File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed
Mod2/LiveLab_DataChallenges Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change 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 )
You can’t perform that action at this time.
0 commit comments