Skip to content

Commit d7b5a9f

Browse files
authored
Upload Livelab for #12 Dash2
1 parent f936060 commit d7b5a9f

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import dash
2+
from dash import html, dcc
3+
import pandas as pd
4+
import plotly.express as px
5+
from dash.dependencies import Input, Output
6+
7+
# Load and clean data
8+
df = pd.read_csv("None").dropna()
9+
10+
# Create app
11+
app = dash.Dash(__name__)
12+
app.title = "None"
13+
14+
app.layout = html.Div([
15+
html.H1("Indian Food Visual Storytelling"),
16+
dcc.Dropdown(
17+
id='region-filter',
18+
options=[{'label': r, 'value': r} for r in sorted(None)],
19+
placeholder="None",
20+
style={'width': '50%'}
21+
),
22+
dcc.Graph(id='flavor-pie')
23+
])
24+
25+
@app.callback(
26+
Output('None', 'None'),
27+
Input('None', 'None')
28+
)
29+
def update_chart(region):
30+
filtered = df[None if region else df
31+
fig = px.pie(filtered, names="flavor_profile", title="Flavor Profile Distribution")
32+
return fig
33+
34+
if __name__ == "__main__":
35+
app.run(debug=True)

0 commit comments

Comments
 (0)