AAhad commited on
Commit
48599fa
·
verified ·
1 Parent(s): 4306dcf

updated logic

Browse files
Files changed (1) hide show
  1. app.py +17 -9
app.py CHANGED
@@ -4,15 +4,23 @@ import plotly.graph_objects as go
4
  import inspect
5
 
6
  @st.experimental_memo
7
- def get_chart_68636849():
8
- import plotly.express as px
9
- import numpy as np
10
- df = px.data.gapminder().query("year == 2007")
11
- fig = px.treemap(df, path=[px.Constant("world"), 'continent', 'country'], values='pop',
12
- color='lifeExp', hover_data=['iso_alpha'],
13
- color_continuous_scale='RdBu',
14
- color_continuous_midpoint=np.average(df['lifeExp'], weights=df['pop']))
15
- fig.update_layout(margin = dict(t=50, l=25, r=25, b=25))
 
 
 
 
 
 
 
 
16
 
17
  tab1, tab2 = st.tabs(["Streamlit theme (default)", "Plotly native theme"])
18
  with tab1:
 
4
  import inspect
5
 
6
  @st.experimental_memo
7
+ def get_chart_8690132():
8
+ import plotly.graph_objects as go
9
+ import pandas as pd
10
+
11
+ df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/96c0bd/sunburst-coffee-flavors-complete.csv')
12
+
13
+ fig = go.Figure(go.Treemap(
14
+ ids = df.ids,
15
+ labels = df.labels,
16
+ parents = df.parents,
17
+ pathbar_textfont_size=15,
18
+ root_color="lightgrey"
19
+ ))
20
+ fig.update_layout(
21
+ uniformtext=dict(minsize=10, mode='hide'),
22
+ margin = dict(t=50, l=25, r=25, b=25)
23
+ )
24
 
25
  tab1, tab2 = st.tabs(["Streamlit theme (default)", "Plotly native theme"])
26
  with tab1: