Skip to content

feat: add Doughnut & Combo (Chart.js), Network Graph & Tree (ECharts) templates#26

Open
Chenglong-MS wants to merge 5 commits into
chenglong-ms/new-chart-templatesfrom
chenglong-ms/more-chart-templates
Open

feat: add Doughnut & Combo (Chart.js), Network Graph & Tree (ECharts) templates#26
Chenglong-MS wants to merge 5 commits into
chenglong-ms/new-chart-templatesfrom
chenglong-ms/more-chart-templates

Conversation

@Chenglong-MS

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

Copy link
Copy Markdown
Contributor

Summary

A second batch of commonly-useful chart templates, following the same conventions as the first batch. New gallery items are flagged with * in their labels so they are easy to spot for inspection.

Stacked on top of #25 — base is chenglong-ms/new-chart-templates, so this PR's diff shows only the four new templates. Merge #25 first, then this.

Backend Template Notes
Chart.js Doughnut Chart * pie variant with a hollow centre (cutout); same color/size data model as Pie
Chart.js Combo Chart * dual-axis bars + line; line measure from chartProperties.lineField (or first other numeric field); gracefully degrades to bars when there is only one measure
ECharts Network Graph * node-link from an edge list (x=source, y=target, size=weight); node size encodes degree; deterministic circular layout by default (force-directed available as a property)
ECharts Tree * orthogonal dendrogram from a category hierarchy (colordetailsize); auto-grows vertically with the leaf count

What changed

  • Templates: chartjs/templates/{doughnut,combo}.ts, echarts/templates/{graph,tree}.ts, registered in both template registries.
  • Gallery: new test-data generators + TEST_GENERATORS keys (Chart.js: Doughnut *, Chart.js: Combo *, ECharts: Network Graph *, ECharts: Tree *) and navigation entries with *-flagged labels.
  • Fixtures: hand-named harness fixtures for each template (matching the existing cal_*/bubble_* style).

Verification

Each template was rendered to PNG and visually graded across the gallery generators and a larger stress pass (30-node graph, 24-month combo, 16-slice doughnut, 6×6 tree). One fix applied during review: widened the circular-graph label margins so node labels never clip at the canvas edge.

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

Update — dedicated icons

Replaced the borrowed sidebar icons with purpose-built ones (matching the existing flat blue/grey style): Doughnut (pie with a hollow centre), Combo (bars + trend line), Tree (root branching into leaves / dendrogram) and Network Graph (nodes connected by edges). All rendered and visually verified.

Rebased on the updated #25 (which adds the calendar legend fix and its own icons).

Copilot and others added 4 commits June 12, 2026 15:51
…e (ECharts)

New common chart templates, each flagged with * in gallery labels so they
are easy to spot for inspection:

- Chart.js Doughnut: pie variant with a hollow centre (cutout)
- Chart.js Combo (Bar + Line): dual-axis bars + line, degrades to bars
- ECharts Network Graph: node-link from an edge list; node size = degree;
  deterministic circular layout (force available as a property)
- ECharts Tree: orthogonal dendrogram from a category hierarchy

All four were rendered to PNG and visually graded across dev/gallery
datasets and a larger stress pass; circular-graph label margins were
widened so labels never clip. typecheck/lint/tests/site build all pass.

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

Replace the borrowed sidebar icons for the new templates with
purpose-built ones, matching the existing flat blue/grey icon style:
- Doughnut: pie wedges with a hollow centre
- Combo: bars overlaid with a trend line
- Tree: root branching left-to-right into leaves (dendrogram)
- Network Graph: nodes connected by edges

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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>
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