Skip to content

SeriesChart: CSV download named after the site, layer and variable - #580

Merged
BhattaraiSijan merged 1 commit into
developmentfrom
issue/change-csv-filename
Oct 19, 2026
Merged

BhattaraiSijan merged 1 commit into
developmentfrom
issue/change-csv-filename

Conversation

@BhattaraiSijan

Copy link
Copy Markdown
Collaborator

Summary

From the Air4US review of the station time series: every site's CSV download was named after the variable alone (24-HR_BLK_AVG.csv), so two sites' files could not be told apart and the pollutant was nowhere in the name. The file is now named after the card: title, section heading and variable, Washington_Georgia_Site_1_AQS_Surface_PM2.5_Concentration_24-HR_BLK_AVG.csv. Long, but every part is what the card shows, and on the AQS layers the pollutant only exists in the heading (the variable is the sample duration).

Each part is reduced to word characters, dots and dashes. Names are NFKD-normalized first, so PM₂.₅ survives as PM2.5 rather than PM_._. A missing part is skipped, and so is a part that repeats the one before it: an ungrouped series is labelled with the layer name, which is also the heading, and the file should not say it twice.

What's in the diff

  • SeriesChart/lib/chartData.ts: csvFileName(parts).
  • SeriesChart/lib/components/SeriesChartPanel.tsx: the card builds the name from payload.title, payload.subtitle and the picked series' label and hands it to the footer; downloadCsv takes the name.
  • SeriesChart/README.md.
  • Tests: seriesChartData.spec.js (the three parts with subscripts, missing and repeated parts, accents, fallback).

Testing

  • npm run test:unit green (210 files, 3600 tests) and tsc --noEmit clean.
  • Manual, on the Air4US mission with Air4US_v182_timeseries-title.config.json: click a PM2.5 site in Washington County, GA, press the time series action, Download CSV. Expect Washington_Georgia_Site_1_AQS_Surface_PM2.5_Concentration_24-HR_BLK_AVG.csv (or …_1_HOUR.csv for that variable).

🤖 Generated with Claude Code

@BhattaraiSijan
BhattaraiSijan merged commit bbe2d29 into development Oct 19, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants