Repository for code and resources for an interactive visualization of CAP LTER ground-dwelling arthropod data
The app is built with Streamlit and Plotly, and uses NLCD-derived land cover to classify sites into Urban, Desert, Agricultural (plus Other/Unknown).
Key files:
streamlit_app.py— main Streamlit dashboard41_core_arthropods.csv— core arthropod dataarthros_temporal.csv— site metadata (including coordinates)site_landuse_from_nlcd.csv— site → landuse mapping derived from NLCDrequirements.txt— Python dependencies
site_code— CAP LTER site identifiersample_date— date of samplingdisplay_name— taxon name (used asTaxa)trap_name— trap type / IDcount— abundance / count per record- (plus observer, comments, flags, etc.)
Contains temporal and spatial metadata for sites, including:
site_codelat,long(or similar latitude / longitude columns)
These are used to map points on the site map.
Generated in R using FedData::get_nlcd() + terra::extract().
site_codelanduse— collapsed NLCD class: Urban, Desert, Agricultural, Other
The dashboard uses landuse as region3.
The Streamlit app provides:
- Sites — multi-select
site_code - Taxa — multi-select (top 100 taxa by total count)
- Year — multi-select years present in the data
All visualizations respond to these filters.
-
Community composition (top 10 taxa × site)
- Stacked bar chart
- X: Site
- Y: Total count
- Colors: Taxa (top 10 per current filter, others grouped as "Other")
-
Quarterly abundance by region
- Grouped bar chart
- X: Region (
Urban,Desert,Agricultural,Other) - Bars: Quarters
Q1–Q4 - Y: Total arthropod counts
-
Site map (bubble size = total counts)
- Mapbox scatter plot
- Points: Site lat/long
- Size: Total counts
- Hover: Site ID, total counts
https://github.com/CAPLTER/arthropods_visualization.git
python -m venv .venv
.venv\Scripts\activate # on Windows
source .venv/bin/activate # on macOS / Linux
pip install -r requirements.txt
streamlit run streamlit_app.py
Streamlit will open a browser tab at : http://localhost:8501
- Push this repo to GitHub
- Go to Streamlit Community Cloud
- Click "New app" and select:
- Repo: your GitHub repo
- Branch: main (or whichever)
- File: streamlit_app.py
- Deploy
You’ll get a URL that can be embedded in WordPress using iframe.