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,2 +1,2 @@
|
|
|
1
|
-
const e=require("./data.cjs"),t=require("./dom.cjs"),n=require("./items.cjs"),r=require("./layout.cjs"),i=require("./model.cjs"),a=require("./overlay.cjs"),o=require("./renderers/detect.cjs"),s=require("./scene.cjs"),c=require("./signature.cjs"),l=require("./theme.cjs"),u=require("./viewport.cjs");var d=e=>(e[0]+e[1])/2,f=e=>({x:[e.x[0],e.x[1]],y:[e.y[0],e.y[1]]}),p=(p,m)=>{let h=p.ownerDocument,g=h.defaultView,_=t.createChartDom(p),ee=new Map,v=new Set,y={},b=m,x=l.readTheme(_.root,b.palette),S,C={x:[0,1],y:[0,1]},w=!1,T={x:0,y:0},te=[],E=!0,ne=0,D=[],O=null,k=null,A=null,j=null,re=0,M=!1,N=0,P=null,ie=``,F=null,I=null,L=null,ae=[],oe=[],R=[],z=0,se=``,ce=``,B=null,V=null,le=()=>{},ue=new Promise(e=>{le=e}),H=(e,t)=>{y[e]?.forEach(e=>e(t))},de=null,U=null,W=()=>{if(de===b)return U;de=b;let e=b.interaction;if(e===!1)return U=null;let t=typeof e==`object`?e:{};return U={zoom:t.zoom??!0,wheel:t.wheel??`modifier`,pan:t.pan??!0,keyboard:t.keyboard??!0,dragPoints:t.dragPoints??!1}},fe=()=>b.tooltip===!1?null:typeof b.tooltip==`object`?b.tooltip:{},G=()=>{M||N||(N=g?.requestAnimationFrame?g.requestAnimationFrame(ve):setTimeout(ve,16))},K=()=>{S=i.buildModel(b,x,v,ee);let{base:e,zoom:t,minSpan:n}=S;w?(C={x:t.x?u.clampRange(C.x,e.x,n.x):[...e.x],y:t.y?u.clampRange(C.y,e.y,n.y):[...e.y]},w=!u.sameRange(C.x,e.x)||!u.sameRange(C.y,e.y)):C=f(e);let r=c.itemsSignature(S,z,e=>b.series[e]?.stack);r!==se&&(se=r,T={x:d(e.x),y:d(e.y)},E=!0,P&&!P.keyboard&&(P=null)),D=s.resolveAnnotations(b.annotations,x),me(),he(),G()},pe=()=>{let e=(e,t)=>Math.max(Math.abs(e[0]-t),Math.abs(e[1]-t))>(e[1]-e[0])*2e3;(e(C.x,T.x)||e(C.y,T.y))&&(T={x:d(C.x),y:d(C.y)},E=!0)},me=()=>{let e=b.legend,n=b.series.filter(e=>e.name).length,r=e===void 0?n>1:!!e,i=typeof e==`object`?e:{},a=i.toggle??!0,o=i.position===`bottom`,c=`${r}|${o}|${a}`;if(r)for(let e of S.series)c+=`\n${e.id}\u0001${e.name}\u0001${e.colorCss}\u0001${s.legendShape(e.type)}\u0001${e.hidden}`;if(c===ce)return;ce=c;let l=[..._.legend.children].indexOf(h.activeElement);if(_.legend.replaceChildren(),_.legend.style.display=r?`flex`:`none`,r){_.legend.style.order=o?`1`:`0`,_.legend.style.padding=o?`8px 4px 0`:`0 4px 8px`;for(let e of S.series){let n=h.createElement(a?`button`:`span`);n instanceof HTMLButtonElement&&(n.type=`button`,n.setAttribute(`aria-pressed`,String(!e.hidden)),n.addEventListener(`click`,()=>{v.has(e.id)?v.delete(e.id):v.add(e.id),K()})),t.styleElement(n,{display:`inline-flex`,alignItems:`center`,gap:`6px`,padding:`2px 4px`,margin:`0`,border:`0`,borderRadius:`4px`,background:`none`,font:`inherit`,color:`var(--text-secondary-color, #6b7280)`,cursor:a?`pointer`:`default`,opacity:e.hidden?`0.45`:`1`,textDecoration:e.hidden?`line-through`:`none`}),n.append(t.swatch(h,e.colorCss,s.legendShape(e.type)),h.createTextNode(e.name)),_.legend.appendChild(n)}l>=0&&_.legend.children[l]?.focus()}},he=()=>{let e=S.series.map(e=>e.name).join(`, `);_.stage.setAttribute(`aria-label`,b.ariaLabel??(e?`Chart: ${e}`:`Chart`));let t=W()?.keyboard;_.stage.style.touchAction=W()?.dragPoints?`none`:`pan-y`,t?_.stage.tabIndex=0:_.stage.removeAttribute(`tabindex`)},ge=(e,t,n,r)=>{let i=Math.max(1,Math.round(t*r)),a=Math.max(1,Math.round(n*r));e.width!==i&&(e.width=i),e.height!==a&&(e.height=a),e.style.width=`${t}px`,e.style.height=`${n}px`},_e=(e,t,n)=>{let r=2/(e[1]-e[0]),i=(t-e[0])*r-1;return n?[-r,-i]:[r,i]};function ve(){if(N=0,M)return;let e=_.stage.clientWidth,r=_.stage.clientHeight;if(e<=0||r<=0)return;let i=g?.devicePixelRatio||1;ge(_.background,e,r,i),ge(_.foreground,e,r,i);let o=_.background.getContext(`2d`),c=_.foreground.getContext(`2d`);o&&(o.setTransform(i,0,0,i,0,0),o.font=a.font(x));let l=s.layoutChart({model:S,view:C,theme:x,width:e,height:r,padding:b.padding,measure:o?e=>o.measureText(e).width:e=>e.length*x.fontSize*.6}),{plot:u}=l;k=l.xTicks,A=l.yTicks,O=l.scales;let d=ye();if(d&&d.join()!==ie&&(ie=d.join(),H(`layout`,{x:d[0],y:d[1],width:d[2],height:d[3]})),o&&a.drawBackground(o,{width:e,height:r,scales:O,x:S.x,y:S.y,xTicks:k,yTicks:A,theme:x,annotations:D}),c&&(c.setTransform(i,0,0,i,0,0),a.drawForeground(c,{width:e,height:r,scales:O,theme:x,annotations:D,pointLabels:s.collectPointLabels(S,C,O,A)})),j){let e=j.canvas;t.styleElement(e,{left:`${u.x}px`,top:`${u.y}px`,width:`${u.width}px`,height:`${u.height}px`});let r=Math.max(1,Math.round(u.width*i)),a=Math.max(1,Math.round(u.height*i));(e.width!==r||e.height!==a)&&j.resize(r,a),pe(),E&&(ne++,te=n.buildItems(S,T,ne),E=!1);let[o,s]=_e(C.x,T.x,S.x.reverse),[c,l]=_e(C.y,T.y,S.y.reverse);j.render(te,{transform:{xScale:o,xOffset:s,yScale:c,yOffset:l},width:r,height:a,dpr:i})}Y()}let q=(e,t)=>O?s.hitTest(S,O,k,e,t):null,ye=()=>{let e=O?.plot;return e?[e.x+_.stage.offsetLeft,e.y+_.stage.offsetTop,e.width,e.height]:null},be=(e,t)=>W()?.dragPoints?q(e,t)?.items.find(e=>S.series[e.seriesIndex].type===`scatter`)??null:null,J=e=>{let t=!s.sameHover(P?.event??null,e?.event??null);P=e,Y(),t&&H(`hover`,e?e.event:null)},xe=e=>{let n=fe()?.render;if(n)return n(e);let r=s.tooltipContent(S,e,A),i=h.createDocumentFragment(),a=h.createElement(`div`);t.styleElement(a,{display:`flex`,alignItems:`center`,gap:`6px`,fontWeight:`600`,marginBottom:`4px`,color:`var(--text-color, #1f2937)`}),r.titleColor&&a.appendChild(t.swatch(h,r.titleColor,`dot`)),a.appendChild(h.createTextNode(r.title)),i.append(a);for(let e of r.rows){let n=h.createElement(`div`);t.styleElement(n,{display:`flex`,alignItems:`center`,gap:`8px`}),e.color&&n.appendChild(t.swatch(h,e.color,`dot`));let r=h.createElement(`span`);t.styleElement(r,{flex:`1 1 auto`,color:`var(--text-secondary-color, #6b7280)`}),r.textContent=e.name;let a=h.createElement(`span`);t.styleElement(a,{fontWeight:`600`,fontVariantNumeric:`tabular-nums`,marginLeft:`12px`}),a.textContent=e.value,n.append(r,a),i.append(n)}return i},Se=(e,t,n,r=_.hover)=>(e[t]||(e[t]=n(),r.appendChild(e[t])),e[t].style.display=`block`,e[t]);function Y(){let e=O;P&&e&&B&&B.scales===e&&B.model===S&&s.sameHover(B.event,P.event)||Ce(e);let t=_.tooltip;if(!P||!e||!fe()||L?.moved||F?.moved){t.style.display=`none`;return}let n=fe()?.render,r,i;if(!n&&V&&V.model===S&&V.yTicks===A&&s.sameHover(V.event,P.event)&&t.style.display===`block`)r=V.width,i=V.height;else{V=null;let e=xe(P.event);if(e===null||e===``){t.style.display=`none`;return}typeof e==`string`?(t.textContent=e,t.style.whiteSpace=`pre`):(t.replaceChildren(e),t.style.whiteSpace=`nowrap`),t.style.display=`block`,r=t.offsetWidth,i=t.offsetHeight,n||(V={event:P.event,model:S,yTicks:A,width:r,height:i})}let a=_.stage.clientWidth,o=_.stage.clientHeight,c=P.anchorX+16;c+r>a-4&&(c=P.anchorX-16-r),c=Math.max(4,Math.min(c,a-r-4));let l=Math.max(4,Math.min(P.anchorY-i/2,o-i-4));t.style.transform=`translate(${Math.round(c)}px, ${Math.round(l)}px)`}function Ce(e){let n=0,r=0,i=0;if(B=null,_.crosshair.style.display=`none`,P&&e){B={event:P.event,model:S,scales:e};let{plot:a}=e;if(_.hover.style.width=`${_.stage.clientWidth}px`,_.hover.style.height=`${_.stage.clientHeight}px`,s.showsCrosshair(S,P.event,b.crosshair)){let n=P.event.items[0],r=e.xToPx(n.x);r>=a.x&&r<=a.x+a.width&&t.styleElement(_.crosshair,{display:`block`,left:`${Math.round(r)}px`,top:`${a.y}px`,height:`${a.height}px`})}for(let a of s.hoverMarks(S,e,P.event)){if(a.kind===`band`||a.kind===`cell`){let e=a.kind===`band`?Se(oe,r++,()=>t.createBand(h),_.underlay):Se(R,i++,()=>t.styleElement(t.createBand(h),{background:`transparent`,borderRadius:`3px`,boxShadow:`0 0 0 1.5px var(--surface-color, var(--background-color, #fff)), 0 0 0 3px color-mix(in srgb, var(--text-color, #1f2937) 55%, transparent)`}));t.styleElement(e,{left:`${a.x}px`,top:`${a.y}px`,width:`${a.width}px`,height:`${a.height}px`});continue}let e=Se(ae,n++,()=>t.createMarker(h));t.styleElement(e,{left:`${a.x}px`,top:`${a.y}px`,width:`${a.size}px`,height:`${a.size}px`,background:a.color,boxShadow:`0 0 0 4px ${a.halo}`})}}for(let e=n;e<ae.length;e++)ae[e].style.display=`none`;for(let e=r;e<oe.length;e++)oe[e].style.display=`none`;for(let e=i;e<R.length;e++)R[e].style.display=`none`}let X=(e,t)=>{let{base:n,minSpan:r}=S;C={x:u.clampRange(e.x,n.x,r.x),y:u.clampRange(e.y,n.y,r.y)},w=!u.sameRange(C.x,n.x)||!u.sameRange(C.y,n.y);let i=W();_.stage.style.cursor=w&&i?.pan?`grab`:``,t&&H(`zoom`,f(C)),G()},we=(e,t,n)=>{let r=O;if(!r)return;let i=f(C);S.zoom.x&&(i.x=u.zoomRange(C.x,r.pxToX(e),n)),S.zoom.y&&(i.y=u.zoomRange(C.y,r.pxToY(t),n)),X(i,!0)},Z=e=>{let t=_.stage.getBoundingClientRect();return{x:e.clientX-t.left,y:e.clientY-t.top}},Q=(e,t)=>{let n=O?.plot;return!!n&&e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height},Te=(e,t)=>{let n=O;if(!n)return null;let{plot:r}=n,i=Math.max(r.x,Math.min(r.x+r.width,e)),a=Math.max(r.y,Math.min(r.y+r.height,t));return{x:n.pxToX(i),y:n.pxToY(a)}},Ee=(e,n,r)=>{if(r===null){I&&(I.style.display=`none`);return}I||(I=t.createMarker(h),_.hover.appendChild(I));let i=(S.series.find(e=>e.type===`scatter`)?.pointSize??8)+8;_.hover.style.width=`${_.stage.clientWidth}px`,_.hover.style.height=`${_.stage.clientHeight}px`,t.styleElement(I,{display:`block`,left:`${e}px`,top:`${n}px`,width:`${i}px`,height:`${i}px`,background:r})},De=e=>{let{x:t,y:n}=Z(e);if(F&&F.id===e.pointerId){if(!F.moved&&Math.hypot(t-F.x,n-F.y)>3&&(F.moved=!0,_.stage.setPointerCapture?.(e.pointerId),_.stage.style.cursor=`grabbing`),F.moved){let e=Te(t,n);e&&(Ee(t,n,F.item.color),Y(),H(`drag`,{item:F.item,x:e.x,y:e.y}))}return}if(L&&L.id===e.pointerId){let r=t-L.x,i=n-L.y;if(!L.moved&&Math.hypot(r,i)>3){let t=W();w&&t?.pan&&(L.moved=!0,_.stage.setPointerCapture?.(e.pointerId),_.stage.style.cursor=`grabbing`)}if(L.moved&&O){let e=f(L.view);S.zoom.x&&(e.x=u.panRange(L.view.x,-r*O.xPerPx*(S.x.reverse?-1:1))),S.zoom.y&&(e.y=u.panRange(L.view.y,i*O.yPerPx*(S.y.reverse?-1:1))),X(e,!0);return}}let r=q(t,n);J(r?{event:r,anchorX:t,anchorY:n,keyboard:!1}:null),!L&&W()?.dragPoints&&(_.stage.style.cursor=be(t,n)||w&&W()?.pan?`grab`:``)},Oe=e=>{if(e.button!==0)return;let{x:t,y:n}=Z(e);if(!Q(t,n))return;let r=be(t,n);if(r){F={id:e.pointerId,item:r,x:t,y:n,moved:!1};return}L={id:e.pointerId,x:t,y:n,view:f(C),moved:!1}},ke=e=>{if(F&&F.id===e.pointerId){let{item:t,moved:n}=F;F=null,_.stage.hasPointerCapture?.(e.pointerId)&&_.stage.releasePointerCapture(e.pointerId),Ee(0,0,null);let{x:r,y:i}=Z(e);if(_.stage.style.cursor=be(r,i)?`grab`:``,n){let n=Te(r,i);n&&e.type!==`pointercancel`&&H(`drop`,{item:t,x:n.x,y:n.y}),Y()}else{let e=q(r,i);e&&H(`click`,e)}return}if(!L||L.id!==e.pointerId)return;let t=L.moved;if(L=null,_.stage.hasPointerCapture?.(e.pointerId)&&_.stage.releasePointerCapture(e.pointerId),_.stage.style.cursor=w&&W()?.pan?`grab`:``,t)Y();else{let{x:t,y:n}=Z(e),r=q(t,n);if(r)H(`click`,r);else if(e.type!==`pointercancel`&&Q(t,n)){let e=Te(t,n);e&&H(`plotClick`,e)}}},Ae=()=>{!L?.moved&&!F?.moved&&J(null)},je=e=>{let t=W();if(!t||t.zoom===!1||!S.zoom.x&&!S.zoom.y)return;let{x:n,y:r}=Z(e);if(!Q(n,r))return;let i=e.ctrlKey||e.metaKey;if(t.wheel===`always`||i)e.preventDefault(),we(n,r,u.wheelFactor(e.deltaY,e.deltaMode,e.ctrlKey&&!e.metaKey));else if(w&&S.zoom.x&&O&&Math.abs(e.deltaX)>Math.abs(e.deltaY)){e.preventDefault();let t=f(C);t.x=u.panRange(C.x,e.deltaX*O.xPerPx*(S.x.reverse?-1:1)),X(t,!0)}},Me=e=>{let{x:t,y:n}=Z(e);W()&&w&&Q(t,n)&&Ve()},Ne=t=>{let n=O;if(!n)return;let i=P?.keyboard?P.event.items[0]:null,a=(i&&S.series[i.seriesIndex])??S.series.find(e=>!e.hidden&&e.cols.count>0);if(!a)return;let{x:o,y:c,count:l}=a.cols,u;for(i?u=i.index+t:(u=a.cols.sorted?e.lowerBound(o,l,C.x[0]):0,t<0&&(u=a.cols.sorted?e.lowerBound(o,l,C.x[1])-1:l-1));u>=0&&u<l&&!Number.isFinite(c[u]);)u+=t||1;if(u<0||u>=l)return;let d=n;if(S.zoom.x&&(o[u]<C.x[0]||o[u]>C.x[1])){let e=C.x[1]-C.x[0];X({x:[o[u]-e/2,o[u]+e/2],y:C.y},!0),d=O=r.createScales(n.plot,C,S.x.reverse,S.y.reverse)}let f=s.pointOf(a,u,d),p=s.hoverItemOf(a,u),m={items:[p,...S.tooltipMode===`axis`&&a.type!==`scatter`?(q(f.px,f.py)?.items??[]).filter(e=>e.seriesIndex!==a.index):[]],x:p.x,xLabel:k?.formatValue(p.x)??String(p.x)};J({event:m,anchorX:f.px,anchorY:f.py,keyboard:!0});let h=p;_.live.textContent=`${h.seriesName}: ${m.xLabel}, ${A?.formatValue(h.y)??h.y}${h.label?` (${h.label})`:``}`},Pe=e=>{if(!W()?.keyboard)return;let t=()=>{let e=O?.plot;return e?[e.x+e.width/2,e.y+e.height/2]:[0,0]};switch(e.key){case`ArrowRight`:case`ArrowLeft`:e.preventDefault(),Ne(e.key===`ArrowRight`===S.x.reverse?-1:1);break;case`+`:case`=`:{if(!S.zoom.x&&!S.zoom.y)return;e.preventDefault();let[n,r]=t();we(n,r,.8);break}case`-`:case`_`:{if(!S.zoom.x&&!S.zoom.y)return;e.preventDefault();let[n,r]=t();we(n,r,1.25);break}case`0`:e.preventDefault(),Ve();break;case`Escape`:P&&(e.preventDefault(),J(null))}},Fe=()=>{let e;try{e=_.stage.matches(`:focus-visible`)}catch{e=!0}e&&(_.stage.style.boxShadow=`0 0 0 2px var(--primary-color, #4f46e5)`)},Ie=()=>{_.stage.style.boxShadow=``,P?.keyboard&&J(null)},$=_.stage;$.addEventListener(`pointermove`,De),$.addEventListener(`pointerdown`,Oe),$.addEventListener(`pointerup`,ke),$.addEventListener(`pointercancel`,ke),$.addEventListener(`pointerleave`,Ae),$.addEventListener(`wheel`,je,{passive:!1}),$.addEventListener(`dblclick`,Me),$.addEventListener(`keydown`,Pe),$.addEventListener(`focus`,Fe),$.addEventListener(`blur`,Ie);let Le=typeof ResizeObserver==`function`?new ResizeObserver(()=>G()):null;Le?.observe(_.stage);let Re=()=>{if(M)return;let e=l.readTheme(_.root,b.palette);l.themeColorsChanged(x,e)&&z++,x=e,K()},ze=l.watchTheme(Re),Be=async(e=new Set)=>{let n=++re,r=await o.createRenderer(b.renderer??`auto`,()=>t.createDataCanvas(h),t=>{M||j?.kind!==t||(j.destroy(),j.canvas.remove(),j=null,Be(new Set([...e,t])))},e);if(M||n!==re){r?.destroy();return}j&&(j.destroy(),j.canvas.remove()),j=r,r&&(_.root.dataset.renderer=r.kind,_.stage.insertBefore(r.canvas,_.foreground),E=!0,H(`renderer`,r.kind)),le(r?.kind??null),G()};function Ve(){w&&X(f(S.base),!0)}return K(),Be(),{setOptions(e){if(M)return;let t=b;b=e,(e.palette??[]).join()!==(t.palette??[]).join()&&(x=l.readTheme(_.root,e.palette),z++),(e.renderer??`auto`)!==(t.renderer??`auto`)&&Be(),K()},resize(){G()},resetZoom:Ve,getView:()=>f(C),setView(e){M||X({x:e.x??C.x,y:e.y??C.y},!1)},getRenderer:()=>j?.kind??null,getPlotRect(){let e=ye();return e?{x:e[0],y:e[1],width:e[2],height:e[3]}:null},toPixel(e,t){return O?{x:O.xToPx(e)+_.stage.offsetLeft,y:O.yToPx(t)+_.stage.offsetTop}:null},fromPixel(e,t){return O?{x:O.pxToX(e-_.stage.offsetLeft),y:O.pxToY(t-_.stage.offsetTop)}:null},ready:ue,refreshTheme:Re,on(e,t){let n=y[e];return n||(n=new Set,y[e]=n),n.add(t),()=>{n.delete(t)}},destroy(){if(!M){M=!0,N&&(g?.cancelAnimationFrame?g.cancelAnimationFrame(N):clearTimeout(N)),Le?.disconnect(),ze(),$.removeEventListener(`wheel`,je),j?.destroy(),j=null,_.root.remove();for(let e of Object.keys(y))delete y[e]}}}};exports.createChart=p;
|
|
1
|
+
const e=require("./data.cjs"),t=require("./dom.cjs"),n=require("./layout.cjs"),r=require("./items.cjs"),i=require("./locale.cjs"),a=require("./labels.cjs"),o=require("./model.cjs"),s=require("./overlay.cjs"),c=require("./renderers/detect.cjs"),l=require("./scene.cjs"),u=require("./signature.cjs"),d=require("./theme.cjs"),f=require("./viewport.cjs");var p=e=>(e[0]+e[1])/2,m=e=>({x:[e.x[0],e.x[1]],y:[e.y[0],e.y[1]]}),h=(h,ee)=>{let g=h.ownerDocument,_=g.defaultView,v=t.createChartDom(h),te=new Map,y=new Set,b={},x=ee,S=d.readTheme(v.root,x.palette),C,w={x:[0,1],y:[0,1]},T=!1,E={x:0,y:0},ne=[],D=!0,re=0,ie=[],O=null,k=null,A=null,ae=null,j=null,oe=0,M=!1,N=0,P=null,se=``,F=null,I=null,L=null,R=[],ce=[],le=[],ue=[],z=null,de=``,fe=0,pe=``,me=``,B=null,V=null,he=()=>{},ge=new Promise(e=>{he=e}),H=(e,t)=>{b[e]?.forEach(e=>e(t))},_e=null,ve=null,U=()=>{if(_e===x)return ve;_e=x;let e=x.interaction;if(e===!1)return ve=null;let t=typeof e==`object`?e:{};return ve={zoom:t.zoom??!0,wheel:t.wheel??`modifier`,pan:t.pan??!0,keyboard:t.keyboard??!0,dragPoints:t.dragPoints??!1}},ye=()=>x.tooltip===!1?null:typeof x.tooltip==`object`?x.tooltip:{},W=()=>{M||N||(N=_?.requestAnimationFrame?_.requestAnimationFrame(Te):setTimeout(Te,16))},G=()=>{C=o.buildModel(x,S,y,te);let{base:e,zoom:t,minSpan:n}=C;T?(w={x:t.x?f.clampRange(w.x,e.x,n.x):[...e.x],y:t.y?f.clampRange(w.y,e.y,n.y):[...e.y]},T=!f.sameRange(w.x,e.x)||!f.sameRange(w.y,e.y)):w=m(e);let r=u.itemsSignature(C,fe,e=>x.series[e]?.stack);r!==pe&&(pe=r,E={x:p(e.x),y:p(e.y)},D=!0,P&&!P.keyboard&&(P=null)),ie=l.resolveAnnotations(x.annotations,S,C.y.type===`log`?Math.log10:void 0),xe(),Se(),W()},be=()=>{let e=(e,t)=>Math.max(Math.abs(e[0]-t),Math.abs(e[1]-t))>(e[1]-e[0])*2e3;(e(w.x,E.x)||e(w.y,E.y))&&(E={x:p(w.x),y:p(w.y)},D=!0)},xe=()=>{let e=x.legend,n=x.series.filter(e=>e.name).length,r=l.legendShown(e,C,n),i=typeof e==`object`?e:{},a=i.toggle??!0,o=i.position===`bottom`,s=r?l.colorLegend(C):null,c=`${r}|${o}|${a}`;if(s)c+=`\n${s.stops.join(`;`)}|${s.labels.map(e=>e.text).join(`;`)}`;else if(r)for(let e of C.series)c+=`\n${e.id}\u0001${e.name}\u0001${e.colorCss}\u0001${l.legendShape(e.type)}\u0001${e.hidden}`;if(c===me)return;me=c;let u=[...v.legend.children].indexOf(g.activeElement);if(v.legend.replaceChildren(),z=null,v.legend.style.display=r?`flex`:`none`,r){if(v.legend.style.order=o?`1`:`0`,v.legend.style.padding=o?`8px 4px 0`:`0 4px 8px`,s){v.legend.style.justifyContent=`flex-end`;let e=g.createElement(`div`);t.styleElement(e,{display:`flex`,alignItems:`center`,gap:`8px`,color:`var(--text-secondary-color, #6b7280)`,fontSize:`11px`,fontVariantNumeric:`tabular-nums`});let n=s.labels[0],r=s.labels[s.labels.length-1],i=g.createElement(`div`);if(t.styleElement(i,{position:`relative`,width:`160px`,height:`8px`,borderRadius:`4px`,background:`linear-gradient(to right, ${s.stops.join(`, `)})`,boxShadow:`inset 0 0 0 1px color-mix(in srgb, var(--text-color, #1f2937) 8%, transparent)`}),s.labels.length>2){let e=g.createElement(`div`);t.styleElement(e,{position:`absolute`,left:`50%`,top:`-2px`,width:`1px`,height:`12px`,background:`color-mix(in srgb, var(--text-color, #1f2937) 35%, transparent)`}),i.appendChild(e)}z=g.createElement(`div`),t.styleElement(z,{position:`absolute`,top:`-3px`,width:`4px`,height:`14px`,marginLeft:`-2px`,borderRadius:`2px`,background:`var(--text-color, #1f2937)`,boxShadow:`0 0 0 1.5px var(--surface-color, var(--background-color, #fff))`,display:`none`}),i.appendChild(z);let a=e=>{let t=g.createElement(`span`);return t.textContent=e,t};e.append(a(n?.text??``),i,a(r?.text??``)),v.legend.appendChild(e);return}v.legend.style.justifyContent=``;for(let e of C.series){let n=g.createElement(a?`button`:`span`);n instanceof HTMLButtonElement&&(n.type=`button`,n.setAttribute(`aria-pressed`,String(!e.hidden)),n.addEventListener(`click`,()=>{y.has(e.id)?y.delete(e.id):y.add(e.id),G()})),t.styleElement(n,{display:`inline-flex`,alignItems:`center`,gap:`6px`,padding:`2px 4px`,margin:`0`,border:`0`,borderRadius:`4px`,background:`none`,font:`inherit`,color:`var(--text-secondary-color, #6b7280)`,cursor:a?`pointer`:`default`,opacity:e.hidden?`0.45`:`1`,textDecoration:e.hidden?`line-through`:`none`}),n.append(t.swatch(g,e.colorCss,l.legendShape(e.type)),g.createTextNode(e.name)),v.legend.appendChild(n)}u>=0&&v.legend.children[u]?.focus()}},Se=()=>{v.stage.setAttribute(`aria-label`,x.ariaLabel??a.chartAriaLabel(C));let e=U()?.keyboard;v.stage.style.touchAction=U()?.dragPoints?`none`:`pan-y`,e?v.stage.tabIndex=0:v.stage.removeAttribute(`tabindex`)},Ce=(e,t,n,r)=>{let i=Math.max(1,Math.round(t*r)),a=Math.max(1,Math.round(n*r));e.width!==i&&(e.width=i),e.height!==a&&(e.height=a),e.style.width=`${t}px`,e.style.height=`${n}px`},we=(e,t,n)=>{let r=2/(e[1]-e[0]),i=(t-e[0])*r-1;return n?[-r,-i]:[r,i]};function Te(){if(N=0,M)return;let e=v.stage.clientWidth,n=v.stage.clientHeight;if(e<=0||n<=0)return;let i=_?.devicePixelRatio||1;Ce(v.background,e,n,i),Ce(v.foreground,e,n,i);let a=v.background.getContext(`2d`),o=v.foreground.getContext(`2d`);a&&(a.setTransform(i,0,0,i,0,0),a.font=s.font(S));let c=l.layoutChart({model:C,view:w,theme:S,width:e,height:n,padding:x.padding,measure:a?e=>a.measureText(e).width:e=>e.length*S.fontSize*.6}),{plot:u}=c;k=c.xTicks,A=c.yTicks,ae=c.y2Ticks,O=c.scales;let d=Ee();if(d&&d.join()!==se&&(se=d.join(),H(`layout`,{x:d[0],y:d[1],width:d[2],height:d[3]})),a&&s.drawBackground(a,{width:e,height:n,scales:O,x:C.x,y:C.y,xTicks:k,yTicks:A,y2:C.y2,y2Ticks:ae,theme:S,annotations:ie}),o&&(o.setTransform(i,0,0,i,0,0),s.drawForeground(o,{width:e,height:n,scales:O,theme:S,annotations:ie,pointLabels:l.collectPointLabels(C,w,O,A),connectors:l.connectorSegments(C,O)})),j){let e=j.canvas,n=C.horizontal,a=n?u.height:u.width,o=n?u.width:u.height;t.styleElement(e,{left:`${u.x}px`,top:`${u.y}px`,width:`${a}px`,height:`${o}px`,transformOrigin:n?`0 0`:``,transform:n?`matrix(0, 1, 1, 0, 0, 0)`:``});let s=Math.max(1,Math.round(a*i)),c=Math.max(1,Math.round(o*i));(e.width!==s||e.height!==c)&&j.resize(s,c),be();let l={x:1/Math.abs(O.xPerPx),y:1/Math.abs(O.yPerPx)},d=r.cellStyleKey(C,l);d!==de&&(de=d,D=!0),D&&(re++,ne=r.buildItems(C,E,re,l),D=!1);let[f,p]=we(w.x,E.x,C.x.reverse),[m,h]=we(w.y,E.y,n?!C.y.reverse:C.y.reverse);j.render(ne,{transform:{xScale:f,xOffset:p,yScale:m,yOffset:h},width:s,height:c,dpr:i})}Y()}let K=(e,t)=>O?l.hitTest(C,O,k,e,t):null,Ee=()=>{let e=O?.plot;return e?[e.x+v.stage.offsetLeft,e.y+v.stage.offsetTop,e.width,e.height]:null},De=(e,t)=>U()?.dragPoints?K(e,t)?.items.find(e=>C.series[e.seriesIndex].type===`scatter`)??null:null,q=e=>{let t=!l.sameHover(P?.event??null,e?.event??null);P=e,Y(),t&&H(`hover`,e?e.event:null)},Oe=e=>{let n=ye()?.render;if(n)return n(e);let r=l.tooltipContent(C,e,A,ae),i=g.createDocumentFragment(),a=g.createElement(`div`);if(t.styleElement(a,{display:`flex`,alignItems:`center`,gap:`6px`,fontWeight:`600`,marginBottom:r.subtitle?`0`:`4px`,color:`var(--text-color, #1f2937)`}),r.titleColor&&a.appendChild(t.swatch(g,r.titleColor,`dot`)),a.appendChild(g.createTextNode(r.title)),i.append(a),r.subtitle){let e=g.createElement(`div`);t.styleElement(e,{color:`var(--text-secondary-color, #6b7280)`,fontSize:`11px`,margin:`1px 0 6px`,paddingLeft:r.titleColor?`14px`:`0`}),e.textContent=r.subtitle,i.append(e)}if(!r.rows.length)return i;let o=r.rows.some(e=>e.color),s=g.createElement(`div`);t.styleElement(s,{display:`grid`,gridTemplateColumns:o?`auto minmax(0, 1fr) auto`:`minmax(0, 1fr) auto`,columnGap:`0`,rowGap:`2px`,alignItems:`center`});for(let e of r.rows){if(o){let n=g.createElement(`span`);t.styleElement(n,{display:`inline-flex`,width:`14px`,justifyContent:`flex-start`}),e.color&&n.appendChild(t.swatch(g,e.color,`dot`)),s.appendChild(n)}let n=g.createElement(`span`);t.styleElement(n,{color:`var(--text-secondary-color, #6b7280)`,paddingRight:`16px`,overflow:`hidden`,textOverflow:`ellipsis`}),n.textContent=e.name;let r=g.createElement(`span`);t.styleElement(r,{fontWeight:`600`,fontVariantNumeric:`tabular-nums`,textAlign:`right`,color:`var(--text-color, #1f2937)`}),r.textContent=e.value,s.append(n,r)}return i.append(s),i},J=(e,t,n,r=v.hover)=>(e[t]||(e[t]=n(),r.appendChild(e[t])),e[t].style.display=`block`,e[t]);function Y(){let e=O;P&&e&&B&&B.scales===e&&B.model===C&&l.sameHover(B.event,P.event)||ke(e);let t=v.tooltip;if(!P||!e||!ye()||L?.moved||F?.moved){t.style.display=`none`;return}let n=ye()?.render,r,i;if(!n&&V&&V.model===C&&V.yTicks===A&&l.sameHover(V.event,P.event)&&t.style.display===`block`)r=V.width,i=V.height;else{V=null;let e=Oe(P.event);if(e===null||e===``){t.style.display=`none`;return}typeof e==`string`?(t.textContent=e,t.style.whiteSpace=`pre`):(t.replaceChildren(e),t.style.whiteSpace=`nowrap`),t.style.display=`block`,r=t.offsetWidth,i=t.offsetHeight,n||(V={event:P.event,model:C,yTicks:A,width:r,height:i})}let a=v.stage.clientWidth,o=v.stage.clientHeight,s=P.anchorX+16;s+r>a-4&&(s=P.anchorX-16-r),s=Math.max(4,Math.min(s,a-r-4));let c=Math.max(4,Math.min(P.anchorY-i/2,o-i-4));t.style.transform=`translate(${Math.round(s)}px, ${Math.round(c)}px)`}function ke(e){let n=0,r=0,i=0,a=0;if(Ae(),B=null,v.crosshair.style.display=`none`,P&&e){B={event:P.event,model:C,scales:e};let{plot:o}=e;v.hover.style.width=`${v.stage.clientWidth}px`,v.hover.style.height=`${v.stage.clientHeight}px`;let s=l.crosshairAt(C,e,P.event,x.crosshair);if(s!==null){let n=`1px dashed color-mix(in srgb, var(--text-secondary-color, #6b7280) 45%, transparent)`;t.styleElement(v.crosshair,e.horizontal?{display:`block`,left:`${o.x}px`,top:`${Math.round(s)}px`,width:`${o.width}px`,height:`0`,borderLeft:`0`,borderTop:n}:{display:`block`,left:`${Math.round(s)}px`,top:`${o.y}px`,width:`0`,height:`${o.height}px`,borderLeft:n,borderTop:`0`})}for(let o of l.hoverMarks(C,e,P.event)){if(o.kind===`band`||o.kind===`guide`){let e=o.kind===`band`?J(ce,r++,()=>t.createBand(g),v.underlay):J(ue,a++,()=>t.styleElement(t.createBand(g),{borderRadius:`0`,background:`color-mix(in srgb, var(--text-color, #1f2937) 6%, transparent)`}));t.styleElement(e,{left:`${o.x}px`,top:`${o.y}px`,width:`${o.width}px`,height:`${o.height}px`});continue}if(o.kind===`cell`){let e=J(le,i++,()=>t.styleElement(t.createBand(g),{boxShadow:`0 8px 18px -6px rgba(15, 23, 42, 0.6), 0 0 0 1px rgba(15, 23, 42, 0.12)`,outlineStyle:`solid`,outlineWidth:`1.5px`,outlineOffset:`-4px`,transform:`scale(1.12)`}));t.styleElement(e,{left:`${o.x}px`,top:`${o.y}px`,width:`${o.width}px`,height:`${o.height}px`,background:o.color,borderRadius:`${Math.max(o.radius,2)}px`,outlineColor:o.ring});continue}let e=J(R,n++,()=>t.createMarker(g));t.styleElement(e,{left:`${o.x}px`,top:`${o.y}px`,width:`${o.size}px`,height:`${o.size}px`,background:o.color,boxShadow:`0 0 0 4px ${o.halo}`})}}for(let e=n;e<R.length;e++)R[e].style.display=`none`;for(let e=r;e<ce.length;e++)ce[e].style.display=`none`;for(let e=i;e<le.length;e++)le[e].style.display=`none`;for(let e=a;e<ue.length;e++)ue[e].style.display=`none`}function Ae(){let e=z;if(!e)return;let t=P?.event.items[0],n=t?C.series[t.seriesIndex]:void 0;if(!t||!n||n.type!==`heatmap`||t.value===void 0){e.style.display=`none`;return}e.style.display=`block`,e.style.left=`${(o.heatPosition(n,t.value)*100).toFixed(2)}%`}let X=(e,t)=>{let{base:n,minSpan:r}=C;w={x:f.clampRange(e.x,n.x,r.x),y:f.clampRange(e.y,n.y,r.y)},T=!f.sameRange(w.x,n.x)||!f.sameRange(w.y,n.y);let i=U();v.stage.style.cursor=T&&i?.pan?`grab`:``,t&&H(`zoom`,m(w)),W()},je=(e,t,r)=>{let i=O;if(!i)return;let a=m(w),o=n.toData(i,e,t);C.zoom.x&&(a.x=f.zoomRange(w.x,o.x,r)),C.zoom.y&&(a.y=f.zoomRange(w.y,o.y,r)),X(a,!0)},Z=e=>{let t=v.stage.getBoundingClientRect();return{x:e.clientX-t.left,y:e.clientY-t.top}},Q=(e,t)=>{let n=O?.plot;return!!n&&e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height},Me=(e,t)=>{let r=O;if(!r)return null;let{plot:i}=r,a=Math.max(i.x,Math.min(i.x+i.width,e)),s=Math.max(i.y,Math.min(i.y+i.height,t)),c=n.toData(r,a,s);return{x:c.x,y:o.fromPlotY(C,c.y)}},Ne=(e,n,r)=>{if(r===null){I&&(I.style.display=`none`);return}I||(I=t.createMarker(g),v.hover.appendChild(I));let i=(C.series.find(e=>e.type===`scatter`)?.pointSize??8)+8;v.hover.style.width=`${v.stage.clientWidth}px`,v.hover.style.height=`${v.stage.clientHeight}px`,t.styleElement(I,{display:`block`,left:`${e}px`,top:`${n}px`,width:`${i}px`,height:`${i}px`,background:r})},Pe=e=>{let{x:t,y:r}=Z(e);if(F&&F.id===e.pointerId){if(!F.moved&&Math.hypot(t-F.x,r-F.y)>3&&(F.moved=!0,v.stage.setPointerCapture?.(e.pointerId),v.stage.style.cursor=`grabbing`),F.moved){let e=Me(t,r);e&&(Ne(t,r,F.item.color),Y(),H(`drag`,{item:F.item,x:e.x,y:e.y}))}return}if(L&&L.id===e.pointerId){let i=t-L.x,a=r-L.y;if(!L.moved&&Math.hypot(i,a)>3){let t=U();T&&t?.pan&&(L.moved=!0,v.stage.setPointerCapture?.(e.pointerId),v.stage.style.cursor=`grabbing`)}if(L.moved&&O){let e=m(L.view),i=n.toData(O,L.x,L.y),a=n.toData(O,t,r);C.zoom.x&&(e.x=f.panRange(L.view.x,i.x-a.x)),C.zoom.y&&(e.y=f.panRange(L.view.y,i.y-a.y)),X(e,!0);return}}let i=K(t,r);q(i?{event:i,anchorX:t,anchorY:r,keyboard:!1}:null),!L&&U()?.dragPoints&&(v.stage.style.cursor=De(t,r)||T&&U()?.pan?`grab`:``)},Fe=e=>{if(e.button!==0)return;let{x:t,y:n}=Z(e);if(!Q(t,n))return;let r=De(t,n);if(r){F={id:e.pointerId,item:r,x:t,y:n,moved:!1};return}L={id:e.pointerId,x:t,y:n,view:m(w),moved:!1}},Ie=e=>{if(F&&F.id===e.pointerId){let{item:t,moved:n}=F;F=null,v.stage.hasPointerCapture?.(e.pointerId)&&v.stage.releasePointerCapture(e.pointerId),Ne(0,0,null);let{x:r,y:i}=Z(e);if(v.stage.style.cursor=De(r,i)?`grab`:``,n){let n=Me(r,i);n&&e.type!==`pointercancel`&&H(`drop`,{item:t,x:n.x,y:n.y}),Y()}else{let e=K(r,i);e&&H(`click`,e)}return}if(!L||L.id!==e.pointerId)return;let t=L.moved;if(L=null,v.stage.hasPointerCapture?.(e.pointerId)&&v.stage.releasePointerCapture(e.pointerId),v.stage.style.cursor=T&&U()?.pan?`grab`:``,t)Y();else{let{x:t,y:n}=Z(e),r=K(t,n);if(r)H(`click`,r);else if(e.type!==`pointercancel`&&Q(t,n)){let e=Me(t,n);e&&H(`plotClick`,e)}}},Le=()=>{!L?.moved&&!F?.moved&&q(null)},Re=e=>{let t=U();if(!t||t.zoom===!1||!C.zoom.x&&!C.zoom.y)return;let{x:n,y:r}=Z(e);if(!Q(n,r))return;let i=e.ctrlKey||e.metaKey;if(t.wheel===`always`||i)e.preventDefault(),je(n,r,f.wheelFactor(e.deltaY,e.deltaMode,e.ctrlKey&&!e.metaKey));else if(T&&C.zoom.x&&O&&!O.horizontal&&Math.abs(e.deltaX)>Math.abs(e.deltaY)){e.preventDefault();let t=m(w);t.x=f.panRange(w.x,e.deltaX*O.xPerPx*(C.x.reverse?-1:1)),X(t,!0)}},ze=e=>{let{x:t,y:n}=Z(e);U()&&T&&Q(t,n)&&Ye()},Be=t=>{let r=O;if(!r)return;let i=P?.keyboard?P.event.items[0]:null,a=(i&&C.series[i.seriesIndex])??C.series.find(e=>!e.hidden&&e.cols.count>0);if(!a)return;let{x:o,y:s,count:c}=a.cols,u;for(i?u=i.index+t:(u=a.cols.sorted?e.lowerBound(o,c,w.x[0]):0,t<0&&(u=a.cols.sorted?e.lowerBound(o,c,w.x[1])-1:c-1));u>=0&&u<c&&!Number.isFinite(s[u]);)u+=t||1;if(u<0||u>=c)return;let d=r;if(C.zoom.x&&(o[u]<w.x[0]||o[u]>w.x[1])){let e=w.x[1]-w.x[0];X({x:[o[u]-e/2,o[u]+e/2],y:w.y},!0),d=O=n.createScales(r.plot,w,C.x.reverse,C.y.reverse,C.horizontal)}let f=l.pointOf(a,u,d),p=l.hoverItemOf(a,u),m={items:[p,...C.tooltipMode===`axis`&&a.type!==`scatter`?(K(f.px,f.py)?.items??[]).filter(e=>e.seriesIndex!==a.index):[]],x:p.x,xLabel:k?.formatValue(p.x)??String(p.x)};q({event:m,anchorX:f.px,anchorY:f.py,keyboard:!0});let h=p;v.live.textContent=`${h.seriesName}: ${m.xLabel}, ${A?.formatValue(h.y)??h.y}${h.label?` (${h.label})`:``}`},Ve=e=>{if(!U()?.keyboard)return;let t=()=>{let e=O?.plot;return e?[e.x+e.width/2,e.y+e.height/2]:[0,0]};switch(e.key){case`ArrowRight`:case`ArrowLeft`:if(C.horizontal)return;e.preventDefault(),Be(e.key===`ArrowRight`===C.x.reverse?-1:1);break;case`ArrowDown`:case`ArrowUp`:if(!C.horizontal)return;e.preventDefault(),Be(e.key===`ArrowDown`===C.x.reverse?-1:1);break;case`+`:case`=`:{if(!C.zoom.x&&!C.zoom.y)return;e.preventDefault();let[n,r]=t();je(n,r,.8);break}case`-`:case`_`:{if(!C.zoom.x&&!C.zoom.y)return;e.preventDefault();let[n,r]=t();je(n,r,1.25);break}case`0`:e.preventDefault(),Ye();break;case`Escape`:P&&(e.preventDefault(),q(null))}},He=()=>{let e;try{e=v.stage.matches(`:focus-visible`)}catch{e=!0}e&&(v.stage.style.boxShadow=`0 0 0 2px var(--primary-color, #4f46e5)`)},Ue=()=>{v.stage.style.boxShadow=``,P?.keyboard&&q(null)},$=v.stage;$.addEventListener(`pointermove`,Pe),$.addEventListener(`pointerdown`,Fe),$.addEventListener(`pointerup`,Ie),$.addEventListener(`pointercancel`,Ie),$.addEventListener(`pointerleave`,Le),$.addEventListener(`wheel`,Re,{passive:!1}),$.addEventListener(`dblclick`,ze),$.addEventListener(`keydown`,Ve),$.addEventListener(`focus`,He),$.addEventListener(`blur`,Ue);let We=typeof ResizeObserver==`function`?new ResizeObserver(()=>W()):null;We?.observe(v.stage);let Ge=()=>{if(M)return;let e=d.readTheme(v.root,x.palette);d.themeColorsChanged(S,e)&&fe++,S=e,G()},Ke=d.watchTheme(Ge),qe=i.watchLocale(()=>{!M&&!x.locale&&G()}),Je=async(e=new Set)=>{let n=++oe,r=await c.createRenderer(x.renderer??`auto`,()=>t.createDataCanvas(g),t=>{M||j?.kind!==t||(j.destroy(),j.canvas.remove(),j=null,Je(new Set([...e,t])))},e);if(M||n!==oe){r?.destroy();return}j&&(j.destroy(),j.canvas.remove()),j=r,r&&(v.root.dataset.renderer=r.kind,v.stage.insertBefore(r.canvas,v.foreground),D=!0,H(`renderer`,r.kind)),he(r?.kind??null),W()};function Ye(){T&&X(m(C.base),!0)}return G(),Je(),{setOptions(e){if(M)return;let t=x;x=e,(e.palette??[]).join()!==(t.palette??[]).join()&&(S=d.readTheme(v.root,e.palette),fe++),(e.renderer??`auto`)!==(t.renderer??`auto`)&&Je(),G()},resize(){W()},resetZoom:Ye,getView:()=>m(w),setView(e){M||X({x:e.x??w.x,y:e.y??w.y},!1)},getRenderer:()=>j?.kind??null,getPlotRect(){let e=Ee();return e?{x:e[0],y:e[1],width:e[2],height:e[3]}:null},toPixel(e,t){if(!O)return null;let r=n.toScreen(O,e,o.toPlotY(C,t));return{x:r.x+v.stage.offsetLeft,y:r.y+v.stage.offsetTop}},fromPixel(e,t){if(!O)return null;let r=n.toData(O,e-v.stage.offsetLeft,t-v.stage.offsetTop);return{x:r.x,y:o.fromPlotY(C,r.y)}},ready:ge,refreshTheme:Ge,on(e,t){let n=b[e];return n||(n=new Set,b[e]=n),n.add(t),()=>{n.delete(t)}},destroy(){if(!M){M=!0,N&&(_?.cancelAnimationFrame?_.cancelAnimationFrame(N):clearTimeout(N)),We?.disconnect(),Ke(),qe(),$.removeEventListener(`wheel`,Re),j?.destroy(),j=null,v.root.remove();for(let e of Object.keys(b))delete b[e]}}}};exports.createChart=h;
|
|
2
2
|
//# sourceMappingURL=chart.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chart.cjs","names":["createChartDom","readTheme","buildModel","clampRange","sameRange","itemsSignature","resolveAnnotations","legendShape","swatch","font","layoutChart","collectPointLabels","buildItems","hitTest","sameHover","tooltipContent","showsCrosshair","hoverMarks","createBand","styleElement","createMarker","zoomRange","panRange","wheelFactor","lowerBound","createScales","pointOf","hoverItemOf","themeColorsChanged","watchTheme","createRenderer","createDataCanvas","require_data","require_dom","require_items","require_layout","require_model","require_overlay","require_detect","require_scene","require_signature","require_theme","require_viewport","mid","r","copyView","v","createChart","doc","container","win","dom","cache","hidden","listeners","options","initialOptions","theme","model","view","zoomed","origin","items","itemsDirty","version","annotations","scales","xTicks","yTicks","renderer","rendererToken","destroyed","frameId","hover","lastPlot","pointDrag","ghost","drag","markers","bands","cells","themeVersion","itemsSignatureKey","legendKey","shownMarks","shownTip","resolveReady","ready","resolve","emit","type","listener","event","interactionOf","interactionValue","interaction","value","o","tooltipOptions","invalidate","frame","rebuild","zoom","base","minSpan","signature","index","renderLegend","updateAccessibility","ensureOrigin","far","legendOption","named","s","show","config","toggle","bottom","key","focused","item","names","keyboard","sizeCanvas","w","width","dpr","h","height","canvas","transformFor","scale","range","offset","reverse","bg","fg","layout","text","rect","plotRect","plot","bw","bh","xScale","xOffset","yScale","yOffset","renderHover","hitAt","px","py","p","draggableAt","it","setHover","changed","next","tooltipNode","custom","content","fragment","header","row","el","n","pooled","pool","i","make","parent","sc","renderMarks","tip","stageW","stageH","left","top","markerCount","bandCount","cellCount","first","cx","mark","setViewInternal","notify","zoomAt","factor","localPoint","inPlot","x","y","dataAt","cy","moveGhost","color","size","series","onPointerMove","at","dx","dy","event2","onPointerDown","draggable","onPointerUp","moved","hit","onPointerLeave","onWheel","modifier","onDoubleClick","resetZoom","moveFocus","current","step","count","current2","span","leadItem","onKeyDown","center","onFocus","visible","onBlur","stage","resizeObserver","refreshTheme","unwatchTheme","initRenderer","token","kind","exclude","previous","set"],"sources":["../../../../charts/src/engine/chart.ts"],"sourcesContent":["// createChart: mounts a chart in a container and keeps it in sync with its\n// options, its size, the theme and the user's interactions.\n\nimport type { AxisTicks } from \"./axis\";\nimport { lowerBound } from \"./data\";\nimport {\n createBand,\n createChartDom,\n createDataCanvas,\n createMarker,\n styleElement,\n swatch,\n} from \"./dom\";\nimport { buildItems, type Origin } from \"./items\";\nimport { createScales, type Scales } from \"./layout\";\nimport { buildModel, type ChartModel, type DataCache } from \"./model\";\nimport {\n drawBackground,\n drawForeground,\n font,\n type ResolvedAnnotation,\n} from \"./overlay\";\nimport { createRenderer } from \"./renderers/detect\";\nimport type { ChartRenderer, RenderItem } from \"./renderers/types\";\nimport {\n collectPointLabels,\n hitTest,\n hoverItemOf,\n hoverMarks,\n layoutChart,\n legendShape,\n pointOf,\n resolveAnnotations,\n sameHover,\n showsCrosshair,\n tooltipContent,\n} from \"./scene\";\nimport { itemsSignature } from \"./signature\";\nimport {\n readTheme,\n themeColorsChanged,\n watchTheme,\n type ChartTheme,\n} from \"./theme\";\nimport type {\n ChartEventMap,\n ChartHoverEvent,\n ChartHoverItem,\n ChartInstance,\n ChartInteractionOptions,\n ChartOptions,\n ChartRendererKind,\n ChartTooltipOptions,\n ChartView,\n} from \"./types\";\nimport {\n clampRange,\n panRange,\n sameRange,\n wheelFactor,\n zoomRange,\n type Range,\n} from \"./viewport\";\n\ninterface HoverState {\n event: ChartHoverEvent;\n /** Tooltip anchor in stage pixels */\n anchorX: number;\n anchorY: number;\n keyboard: boolean;\n}\n\nconst mid = (r: Range) => (r[0] + r[1]) / 2;\nconst copyView = (v: ChartView): ChartView => ({\n x: [v.x[0], v.x[1]],\n y: [v.y[0], v.y[1]],\n});\n\n/**\n * Creates a chart inside `container` (which must have a size). The data\n * layer uses WebGPU when available, then WebGL2, then Canvas2D.\n */\nexport const createChart = (\n container: HTMLElement,\n initialOptions: ChartOptions,\n): ChartInstance => {\n const doc = container.ownerDocument;\n const win = doc.defaultView;\n const dom = createChartDom(container);\n const cache: DataCache = new Map();\n const hidden = new Set<string>();\n const listeners: {\n [K in keyof ChartEventMap]?: Set<(event: ChartEventMap[K]) => void>;\n } = {};\n\n let options = initialOptions;\n let theme: ChartTheme = readTheme(dom.root, options.palette);\n let model: ChartModel;\n let view: ChartView = { x: [0, 1], y: [0, 1] };\n let zoomed = false;\n let origin: Origin = { x: 0, y: 0 };\n let items: RenderItem[] = [];\n let itemsDirty = true;\n let version = 0;\n let annotations: ResolvedAnnotation[] = [];\n let scales: Scales | null = null;\n let xTicks: AxisTicks | null = null;\n let yTicks: AxisTicks | null = null;\n let renderer: ChartRenderer | null = null;\n let rendererToken = 0;\n let destroyed = false;\n let frameId = 0;\n let hover: HoverState | null = null;\n let lastPlot = \"\";\n let pointDrag: {\n id: number;\n item: ChartHoverItem;\n x: number;\n y: number;\n moved: boolean;\n } | null = null;\n let ghost: HTMLDivElement | null = null;\n let drag: {\n id: number;\n x: number;\n y: number;\n view: ChartView;\n moved: boolean;\n } | null = null;\n const markers: HTMLDivElement[] = [];\n const bands: HTMLDivElement[] = [];\n const cells: HTMLDivElement[] = [];\n let themeVersion = 0;\n let itemsSignatureKey = \"\";\n let legendKey = \"\";\n /** What the hover layer shows: kept while the hovered points are the same */\n let shownMarks: {\n event: ChartHoverEvent;\n model: ChartModel;\n scales: Scales;\n } | null = null;\n let shownTip: {\n event: ChartHoverEvent;\n model: ChartModel;\n yTicks: AxisTicks | null;\n width: number;\n height: number;\n } | null = null;\n\n let resolveReady: (kind: ChartRendererKind | null) => void = () => {};\n const ready = new Promise<ChartRendererKind | null>((resolve) => {\n resolveReady = resolve;\n });\n\n const emit = <K extends keyof ChartEventMap>(\n type: K,\n event: ChartEventMap[K],\n ) => {\n listeners[type]?.forEach((listener) => listener(event));\n };\n\n let interactionOf: ChartOptions | null = null;\n let interactionValue: Required<ChartInteractionOptions> | null = null;\n /** Resolved `interaction` option (cached: read on every pointer move) */\n const interaction = (): Required<ChartInteractionOptions> | null => {\n if (interactionOf === options) return interactionValue;\n interactionOf = options;\n const value = options.interaction;\n if (value === false) return (interactionValue = null);\n const o = typeof value === \"object\" ? value : {};\n return (interactionValue = {\n zoom: o.zoom ?? true,\n wheel: o.wheel ?? \"modifier\",\n pan: o.pan ?? true,\n keyboard: o.keyboard ?? true,\n dragPoints: o.dragPoints ?? false,\n });\n };\n\n const tooltipOptions = (): ChartTooltipOptions | null =>\n options.tooltip === false\n ? null\n : typeof options.tooltip === \"object\"\n ? options.tooltip\n : {};\n\n const invalidate = () => {\n if (destroyed || frameId) return;\n frameId = win?.requestAnimationFrame\n ? win.requestAnimationFrame(frame)\n : (setTimeout(frame, 16) as unknown as number);\n };\n\n // ---------------------------------------------------------------- model\n\n const rebuild = () => {\n model = buildModel(options, theme, hidden, cache);\n const { base, zoom, minSpan } = model;\n if (!zoomed) {\n view = copyView(base);\n } else {\n view = {\n x: zoom.x ? clampRange(view.x, base.x, minSpan.x) : [...base.x],\n y: zoom.y ? clampRange(view.y, base.y, minSpan.y) : [...base.y],\n };\n zoomed = !sameRange(view.x, base.x) || !sameRange(view.y, base.y);\n }\n // Unchanged data and styles (e.g. a React re-render): keep the GPU\n // buffers and the hover state\n const signature = itemsSignature(\n model,\n themeVersion,\n (index) => options.series[index]?.stack,\n );\n if (signature !== itemsSignatureKey) {\n itemsSignatureKey = signature;\n origin = { x: mid(base.x), y: mid(base.y) };\n itemsDirty = true;\n if (hover && !hover.keyboard) hover = null;\n }\n annotations = resolveAnnotations(options.annotations, theme);\n renderLegend();\n updateAccessibility();\n invalidate();\n };\n\n /** float32 positions lose precision far from the origin: re-center when deeply zoomed */\n const ensureOrigin = () => {\n const far = (r: Range, o: number) =>\n Math.max(Math.abs(r[0] - o), Math.abs(r[1] - o)) > (r[1] - r[0]) * 2000;\n if (far(view.x, origin.x) || far(view.y, origin.y)) {\n origin = { x: mid(view.x), y: mid(view.y) };\n itemsDirty = true;\n }\n };\n\n // --------------------------------------------------------------- legend\n\n const renderLegend = () => {\n const legendOption = options.legend;\n const named = options.series.filter((s) => s.name).length;\n const show = legendOption === undefined ? named > 1 : !!legendOption;\n const config = typeof legendOption === \"object\" ? legendOption : {};\n const toggle = config.toggle ?? true;\n const bottom = config.position === \"bottom\";\n // rebuild the DOM only when what it shows changed\n let key = `${show}|${bottom}|${toggle}`;\n if (show) {\n for (const s of model.series)\n key += `\\n${s.id}\\u0001${s.name}\\u0001${s.colorCss}\\u0001${legendShape(s.type)}\\u0001${s.hidden}`;\n }\n if (key === legendKey) return;\n legendKey = key;\n const focused = [...dom.legend.children].indexOf(\n doc.activeElement as Element,\n );\n dom.legend.replaceChildren();\n dom.legend.style.display = show ? \"flex\" : \"none\";\n if (!show) return;\n dom.legend.style.order = bottom ? \"1\" : \"0\";\n dom.legend.style.padding = bottom ? \"8px 4px 0\" : \"0 4px 8px\";\n for (const s of model.series) {\n const item = doc.createElement(toggle ? \"button\" : \"span\");\n if (item instanceof HTMLButtonElement) {\n item.type = \"button\";\n item.setAttribute(\"aria-pressed\", String(!s.hidden));\n item.addEventListener(\"click\", () => {\n if (hidden.has(s.id)) hidden.delete(s.id);\n else hidden.add(s.id);\n rebuild();\n });\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: toggle ? \"pointer\" : \"default\",\n opacity: s.hidden ? \"0.45\" : \"1\",\n textDecoration: s.hidden ? \"line-through\" : \"none\",\n });\n item.append(\n swatch(doc, s.colorCss, legendShape(s.type)),\n doc.createTextNode(s.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 const names = model.series.map((s) => s.name).join(\", \");\n dom.stage.setAttribute(\n \"aria-label\",\n options.ariaLabel ?? (names ? `Chart: ${names}` : \"Chart\"),\n );\n const keyboard = interaction()?.keyboard;\n dom.stage.style.touchAction = interaction()?.dragPoints ? \"none\" : \"pan-y\";\n if (keyboard) dom.stage.tabIndex = 0;\n else dom.stage.removeAttribute(\"tabindex\");\n };\n\n // ---------------------------------------------------------------- frame\n\n const sizeCanvas = (\n canvas: HTMLCanvasElement,\n width: number,\n height: number,\n dpr: number,\n ) => {\n const w = Math.max(1, Math.round(width * dpr));\n const h = Math.max(1, Math.round(height * dpr));\n if (canvas.width !== w) canvas.width = w;\n if (canvas.height !== h) canvas.height = h;\n canvas.style.width = `${width}px`;\n canvas.style.height = `${height}px`;\n };\n\n const transformFor = (range: Range, o: number, reverse: boolean) => {\n const scale = 2 / (range[1] - range[0]);\n const offset = (o - range[0]) * scale - 1;\n return reverse ? [-scale, -offset] : [scale, offset];\n };\n\n function frame() {\n frameId = 0;\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 sizeCanvas(dom.background, width, height, dpr);\n sizeCanvas(dom.foreground, width, height, dpr);\n const bg = dom.background.getContext(\"2d\");\n const fg = dom.foreground.getContext(\"2d\");\n\n if (bg) {\n bg.setTransform(dpr, 0, 0, dpr, 0, 0);\n bg.font = font(theme);\n }\n const layout = layoutChart({\n model,\n view,\n theme,\n width,\n height,\n padding: options.padding,\n measure: bg\n ? (text) => bg.measureText(text).width\n : (text) => text.length * theme.fontSize * 0.6,\n });\n const { plot } = layout;\n xTicks = layout.xTicks;\n yTicks = layout.yTicks;\n scales = layout.scales;\n const rect = plotRect();\n if (rect && rect.join() !== lastPlot) {\n lastPlot = rect.join();\n emit(\"layout\", {\n x: rect[0],\n y: rect[1],\n width: rect[2],\n height: rect[3],\n });\n }\n\n if (bg) {\n drawBackground(bg, {\n width,\n height,\n scales,\n x: model.x,\n y: model.y,\n xTicks,\n yTicks,\n theme,\n annotations,\n });\n }\n if (fg) {\n fg.setTransform(dpr, 0, 0, dpr, 0, 0);\n drawForeground(fg, {\n width,\n height,\n scales,\n theme,\n annotations,\n pointLabels: collectPointLabels(model, view, scales, yTicks),\n });\n }\n\n if (renderer) {\n const canvas = renderer.canvas;\n styleElement(canvas, {\n left: `${plot.x}px`,\n top: `${plot.y}px`,\n width: `${plot.width}px`,\n height: `${plot.height}px`,\n });\n const bw = Math.max(1, Math.round(plot.width * dpr));\n const bh = Math.max(1, Math.round(plot.height * dpr));\n if (canvas.width !== bw || canvas.height !== bh) renderer.resize(bw, bh);\n ensureOrigin();\n if (itemsDirty) {\n version++;\n items = buildItems(model, origin, version);\n itemsDirty = false;\n }\n const [xScale, xOffset] = transformFor(view.x, origin.x, model.x.reverse);\n const [yScale, yOffset] = transformFor(view.y, origin.y, model.y.reverse);\n renderer.render(items, {\n transform: { xScale, xOffset, yScale, yOffset },\n width: bw,\n height: bh,\n dpr,\n });\n }\n renderHover();\n }\n\n // ------------------------------------------------------------ hit tests\n\n const hitAt = (px: number, py: number): ChartHoverEvent | null =>\n scales ? hitTest(model, scales, xTicks, px, py) : null;\n\n /** Plot area relative to the container: x, y, width, height */\n const plotRect = (): [number, number, number, number] | null => {\n const p = scales?.plot;\n if (!p) return null;\n return [\n p.x + dom.stage.offsetLeft,\n p.y + dom.stage.offsetTop,\n p.width,\n p.height,\n ];\n };\n\n /** A draggable point under the pointer (`interaction.dragPoints`) */\n const draggableAt = (px: number, py: number) => {\n if (!interaction()?.dragPoints) return null;\n const hit = hitAt(px, py);\n const item = hit?.items.find(\n (it) => model.series[it.seriesIndex].type === \"scatter\",\n );\n return item ?? null;\n };\n\n // ---------------------------------------------------------------- hover\n\n const setHover = (next: HoverState | null) => {\n const changed = !sameHover(hover?.event ?? null, next?.event ?? null);\n hover = next;\n renderHover();\n if (changed) emit(\"hover\", next ? next.event : null);\n };\n\n const tooltipNode = (event: ChartHoverEvent): Node | string | null => {\n const custom = tooltipOptions()?.render;\n if (custom) return custom(event);\n const content = tooltipContent(model, event, yTicks);\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.titleColor)\n header.appendChild(swatch(doc, content.titleColor, \"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: \"var(--text-secondary-color, #6b7280)\",\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 const pooled = <T extends HTMLElement>(\n pool: T[],\n i: number,\n make: () => T,\n parent: HTMLElement = dom.hover,\n ) => {\n if (!pool[i]) {\n pool[i] = make();\n parent.appendChild(pool[i]);\n }\n pool[i].style.display = \"block\";\n return pool[i];\n };\n\n function renderHover() {\n const sc = scales;\n const marksShown =\n !!hover &&\n !!sc &&\n !!shownMarks &&\n shownMarks.scales === sc &&\n shownMarks.model === model &&\n sameHover(shownMarks.event, hover.event);\n // pointer moves over the same points: the markers stay where they are\n if (!marksShown) renderMarks(sc);\n\n const tip = dom.tooltip;\n if (!hover || !sc || !tooltipOptions() || drag?.moved || pointDrag?.moved) {\n tip.style.display = \"none\";\n return;\n }\n const custom = tooltipOptions()?.render;\n let w: number;\n let h: number;\n if (\n !custom &&\n shownTip &&\n shownTip.model === model &&\n shownTip.yTicks === yTicks &&\n sameHover(shownTip.event, hover.event) &&\n tip.style.display === \"block\"\n ) {\n // same content: only the position follows the pointer\n w = shownTip.width;\n h = shownTip.height;\n } else {\n shownTip = null;\n const content = tooltipNode(hover.event);\n if (content === null || content === \"\") {\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 tip.style.display = \"block\";\n w = tip.offsetWidth;\n h = tip.offsetHeight;\n if (!custom)\n shownTip = { event: hover.event, model, yTicks, width: w, height: h };\n }\n const stageW = dom.stage.clientWidth;\n const stageH = dom.stage.clientHeight;\n let left = hover.anchorX + 16;\n if (left + w > stageW - 4) left = hover.anchorX - 16 - w;\n left = Math.max(4, Math.min(left, stageW - w - 4));\n const top = Math.max(4, Math.min(hover.anchorY - h / 2, stageH - h - 4));\n tip.style.transform = `translate(${Math.round(left)}px, ${Math.round(top)}px)`;\n }\n\n /** Crosshair, point markers, bar bands and heatmap cell outlines */\n function renderMarks(sc: Scales | null) {\n let markerCount = 0;\n let bandCount = 0;\n let cellCount = 0;\n shownMarks = null;\n dom.crosshair.style.display = \"none\";\n if (hover && sc) {\n shownMarks = { event: hover.event, model, scales: sc };\n const { plot } = sc;\n dom.hover.style.width = `${dom.stage.clientWidth}px`;\n dom.hover.style.height = `${dom.stage.clientHeight}px`;\n if (showsCrosshair(model, hover.event, options.crosshair)) {\n const first = hover.event.items[0];\n const cx = sc.xToPx(first.x);\n if (cx >= plot.x && cx <= plot.x + plot.width) {\n styleElement(dom.crosshair, {\n display: \"block\",\n left: `${Math.round(cx)}px`,\n top: `${plot.y}px`,\n height: `${plot.height}px`,\n });\n }\n }\n for (const mark of hoverMarks(model, sc, hover.event)) {\n if (mark.kind === \"band\" || mark.kind === \"cell\") {\n const el =\n mark.kind === \"band\"\n ? pooled(bands, bandCount++, () => createBand(doc), dom.underlay)\n : pooled(cells, cellCount++, () =>\n styleElement(createBand(doc), {\n background: \"transparent\",\n borderRadius: \"3px\",\n boxShadow:\n \"0 0 0 1.5px var(--surface-color, var(--background-color, #fff)), 0 0 0 3px color-mix(in srgb, var(--text-color, #1f2937) 55%, transparent)\",\n }),\n );\n styleElement(el, {\n left: `${mark.x}px`,\n top: `${mark.y}px`,\n width: `${mark.width}px`,\n height: `${mark.height}px`,\n });\n continue;\n }\n const el = pooled(markers, markerCount++, () => createMarker(doc));\n styleElement(el, {\n left: `${mark.x}px`,\n top: `${mark.y}px`,\n width: `${mark.size}px`,\n height: `${mark.size}px`,\n background: mark.color,\n boxShadow: `0 0 0 4px ${mark.halo}`,\n });\n }\n }\n for (let i = markerCount; i < markers.length; i++)\n markers[i].style.display = \"none\";\n for (let i = bandCount; i < bands.length; i++)\n bands[i].style.display = \"none\";\n for (let i = cellCount; i < cells.length; i++)\n cells[i].style.display = \"none\";\n }\n\n // ---------------------------------------------------------- interaction\n\n const setViewInternal = (next: ChartView, notify: boolean) => {\n const { base, minSpan } = model;\n view = {\n x: clampRange(next.x, base.x, minSpan.x),\n y: clampRange(next.y, base.y, minSpan.y),\n };\n zoomed = !sameRange(view.x, base.x) || !sameRange(view.y, base.y);\n const it = interaction();\n dom.stage.style.cursor = zoomed && it?.pan ? \"grab\" : \"\";\n if (notify) emit(\"zoom\", copyView(view));\n invalidate();\n };\n\n const zoomAt = (px: number, py: number, factor: number) => {\n const sc = scales;\n if (!sc) return;\n const next = copyView(view);\n if (model.zoom.x) next.x = zoomRange(view.x, sc.pxToX(px), factor);\n if (model.zoom.y) next.y = zoomRange(view.y, sc.pxToY(py), factor);\n setViewInternal(next, true);\n };\n\n const localPoint = (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 inPlot = (x: number, y: number) => {\n const p = scales?.plot;\n return (\n !!p && x >= p.x && x <= p.x + p.width && y >= p.y && y <= p.y + p.height\n );\n };\n\n const dataAt = (x: number, y: number) => {\n const sc = scales;\n if (!sc) return null;\n const { plot } = sc;\n const cx = Math.max(plot.x, Math.min(plot.x + plot.width, x));\n const cy = Math.max(plot.y, Math.min(plot.y + plot.height, y));\n return { x: sc.pxToX(cx), y: sc.pxToY(cy) };\n };\n\n const moveGhost = (x: number, y: number, color: string | null) => {\n if (color === null) {\n if (ghost) ghost.style.display = \"none\";\n return;\n }\n if (!ghost) {\n ghost = createMarker(doc);\n dom.hover.appendChild(ghost);\n }\n const s = model.series.find((series) => series.type === \"scatter\");\n const size = (s?.pointSize ?? 8) + 8;\n dom.hover.style.width = `${dom.stage.clientWidth}px`;\n dom.hover.style.height = `${dom.stage.clientHeight}px`;\n styleElement(ghost, {\n display: \"block\",\n left: `${x}px`,\n top: `${y}px`,\n width: `${size}px`,\n height: `${size}px`,\n background: color,\n });\n };\n\n const onPointerMove = (event: PointerEvent) => {\n const { x, y } = localPoint(event);\n if (pointDrag && pointDrag.id === event.pointerId) {\n if (\n !pointDrag.moved &&\n Math.hypot(x - pointDrag.x, y - pointDrag.y) > 3\n ) {\n pointDrag.moved = true;\n dom.stage.setPointerCapture?.(event.pointerId);\n dom.stage.style.cursor = \"grabbing\";\n }\n if (pointDrag.moved) {\n const at = dataAt(x, y);\n if (at) {\n moveGhost(x, y, pointDrag.item.color);\n renderHover();\n emit(\"drag\", { item: pointDrag.item, x: at.x, y: at.y });\n }\n }\n return;\n }\n if (drag && drag.id === event.pointerId) {\n const dx = x - drag.x;\n const dy = y - drag.y;\n if (!drag.moved && Math.hypot(dx, dy) > 3) {\n const it = interaction();\n if (zoomed && it?.pan) {\n drag.moved = true;\n dom.stage.setPointerCapture?.(event.pointerId);\n dom.stage.style.cursor = \"grabbing\";\n }\n }\n if (drag.moved && scales) {\n const next = copyView(drag.view);\n if (model.zoom.x)\n next.x = panRange(\n drag.view.x,\n -dx * scales.xPerPx * (model.x.reverse ? -1 : 1),\n );\n if (model.zoom.y)\n next.y = panRange(\n drag.view.y,\n dy * scales.yPerPx * (model.y.reverse ? -1 : 1),\n );\n setViewInternal(next, true);\n return;\n }\n }\n const event2 = hitAt(x, y);\n setHover(\n event2\n ? { event: event2, anchorX: x, anchorY: y, keyboard: false }\n : null,\n );\n if (!drag && interaction()?.dragPoints) {\n dom.stage.style.cursor = draggableAt(x, y)\n ? \"grab\"\n : zoomed && interaction()?.pan\n ? \"grab\"\n : \"\";\n }\n };\n\n const onPointerDown = (event: PointerEvent) => {\n if (event.button !== 0) return;\n const { x, y } = localPoint(event);\n if (!inPlot(x, y)) return;\n const draggable = draggableAt(x, y);\n if (draggable) {\n pointDrag = { id: event.pointerId, item: draggable, x, y, moved: false };\n return;\n }\n drag = { id: event.pointerId, x, y, view: copyView(view), moved: false };\n };\n\n const onPointerUp = (event: PointerEvent) => {\n if (pointDrag && pointDrag.id === event.pointerId) {\n const { item, moved } = pointDrag;\n pointDrag = null;\n if (dom.stage.hasPointerCapture?.(event.pointerId)) {\n dom.stage.releasePointerCapture(event.pointerId);\n }\n moveGhost(0, 0, null);\n const { x, y } = localPoint(event);\n dom.stage.style.cursor = draggableAt(x, y) ? \"grab\" : \"\";\n if (moved) {\n const at = dataAt(x, y);\n if (at && event.type !== \"pointercancel\")\n emit(\"drop\", { item, x: at.x, y: at.y });\n renderHover();\n } else {\n const hit = hitAt(x, y);\n if (hit) emit(\"click\", hit);\n }\n return;\n }\n if (!drag || drag.id !== event.pointerId) return;\n const moved = drag.moved;\n drag = null;\n if (dom.stage.hasPointerCapture?.(event.pointerId)) {\n dom.stage.releasePointerCapture(event.pointerId);\n }\n dom.stage.style.cursor = zoomed && interaction()?.pan ? \"grab\" : \"\";\n if (!moved) {\n const { x, y } = localPoint(event);\n const hit = hitAt(x, y);\n if (hit) emit(\"click\", hit);\n else if (event.type !== \"pointercancel\" && inPlot(x, y)) {\n const at = dataAt(x, y);\n if (at) emit(\"plotClick\", at);\n }\n } else {\n renderHover();\n }\n };\n\n const onPointerLeave = () => {\n if (!drag?.moved && !pointDrag?.moved) setHover(null);\n };\n\n const onWheel = (event: WheelEvent) => {\n const it = interaction();\n if (!it || it.zoom === false || (!model.zoom.x && !model.zoom.y)) return;\n const { x, y } = localPoint(event);\n if (!inPlot(x, y)) return;\n const modifier = event.ctrlKey || event.metaKey;\n if (it.wheel === \"always\" || modifier) {\n event.preventDefault();\n zoomAt(\n x,\n y,\n wheelFactor(\n event.deltaY,\n event.deltaMode,\n event.ctrlKey && !event.metaKey,\n ),\n );\n } else if (\n zoomed &&\n model.zoom.x &&\n scales &&\n Math.abs(event.deltaX) > Math.abs(event.deltaY)\n ) {\n event.preventDefault();\n const next = copyView(view);\n next.x = panRange(\n view.x,\n event.deltaX * scales.xPerPx * (model.x.reverse ? -1 : 1),\n );\n setViewInternal(next, true);\n }\n };\n\n const onDoubleClick = (event: MouseEvent) => {\n const { x, y } = localPoint(event);\n if (interaction() && zoomed && inPlot(x, y)) resetZoom();\n };\n\n /** Keyboard: moves along the first visible series (or the one in focus) */\n const moveFocus = (step: number) => {\n const sc = scales;\n if (!sc) return;\n const current = hover?.keyboard ? hover.event.items[0] : null;\n const series =\n (current && model.series[current.seriesIndex]) ??\n model.series.find((s) => !s.hidden && s.cols.count > 0);\n if (!series) return;\n const { x, y, count } = series.cols;\n let index: number;\n if (current) {\n index = current.index + step;\n } else {\n // first point inside the view\n index = series.cols.sorted ? lowerBound(x, count, view.x[0]) : 0;\n if (step < 0)\n index = series.cols.sorted\n ? lowerBound(x, count, view.x[1]) - 1\n : count - 1;\n }\n while (index >= 0 && index < count && !Number.isFinite(y[index]))\n index += step || 1;\n if (index < 0 || index >= count) return;\n // keep the point visible\n let current2 = sc;\n if (model.zoom.x && (x[index] < view.x[0] || x[index] > view.x[1])) {\n const span = view.x[1] - view.x[0];\n setViewInternal(\n { x: [x[index] - span / 2, x[index] + span / 2], y: view.y },\n true,\n );\n current2 = scales = createScales(\n sc.plot,\n view,\n model.x.reverse,\n model.y.reverse,\n );\n }\n const p = pointOf(series, index, current2);\n const leadItem = hoverItemOf(series, index);\n const others =\n model.tooltipMode === \"axis\" && series.type !== \"scatter\"\n ? (hitAt(p.px, p.py)?.items ?? []).filter(\n (it) => it.seriesIndex !== series.index,\n )\n : [];\n const event: ChartHoverEvent = {\n items: [leadItem, ...others],\n x: leadItem.x,\n xLabel: xTicks?.formatValue(leadItem.x) ?? String(leadItem.x),\n };\n setHover({ event, anchorX: p.px, anchorY: p.py, keyboard: true });\n const it = leadItem;\n dom.live.textContent = `${it.seriesName}: ${event.xLabel}, ${yTicks?.formatValue(it.y) ?? it.y}${it.label ? ` (${it.label})` : \"\"}`;\n };\n\n const onKeyDown = (event: KeyboardEvent) => {\n if (!interaction()?.keyboard) return;\n const center = () => {\n const p = scales?.plot;\n return p ? [p.x + p.width / 2, p.y + p.height / 2] : [0, 0];\n };\n switch (event.key) {\n case \"ArrowRight\":\n case \"ArrowLeft\":\n event.preventDefault();\n moveFocus((event.key === \"ArrowRight\") !== model.x.reverse ? 1 : -1);\n break;\n case \"+\":\n case \"=\": {\n if (!model.zoom.x && !model.zoom.y) return;\n event.preventDefault();\n const [cx, cy] = center();\n zoomAt(cx, cy, 0.8);\n break;\n }\n case \"-\":\n case \"_\": {\n if (!model.zoom.x && !model.zoom.y) return;\n event.preventDefault();\n const [cx, cy] = center();\n zoomAt(cx, cy, 1.25);\n break;\n }\n case \"0\":\n event.preventDefault();\n resetZoom();\n break;\n case \"Escape\":\n if (hover) {\n event.preventDefault();\n setHover(null);\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 if (visible)\n dom.stage.style.boxShadow = \"0 0 0 2px var(--primary-color, #4f46e5)\";\n };\n\n const onBlur = () => {\n dom.stage.style.boxShadow = \"\";\n if (hover?.keyboard) setHover(null);\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\", onPointerUp);\n stage.addEventListener(\"pointerleave\", onPointerLeave);\n stage.addEventListener(\"wheel\", onWheel, { passive: false });\n stage.addEventListener(\"dblclick\", onDoubleClick);\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(() => invalidate())\n : null;\n resizeObserver?.observe(dom.stage);\n\n const refreshTheme = () => {\n if (destroyed) return;\n const next = readTheme(dom.root, options.palette);\n // the watcher fires on any class / style change of <html> / <body>:\n // keep the GPU buffers unless a color really changed\n if (themeColorsChanged(theme, next)) themeVersion++;\n theme = next;\n rebuild();\n };\n const unwatchTheme = watchTheme(refreshTheme);\n\n // ------------------------------------------------------------- renderer\n\n const initRenderer = async (exclude: Set<ChartRendererKind> = new Set()) => {\n const token = ++rendererToken;\n const next = await createRenderer(\n options.renderer ?? \"auto\",\n () => createDataCanvas(doc),\n (kind) => {\n if (destroyed || renderer?.kind !== kind) return;\n renderer.destroy();\n renderer.canvas.remove();\n renderer = null;\n void initRenderer(new Set([...exclude, kind]));\n },\n exclude,\n );\n if (destroyed || token !== rendererToken) {\n next?.destroy();\n return;\n }\n if (renderer) {\n renderer.destroy();\n renderer.canvas.remove();\n }\n renderer = next;\n if (next) {\n dom.root.dataset.renderer = next.kind;\n dom.stage.insertBefore(next.canvas, dom.foreground);\n itemsDirty = true;\n emit(\"renderer\", next.kind);\n }\n resolveReady(next?.kind ?? null);\n invalidate();\n };\n\n // ------------------------------------------------------------------ api\n\n function resetZoom() {\n if (!zoomed) return;\n setViewInternal(copyView(model.base), true);\n }\n\n rebuild();\n void initRenderer();\n\n const instance: ChartInstance = {\n setOptions(next) {\n if (destroyed) return;\n const previous = options;\n options = next;\n if ((next.palette ?? []).join() !== (previous.palette ?? []).join()) {\n theme = readTheme(dom.root, next.palette);\n themeVersion++;\n }\n if ((next.renderer ?? \"auto\") !== (previous.renderer ?? \"auto\"))\n void initRenderer();\n rebuild();\n },\n resize() {\n invalidate();\n },\n resetZoom,\n getView: () => copyView(view),\n setView(next) {\n if (destroyed) return;\n setViewInternal({ x: next.x ?? view.x, y: next.y ?? view.y }, false);\n },\n getRenderer: () => renderer?.kind ?? null,\n getPlotRect() {\n const rect = plotRect();\n return rect\n ? { x: rect[0], y: rect[1], width: rect[2], height: rect[3] }\n : null;\n },\n toPixel(x, y) {\n if (!scales) return null;\n return {\n x: scales.xToPx(x) + dom.stage.offsetLeft,\n y: scales.yToPx(y) + dom.stage.offsetTop,\n };\n },\n fromPixel(x, y) {\n if (!scales) return null;\n return {\n x: scales.pxToX(x - dom.stage.offsetLeft),\n y: scales.pxToY(y - dom.stage.offsetTop),\n };\n },\n ready,\n refreshTheme,\n on(type, listener) {\n let set = listeners[type] as Set<typeof listener> | undefined;\n if (!set) {\n set = new Set();\n (listeners as Record<string, unknown>)[type] = set;\n }\n set.add(listener);\n return () => {\n set.delete(listener);\n };\n },\n destroy() {\n if (destroyed) return;\n destroyed = true;\n if (frameId) {\n if (win?.cancelAnimationFrame) win.cancelAnimationFrame(frameId);\n else clearTimeout(frameId);\n }\n resizeObserver?.disconnect();\n unwatchTheme();\n stage.removeEventListener(\"wheel\", onWheel);\n renderer?.destroy();\n renderer = null;\n dom.root.remove();\n for (const key of Object.keys(listeners)) {\n delete (listeners as Record<string, unknown>)[key];\n }\n },\n };\n return instance;\n};\n"],"mappings":"2SAwEA,IAAM2C,EAAO,IAAcC,EAAE,GAAKA,EAAE,IAAM,EACpCC,EAAY,IAA6B,CAC7C,EAAG,CAACC,EAAE,EAAE,GAAIA,EAAE,EAAE,EAAE,EAClB,EAAG,CAACA,EAAE,EAAE,GAAIA,EAAE,EAAE,EAAE,CACpB,GAMaC,GACX,EACA,IACkB,CAClB,IAAMC,EAAMC,EAAU,cAChBC,E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IAAMmE,KAAO,OAAO,KAAKhE,CAAS,EACrC,OAAQA,EAAsCgE,EAFhC,CAIlB,CAEK,CACT"}
|
|
1
|
+
{"version":3,"file":"chart.cjs","names":["createChartDom","readTheme","buildModel","clampRange","sameRange","itemsSignature","resolveAnnotations","legendShown","colorLegend","legendShape","swatch","chartAriaLabel","font","layoutChart","collectPointLabels","connectorSegments","cellStyleKey","buildItems","hitTest","sameHover","tooltipContent","crosshairAt","hoverMarks","createBand","styleElement","createMarker","heatPosition","toData","zoomRange","fromPlotY","panRange","wheelFactor","lowerBound","createScales","pointOf","hoverItemOf","themeColorsChanged","watchTheme","watchLocale","createRenderer","createDataCanvas","toScreen","toPlotY","require_data","require_dom","require_layout","require_items","require_locale","require_labels","require_model","require_overlay","require_detect","require_scene","require_signature","require_theme","require_viewport","mid","r","copyView","v","createChart","doc","container","win","dom","cache","hidden","listeners","options","initialOptions","theme","model","view","zoomed","origin","items","itemsDirty","version","annotations","scales","xTicks","yTicks","y2Ticks","renderer","rendererToken","destroyed","frameId","hover","lastPlot","pointDrag","ghost","drag","markers","bands","cells","guides","legendCaret","cellKey","themeVersion","itemsSignatureKey","legendKey","shownMarks","shownTip","resolveReady","ready","resolve","emit","type","listener","event","interactionOf","interactionValue","interaction","value","o","tooltipOptions","invalidate","frame","rebuild","zoom","base","minSpan","signature","index","renderLegend","updateAccessibility","ensureOrigin","far","legendOption","named","s","show","config","toggle","bottom","colors","key","l","focused","ramp","first","last","bar","tick","text","el","item","keyboard","sizeCanvas","w","width","dpr","h","height","canvas","transformFor","scale","range","offset","reverse","bg","fg","layout","rect","plotRect","transposed","cw","plot","ch","bw","bh","density","xScale","xOffset","yScale","yOffset","renderHover","hitAt","px","py","p","draggableAt","it","setHover","changed","next","tooltipNode","custom","content","fragment","header","sub","swatches","row","grid","cell","pooled","pool","i","make","parent","sc","renderMarks","tip","stageW","stageH","left","top","markerCount","bandCount","cellCount","guideCount","renderLegendCaret","guide","line","mark","caret","setViewInternal","notify","zoomAt","at","factor","localPoint","inPlot","x","y","dataAt","cx","cy","moveGhost","color","size","series","onPointerMove","dx","dy","from","to","event2","onPointerDown","draggable","onPointerUp","moved","hit","onPointerLeave","onWheel","modifier","onDoubleClick","resetZoom","moveFocus","current","step","count","current2","span","leadItem","onKeyDown","center","onFocus","visible","onBlur","stage","resizeObserver","refreshTheme","unwatchTheme","unwatchLocale","initRenderer","token","kind","exclude","previous","set"],"sources":["../../../../charts/src/engine/chart.ts"],"sourcesContent":["// createChart: mounts a chart in a container and keeps it in sync with its\n// options, its size, the theme and the user's interactions.\n\nimport type { AxisTicks } from \"./axis\";\nimport { lowerBound } from \"./data\";\nimport {\n createBand,\n createChartDom,\n createDataCanvas,\n createMarker,\n styleElement,\n swatch,\n} from \"./dom\";\nimport {\n buildItems,\n cellStyleKey,\n type Origin,\n type PixelDensity,\n} from \"./items\";\nimport { chartAriaLabel } from \"./labels\";\nimport { createScales, toData, toScreen, type Scales } from \"./layout\";\nimport { watchLocale } from \"./locale\";\nimport {\n buildModel,\n fromPlotY,\n heatPosition,\n toPlotY,\n type ChartModel,\n type DataCache,\n} from \"./model\";\nimport {\n drawBackground,\n drawForeground,\n font,\n type ResolvedAnnotation,\n} from \"./overlay\";\nimport { createRenderer } from \"./renderers/detect\";\nimport type { ChartRenderer, RenderItem } from \"./renderers/types\";\nimport {\n collectPointLabels,\n colorLegend,\n connectorSegments,\n crosshairAt,\n hitTest,\n hoverItemOf,\n hoverMarks,\n layoutChart,\n legendShape,\n legendShown,\n pointOf,\n resolveAnnotations,\n sameHover,\n tooltipContent,\n} from \"./scene\";\nimport { itemsSignature } from \"./signature\";\nimport {\n readTheme,\n themeColorsChanged,\n watchTheme,\n type ChartTheme,\n} from \"./theme\";\nimport type {\n ChartEventMap,\n ChartHoverEvent,\n ChartHoverItem,\n ChartInstance,\n ChartInteractionOptions,\n ChartOptions,\n ChartRendererKind,\n ChartTooltipOptions,\n ChartView,\n} from \"./types\";\nimport {\n clampRange,\n panRange,\n sameRange,\n wheelFactor,\n zoomRange,\n type Range,\n} from \"./viewport\";\n\ninterface HoverState {\n event: ChartHoverEvent;\n /** Tooltip anchor in stage pixels */\n anchorX: number;\n anchorY: number;\n keyboard: boolean;\n}\n\nconst mid = (r: Range) => (r[0] + r[1]) / 2;\nconst copyView = (v: ChartView): ChartView => ({\n x: [v.x[0], v.x[1]],\n y: [v.y[0], v.y[1]],\n});\n\n/**\n * Creates a chart inside `container` (which must have a size). The data\n * layer uses WebGPU when available, then WebGL2, then WebGL, then Canvas2D.\n */\nexport const createChart = (\n container: HTMLElement,\n initialOptions: ChartOptions,\n): ChartInstance => {\n const doc = container.ownerDocument;\n const win = doc.defaultView;\n const dom = createChartDom(container);\n const cache: DataCache = new Map();\n const hidden = new Set<string>();\n const listeners: {\n [K in keyof ChartEventMap]?: Set<(event: ChartEventMap[K]) => void>;\n } = {};\n\n let options = initialOptions;\n let theme: ChartTheme = readTheme(dom.root, options.palette);\n let model: ChartModel;\n let view: ChartView = { x: [0, 1], y: [0, 1] };\n let zoomed = false;\n let origin: Origin = { x: 0, y: 0 };\n let items: RenderItem[] = [];\n let itemsDirty = true;\n let version = 0;\n let annotations: ResolvedAnnotation[] = [];\n let scales: Scales | null = null;\n let xTicks: AxisTicks | null = null;\n let yTicks: AxisTicks | null = null;\n let y2Ticks: AxisTicks | null = null;\n let renderer: ChartRenderer | null = null;\n let rendererToken = 0;\n let destroyed = false;\n let frameId = 0;\n let hover: HoverState | null = null;\n let lastPlot = \"\";\n let pointDrag: {\n id: number;\n item: ChartHoverItem;\n x: number;\n y: number;\n moved: boolean;\n } | null = null;\n let ghost: HTMLDivElement | null = null;\n let drag: {\n id: number;\n x: number;\n y: number;\n view: ChartView;\n moved: boolean;\n } | null = null;\n const markers: HTMLDivElement[] = [];\n const bands: HTMLDivElement[] = [];\n const cells: HTMLDivElement[] = [];\n const guides: HTMLDivElement[] = [];\n /** Hover caret of the color legend (heatmaps) */\n let legendCaret: HTMLDivElement | null = null;\n let cellKey = \"\";\n let themeVersion = 0;\n let itemsSignatureKey = \"\";\n let legendKey = \"\";\n /** What the hover layer shows: kept while the hovered points are the same */\n let shownMarks: {\n event: ChartHoverEvent;\n model: ChartModel;\n scales: Scales;\n } | null = null;\n let shownTip: {\n event: ChartHoverEvent;\n model: ChartModel;\n yTicks: AxisTicks | null;\n width: number;\n height: number;\n } | null = null;\n\n let resolveReady: (kind: ChartRendererKind | null) => void = () => {};\n const ready = new Promise<ChartRendererKind | null>((resolve) => {\n resolveReady = resolve;\n });\n\n const emit = <K extends keyof ChartEventMap>(\n type: K,\n event: ChartEventMap[K],\n ) => {\n listeners[type]?.forEach((listener) => listener(event));\n };\n\n let interactionOf: ChartOptions | null = null;\n let interactionValue: Required<ChartInteractionOptions> | null = null;\n /** Resolved `interaction` option (cached: read on every pointer move) */\n const interaction = (): Required<ChartInteractionOptions> | null => {\n if (interactionOf === options) return interactionValue;\n interactionOf = options;\n const value = options.interaction;\n if (value === false) return (interactionValue = null);\n const o = typeof value === \"object\" ? value : {};\n return (interactionValue = {\n zoom: o.zoom ?? true,\n wheel: o.wheel ?? \"modifier\",\n pan: o.pan ?? true,\n keyboard: o.keyboard ?? true,\n dragPoints: o.dragPoints ?? false,\n });\n };\n\n const tooltipOptions = (): ChartTooltipOptions | null =>\n options.tooltip === false\n ? null\n : typeof options.tooltip === \"object\"\n ? options.tooltip\n : {};\n\n const invalidate = () => {\n if (destroyed || frameId) return;\n frameId = win?.requestAnimationFrame\n ? win.requestAnimationFrame(frame)\n : (setTimeout(frame, 16) as unknown as number);\n };\n\n // ---------------------------------------------------------------- model\n\n const rebuild = () => {\n model = buildModel(options, theme, hidden, cache);\n const { base, zoom, minSpan } = model;\n if (!zoomed) {\n view = copyView(base);\n } else {\n view = {\n x: zoom.x ? clampRange(view.x, base.x, minSpan.x) : [...base.x],\n y: zoom.y ? clampRange(view.y, base.y, minSpan.y) : [...base.y],\n };\n zoomed = !sameRange(view.x, base.x) || !sameRange(view.y, base.y);\n }\n // Unchanged data and styles (e.g. a React re-render): keep the GPU\n // buffers and the hover state\n const signature = itemsSignature(\n model,\n themeVersion,\n (index) => options.series[index]?.stack,\n );\n if (signature !== itemsSignatureKey) {\n itemsSignatureKey = signature;\n origin = { x: mid(base.x), y: mid(base.y) };\n itemsDirty = true;\n if (hover && !hover.keyboard) hover = null;\n }\n annotations = resolveAnnotations(\n options.annotations,\n theme,\n model.y.type === \"log\" ? Math.log10 : undefined,\n );\n renderLegend();\n updateAccessibility();\n invalidate();\n };\n\n /** float32 positions lose precision far from the origin: re-center when deeply zoomed */\n const ensureOrigin = () => {\n const far = (r: Range, o: number) =>\n Math.max(Math.abs(r[0] - o), Math.abs(r[1] - o)) > (r[1] - r[0]) * 2000;\n if (far(view.x, origin.x) || far(view.y, origin.y)) {\n origin = { x: mid(view.x), y: mid(view.y) };\n itemsDirty = true;\n }\n };\n\n // --------------------------------------------------------------- legend\n\n const renderLegend = () => {\n const legendOption = options.legend;\n const named = options.series.filter((s) => s.name).length;\n const show = legendShown(legendOption, model, named);\n const config = typeof legendOption === \"object\" ? legendOption : {};\n const toggle = config.toggle ?? true;\n const bottom = config.position === \"bottom\";\n const colors = show ? colorLegend(model) : null;\n // rebuild the DOM only when what it shows changed\n let key = `${show}|${bottom}|${toggle}`;\n if (colors) {\n key += `\\n${colors.stops.join(\";\")}|${colors.labels.map((l) => l.text).join(\";\")}`;\n } else if (show) {\n for (const s of model.series)\n key += `\\n${s.id}\\u0001${s.name}\\u0001${s.colorCss}\\u0001${legendShape(s.type)}\\u0001${s.hidden}`;\n }\n if (key === legendKey) return;\n legendKey = key;\n const focused = [...dom.legend.children].indexOf(\n doc.activeElement as Element,\n );\n dom.legend.replaceChildren();\n legendCaret = null;\n dom.legend.style.display = show ? \"flex\" : \"none\";\n if (!show) return;\n dom.legend.style.order = bottom ? \"1\" : \"0\";\n dom.legend.style.padding = bottom ? \"8px 4px 0\" : \"0 4px 8px\";\n if (colors) {\n // visual map: the ramp with its values, the hovered value marked\n dom.legend.style.justifyContent = \"flex-end\";\n const ramp = doc.createElement(\"div\");\n styleElement(ramp, {\n display: \"flex\",\n alignItems: \"center\",\n gap: \"8px\",\n color: \"var(--text-secondary-color, #6b7280)\",\n fontSize: \"11px\",\n fontVariantNumeric: \"tabular-nums\",\n });\n const first = colors.labels[0];\n const last = colors.labels[colors.labels.length - 1];\n const bar = doc.createElement(\"div\");\n styleElement(bar, {\n position: \"relative\",\n width: \"160px\",\n height: \"8px\",\n borderRadius: \"4px\",\n background: `linear-gradient(to right, ${colors.stops.join(\", \")})`,\n boxShadow:\n \"inset 0 0 0 1px color-mix(in srgb, var(--text-color, #1f2937) 8%, transparent)\",\n });\n if (colors.labels.length > 2) {\n const tick = doc.createElement(\"div\");\n styleElement(tick, {\n position: \"absolute\",\n left: \"50%\",\n top: \"-2px\",\n width: \"1px\",\n height: \"12px\",\n background:\n \"color-mix(in srgb, var(--text-color, #1f2937) 35%, transparent)\",\n });\n bar.appendChild(tick);\n }\n legendCaret = doc.createElement(\"div\");\n styleElement(legendCaret, {\n position: \"absolute\",\n top: \"-3px\",\n width: \"4px\",\n height: \"14px\",\n marginLeft: \"-2px\",\n borderRadius: \"2px\",\n background: \"var(--text-color, #1f2937)\",\n boxShadow:\n \"0 0 0 1.5px var(--surface-color, var(--background-color, #fff))\",\n display: \"none\",\n });\n bar.appendChild(legendCaret);\n const text = (value: string) => {\n const el = doc.createElement(\"span\");\n el.textContent = value;\n return el;\n };\n ramp.append(text(first?.text ?? \"\"), bar, text(last?.text ?? \"\"));\n dom.legend.appendChild(ramp);\n return;\n }\n dom.legend.style.justifyContent = \"\";\n for (const s of model.series) {\n const item = doc.createElement(toggle ? \"button\" : \"span\");\n if (item instanceof HTMLButtonElement) {\n item.type = \"button\";\n item.setAttribute(\"aria-pressed\", String(!s.hidden));\n item.addEventListener(\"click\", () => {\n if (hidden.has(s.id)) hidden.delete(s.id);\n else hidden.add(s.id);\n rebuild();\n });\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: toggle ? \"pointer\" : \"default\",\n opacity: s.hidden ? \"0.45\" : \"1\",\n textDecoration: s.hidden ? \"line-through\" : \"none\",\n });\n item.append(\n swatch(doc, s.colorCss, legendShape(s.type)),\n doc.createTextNode(s.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 ?? chartAriaLabel(model),\n );\n const keyboard = interaction()?.keyboard;\n dom.stage.style.touchAction = interaction()?.dragPoints ? \"none\" : \"pan-y\";\n if (keyboard) dom.stage.tabIndex = 0;\n else dom.stage.removeAttribute(\"tabindex\");\n };\n\n // ---------------------------------------------------------------- frame\n\n const sizeCanvas = (\n canvas: HTMLCanvasElement,\n width: number,\n height: number,\n dpr: number,\n ) => {\n const w = Math.max(1, Math.round(width * dpr));\n const h = Math.max(1, Math.round(height * dpr));\n if (canvas.width !== w) canvas.width = w;\n if (canvas.height !== h) canvas.height = h;\n canvas.style.width = `${width}px`;\n canvas.style.height = `${height}px`;\n };\n\n const transformFor = (range: Range, o: number, reverse: boolean) => {\n const scale = 2 / (range[1] - range[0]);\n const offset = (o - range[0]) * scale - 1;\n return reverse ? [-scale, -offset] : [scale, offset];\n };\n\n function frame() {\n frameId = 0;\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 sizeCanvas(dom.background, width, height, dpr);\n sizeCanvas(dom.foreground, width, height, dpr);\n const bg = dom.background.getContext(\"2d\");\n const fg = dom.foreground.getContext(\"2d\");\n\n if (bg) {\n bg.setTransform(dpr, 0, 0, dpr, 0, 0);\n bg.font = font(theme);\n }\n const layout = layoutChart({\n model,\n view,\n theme,\n width,\n height,\n padding: options.padding,\n measure: bg\n ? (text) => bg.measureText(text).width\n : (text) => text.length * theme.fontSize * 0.6,\n });\n const { plot } = layout;\n xTicks = layout.xTicks;\n yTicks = layout.yTicks;\n y2Ticks = layout.y2Ticks;\n scales = layout.scales;\n const rect = plotRect();\n if (rect && rect.join() !== lastPlot) {\n lastPlot = rect.join();\n emit(\"layout\", {\n x: rect[0],\n y: rect[1],\n width: rect[2],\n height: rect[3],\n });\n }\n\n if (bg) {\n drawBackground(bg, {\n width,\n height,\n scales,\n x: model.x,\n y: model.y,\n xTicks,\n yTicks,\n y2: model.y2,\n y2Ticks,\n theme,\n annotations,\n });\n }\n if (fg) {\n fg.setTransform(dpr, 0, 0, dpr, 0, 0);\n drawForeground(fg, {\n width,\n height,\n scales,\n theme,\n annotations,\n pointLabels: collectPointLabels(model, view, scales, yTicks),\n connectors: connectorSegments(model, scales),\n });\n }\n\n if (renderer) {\n const canvas = renderer.canvas;\n // horizontal charts: the data layer is drawn as a vertical chart on a\n // transposed canvas (its x axis runs down the plot, its y axis right)\n const transposed = model.horizontal;\n const cw = transposed ? plot.height : plot.width;\n const ch = transposed ? plot.width : plot.height;\n styleElement(canvas, {\n left: `${plot.x}px`,\n top: `${plot.y}px`,\n width: `${cw}px`,\n height: `${ch}px`,\n transformOrigin: transposed ? \"0 0\" : \"\",\n transform: transposed ? \"matrix(0, 1, 1, 0, 0, 0)\" : \"\",\n });\n const bw = Math.max(1, Math.round(cw * dpr));\n const bh = Math.max(1, Math.round(ch * dpr));\n if (canvas.width !== bw || canvas.height !== bh) renderer.resize(bw, bh);\n ensureOrigin();\n // heatmap cells: their gaps and corners follow their size on screen\n const density: PixelDensity = {\n x: 1 / Math.abs(scales.xPerPx),\n y: 1 / Math.abs(scales.yPerPx),\n };\n const key = cellStyleKey(model, density);\n if (key !== cellKey) {\n cellKey = key;\n itemsDirty = true;\n }\n if (itemsDirty) {\n version++;\n items = buildItems(model, origin, version, density);\n itemsDirty = false;\n }\n const [xScale, xOffset] = transformFor(view.x, origin.x, model.x.reverse);\n const [yScale, yOffset] = transformFor(\n view.y,\n origin.y,\n // the top of the transposed canvas is the left of the plot\n transposed ? !model.y.reverse : model.y.reverse,\n );\n renderer.render(items, {\n transform: { xScale, xOffset, yScale, yOffset },\n width: bw,\n height: bh,\n dpr,\n });\n }\n renderHover();\n }\n\n // ------------------------------------------------------------ hit tests\n\n const hitAt = (px: number, py: number): ChartHoverEvent | null =>\n scales ? hitTest(model, scales, xTicks, px, py) : null;\n\n /** Plot area relative to the container: x, y, width, height */\n const plotRect = (): [number, number, number, number] | null => {\n const p = scales?.plot;\n if (!p) return null;\n return [\n p.x + dom.stage.offsetLeft,\n p.y + dom.stage.offsetTop,\n p.width,\n p.height,\n ];\n };\n\n /** A draggable point under the pointer (`interaction.dragPoints`) */\n const draggableAt = (px: number, py: number) => {\n if (!interaction()?.dragPoints) return null;\n const hit = hitAt(px, py);\n const item = hit?.items.find(\n (it) => model.series[it.seriesIndex].type === \"scatter\",\n );\n return item ?? null;\n };\n\n // ---------------------------------------------------------------- hover\n\n const setHover = (next: HoverState | null) => {\n const changed = !sameHover(hover?.event ?? null, next?.event ?? null);\n hover = next;\n renderHover();\n if (changed) emit(\"hover\", next ? next.event : null);\n };\n\n const tooltipNode = (event: ChartHoverEvent): Node | string | null => {\n const custom = tooltipOptions()?.render;\n if (custom) return custom(event);\n const content = tooltipContent(model, event, yTicks, y2Ticks);\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: content.subtitle ? \"0\" : \"4px\",\n color: \"var(--text-color, #1f2937)\",\n });\n if (content.titleColor)\n header.appendChild(swatch(doc, content.titleColor, \"dot\"));\n header.appendChild(doc.createTextNode(content.title));\n fragment.append(header);\n if (content.subtitle) {\n const sub = doc.createElement(\"div\");\n styleElement(sub, {\n color: \"var(--text-secondary-color, #6b7280)\",\n fontSize: \"11px\",\n margin: \"1px 0 6px\",\n paddingLeft: content.titleColor ? \"14px\" : \"0\",\n });\n sub.textContent = content.subtitle;\n fragment.append(sub);\n }\n if (!content.rows.length) return fragment;\n // a label column and a value column (right-aligned, tabular figures)\n const swatches = content.rows.some((row) => row.color);\n const grid = doc.createElement(\"div\");\n styleElement(grid, {\n display: \"grid\",\n gridTemplateColumns: swatches\n ? \"auto minmax(0, 1fr) auto\"\n : \"minmax(0, 1fr) auto\",\n columnGap: \"0\",\n rowGap: \"2px\",\n alignItems: \"center\",\n });\n for (const row of content.rows) {\n if (swatches) {\n const cell = doc.createElement(\"span\");\n styleElement(cell, {\n display: \"inline-flex\",\n width: \"14px\",\n justifyContent: \"flex-start\",\n });\n if (row.color) cell.appendChild(swatch(doc, row.color, \"dot\"));\n grid.appendChild(cell);\n }\n const n = doc.createElement(\"span\");\n styleElement(n, {\n color: \"var(--text-secondary-color, #6b7280)\",\n paddingRight: \"16px\",\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n });\n n.textContent = row.name;\n const v = doc.createElement(\"span\");\n styleElement(v, {\n fontWeight: \"600\",\n fontVariantNumeric: \"tabular-nums\",\n textAlign: \"right\",\n color: \"var(--text-color, #1f2937)\",\n });\n v.textContent = row.value;\n grid.append(n, v);\n }\n fragment.append(grid);\n return fragment;\n };\n\n const pooled = <T extends HTMLElement>(\n pool: T[],\n i: number,\n make: () => T,\n parent: HTMLElement = dom.hover,\n ) => {\n if (!pool[i]) {\n pool[i] = make();\n parent.appendChild(pool[i]);\n }\n pool[i].style.display = \"block\";\n return pool[i];\n };\n\n function renderHover() {\n const sc = scales;\n const marksShown =\n !!hover &&\n !!sc &&\n !!shownMarks &&\n shownMarks.scales === sc &&\n shownMarks.model === model &&\n sameHover(shownMarks.event, hover.event);\n // pointer moves over the same points: the markers stay where they are\n if (!marksShown) renderMarks(sc);\n\n const tip = dom.tooltip;\n if (!hover || !sc || !tooltipOptions() || drag?.moved || pointDrag?.moved) {\n tip.style.display = \"none\";\n return;\n }\n const custom = tooltipOptions()?.render;\n let w: number;\n let h: number;\n if (\n !custom &&\n shownTip &&\n shownTip.model === model &&\n shownTip.yTicks === yTicks &&\n sameHover(shownTip.event, hover.event) &&\n tip.style.display === \"block\"\n ) {\n // same content: only the position follows the pointer\n w = shownTip.width;\n h = shownTip.height;\n } else {\n shownTip = null;\n const content = tooltipNode(hover.event);\n if (content === null || content === \"\") {\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 tip.style.display = \"block\";\n w = tip.offsetWidth;\n h = tip.offsetHeight;\n if (!custom)\n shownTip = { event: hover.event, model, yTicks, width: w, height: h };\n }\n const stageW = dom.stage.clientWidth;\n const stageH = dom.stage.clientHeight;\n let left = hover.anchorX + 16;\n if (left + w > stageW - 4) left = hover.anchorX - 16 - w;\n left = Math.max(4, Math.min(left, stageW - w - 4));\n const top = Math.max(4, Math.min(hover.anchorY - h / 2, stageH - h - 4));\n tip.style.transform = `translate(${Math.round(left)}px, ${Math.round(top)}px)`;\n }\n\n /** Crosshair, point markers, bar bands and lifted heatmap cells */\n function renderMarks(sc: Scales | null) {\n let markerCount = 0;\n let bandCount = 0;\n let cellCount = 0;\n let guideCount = 0;\n renderLegendCaret();\n shownMarks = null;\n dom.crosshair.style.display = \"none\";\n if (hover && sc) {\n shownMarks = { event: hover.event, model, scales: sc };\n const { plot } = sc;\n dom.hover.style.width = `${dom.stage.clientWidth}px`;\n dom.hover.style.height = `${dom.stage.clientHeight}px`;\n const guide = crosshairAt(model, sc, hover.event, options.crosshair);\n if (guide !== null) {\n const line =\n \"1px dashed color-mix(in srgb, var(--text-secondary-color, #6b7280) 45%, transparent)\";\n styleElement(\n dom.crosshair,\n sc.horizontal\n ? {\n display: \"block\",\n left: `${plot.x}px`,\n top: `${Math.round(guide)}px`,\n width: `${plot.width}px`,\n height: \"0\",\n borderLeft: \"0\",\n borderTop: line,\n }\n : {\n display: \"block\",\n left: `${Math.round(guide)}px`,\n top: `${plot.y}px`,\n width: \"0\",\n height: `${plot.height}px`,\n borderLeft: line,\n borderTop: \"0\",\n },\n );\n }\n for (const mark of hoverMarks(model, sc, hover.event)) {\n if (mark.kind === \"band\" || mark.kind === \"guide\") {\n const el =\n mark.kind === \"band\"\n ? pooled(bands, bandCount++, () => createBand(doc), dom.underlay)\n : pooled(guides, guideCount++, () =>\n styleElement(createBand(doc), {\n borderRadius: \"0\",\n background:\n \"color-mix(in srgb, var(--text-color, #1f2937) 6%, transparent)\",\n }),\n );\n styleElement(el, {\n left: `${mark.x}px`,\n top: `${mark.y}px`,\n width: `${mark.width}px`,\n height: `${mark.height}px`,\n });\n continue;\n }\n if (mark.kind === \"cell\") {\n // the cell lifted above its neighbours, a ring inside its edge\n const el = pooled(cells, cellCount++, () =>\n styleElement(createBand(doc), {\n boxShadow:\n \"0 8px 18px -6px rgba(15, 23, 42, 0.6), 0 0 0 1px rgba(15, 23, 42, 0.12)\",\n outlineStyle: \"solid\",\n outlineWidth: \"1.5px\",\n outlineOffset: \"-4px\",\n transform: \"scale(1.12)\",\n }),\n );\n styleElement(el, {\n left: `${mark.x}px`,\n top: `${mark.y}px`,\n width: `${mark.width}px`,\n height: `${mark.height}px`,\n background: mark.color,\n borderRadius: `${Math.max(mark.radius, 2)}px`,\n outlineColor: mark.ring,\n });\n continue;\n }\n const el = pooled(markers, markerCount++, () => createMarker(doc));\n styleElement(el, {\n left: `${mark.x}px`,\n top: `${mark.y}px`,\n width: `${mark.size}px`,\n height: `${mark.size}px`,\n background: mark.color,\n boxShadow: `0 0 0 4px ${mark.halo}`,\n });\n }\n }\n for (let i = markerCount; i < markers.length; i++)\n markers[i].style.display = \"none\";\n for (let i = bandCount; i < bands.length; i++)\n bands[i].style.display = \"none\";\n for (let i = cellCount; i < cells.length; i++)\n cells[i].style.display = \"none\";\n for (let i = guideCount; i < guides.length; i++)\n guides[i].style.display = \"none\";\n }\n\n /** Marks the hovered heatmap value on the color legend */\n function renderLegendCaret() {\n const caret = legendCaret;\n if (!caret) return;\n const it = hover?.event.items[0];\n const s = it ? model.series[it.seriesIndex] : undefined;\n if (!it || !s || s.type !== \"heatmap\" || it.value === undefined) {\n caret.style.display = \"none\";\n return;\n }\n caret.style.display = \"block\";\n caret.style.left = `${(heatPosition(s, it.value) * 100).toFixed(2)}%`;\n }\n\n // ---------------------------------------------------------- interaction\n\n const setViewInternal = (next: ChartView, notify: boolean) => {\n const { base, minSpan } = model;\n view = {\n x: clampRange(next.x, base.x, minSpan.x),\n y: clampRange(next.y, base.y, minSpan.y),\n };\n zoomed = !sameRange(view.x, base.x) || !sameRange(view.y, base.y);\n const it = interaction();\n dom.stage.style.cursor = zoomed && it?.pan ? \"grab\" : \"\";\n if (notify) emit(\"zoom\", copyView(view));\n invalidate();\n };\n\n const zoomAt = (px: number, py: number, factor: number) => {\n const sc = scales;\n if (!sc) return;\n const next = copyView(view);\n const at = toData(sc, px, py);\n if (model.zoom.x) next.x = zoomRange(view.x, at.x, factor);\n if (model.zoom.y) next.y = zoomRange(view.y, at.y, factor);\n setViewInternal(next, true);\n };\n\n const localPoint = (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 inPlot = (x: number, y: number) => {\n const p = scales?.plot;\n return (\n !!p && x >= p.x && x <= p.x + p.width && y >= p.y && y <= p.y + p.height\n );\n };\n\n const dataAt = (x: number, y: number) => {\n const sc = scales;\n if (!sc) return null;\n const { plot } = sc;\n const cx = Math.max(plot.x, Math.min(plot.x + plot.width, x));\n const cy = Math.max(plot.y, Math.min(plot.y + plot.height, y));\n const p = toData(sc, cx, cy);\n // values of the axes (not logarithms)\n return { x: p.x, y: fromPlotY(model, p.y) };\n };\n\n const moveGhost = (x: number, y: number, color: string | null) => {\n if (color === null) {\n if (ghost) ghost.style.display = \"none\";\n return;\n }\n if (!ghost) {\n ghost = createMarker(doc);\n dom.hover.appendChild(ghost);\n }\n const s = model.series.find((series) => series.type === \"scatter\");\n const size = (s?.pointSize ?? 8) + 8;\n dom.hover.style.width = `${dom.stage.clientWidth}px`;\n dom.hover.style.height = `${dom.stage.clientHeight}px`;\n styleElement(ghost, {\n display: \"block\",\n left: `${x}px`,\n top: `${y}px`,\n width: `${size}px`,\n height: `${size}px`,\n background: color,\n });\n };\n\n const onPointerMove = (event: PointerEvent) => {\n const { x, y } = localPoint(event);\n if (pointDrag && pointDrag.id === event.pointerId) {\n if (\n !pointDrag.moved &&\n Math.hypot(x - pointDrag.x, y - pointDrag.y) > 3\n ) {\n pointDrag.moved = true;\n dom.stage.setPointerCapture?.(event.pointerId);\n dom.stage.style.cursor = \"grabbing\";\n }\n if (pointDrag.moved) {\n const at = dataAt(x, y);\n if (at) {\n moveGhost(x, y, pointDrag.item.color);\n renderHover();\n emit(\"drag\", { item: pointDrag.item, x: at.x, y: at.y });\n }\n }\n return;\n }\n if (drag && drag.id === event.pointerId) {\n const dx = x - drag.x;\n const dy = y - drag.y;\n if (!drag.moved && Math.hypot(dx, dy) > 3) {\n const it = interaction();\n if (zoomed && it?.pan) {\n drag.moved = true;\n dom.stage.setPointerCapture?.(event.pointerId);\n dom.stage.style.cursor = \"grabbing\";\n }\n }\n if (drag.moved && scales) {\n const next = copyView(drag.view);\n const from = toData(scales, drag.x, drag.y);\n const to = toData(scales, x, y);\n if (model.zoom.x) next.x = panRange(drag.view.x, from.x - to.x);\n if (model.zoom.y) next.y = panRange(drag.view.y, from.y - to.y);\n setViewInternal(next, true);\n return;\n }\n }\n const event2 = hitAt(x, y);\n setHover(\n event2\n ? { event: event2, anchorX: x, anchorY: y, keyboard: false }\n : null,\n );\n if (!drag && interaction()?.dragPoints) {\n dom.stage.style.cursor = draggableAt(x, y)\n ? \"grab\"\n : zoomed && interaction()?.pan\n ? \"grab\"\n : \"\";\n }\n };\n\n const onPointerDown = (event: PointerEvent) => {\n if (event.button !== 0) return;\n const { x, y } = localPoint(event);\n if (!inPlot(x, y)) return;\n const draggable = draggableAt(x, y);\n if (draggable) {\n pointDrag = { id: event.pointerId, item: draggable, x, y, moved: false };\n return;\n }\n drag = { id: event.pointerId, x, y, view: copyView(view), moved: false };\n };\n\n const onPointerUp = (event: PointerEvent) => {\n if (pointDrag && pointDrag.id === event.pointerId) {\n const { item, moved } = pointDrag;\n pointDrag = null;\n if (dom.stage.hasPointerCapture?.(event.pointerId)) {\n dom.stage.releasePointerCapture(event.pointerId);\n }\n moveGhost(0, 0, null);\n const { x, y } = localPoint(event);\n dom.stage.style.cursor = draggableAt(x, y) ? \"grab\" : \"\";\n if (moved) {\n const at = dataAt(x, y);\n if (at && event.type !== \"pointercancel\")\n emit(\"drop\", { item, x: at.x, y: at.y });\n renderHover();\n } else {\n const hit = hitAt(x, y);\n if (hit) emit(\"click\", hit);\n }\n return;\n }\n if (!drag || drag.id !== event.pointerId) return;\n const moved = drag.moved;\n drag = null;\n if (dom.stage.hasPointerCapture?.(event.pointerId)) {\n dom.stage.releasePointerCapture(event.pointerId);\n }\n dom.stage.style.cursor = zoomed && interaction()?.pan ? \"grab\" : \"\";\n if (!moved) {\n const { x, y } = localPoint(event);\n const hit = hitAt(x, y);\n if (hit) emit(\"click\", hit);\n else if (event.type !== \"pointercancel\" && inPlot(x, y)) {\n const at = dataAt(x, y);\n if (at) emit(\"plotClick\", at);\n }\n } else {\n renderHover();\n }\n };\n\n const onPointerLeave = () => {\n if (!drag?.moved && !pointDrag?.moved) setHover(null);\n };\n\n const onWheel = (event: WheelEvent) => {\n const it = interaction();\n if (!it || it.zoom === false || (!model.zoom.x && !model.zoom.y)) return;\n const { x, y } = localPoint(event);\n if (!inPlot(x, y)) return;\n const modifier = event.ctrlKey || event.metaKey;\n if (it.wheel === \"always\" || modifier) {\n event.preventDefault();\n zoomAt(\n x,\n y,\n wheelFactor(\n event.deltaY,\n event.deltaMode,\n event.ctrlKey && !event.metaKey,\n ),\n );\n } else if (\n zoomed &&\n model.zoom.x &&\n scales &&\n !scales.horizontal &&\n Math.abs(event.deltaX) > Math.abs(event.deltaY)\n ) {\n event.preventDefault();\n const next = copyView(view);\n next.x = panRange(\n view.x,\n event.deltaX * scales.xPerPx * (model.x.reverse ? -1 : 1),\n );\n setViewInternal(next, true);\n }\n };\n\n const onDoubleClick = (event: MouseEvent) => {\n const { x, y } = localPoint(event);\n if (interaction() && zoomed && inPlot(x, y)) resetZoom();\n };\n\n /** Keyboard: moves along the first visible series (or the one in focus) */\n const moveFocus = (step: number) => {\n const sc = scales;\n if (!sc) return;\n const current = hover?.keyboard ? hover.event.items[0] : null;\n const series =\n (current && model.series[current.seriesIndex]) ??\n model.series.find((s) => !s.hidden && s.cols.count > 0);\n if (!series) return;\n const { x, y, count } = series.cols;\n let index: number;\n if (current) {\n index = current.index + step;\n } else {\n // first point inside the view\n index = series.cols.sorted ? lowerBound(x, count, view.x[0]) : 0;\n if (step < 0)\n index = series.cols.sorted\n ? lowerBound(x, count, view.x[1]) - 1\n : count - 1;\n }\n while (index >= 0 && index < count && !Number.isFinite(y[index]))\n index += step || 1;\n if (index < 0 || index >= count) return;\n // keep the point visible\n let current2 = sc;\n if (model.zoom.x && (x[index] < view.x[0] || x[index] > view.x[1])) {\n const span = view.x[1] - view.x[0];\n setViewInternal(\n { x: [x[index] - span / 2, x[index] + span / 2], y: view.y },\n true,\n );\n current2 = scales = createScales(\n sc.plot,\n view,\n model.x.reverse,\n model.y.reverse,\n model.horizontal,\n );\n }\n const p = pointOf(series, index, current2);\n const leadItem = hoverItemOf(series, index);\n const others =\n model.tooltipMode === \"axis\" && series.type !== \"scatter\"\n ? (hitAt(p.px, p.py)?.items ?? []).filter(\n (it) => it.seriesIndex !== series.index,\n )\n : [];\n const event: ChartHoverEvent = {\n items: [leadItem, ...others],\n x: leadItem.x,\n xLabel: xTicks?.formatValue(leadItem.x) ?? String(leadItem.x),\n };\n setHover({ event, anchorX: p.px, anchorY: p.py, keyboard: true });\n const it = leadItem;\n dom.live.textContent = `${it.seriesName}: ${event.xLabel}, ${yTicks?.formatValue(it.y) ?? it.y}${it.label ? ` (${it.label})` : \"\"}`;\n };\n\n const onKeyDown = (event: KeyboardEvent) => {\n if (!interaction()?.keyboard) return;\n const center = () => {\n const p = scales?.plot;\n return p ? [p.x + p.width / 2, p.y + p.height / 2] : [0, 0];\n };\n switch (event.key) {\n case \"ArrowRight\":\n case \"ArrowLeft\":\n if (model.horizontal) return;\n event.preventDefault();\n moveFocus((event.key === \"ArrowRight\") !== model.x.reverse ? 1 : -1);\n break;\n case \"ArrowDown\":\n case \"ArrowUp\":\n // horizontal charts: the x axis runs down\n if (!model.horizontal) return;\n event.preventDefault();\n moveFocus((event.key === \"ArrowDown\") !== model.x.reverse ? 1 : -1);\n break;\n case \"+\":\n case \"=\": {\n if (!model.zoom.x && !model.zoom.y) return;\n event.preventDefault();\n const [cx, cy] = center();\n zoomAt(cx, cy, 0.8);\n break;\n }\n case \"-\":\n case \"_\": {\n if (!model.zoom.x && !model.zoom.y) return;\n event.preventDefault();\n const [cx, cy] = center();\n zoomAt(cx, cy, 1.25);\n break;\n }\n case \"0\":\n event.preventDefault();\n resetZoom();\n break;\n case \"Escape\":\n if (hover) {\n event.preventDefault();\n setHover(null);\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 if (visible)\n dom.stage.style.boxShadow = \"0 0 0 2px var(--primary-color, #4f46e5)\";\n };\n\n const onBlur = () => {\n dom.stage.style.boxShadow = \"\";\n if (hover?.keyboard) setHover(null);\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\", onPointerUp);\n stage.addEventListener(\"pointerleave\", onPointerLeave);\n stage.addEventListener(\"wheel\", onWheel, { passive: false });\n stage.addEventListener(\"dblclick\", onDoubleClick);\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(() => invalidate())\n : null;\n resizeObserver?.observe(dom.stage);\n\n const refreshTheme = () => {\n if (destroyed) return;\n const next = readTheme(dom.root, options.palette);\n // the watcher fires on any class / style change of <html> / <body>:\n // keep the GPU buffers unless a color really changed\n if (themeColorsChanged(theme, next)) themeVersion++;\n theme = next;\n rebuild();\n };\n const unwatchTheme = watchTheme(refreshTheme);\n // charts without `locale` follow the page language\n const unwatchLocale = watchLocale(() => {\n if (!destroyed && !options.locale) rebuild();\n });\n\n // ------------------------------------------------------------- renderer\n\n const initRenderer = async (exclude: Set<ChartRendererKind> = new Set()) => {\n const token = ++rendererToken;\n const next = await createRenderer(\n options.renderer ?? \"auto\",\n () => createDataCanvas(doc),\n (kind) => {\n if (destroyed || renderer?.kind !== kind) return;\n renderer.destroy();\n renderer.canvas.remove();\n renderer = null;\n void initRenderer(new Set([...exclude, kind]));\n },\n exclude,\n );\n if (destroyed || token !== rendererToken) {\n next?.destroy();\n return;\n }\n if (renderer) {\n renderer.destroy();\n renderer.canvas.remove();\n }\n renderer = next;\n if (next) {\n dom.root.dataset.renderer = next.kind;\n dom.stage.insertBefore(next.canvas, dom.foreground);\n itemsDirty = true;\n emit(\"renderer\", next.kind);\n }\n resolveReady(next?.kind ?? null);\n invalidate();\n };\n\n // ------------------------------------------------------------------ api\n\n function resetZoom() {\n if (!zoomed) return;\n setViewInternal(copyView(model.base), true);\n }\n\n rebuild();\n void initRenderer();\n\n const instance: ChartInstance = {\n setOptions(next) {\n if (destroyed) return;\n const previous = options;\n options = next;\n if ((next.palette ?? []).join() !== (previous.palette ?? []).join()) {\n theme = readTheme(dom.root, next.palette);\n themeVersion++;\n }\n if ((next.renderer ?? \"auto\") !== (previous.renderer ?? \"auto\"))\n void initRenderer();\n rebuild();\n },\n resize() {\n invalidate();\n },\n resetZoom,\n getView: () => copyView(view),\n setView(next) {\n if (destroyed) return;\n setViewInternal({ x: next.x ?? view.x, y: next.y ?? view.y }, false);\n },\n getRenderer: () => renderer?.kind ?? null,\n getPlotRect() {\n const rect = plotRect();\n return rect\n ? { x: rect[0], y: rect[1], width: rect[2], height: rect[3] }\n : null;\n },\n toPixel(x, y) {\n if (!scales) return null;\n const p = toScreen(scales, x, toPlotY(model, y));\n return {\n x: p.x + dom.stage.offsetLeft,\n y: p.y + dom.stage.offsetTop,\n };\n },\n fromPixel(x, y) {\n if (!scales) return null;\n const p = toData(\n scales,\n x - dom.stage.offsetLeft,\n y - dom.stage.offsetTop,\n );\n return { x: p.x, y: fromPlotY(model, p.y) };\n },\n ready,\n refreshTheme,\n on(type, listener) {\n let set = listeners[type] as Set<typeof listener> | undefined;\n if (!set) {\n set = new Set();\n (listeners as Record<string, unknown>)[type] = set;\n }\n set.add(listener);\n return () => {\n set.delete(listener);\n };\n },\n destroy() {\n if (destroyed) return;\n destroyed = true;\n if (frameId) {\n if (win?.cancelAnimationFrame) win.cancelAnimationFrame(frameId);\n else clearTimeout(frameId);\n }\n resizeObserver?.disconnect();\n unwatchTheme();\n unwatchLocale();\n stage.removeEventListener(\"wheel\", onWheel);\n renderer?.destroy();\n renderer = null;\n dom.root.remove();\n for (const key of Object.keys(listeners)) {\n delete (listeners as Record<string, unknown>)[key];\n }\n },\n };\n return instance;\n};\n"],"mappings":"+VAyFA,IAAMwD,EAAO,IAAcC,EAAE,GAAKA,EAAE,IAAM,EACpCC,EAAY,IAA6B,CAC7C,EAAG,CAACC,EAAE,EAAE,GAAIA,EAAE,EAAE,EAAE,EAClB,EAAG,CAACA,EAAE,EAAE,GAAIA,EAAE,EAAE,EAAE,CACpB,GAMaC,GACX,EACA,KACkB,CAClB,IAAMC,E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,EAAI,MAAM,SAChB,EACA,MAAO,CAAE,EAAGoH,EAAE,EAAG,EAAGvJ,EAAAA,UAAU0C,EAAO6G,EAAE,CAAC,CAAE,CAC5C,EACA,SACA,gBACA,GAAG,EAAM,EAAU,CACjB,IAAI2F,EAAM5M,EAAUwC,GAMpB,OALKoK,IACH,EAAM,IAAI,IACV,EAAuCpK,GAAQoK,GAEjDA,EAAI,IAAInK,CAAQ,MACH,CACXmK,EAAI,OAAOnK,CAAQ,CACrB,CACF,EACA,SAAU,CACR,GAAI,GAYJ,CAXA,EAAY,GACRtB,IACEvB,GAAK,qBAAsBA,EAAI,qBAAqBuB,CAAO,EAC1D,aAAaA,CAAO,GAE3BgL,IAAgB,WAAW,EAC3BE,GAAa,EACbC,GAAc,EACdJ,EAAM,oBAAoB,QAAShB,EAAO,EAC1ClK,GAAU,QAAQ,EAClB,EAAW,KACXnB,EAAI,KAAK,OAAO,EAChB,IAAK,IAAMwE,KAAO,OAAO,KAAKrE,CAAS,EACrC,OAAQA,EAAsCqE,EAFhC,CAIlB,CAEK,CACT"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ChartInstance, ChartOptions } from './types.cjs';
|
|
2
2
|
/**
|
|
3
3
|
* Creates a chart inside `container` (which must have a size). The data
|
|
4
|
-
* layer uses WebGPU when available, then WebGL2, then Canvas2D.
|
|
4
|
+
* layer uses WebGPU when available, then WebGL2, then WebGL, then Canvas2D.
|
|
5
5
|
*/
|
|
6
6
|
export declare const createChart: (container: HTMLElement, initialOptions: ChartOptions) => ChartInstance;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ChartInstance, ChartOptions } from './types.js';
|
|
2
2
|
/**
|
|
3
3
|
* Creates a chart inside `container` (which must have a size). The data
|
|
4
|
-
* layer uses WebGPU when available, then WebGL2, then Canvas2D.
|
|
4
|
+
* layer uses WebGPU when available, then WebGL2, then WebGL, then Canvas2D.
|
|
5
5
|
*/
|
|
6
6
|
export declare const createChart: (container: HTMLElement, initialOptions: ChartOptions) => ChartInstance;
|