Would love feedback on my app (Covid Demographics Explorer)!

I just made a few updates to my “Covid Demographics Explorer” app that lets users explore how US counties have changed since Covid: https://census-explorer.streamlit.app/.

I’d appreciate any feedback folks in the community have about how I could make the app better.

This is the only app I’ve made with streamlit, and feel like I don’t have a deep understanding of the framework and different ways to present information in it. I’m wondering if more experienced folks than me have feedback on the layout.

1 Like

Hello, just checked your app.
Maybe a way to improve it, would be to put the “state”, “county”, and “demographic” mutliselect in a st.sidebar ?
And maybe render your graphs in interactive, this way on the right graphs we will have the county corresponding to the dot, in the hover. Because if you want to see the data of one of the dots (so you don’t know in advance the county name), you have to find the county by luck.
Also, maybe the map is a bit little ? You can make the width and height of the map as a selection for the users.
And finally, let the users choose between different colorscales, it’s very usefull for colorblinds people :slight_smile:
Otherwise, I think you did a good job.
Hope it was this kind of return you wanted :slight_smile:

1 Like

Thank you. This is exactly the type of feedback I was looking for. I was not aware of st.sidebar and will look into that!

1 Like

A diverging colormap should work better for the map.

1 Like

@Carla3 @Goyo Thank you both so much for your feedback.

I had a few hours this afternoon and decided to work on this project. I only had time to implement one feature, and decided to change the map scale to be divergent. (@Carla3 FYI I am colorblind so of course I picked a color-blind friendly palette!)

This wound up being much trickier than I expected. Plotly does have support for divergent scales. But if you want the middle color fixed at 0 (which I want, because I’m showing percent change here), then it automatically puts 0 in the middle of the color ramp, with an equal number of values on either side. This is a problem because in my dataset it’s common for there to be just a few negative numbers and lots of positive numbers. So all the dark colors in the color scale simply weren’t appearing in the map.

I had to spend a while with an LLM confirming that there is no easy way to do this, and then writing custom code to handle it. But overall I would say it’s worth it. For starters, the map now highlights much more useful information: minimum values, places where there was no change, and maximum values. For example, here’s a screenshot of the population percent change. I like how, at a glance you can see that most values are around 0, but the negative outlier in Arizona clearly stands out.

Also, because the divergent scale is continuous, it’s easier to compare clusters of counties. For example, New York City is made up of 5 counties, and I often wanted to see if there was a large difference in any of those counties. With the quartile scale you couldn’t really see that. But now you can clearly see that the Bronx had a larger drop than any of the other counties.

If anyone reading this wants to experiment with the feature, the app is here. And if you want to see the commit that made the change, it’s here.

Great work!

If you wanted to make the plots interactive so the user can hover over data points to view additional data points, check out using plotly. There are other graphing libraries that are supported too but I usually go for plotly express and and it works great and is easily integrated into Streamlit using st.plotly_chart.

1 Like

Thank you! A few people have suggested plotly so I just tried to do that port.

It looks like moving the line graph is pretty straight forward.

But unfortunately it looks like plotly doesn’t have a Swarm plot. It looks like they do have a Strip plot, though, which is similar. But there is a subtle difference. In the Swarm plot each point is visible. The graphing library handles pushing each point around so that the resulting image is compact and each point is visible. In the strip plot each point has some random jitter and alpha applied.

I think this can work, but it looks like it might take me a bit to get something I’m happy with. Another nuance is that I’m using both color and size to highlight a specific point.

Thanks again for the suggestion, I think that this change can potentially improve the app quite a bit.

1 Like