@mantha911/ng-echarts 0.1.0-rc.23 → 0.1.0-rc.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +8 -2
  3. package/fesm2022/mantha911-ng-echarts-area-area-renderer-BLNN_Sjy.mjs +14 -0
  4. package/fesm2022/mantha911-ng-echarts-area-area-renderer-BLNN_Sjy.mjs.map +1 -0
  5. package/fesm2022/mantha911-ng-echarts-area.mjs +3 -3
  6. package/fesm2022/mantha911-ng-echarts-area.mjs.map +1 -1
  7. package/fesm2022/mantha911-ng-echarts-bar.mjs +2 -2
  8. package/fesm2022/mantha911-ng-echarts-bar.mjs.map +1 -1
  9. package/fesm2022/mantha911-ng-echarts-composed-composed-renderer-CSFZOsup.mjs +15 -0
  10. package/fesm2022/mantha911-ng-echarts-composed-composed-renderer-CSFZOsup.mjs.map +1 -0
  11. package/fesm2022/mantha911-ng-echarts-composed.mjs +132 -26
  12. package/fesm2022/mantha911-ng-echarts-composed.mjs.map +1 -1
  13. package/fesm2022/mantha911-ng-echarts-core.mjs +42 -11
  14. package/fesm2022/mantha911-ng-echarts-core.mjs.map +1 -1
  15. package/fesm2022/mantha911-ng-echarts-line-line-renderer-BT437KP_.mjs +14 -0
  16. package/fesm2022/mantha911-ng-echarts-line-line-renderer-BT437KP_.mjs.map +1 -0
  17. package/fesm2022/mantha911-ng-echarts-line.mjs +3 -3
  18. package/fesm2022/mantha911-ng-echarts-line.mjs.map +1 -1
  19. package/package.json +1 -1
  20. package/types/mantha911-ng-echarts-composed.d.ts +37 -13
  21. package/types/mantha911-ng-echarts-core.d.ts +16 -8
  22. package/types/mantha911-ng-echarts.d.ts +2 -2
  23. package/fesm2022/mantha911-ng-echarts-area-area-renderer-DQmIKv7N.mjs +0 -37
  24. package/fesm2022/mantha911-ng-echarts-area-area-renderer-DQmIKv7N.mjs.map +0 -1
  25. package/fesm2022/mantha911-ng-echarts-composed-composed-renderer-pWJ8mx0q.mjs +0 -40
  26. package/fesm2022/mantha911-ng-echarts-composed-composed-renderer-pWJ8mx0q.mjs.map +0 -1
  27. package/fesm2022/mantha911-ng-echarts-line-line-renderer-DbAVCM71.mjs +0 -37
  28. package/fesm2022/mantha911-ng-echarts-line-line-renderer-DbAVCM71.mjs.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.0-rc.24 — Explicit composed value axes
4
+
5
+ - Add opt-in one/two labeled linear value axes, axis-ID series assignment and independent numeric formatting for ticks, tooltips and native actions. Keep raw observations and reject named stacks spanning axes.
6
+ - Export explicit composed layout/axis types and annotate configuration declarations for reproducible clean builds.
7
+ - Share curve-renderer coordination across line, area and composed entries without eager engine imports or higher package budgets. Preserve both rc.23 archives and all earlier candidates. Human release gates remain pending.
8
+
3
9
  ## 0.1.0-rc.23 — Horizontal composition
4
10
 
5
11
  - Add opt-in horizontal bar/line/area composition on one comparable-unit scale, with supplied-order categories, separate signed stacks, rotated bar caps and area gradients.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Angular chart library
2
2
 
3
- Experimental standalone Angular 22 components using Apache ECharts. Public prerelease identity: `@mantha911/ng-echarts`. Current candidate: `0.1.0-rc.23`. Public prereleases use the `next` tag; consult the repository publication record for the current registry version. Original library code is MIT licensed; preserve `LICENSE`, `THIRD_PARTY_NOTICES.md`, and the `third-party/` notices. The API is experimental; human screen-reader interpretation remains unreviewed at the user’s request.
3
+ Experimental standalone Angular 22 components using Apache ECharts. Public prerelease identity: `@mantha911/ng-echarts`. Current candidate: `0.1.0-rc.24`. Public prereleases use the `next` tag; consult the repository publication record for the current registry version. Original library code is MIT licensed; preserve `LICENSE`, `THIRD_PARTY_NOTICES.md`, and the `third-party/` notices. The API is experimental; human screen-reader interpretation remains unreviewed at the user’s request.
4
4
 
5
5
  ## Installation
6
6
 
@@ -13,7 +13,7 @@ npm install @mantha911/ng-echarts@next echarts@6.1.0
13
13
  For a retained exact local candidate:
14
14
 
15
15
  ```sh
16
- npm install /absolute/path/to/mantha911-ng-echarts-0.1.0-rc.23.tgz echarts@6.1.0
16
+ npm install /absolute/path/to/mantha911-ng-echarts-0.1.0-rc.24.tgz echarts@6.1.0
17
17
  ```
18
18
 
19
19
  Retain the tarball at the lockfile's recorded path, or store it in the consumer's `vendor/` directory. Commit the lockfile and use `npm ci` for repeat installs. Repack and reinstall to consume source changes. Table pagination is available since rc.19. Named composed bar stacks require rc.20 or later. Composed areas require rc.22 or later. Horizontal composed layout requires rc.23. The exact local candidate includes these features; a registry install must resolve a version containing the features you use.
@@ -154,3 +154,9 @@ Bar, line, area, composed and pie accept `[tablePageSize]="50"`. The default `nu
154
154
  ## Horizontal composition in rc.23
155
155
 
156
156
  Set `layout="horizontal"` on `ComposedChart` for a numeric x-axis and top-to-bottom supplied categories on the y-axis. The default remains `vertical`. Bars, lines and areas share one comparable-unit scale; named bar/area stacks remain separate. Raw plot/table actions, missing observations, legends and updates follow the same contract in both layouts. Whole-line/area hits resolve along the active category axis. No additional renderer module or dependency is required. Dual axes remain outside this contract. The rc.23 source candidate is separate from the published rc.22 baseline; preserve every previous archive.
157
+
158
+ ## Independent composed value axes in rc.24
159
+
160
+ Set `valueAxes` to one or two `ComposedValueAxis` descriptors, each with a unique nonempty `id`, `label` and `unit`. Assign measures with `series.axisId`; omission uses the first axis. Each axis accepts its own `numberFormatOptions` or `valueFormatter`, using the shared locale. With explicit axes, shared number-format options/formatter are replaced by the axis settings. Native scale descriptions, legends, tables and tooltip labels identify units and axis positions. Vertical layout uses left/right value axes; horizontal uses bottom/top. Equal screen heights on independent scales do not imply equal quantities.
161
+
162
+ A named stack within one geometry must use one axis; unknown axis IDs, invalid descriptors and cross-axis stacks produce configuration errors. Raw point events retain source numbers (a 12% formatted fraction still emits `0.12`); missing observations stay missing and zero stays observed. `valueAxes: null` retains the existing shared-scale contract. No raw ECharts options or new engine module is exposed. npm rc.23 supplies horizontal composition; this new API requires the rc.24 source candidate until separately published.
@@ -0,0 +1,14 @@
1
+ import { ɵcreateCurveRenderer } from "@mantha911/ng-echarts/core";
2
+ import "echarts/lib/chart/line";
3
+ import { GridComponent, TooltipComponent } from "echarts/components";
4
+ import { init, use } from "echarts/core";
5
+ import { CanvasRenderer } from "echarts/renderers";
6
+ use([
7
+ GridComponent,
8
+ TooltipComponent,
9
+ CanvasRenderer
10
+ ]);
11
+ const createAreaRenderer = (host, onPoint) => ɵcreateCurveRenderer(init(host, void 0, { renderer: "canvas" }), onPoint);
12
+ export { createAreaRenderer };
13
+
14
+ //# sourceMappingURL=mantha911-ng-echarts-area-area-renderer-BLNN_Sjy.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mantha911-ng-echarts-area-area-renderer-BLNN_Sjy.mjs","names":[],"sources":["../../../projects/chart-library/area/src/lib/area-renderer.ts"],"sourcesContent":["// Use exported per-chart entries to preserve independent lazy engine chunks.\nimport 'echarts/lib/chart/line';\nimport { GridComponent, TooltipComponent } from 'echarts/components';\nimport { init, use } from 'echarts/core';\nimport { CanvasRenderer } from 'echarts/renderers';\nimport { ɵcreateCurveRenderer, type ɵPlotRendererFactory } from '@mantha911/ng-echarts/core';\nimport type { AreaOption } from './area-options';\nuse([GridComponent, TooltipComponent, CanvasRenderer]);\nexport const createAreaRenderer: ɵPlotRendererFactory<AreaOption> = (host, onPoint) =>\n ɵcreateCurveRenderer<AreaOption>(init(host, undefined, { renderer: 'canvas' }), onPoint);\n"],"mappings":";;;;;AAOA,IAAI;CAAC;CAAe;CAAkB;AAAc,CAAC;AACrD,MAAa,sBAAwD,MAAM,YACzE,qBAAiC,KAAK,MAAM,QAAW,EAAE,UAAU,SAAQ,CAAE,GAAG,OAAO"}
@@ -3,7 +3,7 @@ import { ChangeDetectionStrategy, Component, InjectionToken, inject, input } fro
3
3
  import { ChartFrame, ɵCartesianChart, ɵChartStage, ɵTablePager, ɵbuildAreaFill, ɵbuildCurveOptions } from "@mantha911/ng-echarts/core";
4
4
  const AREA_RENDERER_LOADER = new InjectionToken("Area renderer loader", {
5
5
  providedIn: "root",
6
- factory: () => () => import("./mantha911-ng-echarts-area-area-renderer-DQmIKv7N.mjs").then((module) => module.createAreaRenderer)
6
+ factory: () => () => import("./mantha911-ng-echarts-area-area-renderer-BLNN_Sjy.mjs").then((module) => module.createAreaRenderer)
7
7
  });
8
8
  function buildAreaOptions(context, smooth, showPoints, stacked, gradient) {
9
9
  const options = ɵbuildCurveOptions(context, smooth, showPoints);
@@ -91,7 +91,7 @@ var AreaChart = class AreaChart extends ɵCartesianChart {
91
91
  },
92
92
  usesInheritance: true,
93
93
  ngImport: i0,
94
- template: "<nec-chart-frame\n [title]=\"title()\"\n [description]=\"description()\"\n [style.--_nec-default-background]=\"tokens().background\"\n [style.--_nec-default-text]=\"tokens().text\"\n [style.--_nec-default-muted]=\"tokens().muted\"\n [style.--_nec-default-border]=\"tokens().border\"\n>\n @let currentState = state();\n\n <nec-chart-stage\n [state]=\"currentState\"\n [height]=\"plotHeight()\"\n [retryable]=\"rendererError()\"\n (retry)=\"retryRenderer()\"\n >\n <div\n #plot\n class=\"plot\"\n [hidden]=\"currentState.kind !== 'ready'\"\n [style.height.px]=\"plotHeight()\"\n aria-hidden=\"true\"\n ></div>\n\n @if (currentState.kind === 'ready' && allSeriesHidden()) {\n <div class=\"plot-message\" role=\"status\">\n <span>All series are hidden. Choose a series below.</span>\n </div>\n }\n </nec-chart-stage>\n <div\n class=\"chart-controls\"\n [attr.inert]=\"currentState.kind !== 'ready' ? '' : null\"\n [attr.aria-hidden]=\"currentState.kind !== 'ready' ? 'true' : null\"\n >\n <div class=\"legend\" aria-label=\"Chart series\">\n @for (item of legendItems(); track item.id) {\n <button\n type=\"button\"\n [disabled]=\"currentState.kind !== 'ready'\"\n [attr.aria-pressed]=\"item.visible\"\n (click)=\"toggleSeries(item.id)\"\n >\n <span class=\"swatch\" [style.background]=\"item.color\" aria-hidden=\"true\"></span>\n {{ item.label }}\n <span class=\"visibility\" [class.legend-note]=\"false\">{{\n item.visible ? 'Visible' : 'Hidden'\n }}</span>\n </button>\n }\n </div>\n @if (showDataTable()) {\n <button\n type=\"button\"\n class=\"table-toggle\"\n [disabled]=\"currentState.kind !== 'ready'\"\n [attr.aria-expanded]=\"tableExpanded()\"\n (click)=\"toggleTable()\"\n >\n {{ tableExpanded() ? 'Hide data table' : 'Show data table' }}\n </button>\n @if (tableExpanded() && currentState.kind === 'ready') {\n <nec-table-pager [pagination]=\"tablePagination\" [label]=\"title()\" />\n <div\n class=\"table-scroll\"\n tabindex=\"0\"\n role=\"region\"\n [attr.aria-label]=\"title() + ' data table'\"\n >\n <table>\n <caption>\n {{\n title()\n }}\n values\n </caption>\n <thead>\n <tr>\n <th scope=\"col\">Category</th>\n @for (item of legendItems(); track item.id) {\n <th scope=\"col\">{{ item.label }}</th>\n }\n </tr>\n </thead>\n <tbody>\n @for (row of tableRows(); track row.id) {\n <tr\n [class.selected-row]=\"row.selected\"\n [attr.aria-current]=\"row.current ? 'true' : null\"\n >\n <th scope=\"row\">\n {{ row.category }}\n @if (row.selected) {\n <span class=\"selection-label\">Selected</span>\n }\n </th>\n @for (cell of row.cells; track cell.seriesId) {\n <td>\n @if (cell.value !== null) {\n <button\n type=\"button\"\n [attr.aria-label]=\"cell.actionLabel\"\n [attr.data-preview-row]=\"row.id\"\n [attr.data-preview-series]=\"cell.seriesId\"\n (click)=\"selectPoint(cell, 'table')\"\n >\n {{ cell.text }}\n </button>\n } @else {\n <span>{{ cell.text }}</span>\n }\n </td>\n }\n </tr>\n }\n </tbody>\n </table>\n </div>\n }\n }\n </div>\n</nec-chart-frame>\n",
94
+ template: "<nec-chart-frame\n [title]=\"title()\"\n [description]=\"description()\"\n [style.--_nec-default-background]=\"tokens().background\"\n [style.--_nec-default-text]=\"tokens().text\"\n [style.--_nec-default-muted]=\"tokens().muted\"\n [style.--_nec-default-border]=\"tokens().border\"\n>\n @let currentState = state();\n @if (valueAxisDescription()) {\n <p class=\"scale-context\">{{ valueAxisDescription() }}</p>\n }\n\n <nec-chart-stage\n [state]=\"currentState\"\n [height]=\"plotHeight()\"\n [retryable]=\"rendererError()\"\n (retry)=\"retryRenderer()\"\n >\n <div\n #plot\n class=\"plot\"\n [hidden]=\"currentState.kind !== 'ready'\"\n [style.height.px]=\"plotHeight()\"\n aria-hidden=\"true\"\n ></div>\n\n @if (currentState.kind === 'ready' && allSeriesHidden()) {\n <div class=\"plot-message\" role=\"status\">\n <span>All series are hidden. Choose a series below.</span>\n </div>\n }\n </nec-chart-stage>\n <div\n class=\"chart-controls\"\n [attr.inert]=\"currentState.kind !== 'ready' ? '' : null\"\n [attr.aria-hidden]=\"currentState.kind !== 'ready' ? 'true' : null\"\n >\n <div class=\"legend\" aria-label=\"Chart series\">\n @for (item of legendItems(); track item.id) {\n <button\n type=\"button\"\n [disabled]=\"currentState.kind !== 'ready'\"\n [attr.aria-pressed]=\"item.visible\"\n (click)=\"toggleSeries(item.id)\"\n >\n <span class=\"swatch\" [style.background]=\"item.color\" aria-hidden=\"true\"></span>\n {{ item.label }}\n <span class=\"visibility\" [class.legend-note]=\"false\">{{\n item.visible ? 'Visible' : 'Hidden'\n }}</span>\n </button>\n }\n </div>\n @if (showDataTable()) {\n <button\n type=\"button\"\n class=\"table-toggle\"\n [disabled]=\"currentState.kind !== 'ready'\"\n [attr.aria-expanded]=\"tableExpanded()\"\n (click)=\"toggleTable()\"\n >\n {{ tableExpanded() ? 'Hide data table' : 'Show data table' }}\n </button>\n @if (tableExpanded() && currentState.kind === 'ready') {\n <nec-table-pager [pagination]=\"tablePagination\" [label]=\"title()\" />\n <div\n class=\"table-scroll\"\n tabindex=\"0\"\n role=\"region\"\n [attr.aria-label]=\"title() + ' data table'\"\n >\n <table>\n <caption>\n {{\n title()\n }}\n values\n </caption>\n <thead>\n <tr>\n <th scope=\"col\">Category</th>\n @for (item of legendItems(); track item.id) {\n <th scope=\"col\">{{ item.label }}</th>\n }\n </tr>\n </thead>\n <tbody>\n @for (row of tableRows(); track row.id) {\n <tr\n [class.selected-row]=\"row.selected\"\n [attr.aria-current]=\"row.current ? 'true' : null\"\n >\n <th scope=\"row\">\n {{ row.category }}\n @if (row.selected) {\n <span class=\"selection-label\">Selected</span>\n }\n </th>\n @for (cell of row.cells; track cell.seriesId) {\n <td>\n @if (cell.value !== null) {\n <button\n type=\"button\"\n [attr.aria-label]=\"cell.actionLabel\"\n [attr.data-preview-row]=\"row.id\"\n [attr.data-preview-series]=\"cell.seriesId\"\n (click)=\"selectPoint(cell, 'table')\"\n >\n {{ cell.text }}\n </button>\n } @else {\n <span>{{ cell.text }}</span>\n }\n </td>\n }\n </tr>\n }\n </tbody>\n </table>\n </div>\n }\n }\n </div>\n</nec-chart-frame>\n",
95
95
  styles: [":host{display:block;min-width:0}.plot{width:100%}.plot[hidden]{display:none}.legend{display:flex;flex-wrap:wrap;gap:.5rem;margin:1rem 0}button{padding:.5rem .75rem;border:1px solid var(--nec-border, #d6dce5);border-radius:.375rem;color:inherit;background:transparent;font:inherit;cursor:pointer}button:focus-visible,.table-scroll:focus-visible{outline:3px solid var(--nec-focus, #648dff);outline-offset:3px}.swatch{display:inline-block;width:.75rem;height:.75rem;border-radius:.125rem;margin-right:.375rem}.visibility{margin-left:.5rem;font-size:.75rem}.table-toggle{margin:.25rem 0}.table-scroll{overflow-x:auto;margin-top:1rem}table{width:100%;border-collapse:collapse;font-variant-numeric:tabular-nums;text-align:left}caption{padding:.5rem;text-align:left;font-weight:600}th,td{padding:.5rem;border-bottom:1px solid var(--nec-border, #d6dce5)}td{white-space:nowrap}.selected-row{background:color-mix(in srgb,var(--nec-text, #18202c) 5%,transparent)}.selected-row th{box-shadow:inset 2px 0 var(--nec-text, #18202c)}.selection-label{display:block;margin-top:2px;color:var(--nec-muted, #536176);font-size:.6875rem;font-weight:500}.legend button{position:relative;display:inline-flex;align-items:center;gap:6px}.legend button:hover{background:color-mix(in srgb,var(--nec-text, #18202c) 4%,transparent)}.legend button[aria-pressed=false]{border-style:dashed;color:var(--nec-muted, #536176)}.legend button[aria-pressed=false] .swatch{opacity:.35}.pie-legend{display:grid;grid-template-columns:repeat(auto-fit,minmax(108px,1fr));gap:8px}.pie-legend button{display:grid;grid-template-columns:8px minmax(0,1fr);gap:2px 6px;padding:8px 10px;min-width:0;text-align:left}.legend-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.legend-values{grid-column:2;display:flex;justify-content:space-between;gap:6px;font-size:11px;font-variant-numeric:tabular-nums;color:var(--nec-muted, #536176)}.donut-total{position:absolute;inset:0;margin:auto;width:min(36%,140px);height:fit-content;text-align:center;pointer-events:none}.donut-total strong{display:block;font-size:clamp(18px,3vw,26px);line-height:1.25;font-weight:600;letter-spacing:-.5px;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}.donut-total span{display:block;margin-top:4px;font-size:11px;line-height:16px;color:var(--nec-muted, #536176);overflow-wrap:anywhere}@media(max-width:600px){.pie-legend{grid-template-columns:repeat(2,minmax(0,1fr))}}.legend-values{flex-wrap:wrap;min-width:0}.legend-values>span{min-width:0;overflow-wrap:anywhere}.donut-total strong,.donut-total span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}\n", ".chart-controls{min-height:52px}.chart-controls[inert]{visibility:hidden;pointer-events:none}.plot-message{position:absolute;inset:0;display:grid;align-content:center;justify-items:center;padding:20px;margin:0;box-sizing:border-box;text-align:center;color:var(--nec-muted, #536176);font-size:13px;line-height:1.6;pointer-events:none}.visibility:not(.legend-note){position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}.scale-context{margin:0 0 8px;color:var(--nec-muted, #536176);font-size:12px;line-height:20px}.plot-message>span{max-width:34ch;padding:10px 12px;border-radius:6px;background:var(--nec-background, #fff)}\n"],
96
96
  dependencies: [
97
97
  {
@@ -137,7 +137,7 @@ i0.ɵɵngDeclareClassMetadata({
137
137
  ɵTablePager
138
138
  ],
139
139
  changeDetection: ChangeDetectionStrategy.OnPush,
140
- template: "<nec-chart-frame\n [title]=\"title()\"\n [description]=\"description()\"\n [style.--_nec-default-background]=\"tokens().background\"\n [style.--_nec-default-text]=\"tokens().text\"\n [style.--_nec-default-muted]=\"tokens().muted\"\n [style.--_nec-default-border]=\"tokens().border\"\n>\n @let currentState = state();\n\n <nec-chart-stage\n [state]=\"currentState\"\n [height]=\"plotHeight()\"\n [retryable]=\"rendererError()\"\n (retry)=\"retryRenderer()\"\n >\n <div\n #plot\n class=\"plot\"\n [hidden]=\"currentState.kind !== 'ready'\"\n [style.height.px]=\"plotHeight()\"\n aria-hidden=\"true\"\n ></div>\n\n @if (currentState.kind === 'ready' && allSeriesHidden()) {\n <div class=\"plot-message\" role=\"status\">\n <span>All series are hidden. Choose a series below.</span>\n </div>\n }\n </nec-chart-stage>\n <div\n class=\"chart-controls\"\n [attr.inert]=\"currentState.kind !== 'ready' ? '' : null\"\n [attr.aria-hidden]=\"currentState.kind !== 'ready' ? 'true' : null\"\n >\n <div class=\"legend\" aria-label=\"Chart series\">\n @for (item of legendItems(); track item.id) {\n <button\n type=\"button\"\n [disabled]=\"currentState.kind !== 'ready'\"\n [attr.aria-pressed]=\"item.visible\"\n (click)=\"toggleSeries(item.id)\"\n >\n <span class=\"swatch\" [style.background]=\"item.color\" aria-hidden=\"true\"></span>\n {{ item.label }}\n <span class=\"visibility\" [class.legend-note]=\"false\">{{\n item.visible ? 'Visible' : 'Hidden'\n }}</span>\n </button>\n }\n </div>\n @if (showDataTable()) {\n <button\n type=\"button\"\n class=\"table-toggle\"\n [disabled]=\"currentState.kind !== 'ready'\"\n [attr.aria-expanded]=\"tableExpanded()\"\n (click)=\"toggleTable()\"\n >\n {{ tableExpanded() ? 'Hide data table' : 'Show data table' }}\n </button>\n @if (tableExpanded() && currentState.kind === 'ready') {\n <nec-table-pager [pagination]=\"tablePagination\" [label]=\"title()\" />\n <div\n class=\"table-scroll\"\n tabindex=\"0\"\n role=\"region\"\n [attr.aria-label]=\"title() + ' data table'\"\n >\n <table>\n <caption>\n {{\n title()\n }}\n values\n </caption>\n <thead>\n <tr>\n <th scope=\"col\">Category</th>\n @for (item of legendItems(); track item.id) {\n <th scope=\"col\">{{ item.label }}</th>\n }\n </tr>\n </thead>\n <tbody>\n @for (row of tableRows(); track row.id) {\n <tr\n [class.selected-row]=\"row.selected\"\n [attr.aria-current]=\"row.current ? 'true' : null\"\n >\n <th scope=\"row\">\n {{ row.category }}\n @if (row.selected) {\n <span class=\"selection-label\">Selected</span>\n }\n </th>\n @for (cell of row.cells; track cell.seriesId) {\n <td>\n @if (cell.value !== null) {\n <button\n type=\"button\"\n [attr.aria-label]=\"cell.actionLabel\"\n [attr.data-preview-row]=\"row.id\"\n [attr.data-preview-series]=\"cell.seriesId\"\n (click)=\"selectPoint(cell, 'table')\"\n >\n {{ cell.text }}\n </button>\n } @else {\n <span>{{ cell.text }}</span>\n }\n </td>\n }\n </tr>\n }\n </tbody>\n </table>\n </div>\n }\n }\n </div>\n</nec-chart-frame>\n",
140
+ template: "<nec-chart-frame\n [title]=\"title()\"\n [description]=\"description()\"\n [style.--_nec-default-background]=\"tokens().background\"\n [style.--_nec-default-text]=\"tokens().text\"\n [style.--_nec-default-muted]=\"tokens().muted\"\n [style.--_nec-default-border]=\"tokens().border\"\n>\n @let currentState = state();\n @if (valueAxisDescription()) {\n <p class=\"scale-context\">{{ valueAxisDescription() }}</p>\n }\n\n <nec-chart-stage\n [state]=\"currentState\"\n [height]=\"plotHeight()\"\n [retryable]=\"rendererError()\"\n (retry)=\"retryRenderer()\"\n >\n <div\n #plot\n class=\"plot\"\n [hidden]=\"currentState.kind !== 'ready'\"\n [style.height.px]=\"plotHeight()\"\n aria-hidden=\"true\"\n ></div>\n\n @if (currentState.kind === 'ready' && allSeriesHidden()) {\n <div class=\"plot-message\" role=\"status\">\n <span>All series are hidden. Choose a series below.</span>\n </div>\n }\n </nec-chart-stage>\n <div\n class=\"chart-controls\"\n [attr.inert]=\"currentState.kind !== 'ready' ? '' : null\"\n [attr.aria-hidden]=\"currentState.kind !== 'ready' ? 'true' : null\"\n >\n <div class=\"legend\" aria-label=\"Chart series\">\n @for (item of legendItems(); track item.id) {\n <button\n type=\"button\"\n [disabled]=\"currentState.kind !== 'ready'\"\n [attr.aria-pressed]=\"item.visible\"\n (click)=\"toggleSeries(item.id)\"\n >\n <span class=\"swatch\" [style.background]=\"item.color\" aria-hidden=\"true\"></span>\n {{ item.label }}\n <span class=\"visibility\" [class.legend-note]=\"false\">{{\n item.visible ? 'Visible' : 'Hidden'\n }}</span>\n </button>\n }\n </div>\n @if (showDataTable()) {\n <button\n type=\"button\"\n class=\"table-toggle\"\n [disabled]=\"currentState.kind !== 'ready'\"\n [attr.aria-expanded]=\"tableExpanded()\"\n (click)=\"toggleTable()\"\n >\n {{ tableExpanded() ? 'Hide data table' : 'Show data table' }}\n </button>\n @if (tableExpanded() && currentState.kind === 'ready') {\n <nec-table-pager [pagination]=\"tablePagination\" [label]=\"title()\" />\n <div\n class=\"table-scroll\"\n tabindex=\"0\"\n role=\"region\"\n [attr.aria-label]=\"title() + ' data table'\"\n >\n <table>\n <caption>\n {{\n title()\n }}\n values\n </caption>\n <thead>\n <tr>\n <th scope=\"col\">Category</th>\n @for (item of legendItems(); track item.id) {\n <th scope=\"col\">{{ item.label }}</th>\n }\n </tr>\n </thead>\n <tbody>\n @for (row of tableRows(); track row.id) {\n <tr\n [class.selected-row]=\"row.selected\"\n [attr.aria-current]=\"row.current ? 'true' : null\"\n >\n <th scope=\"row\">\n {{ row.category }}\n @if (row.selected) {\n <span class=\"selection-label\">Selected</span>\n }\n </th>\n @for (cell of row.cells; track cell.seriesId) {\n <td>\n @if (cell.value !== null) {\n <button\n type=\"button\"\n [attr.aria-label]=\"cell.actionLabel\"\n [attr.data-preview-row]=\"row.id\"\n [attr.data-preview-series]=\"cell.seriesId\"\n (click)=\"selectPoint(cell, 'table')\"\n >\n {{ cell.text }}\n </button>\n } @else {\n <span>{{ cell.text }}</span>\n }\n </td>\n }\n </tr>\n }\n </tbody>\n </table>\n </div>\n }\n }\n </div>\n</nec-chart-frame>\n",
141
141
  styles: [":host{display:block;min-width:0}.plot{width:100%}.plot[hidden]{display:none}.legend{display:flex;flex-wrap:wrap;gap:.5rem;margin:1rem 0}button{padding:.5rem .75rem;border:1px solid var(--nec-border, #d6dce5);border-radius:.375rem;color:inherit;background:transparent;font:inherit;cursor:pointer}button:focus-visible,.table-scroll:focus-visible{outline:3px solid var(--nec-focus, #648dff);outline-offset:3px}.swatch{display:inline-block;width:.75rem;height:.75rem;border-radius:.125rem;margin-right:.375rem}.visibility{margin-left:.5rem;font-size:.75rem}.table-toggle{margin:.25rem 0}.table-scroll{overflow-x:auto;margin-top:1rem}table{width:100%;border-collapse:collapse;font-variant-numeric:tabular-nums;text-align:left}caption{padding:.5rem;text-align:left;font-weight:600}th,td{padding:.5rem;border-bottom:1px solid var(--nec-border, #d6dce5)}td{white-space:nowrap}.selected-row{background:color-mix(in srgb,var(--nec-text, #18202c) 5%,transparent)}.selected-row th{box-shadow:inset 2px 0 var(--nec-text, #18202c)}.selection-label{display:block;margin-top:2px;color:var(--nec-muted, #536176);font-size:.6875rem;font-weight:500}.legend button{position:relative;display:inline-flex;align-items:center;gap:6px}.legend button:hover{background:color-mix(in srgb,var(--nec-text, #18202c) 4%,transparent)}.legend button[aria-pressed=false]{border-style:dashed;color:var(--nec-muted, #536176)}.legend button[aria-pressed=false] .swatch{opacity:.35}.pie-legend{display:grid;grid-template-columns:repeat(auto-fit,minmax(108px,1fr));gap:8px}.pie-legend button{display:grid;grid-template-columns:8px minmax(0,1fr);gap:2px 6px;padding:8px 10px;min-width:0;text-align:left}.legend-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.legend-values{grid-column:2;display:flex;justify-content:space-between;gap:6px;font-size:11px;font-variant-numeric:tabular-nums;color:var(--nec-muted, #536176)}.donut-total{position:absolute;inset:0;margin:auto;width:min(36%,140px);height:fit-content;text-align:center;pointer-events:none}.donut-total strong{display:block;font-size:clamp(18px,3vw,26px);line-height:1.25;font-weight:600;letter-spacing:-.5px;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}.donut-total span{display:block;margin-top:4px;font-size:11px;line-height:16px;color:var(--nec-muted, #536176);overflow-wrap:anywhere}@media(max-width:600px){.pie-legend{grid-template-columns:repeat(2,minmax(0,1fr))}}.legend-values{flex-wrap:wrap;min-width:0}.legend-values>span{min-width:0;overflow-wrap:anywhere}.donut-total strong,.donut-total span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}\n", ".chart-controls{min-height:52px}.chart-controls[inert]{visibility:hidden;pointer-events:none}.plot-message{position:absolute;inset:0;display:grid;align-content:center;justify-items:center;padding:20px;margin:0;box-sizing:border-box;text-align:center;color:var(--nec-muted, #536176);font-size:13px;line-height:1.6;pointer-events:none}.visibility:not(.legend-note){position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}.scale-context{margin:0 0 8px;color:var(--nec-muted, #536176);font-size:12px;line-height:20px}.plot-message>span{max-width:34ch;padding:10px 12px;border-radius:6px;background:var(--nec-background, #fff)}\n"]
142
142
  }]
143
143
  }],
@@ -1 +1 @@
1
- {"version":3,"file":"mantha911-ng-echarts-area.mjs","names":[],"sources":["../../../projects/chart-library/area/src/lib/area-browser.ts","../../../projects/chart-library/area/src/lib/area-options.ts","../../../projects/chart-library/area/src/lib/area-chart.ts","../../../projects/chart-library/core/src/lib/cartesian-chart.html"],"sourcesContent":["import { InjectionToken } from '@angular/core';\nimport type { ɵPlotRendererFactory } from '@mantha911/ng-echarts/core';\nimport type { AreaOption } from './area-options';\nexport const AREA_RENDERER_LOADER = new InjectionToken<\n () => Promise<ɵPlotRendererFactory<AreaOption>>\n>('Area renderer loader', {\n providedIn: 'root',\n factory: () => () => import('./area-renderer').then((module) => module.createAreaRenderer),\n});\n","import type { LineSeriesOption } from 'echarts/charts';\nimport {\n ɵbuildCurveOptions,\n ɵbuildAreaFill,\n type ɵCartesianContext,\n type ɵCurveOption,\n} from '@mantha911/ng-echarts/core';\nexport type AreaOption = ɵCurveOption;\nexport function buildAreaOptions<T>(\n context: ɵCartesianContext<T>,\n smooth: boolean,\n showPoints: boolean,\n stacked: boolean,\n gradient: boolean,\n): AreaOption {\n const options = ɵbuildCurveOptions(context, smooth, showPoints);\n if (!Array.isArray(options.series)) throw new Error('Expected curve series');\n return {\n ...options,\n series: options.series.map((item): LineSeriesOption => {\n const color = typeof item.lineStyle?.color === 'string' ? item.lineStyle.color : '#047857';\n return {\n ...item,\n stack: stacked ? 'total' : undefined,\n stackStrategy: 'samesign',\n triggerEvent: true,\n areaStyle: ɵbuildAreaFill(color, gradient),\n };\n }),\n };\n}\n","import { ChangeDetectionStrategy, Component, inject, input } from '@angular/core';\nimport {\n ChartFrame,\n ɵChartStage,\n ɵTablePager,\n ɵCartesianChart,\n type ɵCartesianContext,\n} from '@mantha911/ng-echarts/core';\nimport { AREA_RENDERER_LOADER } from './area-browser';\nimport { buildAreaOptions, type AreaOption } from './area-options';\n@Component({\n selector: 'nec-area-chart',\n imports: [ChartFrame, ɵChartStage, ɵTablePager],\n templateUrl: '../../../core/src/lib/cartesian-chart.html',\n styleUrls: [\n '../../../core/src/lib/cartesian-chart.css',\n '../../../core/src/lib/chart-controls.css',\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class AreaChart<T extends object> extends ɵCartesianChart<T, AreaOption> {\n readonly smooth = input(false);\n readonly showPoints = input(false);\n readonly stacked = input(false);\n readonly gradient = input(true);\n private readonly loader = inject(AREA_RENDERER_LOADER);\n protected override renderer() {\n return this.loader();\n }\n protected override familyConfiguration() {\n return {\n smooth: this.smooth(),\n showPoints: this.showPoints(),\n stacked: this.stacked(),\n gradient: this.gradient(),\n };\n }\n protected override familyError() {\n return typeof this.smooth() === 'boolean' &&\n typeof this.showPoints() === 'boolean' &&\n typeof this.stacked() === 'boolean' &&\n typeof this.gradient() === 'boolean'\n ? null\n : 'Area settings must be booleans.';\n }\n protected override buildOptions(context: ɵCartesianContext<T>): AreaOption {\n return buildAreaOptions(\n context,\n this.smooth(),\n this.showPoints(),\n this.stacked(),\n this.gradient(),\n );\n }\n}\n","<nec-chart-frame\n [title]=\"title()\"\n [description]=\"description()\"\n [style.--_nec-default-background]=\"tokens().background\"\n [style.--_nec-default-text]=\"tokens().text\"\n [style.--_nec-default-muted]=\"tokens().muted\"\n [style.--_nec-default-border]=\"tokens().border\"\n>\n @let currentState = state();\n\n <nec-chart-stage\n [state]=\"currentState\"\n [height]=\"plotHeight()\"\n [retryable]=\"rendererError()\"\n (retry)=\"retryRenderer()\"\n >\n <div\n #plot\n class=\"plot\"\n [hidden]=\"currentState.kind !== 'ready'\"\n [style.height.px]=\"plotHeight()\"\n aria-hidden=\"true\"\n ></div>\n\n @if (currentState.kind === 'ready' && allSeriesHidden()) {\n <div class=\"plot-message\" role=\"status\">\n <span>All series are hidden. Choose a series below.</span>\n </div>\n }\n </nec-chart-stage>\n <div\n class=\"chart-controls\"\n [attr.inert]=\"currentState.kind !== 'ready' ? '' : null\"\n [attr.aria-hidden]=\"currentState.kind !== 'ready' ? 'true' : null\"\n >\n <div class=\"legend\" aria-label=\"Chart series\">\n @for (item of legendItems(); track item.id) {\n <button\n type=\"button\"\n [disabled]=\"currentState.kind !== 'ready'\"\n [attr.aria-pressed]=\"item.visible\"\n (click)=\"toggleSeries(item.id)\"\n >\n <span class=\"swatch\" [style.background]=\"item.color\" aria-hidden=\"true\"></span>\n {{ item.label }}\n <span class=\"visibility\" [class.legend-note]=\"false\">{{\n item.visible ? 'Visible' : 'Hidden'\n }}</span>\n </button>\n }\n </div>\n @if (showDataTable()) {\n <button\n type=\"button\"\n class=\"table-toggle\"\n [disabled]=\"currentState.kind !== 'ready'\"\n [attr.aria-expanded]=\"tableExpanded()\"\n (click)=\"toggleTable()\"\n >\n {{ tableExpanded() ? 'Hide data table' : 'Show data table' }}\n </button>\n @if (tableExpanded() && currentState.kind === 'ready') {\n <nec-table-pager [pagination]=\"tablePagination\" [label]=\"title()\" />\n <div\n class=\"table-scroll\"\n tabindex=\"0\"\n role=\"region\"\n [attr.aria-label]=\"title() + ' data table'\"\n >\n <table>\n <caption>\n {{\n title()\n }}\n values\n </caption>\n <thead>\n <tr>\n <th scope=\"col\">Category</th>\n @for (item of legendItems(); track item.id) {\n <th scope=\"col\">{{ item.label }}</th>\n }\n </tr>\n </thead>\n <tbody>\n @for (row of tableRows(); track row.id) {\n <tr\n [class.selected-row]=\"row.selected\"\n [attr.aria-current]=\"row.current ? 'true' : null\"\n >\n <th scope=\"row\">\n {{ row.category }}\n @if (row.selected) {\n <span class=\"selection-label\">Selected</span>\n }\n </th>\n @for (cell of row.cells; track cell.seriesId) {\n <td>\n @if (cell.value !== null) {\n <button\n type=\"button\"\n [attr.aria-label]=\"cell.actionLabel\"\n [attr.data-preview-row]=\"row.id\"\n [attr.data-preview-series]=\"cell.seriesId\"\n (click)=\"selectPoint(cell, 'table')\"\n >\n {{ cell.text }}\n </button>\n } @else {\n <span>{{ cell.text }}</span>\n }\n </td>\n }\n </tr>\n }\n </tbody>\n </table>\n </div>\n }\n }\n </div>\n</nec-chart-frame>\n"],"mappings":";;;AAGA,MAAa,uBAAuB,IAAI,eAEtC,wBAAwB;CACxB,YAAY;CACZ,qBAAqB,OAAO,yDAAkB,CAAC,MAAM,WAAW,OAAO,kBAAkB;AAC1F,CAAA;ACAD,SAAgB,iBACd,SACA,QACA,YACA,SACA,UAAiB;CAEjB,MAAM,UAAU,mBAAmB,SAAS,QAAQ,UAAU;CAC9D,IAAI,CAAC,MAAM,QAAQ,QAAQ,MAAM,GAAG,MAAM,IAAI,MAAM,uBAAuB;CAC3E,OAAO;EACL,GAAG;EACH,QAAQ,QAAQ,OAAO,KAAK,SAA0B;GACpD,MAAM,QAAQ,OAAO,KAAK,WAAW,UAAU,WAAW,KAAK,UAAU,QAAQ;GACjF,OAAO;IACL,GAAG;IACH,OAA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AA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,YAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,SAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,UAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;EAAA;EAAA,iBAAA;EAAA,UAAA;EAAA,UCpBtB;EA0HA,QAAA,CAAA,wjFAAA,wrBAAA;EAAA,cAAA;GAAA;IAAA,MAAA;IAAA,MD9GY;IAAU,UAAA;IAAA,QAAA,CAAA,SAAA,aAAA;GAAA;GAAA;IAAA,MAAA;IAAA,MAAE;IAAW,UAAA;IAAA,QAAA;KAAA;KAAA;KAAA;KAAA;IAAA;IAAA,SAAA,CAAA,OAAA;GAAA;GAAA;IAAA,MAAA;IAAA,MAAE;IAAW,UAAA;IAAA,QAAA,CAAA,cAAA,OAAA;GAAA;EAAA;EAAA,iBAAA,GAAA,wBAAA;CAAA,CAAA;;AAQnC,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAS,YAAA,CAAA;EAVrB,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAgB,SACjB;IAAC;IAAY;IAAa;GAAW;GAAC,iBAM9B,wBAAwB;GAAM,UAAA;GAAA,QAAA,CAAA,wjFAAA,wrBAAA;EAAA,CAAA"}
1
+ {"version":3,"file":"mantha911-ng-echarts-area.mjs","names":[],"sources":["../../../projects/chart-library/area/src/lib/area-browser.ts","../../../projects/chart-library/area/src/lib/area-options.ts","../../../projects/chart-library/area/src/lib/area-chart.ts","../../../projects/chart-library/core/src/lib/cartesian-chart.html"],"sourcesContent":["import { InjectionToken } from '@angular/core';\nimport type { ɵPlotRendererFactory } from '@mantha911/ng-echarts/core';\nimport type { AreaOption } from './area-options';\nexport const AREA_RENDERER_LOADER = new InjectionToken<\n () => Promise<ɵPlotRendererFactory<AreaOption>>\n>('Area renderer loader', {\n providedIn: 'root',\n factory: () => () => import('./area-renderer').then((module) => module.createAreaRenderer),\n});\n","import type { LineSeriesOption } from 'echarts/charts';\nimport {\n ɵbuildCurveOptions,\n ɵbuildAreaFill,\n type ɵCartesianContext,\n type ɵCurveOption,\n} from '@mantha911/ng-echarts/core';\nexport type AreaOption = ɵCurveOption;\nexport function buildAreaOptions<T>(\n context: ɵCartesianContext<T>,\n smooth: boolean,\n showPoints: boolean,\n stacked: boolean,\n gradient: boolean,\n): AreaOption {\n const options = ɵbuildCurveOptions(context, smooth, showPoints);\n if (!Array.isArray(options.series)) throw new Error('Expected curve series');\n return {\n ...options,\n series: options.series.map((item): LineSeriesOption => {\n const color = typeof item.lineStyle?.color === 'string' ? item.lineStyle.color : '#047857';\n return {\n ...item,\n stack: stacked ? 'total' : undefined,\n stackStrategy: 'samesign',\n triggerEvent: true,\n areaStyle: ɵbuildAreaFill(color, gradient),\n };\n }),\n };\n}\n","import { ChangeDetectionStrategy, Component, inject, input } from '@angular/core';\nimport {\n ChartFrame,\n ɵChartStage,\n ɵTablePager,\n ɵCartesianChart,\n type ɵCartesianContext,\n} from '@mantha911/ng-echarts/core';\nimport { AREA_RENDERER_LOADER } from './area-browser';\nimport { buildAreaOptions, type AreaOption } from './area-options';\n@Component({\n selector: 'nec-area-chart',\n imports: [ChartFrame, ɵChartStage, ɵTablePager],\n templateUrl: '../../../core/src/lib/cartesian-chart.html',\n styleUrls: [\n '../../../core/src/lib/cartesian-chart.css',\n '../../../core/src/lib/chart-controls.css',\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class AreaChart<T extends object> extends ɵCartesianChart<T, AreaOption> {\n readonly smooth = input(false);\n readonly showPoints = input(false);\n readonly stacked = input(false);\n readonly gradient = input(true);\n private readonly loader = inject(AREA_RENDERER_LOADER);\n protected override renderer() {\n return this.loader();\n }\n protected override familyConfiguration() {\n return {\n smooth: this.smooth(),\n showPoints: this.showPoints(),\n stacked: this.stacked(),\n gradient: this.gradient(),\n };\n }\n protected override familyError() {\n return typeof this.smooth() === 'boolean' &&\n typeof this.showPoints() === 'boolean' &&\n typeof this.stacked() === 'boolean' &&\n typeof this.gradient() === 'boolean'\n ? null\n : 'Area settings must be booleans.';\n }\n protected override buildOptions(context: ɵCartesianContext<T>): AreaOption {\n return buildAreaOptions(\n context,\n this.smooth(),\n this.showPoints(),\n this.stacked(),\n this.gradient(),\n );\n }\n}\n","<nec-chart-frame\n [title]=\"title()\"\n [description]=\"description()\"\n [style.--_nec-default-background]=\"tokens().background\"\n [style.--_nec-default-text]=\"tokens().text\"\n [style.--_nec-default-muted]=\"tokens().muted\"\n [style.--_nec-default-border]=\"tokens().border\"\n>\n @let currentState = state();\n @if (valueAxisDescription()) {\n <p class=\"scale-context\">{{ valueAxisDescription() }}</p>\n }\n\n <nec-chart-stage\n [state]=\"currentState\"\n [height]=\"plotHeight()\"\n [retryable]=\"rendererError()\"\n (retry)=\"retryRenderer()\"\n >\n <div\n #plot\n class=\"plot\"\n [hidden]=\"currentState.kind !== 'ready'\"\n [style.height.px]=\"plotHeight()\"\n aria-hidden=\"true\"\n ></div>\n\n @if (currentState.kind === 'ready' && allSeriesHidden()) {\n <div class=\"plot-message\" role=\"status\">\n <span>All series are hidden. Choose a series below.</span>\n </div>\n }\n </nec-chart-stage>\n <div\n class=\"chart-controls\"\n [attr.inert]=\"currentState.kind !== 'ready' ? '' : null\"\n [attr.aria-hidden]=\"currentState.kind !== 'ready' ? 'true' : null\"\n >\n <div class=\"legend\" aria-label=\"Chart series\">\n @for (item of legendItems(); track item.id) {\n <button\n type=\"button\"\n [disabled]=\"currentState.kind !== 'ready'\"\n [attr.aria-pressed]=\"item.visible\"\n (click)=\"toggleSeries(item.id)\"\n >\n <span class=\"swatch\" [style.background]=\"item.color\" aria-hidden=\"true\"></span>\n {{ item.label }}\n <span class=\"visibility\" [class.legend-note]=\"false\">{{\n item.visible ? 'Visible' : 'Hidden'\n }}</span>\n </button>\n }\n </div>\n @if (showDataTable()) {\n <button\n type=\"button\"\n class=\"table-toggle\"\n [disabled]=\"currentState.kind !== 'ready'\"\n [attr.aria-expanded]=\"tableExpanded()\"\n (click)=\"toggleTable()\"\n >\n {{ tableExpanded() ? 'Hide data table' : 'Show data table' }}\n </button>\n @if (tableExpanded() && currentState.kind === 'ready') {\n <nec-table-pager [pagination]=\"tablePagination\" [label]=\"title()\" />\n <div\n class=\"table-scroll\"\n tabindex=\"0\"\n role=\"region\"\n [attr.aria-label]=\"title() + ' data table'\"\n >\n <table>\n <caption>\n {{\n title()\n }}\n values\n </caption>\n <thead>\n <tr>\n <th scope=\"col\">Category</th>\n @for (item of legendItems(); track item.id) {\n <th scope=\"col\">{{ item.label }}</th>\n }\n </tr>\n </thead>\n <tbody>\n @for (row of tableRows(); track row.id) {\n <tr\n [class.selected-row]=\"row.selected\"\n [attr.aria-current]=\"row.current ? 'true' : null\"\n >\n <th scope=\"row\">\n {{ row.category }}\n @if (row.selected) {\n <span class=\"selection-label\">Selected</span>\n }\n </th>\n @for (cell of row.cells; track cell.seriesId) {\n <td>\n @if (cell.value !== null) {\n <button\n type=\"button\"\n [attr.aria-label]=\"cell.actionLabel\"\n [attr.data-preview-row]=\"row.id\"\n [attr.data-preview-series]=\"cell.seriesId\"\n (click)=\"selectPoint(cell, 'table')\"\n >\n {{ cell.text }}\n </button>\n } @else {\n <span>{{ cell.text }}</span>\n }\n </td>\n }\n </tr>\n }\n </tbody>\n </table>\n </div>\n }\n }\n </div>\n</nec-chart-frame>\n"],"mappings":";;;AAGA,MAAa,uBAAuB,IAAI,eAEtC,wBAAwB;CACxB,YAAY;CACZ,qBAAqB,OAAO,yDAAkB,CAAC,MAAM,WAAW,OAAO,kBAAkB;AAC1F,CAAA;ACAD,SAAgB,iBACd,SACA,QACA,YACA,SACA,UAAiB;CAEjB,MAAM,UAAU,mBAAmB,SAAS,QAAQ,UAAU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artesianChart {
272
272
  },
273
273
  usesInheritance: true,
274
274
  ngImport: i0,
275
- template: "<nec-chart-frame\n [title]=\"title()\"\n [description]=\"description()\"\n [style.--_nec-default-background]=\"tokens().background\"\n [style.--_nec-default-text]=\"tokens().text\"\n [style.--_nec-default-muted]=\"tokens().muted\"\n [style.--_nec-default-border]=\"tokens().border\"\n>\n @let currentState = state();\n\n <nec-chart-stage\n [state]=\"currentState\"\n [height]=\"plotHeight()\"\n [retryable]=\"rendererError()\"\n (retry)=\"retryRenderer()\"\n >\n <div\n #plot\n class=\"plot\"\n [hidden]=\"currentState.kind !== 'ready'\"\n [style.height.px]=\"plotHeight()\"\n aria-hidden=\"true\"\n ></div>\n\n @if (currentState.kind === 'ready' && allSeriesHidden()) {\n <div class=\"plot-message\" role=\"status\">\n <span>All series are hidden. Choose a series below.</span>\n </div>\n }\n </nec-chart-stage>\n <div\n class=\"chart-controls\"\n [attr.inert]=\"currentState.kind !== 'ready' ? '' : null\"\n [attr.aria-hidden]=\"currentState.kind !== 'ready' ? 'true' : null\"\n >\n <div class=\"legend\" aria-label=\"Chart series\">\n @for (item of legendItems(); track item.id) {\n <button\n type=\"button\"\n [disabled]=\"currentState.kind !== 'ready'\"\n [attr.aria-pressed]=\"item.visible\"\n (click)=\"toggleSeries(item.id)\"\n >\n <span class=\"swatch\" [style.background]=\"item.color\" aria-hidden=\"true\"></span>\n {{ item.label }}\n <span class=\"visibility\" [class.legend-note]=\"false\">{{\n item.visible ? 'Visible' : 'Hidden'\n }}</span>\n </button>\n }\n </div>\n @if (showDataTable()) {\n <button\n type=\"button\"\n class=\"table-toggle\"\n [disabled]=\"currentState.kind !== 'ready'\"\n [attr.aria-expanded]=\"tableExpanded()\"\n (click)=\"toggleTable()\"\n >\n {{ tableExpanded() ? 'Hide data table' : 'Show data table' }}\n </button>\n @if (tableExpanded() && currentState.kind === 'ready') {\n <nec-table-pager [pagination]=\"tablePagination\" [label]=\"title()\" />\n <div\n class=\"table-scroll\"\n tabindex=\"0\"\n role=\"region\"\n [attr.aria-label]=\"title() + ' data table'\"\n >\n <table>\n <caption>\n {{\n title()\n }}\n values\n </caption>\n <thead>\n <tr>\n <th scope=\"col\">Category</th>\n @for (item of legendItems(); track item.id) {\n <th scope=\"col\">{{ item.label }}</th>\n }\n </tr>\n </thead>\n <tbody>\n @for (row of tableRows(); track row.id) {\n <tr\n [class.selected-row]=\"row.selected\"\n [attr.aria-current]=\"row.current ? 'true' : null\"\n >\n <th scope=\"row\">\n {{ row.category }}\n @if (row.selected) {\n <span class=\"selection-label\">Selected</span>\n }\n </th>\n @for (cell of row.cells; track cell.seriesId) {\n <td>\n @if (cell.value !== null) {\n <button\n type=\"button\"\n [attr.aria-label]=\"cell.actionLabel\"\n [attr.data-preview-row]=\"row.id\"\n [attr.data-preview-series]=\"cell.seriesId\"\n (click)=\"selectPoint(cell, 'table')\"\n >\n {{ cell.text }}\n </button>\n } @else {\n <span>{{ cell.text }}</span>\n }\n </td>\n }\n </tr>\n }\n </tbody>\n </table>\n </div>\n }\n }\n </div>\n</nec-chart-frame>\n",
275
+ template: "<nec-chart-frame\n [title]=\"title()\"\n [description]=\"description()\"\n [style.--_nec-default-background]=\"tokens().background\"\n [style.--_nec-default-text]=\"tokens().text\"\n [style.--_nec-default-muted]=\"tokens().muted\"\n [style.--_nec-default-border]=\"tokens().border\"\n>\n @let currentState = state();\n @if (valueAxisDescription()) {\n <p class=\"scale-context\">{{ valueAxisDescription() }}</p>\n }\n\n <nec-chart-stage\n [state]=\"currentState\"\n [height]=\"plotHeight()\"\n [retryable]=\"rendererError()\"\n (retry)=\"retryRenderer()\"\n >\n <div\n #plot\n class=\"plot\"\n [hidden]=\"currentState.kind !== 'ready'\"\n [style.height.px]=\"plotHeight()\"\n aria-hidden=\"true\"\n ></div>\n\n @if (currentState.kind === 'ready' && allSeriesHidden()) {\n <div class=\"plot-message\" role=\"status\">\n <span>All series are hidden. Choose a series below.</span>\n </div>\n }\n </nec-chart-stage>\n <div\n class=\"chart-controls\"\n [attr.inert]=\"currentState.kind !== 'ready' ? '' : null\"\n [attr.aria-hidden]=\"currentState.kind !== 'ready' ? 'true' : null\"\n >\n <div class=\"legend\" aria-label=\"Chart series\">\n @for (item of legendItems(); track item.id) {\n <button\n type=\"button\"\n [disabled]=\"currentState.kind !== 'ready'\"\n [attr.aria-pressed]=\"item.visible\"\n (click)=\"toggleSeries(item.id)\"\n >\n <span class=\"swatch\" [style.background]=\"item.color\" aria-hidden=\"true\"></span>\n {{ item.label }}\n <span class=\"visibility\" [class.legend-note]=\"false\">{{\n item.visible ? 'Visible' : 'Hidden'\n }}</span>\n </button>\n }\n </div>\n @if (showDataTable()) {\n <button\n type=\"button\"\n class=\"table-toggle\"\n [disabled]=\"currentState.kind !== 'ready'\"\n [attr.aria-expanded]=\"tableExpanded()\"\n (click)=\"toggleTable()\"\n >\n {{ tableExpanded() ? 'Hide data table' : 'Show data table' }}\n </button>\n @if (tableExpanded() && currentState.kind === 'ready') {\n <nec-table-pager [pagination]=\"tablePagination\" [label]=\"title()\" />\n <div\n class=\"table-scroll\"\n tabindex=\"0\"\n role=\"region\"\n [attr.aria-label]=\"title() + ' data table'\"\n >\n <table>\n <caption>\n {{\n title()\n }}\n values\n </caption>\n <thead>\n <tr>\n <th scope=\"col\">Category</th>\n @for (item of legendItems(); track item.id) {\n <th scope=\"col\">{{ item.label }}</th>\n }\n </tr>\n </thead>\n <tbody>\n @for (row of tableRows(); track row.id) {\n <tr\n [class.selected-row]=\"row.selected\"\n [attr.aria-current]=\"row.current ? 'true' : null\"\n >\n <th scope=\"row\">\n {{ row.category }}\n @if (row.selected) {\n <span class=\"selection-label\">Selected</span>\n }\n </th>\n @for (cell of row.cells; track cell.seriesId) {\n <td>\n @if (cell.value !== null) {\n <button\n type=\"button\"\n [attr.aria-label]=\"cell.actionLabel\"\n [attr.data-preview-row]=\"row.id\"\n [attr.data-preview-series]=\"cell.seriesId\"\n (click)=\"selectPoint(cell, 'table')\"\n >\n {{ cell.text }}\n </button>\n } @else {\n <span>{{ cell.text }}</span>\n }\n </td>\n }\n </tr>\n }\n </tbody>\n </table>\n </div>\n }\n }\n </div>\n</nec-chart-frame>\n",
276
276
  styles: [":host{display:block;min-width:0}.plot{width:100%}.plot[hidden]{display:none}.legend{display:flex;flex-wrap:wrap;gap:.5rem;margin:1rem 0}button{padding:.5rem .75rem;border:1px solid var(--nec-border, #d6dce5);border-radius:.375rem;color:inherit;background:transparent;font:inherit;cursor:pointer}button:focus-visible,.table-scroll:focus-visible{outline:3px solid var(--nec-focus, #648dff);outline-offset:3px}.swatch{display:inline-block;width:.75rem;height:.75rem;border-radius:.125rem;margin-right:.375rem}.visibility{margin-left:.5rem;font-size:.75rem}.table-toggle{margin:.25rem 0}.table-scroll{overflow-x:auto;margin-top:1rem}table{width:100%;border-collapse:collapse;font-variant-numeric:tabular-nums;text-align:left}caption{padding:.5rem;text-align:left;font-weight:600}th,td{padding:.5rem;border-bottom:1px solid var(--nec-border, #d6dce5)}td{white-space:nowrap}.selected-row{background:color-mix(in srgb,var(--nec-text, #18202c) 5%,transparent)}.selected-row th{box-shadow:inset 2px 0 var(--nec-text, #18202c)}.selection-label{display:block;margin-top:2px;color:var(--nec-muted, #536176);font-size:.6875rem;font-weight:500}.legend button{position:relative;display:inline-flex;align-items:center;gap:6px}.legend button:hover{background:color-mix(in srgb,var(--nec-text, #18202c) 4%,transparent)}.legend button[aria-pressed=false]{border-style:dashed;color:var(--nec-muted, #536176)}.legend button[aria-pressed=false] .swatch{opacity:.35}.pie-legend{display:grid;grid-template-columns:repeat(auto-fit,minmax(108px,1fr));gap:8px}.pie-legend button{display:grid;grid-template-columns:8px minmax(0,1fr);gap:2px 6px;padding:8px 10px;min-width:0;text-align:left}.legend-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.legend-values{grid-column:2;display:flex;justify-content:space-between;gap:6px;font-size:11px;font-variant-numeric:tabular-nums;color:var(--nec-muted, #536176)}.donut-total{position:absolute;inset:0;margin:auto;width:min(36%,140px);height:fit-content;text-align:center;pointer-events:none}.donut-total strong{display:block;font-size:clamp(18px,3vw,26px);line-height:1.25;font-weight:600;letter-spacing:-.5px;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}.donut-total span{display:block;margin-top:4px;font-size:11px;line-height:16px;color:var(--nec-muted, #536176);overflow-wrap:anywhere}@media(max-width:600px){.pie-legend{grid-template-columns:repeat(2,minmax(0,1fr))}}.legend-values{flex-wrap:wrap;min-width:0}.legend-values>span{min-width:0;overflow-wrap:anywhere}.donut-total strong,.donut-total span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}\n", ".chart-controls{min-height:52px}.chart-controls[inert]{visibility:hidden;pointer-events:none}.plot-message{position:absolute;inset:0;display:grid;align-content:center;justify-items:center;padding:20px;margin:0;box-sizing:border-box;text-align:center;color:var(--nec-muted, #536176);font-size:13px;line-height:1.6;pointer-events:none}.visibility:not(.legend-note){position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}.scale-context{margin:0 0 8px;color:var(--nec-muted, #536176);font-size:12px;line-height:20px}.plot-message>span{max-width:34ch;padding:10px 12px;border-radius:6px;background:var(--nec-background, #fff)}\n"],
277
277
  dependencies: [
278
278
  {
@@ -318,7 +318,7 @@ i0.ɵɵngDeclareClassMetadata({
318
318
  ɵTablePager
319
319
  ],
320
320
  changeDetection: ChangeDetectionStrategy.OnPush,
321
- template: "<nec-chart-frame\n [title]=\"title()\"\n [description]=\"description()\"\n [style.--_nec-default-background]=\"tokens().background\"\n [style.--_nec-default-text]=\"tokens().text\"\n [style.--_nec-default-muted]=\"tokens().muted\"\n [style.--_nec-default-border]=\"tokens().border\"\n>\n @let currentState = state();\n\n <nec-chart-stage\n [state]=\"currentState\"\n [height]=\"plotHeight()\"\n [retryable]=\"rendererError()\"\n (retry)=\"retryRenderer()\"\n >\n <div\n #plot\n class=\"plot\"\n [hidden]=\"currentState.kind !== 'ready'\"\n [style.height.px]=\"plotHeight()\"\n aria-hidden=\"true\"\n ></div>\n\n @if (currentState.kind === 'ready' && allSeriesHidden()) {\n <div class=\"plot-message\" role=\"status\">\n <span>All series are hidden. Choose a series below.</span>\n </div>\n }\n </nec-chart-stage>\n <div\n class=\"chart-controls\"\n [attr.inert]=\"currentState.kind !== 'ready' ? '' : null\"\n [attr.aria-hidden]=\"currentState.kind !== 'ready' ? 'true' : null\"\n >\n <div class=\"legend\" aria-label=\"Chart series\">\n @for (item of legendItems(); track item.id) {\n <button\n type=\"button\"\n [disabled]=\"currentState.kind !== 'ready'\"\n [attr.aria-pressed]=\"item.visible\"\n (click)=\"toggleSeries(item.id)\"\n >\n <span class=\"swatch\" [style.background]=\"item.color\" aria-hidden=\"true\"></span>\n {{ item.label }}\n <span class=\"visibility\" [class.legend-note]=\"false\">{{\n item.visible ? 'Visible' : 'Hidden'\n }}</span>\n </button>\n }\n </div>\n @if (showDataTable()) {\n <button\n type=\"button\"\n class=\"table-toggle\"\n [disabled]=\"currentState.kind !== 'ready'\"\n [attr.aria-expanded]=\"tableExpanded()\"\n (click)=\"toggleTable()\"\n >\n {{ tableExpanded() ? 'Hide data table' : 'Show data table' }}\n </button>\n @if (tableExpanded() && currentState.kind === 'ready') {\n <nec-table-pager [pagination]=\"tablePagination\" [label]=\"title()\" />\n <div\n class=\"table-scroll\"\n tabindex=\"0\"\n role=\"region\"\n [attr.aria-label]=\"title() + ' data table'\"\n >\n <table>\n <caption>\n {{\n title()\n }}\n values\n </caption>\n <thead>\n <tr>\n <th scope=\"col\">Category</th>\n @for (item of legendItems(); track item.id) {\n <th scope=\"col\">{{ item.label }}</th>\n }\n </tr>\n </thead>\n <tbody>\n @for (row of tableRows(); track row.id) {\n <tr\n [class.selected-row]=\"row.selected\"\n [attr.aria-current]=\"row.current ? 'true' : null\"\n >\n <th scope=\"row\">\n {{ row.category }}\n @if (row.selected) {\n <span class=\"selection-label\">Selected</span>\n }\n </th>\n @for (cell of row.cells; track cell.seriesId) {\n <td>\n @if (cell.value !== null) {\n <button\n type=\"button\"\n [attr.aria-label]=\"cell.actionLabel\"\n [attr.data-preview-row]=\"row.id\"\n [attr.data-preview-series]=\"cell.seriesId\"\n (click)=\"selectPoint(cell, 'table')\"\n >\n {{ cell.text }}\n </button>\n } @else {\n <span>{{ cell.text }}</span>\n }\n </td>\n }\n </tr>\n }\n </tbody>\n </table>\n </div>\n }\n }\n </div>\n</nec-chart-frame>\n",
321
+ template: "<nec-chart-frame\n [title]=\"title()\"\n [description]=\"description()\"\n [style.--_nec-default-background]=\"tokens().background\"\n [style.--_nec-default-text]=\"tokens().text\"\n [style.--_nec-default-muted]=\"tokens().muted\"\n [style.--_nec-default-border]=\"tokens().border\"\n>\n @let currentState = state();\n @if (valueAxisDescription()) {\n <p class=\"scale-context\">{{ valueAxisDescription() }}</p>\n }\n\n <nec-chart-stage\n [state]=\"currentState\"\n [height]=\"plotHeight()\"\n [retryable]=\"rendererError()\"\n (retry)=\"retryRenderer()\"\n >\n <div\n #plot\n class=\"plot\"\n [hidden]=\"currentState.kind !== 'ready'\"\n [style.height.px]=\"plotHeight()\"\n aria-hidden=\"true\"\n ></div>\n\n @if (currentState.kind === 'ready' && allSeriesHidden()) {\n <div class=\"plot-message\" role=\"status\">\n <span>All series are hidden. Choose a series below.</span>\n </div>\n }\n </nec-chart-stage>\n <div\n class=\"chart-controls\"\n [attr.inert]=\"currentState.kind !== 'ready' ? '' : null\"\n [attr.aria-hidden]=\"currentState.kind !== 'ready' ? 'true' : null\"\n >\n <div class=\"legend\" aria-label=\"Chart series\">\n @for (item of legendItems(); track item.id) {\n <button\n type=\"button\"\n [disabled]=\"currentState.kind !== 'ready'\"\n [attr.aria-pressed]=\"item.visible\"\n (click)=\"toggleSeries(item.id)\"\n >\n <span class=\"swatch\" [style.background]=\"item.color\" aria-hidden=\"true\"></span>\n {{ item.label }}\n <span class=\"visibility\" [class.legend-note]=\"false\">{{\n item.visible ? 'Visible' : 'Hidden'\n }}</span>\n </button>\n }\n </div>\n @if (showDataTable()) {\n <button\n type=\"button\"\n class=\"table-toggle\"\n [disabled]=\"currentState.kind !== 'ready'\"\n [attr.aria-expanded]=\"tableExpanded()\"\n (click)=\"toggleTable()\"\n >\n {{ tableExpanded() ? 'Hide data table' : 'Show data table' }}\n </button>\n @if (tableExpanded() && currentState.kind === 'ready') {\n <nec-table-pager [pagination]=\"tablePagination\" [label]=\"title()\" />\n <div\n class=\"table-scroll\"\n tabindex=\"0\"\n role=\"region\"\n [attr.aria-label]=\"title() + ' data table'\"\n >\n <table>\n <caption>\n {{\n title()\n }}\n values\n </caption>\n <thead>\n <tr>\n <th scope=\"col\">Category</th>\n @for (item of legendItems(); track item.id) {\n <th scope=\"col\">{{ item.label }}</th>\n }\n </tr>\n </thead>\n <tbody>\n @for (row of tableRows(); track row.id) {\n <tr\n [class.selected-row]=\"row.selected\"\n [attr.aria-current]=\"row.current ? 'true' : null\"\n >\n <th scope=\"row\">\n {{ row.category }}\n @if (row.selected) {\n <span class=\"selection-label\">Selected</span>\n }\n </th>\n @for (cell of row.cells; track cell.seriesId) {\n <td>\n @if (cell.value !== null) {\n <button\n type=\"button\"\n [attr.aria-label]=\"cell.actionLabel\"\n [attr.data-preview-row]=\"row.id\"\n [attr.data-preview-series]=\"cell.seriesId\"\n (click)=\"selectPoint(cell, 'table')\"\n >\n {{ cell.text }}\n </button>\n } @else {\n <span>{{ cell.text }}</span>\n }\n </td>\n }\n </tr>\n }\n </tbody>\n </table>\n </div>\n }\n }\n </div>\n</nec-chart-frame>\n",
322
322
  styles: [":host{display:block;min-width:0}.plot{width:100%}.plot[hidden]{display:none}.legend{display:flex;flex-wrap:wrap;gap:.5rem;margin:1rem 0}button{padding:.5rem .75rem;border:1px solid var(--nec-border, #d6dce5);border-radius:.375rem;color:inherit;background:transparent;font:inherit;cursor:pointer}button:focus-visible,.table-scroll:focus-visible{outline:3px solid var(--nec-focus, #648dff);outline-offset:3px}.swatch{display:inline-block;width:.75rem;height:.75rem;border-radius:.125rem;margin-right:.375rem}.visibility{margin-left:.5rem;font-size:.75rem}.table-toggle{margin:.25rem 0}.table-scroll{overflow-x:auto;margin-top:1rem}table{width:100%;border-collapse:collapse;font-variant-numeric:tabular-nums;text-align:left}caption{padding:.5rem;text-align:left;font-weight:600}th,td{padding:.5rem;border-bottom:1px solid var(--nec-border, #d6dce5)}td{white-space:nowrap}.selected-row{background:color-mix(in srgb,var(--nec-text, #18202c) 5%,transparent)}.selected-row th{box-shadow:inset 2px 0 var(--nec-text, #18202c)}.selection-label{display:block;margin-top:2px;color:var(--nec-muted, #536176);font-size:.6875rem;font-weight:500}.legend button{position:relative;display:inline-flex;align-items:center;gap:6px}.legend button:hover{background:color-mix(in srgb,var(--nec-text, #18202c) 4%,transparent)}.legend button[aria-pressed=false]{border-style:dashed;color:var(--nec-muted, #536176)}.legend button[aria-pressed=false] .swatch{opacity:.35}.pie-legend{display:grid;grid-template-columns:repeat(auto-fit,minmax(108px,1fr));gap:8px}.pie-legend button{display:grid;grid-template-columns:8px minmax(0,1fr);gap:2px 6px;padding:8px 10px;min-width:0;text-align:left}.legend-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.legend-values{grid-column:2;display:flex;justify-content:space-between;gap:6px;font-size:11px;font-variant-numeric:tabular-nums;color:var(--nec-muted, #536176)}.donut-total{position:absolute;inset:0;margin:auto;width:min(36%,140px);height:fit-content;text-align:center;pointer-events:none}.donut-total strong{display:block;font-size:clamp(18px,3vw,26px);line-height:1.25;font-weight:600;letter-spacing:-.5px;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}.donut-total span{display:block;margin-top:4px;font-size:11px;line-height:16px;color:var(--nec-muted, #536176);overflow-wrap:anywhere}@media(max-width:600px){.pie-legend{grid-template-columns:repeat(2,minmax(0,1fr))}}.legend-values{flex-wrap:wrap;min-width:0}.legend-values>span{min-width:0;overflow-wrap:anywhere}.donut-total strong,.donut-total span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}\n", ".chart-controls{min-height:52px}.chart-controls[inert]{visibility:hidden;pointer-events:none}.plot-message{position:absolute;inset:0;display:grid;align-content:center;justify-items:center;padding:20px;margin:0;box-sizing:border-box;text-align:center;color:var(--nec-muted, #536176);font-size:13px;line-height:1.6;pointer-events:none}.visibility:not(.legend-note){position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}.scale-context{margin:0 0 8px;color:var(--nec-muted, #536176);font-size:12px;line-height:20px}.plot-message>span{max-width:34ch;padding:10px 12px;border-radius:6px;background:var(--nec-background, #fff)}\n"]
323
323
  }]
324
324
  }],
@@ -1 +1 @@
1
- {"version":3,"file":"mantha911-ng-echarts-bar.mjs","names":[],"sources":["../../../projects/chart-library/bar/src/lib/bar-browser.ts","../../../projects/chart-library/bar/src/lib/bar-options.ts","../../../projects/chart-library/bar/src/lib/bar-chart.ts","../../../projects/chart-library/core/src/lib/cartesian-chart.html"],"sourcesContent":["import { InjectionToken } from '@angular/core';\nimport type { BarRendererFactory } from './plot-controller';\nexport {\n ɵbrowserPlotEnvironment as browserPlotEnvironment,\n ɵreadCartesianTheme as readBarTheme,\n} from '@mantha911/ng-echarts/core';\nexport const BAR_RENDERER_LOADER = new InjectionToken<() => Promise<BarRendererFactory>>(\n 'Bar renderer loader',\n {\n providedIn: 'root',\n factory: () => () => import('./bar-renderer').then((module) => module.createBarRenderer),\n },\n);\n","// The first two default palette colors are adapted from EvilCharts (2026 Gurbinder, MIT).\n// See docs/UPSTREAM_PROVENANCE.md and third-party/evilcharts-LICENSE.txt in the package.\nimport type { BarSeriesOption } from 'echarts/charts';\nimport type { GridComponentOption, TooltipComponentOption } from 'echarts/components';\nimport type { ComposeOption } from 'echarts/core';\nimport type { BarModel } from './bar-model';\nimport type { BarLayout } from '@mantha911/ng-echarts/core';\n\nexport type BarOption = ComposeOption<\n BarSeriesOption | GridComponentOption | TooltipComponentOption\n>;\n\nexport {\n ɵdefaultCartesianTheme as defaultBarTheme,\n ɵescapeTooltipText as escapeTooltipText,\n} from '@mantha911/ng-echarts/core';\nexport type { ɵCartesianThemeTokens as BarThemeTokens } from '@mantha911/ng-echarts/core';\nimport { ɵbuildCartesianOptions } from '@mantha911/ng-echarts/core';\nimport type { ɵCartesianThemeTokens as BarThemeTokens } from '@mantha911/ng-echarts/core';\nfunction baseColor(color: string): string {\n if (/^#[\\da-f]{6}$/i.test(color)) {\n return `rgba(${[1, 3, 5].map((offset) => Number.parseInt(color.slice(offset, offset + 2), 16)).join(',')},0.3)`;\n }\n const rgba = color.match(/^rgba?\\(\\s*([\\d.]+)\\s*,\\s*([\\d.]+)\\s*,\\s*([\\d.]+)(?:\\s*,\\s*([\\d.]+))?/);\n return rgba ? `rgba(${rgba[1]},${rgba[2]},${rgba[3]},${Number(rgba[4] ?? 1) * 0.3})` : color;\n}\n\nexport function buildBarOptions<T>(\n model: Exclude<BarModel<T>, { kind: 'error' }>,\n hiddenIds: ReadonlySet<string>,\n tokens: BarThemeTokens,\n layout: BarLayout,\n stacked: boolean,\n gradient: boolean,\n animation: boolean,\n format: (value: number) => string,\n categoryTicks: readonly string[] = model.rows.map((row) => row.category),\n selectedRowIds: ReadonlySet<string> = new Set(),\n): BarOption {\n const horizontal = layout === 'horizontal';\n const selected = selectedRowIds.size > 0 && model.rows.some((row) => selectedRowIds.has(row.id));\n const base = ɵbuildCartesianOptions(\n model,\n hiddenIds,\n tokens,\n horizontal,\n animation,\n format,\n categoryTicks,\n );\n const categoryAxis = horizontal ? base.yAxis : base.xAxis;\n const selectedAxis = () => ({\n ...categoryAxis,\n // A category band remains visible for zero/missing values or hidden series.\n splitArea: {\n show: true,\n interval: 0,\n areaStyle: {\n color: model.rows.map((row) =>\n selectedRowIds.has(row.id) ? tokens.border : 'transparent',\n ),\n opacity: 0.3,\n },\n },\n data: model.rows.map((row) => ({\n value: row.id,\n textStyle: selectedRowIds.has(row.id) ? { color: tokens.text, fontWeight: 600 } : undefined,\n })),\n });\n return {\n ...base,\n ...(selected ? (horizontal ? { yAxis: selectedAxis() } : { xAxis: selectedAxis() }) : {}),\n series: model.series.flatMap((item, index): BarSeriesOption[] => {\n if (hiddenIds.has(item.id)) return [];\n const color = tokens.series[index % tokens.series.length] ?? '#047857';\n return [\n {\n id: item.id,\n name: item.label,\n type: 'bar',\n stack: stacked ? 'total' : undefined,\n barMaxWidth: 48,\n itemStyle: {\n borderRadius: stacked ? 0 : 3,\n color: gradient\n ? {\n type: 'linear',\n x: 0,\n y: 0,\n x2: horizontal ? 1 : 0,\n y2: horizontal ? 0 : 1,\n colorStops: [\n { offset: 0, color },\n { offset: 0.2, color },\n { offset: 0.9, color: baseColor(color) },\n { offset: 1, color: baseColor(color) },\n ],\n }\n : color,\n },\n data: model.rows.map((row) => {\n const value = row.points[index]?.value ?? null;\n const outer =\n stacked &&\n value !== null &&\n value !== 0 &&\n !model.series.some((later, laterIndex) => {\n const other = row.points[laterIndex]?.value ?? 0;\n return (\n laterIndex > index &&\n !hiddenIds.has(later.id) &&\n other !== 0 &&\n Math.sign(other) === Math.sign(value)\n );\n });\n const cap = horizontal\n ? value! < 0\n ? [3, 0, 0, 3]\n : [0, 3, 3, 0]\n : value! < 0\n ? [0, 0, 3, 3]\n : [3, 3, 0, 0];\n return {\n id: row.id,\n value: value ?? '-',\n ...(stacked || selected\n ? {\n itemStyle: {\n ...(stacked ? { borderRadius: outer ? cap : 0 } : {}),\n ...(selected ? { opacity: selectedRowIds.has(row.id) ? 1 : 0.35 } : {}),\n },\n }\n : {}),\n };\n }),\n },\n ];\n }),\n };\n}\n","import { ChangeDetectionStrategy, Component, computed, inject, input, output } from '@angular/core';\nimport {\n ChartFrame,\n ɵChartStage,\n ɵTablePager,\n ɵCartesianChart,\n type BarLayout,\n type PointPreview,\n type ɵCartesianContext,\n} from '@mantha911/ng-echarts/core';\nimport { BAR_RENDERER_LOADER } from './bar-browser';\nimport { buildBarOptions } from './bar-options';\nimport type { BarRenderOptions } from './bar-render-options';\nexport interface BarRangeSelection<T> {\n readonly fromRowId: string;\n readonly toRowId: string;\n readonly rowIds: readonly string[];\n readonly rows: readonly T[];\n readonly source: 'plot';\n}\n@Component({\n selector: 'nec-bar-chart',\n imports: [ChartFrame, ɵChartStage, ɵTablePager],\n templateUrl: '../../../core/src/lib/cartesian-chart.html',\n styleUrls: [\n '../../../core/src/lib/cartesian-chart.css',\n '../../../core/src/lib/chart-controls.css',\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class BarChart<T extends object> extends ɵCartesianChart<T, BarRenderOptions> {\n readonly rangeSelection = input(false);\n readonly previewEnabled = input(false);\n readonly pointPreview = output<PointPreview<T> | null>();\n readonly rangeSelect = output<BarRangeSelection<T>>();\n readonly layout = input<BarLayout>('vertical');\n readonly stacked = input(false);\n readonly gradient = input(false);\n readonly selectedRowId = input<string | null>(null);\n readonly selectedRowIds = input<readonly string[] | null>(null);\n private readonly selectedIds = computed<ReadonlySet<string>>(() => {\n const model = this.model();\n const available = new Set(model.kind === 'error' ? [] : model.rows.map((row) => row.id));\n const multiple = this.selectedRowIds();\n const requested =\n multiple === null ? [this.selectedRowId()] : Array.isArray(multiple) ? multiple : [];\n return new Set(\n requested.filter((id): id is string => typeof id === 'string' && available.has(id)),\n );\n });\n private readonly loader = inject(BAR_RENDERER_LOADER);\n protected override renderer() {\n return this.loader();\n }\n protected override canPreview(): boolean {\n return this.previewEnabled() && !this.rangeSelection();\n }\n protected override observePreviews(): boolean {\n // Range mode suppresses events without replaying focused values on Escape.\n return this.previewEnabled();\n }\n protected override emitPreview(point: PointPreview<T> | null): void {\n this.pointPreview.emit(point);\n }\n protected override familyConfiguration() {\n return {\n rangeSelection: this.rangeSelection(),\n layout: this.layout(),\n stacked: this.stacked(),\n gradient: this.gradient(),\n selectedRowId: this.selectedRowId(),\n selectedRowIds: this.selectedRowIds(),\n };\n }\n protected override rowSelectionId(): string | null {\n const ids = this.selectedIds();\n return ids.size === 1 ? (ids.values().next().value ?? null) : null;\n }\n protected override rowIsSelected(id: string): boolean {\n return this.selectedIds().has(id);\n }\n protected override familyError() {\n if (typeof this.previewEnabled() !== 'boolean') return 'Preview enabled must be a boolean.';\n if (typeof this.rangeSelection() !== 'boolean') return 'Range selection must be a boolean.';\n if (!['vertical', 'horizontal'].includes(this.layout())) return 'Chart layout is invalid.';\n if (this.selectedRowId() !== null && typeof this.selectedRowId() !== 'string')\n return 'Selected row ID must be a string or null.';\n const ids = this.selectedRowIds();\n return ids === null || (Array.isArray(ids) && ids.every((id) => typeof id === 'string'))\n ? null\n : 'Selected row IDs must be an array of strings or null.';\n }\n protected override selectRange(ids: readonly string[], snapshot: unknown): void {\n const model = this.model();\n if (\n snapshot !== model ||\n !this.rangeSelection() ||\n this.state().kind !== 'ready' ||\n model.kind === 'error' ||\n !ids.length\n )\n return;\n const first = model.rows.findIndex((row) => row.id === ids[0]);\n const last = model.rows.findIndex((row) => row.id === ids.at(-1));\n if (first < 0 || last < first) return;\n const rows = model.rows.slice(first, last + 1);\n if (rows.length !== ids.length || rows.some((row, index) => row.id !== ids[index])) return;\n this.resetPointPreview();\n this.rangeSelect.emit({\n fromRowId: rows[0]!.id,\n toRowId: rows.at(-1)!.id,\n rowIds: rows.map((row) => row.id),\n rows: this.data().slice(first, last + 1),\n source: 'plot',\n });\n }\n protected override buildOptions(context: ɵCartesianContext<T>): BarRenderOptions {\n return {\n chart: buildBarOptions(\n context.model,\n context.hiddenIds,\n context.tokens,\n this.layout(),\n this.stacked(),\n this.gradient(),\n context.animation,\n context.format,\n context.categoryTicks,\n this.selectedIds(),\n ),\n range: this.rangeSelection()\n ? {\n snapshot: context.model,\n ids: context.model.rows.map((row) => row.id),\n horizontal: this.layout() === 'horizontal',\n color: context.tokens.muted,\n fill: context.tokens.border,\n }\n : null,\n };\n }\n}\n","<nec-chart-frame\n [title]=\"title()\"\n [description]=\"description()\"\n [style.--_nec-default-background]=\"tokens().background\"\n [style.--_nec-default-text]=\"tokens().text\"\n [style.--_nec-default-muted]=\"tokens().muted\"\n [style.--_nec-default-border]=\"tokens().border\"\n>\n @let currentState = state();\n\n <nec-chart-stage\n [state]=\"currentState\"\n [height]=\"plotHeight()\"\n [retryable]=\"rendererError()\"\n (retry)=\"retryRenderer()\"\n >\n <div\n #plot\n class=\"plot\"\n [hidden]=\"currentState.kind !== 'ready'\"\n [style.height.px]=\"plotHeight()\"\n aria-hidden=\"true\"\n ></div>\n\n @if (currentState.kind === 'ready' && allSeriesHidden()) {\n <div class=\"plot-message\" role=\"status\">\n <span>All series are hidden. Choose a series below.</span>\n </div>\n }\n </nec-chart-stage>\n <div\n class=\"chart-controls\"\n [attr.inert]=\"currentState.kind !== 'ready' ? '' : null\"\n [attr.aria-hidden]=\"currentState.kind !== 'ready' ? 'true' : null\"\n >\n <div class=\"legend\" aria-label=\"Chart series\">\n @for (item of legendItems(); track item.id) {\n <button\n type=\"button\"\n [disabled]=\"currentState.kind !== 'ready'\"\n [attr.aria-pressed]=\"item.visible\"\n (click)=\"toggleSeries(item.id)\"\n >\n <span class=\"swatch\" [style.background]=\"item.color\" aria-hidden=\"true\"></span>\n {{ item.label }}\n <span class=\"visibility\" [class.legend-note]=\"false\">{{\n item.visible ? 'Visible' : 'Hidden'\n }}</span>\n </button>\n }\n </div>\n @if (showDataTable()) {\n <button\n type=\"button\"\n class=\"table-toggle\"\n [disabled]=\"currentState.kind !== 'ready'\"\n [attr.aria-expanded]=\"tableExpanded()\"\n (click)=\"toggleTable()\"\n >\n {{ tableExpanded() ? 'Hide data table' : 'Show data table' }}\n </button>\n @if (tableExpanded() && currentState.kind === 'ready') {\n <nec-table-pager [pagination]=\"tablePagination\" [label]=\"title()\" />\n <div\n class=\"table-scroll\"\n tabindex=\"0\"\n role=\"region\"\n [attr.aria-label]=\"title() + ' data table'\"\n >\n <table>\n <caption>\n {{\n title()\n }}\n values\n </caption>\n <thead>\n <tr>\n <th scope=\"col\">Category</th>\n @for (item of legendItems(); track item.id) {\n <th scope=\"col\">{{ item.label }}</th>\n }\n </tr>\n </thead>\n <tbody>\n @for (row of tableRows(); track row.id) {\n <tr\n [class.selected-row]=\"row.selected\"\n [attr.aria-current]=\"row.current ? 'true' : null\"\n >\n <th scope=\"row\">\n {{ row.category }}\n @if (row.selected) {\n <span class=\"selection-label\">Selected</span>\n }\n </th>\n @for (cell of row.cells; track cell.seriesId) {\n <td>\n @if (cell.value !== null) {\n <button\n type=\"button\"\n [attr.aria-label]=\"cell.actionLabel\"\n [attr.data-preview-row]=\"row.id\"\n [attr.data-preview-series]=\"cell.seriesId\"\n (click)=\"selectPoint(cell, 'table')\"\n >\n {{ cell.text }}\n </button>\n } @else {\n <span>{{ cell.text }}</span>\n }\n </td>\n }\n </tr>\n }\n </tbody>\n </table>\n </div>\n }\n }\n </div>\n</nec-chart-frame>\n"],"mappings":";;;AAMA,MAAa,sBAAsB,IAAI,eACrC,uBACA;CACE,YAAY;CACZ,qBAAqB,OAAO,uDAAiB,CAAC,MAAM,WAAW,OAAO,iBAAiB;AACxF,CAAA;ACQH,SAAS,UAAU,OAAa;CAC9B,IAAI,iBAAiB,KAAK,KAAK,GAC7B,OAAO,QAAQ;EAAC;EAAG;EAAG;CAAC,CAAC,CAAC,KAAK,WAAW,OAAO,SAAS,MAAM,MAAM,QAAQ,SAAS,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,EAAC;CAE1G,MAAM,OAAO,MAAM,MAAM,uEAAuE;CAChG,OAAO,OAAO,QAAQ,KAAK,GAAE,GAAI,KAAK,GAAE,GAAI,KAAK,GAAE,GAAI,OAAO,KAAK,MAAM,CAAC,IAAI,GAAG,KAAM;AACzF;AAEA,SAAgB,gBACd,OACA,WACA,QACA,QACA,SACA,UACA,WACA,QACA,gBAAmC,MAAM,KAAK,KAAK,QAAQ,IAAI,QAAQ,GACvE,iCAAsC,IAAI,IAAG,GAAE;CAE/C,MAAM,aAAa,WAAW;CAC9B,MAAM,WAAW,eAAe,OAAO,KAAK,MAAM,KAAK,MAAM,QAAQ,eAAe,IAAI,IAAI,EAAE,CAA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AA;EAAA,UC9BrB;EA0HA,QAAA,CAAA,wjFAAA,wrBAAA;EAAA,cAAA;GAAA;IAAA,MAAA;IAAA,MDpGY;IAAU,UAAA;IAAA,QAAA,CAAA,SAAA,aAAA;GAAA;GAAA;IAAA,MAAA;IAAA,MAAE;IAAW,UAAA;IAAA,QAAA;KAAA;KAAA;KAAA;KAAA;IAAA;IAAA,SAAA,CAAA,OAAA;GAAA;GAAA;IAAA,MAAA;IAAA,MAAE;IAAW,UAAA;IAAA,QAAA,CAAA,cAAA,OAAA;GAAA;EAAA;EAAA,iBAAA,GAAA,wBAAA;CAAA,CAAA;;AAQnC,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAQ,YAAA,CAAA;EAVpB,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAe,SAChB;IAAC;IAAY;IAAa;GAAW;GAAC,iBAM9B,wBAAwB;GAAM,UAAA;GAAA,QAAA,CAAA,wjFAAA,wrBAAA;EAAA,CAAA"}
1
+ {"version":3,"file":"mantha911-ng-echarts-bar.mjs","names":[],"sources":["../../../projects/chart-library/bar/src/lib/bar-browser.ts","../../../projects/chart-library/bar/src/lib/bar-options.ts","../../../projects/chart-library/bar/src/lib/bar-chart.ts","../../../projects/chart-library/core/src/lib/cartesian-chart.html"],"sourcesContent":["import { InjectionToken } from '@angular/core';\nimport type { BarRendererFactory } from './plot-controller';\nexport {\n ɵbrowserPlotEnvironment as browserPlotEnvironment,\n ɵreadCartesianTheme as readBarTheme,\n} from '@mantha911/ng-echarts/core';\nexport const BAR_RENDERER_LOADER = new InjectionToken<() => Promise<BarRendererFactory>>(\n 'Bar renderer loader',\n {\n providedIn: 'root',\n factory: () => () => import('./bar-renderer').then((module) => module.createBarRenderer),\n },\n);\n","// The first two default palette colors are adapted from EvilCharts (2026 Gurbinder, MIT).\n// See docs/UPSTREAM_PROVENANCE.md and third-party/evilcharts-LICENSE.txt in the package.\nimport type { BarSeriesOption } from 'echarts/charts';\nimport type { GridComponentOption, TooltipComponentOption } from 'echarts/components';\nimport type { ComposeOption } from 'echarts/core';\nimport type { BarModel } from './bar-model';\nimport type { BarLayout } from '@mantha911/ng-echarts/core';\n\nexport type BarOption = ComposeOption<\n BarSeriesOption | GridComponentOption | TooltipComponentOption\n>;\n\nexport {\n ɵdefaultCartesianTheme as defaultBarTheme,\n ɵescapeTooltipText as escapeTooltipText,\n} from '@mantha911/ng-echarts/core';\nexport type { ɵCartesianThemeTokens as BarThemeTokens } from '@mantha911/ng-echarts/core';\nimport { ɵbuildCartesianOptions } from '@mantha911/ng-echarts/core';\nimport type { ɵCartesianThemeTokens as BarThemeTokens } from '@mantha911/ng-echarts/core';\nfunction baseColor(color: string): string {\n if (/^#[\\da-f]{6}$/i.test(color)) {\n return `rgba(${[1, 3, 5].map((offset) => Number.parseInt(color.slice(offset, offset + 2), 16)).join(',')},0.3)`;\n }\n const rgba = color.match(/^rgba?\\(\\s*([\\d.]+)\\s*,\\s*([\\d.]+)\\s*,\\s*([\\d.]+)(?:\\s*,\\s*([\\d.]+))?/);\n return rgba ? `rgba(${rgba[1]},${rgba[2]},${rgba[3]},${Number(rgba[4] ?? 1) * 0.3})` : color;\n}\n\nexport function buildBarOptions<T>(\n model: Exclude<BarModel<T>, { kind: 'error' }>,\n hiddenIds: ReadonlySet<string>,\n tokens: BarThemeTokens,\n layout: BarLayout,\n stacked: boolean,\n gradient: boolean,\n animation: boolean,\n format: (value: number) => string,\n categoryTicks: readonly string[] = model.rows.map((row) => row.category),\n selectedRowIds: ReadonlySet<string> = new Set(),\n): BarOption {\n const horizontal = layout === 'horizontal';\n const selected = selectedRowIds.size > 0 && model.rows.some((row) => selectedRowIds.has(row.id));\n const base = ɵbuildCartesianOptions(\n model,\n hiddenIds,\n tokens,\n horizontal,\n animation,\n format,\n categoryTicks,\n );\n const categoryAxis = horizontal ? base.yAxis : base.xAxis;\n const selectedAxis = () => ({\n ...categoryAxis,\n // A category band remains visible for zero/missing values or hidden series.\n splitArea: {\n show: true,\n interval: 0,\n areaStyle: {\n color: model.rows.map((row) =>\n selectedRowIds.has(row.id) ? tokens.border : 'transparent',\n ),\n opacity: 0.3,\n },\n },\n data: model.rows.map((row) => ({\n value: row.id,\n textStyle: selectedRowIds.has(row.id) ? { color: tokens.text, fontWeight: 600 } : undefined,\n })),\n });\n return {\n ...base,\n ...(selected ? (horizontal ? { yAxis: selectedAxis() } : { xAxis: selectedAxis() }) : {}),\n series: model.series.flatMap((item, index): BarSeriesOption[] => {\n if (hiddenIds.has(item.id)) return [];\n const color = tokens.series[index % tokens.series.length] ?? '#047857';\n return [\n {\n id: item.id,\n name: item.label,\n type: 'bar',\n stack: stacked ? 'total' : undefined,\n barMaxWidth: 48,\n itemStyle: {\n borderRadius: stacked ? 0 : 3,\n color: gradient\n ? {\n type: 'linear',\n x: 0,\n y: 0,\n x2: horizontal ? 1 : 0,\n y2: horizontal ? 0 : 1,\n colorStops: [\n { offset: 0, color },\n { offset: 0.2, color },\n { offset: 0.9, color: baseColor(color) },\n { offset: 1, color: baseColor(color) },\n ],\n }\n : color,\n },\n data: model.rows.map((row) => {\n const value = row.points[index]?.value ?? null;\n const outer =\n stacked &&\n value !== null &&\n value !== 0 &&\n !model.series.some((later, laterIndex) => {\n const other = row.points[laterIndex]?.value ?? 0;\n return (\n laterIndex > index &&\n !hiddenIds.has(later.id) &&\n other !== 0 &&\n Math.sign(other) === Math.sign(value)\n );\n });\n const cap = horizontal\n ? value! < 0\n ? [3, 0, 0, 3]\n : [0, 3, 3, 0]\n : value! < 0\n ? [0, 0, 3, 3]\n : [3, 3, 0, 0];\n return {\n id: row.id,\n value: value ?? '-',\n ...(stacked || selected\n ? {\n itemStyle: {\n ...(stacked ? { borderRadius: outer ? cap : 0 } : {}),\n ...(selected ? { opacity: selectedRowIds.has(row.id) ? 1 : 0.35 } : {}),\n },\n }\n : {}),\n };\n }),\n },\n ];\n }),\n };\n}\n","import { ChangeDetectionStrategy, Component, computed, inject, input, output } from '@angular/core';\nimport {\n ChartFrame,\n ɵChartStage,\n ɵTablePager,\n ɵCartesianChart,\n type BarLayout,\n type PointPreview,\n type ɵCartesianContext,\n} from '@mantha911/ng-echarts/core';\nimport { BAR_RENDERER_LOADER } from './bar-browser';\nimport { buildBarOptions } from './bar-options';\nimport type { BarRenderOptions } from './bar-render-options';\nexport interface BarRangeSelection<T> {\n readonly fromRowId: string;\n readonly toRowId: string;\n readonly rowIds: readonly string[];\n readonly rows: readonly T[];\n readonly source: 'plot';\n}\n@Component({\n selector: 'nec-bar-chart',\n imports: [ChartFrame, ɵChartStage, ɵTablePager],\n templateUrl: '../../../core/src/lib/cartesian-chart.html',\n styleUrls: [\n '../../../core/src/lib/cartesian-chart.css',\n '../../../core/src/lib/chart-controls.css',\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class BarChart<T extends object> extends ɵCartesianChart<T, BarRenderOptions> {\n readonly rangeSelection = input(false);\n readonly previewEnabled = input(false);\n readonly pointPreview = output<PointPreview<T> | null>();\n readonly rangeSelect = output<BarRangeSelection<T>>();\n readonly layout = input<BarLayout>('vertical');\n readonly stacked = input(false);\n readonly gradient = input(false);\n readonly selectedRowId = input<string | null>(null);\n readonly selectedRowIds = input<readonly string[] | null>(null);\n private readonly selectedIds = computed<ReadonlySet<string>>(() => {\n const model = this.model();\n const available = new Set(model.kind === 'error' ? [] : model.rows.map((row) => row.id));\n const multiple = this.selectedRowIds();\n const requested =\n multiple === null ? [this.selectedRowId()] : Array.isArray(multiple) ? multiple : [];\n return new Set(\n requested.filter((id): id is string => typeof id === 'string' && available.has(id)),\n );\n });\n private readonly loader = inject(BAR_RENDERER_LOADER);\n protected override renderer() {\n return this.loader();\n }\n protected override canPreview(): boolean {\n return this.previewEnabled() && !this.rangeSelection();\n }\n protected override observePreviews(): boolean {\n // Range mode suppresses events without replaying focused values on Escape.\n return this.previewEnabled();\n }\n protected override emitPreview(point: PointPreview<T> | null): void {\n this.pointPreview.emit(point);\n }\n protected override familyConfiguration() {\n return {\n rangeSelection: this.rangeSelection(),\n layout: this.layout(),\n stacked: this.stacked(),\n gradient: this.gradient(),\n selectedRowId: this.selectedRowId(),\n selectedRowIds: this.selectedRowIds(),\n };\n }\n protected override rowSelectionId(): string | null {\n const ids = this.selectedIds();\n return ids.size === 1 ? (ids.values().next().value ?? null) : null;\n }\n protected override rowIsSelected(id: string): boolean {\n return this.selectedIds().has(id);\n }\n protected override familyError() {\n if (typeof this.previewEnabled() !== 'boolean') return 'Preview enabled must be a boolean.';\n if (typeof this.rangeSelection() !== 'boolean') return 'Range selection must be a boolean.';\n if (!['vertical', 'horizontal'].includes(this.layout())) return 'Chart layout is invalid.';\n if (this.selectedRowId() !== null && typeof this.selectedRowId() !== 'string')\n return 'Selected row ID must be a string or null.';\n const ids = this.selectedRowIds();\n return ids === null || (Array.isArray(ids) && ids.every((id) => typeof id === 'string'))\n ? null\n : 'Selected row IDs must be an array of strings or null.';\n }\n protected override selectRange(ids: readonly string[], snapshot: unknown): void {\n const model = this.model();\n if (\n snapshot !== model ||\n !this.rangeSelection() ||\n this.state().kind !== 'ready' ||\n model.kind === 'error' ||\n !ids.length\n )\n return;\n const first = model.rows.findIndex((row) => row.id === ids[0]);\n const last = model.rows.findIndex((row) => row.id === ids.at(-1));\n if (first < 0 || last < first) return;\n const rows = model.rows.slice(first, last + 1);\n if (rows.length !== ids.length || rows.some((row, index) => row.id !== ids[index])) return;\n this.resetPointPreview();\n this.rangeSelect.emit({\n fromRowId: rows[0]!.id,\n toRowId: rows.at(-1)!.id,\n rowIds: rows.map((row) => row.id),\n rows: this.data().slice(first, last + 1),\n source: 'plot',\n });\n }\n protected override buildOptions(context: ɵCartesianContext<T>): BarRenderOptions {\n return {\n chart: buildBarOptions(\n context.model,\n context.hiddenIds,\n context.tokens,\n this.layout(),\n this.stacked(),\n this.gradient(),\n context.animation,\n context.format,\n context.categoryTicks,\n this.selectedIds(),\n ),\n range: this.rangeSelection()\n ? {\n snapshot: context.model,\n ids: context.model.rows.map((row) => row.id),\n horizontal: this.layout() === 'horizontal',\n color: context.tokens.muted,\n fill: context.tokens.border,\n }\n : null,\n };\n }\n}\n","<nec-chart-frame\n [title]=\"title()\"\n [description]=\"description()\"\n [style.--_nec-default-background]=\"tokens().background\"\n [style.--_nec-default-text]=\"tokens().text\"\n [style.--_nec-default-muted]=\"tokens().muted\"\n [style.--_nec-default-border]=\"tokens().border\"\n>\n @let currentState = state();\n @if (valueAxisDescription()) {\n <p class=\"scale-context\">{{ valueAxisDescription() }}</p>\n }\n\n <nec-chart-stage\n [state]=\"currentState\"\n [height]=\"plotHeight()\"\n [retryable]=\"rendererError()\"\n (retry)=\"retryRenderer()\"\n >\n <div\n #plot\n class=\"plot\"\n [hidden]=\"currentState.kind !== 'ready'\"\n [style.height.px]=\"plotHeight()\"\n aria-hidden=\"true\"\n ></div>\n\n @if (currentState.kind === 'ready' && allSeriesHidden()) {\n <div class=\"plot-message\" role=\"status\">\n <span>All series are hidden. Choose a series below.</span>\n </div>\n }\n </nec-chart-stage>\n <div\n class=\"chart-controls\"\n [attr.inert]=\"currentState.kind !== 'ready' ? '' : null\"\n [attr.aria-hidden]=\"currentState.kind !== 'ready' ? 'true' : null\"\n >\n <div class=\"legend\" aria-label=\"Chart series\">\n @for (item of legendItems(); track item.id) {\n <button\n type=\"button\"\n [disabled]=\"currentState.kind !== 'ready'\"\n [attr.aria-pressed]=\"item.visible\"\n (click)=\"toggleSeries(item.id)\"\n >\n <span class=\"swatch\" [style.background]=\"item.color\" aria-hidden=\"true\"></span>\n {{ item.label }}\n <span class=\"visibility\" [class.legend-note]=\"false\">{{\n item.visible ? 'Visible' : 'Hidden'\n }}</span>\n </button>\n }\n </div>\n @if (showDataTable()) {\n <button\n type=\"button\"\n class=\"table-toggle\"\n [disabled]=\"currentState.kind !== 'ready'\"\n [attr.aria-expanded]=\"tableExpanded()\"\n (click)=\"toggleTable()\"\n >\n {{ tableExpanded() ? 'Hide data table' : 'Show data table' }}\n </button>\n @if (tableExpanded() && currentState.kind === 'ready') {\n <nec-table-pager [pagination]=\"tablePagination\" [label]=\"title()\" />\n <div\n class=\"table-scroll\"\n tabindex=\"0\"\n role=\"region\"\n [attr.aria-label]=\"title() + ' data table'\"\n >\n <table>\n <caption>\n {{\n title()\n }}\n values\n </caption>\n <thead>\n <tr>\n <th scope=\"col\">Category</th>\n @for (item of legendItems(); track item.id) {\n <th scope=\"col\">{{ item.label }}</th>\n }\n </tr>\n </thead>\n <tbody>\n @for (row of tableRows(); track row.id) {\n <tr\n [class.selected-row]=\"row.selected\"\n [attr.aria-current]=\"row.current ? 'true' : null\"\n >\n <th scope=\"row\">\n {{ row.category }}\n @if (row.selected) {\n <span class=\"selection-label\">Selected</span>\n }\n </th>\n @for (cell of row.cells; track cell.seriesId) {\n <td>\n @if (cell.value !== null) {\n <button\n type=\"button\"\n [attr.aria-label]=\"cell.actionLabel\"\n [attr.data-preview-row]=\"row.id\"\n [attr.data-preview-series]=\"cell.seriesId\"\n (click)=\"selectPoint(cell, 'table')\"\n >\n {{ cell.text }}\n </button>\n } @else {\n <span>{{ cell.text }}</span>\n }\n </td>\n }\n </tr>\n }\n </tbody>\n </table>\n </div>\n }\n }\n </div>\n</nec-chart-frame>\n"],"mappings":";;;AAMA,MAAa,sBAAsB,IAAI,eACrC,uBACA;CACE,YAAY;CACZ,qBAAqB,OAAO,uDAAiB,CAAC,MAAM,WAAW,OAAO,iBAAiB;AACxF,CAAA;ACQH,SAAS,UAAU,OAAa;CAC9B,IAAI,iBAAiB,KAAK,KAAK,GAC7B,OAAO,QAAQ;EAAC;EAAG;EAAG;CAAC,CAAC,CAAC,KAAK,WAAW,OAAO,SAAS,MAAM,MAAM,QAAQ,SAAS,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,EAAC;CAE1G,MAAM,OAAO,MAAM,MAAM,uEAAuE;CAChG,OAAO,OAAO,QAAQ,KAAK,GAAE,GAAI,KAAK,GAAE,GAAI,KAAK,GAAE,G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AAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,eAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,gBAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;EAAA;EAAA,SAAA;GAAA,cAAA;GAAA,aAAA;EAAA;EAAA,iBAAA;EAAA,UAAA;EAAA,UC9BrB;EA6HA,QAAA,CAAA,wjFAAA,wrBAAA;EAAA,cAAA;GAAA;IAAA,MAAA;IAAA,MDvGY;IAAU,UAAA;IAAA,QAAA,CAAA,SAAA,aAAA;GAAA;GAAA;IAAA,MAAA;IAAA,MAAE;IAAW,UAAA;IAAA,QAAA;KAAA;KAAA;KAAA;KAAA;IAAA;IAAA,SAAA,CAAA,OAAA;GAAA;GAAA;IAAA,MAAA;IAAA,MAAE;IAAW,UAAA;IAAA,QAAA,CAAA,cAAA,OAAA;GAAA;EAAA;EAAA,iBAAA,GAAA,wBAAA;CAAA,CAAA;;AAQnC,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAQ,YAAA,CAAA;EAVpB,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAe,SAChB;IAAC;IAAY;IAAa;GAAW;GAAC,iBAM9B,wBAAwB;GAAM,UAAA;GAAA,QAAA,CAAA,wjFAAA,wrBAAA;EAAA,CAAA"}
@@ -0,0 +1,15 @@
1
+ import { ɵcreateCurveRenderer } from "@mantha911/ng-echarts/core";
2
+ import "echarts/lib/chart/bar";
3
+ import "echarts/lib/chart/line";
4
+ import { GridComponent, TooltipComponent } from "echarts/components";
5
+ import { init, use } from "echarts/core";
6
+ import { CanvasRenderer } from "echarts/renderers";
7
+ use([
8
+ GridComponent,
9
+ TooltipComponent,
10
+ CanvasRenderer
11
+ ]);
12
+ const createComposedRenderer = (host, onPoint) => ɵcreateCurveRenderer(init(host, void 0, { renderer: "canvas" }), onPoint);
13
+ export { createComposedRenderer };
14
+
15
+ //# sourceMappingURL=mantha911-ng-echarts-composed-composed-renderer-CSFZOsup.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mantha911-ng-echarts-composed-composed-renderer-CSFZOsup.mjs","names":[],"sources":["../../../projects/chart-library/composed/src/lib/composed-renderer.ts"],"sourcesContent":["// Use exported per-chart entries to preserve independent lazy engine chunks.\nimport 'echarts/lib/chart/bar';\nimport 'echarts/lib/chart/line';\nimport { GridComponent, TooltipComponent } from 'echarts/components';\nimport { init, use } from 'echarts/core';\nimport { CanvasRenderer } from 'echarts/renderers';\nimport { ɵcreateCurveRenderer, type ɵPlotRendererFactory } from '@mantha911/ng-echarts/core';\nimport type { ComposedOption } from './composed-options';\nuse([GridComponent, TooltipComponent, CanvasRenderer]);\nexport const createComposedRenderer: ɵPlotRendererFactory<ComposedOption> = (host, onPoint) =>\n ɵcreateCurveRenderer<ComposedOption>(init(host, undefined, { renderer: 'canvas' }), onPoint);\n"],"mappings":";;;;;;AAQA,IAAI;CAAC;CAAe;CAAkB;AAAc,CAAC;AACrD,MAAa,0BAAgE,MAAM,YACjF,qBAAqC,KAAK,MAAM,QAAW,EAAE,UAAU,SAAQ,CAAE,GAAG,OAAO"}