Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -360,4 +360,46 @@ def ridgeline_plot():
|
|
360 |
)
|
361 |
st.altair_chart(chart)
|
362 |
|
363 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
360 |
)
|
361 |
st.altair_chart(chart)
|
362 |
|
363 |
+
def create_sidebar():
|
364 |
+
chart_functions = {
|
365 |
+
'Stacked Bar Chart with Text Overlay': stacked_bar_chart_with_text_overlay,
|
366 |
+
'Bump Chart': bump_chart,
|
367 |
+
'Radial Chart': radial_chart,
|
368 |
+
'Trellis Area Sort Chart': trellis_area_sort_chart,
|
369 |
+
'Wind Vector Map': wind_vector_map,
|
370 |
+
'Table Bubble Plot': table_bubble_plot,
|
371 |
+
'Locations of US Airports': locations_of_us_airports,
|
372 |
+
'Connections Among U.S. Airports Interactive': connections_among_us_airports_interactive,
|
373 |
+
'One Dot Per Zipcode': one_dot_per_zipcode,
|
374 |
+
'Isotype Visualization with Emoji': isotype_visualization_with_emoji,
|
375 |
+
'Binned Heatmap': binned_heatmap,
|
376 |
+
'Facetted Scatterplot with Marginal Histograms': facetted_scatterplot_with_marginal_histograms,
|
377 |
+
'Ridgeline Plot': ridgeline_plot
|
378 |
+
}
|
379 |
+
|
380 |
+
st.sidebar.title('Charts')
|
381 |
+
|
382 |
+
for chart_name, chart_function in chart_functions.items():
|
383 |
+
chart_button = st.sidebar.button(f'{chart_name} {emoji(chart_name)}')
|
384 |
+
if chart_button:
|
385 |
+
chart_function()
|
386 |
+
|
387 |
+
def emoji(chart_name):
|
388 |
+
emojis = {
|
389 |
+
'Stacked Bar Chart with Text Overlay': 'π',
|
390 |
+
'Bump Chart': 'π',
|
391 |
+
'Radial Chart': 'π‘',
|
392 |
+
'Trellis Area Sort Chart': 'π',
|
393 |
+
'Wind Vector Map': 'π¬οΈ',
|
394 |
+
'Table Bubble Plot': 'π¬',
|
395 |
+
'Locations of US Airports': 'βοΈ',
|
396 |
+
'Connections Among U.S. Airports Interactive': 'π«',
|
397 |
+
'One Dot Per Zipcode': 'π',
|
398 |
+
'Isotype Visualization with Emoji': 'π',
|
399 |
+
'Binned Heatmap': 'πΊοΈ',
|
400 |
+
'Facetted Scatterplot with Marginal Histograms': 'π³',
|
401 |
+
'Ridgeline Plot': 'ποΈ'
|
402 |
+
}
|
403 |
+
return emojis.get(chart_name, '')
|
404 |
+
|
405 |
+
create_sidebar()
|