Penguni commited on
Commit
dcbc569
·
verified ·
1 Parent(s): 4d9b242

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -2
app.py CHANGED
@@ -17,11 +17,20 @@ st.title('Parental Guide Treemaps')
17
  # Split into two columns
18
  col1, col2 = st.columns(2)
19
 
 
 
 
20
  # Add buttons in each column
21
  with col1:
22
  if st.button('Movies'):
23
- st.plotly_chart(create_treemap(df_movies, 'Parental Guide - Movies'))
24
 
25
  with col2:
26
  if st.button('TV Series'):
27
- st.plotly_chart(create_treemap(df_tv_series, 'Parental Guide - TV Series'))
 
 
 
 
 
 
 
17
  # Split into two columns
18
  col1, col2 = st.columns(2)
19
 
20
+ # Initialize variable for selection
21
+ selection = None
22
+
23
  # Add buttons in each column
24
  with col1:
25
  if st.button('Movies'):
26
+ selection = 'Movies'
27
 
28
  with col2:
29
  if st.button('TV Series'):
30
+ selection = 'TV Series'
31
+
32
+ # Display the corresponding treemap in the center
33
+ if selection == 'Movies':
34
+ st.plotly_chart(create_treemap(df_movies, 'Parental Guide - Movies'), use_container_width=True)
35
+ elif selection == 'TV Series':
36
+ st.plotly_chart(create_treemap(df_tv_series, 'Parental Guide - TV Series'), use_container_width=True)