Repository navigation
SeriesChart: CSV download named after the site, layer and variable - #580
Merged
Merged
Conversation
sandesh-sp
approved these changes
Oct 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 asPM2.5rather thanPM_._. 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 frompayload.title,payload.subtitleand the picked series' label and hands it to the footer;downloadCsvtakes the name.SeriesChart/README.md.seriesChartData.spec.js(the three parts with subscripts, missing and repeated parts, accents, fallback).Testing
npm run test:unitgreen (210 files, 3600 tests) andtsc --noEmitclean.Air4US_v182_timeseries-title.config.json: click a PM2.5 site in Washington County, GA, press the time series action, Download CSV. ExpectWashington_Georgia_Site_1_AQS_Surface_PM2.5_Concentration_24-HR_BLK_AVG.csv(or…_1_HOUR.csvfor that variable).🤖 Generated with Claude Code