Proof-of-concept web dashboard for the Canadian iMicroSeq Data Portal. It summarizes environmental sequencing data with summary cards, charts, and an interactive sample coverage map, and other interactive plots.
Live site: dashboard.imicroseq-dataportal.ca
| Page | File | Description |
|---|---|---|
| At a Glance | public/index.html |
Hero stats, growth chart, environmental breakdown, Canada coverage map |
| Interactive Dashboard | public/dashboard.html |
Deeper charts (sample breakdown, viral loads, and related views) |
Both pages share public/styles.css and public/app.js. Chart data is loaded from gzip-compressed JSON under public/data/.
public/ Static site (HTML, CSS, JS, images)
app.js Fetches /data/*.json.gz, renders Vega-Lite & Leaflet
data/ Generated JSON (gzip) + static geo assets
cf-worker/ Cloudflare Worker (serves `public/` as assets)
scripts/ Python builders + update_website_data.sh
lib/imicroseq_common.py
data/ Source export (not committed): imicroseq.csv.xz
wrangler.toml Worker name, routes, assets binding
- Node.js 18+ (for Wrangler local dev and deploy)
- Python 3 (to regenerate chart data from the portal export)
-
Install dependencies:
npm install
-
Place the portal CSV export at
data/imicroseq.csv.xz(see Updating data). -
Regenerate JSON assets (if you have the source file):
bash scripts/update_website_data.sh
-
Start the dev server (serves
public/via the Worker):npm run dev
Wrangler prints a local URL (typically
http://localhost:8787). Openindex.htmlordashboard.htmlfrom that origin so/data/*.json.gzpaths resolve correctly.
Chart and summary payloads are built from a single compressed export:
- Input:
data/imicroseq.csv.xz - Output: gzip JSON files in
public/data/
Run all builders in one step:
bash scripts/update_website_data.shIndividual scripts (run from repo root with python3):
| Script | Output |
|---|---|
scripts/build_index_hero_stats.py |
index_hero_stats.json.gz |
scripts/build_index_growth_per_year.py |
index_growth_per_year.json.gz |
scripts/build_index_environmental_breakdown.py |
index_environmental_breakdown.json.gz |
scripts/build_index_sample_coverage_map.py |
index_sample_coverage_map.json.gz |
scripts/build_dashboard_sample_breakdown.py |
dashboard_sample_breakdown.json.gz |
scripts/build_dashboard_viral_loads.py |
dashboard_viral_loads.json.gz |
Static geo files (CAN.geo.json, ProvinceCapitalCoords.csv) live in public/data/ and are not regenerated by these scripts.
Optional R smoothing utilities for viral-load processing are under scripts/smoothing/.
Deploy to Cloudflare Workers (custom domain configured in wrangler.toml):
npm run cf:deployThe Worker serves static assets from public/; no application server is required beyond Cloudflare’s edge.
- Charts: Vega / Vega-Lite via CDN
- Map: Leaflet (index page coverage map)
- Hosting: Cloudflare Workers + Workers Assets