IMERSS / inat-components

A suite of React components for rendering iNaturalist data.
https://imerss.github.io/inat-components/
MIT License
6 stars 1 forks source link

Accept multiple root taxa and/or filter function to fine-tune listed observations #13

Open amb26 opened 1 year ago

amb26 commented 1 year ago

As hosted on https://imerss.github.io/galiano-bioblitz-2023/Molluscs-Reknitted.html# we have a fine display of Molluscs but @chlorophilia has noted that we really need to restrict this to marine taxa as per the project remit. This is not an easy proposition informationally and is currently done in the data workflow by laundry lists like the following: https://github.com/IMERSS/imerss-bioinfo/blob/main/data/dataPaper-I/fusion.json5#L107-L122

What would possibly be most helpful would be if in addition to the root taxon, the app could accept a filter function to exclude any unwanted taxa in a freeform way. I appreciate this would be somewhat complex since it would disrupt the paging functionality which can currently be done at the iNat API level - any ideas?

benkeen commented 1 year ago

Hey! Sorry I still haven't polished off the new version yet. It's very close, I've just had little to no time for any open source work recently due to my day job spilling over to my evenings.

What would possibly be most helpful would be if in addition to the root taxon, the app could accept a filter function to exclude any unwanted taxa in a freeform way. I appreciate this would be somewhat complex since it would disrupt the paging functionality which can currently be done at the iNat API level

Yeah, exactly, that hits the nail on the head. But I think it's certainly doable - for the first 3 tabs at least. I could rig it up to continually request a page of data from the API, apply the filter, then if there still aren't enough items returned, request the next page and so on. That'd work for the first three tabs: recent observations, common taxa + favourites, but I suspect it may not be possible for the fourth "summary" tab. I'd need to re-examine that but my hunch is that that tab won't be feasible.