feat(harmonia): native charts for report pages; bump Harmonia 2.1.0 -> 2.3.1#6272
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.reportchart:value), so Velocity emits exactly one native directive per report - no runtime type switching.Changes
pom.xml-harmonia.version2.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 reactivechartConfig; print viaHarmonia.chartToImage(wascanvas.toDataURL).ui/perspective/report-file/index.html.template+report.js.template- the standalone.reportpage: same swap; the imperativerenderChart()becomes a reactivebuildChartConfig(); the per-pagechart.umd<script>is dropped.ui/shell/index.html.template- drop the globalchart.js<script>(native charts ship in the harmonia bundle already loaded by the shell).template/ui/report.js, moduleREADME.md,CLAUDE.md).Scope: the
chart.jswebjar 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:
<div x-ref="chartEl" x-h-chart-bar="chartConfig" class="size-full">(thechart: bar->x-h-chart-barmapping resolves); emittedreport.jscarrieschartConfig/buildChartConfigand nonew Chart; 0chart.umdscripts in the emitted page.index.html+report.jsserve 200;/webjars/codbex__harmonia/dist/harmonia.min.jsserves 200 and the bundle registersh-chart-bar.codbex__harmonia-2.3.1.jar.Not yet exercised: the browser pixel-render of the SVG chart with live rows + the
chartToImageprint path - verified at the emitted-markup + served-resource + bundle-content layers, not a headless-browser render.🤖 Generated with Claude Code