Creating drill-down graphs with streamlit-plotly-events
One of the most popular advanced features in any plotting library is the ability to drill down into sections or parts of graphs. The users of your apps will often have questions about your data that you have not anticipated in advance! Instead of creating new Streamlit inputs around graphs, users often will want to click on items in your graphs like points or bars, and get more information about that point. For example, in our penguins scatterplot graph, a user might want to see all the data available for a penguin, which is represented by a point being scrolled over in a DataFrame.
streamlit-plotly-events
turns the unidirectional st.plotly_chart
function into a bidirectional one, where we can receive events like clicks or hovers back into our Streamlit app. To test this out, we will create another app inside the pages
folder, this one called plotly_events
and will create a graph based on the penguins dataset.
To start...