minerva-design 1.3.0 → 1.5.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.
- package/CHANGELOG.md +18 -0
- package/README.md +21 -21
- package/custom-elements.json +18546 -7329
- package/dist/angular/fesm2022/minerva-angular.mjs +8303 -172
- package/dist/angular/fesm2022/minerva-angular.mjs.map +1 -1
- package/dist/angular/types/minerva-angular.d.ts +2809 -0
- package/dist/charts/canvas.d.cts +8 -3
- package/dist/charts/canvas.d.ts +8 -3
- package/dist/charts/core.cjs +1 -1
- package/dist/charts/core.d.cts +10 -5
- package/dist/charts/core.d.ts +10 -5
- package/dist/charts/core.js +27 -8
- package/dist/charts/engine/axis.cjs +1 -1
- package/dist/charts/engine/axis.cjs.map +1 -1
- package/dist/charts/engine/axis.js +43 -20
- package/dist/charts/engine/axis.js.map +1 -1
- package/dist/charts/engine/canvas.cjs +1 -1
- package/dist/charts/engine/canvas.cjs.map +1 -1
- package/dist/charts/engine/canvas.d.cts +11 -1
- package/dist/charts/engine/canvas.d.ts +11 -1
- package/dist/charts/engine/canvas.js +193 -116
- package/dist/charts/engine/canvas.js.map +1 -1
- package/dist/charts/engine/chart.cjs +1 -1
- package/dist/charts/engine/chart.cjs.map +1 -1
- package/dist/charts/engine/chart.d.cts +1 -1
- package/dist/charts/engine/chart.d.ts +1 -1
- package/dist/charts/engine/chart.js +486 -350
- package/dist/charts/engine/chart.js.map +1 -1
- package/dist/charts/engine/color.cjs +1 -1
- package/dist/charts/engine/color.cjs.map +1 -1
- package/dist/charts/engine/color.d.cts +18 -0
- package/dist/charts/engine/color.d.ts +18 -0
- package/dist/charts/engine/color.js +47 -1
- package/dist/charts/engine/color.js.map +1 -1
- package/dist/charts/engine/controller.cjs +2 -2
- package/dist/charts/engine/controller.cjs.map +1 -1
- package/dist/charts/engine/controller.d.cts +44 -4
- package/dist/charts/engine/controller.d.ts +44 -4
- package/dist/charts/engine/controller.js +421 -314
- package/dist/charts/engine/controller.js.map +1 -1
- package/dist/charts/engine/data.cjs +1 -1
- package/dist/charts/engine/data.cjs.map +1 -1
- package/dist/charts/engine/data.d.cts +9 -1
- package/dist/charts/engine/data.d.ts +9 -1
- package/dist/charts/engine/data.js +65 -49
- package/dist/charts/engine/data.js.map +1 -1
- package/dist/charts/engine/defaults.cjs +2 -0
- package/dist/charts/engine/defaults.cjs.map +1 -0
- package/dist/charts/engine/defaults.d.cts +20 -0
- package/dist/charts/engine/defaults.d.ts +20 -0
- package/dist/charts/engine/defaults.js +35 -0
- package/dist/charts/engine/defaults.js.map +1 -0
- package/dist/charts/engine/format.cjs +1 -1
- package/dist/charts/engine/format.cjs.map +1 -1
- package/dist/charts/engine/format.d.cts +27 -6
- package/dist/charts/engine/format.d.ts +27 -6
- package/dist/charts/engine/format.js +59 -21
- package/dist/charts/engine/format.js.map +1 -1
- package/dist/charts/engine/graph/chart.cjs +2 -0
- package/dist/charts/engine/graph/chart.cjs.map +1 -0
- package/dist/charts/engine/graph/chart.d.cts +3 -0
- package/dist/charts/engine/graph/chart.d.ts +3 -0
- package/dist/charts/engine/graph/chart.js +1565 -0
- package/dist/charts/engine/graph/chart.js.map +1 -0
- package/dist/charts/engine/graph/circular.cjs +2 -0
- package/dist/charts/engine/graph/circular.cjs.map +1 -0
- package/dist/charts/engine/graph/circular.d.cts +16 -0
- package/dist/charts/engine/graph/circular.d.ts +16 -0
- package/dist/charts/engine/graph/circular.js +62 -0
- package/dist/charts/engine/graph/circular.js.map +1 -0
- package/dist/charts/engine/graph/dag.cjs +2 -0
- package/dist/charts/engine/graph/dag.cjs.map +1 -0
- package/dist/charts/engine/graph/dag.d.cts +34 -0
- package/dist/charts/engine/graph/dag.d.ts +34 -0
- package/dist/charts/engine/graph/dag.js +314 -0
- package/dist/charts/engine/graph/dag.js.map +1 -0
- package/dist/charts/engine/graph/dom.cjs +2 -0
- package/dist/charts/engine/graph/dom.cjs.map +1 -0
- package/dist/charts/engine/graph/dom.d.cts +23 -0
- package/dist/charts/engine/graph/dom.d.ts +23 -0
- package/dist/charts/engine/graph/dom.js +158 -0
- package/dist/charts/engine/graph/dom.js.map +1 -0
- package/dist/charts/engine/graph/force.cjs +2 -0
- package/dist/charts/engine/graph/force.cjs.map +1 -0
- package/dist/charts/engine/graph/force.d.cts +67 -0
- package/dist/charts/engine/graph/force.d.ts +67 -0
- package/dist/charts/engine/graph/force.js +325 -0
- package/dist/charts/engine/graph/force.js.map +1 -0
- package/dist/charts/engine/graph/geometry.cjs +2 -0
- package/dist/charts/engine/graph/geometry.cjs.map +1 -0
- package/dist/charts/engine/graph/geometry.d.cts +37 -0
- package/dist/charts/engine/graph/geometry.d.ts +37 -0
- package/dist/charts/engine/graph/geometry.js +144 -0
- package/dist/charts/engine/graph/geometry.js.map +1 -0
- package/dist/charts/engine/graph/index.cjs +1 -0
- package/dist/charts/engine/graph/index.d.cts +6 -0
- package/dist/charts/engine/graph/index.d.ts +6 -0
- package/dist/charts/engine/graph/index.js +6 -0
- package/dist/charts/engine/graph/labels.cjs +2 -0
- package/dist/charts/engine/graph/labels.cjs.map +1 -0
- package/dist/charts/engine/graph/labels.d.cts +12 -0
- package/dist/charts/engine/graph/labels.d.ts +12 -0
- package/dist/charts/engine/graph/labels.js +128 -0
- package/dist/charts/engine/graph/labels.js.map +1 -0
- package/dist/charts/engine/graph/model.cjs +2 -0
- package/dist/charts/engine/graph/model.cjs.map +1 -0
- package/dist/charts/engine/graph/model.d.cts +43 -0
- package/dist/charts/engine/graph/model.d.ts +43 -0
- package/dist/charts/engine/graph/model.js +88 -0
- package/dist/charts/engine/graph/model.js.map +1 -0
- package/dist/charts/engine/graph/sizing.cjs +2 -0
- package/dist/charts/engine/graph/sizing.cjs.map +1 -0
- package/dist/charts/engine/graph/sizing.d.cts +33 -0
- package/dist/charts/engine/graph/sizing.d.ts +33 -0
- package/dist/charts/engine/graph/sizing.js +60 -0
- package/dist/charts/engine/graph/sizing.js.map +1 -0
- package/dist/charts/engine/graph/tree.cjs +2 -0
- package/dist/charts/engine/graph/tree.cjs.map +1 -0
- package/dist/charts/engine/graph/tree.d.cts +30 -0
- package/dist/charts/engine/graph/tree.d.ts +30 -0
- package/dist/charts/engine/graph/tree.js +218 -0
- package/dist/charts/engine/graph/tree.js.map +1 -0
- package/dist/charts/engine/graph/types.d.cts +626 -0
- package/dist/charts/engine/graph/types.d.ts +626 -0
- package/dist/charts/engine/graph/worker.cjs +46 -0
- package/dist/charts/engine/graph/worker.cjs.map +1 -0
- package/dist/charts/engine/graph/worker.d.cts +36 -0
- package/dist/charts/engine/graph/worker.d.ts +36 -0
- package/dist/charts/engine/graph/worker.js +129 -0
- package/dist/charts/engine/graph/worker.js.map +1 -0
- package/dist/charts/engine/items.cjs +1 -1
- package/dist/charts/engine/items.cjs.map +1 -1
- package/dist/charts/engine/items.d.cts +15 -2
- package/dist/charts/engine/items.d.ts +15 -2
- package/dist/charts/engine/items.js +257 -81
- package/dist/charts/engine/items.js.map +1 -1
- package/dist/charts/engine/labels.cjs +2 -0
- package/dist/charts/engine/labels.cjs.map +1 -0
- package/dist/charts/engine/labels.d.cts +13 -0
- package/dist/charts/engine/labels.d.ts +13 -0
- package/dist/charts/engine/labels.js +98 -0
- package/dist/charts/engine/labels.js.map +1 -0
- package/dist/charts/engine/layout.cjs +1 -1
- package/dist/charts/engine/layout.cjs.map +1 -1
- package/dist/charts/engine/layout.d.cts +43 -2
- package/dist/charts/engine/layout.d.ts +43 -2
- package/dist/charts/engine/layout.js +62 -12
- package/dist/charts/engine/layout.js.map +1 -1
- package/dist/charts/engine/locale.cjs +2 -0
- package/dist/charts/engine/locale.cjs.map +1 -0
- package/dist/charts/engine/locale.d.cts +33 -0
- package/dist/charts/engine/locale.d.ts +33 -0
- package/dist/charts/engine/locale.js +68 -0
- package/dist/charts/engine/locale.js.map +1 -0
- package/dist/charts/engine/model.cjs +1 -1
- package/dist/charts/engine/model.cjs.map +1 -1
- package/dist/charts/engine/model.d.cts +77 -2
- package/dist/charts/engine/model.d.ts +77 -2
- package/dist/charts/engine/model.js +304 -116
- package/dist/charts/engine/model.js.map +1 -1
- package/dist/charts/engine/orderbook/book.cjs +2 -0
- package/dist/charts/engine/orderbook/book.cjs.map +1 -0
- package/dist/charts/engine/orderbook/book.d.cts +28 -0
- package/dist/charts/engine/orderbook/book.d.ts +28 -0
- package/dist/charts/engine/orderbook/book.js +134 -0
- package/dist/charts/engine/orderbook/book.js.map +1 -0
- package/dist/charts/engine/orderbook/depth.cjs +2 -0
- package/dist/charts/engine/orderbook/depth.cjs.map +1 -0
- package/dist/charts/engine/orderbook/depth.d.cts +7 -0
- package/dist/charts/engine/orderbook/depth.d.ts +7 -0
- package/dist/charts/engine/orderbook/depth.js +413 -0
- package/dist/charts/engine/orderbook/depth.js.map +1 -0
- package/dist/charts/engine/orderbook/format.cjs +2 -0
- package/dist/charts/engine/orderbook/format.cjs.map +1 -0
- package/dist/charts/engine/orderbook/format.d.cts +49 -0
- package/dist/charts/engine/orderbook/format.d.ts +49 -0
- package/dist/charts/engine/orderbook/format.js +65 -0
- package/dist/charts/engine/orderbook/format.js.map +1 -0
- package/dist/charts/engine/orderbook/heatmap.cjs +2 -0
- package/dist/charts/engine/orderbook/heatmap.cjs.map +1 -0
- package/dist/charts/engine/orderbook/heatmap.d.cts +9 -0
- package/dist/charts/engine/orderbook/heatmap.d.ts +9 -0
- package/dist/charts/engine/orderbook/heatmap.js +822 -0
- package/dist/charts/engine/orderbook/heatmap.js.map +1 -0
- package/dist/charts/engine/orderbook/host.cjs +2 -0
- package/dist/charts/engine/orderbook/host.cjs.map +1 -0
- package/dist/charts/engine/orderbook/host.d.cts +50 -0
- package/dist/charts/engine/orderbook/host.d.ts +50 -0
- package/dist/charts/engine/orderbook/host.js +161 -0
- package/dist/charts/engine/orderbook/host.js.map +1 -0
- package/dist/charts/engine/orderbook/index.cjs +1 -0
- package/dist/charts/engine/orderbook/index.d.cts +6 -0
- package/dist/charts/engine/orderbook/index.d.ts +6 -0
- package/dist/charts/engine/orderbook/index.js +6 -0
- package/dist/charts/engine/orderbook/ladder.cjs +2 -0
- package/dist/charts/engine/orderbook/ladder.cjs.map +1 -0
- package/dist/charts/engine/orderbook/ladder.d.cts +6 -0
- package/dist/charts/engine/orderbook/ladder.d.ts +6 -0
- package/dist/charts/engine/orderbook/ladder.js +341 -0
- package/dist/charts/engine/orderbook/ladder.js.map +1 -0
- package/dist/charts/engine/orderbook/layout.cjs +2 -0
- package/dist/charts/engine/orderbook/layout.cjs.map +1 -0
- package/dist/charts/engine/orderbook/layout.d.cts +37 -0
- package/dist/charts/engine/orderbook/layout.d.ts +37 -0
- package/dist/charts/engine/orderbook/layout.js +70 -0
- package/dist/charts/engine/orderbook/layout.js.map +1 -0
- package/dist/charts/engine/orderbook/tape.cjs +2 -0
- package/dist/charts/engine/orderbook/tape.cjs.map +1 -0
- package/dist/charts/engine/orderbook/tape.d.cts +6 -0
- package/dist/charts/engine/orderbook/tape.d.ts +6 -0
- package/dist/charts/engine/orderbook/tape.js +450 -0
- package/dist/charts/engine/orderbook/tape.js.map +1 -0
- package/dist/charts/engine/orderbook/types.d.cts +751 -0
- package/dist/charts/engine/orderbook/types.d.ts +751 -0
- package/dist/charts/engine/overlay.cjs +1 -1
- package/dist/charts/engine/overlay.cjs.map +1 -1
- package/dist/charts/engine/overlay.d.cts +28 -2
- package/dist/charts/engine/overlay.d.ts +28 -2
- package/dist/charts/engine/overlay.js +138 -96
- package/dist/charts/engine/overlay.js.map +1 -1
- package/dist/charts/engine/presets.cjs +2 -2
- package/dist/charts/engine/presets.cjs.map +1 -1
- package/dist/charts/engine/presets.d.cts +273 -3
- package/dist/charts/engine/presets.d.ts +273 -3
- package/dist/charts/engine/presets.js +390 -38
- package/dist/charts/engine/presets.js.map +1 -1
- package/dist/charts/engine/renderers/detect.cjs +1 -1
- package/dist/charts/engine/renderers/detect.cjs.map +1 -1
- package/dist/charts/engine/renderers/detect.d.cts +2 -1
- package/dist/charts/engine/renderers/detect.d.ts +2 -1
- package/dist/charts/engine/renderers/detect.js +24 -19
- package/dist/charts/engine/renderers/detect.js.map +1 -1
- package/dist/charts/engine/renderers/gl.cjs +2 -0
- package/dist/charts/engine/renderers/gl.cjs.map +1 -0
- package/dist/charts/engine/renderers/gl.d.cts +21 -0
- package/dist/charts/engine/renderers/gl.d.ts +21 -0
- package/dist/charts/engine/renderers/gl.js +56 -0
- package/dist/charts/engine/renderers/gl.js.map +1 -0
- package/dist/charts/engine/renderers/shaders.cjs +143 -1
- package/dist/charts/engine/renderers/shaders.cjs.map +1 -1
- package/dist/charts/engine/renderers/shaders.d.cts +16 -0
- package/dist/charts/engine/renderers/shaders.d.ts +16 -0
- package/dist/charts/engine/renderers/shaders.js +139 -1
- package/dist/charts/engine/renderers/shaders.js.map +1 -1
- package/dist/charts/engine/renderers/webgl.cjs +2 -0
- package/dist/charts/engine/renderers/webgl.cjs.map +1 -0
- package/dist/charts/engine/renderers/webgl.d.cts +4 -0
- package/dist/charts/engine/renderers/webgl.d.ts +4 -0
- package/dist/charts/engine/renderers/webgl.js +133 -0
- package/dist/charts/engine/renderers/webgl.js.map +1 -0
- package/dist/charts/engine/renderers/webgl2.cjs +1 -1
- package/dist/charts/engine/renderers/webgl2.cjs.map +1 -1
- package/dist/charts/engine/renderers/webgl2.d.cts +0 -1
- package/dist/charts/engine/renderers/webgl2.d.ts +0 -1
- package/dist/charts/engine/renderers/webgl2.js +59 -108
- package/dist/charts/engine/renderers/webgl2.js.map +1 -1
- package/dist/charts/engine/scale.cjs +1 -1
- package/dist/charts/engine/scale.cjs.map +1 -1
- package/dist/charts/engine/scale.js +1 -1
- package/dist/charts/engine/scale.js.map +1 -1
- package/dist/charts/engine/scene.cjs +1 -1
- package/dist/charts/engine/scene.cjs.map +1 -1
- package/dist/charts/engine/scene.d.cts +71 -8
- package/dist/charts/engine/scene.d.ts +71 -8
- package/dist/charts/engine/scene.js +465 -183
- package/dist/charts/engine/scene.js.map +1 -1
- package/dist/charts/engine/shapes/bullet.cjs +2 -0
- package/dist/charts/engine/shapes/bullet.cjs.map +1 -0
- package/dist/charts/engine/shapes/bullet.d.cts +6 -0
- package/dist/charts/engine/shapes/bullet.d.ts +6 -0
- package/dist/charts/engine/shapes/bullet.js +255 -0
- package/dist/charts/engine/shapes/bullet.js.map +1 -0
- package/dist/charts/engine/shapes/calendar.cjs +2 -0
- package/dist/charts/engine/shapes/calendar.cjs.map +1 -0
- package/dist/charts/engine/shapes/calendar.d.cts +38 -0
- package/dist/charts/engine/shapes/calendar.d.ts +38 -0
- package/dist/charts/engine/shapes/calendar.js +369 -0
- package/dist/charts/engine/shapes/calendar.js.map +1 -0
- package/dist/charts/engine/shapes/canvas.cjs +1 -1
- package/dist/charts/engine/shapes/canvas.cjs.map +1 -1
- package/dist/charts/engine/shapes/canvas.d.cts +7 -0
- package/dist/charts/engine/shapes/canvas.d.ts +7 -0
- package/dist/charts/engine/shapes/canvas.js +22 -13
- package/dist/charts/engine/shapes/canvas.js.map +1 -1
- package/dist/charts/engine/shapes/chart.cjs +1 -1
- package/dist/charts/engine/shapes/chart.cjs.map +1 -1
- package/dist/charts/engine/shapes/chart.d.cts +3 -2
- package/dist/charts/engine/shapes/chart.d.ts +3 -2
- package/dist/charts/engine/shapes/chart.js +49 -27
- package/dist/charts/engine/shapes/chart.js.map +1 -1
- package/dist/charts/engine/shapes/chord.cjs +2 -0
- package/dist/charts/engine/shapes/chord.cjs.map +1 -0
- package/dist/charts/engine/shapes/chord.d.cts +18 -0
- package/dist/charts/engine/shapes/chord.d.ts +18 -0
- package/dist/charts/engine/shapes/chord.js +414 -0
- package/dist/charts/engine/shapes/chord.js.map +1 -0
- package/dist/charts/engine/shapes/draw.cjs +1 -1
- package/dist/charts/engine/shapes/draw.cjs.map +1 -1
- package/dist/charts/engine/shapes/draw.d.cts +7 -1
- package/dist/charts/engine/shapes/draw.d.ts +7 -1
- package/dist/charts/engine/shapes/draw.js +62 -19
- package/dist/charts/engine/shapes/draw.js.map +1 -1
- package/dist/charts/engine/shapes/funnel.cjs +1 -1
- package/dist/charts/engine/shapes/funnel.cjs.map +1 -1
- package/dist/charts/engine/shapes/funnel.js +3 -3
- package/dist/charts/engine/shapes/funnel.js.map +1 -1
- package/dist/charts/engine/shapes/gauge.cjs +1 -1
- package/dist/charts/engine/shapes/gauge.cjs.map +1 -1
- package/dist/charts/engine/shapes/gauge.js +132 -95
- package/dist/charts/engine/shapes/gauge.js.map +1 -1
- package/dist/charts/engine/shapes/hit.cjs +1 -1
- package/dist/charts/engine/shapes/hit.cjs.map +1 -1
- package/dist/charts/engine/shapes/hit.d.cts +5 -1
- package/dist/charts/engine/shapes/hit.d.ts +5 -1
- package/dist/charts/engine/shapes/hit.js +89 -39
- package/dist/charts/engine/shapes/hit.js.map +1 -1
- package/dist/charts/engine/shapes/index.d.cts +6 -2
- package/dist/charts/engine/shapes/index.d.ts +6 -2
- package/dist/charts/engine/shapes/labels.cjs +2 -0
- package/dist/charts/engine/shapes/labels.cjs.map +1 -0
- package/dist/charts/engine/shapes/labels.d.cts +14 -0
- package/dist/charts/engine/shapes/labels.d.ts +14 -0
- package/dist/charts/engine/shapes/labels.js +154 -0
- package/dist/charts/engine/shapes/labels.js.map +1 -0
- package/dist/charts/engine/shapes/layout.cjs +2 -2
- package/dist/charts/engine/shapes/layout.cjs.map +1 -1
- package/dist/charts/engine/shapes/layout.d.cts +10 -3
- package/dist/charts/engine/shapes/layout.d.ts +10 -3
- package/dist/charts/engine/shapes/layout.js +239 -124
- package/dist/charts/engine/shapes/layout.js.map +1 -1
- package/dist/charts/engine/shapes/pie.cjs +1 -1
- package/dist/charts/engine/shapes/pie.cjs.map +1 -1
- package/dist/charts/engine/shapes/pie.js +2 -2
- package/dist/charts/engine/shapes/pie.js.map +1 -1
- package/dist/charts/engine/shapes/radar.cjs +1 -1
- package/dist/charts/engine/shapes/radar.cjs.map +1 -1
- package/dist/charts/engine/shapes/radar.d.cts +2 -2
- package/dist/charts/engine/shapes/radar.d.ts +2 -2
- package/dist/charts/engine/shapes/radar.js +50 -49
- package/dist/charts/engine/shapes/radar.js.map +1 -1
- package/dist/charts/engine/shapes/radialBar.cjs +2 -0
- package/dist/charts/engine/shapes/radialBar.cjs.map +1 -0
- package/dist/charts/engine/shapes/radialBar.d.cts +8 -0
- package/dist/charts/engine/shapes/radialBar.d.ts +8 -0
- package/dist/charts/engine/shapes/radialBar.js +155 -0
- package/dist/charts/engine/shapes/radialBar.js.map +1 -0
- package/dist/charts/engine/shapes/runtime.cjs +1 -1
- package/dist/charts/engine/shapes/runtime.cjs.map +1 -1
- package/dist/charts/engine/shapes/runtime.d.cts +9 -2
- package/dist/charts/engine/shapes/runtime.d.ts +9 -2
- package/dist/charts/engine/shapes/runtime.js +61 -51
- package/dist/charts/engine/shapes/runtime.js.map +1 -1
- package/dist/charts/engine/shapes/sankey.cjs +2 -0
- package/dist/charts/engine/shapes/sankey.cjs.map +1 -0
- package/dist/charts/engine/shapes/sankey.d.cts +29 -0
- package/dist/charts/engine/shapes/sankey.d.ts +29 -0
- package/dist/charts/engine/shapes/sankey.js +372 -0
- package/dist/charts/engine/shapes/sankey.js.map +1 -0
- package/dist/charts/engine/shapes/scene.cjs +1 -1
- package/dist/charts/engine/shapes/scene.cjs.map +1 -1
- package/dist/charts/engine/shapes/scene.d.cts +92 -8
- package/dist/charts/engine/shapes/scene.d.ts +92 -8
- package/dist/charts/engine/shapes/scene.js +76 -31
- package/dist/charts/engine/shapes/scene.js.map +1 -1
- package/dist/charts/engine/shapes/sunburst.cjs +2 -0
- package/dist/charts/engine/shapes/sunburst.cjs.map +1 -0
- package/dist/charts/engine/shapes/sunburst.d.cts +6 -0
- package/dist/charts/engine/shapes/sunburst.d.ts +6 -0
- package/dist/charts/engine/shapes/sunburst.js +261 -0
- package/dist/charts/engine/shapes/sunburst.js.map +1 -0
- package/dist/charts/engine/shapes/treemap.cjs +1 -1
- package/dist/charts/engine/shapes/treemap.cjs.map +1 -1
- package/dist/charts/engine/shapes/treemap.js +2 -2
- package/dist/charts/engine/shapes/treemap.js.map +1 -1
- package/dist/charts/engine/shapes/types.d.cts +550 -12
- package/dist/charts/engine/shapes/types.d.ts +550 -12
- package/dist/charts/engine/signature.cjs +1 -1
- package/dist/charts/engine/signature.cjs.map +1 -1
- package/dist/charts/engine/signature.js +1 -1
- package/dist/charts/engine/signature.js.map +1 -1
- package/dist/charts/engine/three-d/canvas2d.cjs +2 -0
- package/dist/charts/engine/three-d/canvas2d.cjs.map +1 -0
- package/dist/charts/engine/three-d/canvas2d.d.cts +7 -0
- package/dist/charts/engine/three-d/canvas2d.d.ts +7 -0
- package/dist/charts/engine/three-d/canvas2d.js +128 -0
- package/dist/charts/engine/three-d/canvas2d.js.map +1 -0
- package/dist/charts/engine/three-d/chart.cjs +2 -0
- package/dist/charts/engine/three-d/chart.cjs.map +1 -0
- package/dist/charts/engine/three-d/chart.d.cts +15 -0
- package/dist/charts/engine/three-d/chart.d.ts +15 -0
- package/dist/charts/engine/three-d/chart.js +621 -0
- package/dist/charts/engine/three-d/chart.js.map +1 -0
- package/dist/charts/engine/three-d/colormap.cjs +2 -0
- package/dist/charts/engine/three-d/colormap.cjs.map +1 -0
- package/dist/charts/engine/three-d/colormap.d.cts +16 -0
- package/dist/charts/engine/three-d/colormap.d.ts +16 -0
- package/dist/charts/engine/three-d/colormap.js +166 -0
- package/dist/charts/engine/three-d/colormap.js.map +1 -0
- package/dist/charts/engine/three-d/contours.cjs +2 -0
- package/dist/charts/engine/three-d/contours.cjs.map +1 -0
- package/dist/charts/engine/three-d/contours.d.cts +7 -0
- package/dist/charts/engine/three-d/contours.d.ts +7 -0
- package/dist/charts/engine/three-d/contours.js +47 -0
- package/dist/charts/engine/three-d/contours.js.map +1 -0
- package/dist/charts/engine/three-d/detect.cjs +2 -0
- package/dist/charts/engine/three-d/detect.cjs.map +1 -0
- package/dist/charts/engine/three-d/detect.d.cts +12 -0
- package/dist/charts/engine/three-d/detect.d.ts +12 -0
- package/dist/charts/engine/three-d/detect.js +37 -0
- package/dist/charts/engine/three-d/detect.js.map +1 -0
- package/dist/charts/engine/three-d/dom.cjs +2 -0
- package/dist/charts/engine/three-d/dom.cjs.map +1 -0
- package/dist/charts/engine/three-d/dom.d.cts +21 -0
- package/dist/charts/engine/three-d/dom.d.ts +21 -0
- package/dist/charts/engine/three-d/dom.js +98 -0
- package/dist/charts/engine/three-d/dom.js.map +1 -0
- package/dist/charts/engine/three-d/geometry.cjs +2 -0
- package/dist/charts/engine/three-d/geometry.cjs.map +1 -0
- package/dist/charts/engine/three-d/geometry.d.cts +82 -0
- package/dist/charts/engine/three-d/geometry.d.ts +82 -0
- package/dist/charts/engine/three-d/geometry.js +545 -0
- package/dist/charts/engine/three-d/geometry.js.map +1 -0
- package/dist/charts/engine/three-d/hover.cjs +2 -0
- package/dist/charts/engine/three-d/hover.cjs.map +1 -0
- package/dist/charts/engine/three-d/hover.d.cts +25 -0
- package/dist/charts/engine/three-d/hover.d.ts +25 -0
- package/dist/charts/engine/three-d/hover.js +131 -0
- package/dist/charts/engine/three-d/hover.js.map +1 -0
- package/dist/charts/engine/three-d/index.cjs +1 -0
- package/dist/charts/engine/three-d/index.d.cts +2 -0
- package/dist/charts/engine/three-d/index.d.ts +2 -0
- package/dist/charts/engine/three-d/index.js +2 -0
- package/dist/charts/engine/three-d/labels.cjs +2 -0
- package/dist/charts/engine/three-d/labels.cjs.map +1 -0
- package/dist/charts/engine/three-d/labels.d.cts +23 -0
- package/dist/charts/engine/three-d/labels.d.ts +23 -0
- package/dist/charts/engine/three-d/labels.js +136 -0
- package/dist/charts/engine/three-d/labels.js.map +1 -0
- package/dist/charts/engine/three-d/math.cjs +2 -0
- package/dist/charts/engine/three-d/math.cjs.map +1 -0
- package/dist/charts/engine/three-d/math.d.cts +84 -0
- package/dist/charts/engine/three-d/math.d.ts +84 -0
- package/dist/charts/engine/three-d/math.js +150 -0
- package/dist/charts/engine/three-d/math.js.map +1 -0
- package/dist/charts/engine/three-d/model.cjs +2 -0
- package/dist/charts/engine/three-d/model.cjs.map +1 -0
- package/dist/charts/engine/three-d/model.d.cts +132 -0
- package/dist/charts/engine/three-d/model.d.ts +132 -0
- package/dist/charts/engine/three-d/model.js +279 -0
- package/dist/charts/engine/three-d/model.js.map +1 -0
- package/dist/charts/engine/three-d/overlay.cjs +2 -0
- package/dist/charts/engine/three-d/overlay.cjs.map +1 -0
- package/dist/charts/engine/three-d/overlay.d.cts +72 -0
- package/dist/charts/engine/three-d/overlay.d.ts +72 -0
- package/dist/charts/engine/three-d/overlay.js +204 -0
- package/dist/charts/engine/three-d/overlay.js.map +1 -0
- package/dist/charts/engine/three-d/pick.cjs +2 -0
- package/dist/charts/engine/three-d/pick.cjs.map +1 -0
- package/dist/charts/engine/three-d/pick.d.cts +52 -0
- package/dist/charts/engine/three-d/pick.d.ts +52 -0
- package/dist/charts/engine/three-d/pick.js +220 -0
- package/dist/charts/engine/three-d/pick.js.map +1 -0
- package/dist/charts/engine/three-d/render-types.cjs +2 -0
- package/dist/charts/engine/three-d/render-types.cjs.map +1 -0
- package/dist/charts/engine/three-d/render-types.d.cts +103 -0
- package/dist/charts/engine/three-d/render-types.d.ts +103 -0
- package/dist/charts/engine/three-d/render-types.js +12 -0
- package/dist/charts/engine/three-d/render-types.js.map +1 -0
- package/dist/charts/engine/three-d/shaders.cjs +311 -0
- package/dist/charts/engine/three-d/shaders.cjs.map +1 -0
- package/dist/charts/engine/three-d/shaders.d.cts +25 -0
- package/dist/charts/engine/three-d/shaders.d.ts +25 -0
- package/dist/charts/engine/three-d/shaders.js +210 -0
- package/dist/charts/engine/three-d/shaders.js.map +1 -0
- package/dist/charts/engine/three-d/sort.cjs +2 -0
- package/dist/charts/engine/three-d/sort.cjs.map +1 -0
- package/dist/charts/engine/three-d/sort.d.cts +29 -0
- package/dist/charts/engine/three-d/sort.d.ts +29 -0
- package/dist/charts/engine/three-d/sort.js +145 -0
- package/dist/charts/engine/three-d/sort.js.map +1 -0
- package/dist/charts/engine/three-d/types.d.cts +615 -0
- package/dist/charts/engine/three-d/types.d.ts +615 -0
- package/dist/charts/engine/three-d/webgl.cjs +2 -0
- package/dist/charts/engine/three-d/webgl.cjs.map +1 -0
- package/dist/charts/engine/three-d/webgl.d.cts +10 -0
- package/dist/charts/engine/three-d/webgl.d.ts +10 -0
- package/dist/charts/engine/three-d/webgl.js +132 -0
- package/dist/charts/engine/three-d/webgl.js.map +1 -0
- package/dist/charts/engine/three-d/webgpu.cjs +2 -0
- package/dist/charts/engine/three-d/webgpu.cjs.map +1 -0
- package/dist/charts/engine/three-d/webgpu.d.cts +5 -0
- package/dist/charts/engine/three-d/webgpu.d.ts +5 -0
- package/dist/charts/engine/three-d/webgpu.js +260 -0
- package/dist/charts/engine/three-d/webgpu.js.map +1 -0
- package/dist/charts/engine/time.cjs +1 -1
- package/dist/charts/engine/time.cjs.map +1 -1
- package/dist/charts/engine/time.d.cts +13 -4
- package/dist/charts/engine/time.d.ts +13 -4
- package/dist/charts/engine/time.js +156 -91
- package/dist/charts/engine/time.js.map +1 -1
- package/dist/charts/engine/trading/chart.cjs +2 -0
- package/dist/charts/engine/trading/chart.cjs.map +1 -0
- package/dist/charts/engine/trading/chart.d.cts +13 -0
- package/dist/charts/engine/trading/chart.d.ts +13 -0
- package/dist/charts/engine/trading/chart.js +2206 -0
- package/dist/charts/engine/trading/chart.js.map +1 -0
- package/dist/charts/engine/trading/drawings.cjs +3 -0
- package/dist/charts/engine/trading/drawings.cjs.map +1 -0
- package/dist/charts/engine/trading/drawings.d.cts +95 -0
- package/dist/charts/engine/trading/drawings.d.ts +95 -0
- package/dist/charts/engine/trading/drawings.js +423 -0
- package/dist/charts/engine/trading/drawings.js.map +1 -0
- package/dist/charts/engine/trading/format.cjs +2 -0
- package/dist/charts/engine/trading/format.cjs.map +1 -0
- package/dist/charts/engine/trading/format.d.cts +73 -0
- package/dist/charts/engine/trading/format.d.ts +73 -0
- package/dist/charts/engine/trading/format.js +163 -0
- package/dist/charts/engine/trading/format.js.map +1 -0
- package/dist/charts/engine/trading/geometry.cjs +2 -0
- package/dist/charts/engine/trading/geometry.cjs.map +1 -0
- package/dist/charts/engine/trading/geometry.d.cts +55 -0
- package/dist/charts/engine/trading/geometry.d.ts +55 -0
- package/dist/charts/engine/trading/geometry.js +131 -0
- package/dist/charts/engine/trading/geometry.js.map +1 -0
- package/dist/charts/engine/trading/index.cjs +1 -0
- package/dist/charts/engine/trading/index.d.cts +4 -0
- package/dist/charts/engine/trading/index.d.ts +4 -0
- package/dist/charts/engine/trading/index.js +4 -0
- package/dist/charts/engine/trading/indicators.cjs +2 -0
- package/dist/charts/engine/trading/indicators.cjs.map +1 -0
- package/dist/charts/engine/trading/indicators.d.cts +275 -0
- package/dist/charts/engine/trading/indicators.d.ts +275 -0
- package/dist/charts/engine/trading/indicators.js +544 -0
- package/dist/charts/engine/trading/indicators.js.map +1 -0
- package/dist/charts/engine/trading/labels.cjs +2 -0
- package/dist/charts/engine/trading/labels.cjs.map +1 -0
- package/dist/charts/engine/trading/labels.d.cts +7 -0
- package/dist/charts/engine/trading/labels.d.ts +7 -0
- package/dist/charts/engine/trading/labels.js +171 -0
- package/dist/charts/engine/trading/labels.js.map +1 -0
- package/dist/charts/engine/trading/scale.cjs +2 -0
- package/dist/charts/engine/trading/scale.cjs.map +1 -0
- package/dist/charts/engine/trading/scale.d.cts +46 -0
- package/dist/charts/engine/trading/scale.d.ts +46 -0
- package/dist/charts/engine/trading/scale.js +100 -0
- package/dist/charts/engine/trading/scale.js.map +1 -0
- package/dist/charts/engine/trading/store.cjs +2 -0
- package/dist/charts/engine/trading/store.cjs.map +1 -0
- package/dist/charts/engine/trading/store.d.cts +83 -0
- package/dist/charts/engine/trading/store.d.ts +83 -0
- package/dist/charts/engine/trading/store.js +150 -0
- package/dist/charts/engine/trading/store.js.map +1 -0
- package/dist/charts/engine/trading/studies.cjs +2 -0
- package/dist/charts/engine/trading/studies.cjs.map +1 -0
- package/dist/charts/engine/trading/studies.d.cts +85 -0
- package/dist/charts/engine/trading/studies.d.ts +85 -0
- package/dist/charts/engine/trading/studies.js +510 -0
- package/dist/charts/engine/trading/studies.js.map +1 -0
- package/dist/charts/engine/trading/sync.cjs +2 -0
- package/dist/charts/engine/trading/sync.cjs.map +1 -0
- package/dist/charts/engine/trading/sync.d.cts +8 -0
- package/dist/charts/engine/trading/sync.d.ts +8 -0
- package/dist/charts/engine/trading/sync.js +25 -0
- package/dist/charts/engine/trading/sync.js.map +1 -0
- package/dist/charts/engine/trading/types.d.cts +1131 -0
- package/dist/charts/engine/trading/types.d.ts +1131 -0
- package/dist/charts/engine/types.d.cts +247 -22
- package/dist/charts/engine/types.d.ts +247 -22
- package/dist/charts/index.cjs +1 -1
- package/dist/charts/index.d.cts +8 -4
- package/dist/charts/index.d.ts +8 -4
- package/dist/charts/index.js +30 -11
- package/dist/charts/react/Chart.cjs +1 -1
- package/dist/charts/react/Chart.cjs.map +1 -1
- package/dist/charts/react/Chart.d.cts +4 -4
- package/dist/charts/react/Chart.d.ts +4 -4
- package/dist/charts/react/Chart.js +5 -1
- package/dist/charts/react/Chart.js.map +1 -1
- package/dist/charts/react/charts.cjs +1 -1
- package/dist/charts/react/charts.cjs.map +1 -1
- package/dist/charts/react/charts.d.cts +39 -1
- package/dist/charts/react/charts.d.ts +39 -1
- package/dist/charts/react/charts.js +312 -128
- package/dist/charts/react/charts.js.map +1 -1
- package/dist/charts/react/graph.cjs +2 -0
- package/dist/charts/react/graph.cjs.map +1 -0
- package/dist/charts/react/graph.d.cts +213 -0
- package/dist/charts/react/graph.d.ts +213 -0
- package/dist/charts/react/graph.js +159 -0
- package/dist/charts/react/graph.js.map +1 -0
- package/dist/charts/react/orderbook.cjs +2 -0
- package/dist/charts/react/orderbook.cjs.map +1 -0
- package/dist/charts/react/orderbook.d.cts +142 -0
- package/dist/charts/react/orderbook.d.ts +142 -0
- package/dist/charts/react/orderbook.js +182 -0
- package/dist/charts/react/orderbook.js.map +1 -0
- package/dist/charts/react/shapes.cjs +1 -1
- package/dist/charts/react/shapes.cjs.map +1 -1
- package/dist/charts/react/shapes.d.cts +374 -9
- package/dist/charts/react/shapes.d.ts +374 -9
- package/dist/charts/react/shapes.js +323 -93
- package/dist/charts/react/shapes.js.map +1 -1
- package/dist/charts/react/three-d.cjs +2 -0
- package/dist/charts/react/three-d.cjs.map +1 -0
- package/dist/charts/react/three-d.d.cts +151 -0
- package/dist/charts/react/three-d.d.ts +151 -0
- package/dist/charts/react/three-d.js +154 -0
- package/dist/charts/react/three-d.js.map +1 -0
- package/dist/charts/react/trading.cjs +2 -0
- package/dist/charts/react/trading.cjs.map +1 -0
- package/dist/charts/react/trading.d.cts +145 -0
- package/dist/charts/react/trading.d.ts +145 -0
- package/dist/charts/react/trading.js +126 -0
- package/dist/charts/react/trading.js.map +1 -0
- package/dist/charts/react/types.d.cts +143 -8
- package/dist/charts/react/types.d.ts +143 -8
- package/dist/core/contracts.cjs +1 -1
- package/dist/core/contracts.cjs.map +1 -1
- package/dist/core/contracts.js +1 -1
- package/dist/core/contracts.js.map +1 -1
- package/dist/native/charts/src/canvas.cjs +1 -1
- package/dist/native/charts/src/canvas.js +9 -3
- package/dist/native/charts/src/engine/axis.cjs +1 -1
- package/dist/native/charts/src/engine/axis.cjs.map +1 -1
- package/dist/native/charts/src/engine/axis.js +43 -20
- package/dist/native/charts/src/engine/axis.js.map +1 -1
- package/dist/native/charts/src/engine/color.cjs +1 -1
- package/dist/native/charts/src/engine/color.cjs.map +1 -1
- package/dist/native/charts/src/engine/color.js +47 -5
- package/dist/native/charts/src/engine/color.js.map +1 -1
- package/dist/native/charts/src/engine/controller.cjs +2 -2
- package/dist/native/charts/src/engine/controller.cjs.map +1 -1
- package/dist/native/charts/src/engine/controller.js +415 -308
- package/dist/native/charts/src/engine/controller.js.map +1 -1
- package/dist/native/charts/src/engine/data.cjs +1 -1
- package/dist/native/charts/src/engine/data.cjs.map +1 -1
- package/dist/native/charts/src/engine/data.js +65 -49
- package/dist/native/charts/src/engine/data.js.map +1 -1
- package/dist/native/charts/src/engine/format.cjs +1 -1
- package/dist/native/charts/src/engine/format.cjs.map +1 -1
- package/dist/native/charts/src/engine/format.js +59 -21
- package/dist/native/charts/src/engine/format.js.map +1 -1
- package/dist/native/charts/src/engine/labels.cjs +2 -0
- package/dist/native/charts/src/engine/labels.cjs.map +1 -0
- package/dist/native/charts/src/engine/labels.js +98 -0
- package/dist/native/charts/src/engine/labels.js.map +1 -0
- package/dist/native/charts/src/engine/layout.cjs +1 -1
- package/dist/native/charts/src/engine/layout.cjs.map +1 -1
- package/dist/native/charts/src/engine/layout.js +62 -12
- package/dist/native/charts/src/engine/layout.js.map +1 -1
- package/dist/native/charts/src/engine/locale.cjs +2 -0
- package/dist/native/charts/src/engine/locale.cjs.map +1 -0
- package/dist/native/charts/src/engine/locale.js +60 -0
- package/dist/native/charts/src/engine/locale.js.map +1 -0
- package/dist/native/charts/src/engine/model.cjs +1 -1
- package/dist/native/charts/src/engine/model.cjs.map +1 -1
- package/dist/native/charts/src/engine/model.js +307 -119
- package/dist/native/charts/src/engine/model.js.map +1 -1
- package/dist/native/charts/src/engine/overlay.cjs +1 -1
- package/dist/native/charts/src/engine/overlay.cjs.map +1 -1
- package/dist/native/charts/src/engine/overlay.js +46 -23
- package/dist/native/charts/src/engine/overlay.js.map +1 -1
- package/dist/native/charts/src/engine/presets.cjs +2 -2
- package/dist/native/charts/src/engine/presets.cjs.map +1 -1
- package/dist/native/charts/src/engine/presets.js +470 -41
- package/dist/native/charts/src/engine/presets.js.map +1 -1
- package/dist/native/charts/src/engine/scale.cjs +1 -1
- package/dist/native/charts/src/engine/scale.cjs.map +1 -1
- package/dist/native/charts/src/engine/scale.js +1 -1
- package/dist/native/charts/src/engine/scale.js.map +1 -1
- package/dist/native/charts/src/engine/scene.cjs +1 -1
- package/dist/native/charts/src/engine/scene.cjs.map +1 -1
- package/dist/native/charts/src/engine/scene.js +489 -207
- package/dist/native/charts/src/engine/scene.js.map +1 -1
- package/dist/native/charts/src/engine/shapes/bullet.cjs +2 -0
- package/dist/native/charts/src/engine/shapes/bullet.cjs.map +1 -0
- package/dist/native/charts/src/engine/shapes/bullet.js +255 -0
- package/dist/native/charts/src/engine/shapes/bullet.js.map +1 -0
- package/dist/native/charts/src/engine/shapes/calendar.cjs +2 -0
- package/dist/native/charts/src/engine/shapes/calendar.cjs.map +1 -0
- package/dist/native/charts/src/engine/shapes/calendar.js +369 -0
- package/dist/native/charts/src/engine/shapes/calendar.js.map +1 -0
- package/dist/native/charts/src/engine/shapes/canvas.cjs +2 -0
- package/dist/native/charts/src/engine/shapes/canvas.cjs.map +1 -0
- package/dist/native/charts/src/engine/shapes/canvas.js +168 -0
- package/dist/native/charts/src/engine/shapes/canvas.js.map +1 -0
- package/dist/native/charts/src/engine/shapes/chord.cjs +2 -0
- package/dist/native/charts/src/engine/shapes/chord.cjs.map +1 -0
- package/dist/native/charts/src/engine/shapes/chord.js +414 -0
- package/dist/native/charts/src/engine/shapes/chord.js.map +1 -0
- package/dist/native/charts/src/engine/shapes/draw.cjs +2 -0
- package/dist/native/charts/src/engine/shapes/draw.cjs.map +1 -0
- package/dist/native/charts/src/engine/shapes/draw.js +195 -0
- package/dist/native/charts/src/engine/shapes/draw.js.map +1 -0
- package/dist/native/charts/src/engine/shapes/funnel.cjs +2 -0
- package/dist/native/charts/src/engine/shapes/funnel.cjs.map +1 -0
- package/dist/native/charts/src/engine/shapes/funnel.js +149 -0
- package/dist/native/charts/src/engine/shapes/funnel.js.map +1 -0
- package/dist/native/charts/src/engine/shapes/gauge.cjs +2 -0
- package/dist/native/charts/src/engine/shapes/gauge.cjs.map +1 -0
- package/dist/native/charts/src/engine/shapes/gauge.js +210 -0
- package/dist/native/charts/src/engine/shapes/gauge.js.map +1 -0
- package/dist/native/charts/src/engine/shapes/hit.cjs +2 -0
- package/dist/native/charts/src/engine/shapes/hit.cjs.map +1 -0
- package/dist/native/charts/src/engine/shapes/hit.js +135 -0
- package/dist/native/charts/src/engine/shapes/hit.js.map +1 -0
- package/dist/native/charts/src/engine/shapes/labels.cjs +2 -0
- package/dist/native/charts/src/engine/shapes/labels.cjs.map +1 -0
- package/dist/native/charts/src/engine/shapes/labels.js +154 -0
- package/dist/native/charts/src/engine/shapes/labels.js.map +1 -0
- package/dist/native/charts/src/engine/shapes/layout.cjs +3 -0
- package/dist/native/charts/src/engine/shapes/layout.cjs.map +1 -0
- package/dist/native/charts/src/engine/shapes/layout.js +358 -0
- package/dist/native/charts/src/engine/shapes/layout.js.map +1 -0
- package/dist/native/charts/src/engine/shapes/pie.cjs +2 -0
- package/dist/native/charts/src/engine/shapes/pie.cjs.map +1 -0
- package/dist/native/charts/src/engine/shapes/pie.js +302 -0
- package/dist/native/charts/src/engine/shapes/pie.js.map +1 -0
- package/dist/native/charts/src/engine/shapes/radar.cjs +2 -0
- package/dist/native/charts/src/engine/shapes/radar.cjs.map +1 -0
- package/dist/native/charts/src/engine/shapes/radar.js +198 -0
- package/dist/native/charts/src/engine/shapes/radar.js.map +1 -0
- package/dist/native/charts/src/engine/shapes/radialBar.cjs +2 -0
- package/dist/native/charts/src/engine/shapes/radialBar.cjs.map +1 -0
- package/dist/native/charts/src/engine/shapes/radialBar.js +155 -0
- package/dist/native/charts/src/engine/shapes/radialBar.js.map +1 -0
- package/dist/native/charts/src/engine/shapes/runtime.cjs +2 -0
- package/dist/native/charts/src/engine/shapes/runtime.cjs.map +1 -0
- package/dist/native/charts/src/engine/shapes/runtime.js +107 -0
- package/dist/native/charts/src/engine/shapes/runtime.js.map +1 -0
- package/dist/native/charts/src/engine/shapes/sankey.cjs +2 -0
- package/dist/native/charts/src/engine/shapes/sankey.cjs.map +1 -0
- package/dist/native/charts/src/engine/shapes/sankey.js +372 -0
- package/dist/native/charts/src/engine/shapes/sankey.js.map +1 -0
- package/dist/native/charts/src/engine/shapes/scene.cjs +2 -0
- package/dist/native/charts/src/engine/shapes/scene.cjs.map +1 -0
- package/dist/native/charts/src/engine/shapes/scene.js +168 -0
- package/dist/native/charts/src/engine/shapes/scene.js.map +1 -0
- package/dist/native/charts/src/engine/shapes/sunburst.cjs +2 -0
- package/dist/native/charts/src/engine/shapes/sunburst.cjs.map +1 -0
- package/dist/native/charts/src/engine/shapes/sunburst.js +261 -0
- package/dist/native/charts/src/engine/shapes/sunburst.js.map +1 -0
- package/dist/native/charts/src/engine/shapes/treemap.cjs +2 -0
- package/dist/native/charts/src/engine/shapes/treemap.cjs.map +1 -0
- package/dist/native/charts/src/engine/shapes/treemap.js +213 -0
- package/dist/native/charts/src/engine/shapes/treemap.js.map +1 -0
- package/dist/native/charts/src/engine/time.cjs +1 -1
- package/dist/native/charts/src/engine/time.cjs.map +1 -1
- package/dist/native/charts/src/engine/time.js +156 -91
- package/dist/native/charts/src/engine/time.js.map +1 -1
- package/dist/native/components/Chart/ChartBase.cjs +1 -1
- package/dist/native/components/Chart/ChartBase.cjs.map +1 -1
- package/dist/native/components/Chart/ChartBase.d.cts +1 -1
- package/dist/native/components/Chart/ChartBase.d.ts +1 -1
- package/dist/native/components/Chart/ChartBase.js +110 -107
- package/dist/native/components/Chart/ChartBase.js.map +1 -1
- package/dist/native/components/Chart/charts.cjs +1 -1
- package/dist/native/components/Chart/charts.cjs.map +1 -1
- package/dist/native/components/Chart/charts.d.cts +6 -1
- package/dist/native/components/Chart/charts.d.ts +6 -1
- package/dist/native/components/Chart/charts.js +53 -29
- package/dist/native/components/Chart/charts.js.map +1 -1
- package/dist/native/components/Chart/index.cjs +1 -1
- package/dist/native/components/Chart/index.d.cts +1 -1
- package/dist/native/components/Chart/index.d.ts +1 -1
- package/dist/native/components/Chart/index.js +2 -2
- package/dist/native/components/Chart/scene.cjs +1 -1
- package/dist/native/components/Chart/scene.cjs.map +1 -1
- package/dist/native/components/Chart/scene.js +315 -229
- package/dist/native/components/Chart/scene.js.map +1 -1
- package/dist/native/components/Chart/types.d.cts +26 -3
- package/dist/native/components/Chart/types.d.ts +26 -3
- package/dist/native/components/Charts/charts.cjs +2 -0
- package/dist/native/components/Charts/charts.cjs.map +1 -0
- package/dist/native/components/Charts/charts.d.cts +41 -0
- package/dist/native/components/Charts/charts.d.ts +41 -0
- package/dist/native/components/Charts/charts.js +350 -0
- package/dist/native/components/Charts/charts.js.map +1 -0
- package/dist/native/components/Charts/index.cjs +1 -0
- package/dist/native/components/Charts/index.d.cts +2 -0
- package/dist/native/components/Charts/index.d.ts +2 -0
- package/dist/native/components/Charts/index.js +2 -0
- package/dist/native/components/Charts/types.d.cts +155 -0
- package/dist/native/components/Charts/types.d.ts +155 -0
- package/dist/native/components/ShapeChart/ShapeChartBase.cjs +2 -0
- package/dist/native/components/ShapeChart/ShapeChartBase.cjs.map +1 -0
- package/dist/native/components/ShapeChart/ShapeChartBase.d.cts +24 -0
- package/dist/native/components/ShapeChart/ShapeChartBase.d.ts +24 -0
- package/dist/native/components/ShapeChart/ShapeChartBase.js +272 -0
- package/dist/native/components/ShapeChart/ShapeChartBase.js.map +1 -0
- package/dist/native/components/ShapeChart/charts.cjs +2 -0
- package/dist/native/components/ShapeChart/charts.cjs.map +1 -0
- package/dist/native/components/ShapeChart/charts.d.cts +43 -0
- package/dist/native/components/ShapeChart/charts.d.ts +43 -0
- package/dist/native/components/ShapeChart/charts.js +429 -0
- package/dist/native/components/ShapeChart/charts.js.map +1 -0
- package/dist/native/components/ShapeChart/draw.cjs +2 -0
- package/dist/native/components/ShapeChart/draw.cjs.map +1 -0
- package/dist/native/components/ShapeChart/draw.d.cts +4 -0
- package/dist/native/components/ShapeChart/draw.d.ts +4 -0
- package/dist/native/components/ShapeChart/draw.js +113 -0
- package/dist/native/components/ShapeChart/draw.js.map +1 -0
- package/dist/native/components/ShapeChart/geometry.cjs +2 -0
- package/dist/native/components/ShapeChart/geometry.cjs.map +1 -0
- package/dist/native/components/ShapeChart/geometry.d.cts +71 -0
- package/dist/native/components/ShapeChart/geometry.d.ts +71 -0
- package/dist/native/components/ShapeChart/geometry.js +681 -0
- package/dist/native/components/ShapeChart/geometry.js.map +1 -0
- package/dist/native/components/ShapeChart/index.cjs +1 -0
- package/dist/native/components/ShapeChart/index.d.cts +2 -0
- package/dist/native/components/ShapeChart/index.d.ts +2 -0
- package/dist/native/components/ShapeChart/index.js +2 -0
- package/dist/native/components/ShapeChart/recorder.cjs +2 -0
- package/dist/native/components/ShapeChart/recorder.cjs.map +1 -0
- package/dist/native/components/ShapeChart/recorder.d.cts +115 -0
- package/dist/native/components/ShapeChart/recorder.d.ts +115 -0
- package/dist/native/components/ShapeChart/recorder.js +583 -0
- package/dist/native/components/ShapeChart/recorder.js.map +1 -0
- package/dist/native/components/ShapeChart/types.d.cts +594 -0
- package/dist/native/components/ShapeChart/types.d.ts +594 -0
- package/dist/native/index.cjs +1 -1
- package/dist/native/index.d.cts +2 -0
- package/dist/native/index.d.ts +2 -0
- package/dist/native/index.js +14 -10
- package/dist/native/manifest.d.cts +6 -4
- package/dist/native/manifest.d.ts +6 -4
- package/dist/native/source/components/Chart/ChartBase.tsx +8 -1
- package/dist/native/source/components/Chart/charts.tsx +42 -6
- package/dist/native/source/components/Chart/index.ts +1 -0
- package/dist/native/source/components/Chart/scene.tsx +312 -98
- package/dist/native/source/components/Chart/types.ts +31 -1
- package/dist/native/source/components/Charts/charts.tsx +521 -0
- package/dist/native/source/components/Charts/index.ts +14 -0
- package/dist/native/source/components/Charts/types.ts +218 -0
- package/dist/native/source/components/ShapeChart/ShapeChartBase.tsx +486 -0
- package/dist/native/source/components/ShapeChart/charts.tsx +661 -0
- package/dist/native/source/components/ShapeChart/draw.tsx +201 -0
- package/dist/native/source/components/ShapeChart/geometry.ts +1366 -0
- package/dist/native/source/components/ShapeChart/index.ts +16 -0
- package/dist/native/source/components/ShapeChart/recorder.ts +845 -0
- package/dist/native/source/components/ShapeChart/types.ts +655 -0
- package/dist/native/source/index.ts +2 -0
- package/dist/native/source/manifest.ts +31 -4
- package/dist/taro/charts.d.ts +229 -4
- package/dist/taro/index.d.ts +1 -0
- package/dist/taro/index.js +8818 -2093
- package/dist/taro/manifest.d.ts +1 -0
- package/dist/taro/shape-charts.d.ts +629 -0
- package/dist/uni/AreaChart.vue +68 -0
- package/dist/uni/AreaChart.vue.d.ts +124 -0
- package/dist/uni/Badge.vue.d.ts +1 -1
- package/dist/uni/BarChart.vue.d.ts +5 -1
- package/dist/uni/BoxPlotChart.vue +66 -0
- package/dist/uni/BoxPlotChart.vue.d.ts +110 -0
- package/dist/uni/BubbleChart.vue +68 -0
- package/dist/uni/BubbleChart.vue.d.ts +110 -0
- package/dist/uni/BulletChart.vue +86 -0
- package/dist/uni/BulletChart.vue.d.ts +114 -0
- package/dist/uni/CalendarHeatmap.vue +92 -0
- package/dist/uni/CalendarHeatmap.vue.d.ts +131 -0
- package/dist/uni/CandlestickChart.vue +66 -0
- package/dist/uni/CandlestickChart.vue.d.ts +104 -0
- package/dist/uni/Chart.vue.d.ts +4 -0
- package/dist/uni/ChordChart.vue +93 -0
- package/dist/uni/ChordChart.vue.d.ts +136 -0
- package/dist/uni/DonutChart.vue +72 -0
- package/dist/uni/DonutChart.vue.d.ts +118 -0
- package/dist/uni/FunnelChart.vue +67 -0
- package/dist/uni/FunnelChart.vue.d.ts +108 -0
- package/dist/uni/GanttChart.vue +67 -0
- package/dist/uni/GanttChart.vue.d.ts +127 -0
- package/dist/uni/GaugeChart.vue +77 -0
- package/dist/uni/GaugeChart.vue.d.ts +127 -0
- package/dist/uni/HeatmapChart.vue +66 -0
- package/dist/uni/HeatmapChart.vue.d.ts +120 -0
- package/dist/uni/HistogramChart.vue +66 -0
- package/dist/uni/HistogramChart.vue.d.ts +125 -0
- package/dist/uni/HorizontalBarChart.vue +68 -0
- package/dist/uni/HorizontalBarChart.vue.d.ts +129 -0
- package/dist/uni/Input.vue.d.ts +1 -1
- package/dist/uni/LineChart.vue.d.ts +4 -0
- package/dist/uni/MixedChart.vue +68 -0
- package/dist/uni/MixedChart.vue.d.ts +110 -0
- package/dist/uni/NumberInput.vue.d.ts +1 -1
- package/dist/uni/PieChart.vue +72 -0
- package/dist/uni/PieChart.vue.d.ts +118 -0
- package/dist/uni/QuadrantChart.vue.d.ts +4 -0
- package/dist/uni/RadarChart.vue +67 -0
- package/dist/uni/RadarChart.vue.d.ts +114 -0
- package/dist/uni/RadialBarChart.vue +90 -0
- package/dist/uni/RadialBarChart.vue.d.ts +136 -0
- package/dist/uni/RangeAreaChart.vue +68 -0
- package/dist/uni/RangeAreaChart.vue.d.ts +106 -0
- package/dist/uni/ResponsiveGrid.vue.d.ts +1 -1
- package/dist/uni/SankeyChart.vue +88 -0
- package/dist/uni/SankeyChart.vue.d.ts +125 -0
- package/dist/uni/ScatterChart.vue.d.ts +4 -0
- package/dist/uni/ShapeChart.vue +73 -0
- package/dist/uni/ShapeChart.vue.d.ts +54 -0
- package/dist/uni/Sparkline.vue +58 -0
- package/dist/uni/Sparkline.vue.d.ts +81 -0
- package/dist/uni/SunburstChart.vue +90 -0
- package/dist/uni/SunburstChart.vue.d.ts +118 -0
- package/dist/uni/Textarea.vue.d.ts +1 -1
- package/dist/uni/TimePicker.vue.d.ts +1 -1
- package/dist/uni/ToastProvider.vue.d.ts +1 -1
- package/dist/uni/TreemapChart.vue +65 -0
- package/dist/uni/TreemapChart.vue.d.ts +104 -0
- package/dist/uni/WaterfallChart.vue +66 -0
- package/dist/uni/WaterfallChart.vue.d.ts +134 -0
- package/dist/uni/chart-canvas.d.ts +3 -0
- package/dist/uni/chart-canvas.js +4 -0
- package/dist/uni/chart-types.d.ts +240 -2
- package/dist/uni/chart-types.js +198 -0
- package/dist/uni/charts-canvas.js +8 -3
- package/dist/uni/index.d.ts +27 -1
- package/dist/uni/index.js +27 -1
- package/dist/uni/manifest.d.ts +279 -0
- package/dist/uni/manifest.js +397 -0
- package/dist/uni/named-chart-options.d.ts +95 -0
- package/dist/uni/named-chart-options.js +173 -0
- package/dist/uni/shape-chart-canvas.d.ts +53 -0
- package/dist/uni/shape-chart-canvas.js +333 -0
- package/dist/uni/shape-chart-types.d.ts +431 -0
- package/dist/uni/shape-chart-types.js +305 -0
- package/dist/vue/charts-global.d.ts +48 -0
- package/dist/vue/charts.d.ts +18 -0
- package/dist/vue/charts.js +56 -0
- package/dist/vue/charts.js.map +1 -0
- package/dist/vue/components/Chart/AreaChart.vue.d.ts +124 -0
- package/dist/vue/components/Chart/AreaChart.vue.js +7 -0
- package/dist/vue/components/Chart/AreaChart.vue.js.map +1 -0
- package/dist/vue/components/Chart/AreaChart.vue_vue_type_script_setup_true_lang.js +49 -0
- package/dist/vue/components/Chart/AreaChart.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/vue/components/Chart/Bar3DChart.vue.d.ts +132 -0
- package/dist/vue/components/Chart/Bar3DChart.vue.js +7 -0
- package/dist/vue/components/Chart/Bar3DChart.vue.js.map +1 -0
- package/dist/vue/components/Chart/Bar3DChart.vue_vue_type_script_setup_true_lang.js +55 -0
- package/dist/vue/components/Chart/Bar3DChart.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/vue/components/Chart/BarChart.vue.d.ts +123 -0
- package/dist/vue/components/Chart/BarChart.vue.js +7 -0
- package/dist/vue/components/Chart/BarChart.vue.js.map +1 -0
- package/dist/vue/components/Chart/BarChart.vue_vue_type_script_setup_true_lang.js +53 -0
- package/dist/vue/components/Chart/BarChart.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/vue/components/Chart/BoxPlotChart.vue.d.ts +120 -0
- package/dist/vue/components/Chart/BoxPlotChart.vue.js +7 -0
- package/dist/vue/components/Chart/BoxPlotChart.vue.js.map +1 -0
- package/dist/vue/components/Chart/BoxPlotChart.vue_vue_type_script_setup_true_lang.js +63 -0
- package/dist/vue/components/Chart/BoxPlotChart.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/vue/components/Chart/BubbleChart.vue.d.ts +106 -0
- package/dist/vue/components/Chart/BubbleChart.vue.js +7 -0
- package/dist/vue/components/Chart/BubbleChart.vue.js.map +1 -0
- package/dist/vue/components/Chart/BubbleChart.vue_vue_type_script_setup_true_lang.js +52 -0
- package/dist/vue/components/Chart/BubbleChart.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/vue/components/Chart/BulletChart.vue.d.ts +117 -0
- package/dist/vue/components/Chart/BulletChart.vue.js +7 -0
- package/dist/vue/components/Chart/BulletChart.vue.js.map +1 -0
- package/dist/vue/components/Chart/BulletChart.vue_vue_type_script_setup_true_lang.js +64 -0
- package/dist/vue/components/Chart/BulletChart.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/vue/components/Chart/CalendarHeatmap.vue.d.ts +144 -0
- package/dist/vue/components/Chart/CalendarHeatmap.vue.js +7 -0
- package/dist/vue/components/Chart/CalendarHeatmap.vue.js.map +1 -0
- package/dist/vue/components/Chart/CalendarHeatmap.vue_vue_type_script_setup_true_lang.js +77 -0
- package/dist/vue/components/Chart/CalendarHeatmap.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/vue/components/Chart/CandlestickChart.vue.d.ts +94 -0
- package/dist/vue/components/Chart/CandlestickChart.vue.js +7 -0
- package/dist/vue/components/Chart/CandlestickChart.vue.js.map +1 -0
- package/dist/vue/components/Chart/CandlestickChart.vue_vue_type_script_setup_true_lang.js +44 -0
- package/dist/vue/components/Chart/CandlestickChart.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/vue/components/Chart/Chart.vue.d.ts +103 -0
- package/dist/vue/components/Chart/Chart.vue.js +7 -0
- package/dist/vue/components/Chart/Chart.vue.js.map +1 -0
- package/dist/vue/components/Chart/Chart.vue_vue_type_script_setup_true_lang.js +47 -0
- package/dist/vue/components/Chart/Chart.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/vue/components/Chart/ChordChart.vue.d.ts +153 -0
- package/dist/vue/components/Chart/ChordChart.vue.js +7 -0
- package/dist/vue/components/Chart/ChordChart.vue.js.map +1 -0
- package/dist/vue/components/Chart/ChordChart.vue_vue_type_script_setup_true_lang.js +81 -0
- package/dist/vue/components/Chart/ChordChart.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/vue/components/Chart/DependencyGraph.vue.d.ts +179 -0
- package/dist/vue/components/Chart/DependencyGraph.vue.js +7 -0
- package/dist/vue/components/Chart/DependencyGraph.vue.js.map +1 -0
- package/dist/vue/components/Chart/DependencyGraph.vue_vue_type_script_setup_true_lang.js +65 -0
- package/dist/vue/components/Chart/DependencyGraph.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/vue/components/Chart/DepthChart.vue.d.ts +139 -0
- package/dist/vue/components/Chart/DepthChart.vue.js +7 -0
- package/dist/vue/components/Chart/DepthChart.vue.js.map +1 -0
- package/dist/vue/components/Chart/DepthChart.vue_vue_type_script_setup_true_lang.js +42 -0
- package/dist/vue/components/Chart/DepthChart.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/vue/components/Chart/DonutChart.vue.d.ts +104 -0
- package/dist/vue/components/Chart/DonutChart.vue.js +7 -0
- package/dist/vue/components/Chart/DonutChart.vue.js.map +1 -0
- package/dist/vue/components/Chart/DonutChart.vue_vue_type_script_setup_true_lang.js +53 -0
- package/dist/vue/components/Chart/DonutChart.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/vue/components/Chart/FunnelChart.vue.d.ts +105 -0
- package/dist/vue/components/Chart/FunnelChart.vue.js +7 -0
- package/dist/vue/components/Chart/FunnelChart.vue.js.map +1 -0
- package/dist/vue/components/Chart/FunnelChart.vue_vue_type_script_setup_true_lang.js +58 -0
- package/dist/vue/components/Chart/FunnelChart.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/vue/components/Chart/GanttChart.vue.d.ts +136 -0
- package/dist/vue/components/Chart/GanttChart.vue.js +7 -0
- package/dist/vue/components/Chart/GanttChart.vue.js.map +1 -0
- package/dist/vue/components/Chart/GanttChart.vue_vue_type_script_setup_true_lang.js +101 -0
- package/dist/vue/components/Chart/GanttChart.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/vue/components/Chart/GaugeChart.vue.d.ts +132 -0
- package/dist/vue/components/Chart/GaugeChart.vue.js +7 -0
- package/dist/vue/components/Chart/GaugeChart.vue.js.map +1 -0
- package/dist/vue/components/Chart/GaugeChart.vue_vue_type_script_setup_true_lang.js +71 -0
- package/dist/vue/components/Chart/GaugeChart.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/vue/components/Chart/GraphChart.vue.d.ts +184 -0
- package/dist/vue/components/Chart/GraphChart.vue.js +7 -0
- package/dist/vue/components/Chart/GraphChart.vue.js.map +1 -0
- package/dist/vue/components/Chart/GraphChart.vue_vue_type_script_setup_true_lang.js +62 -0
- package/dist/vue/components/Chart/GraphChart.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/vue/components/Chart/HeatmapChart.vue.d.ts +129 -0
- package/dist/vue/components/Chart/HeatmapChart.vue.js +7 -0
- package/dist/vue/components/Chart/HeatmapChart.vue.js.map +1 -0
- package/dist/vue/components/Chart/HeatmapChart.vue_vue_type_script_setup_true_lang.js +67 -0
- package/dist/vue/components/Chart/HeatmapChart.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/vue/components/Chart/HistogramChart.vue.d.ts +132 -0
- package/dist/vue/components/Chart/HistogramChart.vue.js +7 -0
- package/dist/vue/components/Chart/HistogramChart.vue.js.map +1 -0
- package/dist/vue/components/Chart/HistogramChart.vue_vue_type_script_setup_true_lang.js +66 -0
- package/dist/vue/components/Chart/HistogramChart.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/vue/components/Chart/HorizontalBarChart.vue.d.ts +121 -0
- package/dist/vue/components/Chart/HorizontalBarChart.vue.js +7 -0
- package/dist/vue/components/Chart/HorizontalBarChart.vue.js.map +1 -0
- package/dist/vue/components/Chart/HorizontalBarChart.vue_vue_type_script_setup_true_lang.js +55 -0
- package/dist/vue/components/Chart/HorizontalBarChart.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/vue/components/Chart/Line3DChart.vue.d.ts +121 -0
- package/dist/vue/components/Chart/Line3DChart.vue.js +7 -0
- package/dist/vue/components/Chart/Line3DChart.vue.js.map +1 -0
- package/dist/vue/components/Chart/Line3DChart.vue_vue_type_script_setup_true_lang.js +47 -0
- package/dist/vue/components/Chart/Line3DChart.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/vue/components/Chart/LineChart.vue.d.ts +125 -0
- package/dist/vue/components/Chart/LineChart.vue.js +7 -0
- package/dist/vue/components/Chart/LineChart.vue.js.map +1 -0
- package/dist/vue/components/Chart/LineChart.vue_vue_type_script_setup_true_lang.js +50 -0
- package/dist/vue/components/Chart/LineChart.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/vue/components/Chart/MixedChart.vue.d.ts +103 -0
- package/dist/vue/components/Chart/MixedChart.vue.js +7 -0
- package/dist/vue/components/Chart/MixedChart.vue.js.map +1 -0
- package/dist/vue/components/Chart/MixedChart.vue_vue_type_script_setup_true_lang.js +47 -0
- package/dist/vue/components/Chart/MixedChart.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/vue/components/Chart/OrderBook.vue.d.ts +125 -0
- package/dist/vue/components/Chart/OrderBook.vue.js +7 -0
- package/dist/vue/components/Chart/OrderBook.vue.js.map +1 -0
- package/dist/vue/components/Chart/OrderBook.vue_vue_type_script_setup_true_lang.js +38 -0
- package/dist/vue/components/Chart/OrderBook.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/vue/components/Chart/OrderBookHeatmap.vue.d.ts +130 -0
- package/dist/vue/components/Chart/OrderBookHeatmap.vue.js +7 -0
- package/dist/vue/components/Chart/OrderBookHeatmap.vue.js.map +1 -0
- package/dist/vue/components/Chart/OrderBookHeatmap.vue_vue_type_script_setup_true_lang.js +46 -0
- package/dist/vue/components/Chart/OrderBookHeatmap.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/vue/components/Chart/PieChart.vue.d.ts +104 -0
- package/dist/vue/components/Chart/PieChart.vue.js +7 -0
- package/dist/vue/components/Chart/PieChart.vue.js.map +1 -0
- package/dist/vue/components/Chart/PieChart.vue_vue_type_script_setup_true_lang.js +53 -0
- package/dist/vue/components/Chart/PieChart.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/vue/components/Chart/QuadrantChart.vue.d.ts +186 -0
- package/dist/vue/components/Chart/QuadrantChart.vue.js +7 -0
- package/dist/vue/components/Chart/QuadrantChart.vue.js.map +1 -0
- package/dist/vue/components/Chart/QuadrantChart.vue_vue_type_script_setup_true_lang.js +107 -0
- package/dist/vue/components/Chart/QuadrantChart.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/vue/components/Chart/RadarChart.vue.d.ts +111 -0
- package/dist/vue/components/Chart/RadarChart.vue.js +7 -0
- package/dist/vue/components/Chart/RadarChart.vue.js.map +1 -0
- package/dist/vue/components/Chart/RadarChart.vue_vue_type_script_setup_true_lang.js +61 -0
- package/dist/vue/components/Chart/RadarChart.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/vue/components/Chart/RadialBarChart.vue.d.ts +147 -0
- package/dist/vue/components/Chart/RadialBarChart.vue.js +7 -0
- package/dist/vue/components/Chart/RadialBarChart.vue.js.map +1 -0
- package/dist/vue/components/Chart/RadialBarChart.vue_vue_type_script_setup_true_lang.js +78 -0
- package/dist/vue/components/Chart/RadialBarChart.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/vue/components/Chart/RangeAreaChart.vue.d.ts +106 -0
- package/dist/vue/components/Chart/RangeAreaChart.vue.js +7 -0
- package/dist/vue/components/Chart/RangeAreaChart.vue.js.map +1 -0
- package/dist/vue/components/Chart/RangeAreaChart.vue_vue_type_script_setup_true_lang.js +51 -0
- package/dist/vue/components/Chart/RangeAreaChart.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/vue/components/Chart/SankeyChart.vue.d.ts +132 -0
- package/dist/vue/components/Chart/SankeyChart.vue.js +7 -0
- package/dist/vue/components/Chart/SankeyChart.vue.js.map +1 -0
- package/dist/vue/components/Chart/SankeyChart.vue_vue_type_script_setup_true_lang.js +71 -0
- package/dist/vue/components/Chart/SankeyChart.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/vue/components/Chart/Scatter3DChart.vue.d.ts +121 -0
- package/dist/vue/components/Chart/Scatter3DChart.vue.js +7 -0
- package/dist/vue/components/Chart/Scatter3DChart.vue.js.map +1 -0
- package/dist/vue/components/Chart/Scatter3DChart.vue_vue_type_script_setup_true_lang.js +47 -0
- package/dist/vue/components/Chart/Scatter3DChart.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/vue/components/Chart/ScatterChart.vue.d.ts +94 -0
- package/dist/vue/components/Chart/ScatterChart.vue.js +7 -0
- package/dist/vue/components/Chart/ScatterChart.vue.js.map +1 -0
- package/dist/vue/components/Chart/ScatterChart.vue_vue_type_script_setup_true_lang.js +44 -0
- package/dist/vue/components/Chart/ScatterChart.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/vue/components/Chart/ShapeChart.vue.d.ts +39 -0
- package/dist/vue/components/Chart/ShapeChart.vue.js +7 -0
- package/dist/vue/components/Chart/ShapeChart.vue.js.map +1 -0
- package/dist/vue/components/Chart/ShapeChart.vue_vue_type_script_setup_true_lang.js +43 -0
- package/dist/vue/components/Chart/ShapeChart.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/vue/components/Chart/Sparkline.vue.d.ts +90 -0
- package/dist/vue/components/Chart/Sparkline.vue.js +7 -0
- package/dist/vue/components/Chart/Sparkline.vue.js.map +1 -0
- package/dist/vue/components/Chart/Sparkline.vue_vue_type_script_setup_true_lang.js +66 -0
- package/dist/vue/components/Chart/Sparkline.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/vue/components/Chart/SunburstChart.vue.d.ts +123 -0
- package/dist/vue/components/Chart/SunburstChart.vue.js +7 -0
- package/dist/vue/components/Chart/SunburstChart.vue.js.map +1 -0
- package/dist/vue/components/Chart/SunburstChart.vue_vue_type_script_setup_true_lang.js +68 -0
- package/dist/vue/components/Chart/SunburstChart.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/vue/components/Chart/Surface3DChart.vue.d.ts +143 -0
- package/dist/vue/components/Chart/Surface3DChart.vue.js +7 -0
- package/dist/vue/components/Chart/Surface3DChart.vue.js.map +1 -0
- package/dist/vue/components/Chart/Surface3DChart.vue_vue_type_script_setup_true_lang.js +60 -0
- package/dist/vue/components/Chart/Surface3DChart.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/vue/components/Chart/TimeAndSales.vue.d.ts +116 -0
- package/dist/vue/components/Chart/TimeAndSales.vue.js +7 -0
- package/dist/vue/components/Chart/TimeAndSales.vue.js.map +1 -0
- package/dist/vue/components/Chart/TimeAndSales.vue_vue_type_script_setup_true_lang.js +46 -0
- package/dist/vue/components/Chart/TimeAndSales.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/vue/components/Chart/TradingChart.vue.d.ts +208 -0
- package/dist/vue/components/Chart/TradingChart.vue.js +7 -0
- package/dist/vue/components/Chart/TradingChart.vue.js.map +1 -0
- package/dist/vue/components/Chart/TradingChart.vue_vue_type_script_setup_true_lang.js +101 -0
- package/dist/vue/components/Chart/TradingChart.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/vue/components/Chart/TreeChart.vue.d.ts +172 -0
- package/dist/vue/components/Chart/TreeChart.vue.js +7 -0
- package/dist/vue/components/Chart/TreeChart.vue.js.map +1 -0
- package/dist/vue/components/Chart/TreeChart.vue_vue_type_script_setup_true_lang.js +56 -0
- package/dist/vue/components/Chart/TreeChart.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/vue/components/Chart/TreemapChart.vue.d.ts +97 -0
- package/dist/vue/components/Chart/TreemapChart.vue.js +7 -0
- package/dist/vue/components/Chart/TreemapChart.vue.js.map +1 -0
- package/dist/vue/components/Chart/TreemapChart.vue_vue_type_script_setup_true_lang.js +54 -0
- package/dist/vue/components/Chart/TreemapChart.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/vue/components/Chart/WaterfallChart.vue.d.ts +143 -0
- package/dist/vue/components/Chart/WaterfallChart.vue.js +7 -0
- package/dist/vue/components/Chart/WaterfallChart.vue.js.map +1 -0
- package/dist/vue/components/Chart/WaterfallChart.vue_vue_type_script_setup_true_lang.js +74 -0
- package/dist/vue/components/Chart/WaterfallChart.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/vue/components/Chart/cartesian.d.ts +47 -0
- package/dist/vue/components/Chart/cartesian.js +56 -0
- package/dist/vue/components/Chart/cartesian.js.map +1 -0
- package/dist/vue/components/Chart/engine.d.ts +35 -0
- package/dist/vue/components/Chart/engine.js +35 -0
- package/dist/vue/components/Chart/engine.js.map +1 -0
- package/dist/vue/components/Chart/graph.d.ts +153 -0
- package/dist/vue/components/Chart/graph.js +135 -0
- package/dist/vue/components/Chart/graph.js.map +1 -0
- package/dist/vue/components/Chart/index.d.ts +45 -0
- package/dist/vue/components/Chart/index.js +44 -0
- package/dist/vue/components/Chart/orderbook.d.ts +363 -0
- package/dist/vue/components/Chart/orderbook.js +128 -0
- package/dist/vue/components/Chart/orderbook.js.map +1 -0
- package/dist/vue/components/Chart/props.d.ts +188 -0
- package/dist/vue/components/Chart/props.js +92 -0
- package/dist/vue/components/Chart/props.js.map +1 -0
- package/dist/vue/components/Chart/shape.d.ts +41 -0
- package/dist/vue/components/Chart/shape.js +42 -0
- package/dist/vue/components/Chart/shape.js.map +1 -0
- package/dist/vue/components/Chart/three-d.d.ts +106 -0
- package/dist/vue/components/Chart/three-d.js +88 -0
- package/dist/vue/components/Chart/three-d.js.map +1 -0
- package/dist/vue/components/Chart/trading.d.ts +127 -0
- package/dist/vue/components/Chart/trading.js +63 -0
- package/dist/vue/components/Chart/trading.js.map +1 -0
- package/dist/vue/components/Chart/types.d.ts +209 -0
- package/dist/vue/global.d.ts +2 -0
- package/dist/vue/groups/charts.d.ts +1 -0
- package/dist/vue/groups/charts.js +95 -0
- package/dist/vue/groups/charts.js.map +1 -0
- package/dist/vue/index.d.ts +1 -0
- package/dist/vue/index.js +67 -23
- package/dist/vue/internal/register.d.ts +7 -0
- package/dist/vue/internal/register.js +14 -0
- package/dist/vue/internal/register.js.map +1 -0
- package/dist/vue/plugin.d.ts +9 -4
- package/dist/vue/plugin.js +7 -10
- package/dist/vue/plugin.js.map +1 -1
- package/dist/weapp/area-chart/index.js +1 -0
- package/dist/weapp/area-chart/index.json +1 -0
- package/dist/weapp/area-chart/index.wxml +1 -0
- package/dist/weapp/area-chart/index.wxss +1 -0
- package/dist/weapp/box-plot-chart/index.js +1 -0
- package/dist/weapp/box-plot-chart/index.json +1 -0
- package/dist/weapp/box-plot-chart/index.wxml +1 -0
- package/dist/weapp/box-plot-chart/index.wxss +1 -0
- package/dist/weapp/bubble-chart/index.js +1 -0
- package/dist/weapp/bubble-chart/index.json +1 -0
- package/dist/weapp/bubble-chart/index.wxml +1 -0
- package/dist/weapp/bubble-chart/index.wxss +1 -0
- package/dist/weapp/bullet-chart/index.js +1 -0
- package/dist/weapp/bullet-chart/index.json +1 -0
- package/dist/weapp/bullet-chart/index.wxml +1 -0
- package/dist/weapp/bullet-chart/index.wxss +1 -0
- package/dist/weapp/calendar-heatmap/index.js +1 -0
- package/dist/weapp/calendar-heatmap/index.json +1 -0
- package/dist/weapp/calendar-heatmap/index.wxml +1 -0
- package/dist/weapp/calendar-heatmap/index.wxss +1 -0
- package/dist/weapp/candlestick-chart/index.js +1 -0
- package/dist/weapp/candlestick-chart/index.json +1 -0
- package/dist/weapp/candlestick-chart/index.wxml +1 -0
- package/dist/weapp/candlestick-chart/index.wxss +1 -0
- package/dist/weapp/charts/canvas.js +12976 -0
- package/dist/weapp/charts/core.d.ts +2 -0
- package/dist/weapp/charts/core.js +42 -0
- package/dist/weapp/chord-chart/index.js +1 -0
- package/dist/weapp/chord-chart/index.json +1 -0
- package/dist/weapp/chord-chart/index.wxml +1 -0
- package/dist/weapp/chord-chart/index.wxss +1 -0
- package/dist/weapp/controls.js +1495 -4480
- package/dist/weapp/donut-chart/index.js +1 -0
- package/dist/weapp/donut-chart/index.json +1 -0
- package/dist/weapp/donut-chart/index.wxml +1 -0
- package/dist/weapp/donut-chart/index.wxss +1 -0
- package/dist/weapp/funnel-chart/index.js +1 -0
- package/dist/weapp/funnel-chart/index.json +1 -0
- package/dist/weapp/funnel-chart/index.wxml +1 -0
- package/dist/weapp/funnel-chart/index.wxss +1 -0
- package/dist/weapp/gantt-chart/index.js +1 -0
- package/dist/weapp/gantt-chart/index.json +1 -0
- package/dist/weapp/gantt-chart/index.wxml +1 -0
- package/dist/weapp/gantt-chart/index.wxss +1 -0
- package/dist/weapp/gauge-chart/index.js +1 -0
- package/dist/weapp/gauge-chart/index.json +1 -0
- package/dist/weapp/gauge-chart/index.wxml +1 -0
- package/dist/weapp/gauge-chart/index.wxss +1 -0
- package/dist/weapp/heatmap-chart/index.js +1 -0
- package/dist/weapp/heatmap-chart/index.json +1 -0
- package/dist/weapp/heatmap-chart/index.wxml +1 -0
- package/dist/weapp/heatmap-chart/index.wxss +1 -0
- package/dist/weapp/histogram-chart/index.js +1 -0
- package/dist/weapp/histogram-chart/index.json +1 -0
- package/dist/weapp/histogram-chart/index.wxml +1 -0
- package/dist/weapp/histogram-chart/index.wxss +1 -0
- package/dist/weapp/horizontal-bar-chart/index.js +1 -0
- package/dist/weapp/horizontal-bar-chart/index.json +1 -0
- package/dist/weapp/horizontal-bar-chart/index.wxml +1 -0
- package/dist/weapp/horizontal-bar-chart/index.wxss +1 -0
- package/dist/weapp/mixed-chart/index.js +1 -0
- package/dist/weapp/mixed-chart/index.json +1 -0
- package/dist/weapp/mixed-chart/index.wxml +1 -0
- package/dist/weapp/mixed-chart/index.wxss +1 -0
- package/dist/weapp/pie-chart/index.js +1 -0
- package/dist/weapp/pie-chart/index.json +1 -0
- package/dist/weapp/pie-chart/index.wxml +1 -0
- package/dist/weapp/pie-chart/index.wxss +1 -0
- package/dist/weapp/radar-chart/index.js +1 -0
- package/dist/weapp/radar-chart/index.json +1 -0
- package/dist/weapp/radar-chart/index.wxml +1 -0
- package/dist/weapp/radar-chart/index.wxss +1 -0
- package/dist/weapp/radial-bar-chart/index.js +1 -0
- package/dist/weapp/radial-bar-chart/index.json +1 -0
- package/dist/weapp/radial-bar-chart/index.wxml +1 -0
- package/dist/weapp/radial-bar-chart/index.wxss +1 -0
- package/dist/weapp/range-area-chart/index.js +1 -0
- package/dist/weapp/range-area-chart/index.json +1 -0
- package/dist/weapp/range-area-chart/index.wxml +1 -0
- package/dist/weapp/range-area-chart/index.wxss +1 -0
- package/dist/weapp/sankey-chart/index.js +1 -0
- package/dist/weapp/sankey-chart/index.json +1 -0
- package/dist/weapp/sankey-chart/index.wxml +1 -0
- package/dist/weapp/sankey-chart/index.wxss +1 -0
- package/dist/weapp/shape-chart/index.js +1 -0
- package/dist/weapp/shape-chart/index.json +1 -0
- package/dist/weapp/shape-chart/index.wxml +1 -0
- package/dist/weapp/shape-chart/index.wxss +1 -0
- package/dist/weapp/sparkline/index.js +1 -0
- package/dist/weapp/sparkline/index.json +1 -0
- package/dist/weapp/sparkline/index.wxml +1 -0
- package/dist/weapp/sparkline/index.wxss +1 -0
- package/dist/weapp/sunburst-chart/index.js +1 -0
- package/dist/weapp/sunburst-chart/index.json +1 -0
- package/dist/weapp/sunburst-chart/index.wxml +1 -0
- package/dist/weapp/sunburst-chart/index.wxss +1 -0
- package/dist/weapp/treemap-chart/index.js +1 -0
- package/dist/weapp/treemap-chart/index.json +1 -0
- package/dist/weapp/treemap-chart/index.wxml +1 -0
- package/dist/weapp/treemap-chart/index.wxss +1 -0
- package/dist/weapp/types.d.ts +549 -0
- package/dist/weapp/waterfall-chart/index.js +1 -0
- package/dist/weapp/waterfall-chart/index.json +1 -0
- package/dist/weapp/waterfall-chart/index.wxml +1 -0
- package/dist/weapp/waterfall-chart/index.wxss +1 -0
- package/dist/web-components/components/chart/chart.d.ts +58 -0
- package/dist/web-components/components/chart/chart.js +55 -0
- package/dist/web-components/components/chart/chart.js.map +1 -0
- package/dist/web-components/components/chart/charts.d.ts +254 -0
- package/dist/web-components/components/chart/charts.js +208 -0
- package/dist/web-components/components/chart/charts.js.map +1 -0
- package/dist/web-components/components/chart/engine-element.d.ts +53 -0
- package/dist/web-components/components/chart/engine-element.js +77 -0
- package/dist/web-components/components/chart/engine-element.js.map +1 -0
- package/dist/web-components/components/chart/extended.d.ts +234 -0
- package/dist/web-components/components/chart/extended.js +197 -0
- package/dist/web-components/components/chart/extended.js.map +1 -0
- package/dist/web-components/components/chart/series.d.ts +7 -0
- package/dist/web-components/components/chart/series.js +14 -0
- package/dist/web-components/components/chart/series.js.map +1 -0
- package/dist/web-components/components/chart/shape-chart.d.ts +199 -0
- package/dist/web-components/components/chart/shape-chart.js +161 -0
- package/dist/web-components/components/chart/shape-chart.js.map +1 -0
- package/dist/web-components/components/chart/shapes-extended.d.ts +198 -0
- package/dist/web-components/components/chart/shapes-extended.js +182 -0
- package/dist/web-components/components/chart/shapes-extended.js.map +1 -0
- package/dist/web-components/components/chart-3d/chart-3d.d.ts +111 -0
- package/dist/web-components/components/chart-3d/chart-3d.js +97 -0
- package/dist/web-components/components/chart-3d/chart-3d.js.map +1 -0
- package/dist/web-components/components/graph/graph.d.ts +154 -0
- package/dist/web-components/components/graph/graph.js +149 -0
- package/dist/web-components/components/graph/graph.js.map +1 -0
- package/dist/web-components/components/order-book/order-book.d.ts +165 -0
- package/dist/web-components/components/order-book/order-book.js +174 -0
- package/dist/web-components/components/order-book/order-book.js.map +1 -0
- package/dist/web-components/components/trading-chart/trading-chart.d.ts +143 -0
- package/dist/web-components/components/trading-chart/trading-chart.js +158 -0
- package/dist/web-components/components/trading-chart/trading-chart.js.map +1 -0
- package/dist/web-components/elements/chart-3d.d.ts +2 -0
- package/dist/web-components/elements/chart-3d.js +13 -0
- package/dist/web-components/elements/chart-3d.js.map +1 -0
- package/dist/web-components/elements/chart.d.ts +7 -0
- package/dist/web-components/elements/chart.js +44 -0
- package/dist/web-components/elements/chart.js.map +1 -0
- package/dist/web-components/elements/graph.d.ts +2 -0
- package/dist/web-components/elements/graph.js +12 -0
- package/dist/web-components/elements/graph.js.map +1 -0
- package/dist/web-components/elements/order-book.d.ts +2 -0
- package/dist/web-components/elements/order-book.js +13 -0
- package/dist/web-components/elements/order-book.js.map +1 -0
- package/dist/web-components/elements/trading-chart.d.ts +2 -0
- package/dist/web-components/elements/trading-chart.js +8 -0
- package/dist/web-components/elements/trading-chart.js.map +1 -0
- package/dist/web-components/html-custom-data.json +1470 -38
- package/dist/web-components/types/react.d.ts +494 -0
- package/dist/web-components/types/solid.d.ts +368 -0
- package/dist/web-components/types/svelte.d.ts +368 -0
- package/dist/web-components/types/vue.d.ts +410 -0
- package/package.json +128 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chart.cjs","names":["createChartDom","createShapeRuntime","readTheme","estimateText","tooltipContent","swatch","hoverEvent","hoverAnchor","placeShapeTooltip","sameHover","now","describeScene","shapeLegend","legendConfig","describeChart","hitTestShapes","describeItem","stepHover","watchTheme","require_dom","require_theme","require_scene","require_draw","require_hit","require_layout","require_runtime","TAP_SLOP","uid","createShapeChart","doc","container","win","dom","canvas","ctx","runtime","initial","options","theme","scene","hover","tipKey","destroyed","frameId","frameIsTimeout","press","listeners","emit","listener","type","event","description","fontSet","measure","f","text","cancelFrame","schedule","render","tooltipOptions","tooltipNode","custom","content","fragment","header","row","el","n","v","updateTooltip","tip","key","force","anchor","stageW","stageH","left","top","setHover","changed","next","keyboard","width","height","dpr","pw","ph","frame","it","renderLegend","entries","config","focused","bottom","entry","item","toggle","updateAccessibility","index","local","rect","hitAt","x","y","onPointerMove","onPointerDown","onPointerUp","p","hit","onPointerCancel","onPointerLeave","focusItem","onKeyDown","current","direction","items","e","onFocus","visible","onBlur","stage","resizeObserver","refreshTheme","unwatchTheme","previous"],"sources":["../../../../../charts/src/engine/shapes/chart.ts"],"sourcesContent":["// createShapeChart: DOM host of the shape charts. One Canvas2D layer sized\n// with the device pixel ratio, the house legend / tooltip / live region of\n// createChartDom, pointer + keyboard interaction, resize and theme watching.\n\nimport { createChartDom, styleElement, swatch } from \"../dom\";\nimport { readTheme, watchTheme, type ChartTheme } from \"../theme\";\nimport { drawShapeScene } from \"./draw\";\nimport { hitTestShapes, hoverAnchor, stepHover } from \"./hit\";\nimport {\n describeChart,\n describeItem,\n describeScene,\n hoverEvent,\n legendConfig,\n placeShapeTooltip,\n sameHover,\n shapeLegend,\n tooltipContent,\n} from \"./layout\";\nimport { createShapeRuntime, now } from \"./runtime\";\nimport {\n estimateText,\n type MeasureText,\n type ShapeHover,\n type ShapeScene,\n} from \"./scene\";\nimport type {\n ShapeChartEventMap,\n ShapeChartInstance,\n ShapeChartOptions,\n ShapeHoverEvent,\n} from \"./types\";\n\n/** Pointer travel (px) under which a press counts as a click / tap */\nconst TAP_SLOP = 6;\n\nlet uid = 0;\n\ninterface HoverState {\n hover: ShapeHover;\n x: number;\n y: number;\n keyboard: boolean;\n}\n\n/**\n * Creates a pie / donut, radar, gauge, funnel or treemap chart in\n * `container` (drawn with Canvas2D, themed by the Minerva CSS variables).\n */\nexport const createShapeChart = (\n container: HTMLElement,\n initial: ShapeChartOptions,\n): ShapeChartInstance => {\n const doc = container.ownerDocument;\n const win = doc.defaultView;\n const dom = createChartDom(container);\n dom.root.classList.add(\"minerva-shape-chart\");\n dom.foreground.style.display = \"none\";\n dom.hover.style.display = \"none\";\n const canvas = dom.background;\n let ctx: CanvasRenderingContext2D | null = null;\n try {\n ctx = canvas.getContext(\"2d\");\n } catch {\n ctx = null;\n }\n\n const runtime = createShapeRuntime(initial);\n let options = initial;\n let theme: ChartTheme = readTheme(dom.root, options.palette);\n let scene: ShapeScene | null = null;\n let hover: HoverState | null = null;\n let tipKey = \"\";\n let destroyed = false;\n let frameId: number | null = null;\n let frameIsTimeout = false;\n let press: {\n x: number;\n y: number;\n id: number;\n touch: boolean;\n moved: boolean;\n } | null = null;\n\n const listeners: {\n [K in keyof ShapeChartEventMap]: Set<\n (event: ShapeChartEventMap[K]) => void\n >;\n } = { hover: new Set(), click: new Set(), toggle: new Set() };\n const emit = <K extends keyof ShapeChartEventMap>(\n type: K,\n event: ShapeChartEventMap[K],\n ) => {\n for (const listener of [...listeners[type]]) listener(event);\n };\n\n // screen-reader summary of the data\n const description = doc.createElement(\"div\");\n description.id = `minerva-shape-chart-${++uid}`;\n styleElement(description, {\n position: \"absolute\",\n width: \"1px\",\n height: \"1px\",\n overflow: \"hidden\",\n clip: \"rect(0 0 0 0)\",\n clipPath: \"inset(50%)\",\n whiteSpace: \"nowrap\",\n });\n dom.stage.appendChild(description);\n dom.stage.setAttribute(\"aria-describedby\", description.id);\n dom.stage.tabIndex = 0;\n\n let fontSet = \"\";\n const measure: MeasureText = (text, f) => {\n if (!ctx) return estimateText(text, f);\n if (f !== fontSet) {\n ctx.font = f;\n fontSet = f;\n }\n return ctx.measureText(text).width;\n };\n\n // ------------------------------------------------------------- frames\n\n const cancelFrame = () => {\n if (frameId === null) return;\n if (frameIsTimeout) clearTimeout(frameId);\n else win?.cancelAnimationFrame?.(frameId);\n frameId = null;\n };\n\n const schedule = () => {\n if (destroyed || frameId !== null) return;\n if (win && typeof win.requestAnimationFrame === \"function\") {\n frameIsTimeout = false;\n frameId = win.requestAnimationFrame(() => render());\n } else {\n frameIsTimeout = true;\n frameId = setTimeout(() => render(), 16) as unknown as number;\n }\n };\n\n const tooltipOptions = () =>\n options.tooltip === false\n ? null\n : typeof options.tooltip === \"object\"\n ? options.tooltip\n : {};\n\n const tooltipNode = (event: ShapeHoverEvent): Node | string | null => {\n const custom = tooltipOptions()?.render;\n if (custom) return custom(event);\n if (!scene || !hover) return null;\n const content = tooltipContent(scene, hover.hover);\n if (!content) return null;\n const fragment = doc.createDocumentFragment();\n const header = doc.createElement(\"div\");\n styleElement(header, {\n display: \"flex\",\n alignItems: \"center\",\n gap: \"6px\",\n fontWeight: \"600\",\n marginBottom: \"4px\",\n color: \"var(--text-color, #1f2937)\",\n });\n if (content.color) header.appendChild(swatch(doc, content.color, \"dot\"));\n header.appendChild(doc.createTextNode(content.title));\n fragment.append(header);\n for (const row of content.rows) {\n const el = doc.createElement(\"div\");\n styleElement(el, { display: \"flex\", alignItems: \"center\", gap: \"8px\" });\n if (row.color) el.appendChild(swatch(doc, row.color, \"dot\"));\n const n = doc.createElement(\"span\");\n styleElement(n, {\n flex: \"1 1 auto\",\n color: row.strong\n ? \"var(--text-color, #1f2937)\"\n : \"var(--text-secondary-color, #6b7280)\",\n fontWeight: row.strong ? \"600\" : \"400\",\n });\n n.textContent = row.name;\n const v = doc.createElement(\"span\");\n styleElement(v, {\n fontWeight: \"600\",\n fontVariantNumeric: \"tabular-nums\",\n marginLeft: \"12px\",\n });\n v.textContent = row.value;\n el.append(n, v);\n fragment.append(el);\n }\n return fragment;\n };\n\n /** Fills (when the hovered item changed) and places the tooltip */\n const updateTooltip = (force = false) => {\n const tip = dom.tooltip;\n const event = scene && hover ? hoverEvent(scene, hover.hover) : null;\n if (!event || !scene || !hover || !tooltipOptions() || press?.moved) {\n tip.style.display = \"none\";\n tipKey = \"\";\n return;\n }\n const key = `${event.index}:${event.indicator ?? \"\"}`;\n if (force || key !== tipKey) {\n tipKey = key;\n const content = tooltipNode(event);\n if (content === null || content === \"\") {\n tip.replaceChildren();\n tipKey = \"\";\n tip.style.display = \"none\";\n return;\n }\n if (typeof content === \"string\") {\n tip.textContent = content;\n tip.style.whiteSpace = \"pre\";\n } else {\n tip.replaceChildren(content);\n tip.style.whiteSpace = \"nowrap\";\n }\n } else if (!tip.firstChild) {\n return;\n }\n tip.style.display = \"block\";\n const anchor = hover.keyboard\n ? (hoverAnchor(scene, hover.hover) ?? hover)\n : hover;\n const stageW = dom.stage.clientWidth;\n const stageH = dom.stage.clientHeight;\n const { x: left, y: top } = placeShapeTooltip(\n scene,\n hover.hover,\n anchor,\n tip.offsetWidth,\n tip.offsetHeight,\n stageW,\n stageH,\n );\n tip.style.transform = `translate(${Math.round(left)}px, ${Math.round(top)}px)`;\n };\n\n const setHover = (\n next: ShapeHover | null,\n x: number,\n y: number,\n keyboard: boolean,\n ) => {\n const changed = !sameHover(hover?.hover ?? null, next);\n hover = next ? { hover: next, x, y, keyboard } : null;\n dom.stage.style.cursor = next && !keyboard ? \"pointer\" : \"\";\n updateTooltip();\n if (!changed) return;\n schedule();\n emit(\"hover\", scene && next ? hoverEvent(scene, next) : null);\n };\n\n function render() {\n frameId = null;\n if (destroyed) return;\n const width = dom.stage.clientWidth;\n const height = dom.stage.clientHeight;\n if (!(width > 0 && height > 0)) return;\n const dpr = win?.devicePixelRatio || 1;\n const pw = Math.max(1, Math.round(width * dpr));\n const ph = Math.max(1, Math.round(height * dpr));\n if (canvas.width !== pw) canvas.width = pw;\n if (canvas.height !== ph) canvas.height = ph;\n canvas.style.width = `${width}px`;\n canvas.style.height = `${height}px`;\n fontSet = \"\";\n const frame = runtime.frame(now(), { theme, width, height, measure });\n scene = frame.scene;\n if (hover && !scene.items.some((it) => it.index === hover?.hover.index)) {\n hover = null;\n dom.stage.style.cursor = \"\";\n emit(\"hover\", null);\n }\n if (ctx) {\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.clearRect(0, 0, pw, ph);\n ctx.setTransform(dpr, 0, 0, dpr, 0, 0);\n drawShapeScene(ctx, scene, hover?.hover ?? null);\n fontSet = \"\";\n }\n updateTooltip();\n if (!frame.animating) {\n const text = describeScene(scene);\n if (description.textContent !== text) description.textContent = text;\n } else schedule();\n }\n\n // ------------------------------------------------------------- legend\n\n const renderLegend = () => {\n const entries = shapeLegend(options, theme, runtime.hidden);\n const config = legendConfig(options);\n const focused = [...dom.legend.children].indexOf(\n doc.activeElement as Element,\n );\n dom.legend.replaceChildren();\n dom.legend.style.display = entries ? \"flex\" : \"none\";\n if (!entries) return;\n const bottom = config.position === \"bottom\";\n dom.legend.style.order = bottom ? \"1\" : \"0\";\n dom.legend.style.padding = bottom ? \"8px 4px 0\" : \"0 4px 8px\";\n dom.legend.style.justifyContent = \"center\";\n for (const entry of entries) {\n const item = doc.createElement(config.toggle ? \"button\" : \"span\");\n if (item instanceof HTMLButtonElement) {\n item.type = \"button\";\n item.setAttribute(\"aria-pressed\", String(!entry.hidden));\n item.addEventListener(\"click\", () => toggle(entry.index));\n }\n styleElement(item, {\n display: \"inline-flex\",\n alignItems: \"center\",\n gap: \"6px\",\n padding: \"2px 4px\",\n margin: \"0\",\n border: \"0\",\n borderRadius: \"4px\",\n background: \"none\",\n font: \"inherit\",\n color: \"var(--text-secondary-color, #6b7280)\",\n cursor: config.toggle ? \"pointer\" : \"default\",\n opacity: entry.hidden ? \"0.45\" : \"1\",\n textDecoration: entry.hidden ? \"line-through\" : \"none\",\n transition: \"opacity 120ms ease-out\",\n });\n item.append(\n swatch(doc, entry.color, \"dot\"),\n doc.createTextNode(entry.name),\n );\n dom.legend.appendChild(item);\n }\n if (focused >= 0)\n (dom.legend.children[focused] as HTMLElement | undefined)?.focus();\n };\n\n const updateAccessibility = () => {\n dom.stage.setAttribute(\n \"aria-label\",\n options.ariaLabel ?? describeChart(options),\n );\n };\n\n function toggle(index: number) {\n if (destroyed) return;\n const event = runtime.toggle(index);\n if (!event) return;\n if (!options.hidden) {\n renderLegend();\n tipKey = \"\";\n schedule();\n }\n emit(\"toggle\", event);\n }\n\n // -------------------------------------------------------- interaction\n\n const local = (event: { clientX: number; clientY: number }) => {\n const rect = dom.stage.getBoundingClientRect();\n return { x: event.clientX - rect.left, y: event.clientY - rect.top };\n };\n\n const hitAt = (x: number, y: number) =>\n scene ? hitTestShapes(scene, x, y, hover?.hover ?? null) : null;\n\n const onPointerMove = (event: PointerEvent) => {\n const { x, y } = local(event);\n if (press && press.id === event.pointerId) {\n if (Math.hypot(x - press.x, y - press.y) > TAP_SLOP) press.moved = true;\n if (press.touch) return;\n } else if (event.pointerType === \"touch\") return;\n setHover(hitAt(x, y), x, y, false);\n };\n\n const onPointerDown = (event: PointerEvent) => {\n const { x, y } = local(event);\n press = {\n x,\n y,\n id: event.pointerId,\n touch: event.pointerType === \"touch\",\n moved: false,\n };\n };\n\n const onPointerUp = (event: PointerEvent) => {\n const p = press;\n press = null;\n if (!p || p.id !== event.pointerId || p.moved) {\n updateTooltip();\n return;\n }\n const { x, y } = local(event);\n const hit = hitAt(x, y);\n // a tap shows the tooltip (there is no hover on touch screens)\n setHover(hit, x, y, false);\n if (hit && scene) {\n const e = hoverEvent(scene, hit);\n if (e) emit(\"click\", e);\n }\n };\n\n const onPointerCancel = () => {\n press = null;\n updateTooltip();\n };\n\n const onPointerLeave = (event: PointerEvent) => {\n if (event.pointerType === \"touch\") return;\n press = null;\n if (hover && !hover.keyboard) setHover(null, 0, 0, false);\n };\n\n const focusItem = (next: ShapeHover | null) => {\n if (!scene || !next) return;\n const anchor = hoverAnchor(scene, next) ?? { x: 0, y: 0 };\n setHover(next, anchor.x, anchor.y, true);\n dom.live.textContent = describeItem(scene, next);\n };\n\n const onKeyDown = (event: KeyboardEvent) => {\n if (!scene) return;\n const current = hover?.hover ?? null;\n const keys: Record<string, \"next\" | \"prev\" | \"up\" | \"down\"> = {\n ArrowRight: \"next\",\n ArrowLeft: \"prev\",\n ArrowUp: \"up\",\n ArrowDown: \"down\",\n };\n const direction = keys[event.key];\n if (direction) {\n event.preventDefault();\n focusItem(stepHover(scene, current, direction));\n return;\n }\n switch (event.key) {\n case \"Home\":\n case \"End\": {\n const items = scene.items;\n if (!items.length) return;\n event.preventDefault();\n const it = event.key === \"Home\" ? items[0] : items[items.length - 1];\n focusItem(\n scene.type === \"radar\"\n ? { index: it.index, indicator: current?.indicator ?? 0 }\n : { index: it.index },\n );\n break;\n }\n case \"Enter\":\n case \" \": {\n if (!current) return;\n const e = hoverEvent(scene, current);\n if (!e) return;\n event.preventDefault();\n emit(\"click\", e);\n break;\n }\n case \"Escape\":\n if (hover) {\n event.preventDefault();\n setHover(null, 0, 0, false);\n }\n break;\n default:\n break;\n }\n };\n\n const onFocus = () => {\n let visible: boolean;\n try {\n visible = dom.stage.matches(\":focus-visible\");\n } catch {\n visible = true;\n }\n // inset, like an outline drawn inside the stage edge: the drawing keeps a\n // padding, so the ring never covers labels or leader lines\n if (visible)\n dom.stage.style.boxShadow =\n \"inset 0 0 0 2px var(--primary-color, #4f46e5)\";\n };\n\n const onBlur = () => {\n dom.stage.style.boxShadow = \"\";\n if (hover?.keyboard) setHover(null, 0, 0, false);\n };\n\n const stage = dom.stage;\n stage.addEventListener(\"pointermove\", onPointerMove);\n stage.addEventListener(\"pointerdown\", onPointerDown);\n stage.addEventListener(\"pointerup\", onPointerUp);\n stage.addEventListener(\"pointercancel\", onPointerCancel);\n stage.addEventListener(\"pointerleave\", onPointerLeave);\n stage.addEventListener(\"keydown\", onKeyDown);\n stage.addEventListener(\"focus\", onFocus);\n stage.addEventListener(\"blur\", onBlur);\n\n const resizeObserver =\n typeof ResizeObserver === \"function\"\n ? new ResizeObserver(() => schedule())\n : null;\n resizeObserver?.observe(dom.stage);\n\n const refreshTheme = () => {\n if (destroyed) return;\n theme = readTheme(dom.root, options.palette);\n renderLegend();\n tipKey = \"\";\n schedule();\n };\n const unwatchTheme = watchTheme(refreshTheme);\n\n renderLegend();\n updateAccessibility();\n render();\n\n return {\n setOptions(next) {\n if (destroyed) return;\n const previous = options;\n options = next;\n runtime.setOptions(next);\n if ((next.palette ?? []).join() !== (previous.palette ?? []).join())\n theme = readTheme(dom.root, next.palette);\n if (next.type !== previous.type && hover) setHover(null, 0, 0, false);\n renderLegend();\n updateAccessibility();\n tipKey = \"\";\n schedule();\n },\n resize() {\n if (destroyed) return;\n cancelFrame();\n render();\n },\n refreshTheme,\n toggle,\n getHidden: () => runtime.hiddenIndexes(),\n on(type, listener) {\n listeners[type].add(listener);\n return () => {\n listeners[type].delete(listener);\n };\n },\n destroy() {\n if (destroyed) return;\n destroyed = true;\n cancelFrame();\n stage.removeEventListener(\"pointermove\", onPointerMove);\n stage.removeEventListener(\"pointerdown\", onPointerDown);\n stage.removeEventListener(\"pointerup\", onPointerUp);\n stage.removeEventListener(\"pointercancel\", onPointerCancel);\n stage.removeEventListener(\"pointerleave\", onPointerLeave);\n stage.removeEventListener(\"keydown\", onKeyDown);\n stage.removeEventListener(\"focus\", onFocus);\n stage.removeEventListener(\"blur\", onBlur);\n resizeObserver?.disconnect();\n unwatchTheme();\n listeners.hover.clear();\n listeners.click.clear();\n listeners.toggle.clear();\n dom.root.remove();\n },\n };\n};\n"],"mappings":"qLAkCA,IAAM0B,EAAW,EAEbC,EAAM,EAaGC,GACX,EACA,IACuB,CACvB,IAAMC,EAAMC,EAAU,cAChBC,EAAMF,EAAI,YACVG,EAAMhC,EAAAA,eAAe8B,CAAS,EACpCE,EAAI,KAAK,UAAU,IAAI,qBAAqB,EAC5C,EAAI,WAAW,MAAM,QAAU,OAC/B,EAAI,MAAM,MAAM,QAAU,OAC1B,IAAMC,EAASD,EAAI,WACfE,EAAuC,KAC3C,GAAI,CACF,EAAMD,EAAO,WAAW,IAAI,CAC9B,MAAQ,CACN,EAAM,IACR,CAEA,IAAME,EAAUlC,EAAAA,mBAAmBmC,CAAO,EACtCC,EAAUD,EACVE,EAAoBpC,EAAAA,UAAU8B,EAAI,KAAMK,EAAQ,OAAO,EACvDE,EAA2B,KAC3BC,EAA2B,KAC3BC,EAAS,GACTC,EAAY,GACZC,EAAyB,KACzBC,EAAiB,GACjBC,EAMO,KAELC,EAIF,CAAE,MAAO,IAAI,IAAO,MAAO,IAAI,IAAO,OAAQ,IAAI,GAAM,EACtDC,GACJ,EACA,IACG,CACH,IAAK,IAAMC,IAAY,CAAC,GAAGF,EAAUG,EAAK,EAAGD,EAASE,CAAK,CAC7D,EAGMC,EAActB,EAAI,cAAc,KAAK,EAC3C,EAAY,GAAK,uBAAuB,EAAEF,IAC1CR,EAAA,aAAagC,EAAa,CACxB,SAAU,WACV,MAAO,MACP,OAAQ,MACR,SAAU,SACV,KAAM,gBACN,SAAU,aACV,WAAY,QACd,CAAC,EACDnB,EAAI,MAAM,YAAYmB,CAAW,EACjCnB,EAAI,MAAM,aAAa,mBAAo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,YAAad,CAAW,EAClDc,EAAM,oBAAoB,gBAAiBX,CAAe,EAC1DW,EAAM,oBAAoB,eAAgBV,CAAc,EACxDU,EAAM,oBAAoB,UAAWR,CAAS,EAC9CQ,EAAM,oBAAoB,QAASH,CAAO,EAC1CG,EAAM,oBAAoB,OAAQD,CAAM,EACxCE,GAAgB,WAAW,EAC3BE,GAAa,EACb7E,EAAU,MAAM,MAAM,EACtBA,EAAU,MAAM,MAAM,EACtBA,EAAU,OAAO,MAAM,EACvBd,EAAI,KAAK,OAAO,EAClB,CACF,CACF"}
|
|
1
|
+
{"version":3,"file":"chart.cjs","names":["createChartDom","createShapeRuntime","readTheme","estimateText","tooltipContent","swatch","hoverEvent","hoverAnchor","placeShapeTooltip","sameHover","now","describeScene","shapeLegend","legendConfig","describeChart","hitTestShapes","describeItem","stepHover","watchTheme","require_dom","require_theme","require_scene","require_draw","require_hit","require_layout","require_runtime","TAP_SLOP","uid","createShapeChart","doc","container","win","dom","canvas","ctx","runtime","initial","options","theme","scene","hover","tipKey","destroyed","frameId","frameIsTimeout","press","listeners","emit","listener","type","event","description","fontSet","measure","f","text","cancelFrame","schedule","render","tooltipOptions","tooltipNode","custom","content","fragment","header","row","el","n","v","updateTooltip","tip","key","force","anchor","stageW","stageH","left","top","setHover","changed","next","keyboard","width","height","dpr","pw","ph","frame","it","renderLegend","entries","config","focused","bottom","entry","item","toggle","updateAccessibility","index","drill","path","activate","hit","local","rect","hitAt","x","y","onPointerMove","onPointerDown","onPointerUp","p","onPointerCancel","onPointerLeave","focusItem","onKeyDown","current","direction","items","e","onFocus","visible","onBlur","stage","resizeObserver","refreshTheme","unwatchTheme","previous"],"sources":["../../../../../charts/src/engine/shapes/chart.ts"],"sourcesContent":["// createShapeChart: DOM host of the shape charts. One Canvas2D layer sized\n// with the device pixel ratio, the house legend / tooltip / live region of\n// createChartDom, pointer + keyboard interaction, resize and theme watching.\n\nimport { createChartDom, styleElement, swatch } from \"../dom\";\nimport { readTheme, watchTheme, type ChartTheme } from \"../theme\";\nimport { drawShapeScene } from \"./draw\";\nimport { hitTestShapes, hoverAnchor, stepHover } from \"./hit\";\nimport {\n describeChart,\n describeItem,\n describeScene,\n hoverEvent,\n legendConfig,\n placeShapeTooltip,\n sameHover,\n shapeLegend,\n tooltipContent,\n} from \"./layout\";\nimport { createShapeRuntime, now } from \"./runtime\";\nimport {\n estimateText,\n type MeasureText,\n type ShapeHover,\n type ShapeScene,\n} from \"./scene\";\nimport type {\n ShapeChartEventMap,\n ShapeChartInstance,\n ShapeChartOptions,\n ShapeHoverEvent,\n} from \"./types\";\n\n/** Pointer travel (px) under which a press counts as a click / tap */\nconst TAP_SLOP = 6;\n\nlet uid = 0;\n\ninterface HoverState {\n hover: ShapeHover;\n x: number;\n y: number;\n keyboard: boolean;\n}\n\n/**\n * Creates a pie / donut, radar, gauge, funnel, treemap, sankey, sunburst,\n * radial bar, calendar heatmap or bullet chart in `container` (drawn with\n * Canvas2D, themed by the Minerva CSS variables).\n */\nexport const createShapeChart = (\n container: HTMLElement,\n initial: ShapeChartOptions,\n): ShapeChartInstance => {\n const doc = container.ownerDocument;\n const win = doc.defaultView;\n const dom = createChartDom(container);\n dom.root.classList.add(\"minerva-shape-chart\");\n dom.foreground.style.display = \"none\";\n dom.hover.style.display = \"none\";\n const canvas = dom.background;\n let ctx: CanvasRenderingContext2D | null = null;\n try {\n ctx = canvas.getContext(\"2d\");\n } catch {\n ctx = null;\n }\n\n const runtime = createShapeRuntime(initial);\n let options = initial;\n let theme: ChartTheme = readTheme(dom.root, options.palette);\n let scene: ShapeScene | null = null;\n let hover: HoverState | null = null;\n let tipKey = \"\";\n let destroyed = false;\n let frameId: number | null = null;\n let frameIsTimeout = false;\n let press: {\n x: number;\n y: number;\n id: number;\n touch: boolean;\n moved: boolean;\n } | null = null;\n\n const listeners: {\n [K in keyof ShapeChartEventMap]: Set<\n (event: ShapeChartEventMap[K]) => void\n >;\n } = {\n hover: new Set(),\n click: new Set(),\n toggle: new Set(),\n drill: new Set(),\n };\n const emit = <K extends keyof ShapeChartEventMap>(\n type: K,\n event: ShapeChartEventMap[K],\n ) => {\n for (const listener of [...listeners[type]]) listener(event);\n };\n\n // screen-reader summary of the data\n const description = doc.createElement(\"div\");\n description.id = `minerva-shape-chart-${++uid}`;\n styleElement(description, {\n position: \"absolute\",\n width: \"1px\",\n height: \"1px\",\n overflow: \"hidden\",\n clip: \"rect(0 0 0 0)\",\n clipPath: \"inset(50%)\",\n whiteSpace: \"nowrap\",\n });\n dom.stage.appendChild(description);\n dom.stage.setAttribute(\"aria-describedby\", description.id);\n dom.stage.tabIndex = 0;\n\n let fontSet = \"\";\n const measure: MeasureText = (text, f) => {\n if (!ctx) return estimateText(text, f);\n if (f !== fontSet) {\n ctx.font = f;\n fontSet = f;\n }\n return ctx.measureText(text).width;\n };\n\n // ------------------------------------------------------------- frames\n\n const cancelFrame = () => {\n if (frameId === null) return;\n if (frameIsTimeout) clearTimeout(frameId);\n else win?.cancelAnimationFrame?.(frameId);\n frameId = null;\n };\n\n const schedule = () => {\n if (destroyed || frameId !== null) return;\n if (win && typeof win.requestAnimationFrame === \"function\") {\n frameIsTimeout = false;\n frameId = win.requestAnimationFrame(() => render());\n } else {\n frameIsTimeout = true;\n frameId = setTimeout(() => render(), 16) as unknown as number;\n }\n };\n\n const tooltipOptions = () =>\n options.tooltip === false\n ? null\n : typeof options.tooltip === \"object\"\n ? options.tooltip\n : {};\n\n const tooltipNode = (event: ShapeHoverEvent): Node | string | null => {\n const custom = tooltipOptions()?.render;\n if (custom) return custom(event);\n if (!scene || !hover) return null;\n const content = tooltipContent(scene, hover.hover);\n if (!content) return null;\n const fragment = doc.createDocumentFragment();\n const header = doc.createElement(\"div\");\n styleElement(header, {\n display: \"flex\",\n alignItems: \"center\",\n gap: \"6px\",\n fontWeight: \"600\",\n marginBottom: \"4px\",\n color: \"var(--text-color, #1f2937)\",\n // long titles (full names of truncated labels) wrap\n whiteSpace: \"normal\",\n maxWidth: \"260px\",\n overflowWrap: \"anywhere\",\n });\n if (content.color) header.appendChild(swatch(doc, content.color, \"dot\"));\n header.appendChild(doc.createTextNode(content.title));\n fragment.append(header);\n for (const row of content.rows) {\n const el = doc.createElement(\"div\");\n styleElement(el, { display: \"flex\", alignItems: \"center\", gap: \"8px\" });\n if (row.color) el.appendChild(swatch(doc, row.color, \"dot\"));\n const n = doc.createElement(\"span\");\n styleElement(n, {\n flex: \"1 1 auto\",\n color: row.strong\n ? \"var(--text-color, #1f2937)\"\n : \"var(--text-secondary-color, #6b7280)\",\n fontWeight: row.strong ? \"600\" : \"400\",\n });\n n.textContent = row.name;\n const v = doc.createElement(\"span\");\n styleElement(v, {\n fontWeight: \"600\",\n fontVariantNumeric: \"tabular-nums\",\n marginLeft: \"12px\",\n });\n v.textContent = row.value;\n el.append(n, v);\n fragment.append(el);\n }\n return fragment;\n };\n\n /** Fills (when the hovered item changed) and places the tooltip */\n const updateTooltip = (force = false) => {\n const tip = dom.tooltip;\n const event = scene && hover ? hoverEvent(scene, hover.hover) : null;\n if (!event || !scene || !hover || !tooltipOptions() || press?.moved) {\n tip.style.display = \"none\";\n tipKey = \"\";\n return;\n }\n const key = `${event.index}:${event.indicator ?? \"\"}`;\n if (force || key !== tipKey) {\n tipKey = key;\n const content = tooltipNode(event);\n if (content === null || content === \"\") {\n tip.replaceChildren();\n tipKey = \"\";\n tip.style.display = \"none\";\n return;\n }\n if (typeof content === \"string\") {\n tip.textContent = content;\n tip.style.whiteSpace = \"pre\";\n } else {\n tip.replaceChildren(content);\n tip.style.whiteSpace = \"nowrap\";\n }\n } else if (!tip.firstChild) {\n return;\n }\n tip.style.display = \"block\";\n const anchor = hover.keyboard\n ? (hoverAnchor(scene, hover.hover) ?? hover)\n : hover;\n const stageW = dom.stage.clientWidth;\n const stageH = dom.stage.clientHeight;\n const { x: left, y: top } = placeShapeTooltip(\n scene,\n hover.hover,\n anchor,\n tip.offsetWidth,\n tip.offsetHeight,\n stageW,\n stageH,\n );\n tip.style.transform = `translate(${Math.round(left)}px, ${Math.round(top)}px)`;\n };\n\n const setHover = (\n next: ShapeHover | null,\n x: number,\n y: number,\n keyboard: boolean,\n ) => {\n const changed = !sameHover(hover?.hover ?? null, next);\n hover = next ? { hover: next, x, y, keyboard } : null;\n dom.stage.style.cursor = next && !keyboard ? \"pointer\" : \"\";\n updateTooltip();\n if (!changed) return;\n schedule();\n emit(\"hover\", scene && next ? hoverEvent(scene, next) : null);\n };\n\n function render() {\n frameId = null;\n if (destroyed) return;\n const width = dom.stage.clientWidth;\n const height = dom.stage.clientHeight;\n if (!(width > 0 && height > 0)) return;\n const dpr = win?.devicePixelRatio || 1;\n const pw = Math.max(1, Math.round(width * dpr));\n const ph = Math.max(1, Math.round(height * dpr));\n if (canvas.width !== pw) canvas.width = pw;\n if (canvas.height !== ph) canvas.height = ph;\n canvas.style.width = `${width}px`;\n canvas.style.height = `${height}px`;\n fontSet = \"\";\n const frame = runtime.frame(now(), { theme, width, height, measure });\n scene = frame.scene;\n if (hover && !scene.items.some((it) => it.index === hover?.hover.index)) {\n hover = null;\n dom.stage.style.cursor = \"\";\n emit(\"hover\", null);\n }\n if (ctx) {\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.clearRect(0, 0, pw, ph);\n ctx.setTransform(dpr, 0, 0, dpr, 0, 0);\n drawShapeScene(ctx, scene, hover?.hover ?? null);\n fontSet = \"\";\n }\n updateTooltip();\n if (!frame.animating) {\n const text = describeScene(scene);\n if (description.textContent !== text) description.textContent = text;\n } else schedule();\n }\n\n // ------------------------------------------------------------- legend\n\n const renderLegend = () => {\n const entries = shapeLegend(options, theme, runtime.hidden);\n const config = legendConfig(options);\n const focused = [...dom.legend.children].indexOf(\n doc.activeElement as Element,\n );\n dom.legend.replaceChildren();\n dom.legend.style.display = entries ? \"flex\" : \"none\";\n if (!entries) return;\n const bottom = config.position === \"bottom\";\n dom.legend.style.order = bottom ? \"1\" : \"0\";\n dom.legend.style.padding = bottom ? \"8px 4px 0\" : \"0 4px 8px\";\n dom.legend.style.justifyContent = \"center\";\n for (const entry of entries) {\n const item = doc.createElement(config.toggle ? \"button\" : \"span\");\n if (item instanceof HTMLButtonElement) {\n item.type = \"button\";\n item.setAttribute(\"aria-pressed\", String(!entry.hidden));\n item.addEventListener(\"click\", () => toggle(entry.index));\n }\n styleElement(item, {\n display: \"inline-flex\",\n alignItems: \"center\",\n gap: \"6px\",\n padding: \"2px 4px\",\n margin: \"0\",\n border: \"0\",\n borderRadius: \"4px\",\n background: \"none\",\n font: \"inherit\",\n color: \"var(--text-secondary-color, #6b7280)\",\n cursor: config.toggle ? \"pointer\" : \"default\",\n opacity: entry.hidden ? \"0.45\" : \"1\",\n textDecoration: entry.hidden ? \"line-through\" : \"none\",\n transition: \"opacity 120ms ease-out\",\n });\n item.append(\n swatch(doc, entry.color, \"dot\"),\n doc.createTextNode(entry.name),\n );\n dom.legend.appendChild(item);\n }\n if (focused >= 0)\n (dom.legend.children[focused] as HTMLElement | undefined)?.focus();\n };\n\n const updateAccessibility = () => {\n dom.stage.setAttribute(\n \"aria-label\",\n options.ariaLabel ?? describeChart(options),\n );\n };\n\n function toggle(index: number) {\n if (destroyed) return;\n const event = runtime.toggle(index);\n if (!event) return;\n if (!options.hidden) {\n renderLegend();\n tipKey = \"\";\n schedule();\n }\n emit(\"toggle\", event);\n }\n\n function drill(path: readonly string[]) {\n if (destroyed) return;\n const event = runtime.drill(path);\n if (!event) return;\n if (options.type === \"sunburst\" && !options.drillPath) {\n tipKey = \"\";\n schedule();\n }\n emit(\"drill\", event);\n }\n\n /** Sunburst: drills into / out of an activated item */\n const activate = (hit: ShapeHover) => {\n if (options.type !== \"sunburst\" || options.drill === false || !scene)\n return;\n const item = scene.items.find((it) => it.index === hit.index);\n if (item?.drill) drill(item.drill);\n };\n\n // -------------------------------------------------------- interaction\n\n const local = (event: { clientX: number; clientY: number }) => {\n const rect = dom.stage.getBoundingClientRect();\n return { x: event.clientX - rect.left, y: event.clientY - rect.top };\n };\n\n const hitAt = (x: number, y: number) =>\n scene ? hitTestShapes(scene, x, y, hover?.hover ?? null) : null;\n\n const onPointerMove = (event: PointerEvent) => {\n const { x, y } = local(event);\n if (press && press.id === event.pointerId) {\n if (Math.hypot(x - press.x, y - press.y) > TAP_SLOP) press.moved = true;\n if (press.touch) return;\n } else if (event.pointerType === \"touch\") return;\n setHover(hitAt(x, y), x, y, false);\n };\n\n const onPointerDown = (event: PointerEvent) => {\n const { x, y } = local(event);\n press = {\n x,\n y,\n id: event.pointerId,\n touch: event.pointerType === \"touch\",\n moved: false,\n };\n };\n\n const onPointerUp = (event: PointerEvent) => {\n const p = press;\n press = null;\n if (!p || p.id !== event.pointerId || p.moved) {\n updateTooltip();\n return;\n }\n const { x, y } = local(event);\n const hit = hitAt(x, y);\n // a tap shows the tooltip (there is no hover on touch screens)\n setHover(hit, x, y, false);\n if (hit && scene) {\n const e = hoverEvent(scene, hit);\n if (e) emit(\"click\", e);\n activate(hit);\n }\n };\n\n const onPointerCancel = () => {\n press = null;\n updateTooltip();\n };\n\n const onPointerLeave = (event: PointerEvent) => {\n if (event.pointerType === \"touch\") return;\n press = null;\n if (hover && !hover.keyboard) setHover(null, 0, 0, false);\n };\n\n const focusItem = (next: ShapeHover | null) => {\n if (!scene || !next) return;\n const anchor = hoverAnchor(scene, next) ?? { x: 0, y: 0 };\n setHover(next, anchor.x, anchor.y, true);\n dom.live.textContent = describeItem(scene, next);\n };\n\n const onKeyDown = (event: KeyboardEvent) => {\n if (!scene) return;\n const current = hover?.hover ?? null;\n const keys: Record<string, \"next\" | \"prev\" | \"up\" | \"down\"> = {\n ArrowRight: \"next\",\n ArrowLeft: \"prev\",\n ArrowUp: \"up\",\n ArrowDown: \"down\",\n };\n const direction = keys[event.key];\n if (direction) {\n event.preventDefault();\n focusItem(stepHover(scene, current, direction));\n return;\n }\n switch (event.key) {\n case \"Home\":\n case \"End\": {\n const items = scene.items;\n if (!items.length) return;\n event.preventDefault();\n const it = event.key === \"Home\" ? items[0] : items[items.length - 1];\n focusItem(\n scene.type === \"radar\"\n ? { index: it.index, indicator: current?.indicator ?? 0 }\n : { index: it.index },\n );\n break;\n }\n case \"Enter\":\n case \" \": {\n if (!current) return;\n const e = hoverEvent(scene, current);\n if (!e) return;\n event.preventDefault();\n emit(\"click\", e);\n activate(current);\n break;\n }\n case \"Backspace\": {\n if (options.type !== \"sunburst\" || options.drill === false) return;\n const path = runtime.drillPath();\n if (!path.length) return;\n event.preventDefault();\n drill(path.slice(0, -1));\n break;\n }\n case \"Escape\":\n if (hover) {\n event.preventDefault();\n setHover(null, 0, 0, false);\n }\n break;\n default:\n break;\n }\n };\n\n const onFocus = () => {\n let visible: boolean;\n try {\n visible = dom.stage.matches(\":focus-visible\");\n } catch {\n visible = true;\n }\n // inset, like an outline drawn inside the stage edge: the drawing keeps a\n // padding, so the ring never covers labels or leader lines\n if (visible)\n dom.stage.style.boxShadow =\n \"inset 0 0 0 2px var(--primary-color, #4f46e5)\";\n };\n\n const onBlur = () => {\n dom.stage.style.boxShadow = \"\";\n if (hover?.keyboard) setHover(null, 0, 0, false);\n };\n\n const stage = dom.stage;\n stage.addEventListener(\"pointermove\", onPointerMove);\n stage.addEventListener(\"pointerdown\", onPointerDown);\n stage.addEventListener(\"pointerup\", onPointerUp);\n stage.addEventListener(\"pointercancel\", onPointerCancel);\n stage.addEventListener(\"pointerleave\", onPointerLeave);\n stage.addEventListener(\"keydown\", onKeyDown);\n stage.addEventListener(\"focus\", onFocus);\n stage.addEventListener(\"blur\", onBlur);\n\n const resizeObserver =\n typeof ResizeObserver === \"function\"\n ? new ResizeObserver(() => schedule())\n : null;\n resizeObserver?.observe(dom.stage);\n\n const refreshTheme = () => {\n if (destroyed) return;\n theme = readTheme(dom.root, options.palette);\n renderLegend();\n tipKey = \"\";\n schedule();\n };\n const unwatchTheme = watchTheme(refreshTheme);\n\n renderLegend();\n updateAccessibility();\n render();\n\n return {\n setOptions(next) {\n if (destroyed) return;\n const previous = options;\n options = next;\n runtime.setOptions(next);\n if ((next.palette ?? []).join() !== (previous.palette ?? []).join())\n theme = readTheme(dom.root, next.palette);\n if (next.type !== previous.type && hover) setHover(null, 0, 0, false);\n renderLegend();\n updateAccessibility();\n tipKey = \"\";\n schedule();\n },\n resize() {\n if (destroyed) return;\n cancelFrame();\n render();\n },\n refreshTheme,\n toggle,\n getHidden: () => runtime.hiddenIndexes(),\n drill,\n getDrillPath: () => runtime.drillPath(),\n on(type, listener) {\n listeners[type].add(listener);\n return () => {\n listeners[type].delete(listener);\n };\n },\n destroy() {\n if (destroyed) return;\n destroyed = true;\n cancelFrame();\n stage.removeEventListener(\"pointermove\", onPointerMove);\n stage.removeEventListener(\"pointerdown\", onPointerDown);\n stage.removeEventListener(\"pointerup\", onPointerUp);\n stage.removeEventListener(\"pointercancel\", onPointerCancel);\n stage.removeEventListener(\"pointerleave\", onPointerLeave);\n stage.removeEventListener(\"keydown\", onKeyDown);\n stage.removeEventListener(\"focus\", onFocus);\n stage.removeEventListener(\"blur\", onBlur);\n resizeObserver?.disconnect();\n unwatchTheme();\n listeners.hover.clear();\n listeners.click.clear();\n listeners.toggle.clear();\n listeners.drill.clear();\n dom.root.remove();\n },\n };\n};\n"],"mappings":"qLAkCA,IAAM0B,EAAW,EAEbC,EAAM,EAcGC,GACX,EACA,IACuB,CACvB,IAAMC,EAAMC,EAAU,cAChBC,EAAMF,EAAI,YACVG,EAAMhC,EAAAA,eAAe8B,CAAS,EACpCE,EAAI,KAAK,UAAU,IAAI,qBAAqB,EAC5C,EAAI,WAAW,MAAM,QAAU,OAC/B,EAAI,MAAM,MAAM,QAAU,OAC1B,IAAMC,EAASD,EAAI,WACfE,EAAuC,KAC3C,GAAI,CACF,EAAMD,EAAO,WAAW,IAAI,CAC9B,MAAQ,CACN,EAAM,IACR,CAEA,IAAME,EAAUlC,EAAAA,mBAAmBmC,CAAO,EACtCC,EAAUD,EACVE,EAAoBpC,EAAAA,UAAU8B,EAAI,KAAMK,EAAQ,OAAO,EACvDE,EAA2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EACtDc,EAAM,oBAAoB,YAAab,CAAW,EAClDa,EAAM,oBAAoB,gBAAiBX,CAAe,EAC1DW,EAAM,oBAAoB,eAAgBV,CAAc,EACxDU,EAAM,oBAAoB,UAAWR,CAAS,EAC9CQ,EAAM,oBAAoB,QAASH,CAAO,EAC1CG,EAAM,oBAAoB,OAAQD,CAAM,EACxCE,GAAgB,WAAW,EAC3BE,GAAa,EACbhF,EAAU,MAAM,MAAM,EACtBA,EAAU,MAAM,MAAM,EACtBA,EAAU,OAAO,MAAM,EACvBA,EAAU,MAAM,MAAM,EACtBd,EAAI,KAAK,OAAO,EAClB,CACF,CACF"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ShapeChartInstance, ShapeChartOptions } from './types.cjs';
|
|
2
2
|
/**
|
|
3
|
-
* Creates a pie / donut, radar, gauge, funnel
|
|
4
|
-
*
|
|
3
|
+
* Creates a pie / donut, radar, gauge, funnel, treemap, sankey, sunburst,
|
|
4
|
+
* radial bar, calendar heatmap or bullet chart in `container` (drawn with
|
|
5
|
+
* Canvas2D, themed by the Minerva CSS variables).
|
|
5
6
|
*/
|
|
6
7
|
export declare const createShapeChart: (container: HTMLElement, initial: ShapeChartOptions) => ShapeChartInstance;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ShapeChartInstance, ShapeChartOptions } from './types.js';
|
|
2
2
|
/**
|
|
3
|
-
* Creates a pie / donut, radar, gauge, funnel
|
|
4
|
-
*
|
|
3
|
+
* Creates a pie / donut, radar, gauge, funnel, treemap, sankey, sunburst,
|
|
4
|
+
* radial bar, calendar heatmap or bullet chart in `container` (drawn with
|
|
5
|
+
* Canvas2D, themed by the Minerva CSS variables).
|
|
5
6
|
*/
|
|
6
7
|
export declare const createShapeChart: (container: HTMLElement, initial: ShapeChartOptions) => ShapeChartInstance;
|
|
@@ -18,7 +18,8 @@ var ue = 6, de = 0, d = (d, f) => {
|
|
|
18
18
|
let v = ce(f), y = f, b = r(h.root, y.palette), x = null, S = null, C = "", w = !1, T = null, E = !1, D = null, O = {
|
|
19
19
|
hover: /* @__PURE__ */ new Set(),
|
|
20
20
|
click: /* @__PURE__ */ new Set(),
|
|
21
|
-
toggle: /* @__PURE__ */ new Set()
|
|
21
|
+
toggle: /* @__PURE__ */ new Set(),
|
|
22
|
+
drill: /* @__PURE__ */ new Set()
|
|
22
23
|
}, k = (e, t) => {
|
|
23
24
|
for (let n of [...O[e]]) n(t);
|
|
24
25
|
}, A = p.createElement("div");
|
|
@@ -48,7 +49,10 @@ var ue = 6, de = 0, d = (d, f) => {
|
|
|
48
49
|
gap: "6px",
|
|
49
50
|
fontWeight: "600",
|
|
50
51
|
marginBottom: "4px",
|
|
51
|
-
color: "var(--text-color, #1f2937)"
|
|
52
|
+
color: "var(--text-color, #1f2937)",
|
|
53
|
+
whiteSpace: "normal",
|
|
54
|
+
maxWidth: "260px",
|
|
55
|
+
overflowWrap: "anywhere"
|
|
52
56
|
}), i.color && o.appendChild(n(p, i.color, "dot")), o.appendChild(p.createTextNode(i.title)), a.append(o);
|
|
53
57
|
for (let e of i.rows) {
|
|
54
58
|
let r = p.createElement("div");
|
|
@@ -150,20 +154,29 @@ var ue = 6, de = 0, d = (d, f) => {
|
|
|
150
154
|
let t = v.toggle(e);
|
|
151
155
|
t && (y.hidden || (R(), C = "", N()), k("toggle", t));
|
|
152
156
|
}
|
|
153
|
-
|
|
157
|
+
function V(e) {
|
|
158
|
+
if (w) return;
|
|
159
|
+
let t = v.drill(e);
|
|
160
|
+
t && (y.type === "sunburst" && !y.drillPath && (C = "", N()), k("drill", t));
|
|
161
|
+
}
|
|
162
|
+
let H = (e) => {
|
|
163
|
+
if (y.type !== "sunburst" || y.drill === !1 || !x) return;
|
|
164
|
+
let t = x.items.find((t) => t.index === e.index);
|
|
165
|
+
t?.drill && V(t.drill);
|
|
166
|
+
}, U = (e) => {
|
|
154
167
|
let t = h.stage.getBoundingClientRect();
|
|
155
168
|
return {
|
|
156
169
|
x: e.clientX - t.left,
|
|
157
170
|
y: e.clientY - t.top
|
|
158
171
|
};
|
|
159
|
-
},
|
|
160
|
-
let { x: t, y: n } =
|
|
172
|
+
}, W = (e, t) => x ? s(x, e, t, S?.hover ?? null) : null, G = (e) => {
|
|
173
|
+
let { x: t, y: n } = U(e);
|
|
161
174
|
if (D && D.id === e.pointerId) {
|
|
162
175
|
if (Math.hypot(t - D.x, n - D.y) > ue && (D.moved = !0), D.touch) return;
|
|
163
176
|
} else if (e.pointerType === "touch") return;
|
|
164
|
-
I(
|
|
165
|
-
},
|
|
166
|
-
let { x: t, y: n } =
|
|
177
|
+
I(W(t, n), t, n, !1);
|
|
178
|
+
}, K = (e) => {
|
|
179
|
+
let { x: t, y: n } = U(e);
|
|
167
180
|
D = {
|
|
168
181
|
x: t,
|
|
169
182
|
y: n,
|
|
@@ -171,29 +184,29 @@ var ue = 6, de = 0, d = (d, f) => {
|
|
|
171
184
|
touch: e.pointerType === "touch",
|
|
172
185
|
moved: !1
|
|
173
186
|
};
|
|
174
|
-
},
|
|
187
|
+
}, q = (e) => {
|
|
175
188
|
let t = D;
|
|
176
189
|
if (D = null, !t || t.id !== e.pointerId || t.moved) {
|
|
177
190
|
F();
|
|
178
191
|
return;
|
|
179
192
|
}
|
|
180
|
-
let { x: n, y: r } =
|
|
193
|
+
let { x: n, y: r } = U(e), i = W(n, r);
|
|
181
194
|
if (I(i, n, r, !1), i && x) {
|
|
182
195
|
let e = u(x, i);
|
|
183
|
-
e && k("click", e);
|
|
196
|
+
e && k("click", e), H(i);
|
|
184
197
|
}
|
|
185
|
-
},
|
|
198
|
+
}, J = () => {
|
|
186
199
|
D = null, F();
|
|
187
|
-
},
|
|
200
|
+
}, Y = (e) => {
|
|
188
201
|
e.pointerType !== "touch" && (D = null, S && !S.keyboard && I(null, 0, 0, !1));
|
|
189
|
-
},
|
|
202
|
+
}, X = (e) => {
|
|
190
203
|
if (!x || !e) return;
|
|
191
204
|
let t = c(x, e) ?? {
|
|
192
205
|
x: 0,
|
|
193
206
|
y: 0
|
|
194
207
|
};
|
|
195
208
|
I(e, t.x, t.y, !0), h.live.textContent = te(x, e);
|
|
196
|
-
},
|
|
209
|
+
}, Z = (e) => {
|
|
197
210
|
if (!x) return;
|
|
198
211
|
let t = S?.hover ?? null, n = {
|
|
199
212
|
ArrowRight: "next",
|
|
@@ -202,7 +215,7 @@ var ue = 6, de = 0, d = (d, f) => {
|
|
|
202
215
|
ArrowDown: "down"
|
|
203
216
|
}[e.key];
|
|
204
217
|
if (n) {
|
|
205
|
-
e.preventDefault(),
|
|
218
|
+
e.preventDefault(), X(l(x, t, n));
|
|
206
219
|
return;
|
|
207
220
|
}
|
|
208
221
|
switch (e.key) {
|
|
@@ -212,7 +225,7 @@ var ue = 6, de = 0, d = (d, f) => {
|
|
|
212
225
|
if (!n.length) return;
|
|
213
226
|
e.preventDefault();
|
|
214
227
|
let r = e.key === "Home" ? n[0] : n[n.length - 1];
|
|
215
|
-
|
|
228
|
+
X(x.type === "radar" ? {
|
|
216
229
|
index: r.index,
|
|
217
230
|
indicator: t?.indicator ?? 0
|
|
218
231
|
} : { index: r.index });
|
|
@@ -223,12 +236,19 @@ var ue = 6, de = 0, d = (d, f) => {
|
|
|
223
236
|
if (!t) return;
|
|
224
237
|
let n = u(x, t);
|
|
225
238
|
if (!n) return;
|
|
226
|
-
e.preventDefault(), k("click", n);
|
|
239
|
+
e.preventDefault(), k("click", n), H(t);
|
|
240
|
+
break;
|
|
241
|
+
}
|
|
242
|
+
case "Backspace": {
|
|
243
|
+
if (y.type !== "sunburst" || y.drill === !1) return;
|
|
244
|
+
let t = v.drillPath();
|
|
245
|
+
if (!t.length) return;
|
|
246
|
+
e.preventDefault(), V(t.slice(0, -1));
|
|
227
247
|
break;
|
|
228
248
|
}
|
|
229
249
|
case "Escape": S && (e.preventDefault(), I(null, 0, 0, !1));
|
|
230
250
|
}
|
|
231
|
-
},
|
|
251
|
+
}, me = () => {
|
|
232
252
|
let e;
|
|
233
253
|
try {
|
|
234
254
|
e = h.stage.matches(":focus-visible");
|
|
@@ -236,15 +256,15 @@ var ue = 6, de = 0, d = (d, f) => {
|
|
|
236
256
|
e = !0;
|
|
237
257
|
}
|
|
238
258
|
e && (h.stage.style.boxShadow = "inset 0 0 0 2px var(--primary-color, #4f46e5)");
|
|
239
|
-
},
|
|
259
|
+
}, he = () => {
|
|
240
260
|
h.stage.style.boxShadow = "", S?.keyboard && I(null, 0, 0, !1);
|
|
241
261
|
}, Q = h.stage;
|
|
242
|
-
Q.addEventListener("pointermove",
|
|
243
|
-
let
|
|
244
|
-
|
|
245
|
-
let
|
|
262
|
+
Q.addEventListener("pointermove", G), Q.addEventListener("pointerdown", K), Q.addEventListener("pointerup", q), Q.addEventListener("pointercancel", J), Q.addEventListener("pointerleave", Y), Q.addEventListener("keydown", Z), Q.addEventListener("focus", me), Q.addEventListener("blur", he);
|
|
263
|
+
let ge = typeof ResizeObserver == "function" ? new ResizeObserver(() => N()) : null;
|
|
264
|
+
ge?.observe(h.stage);
|
|
265
|
+
let $ = () => {
|
|
246
266
|
w || (b = r(h.root, y.palette), R(), C = "", N());
|
|
247
|
-
},
|
|
267
|
+
}, _e = i($);
|
|
248
268
|
return R(), z(), L(), {
|
|
249
269
|
setOptions(e) {
|
|
250
270
|
if (w) return;
|
|
@@ -254,16 +274,18 @@ var ue = 6, de = 0, d = (d, f) => {
|
|
|
254
274
|
resize() {
|
|
255
275
|
w || (M(), L());
|
|
256
276
|
},
|
|
257
|
-
refreshTheme:
|
|
277
|
+
refreshTheme: $,
|
|
258
278
|
toggle: B,
|
|
259
279
|
getHidden: () => v.hiddenIndexes(),
|
|
280
|
+
drill: V,
|
|
281
|
+
getDrillPath: () => v.drillPath(),
|
|
260
282
|
on(e, t) {
|
|
261
283
|
return O[e].add(t), () => {
|
|
262
284
|
O[e].delete(t);
|
|
263
285
|
};
|
|
264
286
|
},
|
|
265
287
|
destroy() {
|
|
266
|
-
w || (w = !0, M(), Q.removeEventListener("pointermove",
|
|
288
|
+
w || (w = !0, M(), Q.removeEventListener("pointermove", G), Q.removeEventListener("pointerdown", K), Q.removeEventListener("pointerup", q), Q.removeEventListener("pointercancel", J), Q.removeEventListener("pointerleave", Y), Q.removeEventListener("keydown", Z), Q.removeEventListener("focus", me), Q.removeEventListener("blur", he), ge?.disconnect(), _e(), O.hover.clear(), O.click.clear(), O.toggle.clear(), O.drill.clear(), h.root.remove());
|
|
267
289
|
}
|
|
268
290
|
};
|
|
269
291
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chart.js","names":["assign","TAP_SLOP","uid","createShapeChart","doc","container","win","dom","createChartDom","canvas","ctx","runtime","createShapeRuntime","initial","options","theme","readTheme","scene","hover","tipKey","destroyed","frameId","frameIsTimeout","press","listeners","emit","listener","type","event","description","fontSet","measure","f","text","estimateText","cancelFrame","schedule","render","tooltipOptions","tooltipNode","custom","content","tooltipContent","fragment","header","swatch","row","el","n","v","updateTooltip","tip","hoverEvent","key","force","anchor","hoverAnchor","stageW","stageH","left","top","placeShapeTooltip","setHover","changed","sameHover","next","keyboard","width","height","dpr","pw","ph","frame","now","it","drawShapeScene","describeScene","renderLegend","entries","shapeLegend","config","legendConfig","focused","bottom","entry","item","toggle","updateAccessibility","describeChart","index","local","rect","hitAt","hitTestShapes","x","y","onPointerMove","onPointerDown","onPointerUp","p","hit","onPointerCancel","onPointerLeave","focusItem","describeItem","onKeyDown","current","direction","stepHover","items","e","onFocus","visible","onBlur","stage","resizeObserver","refreshTheme","unwatchTheme","watchTheme","previous"],"sources":["../../../../../charts/src/engine/shapes/chart.ts"],"sourcesContent":["// createShapeChart: DOM host of the shape charts. One Canvas2D layer sized\n// with the device pixel ratio, the house legend / tooltip / live region of\n// createChartDom, pointer + keyboard interaction, resize and theme watching.\n\nimport { createChartDom, styleElement, swatch } from \"../dom\";\nimport { readTheme, watchTheme, type ChartTheme } from \"../theme\";\nimport { drawShapeScene } from \"./draw\";\nimport { hitTestShapes, hoverAnchor, stepHover } from \"./hit\";\nimport {\n describeChart,\n describeItem,\n describeScene,\n hoverEvent,\n legendConfig,\n placeShapeTooltip,\n sameHover,\n shapeLegend,\n tooltipContent,\n} from \"./layout\";\nimport { createShapeRuntime, now } from \"./runtime\";\nimport {\n estimateText,\n type MeasureText,\n type ShapeHover,\n type ShapeScene,\n} from \"./scene\";\nimport type {\n ShapeChartEventMap,\n ShapeChartInstance,\n ShapeChartOptions,\n ShapeHoverEvent,\n} from \"./types\";\n\n/** Pointer travel (px) under which a press counts as a click / tap */\nconst TAP_SLOP = 6;\n\nlet uid = 0;\n\ninterface HoverState {\n hover: ShapeHover;\n x: number;\n y: number;\n keyboard: boolean;\n}\n\n/**\n * Creates a pie / donut, radar, gauge, funnel or treemap chart in\n * `container` (drawn with Canvas2D, themed by the Minerva CSS variables).\n */\nexport const createShapeChart = (\n container: HTMLElement,\n initial: ShapeChartOptions,\n): ShapeChartInstance => {\n const doc = container.ownerDocument;\n const win = doc.defaultView;\n const dom = createChartDom(container);\n dom.root.classList.add(\"minerva-shape-chart\");\n dom.foreground.style.display = \"none\";\n dom.hover.style.display = \"none\";\n const canvas = dom.background;\n let ctx: CanvasRenderingContext2D | null = null;\n try {\n ctx = canvas.getContext(\"2d\");\n } catch {\n ctx = null;\n }\n\n const runtime = createShapeRuntime(initial);\n let options = initial;\n let theme: ChartTheme = readTheme(dom.root, options.palette);\n let scene: ShapeScene | null = null;\n let hover: HoverState | null = null;\n let tipKey = \"\";\n let destroyed = false;\n let frameId: number | null = null;\n let frameIsTimeout = false;\n let press: {\n x: number;\n y: number;\n id: number;\n touch: boolean;\n moved: boolean;\n } | null = null;\n\n const listeners: {\n [K in keyof ShapeChartEventMap]: Set<\n (event: ShapeChartEventMap[K]) => void\n >;\n } = { hover: new Set(), click: new Set(), toggle: new Set() };\n const emit = <K extends keyof ShapeChartEventMap>(\n type: K,\n event: ShapeChartEventMap[K],\n ) => {\n for (const listener of [...listeners[type]]) listener(event);\n };\n\n // screen-reader summary of the data\n const description = doc.createElement(\"div\");\n description.id = `minerva-shape-chart-${++uid}`;\n styleElement(description, {\n position: \"absolute\",\n width: \"1px\",\n height: \"1px\",\n overflow: \"hidden\",\n clip: \"rect(0 0 0 0)\",\n clipPath: \"inset(50%)\",\n whiteSpace: \"nowrap\",\n });\n dom.stage.appendChild(description);\n dom.stage.setAttribute(\"aria-describedby\", description.id);\n dom.stage.tabIndex = 0;\n\n let fontSet = \"\";\n const measure: MeasureText = (text, f) => {\n if (!ctx) return estimateText(text, f);\n if (f !== fontSet) {\n ctx.font = f;\n fontSet = f;\n }\n return ctx.measureText(text).width;\n };\n\n // ------------------------------------------------------------- frames\n\n const cancelFrame = () => {\n if (frameId === null) return;\n if (frameIsTimeout) clearTimeout(frameId);\n else win?.cancelAnimationFrame?.(frameId);\n frameId = null;\n };\n\n const schedule = () => {\n if (destroyed || frameId !== null) return;\n if (win && typeof win.requestAnimationFrame === \"function\") {\n frameIsTimeout = false;\n frameId = win.requestAnimationFrame(() => render());\n } else {\n frameIsTimeout = true;\n frameId = setTimeout(() => render(), 16) as unknown as number;\n }\n };\n\n const tooltipOptions = () =>\n options.tooltip === false\n ? null\n : typeof options.tooltip === \"object\"\n ? options.tooltip\n : {};\n\n const tooltipNode = (event: ShapeHoverEvent): Node | string | null => {\n const custom = tooltipOptions()?.render;\n if (custom) return custom(event);\n if (!scene || !hover) return null;\n const content = tooltipContent(scene, hover.hover);\n if (!content) return null;\n const fragment = doc.createDocumentFragment();\n const header = doc.createElement(\"div\");\n styleElement(header, {\n display: \"flex\",\n alignItems: \"center\",\n gap: \"6px\",\n fontWeight: \"600\",\n marginBottom: \"4px\",\n color: \"var(--text-color, #1f2937)\",\n });\n if (content.color) header.appendChild(swatch(doc, content.color, \"dot\"));\n header.appendChild(doc.createTextNode(content.title));\n fragment.append(header);\n for (const row of content.rows) {\n const el = doc.createElement(\"div\");\n styleElement(el, { display: \"flex\", alignItems: \"center\", gap: \"8px\" });\n if (row.color) el.appendChild(swatch(doc, row.color, \"dot\"));\n const n = doc.createElement(\"span\");\n styleElement(n, {\n flex: \"1 1 auto\",\n color: row.strong\n ? \"var(--text-color, #1f2937)\"\n : \"var(--text-secondary-color, #6b7280)\",\n fontWeight: row.strong ? \"600\" : \"400\",\n });\n n.textContent = row.name;\n const v = doc.createElement(\"span\");\n styleElement(v, {\n fontWeight: \"600\",\n fontVariantNumeric: \"tabular-nums\",\n marginLeft: \"12px\",\n });\n v.textContent = row.value;\n el.append(n, v);\n fragment.append(el);\n }\n return fragment;\n };\n\n /** Fills (when the hovered item changed) and places the tooltip */\n const updateTooltip = (force = false) => {\n const tip = dom.tooltip;\n const event = scene && hover ? hoverEvent(scene, hover.hover) : null;\n if (!event || !scene || !hover || !tooltipOptions() || press?.moved) {\n tip.style.display = \"none\";\n tipKey = \"\";\n return;\n }\n const key = `${event.index}:${event.indicator ?? \"\"}`;\n if (force || key !== tipKey) {\n tipKey = key;\n const content = tooltipNode(event);\n if (content === null || content === \"\") {\n tip.replaceChildren();\n tipKey = \"\";\n tip.style.display = \"none\";\n return;\n }\n if (typeof content === \"string\") {\n tip.textContent = content;\n tip.style.whiteSpace = \"pre\";\n } else {\n tip.replaceChildren(content);\n tip.style.whiteSpace = \"nowrap\";\n }\n } else if (!tip.firstChild) {\n return;\n }\n tip.style.display = \"block\";\n const anchor = hover.keyboard\n ? (hoverAnchor(scene, hover.hover) ?? hover)\n : hover;\n const stageW = dom.stage.clientWidth;\n const stageH = dom.stage.clientHeight;\n const { x: left, y: top } = placeShapeTooltip(\n scene,\n hover.hover,\n anchor,\n tip.offsetWidth,\n tip.offsetHeight,\n stageW,\n stageH,\n );\n tip.style.transform = `translate(${Math.round(left)}px, ${Math.round(top)}px)`;\n };\n\n const setHover = (\n next: ShapeHover | null,\n x: number,\n y: number,\n keyboard: boolean,\n ) => {\n const changed = !sameHover(hover?.hover ?? null, next);\n hover = next ? { hover: next, x, y, keyboard } : null;\n dom.stage.style.cursor = next && !keyboard ? \"pointer\" : \"\";\n updateTooltip();\n if (!changed) return;\n schedule();\n emit(\"hover\", scene && next ? hoverEvent(scene, next) : null);\n };\n\n function render() {\n frameId = null;\n if (destroyed) return;\n const width = dom.stage.clientWidth;\n const height = dom.stage.clientHeight;\n if (!(width > 0 && height > 0)) return;\n const dpr = win?.devicePixelRatio || 1;\n const pw = Math.max(1, Math.round(width * dpr));\n const ph = Math.max(1, Math.round(height * dpr));\n if (canvas.width !== pw) canvas.width = pw;\n if (canvas.height !== ph) canvas.height = ph;\n canvas.style.width = `${width}px`;\n canvas.style.height = `${height}px`;\n fontSet = \"\";\n const frame = runtime.frame(now(), { theme, width, height, measure });\n scene = frame.scene;\n if (hover && !scene.items.some((it) => it.index === hover?.hover.index)) {\n hover = null;\n dom.stage.style.cursor = \"\";\n emit(\"hover\", null);\n }\n if (ctx) {\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.clearRect(0, 0, pw, ph);\n ctx.setTransform(dpr, 0, 0, dpr, 0, 0);\n drawShapeScene(ctx, scene, hover?.hover ?? null);\n fontSet = \"\";\n }\n updateTooltip();\n if (!frame.animating) {\n const text = describeScene(scene);\n if (description.textContent !== text) description.textContent = text;\n } else schedule();\n }\n\n // ------------------------------------------------------------- legend\n\n const renderLegend = () => {\n const entries = shapeLegend(options, theme, runtime.hidden);\n const config = legendConfig(options);\n const focused = [...dom.legend.children].indexOf(\n doc.activeElement as Element,\n );\n dom.legend.replaceChildren();\n dom.legend.style.display = entries ? \"flex\" : \"none\";\n if (!entries) return;\n const bottom = config.position === \"bottom\";\n dom.legend.style.order = bottom ? \"1\" : \"0\";\n dom.legend.style.padding = bottom ? \"8px 4px 0\" : \"0 4px 8px\";\n dom.legend.style.justifyContent = \"center\";\n for (const entry of entries) {\n const item = doc.createElement(config.toggle ? \"button\" : \"span\");\n if (item instanceof HTMLButtonElement) {\n item.type = \"button\";\n item.setAttribute(\"aria-pressed\", String(!entry.hidden));\n item.addEventListener(\"click\", () => toggle(entry.index));\n }\n styleElement(item, {\n display: \"inline-flex\",\n alignItems: \"center\",\n gap: \"6px\",\n padding: \"2px 4px\",\n margin: \"0\",\n border: \"0\",\n borderRadius: \"4px\",\n background: \"none\",\n font: \"inherit\",\n color: \"var(--text-secondary-color, #6b7280)\",\n cursor: config.toggle ? \"pointer\" : \"default\",\n opacity: entry.hidden ? \"0.45\" : \"1\",\n textDecoration: entry.hidden ? \"line-through\" : \"none\",\n transition: \"opacity 120ms ease-out\",\n });\n item.append(\n swatch(doc, entry.color, \"dot\"),\n doc.createTextNode(entry.name),\n );\n dom.legend.appendChild(item);\n }\n if (focused >= 0)\n (dom.legend.children[focused] as HTMLElement | undefined)?.focus();\n };\n\n const updateAccessibility = () => {\n dom.stage.setAttribute(\n \"aria-label\",\n options.ariaLabel ?? describeChart(options),\n );\n };\n\n function toggle(index: number) {\n if (destroyed) return;\n const event = runtime.toggle(index);\n if (!event) return;\n if (!options.hidden) {\n renderLegend();\n tipKey = \"\";\n schedule();\n }\n emit(\"toggle\", event);\n }\n\n // -------------------------------------------------------- interaction\n\n const local = (event: { clientX: number; clientY: number }) => {\n const rect = dom.stage.getBoundingClientRect();\n return { x: event.clientX - rect.left, y: event.clientY - rect.top };\n };\n\n const hitAt = (x: number, y: number) =>\n scene ? hitTestShapes(scene, x, y, hover?.hover ?? null) : null;\n\n const onPointerMove = (event: PointerEvent) => {\n const { x, y } = local(event);\n if (press && press.id === event.pointerId) {\n if (Math.hypot(x - press.x, y - press.y) > TAP_SLOP) press.moved = true;\n if (press.touch) return;\n } else if (event.pointerType === \"touch\") return;\n setHover(hitAt(x, y), x, y, false);\n };\n\n const onPointerDown = (event: PointerEvent) => {\n const { x, y } = local(event);\n press = {\n x,\n y,\n id: event.pointerId,\n touch: event.pointerType === \"touch\",\n moved: false,\n };\n };\n\n const onPointerUp = (event: PointerEvent) => {\n const p = press;\n press = null;\n if (!p || p.id !== event.pointerId || p.moved) {\n updateTooltip();\n return;\n }\n const { x, y } = local(event);\n const hit = hitAt(x, y);\n // a tap shows the tooltip (there is no hover on touch screens)\n setHover(hit, x, y, false);\n if (hit && scene) {\n const e = hoverEvent(scene, hit);\n if (e) emit(\"click\", e);\n }\n };\n\n const onPointerCancel = () => {\n press = null;\n updateTooltip();\n };\n\n const onPointerLeave = (event: PointerEvent) => {\n if (event.pointerType === \"touch\") return;\n press = null;\n if (hover && !hover.keyboard) setHover(null, 0, 0, false);\n };\n\n const focusItem = (next: ShapeHover | null) => {\n if (!scene || !next) return;\n const anchor = hoverAnchor(scene, next) ?? { x: 0, y: 0 };\n setHover(next, anchor.x, anchor.y, true);\n dom.live.textContent = describeItem(scene, next);\n };\n\n const onKeyDown = (event: KeyboardEvent) => {\n if (!scene) return;\n const current = hover?.hover ?? null;\n const keys: Record<string, \"next\" | \"prev\" | \"up\" | \"down\"> = {\n ArrowRight: \"next\",\n ArrowLeft: \"prev\",\n ArrowUp: \"up\",\n ArrowDown: \"down\",\n };\n const direction = keys[event.key];\n if (direction) {\n event.preventDefault();\n focusItem(stepHover(scene, current, direction));\n return;\n }\n switch (event.key) {\n case \"Home\":\n case \"End\": {\n const items = scene.items;\n if (!items.length) return;\n event.preventDefault();\n const it = event.key === \"Home\" ? items[0] : items[items.length - 1];\n focusItem(\n scene.type === \"radar\"\n ? { index: it.index, indicator: current?.indicator ?? 0 }\n : { index: it.index },\n );\n break;\n }\n case \"Enter\":\n case \" \": {\n if (!current) return;\n const e = hoverEvent(scene, current);\n if (!e) return;\n event.preventDefault();\n emit(\"click\", e);\n break;\n }\n case \"Escape\":\n if (hover) {\n event.preventDefault();\n setHover(null, 0, 0, false);\n }\n break;\n default:\n break;\n }\n };\n\n const onFocus = () => {\n let visible: boolean;\n try {\n visible = dom.stage.matches(\":focus-visible\");\n } catch {\n visible = true;\n }\n // inset, like an outline drawn inside the stage edge: the drawing keeps a\n // padding, so the ring never covers labels or leader lines\n if (visible)\n dom.stage.style.boxShadow =\n \"inset 0 0 0 2px var(--primary-color, #4f46e5)\";\n };\n\n const onBlur = () => {\n dom.stage.style.boxShadow = \"\";\n if (hover?.keyboard) setHover(null, 0, 0, false);\n };\n\n const stage = dom.stage;\n stage.addEventListener(\"pointermove\", onPointerMove);\n stage.addEventListener(\"pointerdown\", onPointerDown);\n stage.addEventListener(\"pointerup\", onPointerUp);\n stage.addEventListener(\"pointercancel\", onPointerCancel);\n stage.addEventListener(\"pointerleave\", onPointerLeave);\n stage.addEventListener(\"keydown\", onKeyDown);\n stage.addEventListener(\"focus\", onFocus);\n stage.addEventListener(\"blur\", onBlur);\n\n const resizeObserver =\n typeof ResizeObserver === \"function\"\n ? new ResizeObserver(() => schedule())\n : null;\n resizeObserver?.observe(dom.stage);\n\n const refreshTheme = () => {\n if (destroyed) return;\n theme = readTheme(dom.root, options.palette);\n renderLegend();\n tipKey = \"\";\n schedule();\n };\n const unwatchTheme = watchTheme(refreshTheme);\n\n renderLegend();\n updateAccessibility();\n render();\n\n return {\n setOptions(next) {\n if (destroyed) return;\n const previous = options;\n options = next;\n runtime.setOptions(next);\n if ((next.palette ?? []).join() !== (previous.palette ?? []).join())\n theme = readTheme(dom.root, next.palette);\n if (next.type !== previous.type && hover) setHover(null, 0, 0, false);\n renderLegend();\n updateAccessibility();\n tipKey = \"\";\n schedule();\n },\n resize() {\n if (destroyed) return;\n cancelFrame();\n render();\n },\n refreshTheme,\n toggle,\n getHidden: () => runtime.hiddenIndexes(),\n on(type, listener) {\n listeners[type].add(listener);\n return () => {\n listeners[type].delete(listener);\n };\n },\n destroy() {\n if (destroyed) return;\n destroyed = true;\n cancelFrame();\n stage.removeEventListener(\"pointermove\", onPointerMove);\n stage.removeEventListener(\"pointerdown\", onPointerDown);\n stage.removeEventListener(\"pointerup\", onPointerUp);\n stage.removeEventListener(\"pointercancel\", onPointerCancel);\n stage.removeEventListener(\"pointerleave\", onPointerLeave);\n stage.removeEventListener(\"keydown\", onKeyDown);\n stage.removeEventListener(\"focus\", onFocus);\n stage.removeEventListener(\"blur\", onBlur);\n resizeObserver?.disconnect();\n unwatchTheme();\n listeners.hover.clear();\n listeners.click.clear();\n listeners.toggle.clear();\n dom.root.remove();\n },\n };\n};\n"],"mappings":";;;;;;;;AAkCA,IAAMC,KAAW,GAEbC,KAAM,GAaGC,KACX,GACA,MACuB;CACvB,IAAMC,IAAMC,EAAU,eAChBC,IAAMF,EAAI,aACVG,IAAMC,EAAeH,CAAS;CAGpC,AAFAE,EAAI,KAAK,UAAU,IAAI,qBAAqB,GAC5C,EAAI,WAAW,MAAM,UAAU,QAC/B,EAAI,MAAM,MAAM,UAAU;CAC1B,IAAME,IAASF,EAAI,YACfG,IAAuC;CAC3C,IAAI;EACF,IAAMD,EAAO,WAAW,IAAI;CAC9B,QAAQ;EACN,IAAM;CACR;CAEA,IAAME,IAAUC,GAAmBC,CAAO,GACtCC,IAAUD,GACVE,IAAoBC,EAAUT,EAAI,MAAMO,EAAQ,OAAO,GACvDG,IAA2B,MAC3BC,IAA2B,MAC3BC,IAAS,IACTC,IAAY,IACZC,IAAyB,MACzBC,IAAiB,IACjBC,IAMO,MAELC,IAIF;EAAE,uBAAO,IAAI,IAAI;EAAG,uBAAO,IAAI,IAAI;EAAG,wBAAQ,IAAI,IAAI;CAAE,GACtDC,KACJ,GACA,MACG;EACH,KAAK,IAAMC,KAAY,CAAC,GAAGF,EAAUG,EAAK,GAAG,EAASC,CAAK;CAC7D,GAGMC,IAAczB,EAAI,cAAc,KAAK;CAa3C,AAZA,EAAY,KAAK,uBAAuB,EAAEF,MAC1CF,EAAa6B,GAAa;EACxB,UAAU;EACV,OAAO;EACP,QAAQ;EACR,UAAU;EACV,MAAM;EACN,UAAU;EACV,YAAY;CACd,CAAC,GACDtB,EAAI,MAAM,YAAYsB,CAAW,GACjCtB,EAAI,MAAM,aAAa,oBAAoBsB,EAAY,EAAE,GACzD,EAAI,MAAM,WAAW;CAErB,IAAIC,IAAU,IACRC,MAAwB,GAAM,MAC7BrB,KACDsB,MAAMF,MACR,EAAI,OAAOE,GACX,IAAUA,IAELtB,EAAI,YAAYuB,CAAI,C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WAAW,GAC3BE,GAAa,GACb7F,EAAU,MAAM,MAAM,GACtBA,EAAU,MAAM,MAAM,GACtBA,EAAU,OAAO,MAAM,GACvBjB,EAAI,KAAK,OAAO;EAClB;CACF;AACF"}
|
|
1
|
+
{"version":3,"file":"chart.js","names":["assign","TAP_SLOP","uid","createShapeChart","doc","container","win","dom","createChartDom","canvas","ctx","runtime","createShapeRuntime","initial","options","theme","readTheme","scene","hover","tipKey","destroyed","frameId","frameIsTimeout","press","listeners","emit","listener","type","event","description","fontSet","measure","f","text","estimateText","cancelFrame","schedule","render","tooltipOptions","tooltipNode","custom","content","tooltipContent","fragment","header","swatch","row","el","n","v","updateTooltip","tip","hoverEvent","key","force","anchor","hoverAnchor","stageW","stageH","left","top","placeShapeTooltip","setHover","changed","sameHover","next","keyboard","width","height","dpr","pw","ph","frame","now","it","drawShapeScene","describeScene","renderLegend","entries","shapeLegend","config","legendConfig","focused","bottom","entry","item","toggle","updateAccessibility","describeChart","index","drill","path","activate","hit","local","rect","hitAt","hitTestShapes","x","y","onPointerMove","onPointerDown","onPointerUp","p","onPointerCancel","onPointerLeave","focusItem","describeItem","onKeyDown","current","direction","stepHover","items","e","onFocus","visible","onBlur","stage","resizeObserver","refreshTheme","unwatchTheme","watchTheme","previous"],"sources":["../../../../../charts/src/engine/shapes/chart.ts"],"sourcesContent":["// createShapeChart: DOM host of the shape charts. One Canvas2D layer sized\n// with the device pixel ratio, the house legend / tooltip / live region of\n// createChartDom, pointer + keyboard interaction, resize and theme watching.\n\nimport { createChartDom, styleElement, swatch } from \"../dom\";\nimport { readTheme, watchTheme, type ChartTheme } from \"../theme\";\nimport { drawShapeScene } from \"./draw\";\nimport { hitTestShapes, hoverAnchor, stepHover } from \"./hit\";\nimport {\n describeChart,\n describeItem,\n describeScene,\n hoverEvent,\n legendConfig,\n placeShapeTooltip,\n sameHover,\n shapeLegend,\n tooltipContent,\n} from \"./layout\";\nimport { createShapeRuntime, now } from \"./runtime\";\nimport {\n estimateText,\n type MeasureText,\n type ShapeHover,\n type ShapeScene,\n} from \"./scene\";\nimport type {\n ShapeChartEventMap,\n ShapeChartInstance,\n ShapeChartOptions,\n ShapeHoverEvent,\n} from \"./types\";\n\n/** Pointer travel (px) under which a press counts as a click / tap */\nconst TAP_SLOP = 6;\n\nlet uid = 0;\n\ninterface HoverState {\n hover: ShapeHover;\n x: number;\n y: number;\n keyboard: boolean;\n}\n\n/**\n * Creates a pie / donut, radar, gauge, funnel, treemap, sankey, sunburst,\n * radial bar, calendar heatmap or bullet chart in `container` (drawn with\n * Canvas2D, themed by the Minerva CSS variables).\n */\nexport const createShapeChart = (\n container: HTMLElement,\n initial: ShapeChartOptions,\n): ShapeChartInstance => {\n const doc = container.ownerDocument;\n const win = doc.defaultView;\n const dom = createChartDom(container);\n dom.root.classList.add(\"minerva-shape-chart\");\n dom.foreground.style.display = \"none\";\n dom.hover.style.display = \"none\";\n const canvas = dom.background;\n let ctx: CanvasRenderingContext2D | null = null;\n try {\n ctx = canvas.getContext(\"2d\");\n } catch {\n ctx = null;\n }\n\n const runtime = createShapeRuntime(initial);\n let options = initial;\n let theme: ChartTheme = readTheme(dom.root, options.palette);\n let scene: ShapeScene | null = null;\n let hover: HoverState | null = null;\n let tipKey = \"\";\n let destroyed = false;\n let frameId: number | null = null;\n let frameIsTimeout = false;\n let press: {\n x: number;\n y: number;\n id: number;\n touch: boolean;\n moved: boolean;\n } | null = null;\n\n const listeners: {\n [K in keyof ShapeChartEventMap]: Set<\n (event: ShapeChartEventMap[K]) => void\n >;\n } = {\n hover: new Set(),\n click: new Set(),\n toggle: new Set(),\n drill: new Set(),\n };\n const emit = <K extends keyof ShapeChartEventMap>(\n type: K,\n event: ShapeChartEventMap[K],\n ) => {\n for (const listener of [...listeners[type]]) listener(event);\n };\n\n // screen-reader summary of the data\n const description = doc.createElement(\"div\");\n description.id = `minerva-shape-chart-${++uid}`;\n styleElement(description, {\n position: \"absolute\",\n width: \"1px\",\n height: \"1px\",\n overflow: \"hidden\",\n clip: \"rect(0 0 0 0)\",\n clipPath: \"inset(50%)\",\n whiteSpace: \"nowrap\",\n });\n dom.stage.appendChild(description);\n dom.stage.setAttribute(\"aria-describedby\", description.id);\n dom.stage.tabIndex = 0;\n\n let fontSet = \"\";\n const measure: MeasureText = (text, f) => {\n if (!ctx) return estimateText(text, f);\n if (f !== fontSet) {\n ctx.font = f;\n fontSet = f;\n }\n return ctx.measureText(text).width;\n };\n\n // ------------------------------------------------------------- frames\n\n const cancelFrame = () => {\n if (frameId === null) return;\n if (frameIsTimeout) clearTimeout(frameId);\n else win?.cancelAnimationFrame?.(frameId);\n frameId = null;\n };\n\n const schedule = () => {\n if (destroyed || frameId !== null) return;\n if (win && typeof win.requestAnimationFrame === \"function\") {\n frameIsTimeout = false;\n frameId = win.requestAnimationFrame(() => render());\n } else {\n frameIsTimeout = true;\n frameId = setTimeout(() => render(), 16) as unknown as number;\n }\n };\n\n const tooltipOptions = () =>\n options.tooltip === false\n ? null\n : typeof options.tooltip === \"object\"\n ? options.tooltip\n : {};\n\n const tooltipNode = (event: ShapeHoverEvent): Node | string | null => {\n const custom = tooltipOptions()?.render;\n if (custom) return custom(event);\n if (!scene || !hover) return null;\n const content = tooltipContent(scene, hover.hover);\n if (!content) return null;\n const fragment = doc.createDocumentFragment();\n const header = doc.createElement(\"div\");\n styleElement(header, {\n display: \"flex\",\n alignItems: \"center\",\n gap: \"6px\",\n fontWeight: \"600\",\n marginBottom: \"4px\",\n color: \"var(--text-color, #1f2937)\",\n // long titles (full names of truncated labels) wrap\n whiteSpace: \"normal\",\n maxWidth: \"260px\",\n overflowWrap: \"anywhere\",\n });\n if (content.color) header.appendChild(swatch(doc, content.color, \"dot\"));\n header.appendChild(doc.createTextNode(content.title));\n fragment.append(header);\n for (const row of content.rows) {\n const el = doc.createElement(\"div\");\n styleElement(el, { display: \"flex\", alignItems: \"center\", gap: \"8px\" });\n if (row.color) el.appendChild(swatch(doc, row.color, \"dot\"));\n const n = doc.createElement(\"span\");\n styleElement(n, {\n flex: \"1 1 auto\",\n color: row.strong\n ? \"var(--text-color, #1f2937)\"\n : \"var(--text-secondary-color, #6b7280)\",\n fontWeight: row.strong ? \"600\" : \"400\",\n });\n n.textContent = row.name;\n const v = doc.createElement(\"span\");\n styleElement(v, {\n fontWeight: \"600\",\n fontVariantNumeric: \"tabular-nums\",\n marginLeft: \"12px\",\n });\n v.textContent = row.value;\n el.append(n, v);\n fragment.append(el);\n }\n return fragment;\n };\n\n /** Fills (when the hovered item changed) and places the tooltip */\n const updateTooltip = (force = false) => {\n const tip = dom.tooltip;\n const event = scene && hover ? hoverEvent(scene, hover.hover) : null;\n if (!event || !scene || !hover || !tooltipOptions() || press?.moved) {\n tip.style.display = \"none\";\n tipKey = \"\";\n return;\n }\n const key = `${event.index}:${event.indicator ?? \"\"}`;\n if (force || key !== tipKey) {\n tipKey = key;\n const content = tooltipNode(event);\n if (content === null || content === \"\") {\n tip.replaceChildren();\n tipKey = \"\";\n tip.style.display = \"none\";\n return;\n }\n if (typeof content === \"string\") {\n tip.textContent = content;\n tip.style.whiteSpace = \"pre\";\n } else {\n tip.replaceChildren(content);\n tip.style.whiteSpace = \"nowrap\";\n }\n } else if (!tip.firstChild) {\n return;\n }\n tip.style.display = \"block\";\n const anchor = hover.keyboard\n ? (hoverAnchor(scene, hover.hover) ?? hover)\n : hover;\n const stageW = dom.stage.clientWidth;\n const stageH = dom.stage.clientHeight;\n const { x: left, y: top } = placeShapeTooltip(\n scene,\n hover.hover,\n anchor,\n tip.offsetWidth,\n tip.offsetHeight,\n stageW,\n stageH,\n );\n tip.style.transform = `translate(${Math.round(left)}px, ${Math.round(top)}px)`;\n };\n\n const setHover = (\n next: ShapeHover | null,\n x: number,\n y: number,\n keyboard: boolean,\n ) => {\n const changed = !sameHover(hover?.hover ?? null, next);\n hover = next ? { hover: next, x, y, keyboard } : null;\n dom.stage.style.cursor = next && !keyboard ? \"pointer\" : \"\";\n updateTooltip();\n if (!changed) return;\n schedule();\n emit(\"hover\", scene && next ? hoverEvent(scene, next) : null);\n };\n\n function render() {\n frameId = null;\n if (destroyed) return;\n const width = dom.stage.clientWidth;\n const height = dom.stage.clientHeight;\n if (!(width > 0 && height > 0)) return;\n const dpr = win?.devicePixelRatio || 1;\n const pw = Math.max(1, Math.round(width * dpr));\n const ph = Math.max(1, Math.round(height * dpr));\n if (canvas.width !== pw) canvas.width = pw;\n if (canvas.height !== ph) canvas.height = ph;\n canvas.style.width = `${width}px`;\n canvas.style.height = `${height}px`;\n fontSet = \"\";\n const frame = runtime.frame(now(), { theme, width, height, measure });\n scene = frame.scene;\n if (hover && !scene.items.some((it) => it.index === hover?.hover.index)) {\n hover = null;\n dom.stage.style.cursor = \"\";\n emit(\"hover\", null);\n }\n if (ctx) {\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.clearRect(0, 0, pw, ph);\n ctx.setTransform(dpr, 0, 0, dpr, 0, 0);\n drawShapeScene(ctx, scene, hover?.hover ?? null);\n fontSet = \"\";\n }\n updateTooltip();\n if (!frame.animating) {\n const text = describeScene(scene);\n if (description.textContent !== text) description.textContent = text;\n } else schedule();\n }\n\n // ------------------------------------------------------------- legend\n\n const renderLegend = () => {\n const entries = shapeLegend(options, theme, runtime.hidden);\n const config = legendConfig(options);\n const focused = [...dom.legend.children].indexOf(\n doc.activeElement as Element,\n );\n dom.legend.replaceChildren();\n dom.legend.style.display = entries ? \"flex\" : \"none\";\n if (!entries) return;\n const bottom = config.position === \"bottom\";\n dom.legend.style.order = bottom ? \"1\" : \"0\";\n dom.legend.style.padding = bottom ? \"8px 4px 0\" : \"0 4px 8px\";\n dom.legend.style.justifyContent = \"center\";\n for (const entry of entries) {\n const item = doc.createElement(config.toggle ? \"button\" : \"span\");\n if (item instanceof HTMLButtonElement) {\n item.type = \"button\";\n item.setAttribute(\"aria-pressed\", String(!entry.hidden));\n item.addEventListener(\"click\", () => toggle(entry.index));\n }\n styleElement(item, {\n display: \"inline-flex\",\n alignItems: \"center\",\n gap: \"6px\",\n padding: \"2px 4px\",\n margin: \"0\",\n border: \"0\",\n borderRadius: \"4px\",\n background: \"none\",\n font: \"inherit\",\n color: \"var(--text-secondary-color, #6b7280)\",\n cursor: config.toggle ? \"pointer\" : \"default\",\n opacity: entry.hidden ? \"0.45\" : \"1\",\n textDecoration: entry.hidden ? \"line-through\" : \"none\",\n transition: \"opacity 120ms ease-out\",\n });\n item.append(\n swatch(doc, entry.color, \"dot\"),\n doc.createTextNode(entry.name),\n );\n dom.legend.appendChild(item);\n }\n if (focused >= 0)\n (dom.legend.children[focused] as HTMLElement | undefined)?.focus();\n };\n\n const updateAccessibility = () => {\n dom.stage.setAttribute(\n \"aria-label\",\n options.ariaLabel ?? describeChart(options),\n );\n };\n\n function toggle(index: number) {\n if (destroyed) return;\n const event = runtime.toggle(index);\n if (!event) return;\n if (!options.hidden) {\n renderLegend();\n tipKey = \"\";\n schedule();\n }\n emit(\"toggle\", event);\n }\n\n function drill(path: readonly string[]) {\n if (destroyed) return;\n const event = runtime.drill(path);\n if (!event) return;\n if (options.type === \"sunburst\" && !options.drillPath) {\n tipKey = \"\";\n schedule();\n }\n emit(\"drill\", event);\n }\n\n /** Sunburst: drills into / out of an activated item */\n const activate = (hit: ShapeHover) => {\n if (options.type !== \"sunburst\" || options.drill === false || !scene)\n return;\n const item = scene.items.find((it) => it.index === hit.index);\n if (item?.drill) drill(item.drill);\n };\n\n // -------------------------------------------------------- interaction\n\n const local = (event: { clientX: number; clientY: number }) => {\n const rect = dom.stage.getBoundingClientRect();\n return { x: event.clientX - rect.left, y: event.clientY - rect.top };\n };\n\n const hitAt = (x: number, y: number) =>\n scene ? hitTestShapes(scene, x, y, hover?.hover ?? null) : null;\n\n const onPointerMove = (event: PointerEvent) => {\n const { x, y } = local(event);\n if (press && press.id === event.pointerId) {\n if (Math.hypot(x - press.x, y - press.y) > TAP_SLOP) press.moved = true;\n if (press.touch) return;\n } else if (event.pointerType === \"touch\") return;\n setHover(hitAt(x, y), x, y, false);\n };\n\n const onPointerDown = (event: PointerEvent) => {\n const { x, y } = local(event);\n press = {\n x,\n y,\n id: event.pointerId,\n touch: event.pointerType === \"touch\",\n moved: false,\n };\n };\n\n const onPointerUp = (event: PointerEvent) => {\n const p = press;\n press = null;\n if (!p || p.id !== event.pointerId || p.moved) {\n updateTooltip();\n return;\n }\n const { x, y } = local(event);\n const hit = hitAt(x, y);\n // a tap shows the tooltip (there is no hover on touch screens)\n setHover(hit, x, y, false);\n if (hit && scene) {\n const e = hoverEvent(scene, hit);\n if (e) emit(\"click\", e);\n activate(hit);\n }\n };\n\n const onPointerCancel = () => {\n press = null;\n updateTooltip();\n };\n\n const onPointerLeave = (event: PointerEvent) => {\n if (event.pointerType === \"touch\") return;\n press = null;\n if (hover && !hover.keyboard) setHover(null, 0, 0, false);\n };\n\n const focusItem = (next: ShapeHover | null) => {\n if (!scene || !next) return;\n const anchor = hoverAnchor(scene, next) ?? { x: 0, y: 0 };\n setHover(next, anchor.x, anchor.y, true);\n dom.live.textContent = describeItem(scene, next);\n };\n\n const onKeyDown = (event: KeyboardEvent) => {\n if (!scene) return;\n const current = hover?.hover ?? null;\n const keys: Record<string, \"next\" | \"prev\" | \"up\" | \"down\"> = {\n ArrowRight: \"next\",\n ArrowLeft: \"prev\",\n ArrowUp: \"up\",\n ArrowDown: \"down\",\n };\n const direction = keys[event.key];\n if (direction) {\n event.preventDefault();\n focusItem(stepHover(scene, current, direction));\n return;\n }\n switch (event.key) {\n case \"Home\":\n case \"End\": {\n const items = scene.items;\n if (!items.length) return;\n event.preventDefault();\n const it = event.key === \"Home\" ? items[0] : items[items.length - 1];\n focusItem(\n scene.type === \"radar\"\n ? { index: it.index, indicator: current?.indicator ?? 0 }\n : { index: it.index },\n );\n break;\n }\n case \"Enter\":\n case \" \": {\n if (!current) return;\n const e = hoverEvent(scene, current);\n if (!e) return;\n event.preventDefault();\n emit(\"click\", e);\n activate(current);\n break;\n }\n case \"Backspace\": {\n if (options.type !== \"sunburst\" || options.drill === false) return;\n const path = runtime.drillPath();\n if (!path.length) return;\n event.preventDefault();\n drill(path.slice(0, -1));\n break;\n }\n case \"Escape\":\n if (hover) {\n event.preventDefault();\n setHover(null, 0, 0, false);\n }\n break;\n default:\n break;\n }\n };\n\n const onFocus = () => {\n let visible: boolean;\n try {\n visible = dom.stage.matches(\":focus-visible\");\n } catch {\n visible = true;\n }\n // inset, like an outline drawn inside the stage edge: the drawing keeps a\n // padding, so the ring never covers labels or leader lines\n if (visible)\n dom.stage.style.boxShadow =\n \"inset 0 0 0 2px var(--primary-color, #4f46e5)\";\n };\n\n const onBlur = () => {\n dom.stage.style.boxShadow = \"\";\n if (hover?.keyboard) setHover(null, 0, 0, false);\n };\n\n const stage = dom.stage;\n stage.addEventListener(\"pointermove\", onPointerMove);\n stage.addEventListener(\"pointerdown\", onPointerDown);\n stage.addEventListener(\"pointerup\", onPointerUp);\n stage.addEventListener(\"pointercancel\", onPointerCancel);\n stage.addEventListener(\"pointerleave\", onPointerLeave);\n stage.addEventListener(\"keydown\", onKeyDown);\n stage.addEventListener(\"focus\", onFocus);\n stage.addEventListener(\"blur\", onBlur);\n\n const resizeObserver =\n typeof ResizeObserver === \"function\"\n ? new ResizeObserver(() => schedule())\n : null;\n resizeObserver?.observe(dom.stage);\n\n const refreshTheme = () => {\n if (destroyed) return;\n theme = readTheme(dom.root, options.palette);\n renderLegend();\n tipKey = \"\";\n schedule();\n };\n const unwatchTheme = watchTheme(refreshTheme);\n\n renderLegend();\n updateAccessibility();\n render();\n\n return {\n setOptions(next) {\n if (destroyed) return;\n const previous = options;\n options = next;\n runtime.setOptions(next);\n if ((next.palette ?? []).join() !== (previous.palette ?? []).join())\n theme = readTheme(dom.root, next.palette);\n if (next.type !== previous.type && hover) setHover(null, 0, 0, false);\n renderLegend();\n updateAccessibility();\n tipKey = \"\";\n schedule();\n },\n resize() {\n if (destroyed) return;\n cancelFrame();\n render();\n },\n refreshTheme,\n toggle,\n getHidden: () => runtime.hiddenIndexes(),\n drill,\n getDrillPath: () => runtime.drillPath(),\n on(type, listener) {\n listeners[type].add(listener);\n return () => {\n listeners[type].delete(listener);\n };\n },\n destroy() {\n if (destroyed) return;\n destroyed = true;\n cancelFrame();\n stage.removeEventListener(\"pointermove\", onPointerMove);\n stage.removeEventListener(\"pointerdown\", onPointerDown);\n stage.removeEventListener(\"pointerup\", onPointerUp);\n stage.removeEventListener(\"pointercancel\", onPointerCancel);\n stage.removeEventListener(\"pointerleave\", onPointerLeave);\n stage.removeEventListener(\"keydown\", onKeyDown);\n stage.removeEventListener(\"focus\", onFocus);\n stage.removeEventListener(\"blur\", onBlur);\n resizeObserver?.disconnect();\n unwatchTheme();\n listeners.hover.clear();\n listeners.click.clear();\n listeners.toggle.clear();\n listeners.drill.clear();\n dom.root.remove();\n },\n };\n};\n"],"mappings":";;;;;;;;AAkCA,IAAMC,KAAW,GAEbC,KAAM,GAcGC,KACX,GACA,MACuB;CACvB,IAAMC,IAAMC,EAAU,eAChBC,IAAMF,EAAI,aACVG,IAAMC,EAAeH,CAAS;CAGpC,AAFAE,EAAI,KAAK,UAAU,IAAI,qBAAqB,GAC5C,EAAI,WAAW,MAAM,UAAU,QAC/B,EAAI,MAAM,MAAM,UAAU;CAC1B,IAAME,IAASF,EAAI,YACfG,IAAuC;CAC3C,IAAI;EACF,IAAMD,EAAO,WAAW,IAAI;CAC9B,QAAQ;EACN,IAAM;CACR;CAEA,IAAME,IAAUC,GAAmBC,CAAO,GACtCC,IAAUD,GACVE,IAAoBC,EAAUT,EAAI,MAAMO,EAAQ,OAAO,GACvDG,IAA2B,MAC3BC,IAA2B,MAC3BC,IAAS,IACTC,IAAY,IACZC,IAAyB,MACzBC,IAAiB,IACjBC,IAMO,MAELC,IAIF;EACF,uBAAO,IAAI,IAAI;EACf,uBAAO,IAAI,IAAI;EACf,wBAAQ,IAAI,IAAI;EAChB,uBAAO,IAAI,IAAI;CACjB,GACMC,KACJ,GACA,MACG;EACH,KAAK,IAAMC,KAAY,CAAC,GAAG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,MAAM,MAAM,GACtBA,EAAU,MAAM,MAAM,GACtBA,EAAU,OAAO,MAAM,GACvBA,EAAU,MAAM,MAAM,GACtBjB,EAAI,KAAK,OAAO;EAClB;CACF;AACF"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const e=require("../color.cjs"),t=require("../overlay.cjs"),n=require("./labels.cjs"),r=require("./scene.cjs");var i=e=>{let t=[],n=[],i=new Map;for(let r of e.groups??[]){let e=typeof r==`string`?{name:r}:r;e&&typeof e.name==`string`&&(i.has(e.name)||i.set(e.name,t.length),t.push(e.name),n.push(e.color))}let a=new Map;if(e.links){let o=t.length,s=e=>{if(typeof e==`number`)return Number.isInteger(e)&&e>=0&&e<o?e:-1;if(typeof e!=`string`)return-1;let r=i.get(e);return r===void 0?(i.set(e,t.length),t.push(e),n.push(void 0),t.length-1):r},c=[];for(let t of e.links){if(!t)continue;let e=s(t.source),n=s(t.target);e<0||n<0||c.push([e,n,r.positive(t.value),t.color])}let l=t.length,u=t.map(()=>Array(l).fill(0));for(let[e,t,n,r]of c)u[e][t]+=n,r&&a.set(e*l+t,r);return{names:t,colors:n,matrix:u,cellColors:a}}let o=e.matrix??[],s=Math.max(t.length,o.length);for(let e=t.length;e<s;e++)t.push(String(e+1)),n.push(void 0);return{names:t,colors:n,matrix:t.map((e,n)=>t.map((e,t)=>r.positive(o[n]?.[t]))),cellColors:a}},a=e=>{let t=r.uniqueKeys(e.names);return{group:e=>`~${t[e]}`,cell:(e,n)=>`${t[e]}\u2192${t[n]}`}},o=(e,t,n,r)=>e.matrix[n][r]>0&&!(t&&n===r),s=(e,t,n)=>{let r=i(e),s=a(r),c=!!e.directed;r.names.forEach((e,i)=>{n.set(s.group(i),+!t.has(i)),r.names.forEach((e,a)=>{o(r,c,i,a)&&n.set(s.cell(i,a),t.has(i)||t.has(a)?0:r.matrix[i][a])})})},c=(e,t)=>{let n=e.length,r=Array(n).fill(0),i=Array(n).fill(0);for(let a=0;a<n;a++)for(let o=0;o<n;o++)t&&a===o||(r[a]+=e[a][o],i[o]+=e[a][o]);return{out:r,inc:i,value:r.map((e,n)=>t?e+i[n]:e)}},l=e=>{if(!(e>0)||!Number.isFinite(e))return 0;let t=10**Math.floor(Math.log10(e));for(let n of[1,2,5,10])if(n*t>=e*(1-1e-9))return n*t;return 10*t},u=12,d=22,f=(s,f)=>{let{theme:p,area:m,measure:h,hidden:g}=f,_=i(s),{names:v,matrix:y}=_,b=v.length;if(!b)return r.emptyLayout(f);let x=!!s.directed,ee=a(_),S=(e,t)=>o(_,x,e,t),te=y.map((e,t)=>e.map((e,n)=>S(t,n)?Math.max(0,f.value(ee.cell(t,n),g.has(t)||g.has(n)?0:e)):0)),C=y.map((e,t)=>e.map((e,n)=>S(t,n)&&!g.has(t)&&!g.has(n)?e:0)),w=c(te,x),T=c(C,x),ne=T.value.reduce((e,t)=>e+t,0),E=v.map((e,t)=>T.value[t]>0||w.value[t]>1e-9?r.clamp(f.value(ee.group(t),+!g.has(t)),0,1):0),D=w.value.reduce((e,t)=>e+t,0);if(D<=1e-12)return r.emptyLayout(f);let O=c(y.map((e,t)=>e.map((e,n)=>S(t,n)?e:0)),x).value,k=v.map((e,t)=>t);if(s.sortGroups===`ascending`||s.sortGroups===`descending`){let e=s.sortGroups===`ascending`?1:-1;k.sort((t,n)=>e*(O[t]-O[n])||t-n)}let A=Array(b);k.forEach((e,t)=>A[e]=t);let j=m.x+m.width/2,M=m.y+m.height/2,N=Math.min(m.width,m.height)/2,P=s.labels??`auto`,F=t.font(p,u,500),re=t.font(p,10),I=s.ticks,ie=I===!1?!1:typeof I==`number`?I>0:N>=150,L=ie?d:0,R=r.clamp(r.finite(s.padAngle,2),0,45)*(Math.PI/180),z=R*E.reduce((e,t)=>e+t,0),B=z>r.TAU*.5?r.TAU*.5/z:1,V=(r.TAU-z*B)/D,ae=-Math.PI/2+r.finite(s.startAngle)*Math.PI/180,H=Array(b);{let e=ae+R*B*(E[k[0]]??0)/2;for(let t of k){let n=e,r=n+w.value[t]*V;H[t]={a0:n,a1:r},e=r+R*B*E[t]}}let U=e=>H[e].a1-H[e].a0>1e-6,oe=v.map(e=>h(e,F)),se=e=>k.every(t=>!U(t)||oe[t]+6<=(H[t].a1-H[t].a0+R*B*.8)*e),W=P===`none`?`none`:P===`radial`?`radial`:`tangential`;P===`auto`&&!se(Math.max(1,N-12))&&(W=`radial`);let ce=e=>{let t=Math.abs(Math.cos(e)),n=Math.abs(Math.sin(e));return Math.min(t>1e-6?(m.width/2-2)/t:1/0,n>1e-6?(m.height/2-u/2-1)/n:1/0)},le=e=>(H[e].a0+H[e].a1)/2,ue=e=>Math.abs(Math.sin(e))>.92,G;if(W===`radial`){G=N-L-8;for(let e of k)if(U(e)&&E[e]>.5){let t=le(e),n=ue(t)?14:oe[e];G=Math.min(G,ce(t)-n-L-10)}G=Math.max(N*.5,G)}else G=N-L-(W===`none`?0:22)-2;G=Math.max(16,G);let de=r.clamp(r.finite(s.arcWidth,r.clamp(G*.06,8,18)),2,G*.5),fe=G-de,K=Math.max(4,fe-2),q=v.map(()=>[]);for(let e=0;e<b;e++)for(let t=0;t<b;t++)x?S(e,t)&&(q[e].push({j:t,dir:`out`,raw:y[e][t],a0:0,a1:0}),q[t].push({j:e,dir:`in`,raw:y[e][t],a0:0,a1:0})):(S(e,t)||S(t,e))&&q[e].push({j:t,dir:`out`,raw:y[e][t],a0:0,a1:0});let J=s.sortSubgroups??`auto`;q.forEach((e,t)=>{let n=e=>{let n=(A[e]-A[t]+b)%b;return n===0?b/2:n};e.sort((e,t)=>{let r=Number(e.dir===`in`)-Number(t.dir===`in`);return J===`ascending`||J===`descending`?(J===`ascending`?1:-1)*(e.raw-t.raw)||A[e.j]-A[t.j]||r:J===`none`?A[e.j]-A[t.j]||r:n(t.j)-n(e.j)||r});let r=H[t].a0;for(let n of e){let e=n.dir===`out`?te[t][n.j]:te[n.j][t];n.a0=r,n.a1=r+e*V,r=n.a1}});let Y=(e,t,n)=>q[e].find(e=>e.j===t&&e.dir===n),X=v.map((e,t)=>f.color(_.colors[t],t)).map(t=>e.toCss(t)),pe=e.toCss(e.mix(p.grid,p.textMuted,.45)),me=s.ribbonColor??`gradient`,he=r.clamp(r.finite(s.ribbonOpacity,.65),.02,1),ge=Math.min(1,he+.25),_e=s.arrows??x?r.clamp(K*.07,5,12):0,Z=[],ve=(e,t)=>b+e*b+t;for(let e=0;e<b;e++)for(let t=x?0:e;t<b;t++)if(x){if(!S(e,t))continue;let n=Y(e,t,`out`),r=Y(t,e,`in`);n&&r&&Z.push({index:ve(e,t),s:e,t,src:n,tgt:r})}else{if(!S(e,t)&&!S(t,e))continue;let[n,r]=y[t][e]>y[e][t]?[t,e]:[e,t],i=Y(n,r,`out`),a=Y(r,n,`out`);i&&a&&Z.push({index:ve(n,r),s:n,t:r,src:i,tgt:a})}let Q=v.map(()=>[]);for(let e of Z)Q[e.s].push(e.index),e.t!==e.s&&Q[e.t].push(e.index);let $=[],ye=e=>e.src.a1-e.src.a0+(e.tgt.a1-e.tgt.a0);for(let t of Z.slice().sort((e,t)=>ye(t)-ye(e))){if(ye(t)<=1e-6)continue;let n=_.cellColors.get(t.s*b+t.t)??(x?void 0:_.cellColors.get(t.t*b+t.s)),r,i;n?r=i=e.toCss(f.color(n,t.s)):me===`source`?r=i=X[t.s]:me===`target`?r=i=X[t.t]:me===`neutral`?r=i=pe:(r=X[t.s],i=X[t.t]),$.push({kind:`ribbon`,cx:j,cy:M,r:K,s0:t.src.a0,s1:t.src.a1,t0:t.tgt.a0,t1:t.tgt.a1,head:t.s===t.t?0:_e,color0:r,color1:i,alpha:he,activeAlpha:ge,hit:t.index,also:t.s===t.t?[t.s]:[t.s,t.t]})}for(let e of k)U(e)&&$.push({kind:`sector`,cx:j,cy:M,r0:fe,r1:G,a0:H[e].a0,a1:H[e].a1,pad:0,corner:Math.min(2,de/4),fill:X[e],hit:e,also:Q[e],alpha:E[e]});let be=e.toCss(p.textMuted),xe=e.toCss(p.textMuted,.7);if(ie){let e=V*G,t=s.tickFormat??n.localeFormat(f.locale),i=h(t(Math.max(...O)),re)+14,a=typeof I==`number`?I:l(i/Math.max(e,1e-12)),o=D/Math.max(a,1e-12);(!(a>0)||o>240)&&(a=l(D/240));let c=a/5*e>=5?a/5:a/2*e>=5?a/2:a,u=Math.round(a/c),d=G+2,p=G+15,m=-1/0,g=null;for(let n of k){if(!U(n))continue;let{a0:i,a1:a}=H[n],o=Q[n];for(let s=0;;s++){let l=i+s*c*V;if(l>a+1e-9)break;let f=s%u===0,_=f?5:3;if((e*c>=3||f)&&$.push({kind:`line`,points:[j+d*Math.cos(l),M+d*Math.sin(l),j+(d+_)*Math.cos(l),M+(d+_)*Math.sin(l)],color:xe,width:1,hit:n,also:o}),!f)continue;let v=t(s*c),y=(h(v,re)/2+3)/p;l-y<m||g!==null&&l+y>g+r.TAU||(g===null&&(g=l-y),m=l+y,$.push({kind:`text`,x:j+p*Math.cos(l),y:M+p*Math.sin(l),text:v,font:re,color:be,align:`center`,baseline:`middle`,rotate:r.upright(l+Math.PI/2),hit:n,also:o}))}}}if(W!==`none`){let t=G+L+6,n=e.toCss(p.text),i=[],a=(e,t,n,r,i)=>{let a=[],o=Math.max(1,Math.ceil(i/6));for(let s=0;s<=o;s++)a.push([e+n*i*s/o,t+r*i*s/o]);return a},o=e=>i.some(t=>t.some(([t,n])=>e.some(([e,r])=>Math.hypot(t-e,n-r)<15))),s=k.filter(e=>U(e)&&E[e]>.5).sort((e,t)=>w.value[t]-w.value[e]);for(let e of s){let{a0:s,a1:c}=H[e],l=(s+c)/2;if(W===`tangential`){let i=(c-s+R*B*.8)*(t+6)-6,a=r.ellipsize(v[e],i,F,h);if(!a)continue;$.push({kind:`text`,x:j+(t+6)*Math.cos(l),y:M+(t+6)*Math.sin(l),text:a,font:F,color:n,align:`center`,baseline:`middle`,rotate:r.upright(l+Math.PI/2),hit:e,also:Q[e]});continue}let u=j+t*Math.cos(l),d=M+t*Math.sin(l);if(ue(l)){let s=d+Math.sign(Math.sin(l))*7,c=Math.cos(l)>=0?`left`:`right`,f=[`center`,c,c===`left`?`right`:`left`],p=e=>e.every(([e,n])=>Math.hypot(e-j,n-M)>=t+2);for(let t of f){let c=t===`center`?2*Math.min(u-m.x,m.x+m.width-u)-4:t===`left`?m.x+m.width-u-2:u-m.x-2,l=r.ellipsize(v[e],c,F,h);if(!l)continue;let d=h(l,F),f=a(t===`left`?u:t===`right`?u-d:u-d/2,s,1,0,d);if(p(f)&&!o(f)){i.push(f),$.push({kind:`text`,x:u,y:s,text:l,font:F,color:n,align:t,baseline:`middle`,hit:e,also:Q[e]});break}}continue}let f=r.ellipsize(v[e],ce(l)-t-2,F,h);if(!f)continue;let p=a(u,d,Math.cos(l),Math.sin(l),h(f,F));if(o(p))continue;i.push(p);let g=Math.cos(l)>=0;$.push({kind:`text`,x:u,y:d,text:f,font:F,color:n,align:g?`left`:`right`,baseline:`middle`,rotate:g?l:l+Math.PI,hit:e,also:Q[e]})}}let Se=[],Ce=x||y.some((e,t)=>e.some((e,n)=>Math.abs(e-y[n][t])>1e-12));for(let e of k){let t=T.value[e];if(!(t>0)||g.has(e))continue;let n=ne>0?t/ne:0,r=(H[e].a0+H[e].a1)/2;Se.push({index:e,name:v[e],value:t,percent:n,share:f.percent(n),color:X[e],x:j+G*Math.cos(r),y:M+G*Math.sin(r),rows:[...x||!Ce?[{name:f.labels.value,value:f.format(t)}]:[],...Ce?[{name:f.labels.outgoing,value:f.format(T.out[e])},{name:f.labels.incoming,value:f.format(T.inc[e])}]:[],{name:f.labels.share,value:f.percent(n)}]})}let we=C.reduce((e,t)=>e+t.reduce((e,t)=>e+t,0),0),Te=Z.filter(e=>C[e.s][e.t]>0||C[e.t][e.s]>0).sort((e,t)=>A[e.s]-A[t.s]||e.src.a0-t.src.a0||A[e.t]-A[t.t]);for(let e of Te){let t=C[e.s][e.t],n=e.s!==e.t&&C[e.s][e.t]+C[e.t][e.s]>0?y[e.t][e.s]:0,r=we>0?t/we:0,i=v[e.s],a=v[e.t],o=(e.src.a0+e.src.a1)/2,s=(e.tgt.a0+e.tgt.a1)/2,c=e.s===e.t?j+K*.7*Math.cos(o):.25*(j+K*Math.cos(o))+.5*j+.25*(j+K*Math.cos(s)),l=e.s===e.t?M+K*.7*Math.sin(o):.25*(M+K*Math.sin(o))+.5*M+.25*(M+K*Math.sin(s));Se.push({index:e.index,name:e.s===e.t?i:`${i} \u2192 ${a}`,value:t,percent:r,share:f.percent(r),color:X[e.s],x:c,y:l,rows:[{name:f.labels.value,value:f.format(t)},...e.s!==e.t&&(!x||n>0)?[{name:f.labels.reverse,value:f.format(n)}]:[],{name:f.labels.share,value:f.percent(r)}],event:{source:i,target:a,reverseValue:n}})}let Ee=r.clamp(f.enter,0,1);return{nodes:$,items:Se,dim:.25,empty:!1,...Ee<1?{enter:{alpha:Ee,scale:.94+.06*Ee,cx:j,cy:M}}:{}}};exports.chordValues=s,exports.layoutChord=f,exports.resolveChord=i;
|
|
2
|
+
//# sourceMappingURL=chord.cjs.map
|