Skip to content

feat(harmonia): native charts for report pages; bump Harmonia 2.1.0 -> 2.3.1#6272

Merged
delchev merged 1 commit into
masterfrom
feat/harmonia-native-charts
Jul 12, 2026
Merged

feat(harmonia): native charts for report pages; bump Harmonia 2.1.0 -> 2.3.1#6272
delchev merged 1 commit into
masterfrom
feat/harmonia-native-charts

Conversation

@delchev

@delchev delchev commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

What

The Harmonia report templates rendered charts with Chart.js. Harmonia now ships its own native, theme-aware, accessible SVG charts (x-h-chart-{bar,line,pie,doughnut,polar-area,radar,scatter}), so this replaces Chart.js in the Harmonia stack with those directives and removes the external chart library from Harmonia-generated apps.

The chart type is a generation-time constant ($layoutType / the .report chart: value), so Velocity emits exactly one native directive per report - no runtime type switching.

Changes

  • pom.xml - harmonia.version 2.1.0 -> 2.3.1 (the webjar ships the native charts + chartToImage/chartToSvg).
  • ui/perspective/report/chart-view.html.template + chart-page.js.template - the in-SPA report chart page: <canvas> + new Chart(...) -> <div x-h-chart-{type}="chartConfig"> bound to a reactive chartConfig; print via Harmonia.chartToImage (was canvas.toDataURL).
  • ui/perspective/report-file/index.html.template + report.js.template - the standalone .report page: same swap; the imperative renderChart() becomes a reactive buildChartConfig(); the per-page chart.umd <script> is dropped.
  • ui/shell/index.html.template - drop the global chart.js <script> (native charts ship in the harmonia bundle already loaded by the shell).
  • Recipe/doc comments (template/ui/report.js, module README.md, CLAUDE.md).

Scope: the chart.js webjar dependency is intentionally kept - the AngularJS report/dashboard stacks still use it. Only the Harmonia stack moves off Chart.js.

Verification

Built the fat jar and ran an isolated instance; drove the full generate pipeline with a minimal chart-report intent:

  • generate 200, model->code 201, publish 200.
  • Emitted report page renders <div x-ref="chartEl" x-h-chart-bar="chartConfig" class="size-full"> (the chart: bar -> x-h-chart-bar mapping resolves); emitted report.js carries chartConfig/buildChartConfig and no new Chart; 0 chart.umd scripts in the emitted page.
  • Report index.html + report.js serve 200; /webjars/codbex__harmonia/dist/harmonia.min.js serves 200 and the bundle registers h-chart-bar.
  • Fat jar bundles codbex__harmonia-2.3.1.jar.

Not yet exercised: the browser pixel-render of the SVG chart with live rows + the chartToImage print path - verified at the emitted-markup + served-resource + bundle-content layers, not a headless-browser render.

🤖 Generated with Claude Code

…a 2.1.0 -> 2.3.1

Replace Chart.js with Harmonia's own native x-h-chart-* SVG charts in the Harmonia
report templates. The chart type is a generation-time constant, so exactly one
directive is emitted per report:

- report chart page (report/chart-view + chart-page): <canvas> + `new Chart` -> the
  native directive bound to a reactive `chartConfig`; print via Harmonia.chartToImage.
- standalone report-file page (report-file/index + report.js): same swap; the
  imperative renderChart() becomes a reactive buildChartConfig(); the per-page
  chart.umd <script> is dropped.
- shell (ui/shell/index): drop the global chart.js <script> (native charts ship in
  the harmonia bundle already loaded by the shell).

Bump harmonia.version 2.1.0 -> 2.3.1 (the webjar ships the native charts +
chartToImage/chartToSvg). The chart.js webjar dependency stays - the AngularJS
report/dashboard stacks still use it.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@delchev delchev merged commit 01eae45 into master Jul 12, 2026
10 checks passed
@delchev delchev deleted the feat/harmonia-native-charts branch July 12, 2026 10:06
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