Download app.py from martinwhy/dash: direct link, hf CLI and curl.
- Browser
- Download file 686 Bytes
-
https://huggingface.co/spaces/martinwhy/dash/resolve/main/app.py
- Command line
-
hf download hf://spaces/martinwhy/dash/app.py
-
curl -L -o app.py https://huggingface.co/spaces/martinwhy/dash/resolve/main/app.py
686 Bytes
| from dash import Dash, html, dcc, callback, Output, Input | |
| import plotly.express as px | |
| import pandas as pd | |
| df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/gapminder_unfiltered.csv') | |
| app = Dash(__name__) | |
| app.layout = html.Div([ | |
| html.H1(children='Title of Dash App', style={'textAlign':'center'}), | |
| dcc.Dropdown(df.country.unique(), 'Canada', id='dropdown-selection'), | |
| dcc.Graph(id='graph-content') | |
| ]) | |
| def update_graph(value): | |
| dff = df[df.country==value] | |
| return px.line(dff, x='year', y='pop') | |
| if __name__ == '__main__': | |
| app.run(debug=True) | |