Skip to content

SeriesChart: chart-series contract and single-variable chart plugin - #293

Open
BhattaraiSijan wants to merge 7 commits into
developmentfrom
feat/series-chart
Open

SeriesChart: chart-series contract and single-variable chart plugin#293
BhattaraiSijan wants to merge 7 commits into
developmentfrom
feat/series-chart

Conversation

@BhattaraiSijan

@BhattaraiSijan BhattaraiSijan commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds the shared chart-series contract (src/essence/Tools/_shared/types/chartSeries.ts) and SeriesChart, a generic chart panel rendering it. SeriesChart knows nothing about data sources: any plugin listed in its sources tool variable that emits plugin:<id>:seriesLoading/seriesReady/seriesError/seriesCleared gets a chart card per chartId — loading, error, and ready states included. Payloads are treated as untrusted: malformed ones warn and drop rather than crash the panel.

Rendering (ECharts, already a dependency): one variable visible at a time (air-quality-domain convention, e.g. OpenAQ), with the single-select legend as the parameter picker — the y-axis renames to the picked variable's unit. Wheel + slider zoom (slim theme-primary scrubber), reset button in the card header, crosshair tooltips. All time labels are UTC by design: epoch-value axis with our own formatters, since ECharts' native time axis renders viewer-local. All colors route through --theme-* tokens (canvas via a resolved theme object; spec-asserted so literals can't regress in).

The default sources: ["fetch-timeseries"] forward-references the fetcher plugin from the stacked PR — inert until it merges.

Size note: ~360 lines are unit tests and ~230 are styles/config/docs; reviewable logic is ~600 (chartData.ts, panel, adapter).

Merge order

  1. Emit feature:click on the bus for every vector feature click #292 feature:click core event (independent of this one)
  2. this PRdevelopment
  3. FetchTimeseries: feature clicks to chart-series events #294 FetchTimeseries (stacked on this PR)

Testing

Contract guards and option-builder covered by tests/unit/chartSeries.spec.js + tests/unit/seriesChartData.spec.js (UTC handling, single-select legend, unit-named axis, themed scrubber, tooltip formatting). Full unit suite green. Manual recipe lives in the stacked FetchTimeseries PR, which provides the first emitter.

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