@blukavantui/charts-community 1.0.1 → 1.2.0

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 (98) hide show
  1. package/LICENSE.txt +0 -2
  2. package/README.md +75 -70
  3. package/dist/bar.js +1 -1
  4. package/dist/browser/charts-community.css +1 -1
  5. package/dist/browser/charts-community.js +17 -17
  6. package/dist/build-audit.json +129 -84
  7. package/dist/catalogue-runtime.d.ts +13 -1
  8. package/dist/chunk-2GUWWKHW.js +1 -0
  9. package/dist/chunk-3PITHTEO.js +1 -0
  10. package/dist/chunk-4B5MQ6GZ.js +1 -0
  11. package/dist/chunk-4EQMOBBN.js +1 -0
  12. package/dist/chunk-4WDZUJDS.js +1 -0
  13. package/dist/chunk-5NUOOMHV.js +1 -0
  14. package/dist/chunk-7OCMRHIH.js +1 -0
  15. package/dist/chunk-CF5Q2DDP.js +1 -0
  16. package/dist/chunk-EITBQBN2.js +1 -0
  17. package/dist/chunk-FXNKAHRG.js +1 -0
  18. package/dist/chunk-IDMAFTWV.js +1 -0
  19. package/dist/chunk-ILTENI35.js +1 -0
  20. package/dist/chunk-KRMM7EWI.js +1 -0
  21. package/dist/chunk-LUUPBBD4.js +1 -0
  22. package/dist/chunk-MR5VITXX.js +1 -0
  23. package/dist/chunk-NASBRHIW.js +1 -0
  24. package/dist/chunk-NXDBBMF5.js +1 -0
  25. package/dist/chunk-OQ6MP7PY.js +1 -0
  26. package/dist/{chunk-QETOF22L.js → chunk-RC2TCMJF.js} +1 -1
  27. package/dist/{chunk-MSZ5J5WG.js → chunk-RXOGAN23.js} +1 -1
  28. package/dist/chunk-UGXWOWAG.js +2 -0
  29. package/dist/chunk-UO2KNHTU.js +2 -0
  30. package/dist/chunk-UQMMBG26.js +3 -0
  31. package/dist/chunk-VTJ4XPRV.js +1 -0
  32. package/dist/chunk-WJ3UHH6J.js +1 -0
  33. package/dist/chunk-XLJUSNGV.js +1 -0
  34. package/dist/doughnut.js +1 -1
  35. package/dist/heatmap.js +1 -1
  36. package/dist/index.js +1 -1
  37. package/dist/line.js +1 -1
  38. package/dist/motion/bar.css +1 -0
  39. package/dist/motion/bar.d.ts +8 -0
  40. package/dist/motion/bar.js +1 -0
  41. package/dist/motion/doughnut.css +1 -0
  42. package/dist/motion/doughnut.d.ts +8 -0
  43. package/dist/motion/doughnut.js +1 -0
  44. package/dist/motion/heatmap.css +1 -0
  45. package/dist/motion/heatmap.d.ts +7 -0
  46. package/dist/motion/heatmap.js +1 -0
  47. package/dist/motion/line.css +1 -0
  48. package/dist/motion/line.d.ts +8 -0
  49. package/dist/motion/line.js +1 -0
  50. package/dist/motion/pie.css +1 -0
  51. package/dist/motion/pie.d.ts +8 -0
  52. package/dist/motion/pie.js +1 -0
  53. package/dist/motion/radar.css +1 -0
  54. package/dist/motion/radar.d.ts +8 -0
  55. package/dist/motion/radar.js +1 -0
  56. package/dist/motion/scatter.css +1 -0
  57. package/dist/motion/scatter.d.ts +8 -0
  58. package/dist/motion/scatter.js +1 -0
  59. package/dist/motion/sparkline.d.ts +7 -0
  60. package/dist/motion/sparkline.js +1 -0
  61. package/dist/motion-collection.d.ts +7 -0
  62. package/dist/motion-community.d.ts +40 -0
  63. package/dist/motion-policy.d.ts +14 -0
  64. package/dist/motion.css +1 -0
  65. package/dist/motion.d.ts +40 -0
  66. package/dist/motion.js +1 -0
  67. package/dist/pie.js +1 -1
  68. package/dist/radar.js +1 -1
  69. package/dist/scatter.js +1 -1
  70. package/dist/sparkline.js +1 -1
  71. package/dist/styles.css +8 -0
  72. package/dist/web-api.json +162 -2
  73. package/dist/web-motion-sparkline.d.ts +4 -0
  74. package/edition.json +1 -1
  75. package/package.json +40 -33
  76. package/src/catalogue-runtime.ts +49 -5
  77. package/src/motion/bar.ts +15 -0
  78. package/src/motion/doughnut.ts +14 -0
  79. package/src/motion/heatmap.ts +14 -0
  80. package/src/motion/line.ts +15 -0
  81. package/src/motion/pie.ts +14 -0
  82. package/src/motion/radar.ts +15 -0
  83. package/src/motion/scatter.ts +15 -0
  84. package/src/motion/sparkline.ts +10 -0
  85. package/src/motion-collection.ts +20 -0
  86. package/src/motion-community.ts +22 -0
  87. package/src/motion-policy.ts +36 -0
  88. package/src/web-motion-sparkline.ts +37 -0
  89. package/dist/chunk-5NXLEMCV.js +0 -3
  90. package/dist/chunk-FHHQWCUO.js +0 -1
  91. package/dist/chunk-FZ7J7BEC.js +0 -1
  92. package/dist/chunk-JNSBTZUP.js +0 -2
  93. package/dist/chunk-KCW3WN5P.js +0 -1
  94. package/dist/chunk-QBKO4AG7.js +0 -1
  95. package/dist/chunk-QFXXWRD5.js +0 -1
  96. package/dist/chunk-YJKEV5J7.js +0 -2
  97. package/scripts/build.mjs +0 -31
  98. package/tsconfig.json +0 -16
@@ -0,0 +1 @@
1
+ .blu-chart__body{display:grid;grid-template-columns:minmax(0,1fr);gap:12px;min-width:0}.blu-chart__body[data-legend-position=Top] .blu-chart__legend{grid-row:1}.blu-chart__body[data-legend-position=Bottom] .blu-chart__legend{grid-row:2}.blu-chart__body[data-legend-position=Left]{grid-template-columns:190px minmax(0,1fr);align-items:center}.blu-chart__body[data-legend-position=Right]{grid-template-columns:minmax(0,1fr) 190px;align-items:center}.blu-chart__body[data-legend-position=Left] .blu-chart__legend{grid-column:1;grid-row:1}.blu-chart__body[data-legend-position=Left] .blu-chart__stage,.blu-chart__body[data-legend-position=Right] .blu-chart__legend{grid-column:2;grid-row:1}.blu-chart__body[data-legend-position=Right] .blu-chart__stage{grid-column:1;grid-row:1}.blu-chart__body.blu-chart__body--no-legend{grid-template-columns:minmax(0,1fr);gap:0}.blu-chart__body--no-legend .blu-chart__stage{grid-column:1!important;grid-row:1!important}.blu-chart__legend{--legend-selected:color-mix(in srgb,var(--bluui-primary) 9%,var(--bluui-surface));min-width:0;padding:8px 20px 16px;font:12px/1.45 var(--bluui-font,Inter,system-ui,sans-serif);color:var(--bluui-text)}.blu-chart__legend-items{display:flex;flex-wrap:wrap;gap:8px}.blu-chart__legend-entry{min-width:0;max-width:100%;display:flex;align-items:center;gap:10px;border:1px solid transparent;background:transparent;color:inherit;font:inherit;text-align:left;padding:7px 8px;border-radius:8px;cursor:pointer;min-height:36px}.blu-chart__legend-entry:hover{background:var(--bluui-surface-muted)}.blu-chart__legend-entry[aria-pressed=true]{text-decoration:none;background:var(--legend-selected)}.blu-chart__legend-heading{display:flex;align-items:center;gap:7px;min-width:0}.blu-chart__legend-marker{display:flex;flex-shrink:0}.blu-chart__legend-text{overflow-wrap:anywhere}.blu-chart__legend-label{font-weight:500}.blu-chart__legend-detail,.blu-chart__legend-percent,.blu-chart__legend-note{font-size:11px;color:var(--bluui-text-muted)}.blu-chart__legend-numbers{display:flex;align-items:baseline;gap:10px;min-width:0;font-variant-numeric:tabular-nums}.blu-chart__legend-value{font-weight:600;letter-spacing:-.25px}.blu-chart__legend-check{visibility:hidden;margin-left:auto;color:var(--bluui-primary);font-weight:700;font-size:12px}[aria-pressed=true] .blu-chart__legend-check{visibility:visible}.blu-chart__legend[data-style=Standard] .blu-chart__legend-detail,.blu-chart__legend[data-style=Standard] .blu-chart__legend-check{display:none}.blu-chart__legend[data-style=Standard] .blu-chart__legend-value{font-size:11px;color:var(--bluui-text-muted)}.blu-chart__legend-track{display:none;height:3px;background:var(--bluui-border);border-radius:2px;overflow:hidden}.blu-chart__legend-track>span{display:block;height:100%}.blu-chart__legend-chip-host{min-width:0;max-width:100%}.blu-chart__legend .blu-chip.blu-chart__legend-chip{--chip-bg:transparent;--chip-fg:var(--bluui-text);--chip-border:var(--bluui-border);max-width:100%;box-shadow:none}.blu-chart__legend .blu-chart__legend-chip.blu-chip--selected{--chip-bg:var(--legend-selected);--chip-border:var(--bluui-primary);box-shadow:none}.blu-chart__legend .blu-chart__legend-chip .blu-chip__select{min-height:38px;padding:9px 12px;gap:10px;font:inherit;font-size:11px;text-align:left;justify-content:flex-start}.blu-chart__legend-chip .blu-chart__legend-label{font-weight:500}.blu-chart__legend-chip .blu-chart__legend-detail,.blu-chart__legend-chip .blu-chart__legend-check{display:none}.blu-chart__legend-chip [aria-pressed=true]{text-decoration:none}.blu-chart__legend-chip [aria-pressed=true] .blu-chart__legend-label{text-decoration:underline;text-underline-offset:3px}.blu-chart__legend-chip .blu-chart__legend-numbers{gap:7px;flex-wrap:wrap}.blu-chart__legend[data-style=ValueList] .blu-chart__legend-items,.blu-chart__legend[data-style=SummaryCards] .blu-chart__legend-items{display:grid;grid-template-columns:repeat(var(--legend-columns,1),minmax(0,1fr));gap:10px}.blu-chart__legend[data-style=ValueList] .blu-chart__legend-entry{display:flex;flex-direction:column;align-items:stretch;gap:5px;padding:10px 11px;border:0}.blu-chart__legend[data-style=ValueList] .blu-chart__legend-numbers{margin-left:23px;justify-content:space-between}.blu-chart__legend[data-style=ValueList] .blu-chart__legend-value{font-size:19px;letter-spacing:-.4px;line-height:1.3}.blu-chart__legend[data-style=ValueList] .blu-chart__legend-detail{margin-left:23px}.blu-chart__legend[data-style=ValueList] .blu-chart__legend-track{display:block;margin:3px 0 0 23px}.blu-chart__legend[data-style=SummaryCards] .blu-chart__legend-entry{display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;gap:0;padding:12px;min-height:36px;align-self:start;border-color:var(--bluui-border);border-radius:12px}.blu-chart__legend[data-style=SummaryCards] .blu-chart__legend-entry[aria-pressed=true]{border-color:var(--bluui-primary)}.blu-chart__legend[data-style=SummaryCards] .blu-chart__legend-heading{font-size:11px}.blu-chart__legend[data-style=SummaryCards] .blu-chart__legend-numbers{flex-direction:column;align-items:stretch;gap:6px;margin-top:10px}.blu-chart__legend[data-style=SummaryCards] .blu-chart__legend-value{font-size:24px;letter-spacing:-.6px;line-height:1.2}.blu-chart__legend[data-style=SummaryCards] .blu-chart__legend-detail{margin-top:6px}.blu-chart__body:is([data-legend-position=Left],[data-legend-position=Right]) .blu-chart__legend{padding:8px 12px 16px}.blu-chart__body:is([data-legend-position=Left],[data-legend-position=Right]) .blu-chart__legend-items{display:flex;flex-direction:column}.blu-chart__body:is([data-legend-position=Left],[data-legend-position=Right]) .blu-chart__legend-entry{width:100%}.blu-chart__body:is([data-legend-position=Left],[data-legend-position=Right]) .blu-chart__legend[data-style=Standard] .blu-chart__legend-entry{flex-wrap:wrap;gap:4px 10px}.blu-chart__legend-scale{max-width:360px;min-width:0;margin:0 0 8px}.blu-chart__legend-scale-title{display:block;font-size:11px;font-weight:500;margin-bottom:10px;color:var(--bluui-text-muted)}.blu-chart__legend-gradient{height:8px;border-radius:4px}.blu-chart__legend-range{display:flex;justify-content:space-between;gap:12px;margin-top:8px;font-variant-numeric:tabular-nums}.blu-chart__legend[data-style=Compact] .blu-chart__legend-scale{padding:12px 16px;border:1px solid var(--bluui-border);border-radius:18px}.blu-chart__legend[data-style=ValueList] .blu-chart__legend-scale{padding:10px 11px}.blu-chart__legend[data-style=SummaryCards] .blu-chart__legend-scale{padding:16px;border:1px solid var(--bluui-border);border-radius:12px}.blu-chart__legend-note{display:block;margin-top:10px}@media(forced-colors:active){.blu-chart__legend-entry{border:1px solid ButtonText!important}.blu-chart__legend-entry[aria-pressed=true],.blu-chart__legend .blu-chart__legend-chip.blu-chip--selected{outline:1px solid Highlight}.blu-chart__legend-marker svg{forced-color-adjust:none}.blu-chart__legend-gradient{background:Canvas!important;border:1px solid CanvasText}}.blu-chart{width:100%;min-width:0;color:var(--bluui-text,#182230);background:var(--bluui-surface,#fff);font:13px/1.5 var(--blu-font-family,Inter,system-ui,sans-serif)}.blu-chart [hidden]{display:none!important}.blu-chart__heading{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding:18px 16px 12px}.blu-chart__heading>div:first-child{min-width:0}.blu-chart__heading h3{margin:0;color:inherit;font-size:16px;font-weight:650;letter-spacing:-.3px;overflow-wrap:anywhere}.blu-chart__heading p{margin:5px 0 0;font-size:11px;color:var(--bluui-text-muted,#667085);line-height:1.6;overflow-wrap:anywhere}.blu-chart__export{display:flex;gap:5px;flex-shrink:0;margin-left:auto}.blu-chart__export :is(select,button){font:inherit;font-size:11px;border:1px solid var(--bluui-border,#ddd);color:inherit;border-radius:6px;background:var(--bluui-surface,#fff);min-height:34px;padding:6px 8px;cursor:pointer}.blu-chart__export button:disabled{opacity:.5;cursor:default}.blu-chart__stage{position:relative;min-width:0}.blu-chart__plot{width:100%;min-width:0}.blu-chart__state{position:absolute;inset:0;display:grid;place-items:center;background:var(--bluui-surface-muted,#f8f8fa);color:var(--bluui-text-muted,#667085);padding:20px;text-align:center}.blu-chart__state--loading{grid-template-rows:minmax(0,1fr) auto;gap:14px;place-items:stretch;background:var(--bluui-surface,#fff);padding:16px}.blu-chart__skeleton{display:flex;flex-direction:column;gap:24px;min-width:0;min-height:0}.blu-chart__skeleton-key{display:flex;gap:16px;align-items:center;flex-wrap:wrap}.blu-chart__skeleton-plot{flex:1;min-height:0}.blu-chart__skeleton-plot>div{height:100%}.blu-chart__state-message{font-size:12px}.blu-chart__data{margin:12px 16px 0;border-top:1px solid var(--bluui-border,#ddd);font-size:11px}.blu-chart__data summary{cursor:pointer;padding:12px 0;color:var(--bluui-text-muted,#667085)}.blu-chart__data--compact{margin-top:0;border-top:0}.blu-chart__data--compact summary{padding:6px 0}.blu-chart__table{overflow:auto;max-height:320px}.blu-chart__table table{width:100%;border-collapse:collapse;white-space:nowrap;font-size:11px;font-variant-numeric:tabular-nums}.blu-chart__table caption{text-align:left;color:var(--bluui-text-muted,#667085);padding:8px}.blu-chart__table th,.blu-chart__table td{padding:8px;border-bottom:1px solid var(--bluui-border,#ddd);text-align:right}.blu-chart__table th:first-child{text-align:left}.blu-chart__table button{font:inherit;color:var(--bluui-primary,#6557e8);background:transparent;border:0;border-radius:3px;padding:5px;cursor:pointer}.blu-chart__table button[aria-pressed=true]{background:var(--bluui-selected,#eeeaff);text-decoration:underline;text-decoration-thickness:2px;text-underline-offset:3px;font-weight:700}.blu-chart :is(button,select,summary,[tabindex]):focus-visible{outline:2px solid var(--bluui-primary,#6557e8);outline-offset:2px}.blu-chart__status{font-size:11px;color:var(--bluui-text-muted,#667085);margin:0 16px}.blu-chart__status:not(:empty){padding:8px 0}@media(max-width:640px){.blu-chart__heading{flex-wrap:wrap;padding-inline:12px}.blu-chart__export{margin-left:0}.blu-chart__data{margin-inline:12px}}.blu-chart__navigation{display:flex;flex-wrap:wrap;gap:6px;padding:8px 16px}.blu-chart__navigation button{min-width:32px;min-height:32px;padding:5px 9px;font:inherit;font-size:12px;color:var(--bluui-text);background:var(--bluui-surface);border:1px solid var(--bluui-control-border);border-radius:5px;cursor:pointer}.blu-chart__stage[tabindex]:focus-visible{outline-offset:-3px}.blu-chart__state-announcement{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}.blu-chart__patterns{display:flex;align-items:center;gap:8px;font-size:12px;padding:6px 0 12px;cursor:pointer}.blu-chart__patterns input{width:24px;height:24px;margin:0;accent-color:var(--bluui-color-primary-solid)}.blu-chart__missing-note{margin:8px 12px;color:var(--bluui-text-muted);font-size:12px;line-height:1.5}.blu-chart .blu-chart__patterns input[type=checkbox]{-webkit-appearance:none;appearance:none;box-sizing:border-box;position:relative;display:inline-block;flex:0 0 22px;width:22px;height:22px;min-width:22px;min-height:22px;margin:0;padding:0;border:1.5px solid var(--bluui-control-border,#7b8799);border-radius:6px;background-color:var(--bluui-surface,#fff);background-image:none;box-shadow:0 1px 2px #0f172a0f;vertical-align:middle;cursor:pointer;opacity:1;filter:none;transition:background-color .12s ease,border-color .12s ease,box-shadow .12s ease}.blu-chart .blu-chart__patterns input[type=checkbox]:after{content:none}.blu-chart .blu-chart__patterns input[type=checkbox]:checked,.blu-chart .blu-chart__patterns input[type=checkbox]:indeterminate{border-color:var(--bluui-color-primary-solid,#4f46e5);background-color:var(--bluui-color-primary-solid,#4f46e5)}.blu-chart .blu-chart__patterns input[type=checkbox]:checked:after,.blu-chart .blu-chart__patterns input[type=checkbox]:indeterminate:after{content:"";box-sizing:content-box;position:absolute;width:10px;height:6px;inset:5px auto auto 4px;border:solid var(--bluui-color-primary-contrast,#fff);border-width:0 0 2px 2px;border-radius:0;background:none;-webkit-mask:none;mask:none;transform:rotate(-45deg);pointer-events:none}.blu-chart .blu-chart__patterns input[type=checkbox]:indeterminate:after{height:0;top:8px;border-width:0 0 2px;transform:none}.blu-chart .blu-chart__patterns input[type=checkbox]:hover:not(:disabled){border-color:var(--bluui-color-primary-solid,#4f46e5);box-shadow:0 0 0 3px var(--bluui-color-primary-soft,#eef2ff)}.blu-chart .blu-chart__patterns input[type=checkbox]:focus-visible{outline:2px solid var(--bluui-color-primary-solid,#4f46e5);outline-offset:3px}.blu-chart .blu-chart__patterns input[type=checkbox]:disabled{border-color:var(--bluui-border-strong,#b8c4d4);background-color:var(--bluui-surface-muted,#f7f8fb);box-shadow:none;cursor:not-allowed}.blu-chart .blu-chart__patterns input[type=checkbox]:disabled:checked,.blu-chart .blu-chart__patterns input[type=checkbox]:disabled:indeterminate{border-color:var(--bluui-text-muted,#5c6b80);background-color:var(--bluui-text-muted,#5c6b80)}@media(prefers-reduced-motion:reduce){.blu-chart .blu-chart__patterns input[type=checkbox]{transition:none}}.blu-chart .blu-chart__patterns input[type=checkbox]:before{content:none}@media(forced-colors:active){.blu-chart .blu-chart__patterns input[type=checkbox],.blu-chart .blu-chart__patterns input[type=checkbox]:checked,.blu-chart .blu-chart__patterns input[type=checkbox]:indeterminate,.blu-chart .blu-chart__patterns input[type=checkbox]:disabled,.blu-chart .blu-chart__patterns input[type=checkbox]:disabled:checked,.blu-chart .blu-chart__patterns input[type=checkbox]:disabled:indeterminate{-webkit-appearance:checkbox;appearance:auto;background:revert;border:revert;box-shadow:none;forced-color-adjust:auto}.blu-chart .blu-chart__patterns input[type=checkbox]:checked:after,.blu-chart .blu-chart__patterns input[type=checkbox]:indeterminate:after{content:none}}
@@ -0,0 +1,40 @@
1
+ import type { MotionState } from './motion-policy.ts';
2
+ import type { ComponentMotionSettings } from '@blukavantui/community/motion/settings';
3
+ export { createMotionSparkline } from './motion/sparkline.ts';
4
+ export { createMotionLineChart } from './motion/line.ts';
5
+ export { createMotionBarChart } from './motion/bar.ts';
6
+ export { createMotionPieChart } from './motion/pie.ts';
7
+ export { createMotionDoughnutChart } from './motion/doughnut.ts';
8
+ export { createMotionScatterChart } from './motion/scatter.ts';
9
+ export { createMotionRadarChart } from './motion/radar.ts';
10
+ export { createMotionHeatmap } from './motion/heatmap.ts';
11
+ export declare function createMotionCharts(motion: MotionState, defaults?: ComponentMotionSettings): {
12
+ configure(next?: ComponentMotionSettings): void;
13
+ } & {
14
+ createSparkline: (host: HTMLElement, options: import("./sparkline.ts").SparklineOptions, events?: import("./sparkline.ts").SparklineEvents | undefined) => import("./sparkline.ts").SparklineInstance & {
15
+ setMotion(next?: ComponentMotionSettings): void;
16
+ };
17
+ createLineChart: (host: HTMLElement, options: import("./catalogue-types.ts").CartesianOptions, events?: import("./types.ts").ChartEvents<import("./catalogue-types.ts").ChartPoint> | undefined) => import("./types.ts").ChartInstance<import("./catalogue-types.ts").CartesianOptions> & {
18
+ setMotion(next?: ComponentMotionSettings): void;
19
+ };
20
+ createBarChart: (host: HTMLElement, options: import("./catalogue-types.ts").CartesianOptions, events?: import("./types.ts").ChartEvents<import("./catalogue-types.ts").ChartPoint> | undefined) => import("./types.ts").ChartInstance<import("./catalogue-types.ts").CartesianOptions> & {
21
+ setMotion(next?: ComponentMotionSettings): void;
22
+ };
23
+ createPieChart: (host: HTMLElement, options: import("./catalogue-types.ts").CircularOptions, events?: import("./types.ts").ChartEvents<import("./catalogue-types.ts").ChartPoint> | undefined) => import("./types.ts").ChartInstance<import("./catalogue-types.ts").CircularOptions> & {
24
+ setMotion(next?: ComponentMotionSettings): void;
25
+ };
26
+ createDoughnutChart: (host: HTMLElement, options: import("./catalogue-types.ts").CircularOptions, events?: import("./types.ts").ChartEvents<import("./catalogue-types.ts").ChartPoint> | undefined) => import("./types.ts").ChartInstance<import("./catalogue-types.ts").CircularOptions> & {
27
+ setMotion(next?: ComponentMotionSettings): void;
28
+ };
29
+ createScatterChart: (host: HTMLElement, options: import("./catalogue-types.ts").ScatterOptions, events?: import("./types.ts").ChartEvents<import("./catalogue-types.ts").ChartPoint> | undefined) => import("./types.ts").ChartInstance<import("./catalogue-types.ts").ScatterOptions> & {
30
+ setMotion(next?: ComponentMotionSettings): void;
31
+ };
32
+ createRadarChart: (host: HTMLElement, options: import("./catalogue-types.ts").RadarOptions, events?: import("./types.ts").ChartEvents<import("./catalogue-types.ts").ChartPoint> | undefined) => import("./types.ts").ChartInstance<import("./catalogue-types.ts").RadarOptions> & {
33
+ setMotion(next?: ComponentMotionSettings): void;
34
+ };
35
+ createHeatmap: (host: HTMLElement, options: import("./types.ts").HeatmapOptions, events?: import("./types.ts").ChartEvents<import("./types.ts").HeatmapPoint> | undefined) => import("./types.ts").ChartInstance<import("./types.ts").HeatmapOptions> & {
36
+ setMotion(next?: ComponentMotionSettings): void;
37
+ };
38
+ } & {
39
+ destroy(): void;
40
+ };
package/dist/motion.js ADDED
@@ -0,0 +1 @@
1
+ import{a as u}from"./chunk-2GUWWKHW.js";import"./chunk-ILTENI35.js";import{a as m}from"./chunk-5NUOOMHV.js";import"./chunk-RXOGAN23.js";import{a as p}from"./chunk-4WDZUJDS.js";import"./chunk-WJ3UHH6J.js";import{a as c}from"./chunk-4B5MQ6GZ.js";import"./chunk-EITBQBN2.js";import{a as M}from"./chunk-4EQMOBBN.js";import"./chunk-UO2KNHTU.js";import{a as f}from"./chunk-NASBRHIW.js";import"./chunk-UQMMBG26.js";import{a as d}from"./chunk-CF5Q2DDP.js";import"./chunk-NXDBBMF5.js";import{a as h}from"./chunk-VTJ4XPRV.js";import"./chunk-UGXWOWAG.js";import"./chunk-MR5VITXX.js";import"./chunk-3PITHTEO.js";import"./chunk-RC2TCMJF.js";import{createMotionSettingsGroup as P}from"@blukavantui/community/motion/settings";function g(r,n,S={}){let i=P(S),a=new Set,e=!1;function F(o){return(s,l,x={})=>{if(e)throw Error("Motion charts are destroyed.");let t=o(s,l,n,x,i.settings),b=t.destroy.bind(t),y=!1,C=i.bind(t.setMotion);return t.setMotion=C.setMotion,t.destroy=()=>{y||(y=!0,a.delete(t),C.destroy(),b())},a.add(t),t}}return{configure(o={}){if(e)throw Error("Motion charts are destroyed.");i.configure(o)},...Object.fromEntries(Object.entries(r).map(([o,s])=>[o,F(s)])),destroy(){if(!e){e=!0;for(let o of[...a])o.destroy()}}}}function O(r,n={}){return g({createSparkline:m,createLineChart:p,createBarChart:c,createPieChart:M,createDoughnutChart:f,createScatterChart:d,createRadarChart:h,createHeatmap:u},r,n)}export{c as createMotionBarChart,O as createMotionCharts,f as createMotionDoughnutChart,u as createMotionHeatmap,p as createMotionLineChart,M as createMotionPieChart,h as createMotionRadarChart,d as createMotionScatterChart,m as createMotionSparkline};
package/dist/pie.js CHANGED
@@ -1 +1 @@
1
- import{a}from"./chunk-YJKEV5J7.js";import"./chunk-QFXXWRD5.js";import"./chunk-QETOF22L.js";export{a as createPieChart};
1
+ import{a}from"./chunk-OQ6MP7PY.js";import"./chunk-UO2KNHTU.js";import"./chunk-MR5VITXX.js";import"./chunk-RC2TCMJF.js";export{a as createPieChart};
package/dist/radar.js CHANGED
@@ -1 +1 @@
1
- import{a}from"./chunk-JNSBTZUP.js";import"./chunk-QFXXWRD5.js";import"./chunk-QETOF22L.js";export{a as createRadarChart};
1
+ import{a}from"./chunk-XLJUSNGV.js";import"./chunk-UGXWOWAG.js";import"./chunk-MR5VITXX.js";import"./chunk-RC2TCMJF.js";export{a as createRadarChart};
package/dist/scatter.js CHANGED
@@ -1 +1 @@
1
- import{a}from"./chunk-FZ7J7BEC.js";import"./chunk-QFXXWRD5.js";import"./chunk-QETOF22L.js";export{a as createScatterChart};
1
+ import{a}from"./chunk-FXNKAHRG.js";import"./chunk-NXDBBMF5.js";import"./chunk-MR5VITXX.js";import"./chunk-RC2TCMJF.js";export{a as createScatterChart};
package/dist/sparkline.js CHANGED
@@ -1 +1 @@
1
- import{a}from"./chunk-MSZ5J5WG.js";import"./chunk-QETOF22L.js";export{a as createSparkline};
1
+ import{b as a}from"./chunk-RXOGAN23.js";import"./chunk-RC2TCMJF.js";export{a as createSparkline};
package/dist/styles.css CHANGED
@@ -461,6 +461,14 @@ The base shape remains visible when the animated overlay is removed. */
461
461
  -servicestudio-height: 20px;
462
462
  }
463
463
 
464
+ /* The opt-in native motion adapter owns the shimmer. Avoid a second legacy
465
+ wave, including when the adapter is Reduced or Off. Removing the adapter
466
+ restores the existing IsAnimated behavior without changing its contract. */
467
+ .blu-skeleton[data-blu-native-motion="loading-skeleton"]::after {
468
+ animation: none !important;
469
+ display: none !important;
470
+ }
471
+
464
472
  /* BluKavantUI Charts Community / Sparkline. SVG scales with the container; colors inherit the
465
473
  shared palette. Values are always exposed through an accessible summary. */
466
474
  .blu-sparkline { min-width: 0; width: 100%; color: var(--bluui-text); }
package/dist/web-api.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.0.1",
2
+ "version": "1.2.0",
3
3
  "components": {
4
4
  "bar": {
5
5
  "entry": "bar",
@@ -3153,7 +3153,7 @@
3153
3153
  "description": "Returns a new String consisting of the single UTF-16 code unit located at the specified index."
3154
3154
  },
3155
3155
  {
3156
- "name": "__@iterator@50",
3156
+ "name": "__@iterator@64",
3157
3157
  "type": "() => StringIterator<string>",
3158
3158
  "optional": false,
3159
3159
  "description": "Iterator"
@@ -4140,6 +4140,166 @@
4140
4140
  "source": "sparkline.d.ts"
4141
4141
  }
4142
4142
  ]
4143
+ },
4144
+ "web-motion-sparkline": {
4145
+ "entry": "web-motion-sparkline",
4146
+ "factory": "createMotionSparkline",
4147
+ "signature": "(host: HTMLElement, options: SparklineOptions, events: SparklineEvents, policy: ChartPresentation): SparklineInstance",
4148
+ "optionsType": "SparklineOptions",
4149
+ "eventsPlacement": "third argument",
4150
+ "options": [
4151
+ {
4152
+ "name": "Points",
4153
+ "type": "BluSparklinePoint[]",
4154
+ "optional": false,
4155
+ "description": ""
4156
+ },
4157
+ {
4158
+ "name": "Height",
4159
+ "type": "number",
4160
+ "optional": true,
4161
+ "description": "Height in pixels, from 24 to 240. Defaults to 64."
4162
+ },
4163
+ {
4164
+ "name": "Color",
4165
+ "type": "ComponentColor",
4166
+ "optional": true,
4167
+ "description": ""
4168
+ },
4169
+ {
4170
+ "name": "LineStyle",
4171
+ "type": "'Straight' | 'Smooth'",
4172
+ "optional": true,
4173
+ "description": "A smooth curve that stays within the data range, or straight segments. Defaults to Smooth."
4174
+ },
4175
+ {
4176
+ "name": "AnimateGlow",
4177
+ "type": "boolean",
4178
+ "optional": true,
4179
+ "description": ""
4180
+ },
4181
+ {
4182
+ "name": "Animation",
4183
+ "type": "'Off' | 'Once' | 'Continuous'",
4184
+ "optional": true,
4185
+ "description": "A glow and point follow the line. Defaults to Once; reduced motion disables it."
4186
+ },
4187
+ {
4188
+ "name": "AnimationDuration",
4189
+ "type": "number",
4190
+ "optional": true,
4191
+ "description": "Seconds per pass, from 1 to 60. Defaults to 5."
4192
+ },
4193
+ {
4194
+ "name": "ShowArea",
4195
+ "type": "boolean",
4196
+ "optional": true,
4197
+ "description": ""
4198
+ },
4199
+ {
4200
+ "name": "AreaOpacity",
4201
+ "type": "number",
4202
+ "optional": true,
4203
+ "description": "Area opacity from 0 to 100 percent. Defaults to 18."
4204
+ },
4205
+ {
4206
+ "name": "AreaFade",
4207
+ "type": "boolean",
4208
+ "optional": true,
4209
+ "description": "Fade the area to transparent at the bottom. Defaults to true."
4210
+ },
4211
+ {
4212
+ "name": "ShowEndMarker",
4213
+ "type": "boolean",
4214
+ "optional": true,
4215
+ "description": "Final point for a static trend. Hidden during animation; a single value always remains visible."
4216
+ },
4217
+ {
4218
+ "name": "ShowDataTable",
4219
+ "type": "boolean",
4220
+ "optional": true,
4221
+ "description": ""
4222
+ },
4223
+ {
4224
+ "name": "AccessibleLabel",
4225
+ "type": "string",
4226
+ "optional": true,
4227
+ "description": ""
4228
+ },
4229
+ {
4230
+ "name": "SummaryText",
4231
+ "type": "string",
4232
+ "optional": true,
4233
+ "description": ""
4234
+ },
4235
+ {
4236
+ "name": "EmptyText",
4237
+ "type": "string",
4238
+ "optional": true,
4239
+ "description": ""
4240
+ },
4241
+ {
4242
+ "name": "ExtendedClass",
4243
+ "type": "string",
4244
+ "optional": true,
4245
+ "description": ""
4246
+ },
4247
+ {
4248
+ "name": "Messages",
4249
+ "type": "Record<string, string>",
4250
+ "optional": true,
4251
+ "description": "Plain-text translations for the summary, animation controls and data disclosure."
4252
+ }
4253
+ ],
4254
+ "events": [
4255
+ {
4256
+ "name": "Error",
4257
+ "type": "(message: string) => unknown",
4258
+ "optional": true,
4259
+ "description": ""
4260
+ }
4261
+ ],
4262
+ "methods": [
4263
+ {
4264
+ "name": "element",
4265
+ "type": "HTMLElement",
4266
+ "optional": false,
4267
+ "description": ""
4268
+ },
4269
+ {
4270
+ "name": "update",
4271
+ "type": "(options: Partial<SparklineOptions>) => void",
4272
+ "optional": false,
4273
+ "description": ""
4274
+ },
4275
+ {
4276
+ "name": "destroy",
4277
+ "type": "() => void",
4278
+ "optional": false,
4279
+ "description": ""
4280
+ }
4281
+ ],
4282
+ "helpers": [],
4283
+ "types": [
4284
+ {
4285
+ "name": "BluSparklinePoint",
4286
+ "description": "One ordered numeric observation.",
4287
+ "declaration": "interface BluSparklinePoint {\n Label?: string;\n Value: number;\n}",
4288
+ "source": "sparkline.d.ts"
4289
+ },
4290
+ {
4291
+ "name": "ChartPresentation",
4292
+ "description": "Internal opt-in web presentation. Ordinary/native factories omit this policy.",
4293
+ "declaration": "interface ChartPresentation {\n /** Native integration can opt in/out without replacing the chart. */\n enabled?(): boolean;\n mode(host: HTMLElement): 'full' | 'reduced' | 'off';\n timing?(): {\n duration?: number;\n easing?: string;\n curve?: string;\n };\n subscribe(host: HTMLElement, refresh: () => void): () => void;\n}",
4294
+ "source": "catalogue-runtime.d.ts"
4295
+ },
4296
+ {
4297
+ "name": "ComponentColor",
4298
+ "description": "Shared Web chart contracts; native inputs are normalized by the private adapter.",
4299
+ "declaration": "type ComponentColor = 'Default' | 'Primary' | 'Secondary' | 'Success' | 'Processing' | 'Warning' | 'Error' | 'Danger' | 'Magenta' | 'Red' | 'Volcano' | 'Orange' | 'Gold' | 'Lime' | 'Green' | 'Cyan' | 'Blue' | 'GeekBlue' | 'Purple';",
4300
+ "source": "types.d.ts"
4301
+ }
4302
+ ]
4143
4303
  }
4144
4304
  }
4145
4305
  }
@@ -0,0 +1,4 @@
1
+ /** Local opt-in adapter. The compact SVG runtime and its ordinary defaults stay intact. */
2
+ import { type SparklineOptions, type SparklineEvents } from './sparkline.ts';
3
+ import type { ChartPresentation } from './catalogue-runtime.ts';
4
+ export declare function createMotionSparkline(host: HTMLElement, options: SparklineOptions, events: SparklineEvents, policy: ChartPresentation): import("./sparkline.ts").SparklineInstance;
package/edition.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "edition": "community",
3
- "version": "1.0.1",
3
+ "version": "1.2.0",
4
4
  "platform": "web",
5
5
  "charts": [
6
6
  {
package/package.json CHANGED
@@ -1,16 +1,51 @@
1
1
  {
2
2
  "name": "@blukavantui/charts-community",
3
- "version": "1.0.1",
3
+ "version": "1.2.0",
4
4
  "description": "BluKavantUI Charts Community: 8 modular web charts. A separate chart bundle.",
5
5
  "type": "module",
6
6
  "license": "SEE LICENSE IN LICENSE.txt",
7
7
  "publishConfig": {
8
- "access": "public",
9
- "registry": "https://registry.npmjs.org/"
8
+ "access": "public"
10
9
  },
11
10
  "main": "./dist/index.js",
12
11
  "types": "./dist/index.d.ts",
13
12
  "exports": {
13
+ "./motion": {
14
+ "types": "./dist/motion.d.ts",
15
+ "import": "./dist/motion.js"
16
+ },
17
+ "./motion/sparkline": {
18
+ "types": "./dist/motion/sparkline.d.ts",
19
+ "import": "./dist/motion/sparkline.js"
20
+ },
21
+ "./motion/line": {
22
+ "types": "./dist/motion/line.d.ts",
23
+ "import": "./dist/motion/line.js"
24
+ },
25
+ "./motion/bar": {
26
+ "types": "./dist/motion/bar.d.ts",
27
+ "import": "./dist/motion/bar.js"
28
+ },
29
+ "./motion/pie": {
30
+ "types": "./dist/motion/pie.d.ts",
31
+ "import": "./dist/motion/pie.js"
32
+ },
33
+ "./motion/doughnut": {
34
+ "types": "./dist/motion/doughnut.d.ts",
35
+ "import": "./dist/motion/doughnut.js"
36
+ },
37
+ "./motion/scatter": {
38
+ "types": "./dist/motion/scatter.d.ts",
39
+ "import": "./dist/motion/scatter.js"
40
+ },
41
+ "./motion/radar": {
42
+ "types": "./dist/motion/radar.d.ts",
43
+ "import": "./dist/motion/radar.js"
44
+ },
45
+ "./motion/heatmap": {
46
+ "types": "./dist/motion/heatmap.d.ts",
47
+ "import": "./dist/motion/heatmap.js"
48
+ },
14
49
  ".": {
15
50
  "types": "./dist/index.d.ts",
16
51
  "import": "./dist/index.js"
@@ -58,41 +93,13 @@
58
93
  "README.md",
59
94
  "LICENSE.txt",
60
95
  "THIRD_PARTY_NOTICES.txt",
61
- "edition.json",
62
- "scripts/build.mjs",
63
- "tsconfig.json"
96
+ "edition.json"
64
97
  ],
65
98
  "sideEffects": [
66
99
  "**/*.css"
67
100
  ],
68
101
  "dependencies": {
69
- "@blukavantui/community": "^1.0.1",
102
+ "@blukavantui/community": "^1.2.0",
70
103
  "echarts": "6.1.0"
71
- },
72
- "author": {
73
- "name": "BluTek Media",
74
- "url": "https://blutekmedia.com"
75
- },
76
- "homepage": "https://blukavantui.blutekmedia.com/charts",
77
- "bugs": {
78
- "url": "https://blutekmedia.com/contact"
79
- },
80
- "keywords": [
81
- "blukavantui",
82
- "charts",
83
- "typescript",
84
- "javascript",
85
- "echarts",
86
- "sparkline",
87
- "data-visualization"
88
- ],
89
- "scripts": {
90
- "check": "tsc --noEmit --emitDeclarationOnly false",
91
- "build": "node scripts/build.mjs"
92
- },
93
- "devDependencies": {
94
- "esbuild": "0.28.2",
95
- "typescript": "6.0.3",
96
- "@types/node": "24.12.0"
97
104
  }
98
105
  }
@@ -17,14 +17,24 @@ import {validateMapRegions} from './catalogue-model.ts';
17
17
  import './charts.css';
18
18
 
19
19
  type Builder=(o:any,t:ReturnType<typeof themeTokens>,mapName?:string,reducedMotion?:boolean,width?:number)=>echarts.EChartsCoreOption;
20
+ /** Internal opt-in web presentation. Ordinary/native factories omit this policy. */
21
+ export interface ChartPresentation {
22
+ /** Native integration can opt in/out without replacing the chart. */
23
+ enabled?(): boolean;
24
+ mode(host: HTMLElement): 'full' | 'reduced' | 'off';
25
+ timing?(): {duration?:number;easing?:string;curve?:string};
26
+ subscribe(host: HTMLElement, refresh: () => void): () => void;
27
+ }
20
28
  export function createCatalogueChart<K extends CatalogueKind>(host:HTMLElement,kind:K,initial:OptionsByKind[K],events:ChartEvents<ChartPoint>,build:Builder):ChartInstance<OptionsByKind[K]> {
21
29
  return createChartRuntime(host,kind,initial,events,build);
22
30
  }
23
31
  /** One lifecycle for all ECharts families. Sparkline deliberately stays independent. */
24
- export function createChartRuntime<O extends RuntimeOptions,P=ChartPoint>(host:HTMLElement,kind:RuntimeKind,initial:O,events:ChartEvents<P>,build:Builder):ChartInstance<O> {
32
+ export function createChartRuntime<O extends RuntimeOptions,P=ChartPoint>(host:HTMLElement,kind:RuntimeKind,initial:O,events:ChartEvents<P>,build:Builder,presentation?:ChartPresentation):ChartInstance<O> {
25
33
  let options={...defaults,...structuredClone(initial)} as O, requested=options;
26
34
  const emit=(callback:any,...args:any[])=>{if(destroyed)return;try{callback?.(...args);}catch(e){console.error('Chart event handler failed.',e);}};
27
35
  let destroyed=false, exporting=false, revision=0, frame=0, focusFrame=0, pending=false, ready=false, lastState='', resourceError='';
36
+ let stopPresentation=()=>{};
37
+ let dataFade:Animation|undefined,dataFadeMode:string|undefined;
28
38
  try{validateChart(kind,options);}catch(e){emit(events.Error,{Message:String((e as Error).message),Code:'InvalidData'});throw e;}
29
39
  let chart:echarts.EChartsType|undefined,legend:ReturnType<typeof createChartLegend>|undefined,config:any;
30
40
  let map:ReturnType<typeof mapRegistry.acquire>|undefined, geometry:GeoJSON|undefined,geometryKey='';
@@ -94,6 +104,7 @@ export function createChartRuntime<O extends RuntimeOptions,P=ChartPoint>(host:H
94
104
  if(restore)restorePointFocus(restore);
95
105
  }
96
106
  function paint(reset=false){
107
+ if(dataFade&&(presentation?.enabled?.()===false||!options.EnableAnimation||presentation?.mode(host)!==dataFadeMode)){dataFade.cancel();dataFade=undefined;}
97
108
  if(destroyed)return;
98
109
  const busy=pending||!!options.IsLoading,empty=!available(),failed=!!resourceError&&!busy;
99
110
  root.className=`blu-chart ${options.ExtendedClass||''}`;root.setAttribute('aria-label',options.AccessibleLabel||options.Title||'Chart');
@@ -110,7 +121,7 @@ export function createChartRuntime<O extends RuntimeOptions,P=ChartPoint>(host:H
110
121
  plot.style.height=`${options.Height}px`;plot.style.visibility=busy||empty?'hidden':'visible';plot.setAttribute('aria-busy',String(busy));
111
122
  if(kind==='calendar-heatmap'){const o=options as any;const weeks=Math.ceil(((Date.parse(o.RangeEnd)-Date.parse(o.RangeStart))/86400000+7)/7);plot.style.minWidth=`${Math.max(300,weeks*12+56)}px`;const stage=$('.blu-chart__stage');stage.style.overflowX='auto';stage.tabIndex=0;stage.setAttribute('role','region');stage.setAttribute('aria-label',msg('CalendarScroll','Calendar plot; scroll horizontally for more dates'));}
112
123
  const label=busy?msg('Loading',pending?'Loading map…':'Loading chart…'):options.EmptyMessage||'No data to display';
113
- loading.update(busy,empty,label,!!options.EnableAnimation&&!motion.matches);announce.update(failed?resourceError:!busy&&!empty?msg('Ready','Chart ready.'):label);
124
+ loading.update(busy,empty,label,!!options.EnableAnimation&&!motion.matches&&(!presentation||presentation.enabled?.()===false||presentation.mode(host)==='full'));announce.update(failed?resourceError:!busy&&!empty?msg('Ready','Chart ready.'):label);
114
125
  download.disabled=exporting||busy||empty||failed;
115
126
  navigation.hidden=busy||empty||failed||!(kind==='geo-map'&&(options as any).Roam!==false||kind==='treemap'&&(options as any).Drilldown);
116
127
  if(kind==='geo-map'&&!navigation.children.length)navigation.innerHTML=['in','out','left','right','up','down','reset','full'].map(a=>`<button type="button" data-nav="${a}"></button>`).join('');
@@ -125,7 +136,29 @@ export function createChartRuntime<O extends RuntimeOptions,P=ChartPoint>(host:H
125
136
  delete next.legend;
126
137
  next.aria={...next.aria,description:`${options.Title}. ${options.Description||''} ${msg('DataAlternative','Original values and keyboard selection are in the data table.')}`};
127
138
  if(next.geo&&view){next.geo.zoom=view.zoom;if(view.center)next.geo.center=view.center;}
128
- chart.resize();chart.setOption(next,{notMerge:true});config=next;
139
+ if(presentation&&presentation.enabled?.()!==false){
140
+ const timing=presentation.timing?.();
141
+ next.animation=!!options.EnableAnimation&&!motion.matches&&presentation.mode(host)==='full'&&timing?.duration!==0&&!busy&&!empty;
142
+ next.animationDuration=timing?.duration??750;next.animationDurationUpdate=timing?.duration??650;
143
+ next.animationEasing=next.animationEasingUpdate=timing?.easing??'cubicInOut';
144
+ // Stable data identity lets values move to their new shape instead of replaying an entrance.
145
+ next.series?.forEach((series:any, index:number)=>{
146
+ series.id ??= JSON.stringify([kind,series.type,series.name || (kind==='geo-map' ? series.type : index)]);
147
+ // Series and points keep semantic identity even when groups/categories reorder.
148
+ const identify=(datum:any, i:number)=>{
149
+ if(!datum || typeof datum!=='object' || datum.id!=null)return;
150
+ const key=datum.point?.Key ?? (kind==='mixed' ? (options as MixedChartOptions).Categories[i]?.Key : datum.name);
151
+ // Sankey source/target reference node IDs. Keep those IDs equal to the source keys.
152
+ if(key!=null)datum.id=kind==='sankey'?String(key):JSON.stringify([key,datum.point?.SeriesKey||'']);
153
+ };
154
+ series.data?.forEach(identify);series.links?.forEach(identify);
155
+ });
156
+ // A map can switch to locations only; remove the old colour scale as well.
157
+ if(kind==='geo-map' && !next.visualMap)next.visualMap=[];
158
+ // Preference changes settle any engine-owned motion immediately.
159
+ if(!next.animation&&config?.animation)chart.clear();
160
+ }
161
+ chart.resize();chart.setOption(next,presentation&&presentation.enabled?.()!==false?{notMerge:!!reset,replaceMerge:kind==='geo-map'?['series','visualMap']:['series']}:{notMerge:true});config=next;
129
162
  if(reset)treeRoot=undefined;
130
163
  if(kind==='treemap'&&treeRoot&&points().some(p=>p.Key===treeRoot))chart.dispatchAction({type:treeAction,seriesIndex:0,targetNodeId:treeRoot});
131
164
  legend?.render(options,next,t);
@@ -139,6 +172,17 @@ export function createChartRuntime<O extends RuntimeOptions,P=ChartPoint>(host:H
139
172
  function commit(next:O,cleared:boolean,nextMap=map,nextGeo=geometry,nextKey=geometryKey){
140
173
  const old={options,map,geometry,geometryKey,resourceError};options=next;map=nextMap;geometry=nextGeo;geometryKey=nextKey;
141
174
  try{resourceError='';status.textContent='';paint(old.options.ResetKey!==next.ResetKey||old.geometryKey!==nextKey);}catch(e){options=old.options;map=old.map;geometry=old.geometry;geometryKey=old.geometryKey;resourceError=old.resourceError;requested=options;try{paint();}catch{}if(nextMap!==old.map)nextMap?.release();throw e;}
175
+ // These engines replace heat colours / link geometry in one frame. Give
176
+ // actual data changes a readable fade while retaining the same chart,
177
+ // selection and accessible data table. The normal factories omit this.
178
+ if(presentation&&presentation.enabled?.()!==false&&['heatmap','calendar-heatmap','sankey'].includes(kind)&&old.options!==next&&JSON.stringify(chartPoints(kind,old.options))!==JSON.stringify(points())){
179
+ dataFade?.cancel();dataFade=undefined;
180
+ const mode=presentation.mode(host),timing=presentation.timing?.();
181
+ if(options.EnableAnimation&&mode!=='off'&&!options.IsLoading&&available()&&timing?.duration!==0){
182
+ const duration=mode==='reduced'||motion.matches?Math.min(timing?.duration??200,200):timing?.duration??650;
183
+ dataFadeMode=mode;dataFade=plot.animate([{opacity:.35},{opacity:1}],{duration,easing:timing?.curve||'ease-in-out'});
184
+ }
185
+ }
142
186
  if(old.map!==nextMap)old.map?.release();
143
187
  if(cleared)emit(events.SelectionChange,{Key:null,Reason:'DataChanged'});
144
188
  }
@@ -191,10 +235,10 @@ export function createChartRuntime<O extends RuntimeOptions,P=ChartPoint>(host:H
191
235
  }catch(e){if(!destroyed)report(e,e instanceof Error&&e.message==='ExportBusy'?'ExportBusy':'ExportFailed',requestId);throw e;}
192
236
  finally{if(owns){exporting=false;if(!destroyed)download.disabled=pending||!!resourceError||!!options.IsLoading||!available();}}
193
237
  },
194
- destroy(){if(destroyed)return;destroyed=true;revision++;mapAbort?.abort();exportAbort.abort();cancelAnimationFrame(frame);cancelAnimationFrame(focusFrame);resize.disconnect();theme.disconnect();motion.removeEventListener('change',refresh);forced.removeEventListener('change',refresh);scheme.removeEventListener('change',refresh);document.removeEventListener('keydown',escape);announce.destroy();loading.destroy();legend?.destroy();chart?.dispose();map?.release();root.remove();}
238
+ destroy(){if(destroyed)return;destroyed=true;dataFade?.cancel();stopPresentation();revision++;mapAbort?.abort();exportAbort.abort();cancelAnimationFrame(frame);cancelAnimationFrame(focusFrame);resize.disconnect();theme.disconnect();motion.removeEventListener('change',refresh);forced.removeEventListener('change',refresh);scheme.removeEventListener('change',refresh);document.removeEventListener('keydown',escape);announce.destroy();loading.destroy();legend?.destroy();chart?.dispose();map?.release();root.remove();}
195
239
  };
196
240
  download.onclick=()=>void instance.download($<HTMLSelectElement>('select').value as ChartFormat).catch(()=>{});
197
241
  resize.observe(root);
198
- try{apply(options);}catch(e){report(e);instance.destroy();throw e;}
242
+ try{apply(options);stopPresentation=presentation?.subscribe(host,refresh)||(()=>{});}catch(e){report(e);instance.destroy();throw e;}
199
243
  return instance;
200
244
  }
@@ -0,0 +1,15 @@
1
+ /** Optional motion factory; preserves the original chart contract. */
2
+ import type {ComponentMotionSettings} from '@blukavantui/community/motion/settings';
3
+ import {configuredChart,type MotionState} from '../motion-policy.ts';
4
+ import {use} from 'echarts/core';
5
+ import {createChartRuntime} from '../catalogue-runtime.ts';
6
+ import {BarChart} from 'echarts/charts';
7
+ import {GridComponent} from 'echarts/components';
8
+ import {buildOption as bar} from '../builders/bar.ts';
9
+ import type {CartesianOptions,ChartPoint} from '../catalogue-types.ts';
10
+ import type {ChartEvents} from '../types.ts';
11
+ export function createMotionBarChart(host: HTMLElement, options: CartesianOptions, motion: MotionState, events: ChartEvents<ChartPoint> = {}, settings:ComponentMotionSettings = {}) {
12
+ return configuredChart(host,motion,settings,(policy,host)=>{
13
+ use([BarChart, GridComponent]); return createChartRuntime(host, 'bar', options, events, bar, policy);
14
+ });
15
+ }
@@ -0,0 +1,14 @@
1
+ /** Optional motion factory; preserves the original chart contract. */
2
+ import type {ComponentMotionSettings} from '@blukavantui/community/motion/settings';
3
+ import {configuredChart,type MotionState} from '../motion-policy.ts';
4
+ import {use} from 'echarts/core';
5
+ import {createChartRuntime} from '../catalogue-runtime.ts';
6
+ import {PieChart} from 'echarts/charts';
7
+ import {buildOption as doughnut} from '../builders/doughnut.ts';
8
+ import type {ChartPoint,CircularOptions} from '../catalogue-types.ts';
9
+ import type {ChartEvents} from '../types.ts';
10
+ export function createMotionDoughnutChart(host: HTMLElement, options: CircularOptions, motion: MotionState, events: ChartEvents<ChartPoint> = {}, settings:ComponentMotionSettings = {}) {
11
+ return configuredChart(host,motion,settings,(policy,host)=>{
12
+ use([PieChart]); return createChartRuntime<CircularOptions, ChartPoint>(host, 'doughnut', options, events, doughnut, policy);
13
+ });
14
+ }
@@ -0,0 +1,14 @@
1
+ /** Optional motion factory; preserves the original chart contract. */
2
+ import type {ComponentMotionSettings} from '@blukavantui/community/motion/settings';
3
+ import {configuredChart,type MotionState} from '../motion-policy.ts';
4
+ import {use} from 'echarts/core';
5
+ import {createChartRuntime} from '../catalogue-runtime.ts';
6
+ import {HeatmapChart} from 'echarts/charts';
7
+ import {GridComponent,VisualMapComponent} from 'echarts/components';
8
+ import {heatmapOption as heatmap} from '../builders/heatmap.ts';
9
+ import type {ChartEvents,HeatmapOptions,HeatmapPoint} from '../types.ts';
10
+ export function createMotionHeatmap(host: HTMLElement, options: HeatmapOptions, motion: MotionState, events: ChartEvents<HeatmapPoint> = {}, settings:ComponentMotionSettings = {}) {
11
+ return configuredChart(host,motion,settings,(policy,host)=>{
12
+ use([HeatmapChart, GridComponent, VisualMapComponent]); return createChartRuntime<HeatmapOptions, HeatmapPoint>(host, 'heatmap', options, events, heatmap, policy);
13
+ });
14
+ }
@@ -0,0 +1,15 @@
1
+ /** Optional motion factory; preserves the original chart contract. */
2
+ import type {ComponentMotionSettings} from '@blukavantui/community/motion/settings';
3
+ import {configuredChart,type MotionState} from '../motion-policy.ts';
4
+ import {use} from 'echarts/core';
5
+ import {createChartRuntime} from '../catalogue-runtime.ts';
6
+ import {LineChart} from 'echarts/charts';
7
+ import {GridComponent} from 'echarts/components';
8
+ import {buildOption as line} from '../builders/line.ts';
9
+ import type {CartesianOptions,ChartPoint} from '../catalogue-types.ts';
10
+ import type {ChartEvents} from '../types.ts';
11
+ export function createMotionLineChart(host: HTMLElement, options: CartesianOptions, motion: MotionState, events: ChartEvents<ChartPoint> = {}, settings:ComponentMotionSettings = {}) {
12
+ return configuredChart(host,motion,settings,(policy,host)=>{
13
+ use([LineChart, GridComponent]); return createChartRuntime(host, 'line', options, events, line, policy);
14
+ });
15
+ }
@@ -0,0 +1,14 @@
1
+ /** Optional motion factory; preserves the original chart contract. */
2
+ import type {ComponentMotionSettings} from '@blukavantui/community/motion/settings';
3
+ import {configuredChart,type MotionState} from '../motion-policy.ts';
4
+ import {use} from 'echarts/core';
5
+ import {createChartRuntime} from '../catalogue-runtime.ts';
6
+ import {PieChart} from 'echarts/charts';
7
+ import {buildOption as pie} from '../builders/pie.ts';
8
+ import type {ChartPoint,CircularOptions} from '../catalogue-types.ts';
9
+ import type {ChartEvents} from '../types.ts';
10
+ export function createMotionPieChart(host: HTMLElement, options: CircularOptions, motion: MotionState, events: ChartEvents<ChartPoint> = {}, settings:ComponentMotionSettings = {}) {
11
+ return configuredChart(host,motion,settings,(policy,host)=>{
12
+ use([PieChart]); return createChartRuntime<CircularOptions, ChartPoint>(host, 'pie', options, events, pie, policy);
13
+ });
14
+ }
@@ -0,0 +1,15 @@
1
+ /** Optional motion factory; preserves the original chart contract. */
2
+ import type {ComponentMotionSettings} from '@blukavantui/community/motion/settings';
3
+ import {configuredChart,type MotionState} from '../motion-policy.ts';
4
+ import {use} from 'echarts/core';
5
+ import {createChartRuntime} from '../catalogue-runtime.ts';
6
+ import {RadarChart} from 'echarts/charts';
7
+ import {RadarComponent} from 'echarts/components';
8
+ import {buildOption as radar} from '../builders/radar.ts';
9
+ import type {ChartPoint,RadarOptions} from '../catalogue-types.ts';
10
+ import type {ChartEvents} from '../types.ts';
11
+ export function createMotionRadarChart(host: HTMLElement, options: RadarOptions, motion: MotionState, events: ChartEvents<ChartPoint> = {}, settings:ComponentMotionSettings = {}) {
12
+ return configuredChart(host,motion,settings,(policy,host)=>{
13
+ use([RadarChart, RadarComponent]); return createChartRuntime<RadarOptions, ChartPoint>(host, 'radar', options, events, radar, policy);
14
+ });
15
+ }