Spaces:
Running
Running
| import gradio as gr | |
| from modules.share_price_trend import share_price_trend, gradio_interface | |
| examples = [ | |
| ["AAPL,GOOGL,MSFT", 90], | |
| ["SCHD,QQQ", 365] | |
| ] | |
| # Define Gradio components for inputs | |
| stock_codes = gr.Textbox( | |
| label="Stock Codes", | |
| # info="Enter stock codes separated by comma.", | |
| placeholder="e.g., AAPL,GOOGL,MSFT", | |
| value="SCHD,QQQ" | |
| ) | |
| period = gr.Number( | |
| label="Number of Days", | |
| value=365 | |
| ) | |
| # Define output component | |
| input = [stock_codes, period] | |
| output = gr.Plot() | |
| component_rows = [[stock_codes], [period]] | |
| # Define the update function | |
| def update_output(*args): | |
| return gradio_interface(*args) | |