Show and Tell - Dash App exploring soil health/food trade/climate change

I made a Dash app for my graduate capstone project in data viz & analytics. The design is to give folks a chance to explore the importance of soil carbon content for both its ability to support agriculture/population growth, and to offset carbon emissions and mitigate climate change. Grateful for any feedback at all.

https://sustain-our-soil.kathrynhurchla.com/

github repo of production code

Shout out to @adamschroeder who was a great resource for me in making this which is just my 2nd Dash app, plus many solutions from this community that helped with challenges along the way! I had a lot of fun, and looking forward to doing more work in Plotly and Dash!

So far some feedback has been around:

  • Distinguishing map scatter points, using outline or opacity.
  • Giving audience easier connection between their food choices and soil health.

My original design included two dropdowns, where you would first select where you live, then select from a (filtered list of) food you eat, which would then display the soil data on the map for only the countries that export that food to your country. I didn’t get the two datasets–food trade and soil carbon–linked in time, realizing I need to set that up in SQL probably due to their large size and so I went with a simplified version where you just select a country to display. That would definitely be my next plan with this.

Thanks for looking,
Kathy

4 Likes

HI @kmhurchla Kathy,
very cool upgrades to your app. I thought the “Take Your Curiosity a Step Further” part is a great idea, as it encourages others to continue exploring the topic on their own.

One recommendation I have it to add a dcc.Loading to your app, so when people change countries, they understand the info is loading and don’t get the perception that the app is stuck.

Also, when the country is changed in the dropdown, one has to scroll/zoom into that country on the map. Maybe it would be better to zoom out of the map to its original zoom-out state when a selection is made in the dropdown.

1 Like

Hi @kmhurchla

This is awesome - and it’s amazing that it’s only your second Dash app :star_struck:

Your code is very well documented, and I think anyone new to Dash would find it very helpful.

I didn’t know about the humanize package until I saw how you used it here. I’ll definitely be adding this to my future projects!

Here’s a preview for those just passing through:

–

I find the topic very interesting too. Can you say why the Soil Organic Carbon Density is so much higher in Europe than the rest of the world?

3 Likes

@adamschroeder I haven’t tried dcc.loading and will try that, good point!

Also zooming back out would be a good reset when switching, not sure how to go about that and can search the docs. :mag:

I had looked into zooming into the selected country, and recall finding some folks might be working on that but not something that’s possible automatically as is as of now. A reset zoom is a good option though, and also gives a sense of the place in the world.

@AnnMarieW I love love love the Humanize package, and being able to use the custom comments options within the rollovers opened up that possibility which was a hit I think with my project professors and reviewers who are usually like real big on audience and concept and less impressed with the tech build! Humanize is so awesome and looks like they’re even adding additional languages. Would be a great project to contribute to!

One takeaway was I want to better master custom rollover/label capabilities in Dash. And understand why something is possible/works a certain way in a bar chart v. Scatterplot vs. Scattermapbox (where I tried but gave up and just showed Lon/Lat due to deadline). Again, when I show someone outside this group they just want to see a similar level of custom info for points, etc. across chart types but I know enough to judge it’s not that easy.

And I’m glad you appreciate my code documenting, sometimes I think I’m over-commenting but even as notes to my future self it’s really helpful. I am big on using commonly used words not tech lingo as a holdover from data quality work I think🙂

4 Likes

I second @AnnMarieW 's comment about Humanize! Never knew about it until you used it.

4 Likes

So glad to tip y’all off! I found it out of need and way more time searching for solutions than is healthy. I really didn’t like my own past clunky solutions that depended on knowing the range of numbers I was working with (I.e. thousands, billions…). Humanize handles it all fluidly and has a variety of options how to show the numbers.

2 Likes

I also learned about Humanize from you, @kmhurchla
Thanks for sharing.

1 Like

Jumping on the humanize bandwagon, didn’t even know it existed and definitely could have used that yesterday instead of home baking my own -_-
Good stuff!

1 Like