mirror of
https://github.com/aljazceru/Auto-GPT.git
synced 2025-12-28 11:24:30 +01:00
28 lines
710 B
Python
28 lines
710 B
Python
import pandas as pd
|
|
import plotly.express as px
|
|
from dash import Dash, Input, Output, callback, dcc, html
|
|
|
|
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"),
|
|
]
|
|
)
|
|
|
|
|
|
@callback(Output("graph-content", "figure"), Input("dropdown-selection", "value"))
|
|
def update_graph(value):
|
|
dff = df[df.country == value]
|
|
return px.line(dff, x="year", y="pop")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
app.run(debug=True)
|