Penguni commited on
Commit
5317a5e
·
verified ·
1 Parent(s): adb5970

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +22 -22
app.py CHANGED
@@ -165,28 +165,28 @@ selection = col1.button('Movies')
165
  col2.button('TV Series')
166
 
167
  # Displaying charts in a customized layout based on selection
168
- if selection:
169
  st.subheader('Movies')
170
- st.write('<div style="display: flex; flex-direction: row; flex-wrap: wrap;">', unsafe_allow_html=True)
171
- st.write('<div style="flex: 50%; padding: 10px;">')
172
- st.plotly_chart(create_treemap(df_movies, 'Parental Guide - Movies'), use_container_width=True)
173
- st.plotly_chart(create_genre_bar_chart(df_movies, 'Top 10 Genres - Movies'), use_container_width=True)
174
- st.write('</div>')
175
- st.write('<div style="flex: 50%; padding: 10px;">')
176
- st.plotly_chart(create_rating_box_chart(df_movies, 'Rating Distribution - Movies'), use_container_width=True)
177
- st.plotly_chart(create_country_map(df_movies, 'Global Distribution of Movies'), use_container_width=True)
178
- st.write('</div>')
179
- st.write('</div>', unsafe_allow_html=True)
180
 
181
- else:
182
  st.subheader('TV Series')
183
- st.write('<div style="display: flex; flex-direction: row; flex-wrap: wrap;">', unsafe_allow_html=True)
184
- st.write('<div style="flex: 50%; padding: 10px;">')
185
- st.plotly_chart(create_treemap(df_tv_series, 'Parental Guide - TV Series'), use_container_width=True)
186
- st.plotly_chart(create_genre_bar_chart(df_tv_series, 'Top 10 Genres - TV Series'), use_container_width=True)
187
- st.write('</div>')
188
- st.write('<div style="flex: 50%; padding: 10px;">')
189
- st.plotly_chart(create_rating_box_chart(df_tv_series, 'Rating Distribution - TV Series'), use_container_width=True)
190
- st.plotly_chart(create_country_map(df_tv_series, 'Global Distribution of TV Series'), use_container_width=True)
191
- st.write('</div>')
192
- st.write('</div>', unsafe_allow_html=True)
 
165
  col2.button('TV Series')
166
 
167
  # Displaying charts in a customized layout based on selection
168
+ if selection_movies:
169
  st.subheader('Movies')
170
+ col1_1, col1_2 = st.columns(2)
171
+ with col1_1:
172
+ st.plotly_chart(create_treemap(df_movies, 'Parental Guide - Movies'), use_container_width=True)
173
+ with col1_2:
174
+ st.plotly_chart(create_genre_bar_chart(df_movies, 'Top 10 Genres - Movies'), use_container_width=True)
175
+ col2_1, col2_2 = st.columns(2)
176
+ with col2_1:
177
+ st.plotly_chart(create_rating_box_chart(df_movies, 'Rating Distribution - Movies'), use_container_width=True)
178
+ with col2_2:
179
+ st.plotly_chart(create_country_map(df_movies, 'Global Distribution of Movies'), use_container_width=True)
180
 
181
+ elif selection_tv_series:
182
  st.subheader('TV Series')
183
+ col1_1, col1_2 = st.columns(2)
184
+ with col1_1:
185
+ st.plotly_chart(create_treemap(df_tv_series, 'Parental Guide - TV Series'), use_container_width=True)
186
+ with col1_2:
187
+ st.plotly_chart(create_genre_bar_chart(df_tv_series, 'Top 10 Genres - TV Series'), use_container_width=True)
188
+ col2_1, col2_2 = st.columns(2)
189
+ with col2_1:
190
+ st.plotly_chart(create_rating_box_chart(df_tv_series, 'Rating Distribution - TV Series'), use_container_width=True)
191
+ with col2_2:
192
+ st.plotly_chart(create_country_map(df_tv_series, 'Global Distribution of TV Series'), use_container_width=True)