iNat Bar Charts (by @ospreyj)

Goal of the tool:

The goal of this website is to provide Bar Charts (frequency of observations over the course of a year) for specified taxa. It’s inspired by how eBird does the same thing.

Niche it fills in the iNaturalist ecosystem:

You can already find histograms, or, alternatively, the most common taxa, in a given area with iNaturalist. But, as far as I can tell, you usually can’t do those things together, or in a user-friendly way (I don’t want to personally call the API with taxon_ids and place_ids every time! That’s annoying!).

Quoting myself in a previous post, “I think this is useful because I’m quite interested in knowing what to look for in places before I go there. Like, before I go unfamiliar places, I usually spend a week just surfing eBird to know what to look for.”

Maybe it comes down to the fun I had working on this, but I also found that in using it, I learned the common insects in my area, and then I started being able to use that knowledge better in the field. Like, I ID’ed this ant in the field recently and it was mainly because I had been testing the app on common ants. Similarly, I’ve been sorting moths by frequency in September (the current month) and have been ID’ing moths way more easily because of it. Next year, I’m excited to do a “big year” type thing where I continually hide the species I’ve already seen and see how far down on the bar charts I can get.

Anyway, I don’t think this will change the world or anything, but I do think that this sort of thing is important because it’s fun to tick off species and see what’s around and so forth.

Is there a commercial component, or do you plan into include one in the future? Are donations requested? (yes/no, explain):
No, of course not. This is in reality an excuse for me to learn to use an API lolll

What sort of data (if any) does your app collect from its users?:

I don’t store any data, but I will note that I hosted it on Streamlit. Streamlit says that the data isn’t permanently stored, but I don’t know for sure. Really streamlit is just a prettified version of my python script, “translated” into JavaScript/HTML, so it would surprise me if it stored anything permanently.

But I think that’s all moot anyway because the only vaguely personal thing you can input is your username, and in fact you could actually put anyone’s username in there (and I have, to make sure it would work even for people with thousands of observed species), it just calls the API’s life list function. You don’t need to sign in or anything.

Link to your iNaturalist profile:

https://www.inaturalist.org/people/ospreyj

Description:

A website to create bar charts, represented by a heatmap, of the most common taxa in a specific area.

Also I added in all sorts of little fun things that eBird can do, like hiding taxa on your life list, or year list, sorting by frequency in a given month, etc.

The input fields are: Taxon (e.g., spiders, lepidoptera, heteroptera, lemurs, etc.), number of results, what rank you want for results, what time period to sort the results for (Year-round? A specific month?), whether you want pictures, whether you want research-grade observations only (that option is only available if the results rank is species), whether to hide any taxa (e.g., life list, year list), and finally, the place in which you are interested. And then it will just output the bar chart (heatmap), with each cell representing one week!

Most common ants in October:

Frequency of Noctuidae in March v in October

Lepidoptera, but those I’ve already reported in iNat (e.g., Monarch, Tiger Swallowtail) are hidden:

Most common Lepidoptera species in Belize (with pictures so you know what to look for):

Most common families of ray-finned fish in California:

It also outputs a line chart if you prefer to look at these data this way:

(Mammals in Belize)

Discussion questions or areas seeking feedback:

So, if you look at this app, you can pretty clearly tell it was made by an amateur who knows a little python. I mean, the plots are blatantly just made with matplotlib. Of course there’s a lot I could improve.

One of my friends suggested that I make it so that you can select a bounding box, just like in “explore” in iNat itself. Would other people be interested in that?

I’m not 100% sure I have the month markers correct; the histogram data comes as numbers 1-53 (for each of the weeks of the year) and I just kind of had to guess from there. Actually in general I hope the month markers are easy enough to read.

If you use the photos, are they big enough? I tried to come up with a good compromise of good photo size that still fits into the graph; did I get the balance right?

I guess I want to move this off streamlit at some point onto my own website. I’m sure any number of people could do that for me or I could ask ChatGPT to do it, but I don’t want to do it like that because I’m a stubborn little git and I want to learn HTML/JavaScript and make it myself. If you have a nice little tutorial for, like React Aria or something, that would be appreciated!

edit: I just thought about a problem that I didn’t need to consider when it was just my friends and I using the app, which is that the requests from many users at once might get throttled. The script avoids it when it is just one person by sleeping for a second, but it might not work if many people try to use it. If you try it out, tell me if that happens!

Here is the link:
(I guess you could say the app is in a beta-type test phase, before I move it to its own website, which would probably take a couple months)

https://inatbarcharts.streamlit.app/

16 Likes

This is pretty cool. Bar charts are often very useful for understanding occurrence especially of migratory or ephemeral species.

1 Like

This is really cool. I’d love to be able to filter results by annotations - specially Life Stage.

5 Likes

Very cool indeed.

For some less observose taxa, it could be useful to allow coarser binning, e.g., by month.

1 Like

I like it!

One suggestion: cache the data so you don’t need to refetch if the user only changes something like the sort-order. (Unclear if this would work with streamlit, I know nothing about it.)

2 Likes

Great job. I think this is pretty useful. I would like a slider tool to adjust the intensity of the bars and maybe to adjust the display of the graphs. Depending on the output, this can make interpreting the graphs difficult if one taxon is radically more present than the rest.

2 Likes

Wow, awesome suggestions everyone. @a6475 it’s super easy to cache in streamlit and probably if I was an experienced web developer I would have done it to begin with. Nevertheless I’ve implemented it now.

I will get to the other suggestions over the weekend. I’m very happy that so many people seem to enjoy it! I had a lot of fun making it and I always hoped that if I wanted to see this sort of thing, others would too

3 Likes

This is a really great tool! I love the bar chart functionality on ebird (it’s great for planning outings if you want to see certain migratory species) and poking around on this tool it’s really interesting to see some significant seasonality to organisms (I looked at butterfly species and fly species in my county) that I wasn’t consciously thinking about before.

1 Like

is it possible to set the names to scientific?

1 Like

I would like to see both.

Hi everyone,
I’ve implemented basically all the upgrades people suggested! I was going to tag everyone who gave a suggestion but I figured that would be poor form.

Updates:

  • Now when you input a place and taxon, there is a little expandable box with other options you might have meant

  • @tsssss You can now use annotations (and also toggle whether you want observations with those values or without them)

  • You can also use fields (my friend requested one for “gyne(s) present?” for ants). That one you have to input manually though because there are so many fields you could try

  • You can see the results month-by-month

  • @mycogeekyohio Adjusting the graphs was the one I had the hardest time with. The way I eventually settled on was, along with the graphs, it now outputs a little extra options box with options “Maximum value” and “Hide top ___ results.” With that first one you can manually change what number is the maximum value for the heatmap. With the second you can exclude, say, one or two taxa that are way more present. You can input both as either a textbox or a slider.

    As I said, these were the hardest to figure out. It has one bug which is that the slider doesn’t work on mobile. But the textbox still does, and the slider updates with it.

  • @xris @ljazz You can now set names to scientific, common, or both. I wanted to implement that to begin with and then forgot :).

Most of the new settings are now collapsed into a box entitled “Extra Options,” which is my attempt to keep the website looking kinda nice.

Since this stuff is all new I’m not sure I tested every possible input, so it might break if you try some really weird options together. Tell me if you see any bugs! (except the ones you were asking for on the bar chart :grinning_face_with_smiling_eyes:). But overall I hope y’all have fun with this :)

2 Likes

fwiw I think it’s fine to @ mention people who provided suggestions or feedback!

1 Like

Ah! Good to know, thank you! I think I will edit my post with all the updates because I want the ppl who suggested them to know that they can do those things now

1 Like

I totally agree with you! I’d browse iNaturalist observations to get a sense of what’s there, but having the charts can be helpful.


One possible usability refinement: let users past a iNat URL to autofill taxon and places. E.g., on iNat, Dicots in New York, NY, the URL is

https://www.inaturalist.org/observations?place_id=48&taxon_id=47124

The app then accepts the URL and chooses the correspond taxon / places, avoiding typing mistakes.

Very nice tool! Congrats! one suggestion is to show autocomplete for the taxons and places, right now it is not clear what taxon will the app use before I hit enter (sometimes it selects not the taxon I wanted)

Another suggestion is to add a download button so people can download the images.