Skip to content

feat(count-aggregator-ui): improve station comparison charts - #490

Open
pjeweb wants to merge 4 commits into
mainfrom
feat/count-aggregator-compare-chart
Open

pjeweb wants to merge 4 commits into
mainfrom
feat/count-aggregator-compare-chart

Conversation

@pjeweb

@pjeweb pjeweb commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Summary

Improves TimeSeriesChart in @mapsight/count-aggregator-ui when several stations are compared.

  • Compact comparison tooltip (opt-in): new app setting comparisonTooltip: "compact" shows a colour swatch, a short station identifier (originId, or #<id> when ambiguous or long) and the metric per series. Tooltip height and width are bounded on small screens and scroll for long comparisons. Default stays "full"; single-series charts keep full labels in either mode.
  • Dates on intraday ticks: 5-minute, 15-minute and hourly axis ticks include the date when the selected range spans more than one calendar day, and the year when it spans a year boundary. Single-day ranges keep time-only ticks.
  • Breaks at data gaps: mergeSeriesData inserts null rows at the expected resolution step, so line and area charts break at missing buckets instead of joining straight across them. Gaps are omitted from tooltips and never become measurements. Calendar steps (daily through yearly) follow local dates. Expansion is capped at 5,000 rows plus one break marker for each remaining gap. Raw values have no fixed step, so the wizard keeps connecting them. The new breakAtGaps prop (default true) lets direct TimeSeriesChart consumers turn gap breaks off for other irregular series.
  • Duplicate station names: station select, result list and full tooltips disambiguate identical display names using existing metadata: section description, then type name, then origin ID, then numeric ID. When the section description disambiguates, selections and result labels show it as their usual description text, also in selected values that otherwise hide descriptions. The new export buildStationLabels gives custom selectors the same labels.

No future.v8_* defaults changed.

Verification

  • pnpm verify --filter=@mapsight/count-aggregator-ui: lint (one existing warning in result-step.test.tsx), typecheck, 122 tests
  • pnpm --filter @mapsight/count-aggregator-ui build
  • pnpm run check
  • pnpm exec changeset status --since=origin/main
  • Manual check at phone (390px) and desktop widths: tooltip size, multi-day ticks, gap rendering, touch tooltip

Raw values use a 5-minute chart resolution for formatting but have no fixed step, so gap filling would isolate every point. Add a breakAtGaps prop to TimeSeriesChart (default true) and disable it for raw values in the wizard.
@changeset-bot

changeset-bot Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 47d8e85

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@mapsight/count-aggregator-ui Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

🤖 Mapsight review links

Preview for 47d8e85 · Open demos

Suggested starting points from the changed files and their demo consumers:

Screen PR preview Current main Suggested check
Count aggregator wizard Open Compare Search for Example, select a station, choose Next, then check the chart, table and CSV download.
Why these screens?

Count-aggregator demos use local mock data.
These are suggested checks, not a verified reproduction of the issue. Current main can move independently of this PR; new behavior may need the PR author's setup steps.

Updated after successful deployments. The commit above identifies this preview; a newer build may still be running.

Station select and result labels decided whether to hide the section description by rebuilding the formatted label string. Resolve labels into a name plus the disambiguating field instead, and format the string in one place. When the section description disambiguates, show it as the usual description text rather than appending it to the name. buildStationLabels keeps its signature.

This branch was successfully deployed

1 active deployment
preview/pr-490 — 47d8e850 Deployed Nov 20, 2026 by github-actions[bot]
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.

1 participant