Add source example files

This commit is contained in:
2025-07-12 18:43:56 +02:00
parent 11d6846f49
commit d0bcfcf8f1
62 changed files with 40101 additions and 161 deletions

View File

@ -0,0 +1,24 @@
import dash
import pandas as pd
from dash import Dash, html, dash_table, dcc
from plotly.express import line
data = pd.read_excel("france-communes.xlsx")
dept = data.groupby("departement").sum("population")
app = Dash("demo")
app.layout = html.Div(children=[
html.H1(children="Dashboard"),
dash_table.DataTable(data=data.to_dict("records"), page_size=10),
dcc.Graph(id="dept-population", figure=line(dept, x=None, y="population")),
dcc.Dropdown(id="color-select", options=["#ff0000", "#00ff00"])
])
@app.callback(dash.Output("dept-population", "figure"), dash.Input("color-select", "value"))
def update_dept_population(color):
return line(dept, x=None, y="population", color_discrete_sequence=[color])
if __name__ == '__main__':
app.run(debug=True)