Skip to content

feat: add Bubble (Chart.js), Calendar Heatmap & Parallel Coordinates (ECharts) templates#25

Merged
Chenglong-MS merged 4 commits into
mainfrom
chenglong-ms/new-chart-templates
Jun 12, 2026
Merged

feat: add Bubble (Chart.js), Calendar Heatmap & Parallel Coordinates (ECharts) templates#25
Chenglong-MS merged 4 commits into
mainfrom
chenglong-ms/new-chart-templates

Conversation

@Chenglong-MS

@Chenglong-MS Chenglong-MS commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds three new, commonly useful chart templates following existing template conventions. New gallery items are flagged with * in their labels so they are easy to spot for inspection.

Backend Template Notes
Chart.js Bubble Chart * native bubble type; size channel → area-proportional, density-aware radius; optional color grouping + legend
ECharts Calendar Heatmap * calendar coordinate + heatmap series + continuous visualMap; auto-sizes canvas from the date range
ECharts Parallel Coordinates * parallel coordinate, one axis per numeric dimension; optional categorical color; line opacity eases with row count

What changed

  • Templates: chartjs/templates/bubble.ts, echarts/templates/calendar.ts, echarts/templates/parallel.ts, registered in both template registries.
  • Gallery: new test-data generators + TEST_GENERATORS keys (Chart.js: Bubble *, ECharts: Calendar Heatmap *, ECharts: Parallel Coordinates *) and navigation entries with *-flagged labels.
  • Verification tooling: a new Chart.js offline render harness (recursive/chartjs-testing) mirroring the ECharts one, plus a generator→harness converter (recursive/gen_gallery_cases.mts).

Verification

Each template was rendered to PNG and visually graded across small dev datasets and the actual gallery generators, then iterated (e.g. density-aware bubble radius; legend/axis-name spacing on parallel coords).

  • npm run typecheck
  • npm run lint ✅ (0 errors)
  • npm run test ✅ 51/51
  • npm run site:build

Update — calendar legend fix + dedicated icons

  • Fix: in the gallery the calendar visualMap runs with calculable on, so it also draws value labels + drag handles above the colour bar. The reserved bottom band (46px) was too small and the labels rode up into the last weekday row. Widened the band to 70px so the legend sits cleanly below the calendar (verified by re-rendering with calculable enabled).
  • Icons: added purpose-built sidebar icons (matching the existing flat blue/grey style) for Bubble (sized scatter circles), Calendar Heatmap (intensity day-grid) and Parallel Coordinates (crossed axes), replacing the borrowed ones.

…oordinates (ECharts)

Add three new, commonly useful chart templates following existing template
conventions. New gallery items are flagged with "*" so they are easy to spot
for inspection.

New templates
- Chart.js Bubble Chart: native `bubble` type; the `size` channel maps to an
  area-proportional, density-aware pixel radius; optional `color` grouping with
  a right-hand legend.
- ECharts Calendar Heatmap: `calendar` coordinate + `heatmap` series with a
  continuous visualMap; auto-sizes the canvas from the date range (quarter,
  full year, multi-year).
- ECharts Parallel Coordinates: `parallel` coordinate with one axis per numeric
  dimension; optional categorical color grouping; opacity eases with row count
  to avoid a hairball.

Wiring
- Register templates in the chartjs/echarts template registries.
- Add gallery test-data generators and TEST_GENERATORS keys
  ("Chart.js: Bubble *", "ECharts: Calendar Heatmap *",
  "ECharts: Parallel Coordinates *").
- Add gallery navigation entries (labels flagged with "*").

Verification tooling
- Add a Chart.js offline render harness (recursive/chartjs-testing) mirroring
  the ECharts one, plus a generator->harness converter
  (recursive/gen_gallery_cases.mts). Each template was rendered to PNG and
  visually graded across dev + gallery datasets, then iterated.

typecheck, lint (0 errors), 51/51 tests and site build all pass.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot and others added 2 commits June 12, 2026 17:02
- Calendar Heatmap: in the gallery the continuous visualMap has
  calculable on, so it also draws value labels and drag handles above
  the colour bar. The reserved bottom band (46px) was too small and the
  labels rode up into the last weekday row. Widen the band to 70px so
  the legend sits cleanly below the calendar.
- Add purpose-built sidebar icons for the new gallery items instead of
  borrowing existing ones: Bubble (sized scatter circles), Calendar
  Heatmap (intensity day-grid) and Parallel Coordinates (crossed axes).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ipping

Issues found while grading rendered gallery output:

- Parallel Coordinates: ECharts derives each parallelAxis range from only
  the first series, so with grouped data (e.g. Cars by Origin) any group
  whose values exceed the first group's max overflowed above the top axis
  label (USA MPG max 30 clipped Japan's 37.7). Compute each axis range
  across all rows and set explicit nice min/max so every line stays within
  the labelled domain and each axis uses its full height.

- Bubble: large bubbles sitting at the data extremes were clipped by the
  plot edge, and the forced zero baseline compressed all points into the
  upper half. Scale to the data extent with 10% grace padding on both axes
  (dropping the forced beginAtZero) so nothing clips and bubbles spread out.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@Chenglong-MS

Copy link
Copy Markdown
Contributor Author

Grading pass — rendered all * charts & fixed two issues

Re-generated the gallery cases for every new template, rendered them to PNG and graded each image. Two real issues surfaced (both fixed in 405fe7e):

  • Parallel Coordinates (Cars by Origin): the first MPG line exceeded the labelled axis domain. ECharts derives each parallelAxis range from only the first series, so USA (MPG max 29.7 → axis capped at 30) clipped Europe/Japan lines (up to 37.7) above the top label. Now each axis range is computed across all rows with tidy nice min/max, so every line stays within the labelled domain and each axis uses its full height.
  • Bubble: large bubbles at the data extremes were clipped by the plot edge, and the forced zero baseline squashed all points into the upper half. Now scales to the data extent with 10% grace padding on both axes — no clipping, points well spread.

Calendar/Parallel/Bubble: ✅ after fixes. (Tree, Network Graph, Combo, Doughnut graded clean in #26.) typecheck/lint/tests/site-build all pass.

Chenglong-MS pushed a commit that referenced this pull request Jun 12, 2026
…etwork, Doughnut, Combo) into main

Merges the chenglong-ms/more-chart-templates stack (PRs #25/#26) so the new
chart templates and the photo-wall gallery advance together on main.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@Chenglong-MS Chenglong-MS merged commit 1c5de16 into main Jun 12, 2026
7 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.

1 participant