minerva-design 1.2.0 → 1.4.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 +16 -0
- package/README.md +21 -21
- package/custom-elements.json +13630 -4757
- package/dist/angular/fesm2022/minerva-angular.mjs +6872 -172
- package/dist/angular/fesm2022/minerva-angular.mjs.map +1 -1
- package/dist/angular/types/minerva-angular.d.ts +2240 -0
- package/dist/charts/canvas.d.cts +10 -2
- package/dist/charts/canvas.d.ts +10 -2
- package/dist/charts/core.cjs +1 -1
- package/dist/charts/core.d.cts +9 -3
- package/dist/charts/core.d.ts +9 -3
- package/dist/charts/core.js +19 -6
- package/dist/charts/engine/axis.cjs +1 -1
- package/dist/charts/engine/axis.cjs.map +1 -1
- package/dist/charts/engine/axis.js +6 -6
- 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 +161 -99
- package/dist/charts/engine/canvas.js.map +1 -1
- package/dist/charts/engine/chart.cjs +1 -2
- 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 +390 -349
- 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 +17 -0
- package/dist/charts/engine/color.d.ts +17 -0
- package/dist/charts/engine/color.js +27 -3
- 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 +17 -2
- package/dist/charts/engine/controller.d.ts +17 -2
- package/dist/charts/engine/controller.js +404 -280
- package/dist/charts/engine/controller.js.map +1 -1
- package/dist/charts/engine/curve.cjs +2 -0
- package/dist/charts/engine/curve.cjs.map +1 -0
- package/dist/charts/engine/curve.d.cts +15 -0
- package/dist/charts/engine/curve.d.ts +15 -0
- package/dist/charts/engine/curve.js +56 -0
- package/dist/charts/engine/curve.js.map +1 -0
- package/dist/charts/engine/data.cjs +1 -1
- package/dist/charts/engine/data.cjs.map +1 -1
- package/dist/charts/engine/data.d.cts +21 -2
- package/dist/charts/engine/data.d.ts +21 -2
- package/dist/charts/engine/data.js +117 -43
- package/dist/charts/engine/data.js.map +1 -1
- package/dist/charts/engine/dom.cjs +1 -1
- package/dist/charts/engine/dom.cjs.map +1 -1
- package/dist/charts/engine/dom.d.cts +5 -3
- package/dist/charts/engine/dom.d.ts +5 -3
- package/dist/charts/engine/dom.js +27 -22
- package/dist/charts/engine/dom.js.map +1 -1
- package/dist/charts/engine/format.cjs +1 -1
- package/dist/charts/engine/format.cjs.map +1 -1
- package/dist/charts/engine/format.d.cts +21 -6
- package/dist/charts/engine/format.d.ts +21 -6
- package/dist/charts/engine/format.js +46 -21
- package/dist/charts/engine/format.js.map +1 -1
- package/dist/charts/engine/items.cjs +1 -1
- package/dist/charts/engine/items.cjs.map +1 -1
- package/dist/charts/engine/items.js +290 -62
- 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 +74 -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 +34 -2
- package/dist/charts/engine/layout.d.ts +34 -2
- package/dist/charts/engine/layout.js +53 -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 +68 -3
- package/dist/charts/engine/model.d.ts +68 -3
- package/dist/charts/engine/model.js +332 -108
- 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 +48 -0
- package/dist/charts/engine/orderbook/format.d.ts +48 -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 +703 -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/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 +735 -0
- package/dist/charts/engine/orderbook/types.d.ts +735 -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 +18 -0
- package/dist/charts/engine/overlay.d.ts +18 -0
- package/dist/charts/engine/overlay.js +138 -102
- 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 +319 -5
- package/dist/charts/engine/presets.d.ts +319 -5
- package/dist/charts/engine/presets.js +463 -38
- package/dist/charts/engine/presets.js.map +1 -1
- package/dist/charts/engine/renderers/canvas2d.cjs +1 -1
- package/dist/charts/engine/renderers/canvas2d.cjs.map +1 -1
- package/dist/charts/engine/renderers/canvas2d.js +149 -111
- package/dist/charts/engine/renderers/canvas2d.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.js +18 -15
- 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/range.cjs +1 -1
- package/dist/charts/engine/renderers/range.cjs.map +1 -1
- package/dist/charts/engine/renderers/range.js +4 -4
- package/dist/charts/engine/renderers/range.js.map +1 -1
- package/dist/charts/engine/renderers/shaders.cjs +180 -20
- package/dist/charts/engine/renderers/shaders.cjs.map +1 -1
- package/dist/charts/engine/renderers/shaders.d.cts +18 -2
- package/dist/charts/engine/renderers/shaders.d.ts +18 -2
- package/dist/charts/engine/renderers/shaders.js +176 -20
- package/dist/charts/engine/renderers/shaders.js.map +1 -1
- package/dist/charts/engine/renderers/types.cjs.map +1 -1
- package/dist/charts/engine/renderers/types.d.cts +11 -4
- package/dist/charts/engine/renderers/types.d.ts +11 -4
- package/dist/charts/engine/renderers/types.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 +62 -90
- package/dist/charts/engine/renderers/webgl2.js.map +1 -1
- package/dist/charts/engine/renderers/webgpu.cjs +1 -1
- package/dist/charts/engine/renderers/webgpu.cjs.map +1 -1
- package/dist/charts/engine/renderers/webgpu.js +18 -15
- package/dist/charts/engine/renderers/webgpu.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 +32 -9
- package/dist/charts/engine/scene.d.ts +32 -9
- package/dist/charts/engine/scene.js +363 -122
- 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 +2 -0
- package/dist/charts/engine/shapes/canvas.cjs.map +1 -0
- package/dist/charts/engine/shapes/canvas.d.cts +65 -0
- package/dist/charts/engine/shapes/canvas.d.ts +65 -0
- package/dist/charts/engine/shapes/canvas.js +168 -0
- package/dist/charts/engine/shapes/canvas.js.map +1 -0
- package/dist/charts/engine/shapes/chart.cjs +2 -0
- package/dist/charts/engine/shapes/chart.cjs.map +1 -0
- package/dist/charts/engine/shapes/chart.d.cts +7 -0
- package/dist/charts/engine/shapes/chart.d.ts +7 -0
- package/dist/charts/engine/shapes/chart.js +292 -0
- package/dist/charts/engine/shapes/chart.js.map +1 -0
- package/dist/charts/engine/shapes/draw.cjs +2 -0
- package/dist/charts/engine/shapes/draw.cjs.map +1 -0
- package/dist/charts/engine/shapes/draw.d.cts +22 -0
- package/dist/charts/engine/shapes/draw.d.ts +22 -0
- package/dist/charts/engine/shapes/draw.js +165 -0
- package/dist/charts/engine/shapes/draw.js.map +1 -0
- package/dist/charts/engine/shapes/funnel.cjs +2 -0
- package/dist/charts/engine/shapes/funnel.cjs.map +1 -0
- package/dist/charts/engine/shapes/funnel.d.cts +6 -0
- package/dist/charts/engine/shapes/funnel.d.ts +6 -0
- package/dist/charts/engine/shapes/funnel.js +149 -0
- package/dist/charts/engine/shapes/funnel.js.map +1 -0
- package/dist/charts/engine/shapes/gauge.cjs +2 -0
- package/dist/charts/engine/shapes/gauge.cjs.map +1 -0
- package/dist/charts/engine/shapes/gauge.d.cts +7 -0
- package/dist/charts/engine/shapes/gauge.d.ts +7 -0
- package/dist/charts/engine/shapes/gauge.js +210 -0
- package/dist/charts/engine/shapes/gauge.js.map +1 -0
- package/dist/charts/engine/shapes/hit.cjs +2 -0
- package/dist/charts/engine/shapes/hit.cjs.map +1 -0
- package/dist/charts/engine/shapes/hit.d.cts +30 -0
- package/dist/charts/engine/shapes/hit.d.ts +30 -0
- package/dist/charts/engine/shapes/hit.js +145 -0
- package/dist/charts/engine/shapes/hit.js.map +1 -0
- package/dist/charts/engine/shapes/index.d.cts +12 -0
- package/dist/charts/engine/shapes/index.d.ts +12 -0
- 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 +146 -0
- package/dist/charts/engine/shapes/labels.js.map +1 -0
- package/dist/charts/engine/shapes/layout.cjs +3 -0
- package/dist/charts/engine/shapes/layout.cjs.map +1 -0
- package/dist/charts/engine/shapes/layout.d.cts +93 -0
- package/dist/charts/engine/shapes/layout.d.ts +93 -0
- package/dist/charts/engine/shapes/layout.js +353 -0
- package/dist/charts/engine/shapes/layout.js.map +1 -0
- package/dist/charts/engine/shapes/pie.cjs +2 -0
- package/dist/charts/engine/shapes/pie.cjs.map +1 -0
- package/dist/charts/engine/shapes/pie.d.cts +20 -0
- package/dist/charts/engine/shapes/pie.d.ts +20 -0
- package/dist/charts/engine/shapes/pie.js +302 -0
- package/dist/charts/engine/shapes/pie.js.map +1 -0
- package/dist/charts/engine/shapes/radar.cjs +2 -0
- package/dist/charts/engine/shapes/radar.cjs.map +1 -0
- package/dist/charts/engine/shapes/radar.d.cts +8 -0
- package/dist/charts/engine/shapes/radar.d.ts +8 -0
- package/dist/charts/engine/shapes/radar.js +198 -0
- package/dist/charts/engine/shapes/radar.js.map +1 -0
- 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 +2 -0
- package/dist/charts/engine/shapes/runtime.cjs.map +1 -0
- package/dist/charts/engine/shapes/runtime.d.cts +36 -0
- package/dist/charts/engine/shapes/runtime.d.ts +36 -0
- package/dist/charts/engine/shapes/runtime.js +107 -0
- package/dist/charts/engine/shapes/runtime.js.map +1 -0
- 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 +2 -0
- package/dist/charts/engine/shapes/scene.cjs.map +1 -0
- package/dist/charts/engine/shapes/scene.d.cts +311 -0
- package/dist/charts/engine/shapes/scene.d.ts +311 -0
- package/dist/charts/engine/shapes/scene.js +125 -0
- package/dist/charts/engine/shapes/scene.js.map +1 -0
- 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 +2 -0
- package/dist/charts/engine/shapes/treemap.cjs.map +1 -0
- package/dist/charts/engine/shapes/treemap.d.cts +14 -0
- package/dist/charts/engine/shapes/treemap.d.ts +14 -0
- package/dist/charts/engine/shapes/treemap.js +213 -0
- package/dist/charts/engine/shapes/treemap.js.map +1 -0
- package/dist/charts/engine/shapes/types.d.cts +719 -0
- package/dist/charts/engine/shapes/types.d.ts +719 -0
- package/dist/charts/engine/signature.cjs +2 -0
- package/dist/charts/engine/signature.cjs.map +1 -0
- package/dist/charts/engine/signature.d.cts +9 -0
- package/dist/charts/engine/signature.d.ts +9 -0
- package/dist/charts/engine/signature.js +13 -0
- package/dist/charts/engine/signature.js.map +1 -0
- package/dist/charts/engine/theme.cjs +1 -1
- package/dist/charts/engine/theme.cjs.map +1 -1
- package/dist/charts/engine/theme.d.cts +10 -1
- package/dist/charts/engine/theme.d.ts +10 -1
- package/dist/charts/engine/theme.js +40 -16
- package/dist/charts/engine/theme.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 +4 -0
- package/dist/charts/engine/three-d/canvas2d.d.ts +4 -0
- package/dist/charts/engine/three-d/canvas2d.js +104 -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 +11 -0
- package/dist/charts/engine/three-d/detect.d.ts +11 -0
- package/dist/charts/engine/three-d/detect.js +35 -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 +76 -0
- package/dist/charts/engine/three-d/geometry.d.ts +76 -0
- package/dist/charts/engine/three-d/geometry.js +529 -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 +130 -0
- package/dist/charts/engine/three-d/model.d.ts +130 -0
- package/dist/charts/engine/three-d/model.js +277 -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 +197 -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 +82 -0
- package/dist/charts/engine/three-d/render-types.d.ts +82 -0
- package/dist/charts/engine/three-d/render-types.js +13 -0
- package/dist/charts/engine/three-d/render-types.js.map +1 -0
- package/dist/charts/engine/three-d/shaders.cjs +276 -0
- package/dist/charts/engine/three-d/shaders.cjs.map +1 -0
- package/dist/charts/engine/three-d/shaders.d.cts +26 -0
- package/dist/charts/engine/three-d/shaders.d.ts +26 -0
- package/dist/charts/engine/three-d/shaders.js +191 -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 +18 -0
- package/dist/charts/engine/three-d/sort.d.ts +18 -0
- package/dist/charts/engine/three-d/sort.js +71 -0
- package/dist/charts/engine/three-d/sort.js.map +1 -0
- package/dist/charts/engine/three-d/types.d.cts +588 -0
- package/dist/charts/engine/three-d/types.d.ts +588 -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 +130 -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 +249 -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 +3 -0
- package/dist/charts/engine/trading/chart.d.ts +3 -0
- package/dist/charts/engine/trading/chart.js +1507 -0
- package/dist/charts/engine/trading/chart.js.map +1 -0
- package/dist/charts/engine/trading/drawings.cjs +2 -0
- package/dist/charts/engine/trading/drawings.cjs.map +1 -0
- package/dist/charts/engine/trading/drawings.d.cts +57 -0
- package/dist/charts/engine/trading/drawings.d.ts +57 -0
- package/dist/charts/engine/trading/drawings.js +160 -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 +60 -0
- package/dist/charts/engine/trading/format.d.ts +60 -0
- package/dist/charts/engine/trading/format.js +131 -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 +3 -0
- package/dist/charts/engine/trading/index.d.ts +3 -0
- package/dist/charts/engine/trading/index.js +3 -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 +105 -0
- package/dist/charts/engine/trading/indicators.d.ts +105 -0
- package/dist/charts/engine/trading/indicators.js +268 -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 +91 -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 +62 -0
- package/dist/charts/engine/trading/store.d.ts +62 -0
- package/dist/charts/engine/trading/store.js +129 -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 +52 -0
- package/dist/charts/engine/trading/studies.d.ts +52 -0
- package/dist/charts/engine/trading/studies.js +254 -0
- package/dist/charts/engine/trading/studies.js.map +1 -0
- package/dist/charts/engine/trading/types.d.cts +656 -0
- package/dist/charts/engine/trading/types.d.ts +656 -0
- package/dist/charts/engine/types.d.cts +227 -15
- package/dist/charts/engine/types.d.ts +227 -15
- package/dist/charts/index.cjs +1 -1
- package/dist/charts/index.d.cts +7 -2
- package/dist/charts/index.d.ts +7 -2
- package/dist/charts/index.js +22 -8
- package/dist/charts/react/Chart.cjs +1 -1
- package/dist/charts/react/Chart.cjs.map +1 -1
- package/dist/charts/react/Chart.d.cts +11 -4
- package/dist/charts/react/Chart.d.ts +11 -4
- package/dist/charts/react/Chart.js +70 -47
- 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 +48 -2
- package/dist/charts/react/charts.d.ts +48 -2
- package/dist/charts/react/charts.js +371 -76
- package/dist/charts/react/charts.js.map +1 -1
- 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 +2 -0
- package/dist/charts/react/shapes.cjs.map +1 -0
- package/dist/charts/react/shapes.d.cts +537 -0
- package/dist/charts/react/shapes.d.ts +537 -0
- package/dist/charts/react/shapes.js +429 -0
- package/dist/charts/react/shapes.js.map +1 -0
- 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 +93 -0
- package/dist/charts/react/trading.d.ts +93 -0
- package/dist/charts/react/trading.js +95 -0
- package/dist/charts/react/trading.js.map +1 -0
- package/dist/charts/react/types.d.cts +200 -7
- package/dist/charts/react/types.d.ts +200 -7
- 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 +6 -6
- 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 +12 -3
- 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 +418 -294
- package/dist/native/charts/src/engine/controller.js.map +1 -1
- package/dist/native/charts/src/engine/curve.cjs +2 -0
- package/dist/native/charts/src/engine/curve.cjs.map +1 -0
- package/dist/native/charts/src/engine/curve.js +56 -0
- package/dist/native/charts/src/engine/curve.js.map +1 -0
- 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 +117 -43
- 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 +46 -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 +74 -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 +53 -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 +335 -111
- 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 +54 -31
- 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 +456 -34
- 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 +369 -128
- 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 +364 -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/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 +165 -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 +106 -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 +146 -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 +331 -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 +125 -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/theme.cjs.map +1 -1
- package/dist/native/charts/src/engine/theme.js.map +1 -1
- 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 +244 -215
- 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 +338 -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 +144 -0
- package/dist/native/components/Charts/types.d.ts +144 -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 +271 -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 +38 -0
- package/dist/native/components/ShapeChart/charts.d.ts +38 -0
- package/dist/native/components/ShapeChart/charts.js +387 -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 +104 -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 +602 -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 +106 -0
- package/dist/native/components/ShapeChart/recorder.d.ts +106 -0
- package/dist/native/components/ShapeChart/recorder.js +574 -0
- package/dist/native/components/ShapeChart/recorder.js.map +1 -0
- package/dist/native/components/ShapeChart/types.d.cts +509 -0
- package/dist/native/components/ShapeChart/types.d.ts +509 -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 +204 -100
- package/dist/native/source/components/Chart/types.ts +31 -1
- package/dist/native/source/components/Charts/charts.tsx +493 -0
- package/dist/native/source/components/Charts/index.ts +14 -0
- package/dist/native/source/components/Charts/types.ts +207 -0
- package/dist/native/source/components/ShapeChart/ShapeChartBase.tsx +484 -0
- package/dist/native/source/components/ShapeChart/charts.tsx +605 -0
- package/dist/native/source/components/ShapeChart/draw.tsx +170 -0
- package/dist/native/source/components/ShapeChart/geometry.ts +1185 -0
- package/dist/native/source/components/ShapeChart/index.ts +15 -0
- package/dist/native/source/components/ShapeChart/recorder.ts +830 -0
- package/dist/native/source/components/ShapeChart/types.ts +564 -0
- package/dist/native/source/index.ts +2 -0
- package/dist/native/source/manifest.ts +30 -4
- package/dist/taro/charts.d.ts +209 -4
- package/dist/taro/index.d.ts +1 -0
- package/dist/taro/index.js +8032 -1891
- package/dist/taro/manifest.d.ts +1 -0
- package/dist/taro/shape-charts.d.ts +537 -0
- package/dist/uni/AreaChart.vue +68 -0
- package/dist/uni/AreaChart.vue.d.ts +120 -0
- package/dist/uni/Badge.vue.d.ts +1 -1
- package/dist/uni/BoxPlotChart.vue +66 -0
- package/dist/uni/BoxPlotChart.vue.d.ts +102 -0
- package/dist/uni/BubbleChart.vue +68 -0
- package/dist/uni/BubbleChart.vue.d.ts +106 -0
- package/dist/uni/BulletChart.vue +86 -0
- package/dist/uni/BulletChart.vue.d.ts +110 -0
- package/dist/uni/CalendarHeatmap.vue +92 -0
- package/dist/uni/CalendarHeatmap.vue.d.ts +129 -0
- package/dist/uni/CandlestickChart.vue +66 -0
- package/dist/uni/CandlestickChart.vue.d.ts +100 -0
- package/dist/uni/DonutChart.vue +72 -0
- package/dist/uni/DonutChart.vue.d.ts +114 -0
- package/dist/uni/FunnelChart.vue +67 -0
- package/dist/uni/FunnelChart.vue.d.ts +104 -0
- package/dist/uni/GanttChart.vue +67 -0
- package/dist/uni/GanttChart.vue.d.ts +123 -0
- package/dist/uni/GaugeChart.vue +77 -0
- package/dist/uni/GaugeChart.vue.d.ts +123 -0
- package/dist/uni/HeatmapChart.vue +66 -0
- package/dist/uni/HeatmapChart.vue.d.ts +114 -0
- package/dist/uni/HistogramChart.vue +66 -0
- package/dist/uni/HistogramChart.vue.d.ts +121 -0
- package/dist/uni/HorizontalBarChart.vue +68 -0
- package/dist/uni/HorizontalBarChart.vue.d.ts +127 -0
- package/dist/uni/Input.vue.d.ts +1 -1
- package/dist/uni/MixedChart.vue +68 -0
- package/dist/uni/MixedChart.vue.d.ts +106 -0
- package/dist/uni/NumberInput.vue.d.ts +1 -1
- package/dist/uni/PieChart.vue +72 -0
- package/dist/uni/PieChart.vue.d.ts +114 -0
- package/dist/uni/RadarChart.vue +67 -0
- package/dist/uni/RadarChart.vue.d.ts +110 -0
- package/dist/uni/RadialBarChart.vue +90 -0
- package/dist/uni/RadialBarChart.vue.d.ts +132 -0
- package/dist/uni/RangeAreaChart.vue +68 -0
- package/dist/uni/RangeAreaChart.vue.d.ts +102 -0
- package/dist/uni/ResponsiveGrid.vue.d.ts +1 -1
- package/dist/uni/SankeyChart.vue +88 -0
- package/dist/uni/SankeyChart.vue.d.ts +121 -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 +77 -0
- package/dist/uni/SunburstChart.vue +90 -0
- package/dist/uni/SunburstChart.vue.d.ts +114 -0
- package/dist/uni/Textarea.vue.d.ts +1 -1
- package/dist/uni/TimePicker.vue.d.ts +1 -1
- package/dist/uni/TreemapChart.vue +65 -0
- package/dist/uni/TreemapChart.vue.d.ts +100 -0
- package/dist/uni/WaterfallChart.vue +66 -0
- package/dist/uni/WaterfallChart.vue.d.ts +125 -0
- package/dist/uni/chart-types.d.ts +216 -2
- package/dist/uni/chart-types.js +174 -0
- package/dist/uni/charts-canvas.js +10 -3
- package/dist/uni/index.d.ts +26 -1
- package/dist/uni/index.js +26 -1
- package/dist/uni/manifest.d.ts +272 -0
- package/dist/uni/manifest.js +387 -0
- package/dist/uni/named-chart-options.d.ts +88 -0
- package/dist/uni/named-chart-options.js +156 -0
- package/dist/uni/shape-chart-canvas.d.ts +51 -0
- package/dist/uni/shape-chart-canvas.js +342 -0
- package/dist/uni/shape-chart-types.d.ts +381 -0
- package/dist/uni/shape-chart-types.js +261 -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 +112 -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 +57 -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/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 +132 -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 +98 -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/HeatmapChart.vue.d.ts +125 -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 +65 -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 +128 -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 +114 -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 +160 -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 +70 -0
- package/dist/vue/components/Chart/TradingChart.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 +132 -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 +68 -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/index.d.ts +41 -0
- package/dist/vue/components/Chart/index.js +40 -0
- package/dist/vue/components/Chart/orderbook.d.ts +359 -0
- package/dist/vue/components/Chart/orderbook.js +126 -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 +105 -0
- package/dist/vue/components/Chart/trading.js +55 -0
- package/dist/vue/components/Chart/trading.js.map +1 -0
- package/dist/vue/components/Chart/types.d.ts +137 -0
- package/dist/vue/global.d.ts +38 -0
- package/dist/vue/groups/charts.d.ts +1 -0
- package/dist/vue/groups/charts.js +87 -0
- package/dist/vue/groups/charts.js.map +1 -0
- package/dist/vue/index.d.ts +1 -0
- package/dist/vue/index.js +63 -23
- package/dist/vue/plugin.js +12 -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 +11436 -0
- package/dist/weapp/charts/core.d.ts +2 -0
- package/dist/weapp/charts/core.js +41 -0
- package/dist/weapp/controls.js +1428 -3732
- 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 +466 -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 +252 -0
- package/dist/web-components/components/chart/charts.js +201 -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 +224 -0
- package/dist/web-components/components/chart/extended.js +183 -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 +162 -0
- package/dist/web-components/components/chart/shapes-extended.js +156 -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/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 +96 -0
- package/dist/web-components/components/trading-chart/trading-chart.js +96 -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 +43 -0
- package/dist/web-components/elements/chart.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 +1192 -29
- package/dist/web-components/types/react.d.ts +435 -0
- package/dist/web-components/types/solid.d.ts +321 -0
- package/dist/web-components/types/svelte.d.ts +321 -0
- package/dist/web-components/types/vue.d.ts +359 -0
- package/package.json +113 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var e=new WeakMap,t=0,n=n=>{let r=e.get(n);return r===void 0&&e.set(n,r=++t),r},r=(e,t,r)=>{let{base:i}=e,a=`${t}|${e.baseline}|${e.percent}|${i.x[0]},${i.x[1]}|${i.y[0]},${i.y[1]}`;for(let t of e.series)a+=`\n${t.key}|${t.type}|${n(t.cols)}|${t.colorCss}|${t.hidden}|${t.lineWidth}|${t.pointSize}|${t.opacity}|${t.barOffset}|${t.barHalfWidth}|${r(t.index)??``}|${t.curve}|${t.radius}`,t.type===`candlestick`?a+=`|${t.upColor}/${t.downColor}`:t.type===`heatmap`&&(a+=`|${t.colorScale.join(`;`)}/${t.valueRange[0]},${t.valueRange[1]}/${t.cellHalf.x},${t.cellHalf.y}`);return a};exports.itemsSignature=r;
|
|
2
|
+
//# sourceMappingURL=signature.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signature.cjs","names":["ids","counter","idOf","id","value","itemsSignature","model","signature","themeKey","base","s","stackOf"],"sources":["../../../../charts/src/engine/signature.ts"],"sourcesContent":["// Signature of what the render items (GPU buffers) of a model depend on:\n// when it is unchanged, the items of the previous model can be kept.\n\nimport type { ChartModel } from \"./model\";\n\nconst ids = new WeakMap<object, number>();\nlet counter = 0;\n\n/** Stable id of an object (data columns compare by identity) */\nconst idOf = (value: object): number => {\n let id = ids.get(value);\n if (id === undefined) ids.set(value, (id = ++counter));\n return id;\n};\n\n/**\n * Every input of `buildItems` (and of the origin of its positions): data\n * identity, types, colors, visibility, widths, bar layout, stacks, curves,\n * radii, candlestick and heatmap colors. `themeKey` covers the colors resolved\n * from the theme that the model doesn't spell out (per-point colors);\n * `stackOf` gives the `stack` option of a series.\n */\nexport const itemsSignature = (\n model: ChartModel,\n themeKey: number | string,\n stackOf: (index: number) => string | undefined,\n): string => {\n const { base } = model;\n let signature = `${themeKey}|${model.baseline}|${model.percent}|${base.x[0]},${base.x[1]}|${base.y[0]},${base.y[1]}`;\n for (const s of model.series) {\n signature += `\\n${s.key}|${s.type}|${idOf(s.cols)}|${s.colorCss}|${s.hidden}|${s.lineWidth}|${s.pointSize}|${s.opacity}|${s.barOffset}|${s.barHalfWidth}|${stackOf(s.index) ?? \"\"}|${s.curve}|${s.radius}`;\n if (s.type === \"candlestick\") signature += `|${s.upColor}/${s.downColor}`;\n else if (s.type === \"heatmap\")\n signature += `|${s.colorScale.join(\";\")}/${s.valueRange[0]},${s.valueRange[1]}/${s.cellHalf.x},${s.cellHalf.y}`;\n }\n return signature;\n};\n"],"mappings":"AAKA,IAAMA,EAAM,IAAI,QACZC,EAAU,EAGRC,EAAQ,GAA0B,CACtC,IAAIC,EAAKH,EAAI,IAAII,CAAK,EAEtB,OADID,IAAO,IAAA,IAAWH,EAAI,IAAII,EAAQ,EAAK,EAAEH,CAAQ,EAC9CE,CACT,EASaE,GACX,EACA,EACA,IACW,CACX,GAAM,CAAE,QAASC,EACbC,EAAY,GAAGC,EAAS,GAAGF,EAAM,SAAS,GAAGA,EAAM,QAAQ,GAAGG,EAAK,EAAE,GAAG,GAAGA,EAAK,EAAE,GAAG,GAAGA,EAAK,EAAE,GAAG,GAAGA,EAAK,EAAE,KAChH,IAAK,IAAMC,KAAKJ,EAAM,OACpB,GAAa,KAAKI,EAAE,IAAI,GAAGA,EAAE,KAAK,GAAGR,EAAKQ,EAAE,IAAI,EAAE,GAAGA,EAAE,SAAS,GAAGA,EAAE,OAAO,GAAGA,EAAE,UAAU,GAAGA,EAAE,UAAU,GAAGA,EAAE,QAAQ,GAAGA,EAAE,UAAU,GAAGA,EAAE,aAAa,GAAGC,EAAQD,EAAE,KAAK,GAAK,GAAG,GAAGA,EAAE,MAAM,GAAGA,EAAE,SAC9LA,EAAE,OAAS,cAAe,GAAa,IAAIA,EAAE,QAAQ,GAAGA,EAAE,YACrDA,EAAE,OAAS,YAClB,GAAa,IAAIA,EAAE,WAAW,KAAK,GAAG,EAAE,GAAGA,EAAE,WAAW,GAAG,GAAGA,EAAE,WAAW,GAAG,GAAGA,EAAE,SAAS,EAAE,GAAGA,EAAE,SAAS,KAEhH,OAAOH,CACT"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ChartModel } from './model.cjs';
|
|
2
|
+
/**
|
|
3
|
+
* Every input of `buildItems` (and of the origin of its positions): data
|
|
4
|
+
* identity, types, colors, visibility, widths, bar layout, stacks, curves,
|
|
5
|
+
* radii, candlestick and heatmap colors. `themeKey` covers the colors resolved
|
|
6
|
+
* from the theme that the model doesn't spell out (per-point colors);
|
|
7
|
+
* `stackOf` gives the `stack` option of a series.
|
|
8
|
+
*/
|
|
9
|
+
export declare const itemsSignature: (model: ChartModel, themeKey: number | string, stackOf: (index: number) => string | undefined) => string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ChartModel } from './model.js';
|
|
2
|
+
/**
|
|
3
|
+
* Every input of `buildItems` (and of the origin of its positions): data
|
|
4
|
+
* identity, types, colors, visibility, widths, bar layout, stacks, curves,
|
|
5
|
+
* radii, candlestick and heatmap colors. `themeKey` covers the colors resolved
|
|
6
|
+
* from the theme that the model doesn't spell out (per-point colors);
|
|
7
|
+
* `stackOf` gives the `stack` option of a series.
|
|
8
|
+
*/
|
|
9
|
+
export declare const itemsSignature: (model: ChartModel, themeKey: number | string, stackOf: (index: number) => string | undefined) => string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region src/engine/signature.ts
|
|
2
|
+
var e = /* @__PURE__ */ new WeakMap(), t = 0, n = (n) => {
|
|
3
|
+
let r = e.get(n);
|
|
4
|
+
return r === void 0 && e.set(n, r = ++t), r;
|
|
5
|
+
}, r = (e, t, r) => {
|
|
6
|
+
let { base: i } = e, a = `${t}|${e.baseline}|${e.percent}|${i.x[0]},${i.x[1]}|${i.y[0]},${i.y[1]}`;
|
|
7
|
+
for (let t of e.series) a += `\n${t.key}|${t.type}|${n(t.cols)}|${t.colorCss}|${t.hidden}|${t.lineWidth}|${t.pointSize}|${t.opacity}|${t.barOffset}|${t.barHalfWidth}|${r(t.index) ?? ""}|${t.curve}|${t.radius}`, t.type === "candlestick" ? a += `|${t.upColor}/${t.downColor}` : t.type === "heatmap" && (a += `|${t.colorScale.join(";")}/${t.valueRange[0]},${t.valueRange[1]}/${t.cellHalf.x},${t.cellHalf.y}`);
|
|
8
|
+
return a;
|
|
9
|
+
};
|
|
10
|
+
//#endregion
|
|
11
|
+
export { r as itemsSignature };
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=signature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signature.js","names":["ids","counter","idOf","id","value","itemsSignature","model","signature","themeKey","base","s","stackOf"],"sources":["../../../../charts/src/engine/signature.ts"],"sourcesContent":["// Signature of what the render items (GPU buffers) of a model depend on:\n// when it is unchanged, the items of the previous model can be kept.\n\nimport type { ChartModel } from \"./model\";\n\nconst ids = new WeakMap<object, number>();\nlet counter = 0;\n\n/** Stable id of an object (data columns compare by identity) */\nconst idOf = (value: object): number => {\n let id = ids.get(value);\n if (id === undefined) ids.set(value, (id = ++counter));\n return id;\n};\n\n/**\n * Every input of `buildItems` (and of the origin of its positions): data\n * identity, types, colors, visibility, widths, bar layout, stacks, curves,\n * radii, candlestick and heatmap colors. `themeKey` covers the colors resolved\n * from the theme that the model doesn't spell out (per-point colors);\n * `stackOf` gives the `stack` option of a series.\n */\nexport const itemsSignature = (\n model: ChartModel,\n themeKey: number | string,\n stackOf: (index: number) => string | undefined,\n): string => {\n const { base } = model;\n let signature = `${themeKey}|${model.baseline}|${model.percent}|${base.x[0]},${base.x[1]}|${base.y[0]},${base.y[1]}`;\n for (const s of model.series) {\n signature += `\\n${s.key}|${s.type}|${idOf(s.cols)}|${s.colorCss}|${s.hidden}|${s.lineWidth}|${s.pointSize}|${s.opacity}|${s.barOffset}|${s.barHalfWidth}|${stackOf(s.index) ?? \"\"}|${s.curve}|${s.radius}`;\n if (s.type === \"candlestick\") signature += `|${s.upColor}/${s.downColor}`;\n else if (s.type === \"heatmap\")\n signature += `|${s.colorScale.join(\";\")}/${s.valueRange[0]},${s.valueRange[1]}/${s.cellHalf.x},${s.cellHalf.y}`;\n }\n return signature;\n};\n"],"mappings":";AAKA,IAAMA,oBAAM,IAAI,QAAwB,GACpCC,IAAU,GAGRC,KAAQ,MAA0B;CACtC,IAAIC,IAAKH,EAAI,IAAII,CAAK;CAEtB,OADID,MAAO,KAAA,KAAWH,EAAI,IAAII,GAAQ,IAAK,EAAEH,CAAQ,GAC9CE;AACT,GASaE,KACX,GACA,GACA,MACW;CACX,IAAM,EAAE,YAASC,GACbC,IAAY,GAAGC,EAAS,GAAGF,EAAM,SAAS,GAAGA,EAAM,QAAQ,GAAGG,EAAK,EAAE,GAAG,GAAGA,EAAK,EAAE,GAAG,GAAGA,EAAK,EAAE,GAAG,GAAGA,EAAK,EAAE;CAChH,KAAK,IAAMC,KAAKJ,EAAM,QAEpB,AADA,KAAa,KAAKI,EAAE,IAAI,GAAGA,EAAE,KAAK,GAAGR,EAAKQ,EAAE,IAAI,EAAE,GAAGA,EAAE,SAAS,GAAGA,EAAE,OAAO,GAAGA,EAAE,UAAU,GAAGA,EAAE,UAAU,GAAGA,EAAE,QAAQ,GAAGA,EAAE,UAAU,GAAGA,EAAE,aAAa,GAAGC,EAAQD,EAAE,KAAK,KAAK,GAAG,GAAGA,EAAE,MAAM,GAAGA,EAAE,UAC9LA,EAAE,SAAS,gBAAe,KAAa,IAAIA,EAAE,QAAQ,GAAGA,EAAE,cACrDA,EAAE,SAAS,cAClB,KAAa,IAAIA,EAAE,WAAW,KAAK,GAAG,EAAE,GAAGA,EAAE,WAAW,GAAG,GAAGA,EAAE,WAAW,GAAG,GAAGA,EAAE,SAAS,EAAE,GAAGA,EAAE,SAAS;CAEhH,OAAOH;AACT"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require("./color.cjs");var t=[`#4f46e5`,`#10b981`,`#f59e0b`,`#ef4444`,`#0ea5e9`,`#8b5cf6`,`#14b8a6`,`#f97316`],n=(e,t)=>e?.getPropertyValue(t).trim()??``,r=(t,r)=>{let i=t&&typeof getComputedStyle==`function`?getComputedStyle(t):null;return
|
|
1
|
+
const e=require("./color.cjs");var t=[`#4f46e5`,`#10b981`,`#f59e0b`,`#ef4444`,`#0ea5e9`,`#8b5cf6`,`#14b8a6`,`#f97316`],n=(e,t)=>e?.getPropertyValue(t).trim()??``,r=(t,r)=>{let i=t&&typeof getComputedStyle==`function`?getComputedStyle(t):null;return c(e=>n(i,e),e.memoizeColorResolver(e.domColorResolver(t)),r,i?.fontFamily??``)},i=[`text`,`textMuted`,`grid`,`axis`,`background`,`surface`,`primary`],a=(t,n)=>{if(t===n)return!1;if(t.palette.length!==n.palette.length||t.palette.some((t,r)=>!e.sameColor(t,n.palette[r]))||i.some(r=>!e.sameColor(t[r],n[r])))return!0;let r=t.resolve?.cache;if(!r||!n.resolve)return!0;let a=[NaN,NaN,NaN,NaN];for(let[t,i]of r){let r=n.resolve(t,a);if(!e.sameColor(i,r===a?null:r))return!0}return!1},o=(e={},t)=>{let n=e.variables??{};return{...c(e=>n[e]?.trim()??``,s(n),t?.length?t:e.palette,``),...e.fontFamily?{fontFamily:e.fontFamily}:{},...e.fontSize?{fontSize:e.fontSize}:{}}},s=t=>(n,r)=>e.resolveStaticColor(n,t,r),c=(n,r,i,a)=>{let o=[.4,.4,.4,1],s=e=>r(e,o),c=(e,t)=>{for(let t of e)if(n(t))return s(`var(${t})`);return s(t)},l=c([`--surface-color`,`--background-color`],`#ffffff`),u=c([`--text-color`],`#1f2937`),d=c([`--text-secondary-color`,`--text-muted-color`],`#6b7280`),f=c([`--border-color`],`#e5e7eb`),p;if(i&&i.length)p=i.map(e=>s(e));else{let e=[];for(let t=1;t<=8;t++){let r=`--chart-series-${t}`;n(r)&&e.push(s(`var(${r})`))}p=e.length?e:[...[`--primary-color`,`--success-color`,`--warning-color`,`--danger-color`,`--info-color`].map((e,r)=>n(e)?s(`var(${e})`):s(t[r])),...t.slice(5).map(e=>s(e))]}let m=n(`--font-family-sans`)||a||`system-ui, -apple-system, 'Segoe UI', sans-serif`;return{palette:p,text:u,textMuted:d,grid:e.mix(l,f,.75),axis:f,background:l,surface:l,primary:p[0],fontFamily:m,fontSize:11,resolve:r}},l=e=>{if(typeof document>`u`)return()=>{};let t=[];if(typeof MutationObserver==`function`){let n=new MutationObserver(e);for(let e of[document.documentElement,document.body])e&&n.observe(e,{attributes:!0,attributeFilter:[`class`,`style`,`data-theme`,`data-mode`]});t.push(()=>n.disconnect())}if(typeof matchMedia==`function`){let n=matchMedia(`(prefers-color-scheme: dark)`);n.addEventListener?.(`change`,e),t.push(()=>n.removeEventListener?.(`change`,e))}return()=>t.forEach(e=>e())};exports.createTheme=o,exports.readTheme=r,exports.staticColorResolver=s,exports.themeColorsChanged=a,exports.watchTheme=l;
|
|
2
2
|
//# sourceMappingURL=theme.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.cjs","names":["domColorResolver","resolveStaticColor","mix","require_color","DEFAULT_PALETTE","readVar","style","name","readTheme","element","buildTheme","palette","createTheme","variables","input","staticColorResolver","value","fallback","fallbackGray","resolveColor","resolve","color","names","readVariable","background","text","textMuted","border","colors","c","custom","i","fontFamily","inheritedFont","watchTheme","cleanups","observer","onChange","node","query","fn"],"sources":["../../../../charts/src/engine/theme.ts"],"sourcesContent":["// Chart colors and fonts read from the Minerva CSS variables.\n\nimport {\n domColorResolver,\n mix,\n resolveStaticColor,\n type ColorResolver,\n type Rgba,\n} from \"./color\";\n\nexport interface ChartTheme {\n palette: Rgba[];\n text: Rgba;\n textMuted: Rgba;\n grid: Rgba;\n axis: Rgba;\n background: Rgba;\n surface: Rgba;\n primary: Rgba;\n fontFamily: string;\n /** Tick label font size in CSS pixels */\n fontSize: number;\n /** Resolves the colors of the options (`var(--x)` included); static colors only when omitted */\n resolve?: ColorResolver;\n}\n\n/** Used when no CSS variable is defined (e.g. without the Minerva stylesheet) */\nconst DEFAULT_PALETTE = [\n \"#4f46e5\",\n \"#10b981\",\n \"#f59e0b\",\n \"#ef4444\",\n \"#0ea5e9\",\n \"#8b5cf6\",\n \"#14b8a6\",\n \"#f97316\",\n];\n\nconst readVar = (style: CSSStyleDeclaration | null, name: string) =>\n style?.getPropertyValue(name).trim() ?? \"\";\n\n/** Reads the theme from the computed style of `element` */\nexport const readTheme = (\n element: Element | null,\n palette?: readonly string[],\n): ChartTheme => {\n const style =\n element && typeof getComputedStyle === \"function\"\n ? getComputedStyle(element)\n : null;\n return buildTheme(\n (name) => readVar(style, name),\n domColorResolver(element),\n palette,\n style?.fontFamily ?? \"\",\n );\n};\n\n/** Theme of the charts drawn without a DOM (mini-programs, React Native) */\nexport interface ChartThemeInput {\n /**\n * Values of the Minerva CSS variables (`--primary-color`, `--text-color`,\n * `--chart-series-1`, ...) used for the theme colors and to resolve\n * `var(--name)` colors of the options\n */\n variables?: Readonly<Record<string, string>>;\n /** Series colors (hex / rgb) */\n palette?: readonly string[];\n /** Font family of the labels */\n fontFamily?: string;\n /**\n * Font size of the tick labels, in pixels\n * @default 11\n */\n fontSize?: number;\n}\n\n/** Builds a theme from plain values (no DOM) */\nexport const createTheme = (\n input: ChartThemeInput = {},\n palette?: readonly string[],\n): ChartTheme => {\n const variables = input.variables ?? {};\n const theme = buildTheme(\n (name) => variables[name]?.trim() ?? \"\",\n staticColorResolver(variables),\n palette?.length ? palette : input.palette,\n \"\",\n );\n return {\n ...theme,\n ...(input.fontFamily ? { fontFamily: input.fontFamily } : {}),\n ...(input.fontSize ? { fontSize: input.fontSize } : {}),\n };\n};\n\n/** Resolver of `var(--name, fallback)` colors against plain variables */\nexport const staticColorResolver =\n (variables: Readonly<Record<string, string>>): ColorResolver =>\n (value, fallback) =>\n resolveStaticColor(value, variables, fallback);\n\nconst buildTheme = (\n readVariable: (name: string) => string,\n resolve: ColorResolver,\n palette: readonly string[] | undefined,\n inheritedFont: string,\n): ChartTheme => {\n const fallbackGray: Rgba = [0.4, 0.4, 0.4, 1];\n const resolveColor = (value: string) => resolve(value, fallbackGray);\n const color = (names: string[], fallback: string): Rgba => {\n for (const name of names) {\n if (readVariable(name)) return resolveColor(`var(${name})`);\n }\n return resolveColor(fallback);\n };\n\n const background = color(\n [\"--surface-color\", \"--background-color\"],\n \"#ffffff\",\n );\n const text = color([\"--text-color\"], \"#1f2937\");\n const textMuted = color(\n [\"--text-secondary-color\", \"--text-muted-color\"],\n \"#6b7280\",\n );\n const border = color([\"--border-color\"], \"#e5e7eb\");\n\n let colors: Rgba[];\n if (palette && palette.length) {\n colors = palette.map((c) => resolveColor(c));\n } else {\n const custom: Rgba[] = [];\n for (let i = 1; i <= 8; i++) {\n const name = `--chart-series-${i}`;\n if (readVariable(name)) custom.push(resolveColor(`var(${name})`));\n }\n if (custom.length) {\n colors = custom;\n } else {\n const themed = [\n \"--primary-color\",\n \"--success-color\",\n \"--warning-color\",\n \"--danger-color\",\n \"--info-color\",\n ].map((name, i) =>\n readVariable(name)\n ? resolveColor(`var(${name})`)\n : resolveColor(DEFAULT_PALETTE[i]),\n );\n colors = [\n ...themed,\n ...DEFAULT_PALETTE.slice(5).map((c) => resolveColor(c)),\n ];\n }\n }\n\n const fontFamily =\n readVariable(\"--font-family-sans\") ||\n inheritedFont ||\n \"system-ui, -apple-system, 'Segoe UI', sans-serif\";\n\n return {\n palette: colors,\n text,\n textMuted,\n grid: mix(background, border, 0.75),\n axis: border,\n background,\n surface: background,\n primary: colors[0],\n fontFamily,\n fontSize: 11,\n resolve,\n };\n};\n\n/**\n * Calls `onChange` when the theme may have changed: attributes of `<html>` /\n * `<body>` (class, style, data-theme) and the color scheme.\n */\nexport const watchTheme = (onChange: () => void): (() => void) => {\n if (typeof document === \"undefined\") return () => {};\n const cleanups: (() => void)[] = [];\n if (typeof MutationObserver === \"function\") {\n const observer = new MutationObserver(onChange);\n for (const node of [document.documentElement, document.body]) {\n if (node) {\n observer.observe(node, {\n attributes: true,\n attributeFilter: [\"class\", \"style\", \"data-theme\", \"data-mode\"],\n });\n }\n }\n cleanups.push(() => observer.disconnect());\n }\n if (typeof matchMedia === \"function\") {\n const query = matchMedia(\"(prefers-color-scheme: dark)\");\n query.addEventListener?.(\"change\", onChange);\n cleanups.push(() => query.removeEventListener?.(\"change\", onChange));\n }\n return () => cleanups.forEach((fn) => fn());\n};\n"],"mappings":"+BA2BA,IAAMI,EAAkB,CACtB,UACA,UACA,UACA,UACA,UACA,UACA,UACA,SACF,EAEMC,GAAW,EAAmC,IAClDC,GAAO,iBAAiBC,CAAI,CAAC,CAAC,KAAK,GAAK,GAG7BC,GACX,EACA,IACe,CACf,IAAMF,EACJG,GAAW,OAAO,kBAAqB,WACnC,iBAAiBA,CAAO,EACxB,KACN,OAAOC,EACJ,GAASL,EAAQC,EAAOC,CAAI,EAC7BP,EAAAA,iBAAiBS,CAAO,EACxBE,EACAL,GAAO,YAAc,EACvB,CACF,EAsBaM,GACX,EAAyB,CAAC,EAC1B,IACe,CACf,IAAMC,EAAYC,EAAM,WAAa,CAAC,EAOtC,MAAO,CACL,GAPYJ,EACX,GAASG,EAAUN,EAAK,EAAE,KAAK,GAAK,GACrCQ,EAAoBF,CAAS,EAC7BF,GAAS,OAASA,EAAUG,EAAM,QAClC,EAGG,EACH,GAAIA,EAAM,WAAa,CAAE,WAAYA,EAAM,UAAW,EAAI,CAAC,EAC3D,GAAIA,EAAM,SAAW,CAAE,SAAUA,EAAM,QAAS,EAAI,CAAC,CACvD,CACF,EAGaC,EACV,IACA,EAAO,IACNd,EAAAA,mB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N,aACA,QAASH,EACT,QAASI,EAAO,GAChB,aACA,SAAU,GACV,SACF,CACF,EAMaM,EAAc,GAAuC,CAChE,GAAI,OAAO,SAAa,IAAa,UAAa,CAAC,EACnD,IAAMC,EAA2B,CAAC,EAClC,GAAI,OAAO,kBAAqB,WAAY,CAC1C,IAAMC,EAAW,IAAI,iBAAiBC,CAAQ,EAC9C,IAAK,IAAMC,IAAQ,CAAC,SAAS,gBAAiB,SAAS,IAAI,EACrDA,GACFF,EAAS,QAAQE,EAAM,CACrB,WAAY,GACZ,gBAAiB,CAAC,QAAS,QAAS,aAAc,WAAW,CAC/D,CAAC,EAGLH,EAAS,SAAWC,EAAS,WAAW,CAAC,CAC3C,CACA,GAAI,OAAO,YAAe,WAAY,CACpC,IAAMG,EAAQ,WAAW,8BAA8B,EACvDA,EAAM,mBAAmB,SAAUF,CAAQ,EAC3CF,EAAS,SAAWI,EAAM,sBAAsB,SAAUF,CAAQ,CAAC,CACrE,CACA,UAAaF,EAAS,QAAS,GAAOK,EAAG,CAAC,CAC5C"}
|
|
1
|
+
{"version":3,"file":"theme.cjs","names":["memoizeColorResolver","domColorResolver","sameColor","resolveStaticColor","mix","require_color","DEFAULT_PALETTE","readVar","style","name","readTheme","element","buildTheme","palette","THEME_COLORS","themeColorsChanged","previous","next","c","i","key","cache","probe","value","color","resolved","createTheme","variables","input","staticColorResolver","fallback","fallbackGray","resolveColor","resolve","names","readVariable","background","text","textMuted","border","colors","custom","fontFamily","inheritedFont","watchTheme","cleanups","observer","onChange","node","query","fn"],"sources":["../../../../charts/src/engine/theme.ts"],"sourcesContent":["// Chart colors and fonts read from the Minerva CSS variables.\n\nimport {\n domColorResolver,\n memoizeColorResolver,\n mix,\n resolveStaticColor,\n sameColor,\n type ColorResolver,\n type MemoizedColorResolver,\n type Rgba,\n} from \"./color\";\n\nexport interface ChartTheme {\n palette: Rgba[];\n text: Rgba;\n textMuted: Rgba;\n grid: Rgba;\n axis: Rgba;\n background: Rgba;\n surface: Rgba;\n primary: Rgba;\n fontFamily: string;\n /** Tick label font size in CSS pixels */\n fontSize: number;\n /** Resolves the colors of the options (`var(--x)` included); static colors only when omitted */\n resolve?: ColorResolver;\n}\n\n/** Used when no CSS variable is defined (e.g. without the Minerva stylesheet) */\nconst DEFAULT_PALETTE = [\n \"#4f46e5\",\n \"#10b981\",\n \"#f59e0b\",\n \"#ef4444\",\n \"#0ea5e9\",\n \"#8b5cf6\",\n \"#14b8a6\",\n \"#f97316\",\n];\n\nconst readVar = (style: CSSStyleDeclaration | null, name: string) =>\n style?.getPropertyValue(name).trim() ?? \"\";\n\n/**\n * Reads the theme from the computed style of `element`. Its resolver caches\n * the colors (DOM probes are costly): read the theme again to see new values.\n */\nexport const readTheme = (\n element: Element | null,\n palette?: readonly string[],\n): ChartTheme => {\n const style =\n element && typeof getComputedStyle === \"function\"\n ? getComputedStyle(element)\n : null;\n return buildTheme(\n (name) => readVar(style, name),\n memoizeColorResolver(domColorResolver(element)),\n palette,\n style?.fontFamily ?? \"\",\n );\n};\n\nconst THEME_COLORS = [\n \"text\",\n \"textMuted\",\n \"grid\",\n \"axis\",\n \"background\",\n \"surface\",\n \"primary\",\n] as const;\n\n/**\n * Whether `next` (a re-read of `previous`) resolves any color differently:\n * the theme colors, the palette and every color `previous` has resolved so\n * far (series, points, annotations...). `true` when it cannot tell.\n */\nexport const themeColorsChanged = (\n previous: ChartTheme,\n next: ChartTheme,\n): boolean => {\n if (previous === next) return false;\n if (previous.palette.length !== next.palette.length) return true;\n if (previous.palette.some((c, i) => !sameColor(c, next.palette[i])))\n return true;\n if (THEME_COLORS.some((key) => !sameColor(previous[key], next[key])))\n return true;\n const cache = (previous.resolve as Partial<MemoizedColorResolver> | undefined)\n ?.cache;\n if (!cache || !next.resolve) return true;\n const probe: Rgba = [NaN, NaN, NaN, NaN];\n for (const [value, color] of cache) {\n const resolved = next.resolve(value, probe);\n if (!sameColor(color, resolved === probe ? null : resolved)) return true;\n }\n return false;\n};\n\n/** Theme of the charts drawn without a DOM (mini-programs, React Native) */\nexport interface ChartThemeInput {\n /**\n * Values of the Minerva CSS variables (`--primary-color`, `--text-color`,\n * `--chart-series-1`, ...) used for the theme colors and to resolve\n * `var(--name)` colors of the options\n */\n variables?: Readonly<Record<string, string>>;\n /** Series colors (hex / rgb) */\n palette?: readonly string[];\n /** Font family of the labels */\n fontFamily?: string;\n /**\n * Font size of the tick labels, in pixels\n * @default 11\n */\n fontSize?: number;\n}\n\n/** Builds a theme from plain values (no DOM) */\nexport const createTheme = (\n input: ChartThemeInput = {},\n palette?: readonly string[],\n): ChartTheme => {\n const variables = input.variables ?? {};\n const theme = buildTheme(\n (name) => variables[name]?.trim() ?? \"\",\n staticColorResolver(variables),\n palette?.length ? palette : input.palette,\n \"\",\n );\n return {\n ...theme,\n ...(input.fontFamily ? { fontFamily: input.fontFamily } : {}),\n ...(input.fontSize ? { fontSize: input.fontSize } : {}),\n };\n};\n\n/** Resolver of `var(--name, fallback)` colors against plain variables */\nexport const staticColorResolver =\n (variables: Readonly<Record<string, string>>): ColorResolver =>\n (value, fallback) =>\n resolveStaticColor(value, variables, fallback);\n\nconst buildTheme = (\n readVariable: (name: string) => string,\n resolve: ColorResolver,\n palette: readonly string[] | undefined,\n inheritedFont: string,\n): ChartTheme => {\n const fallbackGray: Rgba = [0.4, 0.4, 0.4, 1];\n const resolveColor = (value: string) => resolve(value, fallbackGray);\n const color = (names: string[], fallback: string): Rgba => {\n for (const name of names) {\n if (readVariable(name)) return resolveColor(`var(${name})`);\n }\n return resolveColor(fallback);\n };\n\n const background = color(\n [\"--surface-color\", \"--background-color\"],\n \"#ffffff\",\n );\n const text = color([\"--text-color\"], \"#1f2937\");\n const textMuted = color(\n [\"--text-secondary-color\", \"--text-muted-color\"],\n \"#6b7280\",\n );\n const border = color([\"--border-color\"], \"#e5e7eb\");\n\n let colors: Rgba[];\n if (palette && palette.length) {\n colors = palette.map((c) => resolveColor(c));\n } else {\n const custom: Rgba[] = [];\n for (let i = 1; i <= 8; i++) {\n const name = `--chart-series-${i}`;\n if (readVariable(name)) custom.push(resolveColor(`var(${name})`));\n }\n if (custom.length) {\n colors = custom;\n } else {\n const themed = [\n \"--primary-color\",\n \"--success-color\",\n \"--warning-color\",\n \"--danger-color\",\n \"--info-color\",\n ].map((name, i) =>\n readVariable(name)\n ? resolveColor(`var(${name})`)\n : resolveColor(DEFAULT_PALETTE[i]),\n );\n colors = [\n ...themed,\n ...DEFAULT_PALETTE.slice(5).map((c) => resolveColor(c)),\n ];\n }\n }\n\n const fontFamily =\n readVariable(\"--font-family-sans\") ||\n inheritedFont ||\n \"system-ui, -apple-system, 'Segoe UI', sans-serif\";\n\n return {\n palette: colors,\n text,\n textMuted,\n grid: mix(background, border, 0.75),\n axis: border,\n background,\n surface: background,\n primary: colors[0],\n fontFamily,\n fontSize: 11,\n resolve,\n };\n};\n\n/**\n * Calls `onChange` when the theme may have changed: attributes of `<html>` /\n * `<body>` (class, style, data-theme) and the color scheme.\n */\nexport const watchTheme = (onChange: () => void): (() => void) => {\n if (typeof document === \"undefined\") return () => {};\n const cleanups: (() => void)[] = [];\n if (typeof MutationObserver === \"function\") {\n const observer = new MutationObserver(onChange);\n for (const node of [document.documentElement, document.body]) {\n if (node) {\n observer.observe(node, {\n attributes: true,\n attributeFilter: [\"class\", \"style\", \"data-theme\", \"data-mode\"],\n });\n }\n }\n cleanups.push(() => observer.disconnect());\n }\n if (typeof matchMedia === \"function\") {\n const query = matchMedia(\"(prefers-color-scheme: dark)\");\n query.addEventListener?.(\"change\", onChange);\n cleanups.push(() => query.removeEventListener?.(\"change\", onChange));\n }\n return () => cleanups.forEach((fn) => fn());\n};\n"],"mappings":"+BA8BA,IAAMM,EAAkB,CACtB,UACA,UACA,UACA,UACA,UACA,UACA,UACA,SACF,EAEMC,GAAW,EAAmC,IAClDC,GAAO,iBAAiBC,CAAI,CAAC,CAAC,KAAK,GAAK,GAM7BC,GACX,EACA,IACe,CACf,IAAMF,EACJG,GAAW,OAAO,kBAAq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A,EACN,aACA,QAASH,EACT,QAASI,EAAO,GAChB,aACA,SAAU,GACV,SACF,CACF,EAMaI,EAAc,GAAuC,CAChE,GAAI,OAAO,SAAa,IAAa,UAAa,CAAC,EACnD,IAAMC,EAA2B,CAAC,EAClC,GAAI,OAAO,kBAAqB,WAAY,CAC1C,IAAMC,EAAW,IAAI,iBAAiBC,CAAQ,EAC9C,IAAK,IAAMC,IAAQ,CAAC,SAAS,gBAAiB,SAAS,IAAI,EACrDA,GACFF,EAAS,QAAQE,EAAM,CACrB,WAAY,GACZ,gBAAiB,CAAC,QAAS,QAAS,aAAc,WAAW,CAC/D,CAAC,EAGLH,EAAS,SAAWC,EAAS,WAAW,CAAC,CAC3C,CACA,GAAI,OAAO,YAAe,WAAY,CACpC,IAAMG,EAAQ,WAAW,8BAA8B,EACvDA,EAAM,mBAAmB,SAAUF,CAAQ,EAC3CF,EAAS,SAAWI,EAAM,sBAAsB,SAAUF,CAAQ,CAAC,CACrE,CACA,UAAaF,EAAS,QAAS,GAAOK,EAAG,CAAC,CAC5C"}
|
|
@@ -14,8 +14,17 @@ export interface ChartTheme {
|
|
|
14
14
|
/** Resolves the colors of the options (`var(--x)` included); static colors only when omitted */
|
|
15
15
|
resolve?: ColorResolver;
|
|
16
16
|
}
|
|
17
|
-
/**
|
|
17
|
+
/**
|
|
18
|
+
* Reads the theme from the computed style of `element`. Its resolver caches
|
|
19
|
+
* the colors (DOM probes are costly): read the theme again to see new values.
|
|
20
|
+
*/
|
|
18
21
|
export declare const readTheme: (element: Element | null, palette?: readonly string[]) => ChartTheme;
|
|
22
|
+
/**
|
|
23
|
+
* Whether `next` (a re-read of `previous`) resolves any color differently:
|
|
24
|
+
* the theme colors, the palette and every color `previous` has resolved so
|
|
25
|
+
* far (series, points, annotations...). `true` when it cannot tell.
|
|
26
|
+
*/
|
|
27
|
+
export declare const themeColorsChanged: (previous: ChartTheme, next: ChartTheme) => boolean;
|
|
19
28
|
/** Theme of the charts drawn without a DOM (mini-programs, React Native) */
|
|
20
29
|
export interface ChartThemeInput {
|
|
21
30
|
/**
|
|
@@ -14,8 +14,17 @@ export interface ChartTheme {
|
|
|
14
14
|
/** Resolves the colors of the options (`var(--x)` included); static colors only when omitted */
|
|
15
15
|
resolve?: ColorResolver;
|
|
16
16
|
}
|
|
17
|
-
/**
|
|
17
|
+
/**
|
|
18
|
+
* Reads the theme from the computed style of `element`. Its resolver caches
|
|
19
|
+
* the colors (DOM probes are costly): read the theme again to see new values.
|
|
20
|
+
*/
|
|
18
21
|
export declare const readTheme: (element: Element | null, palette?: readonly string[]) => ChartTheme;
|
|
22
|
+
/**
|
|
23
|
+
* Whether `next` (a re-read of `previous`) resolves any color differently:
|
|
24
|
+
* the theme colors, the palette and every color `previous` has resolved so
|
|
25
|
+
* far (series, points, annotations...). `true` when it cannot tell.
|
|
26
|
+
*/
|
|
27
|
+
export declare const themeColorsChanged: (previous: ChartTheme, next: ChartTheme) => boolean;
|
|
19
28
|
/** Theme of the charts drawn without a DOM (mini-programs, React Native) */
|
|
20
29
|
export interface ChartThemeInput {
|
|
21
30
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { domColorResolver as e,
|
|
1
|
+
import { domColorResolver as e, memoizeColorResolver as t, mix as n, resolveStaticColor as r, sameColor as i } from "./color.js";
|
|
2
2
|
//#region src/engine/theme.ts
|
|
3
|
-
var
|
|
3
|
+
var a = [
|
|
4
4
|
"#4f46e5",
|
|
5
5
|
"#10b981",
|
|
6
6
|
"#f59e0b",
|
|
@@ -9,27 +9,51 @@ var r = [
|
|
|
9
9
|
"#8b5cf6",
|
|
10
10
|
"#14b8a6",
|
|
11
11
|
"#f97316"
|
|
12
|
-
],
|
|
13
|
-
let
|
|
14
|
-
return
|
|
15
|
-
},
|
|
12
|
+
], o = (e, t) => e?.getPropertyValue(t).trim() ?? "", s = (n, r) => {
|
|
13
|
+
let i = n && typeof getComputedStyle == "function" ? getComputedStyle(n) : null;
|
|
14
|
+
return f((e) => o(i, e), t(e(n)), r, i?.fontFamily ?? "");
|
|
15
|
+
}, c = [
|
|
16
|
+
"text",
|
|
17
|
+
"textMuted",
|
|
18
|
+
"grid",
|
|
19
|
+
"axis",
|
|
20
|
+
"background",
|
|
21
|
+
"surface",
|
|
22
|
+
"primary"
|
|
23
|
+
], l = (e, t) => {
|
|
24
|
+
if (e === t) return !1;
|
|
25
|
+
if (e.palette.length !== t.palette.length || e.palette.some((e, n) => !i(e, t.palette[n])) || c.some((n) => !i(e[n], t[n]))) return !0;
|
|
26
|
+
let n = e.resolve?.cache;
|
|
27
|
+
if (!n || !t.resolve) return !0;
|
|
28
|
+
let r = [
|
|
29
|
+
NaN,
|
|
30
|
+
NaN,
|
|
31
|
+
NaN,
|
|
32
|
+
NaN
|
|
33
|
+
];
|
|
34
|
+
for (let [e, a] of n) {
|
|
35
|
+
let n = t.resolve(e, r);
|
|
36
|
+
if (!i(a, n === r ? null : n)) return !0;
|
|
37
|
+
}
|
|
38
|
+
return !1;
|
|
39
|
+
}, u = (e = {}, t) => {
|
|
16
40
|
let n = e.variables ?? {};
|
|
17
41
|
return {
|
|
18
|
-
...
|
|
42
|
+
...f((e) => n[e]?.trim() ?? "", d(n), t?.length ? t : e.palette, ""),
|
|
19
43
|
...e.fontFamily ? { fontFamily: e.fontFamily } : {},
|
|
20
44
|
...e.fontSize ? { fontSize: e.fontSize } : {}
|
|
21
45
|
};
|
|
22
|
-
},
|
|
46
|
+
}, d = (e) => (t, n) => r(t, e, n), f = (e, t, r, i) => {
|
|
23
47
|
let o = [
|
|
24
48
|
.4,
|
|
25
49
|
.4,
|
|
26
50
|
.4,
|
|
27
51
|
1
|
|
28
|
-
], s = (e) =>
|
|
52
|
+
], s = (e) => t(e, o), c = (t, n) => {
|
|
29
53
|
for (let n of t) if (e(n)) return s(`var(${n})`);
|
|
30
54
|
return s(n);
|
|
31
55
|
}, l = c(["--surface-color", "--background-color"], "#ffffff"), u = c(["--text-color"], "#1f2937"), d = c(["--text-secondary-color", "--text-muted-color"], "#6b7280"), f = c(["--border-color"], "#e5e7eb"), p;
|
|
32
|
-
if (
|
|
56
|
+
if (r && r.length) p = r.map((e) => s(e));
|
|
33
57
|
else {
|
|
34
58
|
let t = [];
|
|
35
59
|
for (let n = 1; n <= 8; n++) {
|
|
@@ -42,23 +66,23 @@ var r = [
|
|
|
42
66
|
"--warning-color",
|
|
43
67
|
"--danger-color",
|
|
44
68
|
"--info-color"
|
|
45
|
-
].map((t, n) => e(t) ? s(`var(${t})`) : s(
|
|
69
|
+
].map((t, n) => e(t) ? s(`var(${t})`) : s(a[n])), ...a.slice(5).map((e) => s(e))];
|
|
46
70
|
}
|
|
47
|
-
let m = e("--font-family-sans") ||
|
|
71
|
+
let m = e("--font-family-sans") || i || "system-ui, -apple-system, 'Segoe UI', sans-serif";
|
|
48
72
|
return {
|
|
49
73
|
palette: p,
|
|
50
74
|
text: u,
|
|
51
75
|
textMuted: d,
|
|
52
|
-
grid:
|
|
76
|
+
grid: n(l, f, .75),
|
|
53
77
|
axis: f,
|
|
54
78
|
background: l,
|
|
55
79
|
surface: l,
|
|
56
80
|
primary: p[0],
|
|
57
81
|
fontFamily: m,
|
|
58
82
|
fontSize: 11,
|
|
59
|
-
resolve:
|
|
83
|
+
resolve: t
|
|
60
84
|
};
|
|
61
|
-
},
|
|
85
|
+
}, p = (e) => {
|
|
62
86
|
if (typeof document > "u") return () => {};
|
|
63
87
|
let t = [];
|
|
64
88
|
if (typeof MutationObserver == "function") {
|
|
@@ -81,6 +105,6 @@ var r = [
|
|
|
81
105
|
return () => t.forEach((e) => e());
|
|
82
106
|
};
|
|
83
107
|
//#endregion
|
|
84
|
-
export {
|
|
108
|
+
export { u as createTheme, s as readTheme, d as staticColorResolver, l as themeColorsChanged, p as watchTheme };
|
|
85
109
|
|
|
86
110
|
//# sourceMappingURL=theme.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.js","names":["DEFAULT_PALETTE","readVar","style","name","readTheme","element","buildTheme","domColorResolver","palette","createTheme","variables","input","staticColorResolver","resolveStaticColor","value","fallback","fallbackGray","resolveColor","resolve","color","names","readVariable","background","text","textMuted","border","colors","c","custom","i","fontFamily","inheritedFont","mix","watchTheme","cleanups","observer","onChange","node","query","fn"],"sources":["../../../../charts/src/engine/theme.ts"],"sourcesContent":["// Chart colors and fonts read from the Minerva CSS variables.\n\nimport {\n domColorResolver,\n mix,\n resolveStaticColor,\n type ColorResolver,\n type Rgba,\n} from \"./color\";\n\nexport interface ChartTheme {\n palette: Rgba[];\n text: Rgba;\n textMuted: Rgba;\n grid: Rgba;\n axis: Rgba;\n background: Rgba;\n surface: Rgba;\n primary: Rgba;\n fontFamily: string;\n /** Tick label font size in CSS pixels */\n fontSize: number;\n /** Resolves the colors of the options (`var(--x)` included); static colors only when omitted */\n resolve?: ColorResolver;\n}\n\n/** Used when no CSS variable is defined (e.g. without the Minerva stylesheet) */\nconst DEFAULT_PALETTE = [\n \"#4f46e5\",\n \"#10b981\",\n \"#f59e0b\",\n \"#ef4444\",\n \"#0ea5e9\",\n \"#8b5cf6\",\n \"#14b8a6\",\n \"#f97316\",\n];\n\nconst readVar = (style: CSSStyleDeclaration | null, name: string) =>\n style?.getPropertyValue(name).trim() ?? \"\";\n\n/** Reads the theme from the computed style of `element` */\nexport const readTheme = (\n element: Element | null,\n palette?: readonly string[],\n): ChartTheme => {\n const style =\n element && typeof getComputedStyle === \"function\"\n ? getComputedStyle(element)\n : null;\n return buildTheme(\n (name) => readVar(style, name),\n domColorResolver(element),\n palette,\n style?.fontFamily ?? \"\",\n );\n};\n\n/** Theme of the charts drawn without a DOM (mini-programs, React Native) */\nexport interface ChartThemeInput {\n /**\n * Values of the Minerva CSS variables (`--primary-color`, `--text-color`,\n * `--chart-series-1`, ...) used for the theme colors and to resolve\n * `var(--name)` colors of the options\n */\n variables?: Readonly<Record<string, string>>;\n /** Series colors (hex / rgb) */\n palette?: readonly string[];\n /** Font family of the labels */\n fontFamily?: string;\n /**\n * Font size of the tick labels, in pixels\n * @default 11\n */\n fontSize?: number;\n}\n\n/** Builds a theme from plain values (no DOM) */\nexport const createTheme = (\n input: ChartThemeInput = {},\n palette?: readonly string[],\n): ChartTheme => {\n const variables = input.variables ?? {};\n const theme = buildTheme(\n (name) => variables[name]?.trim() ?? \"\",\n staticColorResolver(variables),\n palette?.length ? palette : input.palette,\n \"\",\n );\n return {\n ...theme,\n ...(input.fontFamily ? { fontFamily: input.fontFamily } : {}),\n ...(input.fontSize ? { fontSize: input.fontSize } : {}),\n };\n};\n\n/** Resolver of `var(--name, fallback)` colors against plain variables */\nexport const staticColorResolver =\n (variables: Readonly<Record<string, string>>): ColorResolver =>\n (value, fallback) =>\n resolveStaticColor(value, variables, fallback);\n\nconst buildTheme = (\n readVariable: (name: string) => string,\n resolve: ColorResolver,\n palette: readonly string[] | undefined,\n inheritedFont: string,\n): ChartTheme => {\n const fallbackGray: Rgba = [0.4, 0.4, 0.4, 1];\n const resolveColor = (value: string) => resolve(value, fallbackGray);\n const color = (names: string[], fallback: string): Rgba => {\n for (const name of names) {\n if (readVariable(name)) return resolveColor(`var(${name})`);\n }\n return resolveColor(fallback);\n };\n\n const background = color(\n [\"--surface-color\", \"--background-color\"],\n \"#ffffff\",\n );\n const text = color([\"--text-color\"], \"#1f2937\");\n const textMuted = color(\n [\"--text-secondary-color\", \"--text-muted-color\"],\n \"#6b7280\",\n );\n const border = color([\"--border-color\"], \"#e5e7eb\");\n\n let colors: Rgba[];\n if (palette && palette.length) {\n colors = palette.map((c) => resolveColor(c));\n } else {\n const custom: Rgba[] = [];\n for (let i = 1; i <= 8; i++) {\n const name = `--chart-series-${i}`;\n if (readVariable(name)) custom.push(resolveColor(`var(${name})`));\n }\n if (custom.length) {\n colors = custom;\n } else {\n const themed = [\n \"--primary-color\",\n \"--success-color\",\n \"--warning-color\",\n \"--danger-color\",\n \"--info-color\",\n ].map((name, i) =>\n readVariable(name)\n ? resolveColor(`var(${name})`)\n : resolveColor(DEFAULT_PALETTE[i]),\n );\n colors = [\n ...themed,\n ...DEFAULT_PALETTE.slice(5).map((c) => resolveColor(c)),\n ];\n }\n }\n\n const fontFamily =\n readVariable(\"--font-family-sans\") ||\n inheritedFont ||\n \"system-ui, -apple-system, 'Segoe UI', sans-serif\";\n\n return {\n palette: colors,\n text,\n textMuted,\n grid: mix(background, border, 0.75),\n axis: border,\n background,\n surface: background,\n primary: colors[0],\n fontFamily,\n fontSize: 11,\n resolve,\n };\n};\n\n/**\n * Calls `onChange` when the theme may have changed: attributes of `<html>` /\n * `<body>` (class, style, data-theme) and the color scheme.\n */\nexport const watchTheme = (onChange: () => void): (() => void) => {\n if (typeof document === \"undefined\") return () => {};\n const cleanups: (() => void)[] = [];\n if (typeof MutationObserver === \"function\") {\n const observer = new MutationObserver(onChange);\n for (const node of [document.documentElement, document.body]) {\n if (node) {\n observer.observe(node, {\n attributes: true,\n attributeFilter: [\"class\", \"style\", \"data-theme\", \"data-mode\"],\n });\n }\n }\n cleanups.push(() => observer.disconnect());\n }\n if (typeof matchMedia === \"function\") {\n const query = matchMedia(\"(prefers-color-scheme: dark)\");\n query.addEventListener?.(\"change\", onChange);\n cleanups.push(() => query.removeEventListener?.(\"change\", onChange));\n }\n return () => cleanups.forEach((fn) => fn());\n};\n"],"mappings":";;AA2BA,IAAMA,IAAkB;CACtB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,GAEMC,KAAW,GAAmC,MAClDC,GAAO,iBAAiBC,CAAI,CAAC,CAAC,KAAK,KAAK,IAG7BC,KACX,GACA,MACe;CACf,IAAMF,IACJG,KAAW,OAAO,oBAAqB,aACnC,iBAAiBA,CAAO,IACxB;CACN,OAAOC,GACJ,MAASL,EAAQC,GAAOC,CAAI,GAC7BI,EAAiBF,CAAO,GACxBG,GACAN,GAAO,cAAc,EACvB;AACF,GAsBaO,KACX,IAAyB,CAAC,GAC1B,MACe;CACf,IAAMC,IAAYC,EAAM,aAAa,CAAC;CAOtC,OAAO;EACL,GAPYL,GACX,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3Bc,EAAajB,EAAgB6B,EAAE,CAGhC,GACH,GAAG7B,EAAgB,MAAM,CAAC,CAAC,CAAC,KAAK,MAAMiB,EAAaU,CAAC,CAAC,CACxD;CAEJ;CAEA,IAAMG,IACJT,EAAa,oBAAoB,KACjCU,KACA;CAEF,OAAO;EACL,SAASL;EACT;EACA;EACA,MAAMM,EAAIV,GAAYG,GAAQ,GAAI;EAClC,MAAMA;EACN;EACA,SAASH;EACT,SAASI,EAAO;EAChB;EACA,UAAU;EACV;CACF;AACF,GAMaO,KAAc,MAAuC;CAChE,IAAI,OAAO,WAAa,KAAa,aAAa,CAAC;CACnD,IAAMC,IAA2B,CAAC;CAClC,IAAI,OAAO,oBAAqB,YAAY;EAC1C,IAAMC,IAAW,IAAI,iBAAiBC,CAAQ;EAC9C,KAAK,IAAMC,KAAQ,CAAC,SAAS,iBAAiB,SAAS,IAAI,GACzD,AAAIA,KACFF,EAAS,QAAQE,GAAM;GACrB,YAAY;GACZ,iBAAiB;IAAC;IAAS;IAAS;IAAc;GAAW;EAC/D,CAAC;EAGL,EAAS,WAAWF,EAAS,WAAW,CAAC;CAC3C;CACA,IAAI,OAAO,cAAe,YAAY;EACpC,IAAMG,IAAQ,WAAW,8BAA8B;EAEvD,AADAA,EAAM,mBAAmB,UAAUF,CAAQ,GAC3CF,EAAS,WAAWI,EAAM,sBAAsB,UAAUF,CAAQ,CAAC;CACrE;CACA,aAAaF,EAAS,SAAS,MAAOK,EAAG,CAAC;AAC5C"}
|
|
1
|
+
{"version":3,"file":"theme.js","names":["DEFAULT_PALETTE","readVar","style","name","readTheme","element","buildTheme","memoizeColorResolver","domColorResolver","palette","THEME_COLORS","themeColorsChanged","previous","next","sameColor","c","i","key","cache","probe","value","color","resolved","createTheme","variables","input","staticColorResolver","resolveStaticColor","fallback","fallbackGray","resolveColor","resolve","names","readVariable","background","text","textMuted","border","colors","custom","fontFamily","inheritedFont","mix","watchTheme","cleanups","observer","onChange","node","query","fn"],"sources":["../../../../charts/src/engine/theme.ts"],"sourcesContent":["// Chart colors and fonts read from the Minerva CSS variables.\n\nimport {\n domColorResolver,\n memoizeColorResolver,\n mix,\n resolveStaticColor,\n sameColor,\n type ColorResolver,\n type MemoizedColorResolver,\n type Rgba,\n} from \"./color\";\n\nexport interface ChartTheme {\n palette: Rgba[];\n text: Rgba;\n textMuted: Rgba;\n grid: Rgba;\n axis: Rgba;\n background: Rgba;\n surface: Rgba;\n primary: Rgba;\n fontFamily: string;\n /** Tick label font size in CSS pixels */\n fontSize: number;\n /** Resolves the colors of the options (`var(--x)` included); static colors only when omitted */\n resolve?: ColorResolver;\n}\n\n/** Used when no CSS variable is defined (e.g. without the Minerva stylesheet) */\nconst DEFAULT_PALETTE = [\n \"#4f46e5\",\n \"#10b981\",\n \"#f59e0b\",\n \"#ef4444\",\n \"#0ea5e9\",\n \"#8b5cf6\",\n \"#14b8a6\",\n \"#f97316\",\n];\n\nconst readVar = (style: CSSStyleDeclaration | null, name: string) =>\n style?.getPropertyValue(name).trim() ?? \"\";\n\n/**\n * Reads the theme from the computed style of `element`. Its resolver caches\n * the colors (DOM probes are costly): read the theme again to see new values.\n */\nexport const readTheme = (\n element: Element | null,\n palette?: readonly string[],\n): ChartTheme => {\n const style =\n element && typeof getComputedStyle === \"function\"\n ? getComputedStyle(element)\n : null;\n return buildTheme(\n (name) => readVar(style, name),\n memoizeColorResolver(domColorResolver(element)),\n palette,\n style?.fontFamily ?? \"\",\n );\n};\n\nconst THEME_COLORS = [\n \"text\",\n \"textMuted\",\n \"grid\",\n \"axis\",\n \"background\",\n \"surface\",\n \"primary\",\n] as const;\n\n/**\n * Whether `next` (a re-read of `previous`) resolves any color differently:\n * the theme colors, the palette and every color `previous` has resolved so\n * far (series, points, annotations...). `true` when it cannot tell.\n */\nexport const themeColorsChanged = (\n previous: ChartTheme,\n next: ChartTheme,\n): boolean => {\n if (previous === next) return false;\n if (previous.palette.length !== next.palette.length) return true;\n if (previous.palette.some((c, i) => !sameColor(c, next.palette[i])))\n return true;\n if (THEME_COLORS.some((key) => !sameColor(previous[key], next[key])))\n return true;\n const cache = (previous.resolve as Partial<MemoizedColorResolver> | undefined)\n ?.cache;\n if (!cache || !next.resolve) return true;\n const probe: Rgba = [NaN, NaN, NaN, NaN];\n for (const [value, color] of cache) {\n const resolved = next.resolve(value, probe);\n if (!sameColor(color, resolved === probe ? null : resolved)) return true;\n }\n return false;\n};\n\n/** Theme of the charts drawn without a DOM (mini-programs, React Native) */\nexport interface ChartThemeInput {\n /**\n * Values of the Minerva CSS variables (`--primary-color`, `--text-color`,\n * `--chart-series-1`, ...) used for the theme colors and to resolve\n * `var(--name)` colors of the options\n */\n variables?: Readonly<Record<string, string>>;\n /** Series colors (hex / rgb) */\n palette?: readonly string[];\n /** Font family of the labels */\n fontFamily?: string;\n /**\n * Font size of the tick labels, in pixels\n * @default 11\n */\n fontSize?: number;\n}\n\n/** Builds a theme from plain values (no DOM) */\nexport const createTheme = (\n input: ChartThemeInput = {},\n palette?: readonly string[],\n): ChartTheme => {\n const variables = input.variables ?? {};\n const theme = buildTheme(\n (name) => variables[name]?.trim() ?? \"\",\n staticColorResolver(variables),\n palette?.length ? palette : input.palette,\n \"\",\n );\n return {\n ...theme,\n ...(input.fontFamily ? { fontFamily: input.fontFamily } : {}),\n ...(input.fontSize ? { fontSize: input.fontSize } : {}),\n };\n};\n\n/** Resolver of `var(--name, fallback)` colors against plain variables */\nexport const staticColorResolver =\n (variables: Readonly<Record<string, string>>): ColorResolver =>\n (value, fallback) =>\n resolveStaticColor(value, variables, fallback);\n\nconst buildTheme = (\n readVariable: (name: string) => string,\n resolve: ColorResolver,\n palette: readonly string[] | undefined,\n inheritedFont: string,\n): ChartTheme => {\n const fallbackGray: Rgba = [0.4, 0.4, 0.4, 1];\n const resolveColor = (value: string) => resolve(value, fallbackGray);\n const color = (names: string[], fallback: string): Rgba => {\n for (const name of names) {\n if (readVariable(name)) return resolveColor(`var(${name})`);\n }\n return resolveColor(fallback);\n };\n\n const background = color(\n [\"--surface-color\", \"--background-color\"],\n \"#ffffff\",\n );\n const text = color([\"--text-color\"], \"#1f2937\");\n const textMuted = color(\n [\"--text-secondary-color\", \"--text-muted-color\"],\n \"#6b7280\",\n );\n const border = color([\"--border-color\"], \"#e5e7eb\");\n\n let colors: Rgba[];\n if (palette && palette.length) {\n colors = palette.map((c) => resolveColor(c));\n } else {\n const custom: Rgba[] = [];\n for (let i = 1; i <= 8; i++) {\n const name = `--chart-series-${i}`;\n if (readVariable(name)) custom.push(resolveColor(`var(${name})`));\n }\n if (custom.length) {\n colors = custom;\n } else {\n const themed = [\n \"--primary-color\",\n \"--success-color\",\n \"--warning-color\",\n \"--danger-color\",\n \"--info-color\",\n ].map((name, i) =>\n readVariable(name)\n ? resolveColor(`var(${name})`)\n : resolveColor(DEFAULT_PALETTE[i]),\n );\n colors = [\n ...themed,\n ...DEFAULT_PALETTE.slice(5).map((c) => resolveColor(c)),\n ];\n }\n }\n\n const fontFamily =\n readVariable(\"--font-family-sans\") ||\n inheritedFont ||\n \"system-ui, -apple-system, 'Segoe UI', sans-serif\";\n\n return {\n palette: colors,\n text,\n textMuted,\n grid: mix(background, border, 0.75),\n axis: border,\n background,\n surface: background,\n primary: colors[0],\n fontFamily,\n fontSize: 11,\n resolve,\n };\n};\n\n/**\n * Calls `onChange` when the theme may have changed: attributes of `<html>` /\n * `<body>` (class, style, data-theme) and the color scheme.\n */\nexport const watchTheme = (onChange: () => void): (() => void) => {\n if (typeof document === \"undefined\") return () => {};\n const cleanups: (() => void)[] = [];\n if (typeof MutationObserver === \"function\") {\n const observer = new MutationObserver(onChange);\n for (const node of [document.documentElement, document.body]) {\n if (node) {\n observer.observe(node, {\n attributes: true,\n attributeFilter: [\"class\", \"style\", \"data-theme\", \"data-mode\"],\n });\n }\n }\n cleanups.push(() => observer.disconnect());\n }\n if (typeof matchMedia === \"function\") {\n const query = matchMedia(\"(prefers-color-scheme: dark)\");\n query.addEventListener?.(\"change\", onChange);\n cleanups.push(() => query.removeEventListener?.(\"change\", onChange));\n }\n return () => cleanups.forEach((fn) => fn());\n};\n"],"mappings":";;AA8BA,IAAMA,IAAkB;CACtB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,GAEMC,KAAW,GAAmC,MAClDC,GAAO,iBAAiBC,CAAI,CAAC,CAAC,KAAK,KAAK,IAM7BC,KACX,GACA,MACe;CACf,IAAMF,IACJG,KAAW,OAAO,oBAAqB,aACnC,iBAAiBA,CAAO,IACxB;CACN,OAAOC,GACJ,MAASL,EAAQC,GAAOC,CAAI,GAC7BI,EAAqBC,EAAiBH,CAAO,CAAC,GAC9CI,GACAP,GAAO,cAAc,EACvB;AACF,GAEMQ,IAAe;CACnB;CACA;CACA;CACA;CACA;CACA;CACA;AACF,GAOaC,KACX,GACA,MACY;CACZ,IAAIC,MAAaC,GAAM,OAAO;CAI9B,IAHID,EAAS,QAAQ,WAAWC,EAAK,QAAQ,UACzCD,EAAS,QAAQ,MAAM,GAAG,MAAM,CAACE,EAAUC,GAAGF,EAAK,QAAQG,EAAE,CAAC,KAE9DN,EAAa,MAAM,MAAQ,CAACI,EAAUF,EAASK,IAAMJ,EAAKI,EAAI,CAAC,GACjE,OAAO;CACT,IAAMC,IAASN,EAAS,SACpB;CACJ,IAAI,CAACM,KAAS,CAACL,EAAK,SAAS,OAAO;CACpC,IAAMM,IAAc;EAAC;EAAK;EAAK;EAAK;CAAG;CACvC,KAAK,IAAM,CAACC,GAAOC,MAAUH,GAAO;EAClC,IAAMI,IAAWT,EAAK,QAAQO,GAAOD,CAAK;EAC1C,IAAI,CAACL,EAAUO,GAAOC,MAAaH,IAAQ,OAAOG,CAAQ,GAAG,OAAO;CACtE;CACA,OAAO;AACT,GAsBaC,KACX,IAAyB,CAAC,GAC1B,MACe;CACf,IAAMC,IAAYC,EAAM,aAAa,CAAC;CAOtC,OAAO;EACL,GAPYnB,GACX,MAASkB,EAAUrB,EAAK,EAAE,KAAK,KAAK,IACrCuB,EAAoBF,CAAS,GAC7B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B,EAAgB,MAAM,CAAC,CAAC,CAAC,KAAK,MAAM8B,EAAaf,CAAC,CAAC,CACxD;CAEJ;CAEA,IAAMyB,IACJP,EAAa,oBAAoB,KACjCQ,KACA;CAEF,OAAO;EACL,SAASH;EACT;EACA;EACA,MAAMI,EAAIR,GAAYG,GAAQ,GAAI;EAClC,MAAMA;EACN;EACA,SAASH;EACT,SAASI,EAAO;EAChB;EACA,UAAU;EACV;CACF;AACF,GAMaK,KAAc,MAAuC;CAChE,IAAI,OAAO,WAAa,KAAa,aAAa,CAAC;CACnD,IAAMC,IAA2B,CAAC;CAClC,IAAI,OAAO,oBAAqB,YAAY;EAC1C,IAAMC,IAAW,IAAI,iBAAiBC,CAAQ;EAC9C,KAAK,IAAMC,KAAQ,CAAC,SAAS,iBAAiB,SAAS,IAAI,GACzD,AAAIA,KACFF,EAAS,QAAQE,GAAM;GACrB,YAAY;GACZ,iBAAiB;IAAC;IAAS;IAAS;IAAc;GAAW;EAC/D,CAAC;EAGL,EAAS,WAAWF,EAAS,WAAW,CAAC;CAC3C;CACA,IAAI,OAAO,cAAe,YAAY;EACpC,IAAMG,IAAQ,WAAW,8BAA8B;EAEvD,AADAA,EAAM,mBAAmB,UAAUF,CAAQ,GAC3CF,EAAS,WAAWI,EAAM,sBAAsB,UAAUF,CAAQ,CAAC;CACrE;CACA,aAAaF,EAAS,SAAS,MAAOK,EAAG,CAAC;AAC5C"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const e=require("./render-types.cjs");var t=4e4,n=0,r=1,i=2,a=(e,t,n,r,i,a,o)=>{let s=new Float32Array(i),c=new Float32Array(i),l=new Float32Array(i),u=new Float32Array(i);for(let d=0;d<i;d++){let i=d*n+r,f=t[i],p=t[i+1],m=t[i+2],h=e[3]*f+e[7]*p+e[11]*m+e[15],g=1/(h>1e-9?h:1e-9);s[d]=((e[0]*f+e[4]*p+e[8]*m+e[12])*g+1)*.5*a,c[d]=(1-(e[1]*f+e[5]*p+e[9]*m+e[13])*g)*.5*o,l[d]=(e[2]*f+e[6]*p+e[10]*m+e[14])*g,u[d]=h}return{x:s,y:c,z:l,w:u}},o=e=>e<0?0:e>255?255:Math.round(e),s=s=>{let l=s.getContext(`2d`);if(!l)return null;let u=new Map,d=(e,t,n)=>{let r=o(e)<<16|o(t)<<8|o(n),i=u.get(r);return i===void 0&&(i=`rgb(${r>>16},${r>>8&255},${r&255})`,u.size>4096&&u.clear(),u.set(r,i)),i},f=(o,u)=>{let{width:f,height:p}=s,m=u.dpr;l.setTransform(1,0,0,1,0,0),l.clearRect(0,0,f,p);let h=e.drawOrder(o),g=u.viewProj,[_,v,y,b]=u.lighting,x=u.light,S=u.fog[0]*255,C=u.fog[1]*255,w=u.fog[2]*255,T=0;for(let e of h)e.kind===`points`&&(T+=e.count);let E=Math.max(1,Math.ceil(T/t)),D=[],O=[],k=[],A=0;for(let e of h)A+=e.kind===`mesh`?e.indices.length/3:e.kind===`points`?Math.ceil(e.count/E):e.count;let j=new Float32Array(A),M=new Uint8Array(A),N=new Uint16Array(A),P=new Uint32Array(A),F=0;h.forEach((e,t)=>{let o=e.kind===`mesh`?e.vertices:e.data;if(O.push(new Float32Array(o)),k.push(new Uint8Array(o)),e.kind===`mesh`){let r=O[t],i=a(g,r,7,0,e.vertexCount,f,p);D.push(i);let o=e.indices;for(let e=0;e+2<o.length;e+=3){let r=o[e],a=o[e+1],s=o[e+2];i.w[r]<=0||i.w[a]<=0||i.w[s]<=0||(j[F]=(i.z[r]+i.z[a]+i.z[s])/3,M[F]=n,N[F]=t,P[F]=e,F++)}}else if(e.kind===`points`){let n=O[t],i=a(g,n,5,0,e.count,f,p);D.push(i);for(let n=0;n<e.count;n+=E)i.w[n]<=0||(j[F]=i.z[n],M[F]=r,N[F]=t,P[F]=n,F++)}else{let n=O[t],r=a(g,n,7,0,e.count,f,p),o=a(g,n,7,3,e.count,f,p);D.push({x:c(r.x,o.x),y:c(r.y,o.y),z:c(r.z,o.z),w:c(r.w,o.w)});let s=e.bias*5;for(let n=0;n<e.count;n++)r.w[n]<=0||o.w[n]<=0||(j[F]=(r.z[n]+o.z[n])/2-s,M[F]=i,N[F]=t,P[F]=n,F++)}});let I=new Uint32Array(F);for(let e=0;e<F;e++)I[e]=e;I.sort((e,t)=>j[t]-j[e]),l.lineJoin=`round`,l.lineCap=`round`;let L=-1,R=e=>{e!==L&&(l.globalAlpha=e,L=e)},z=u.distance-u.radius;for(let e=0;e<F;e++){let t=I[e],a=h[N[t]],o=D[N[t]],s=O[N[t]],c=k[N[t]];if(!a||!o||!s||!c)continue;let f=P[t];if(a.kind===`mesh`&&M[t]===n){let e=a.indices[f],t=a.indices[f+1],n=a.indices[f+2],r=s[e*7],i=s[e*7+1],p=s[e*7+2],m=s[t*7]-r,h=s[t*7+1]-i,g=s[t*7+2]-p,S=s[n*7]-r,C=s[n*7+1]-i,w=s[n*7+2]-p,T=h*w-g*C,E=g*S-m*w,D=m*C-h*S,O=Math.hypot(T,E,D)||1;T/=O,E/=O,D/=O;let k=u.eye[0]-r,A=u.eye[1]-i,j=u.eye[2]-p,M=Math.hypot(k,A,j)||1;k/=M,A/=M,j/=M,T*k+E*A+D*j<0&&(T=-T,E=-E,D=-D);let N=Math.max(0,T*x[0]+E*x[1]+D*x[2]),P=x[0]+k,F=x[1]+A,I=x[2]+j,L=Math.hypot(P,F,I)||1;P/=L,F/=L,I/=L;let z=Math.max(0,T*P+E*F+D*I)**+b*y*255,B=_+v*N,V=e*28+24,H=t*28+24,U=n*28+24,W=(c[V]+c[H]+c[U])/3,G=(c[V+1]+c[H+1]+c[U+1])/3,K=(c[V+2]+c[H+2]+c[U+2])/3,q=(c[V+3]+c[H+3]+c[U+3])/765,J=d(W*B+z,G*B+z,K*B+z);R(a.opacity*q),l.beginPath(),l.moveTo(o.x[e],o.y[e]),l.lineTo(o.x[t],o.y[t]),l.lineTo(o.x[n],o.y[n]),l.closePath(),l.fillStyle=J,l.fill(),a.opacity>=1&&(l.strokeStyle=J,l.lineWidth=.75,l.stroke())}else if(a.kind===`points`&&M[t]===r){let e=a.perspective&&!u.orthographic?Math.max(.5,Math.min(2,u.distance/Math.max(o.w[f],1e-6))):1,t=Math.max(.5,s[f*5+3]*m*e/2),n=f*20+16,r=s[f*5]-u.eye[0],i=s[f*5+1]-u.eye[1],p=s[f*5+2]-u.eye[2],h=Math.max(0,Math.min(1,(Math.hypot(r,i,p)-z)/(2*u.radius)))*.45,g=c[n]+(S-c[n])*h,_=c[n+1]+(C-c[n+1])*h,v=c[n+2]+(w-c[n+2])*h;R(a.opacity*(c[n+3]/255)),l.fillStyle=d(g,_,v),t<1.5?l.fillRect(o.x[f]-t,o.y[f]-t,t*2,t*2):(l.beginPath(),l.arc(o.x[f],o.y[f],t,0,Math.PI*2),l.fill())}else if(a.kind===`lines`&&M[t]===i){let e=f*28+24,t=o.x.length/2;R(a.opacity*(c[e+3]/255)),l.strokeStyle=d(c[e],c[e+1],c[e+2]),l.lineWidth=Math.max(.5,a.width*m),l.beginPath(),l.moveTo(o.x[f],o.y[f]),l.lineTo(o.x[t+f],o.y[t+f]),l.stroke()}}l.globalAlpha=1};return{kind:`canvas2d`,canvas:s,resize(e,t){s.width=Math.max(1,e),s.height=Math.max(1,t)},render(e,t){f(e,t)},destroy(){u.clear(),l.setTransform(1,0,0,1,0,0),l.clearRect(0,0,s.width,s.height)}}},c=(e,t)=>{let n=new Float32Array(e.length+t.length);return n.set(e,0),n.set(t,e.length),n};exports.CPU_POINT_BUDGET=t,exports.createCanvas2d3D=s;
|
|
2
|
+
//# sourceMappingURL=canvas2d.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"canvas2d.cjs","names":["drawOrder","require_render_types","CPU_POINT_BUDGET","TRIANGLE","POINT","SEGMENT","projectAll","x","count","y","z","w","i","o","stride","offset","px","data","py","pz","cw","m","iw","width","height","clamp255","v","createCanvas2d3D","ctx","canvas","styles","style","key","r","g","b","s","render","dpr","frame","ordered","items","ambient","diffuse","specular","shininess","L","fogR","fogG","fogB","totalPoints","item","pointStride","projected","floats","bytes","capacity","depth","kind","owner","element","n","raw","f32","k","p","idx","t","a","c","concat","bias","order","currentAlpha","alpha","value","near","u8","e","ax","ay","az","ux","uy","uz","vx","vy","vz","nx","ny","nz","len","ex","ey","ez","el","lambert","hx","hy","hz","hl","spec","light","ca","cb","cc","bl","ac","fill","scale","radius","wx","wy","wz","fog","half","out"],"sources":["../../../../../charts/src/engine/three-d/canvas2d.ts"],"sourcesContent":["// Canvas2D backend of the 3D charts: CPU projection and the painter's\n// algorithm (every triangle, dot and segment sorted back to front), flat\n// lighting per triangle. Point clouds are decimated to a fixed budget; the\n// chart also resamples the surfaces (`CPU_BUDGET`) for this backend.\n\nimport {\n drawOrder,\n type Frame3D,\n type Item3D,\n type Renderer3D,\n} from \"./render-types\";\n\n/** Largest number of dots drawn per frame (by stride over every point item) */\nexport const CPU_POINT_BUDGET = 40_000;\n\nconst TRIANGLE = 0;\nconst POINT = 1;\nconst SEGMENT = 2;\n\ninterface Projected {\n x: Float32Array;\n y: Float32Array;\n z: Float32Array;\n w: Float32Array;\n}\n\nconst projectAll = (\n m: Float32Array,\n data: Float32Array,\n stride: number,\n offset: number,\n count: number,\n width: number,\n height: number,\n): Projected => {\n const x = new Float32Array(count);\n const y = new Float32Array(count);\n const z = new Float32Array(count);\n const w = new Float32Array(count);\n for (let i = 0; i < count; i++) {\n const o = i * stride + offset;\n const px = data[o];\n const py = data[o + 1];\n const pz = data[o + 2];\n const cw = m[3] * px + m[7] * py + m[11] * pz + m[15];\n const iw = 1 / (cw > 1e-9 ? cw : 1e-9);\n x[i] = ((m[0] * px + m[4] * py + m[8] * pz + m[12]) * iw + 1) * 0.5 * width;\n y[i] =\n (1 - (m[1] * px + m[5] * py + m[9] * pz + m[13]) * iw) * 0.5 * height;\n z[i] = (m[2] * px + m[6] * py + m[10] * pz + m[14]) * iw;\n w[i] = cw;\n }\n return { x, y, z, w };\n};\n\nconst clamp255 = (v: number) => (v < 0 ? 0 : v > 255 ? 255 : Math.round(v));\n\nexport const createCanvas2d3D = (\n canvas: HTMLCanvasElement,\n): Renderer3D | null => {\n const ctx = canvas.getContext(\"2d\");\n if (!ctx) return null;\n const styles = new Map<number, string>();\n const style = (r: number, g: number, b: number) => {\n const key = (clamp255(r) << 16) | (clamp255(g) << 8) | clamp255(b);\n let s = styles.get(key);\n if (s === undefined) {\n s = `rgb(${key >> 16},${(key >> 8) & 255},${key & 255})`;\n if (styles.size > 4096) styles.clear();\n styles.set(key, s);\n }\n return s;\n };\n\n const render = (items: readonly Item3D[], frame: Frame3D) => {\n const { width, height } = canvas;\n const dpr = frame.dpr;\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.clearRect(0, 0, width, height);\n const ordered = drawOrder(items);\n const m = frame.viewProj;\n const [ambient, diffuse, specular, shininess] = frame.lighting;\n const L = frame.light;\n const fogR = frame.fog[0] * 255;\n const fogG = frame.fog[1] * 255;\n const fogB = frame.fog[2] * 255;\n\n let totalPoints = 0;\n for (const item of ordered)\n if (item.kind === \"points\") totalPoints += item.count;\n const pointStride = Math.max(1, Math.ceil(totalPoints / CPU_POINT_BUDGET));\n\n // ---- collect the primitives\n const projected: (Projected | null)[] = [];\n // typed views of every item (floats and bytes of the same buffer)\n const floats: Float32Array[] = [];\n const bytes: Uint8Array[] = [];\n let capacity = 0;\n for (const item of ordered) {\n capacity +=\n item.kind === \"mesh\"\n ? item.indices.length / 3\n : item.kind === \"points\"\n ? Math.ceil(item.count / pointStride)\n : item.count;\n }\n const depth = new Float32Array(capacity);\n const kind = new Uint8Array(capacity);\n const owner = new Uint16Array(capacity);\n const element = new Uint32Array(capacity);\n let n = 0;\n ordered.forEach((item, k) => {\n const raw = item.kind === \"mesh\" ? item.vertices : item.data;\n floats.push(new Float32Array(raw));\n bytes.push(new Uint8Array(raw));\n if (item.kind === \"mesh\") {\n const f32 = floats[k]!;\n const p = projectAll(m, f32, 7, 0, item.vertexCount, width, height);\n projected.push(p);\n const idx = item.indices;\n for (let t = 0; t + 2 < idx.length; t += 3) {\n const a = idx[t];\n const b = idx[t + 1];\n const c = idx[t + 2];\n if (p.w[a] <= 0 || p.w[b] <= 0 || p.w[c] <= 0) continue;\n depth[n] = (p.z[a] + p.z[b] + p.z[c]) / 3;\n kind[n] = TRIANGLE;\n owner[n] = k;\n element[n] = t;\n n++;\n }\n } else if (item.kind === \"points\") {\n const f32 = floats[k]!;\n const p = projectAll(m, f32, 5, 0, item.count, width, height);\n projected.push(p);\n for (let i = 0; i < item.count; i += pointStride) {\n if (p.w[i] <= 0) continue;\n depth[n] = p.z[i];\n kind[n] = POINT;\n owner[n] = k;\n element[n] = i;\n n++;\n }\n } else {\n const f32 = floats[k]!;\n // both ends: projected as two interleaved point lists\n const a = projectAll(m, f32, 7, 0, item.count, width, height);\n const b = projectAll(m, f32, 7, 3, item.count, width, height);\n projected.push({\n x: concat(a.x, b.x),\n y: concat(a.y, b.y),\n z: concat(a.z, b.z),\n w: concat(a.w, b.w),\n });\n const bias = item.bias * 5;\n for (let i = 0; i < item.count; i++) {\n if (a.w[i] <= 0 || b.w[i] <= 0) continue;\n depth[n] = (a.z[i] + b.z[i]) / 2 - bias;\n kind[n] = SEGMENT;\n owner[n] = k;\n element[n] = i;\n n++;\n }\n }\n });\n const order = new Uint32Array(n);\n for (let i = 0; i < n; i++) order[i] = i;\n order.sort((a, b) => depth[b] - depth[a]);\n\n // ---- draw back to front\n ctx.lineJoin = \"round\";\n ctx.lineCap = \"round\";\n let currentAlpha = -1;\n const alpha = (value: number) => {\n if (value !== currentAlpha) {\n ctx.globalAlpha = value;\n currentAlpha = value;\n }\n };\n const near = frame.distance - frame.radius;\n for (let o = 0; o < n; o++) {\n const i = order[o];\n const item = ordered[owner[i]];\n const p = projected[owner[i]];\n const f32 = floats[owner[i]];\n const u8 = bytes[owner[i]];\n if (!item || !p || !f32 || !u8) continue;\n const e = element[i];\n if (item.kind === \"mesh\" && kind[i] === TRIANGLE) {\n const a = item.indices[e];\n const b = item.indices[e + 1];\n const c = item.indices[e + 2];\n // flat normal facing the camera\n const ax = f32[a * 7],\n ay = f32[a * 7 + 1],\n az = f32[a * 7 + 2];\n const ux = f32[b * 7] - ax,\n uy = f32[b * 7 + 1] - ay,\n uz = f32[b * 7 + 2] - az;\n const vx = f32[c * 7] - ax,\n vy = f32[c * 7 + 1] - ay,\n vz = f32[c * 7 + 2] - az;\n let nx = uy * vz - uz * vy;\n let ny = uz * vx - ux * vz;\n let nz = ux * vy - uy * vx;\n const len = Math.hypot(nx, ny, nz) || 1;\n nx /= len;\n ny /= len;\n nz /= len;\n let ex = frame.eye[0] - ax;\n let ey = frame.eye[1] - ay;\n let ez = frame.eye[2] - az;\n const el = Math.hypot(ex, ey, ez) || 1;\n ex /= el;\n ey /= el;\n ez /= el;\n if (nx * ex + ny * ey + nz * ez < 0) {\n nx = -nx;\n ny = -ny;\n nz = -nz;\n }\n const lambert = Math.max(0, nx * L[0] + ny * L[1] + nz * L[2]);\n let hx = L[0] + ex;\n let hy = L[1] + ey;\n let hz = L[2] + ez;\n const hl = Math.hypot(hx, hy, hz) || 1;\n hx /= hl;\n hy /= hl;\n hz /= hl;\n const spec =\n Math.pow(Math.max(0, nx * hx + ny * hy + nz * hz), shininess) *\n specular *\n 255;\n const light = ambient + diffuse * lambert;\n const ca = a * 28 + 24;\n const cb = b * 28 + 24;\n const cc = c * 28 + 24;\n const r = (u8[ca] + u8[cb] + u8[cc]) / 3;\n const g = (u8[ca + 1] + u8[cb + 1] + u8[cc + 1]) / 3;\n const bl = (u8[ca + 2] + u8[cb + 2] + u8[cc + 2]) / 3;\n const ac = (u8[ca + 3] + u8[cb + 3] + u8[cc + 3]) / 765;\n const fill = style(\n r * light + spec,\n g * light + spec,\n bl * light + spec,\n );\n alpha(item.opacity * ac);\n ctx.beginPath();\n ctx.moveTo(p.x[a], p.y[a]);\n ctx.lineTo(p.x[b], p.y[b]);\n ctx.lineTo(p.x[c], p.y[c]);\n ctx.closePath();\n ctx.fillStyle = fill;\n ctx.fill();\n if (item.opacity >= 1) {\n // hides the seams between neighbouring triangles\n ctx.strokeStyle = fill;\n ctx.lineWidth = 0.75;\n ctx.stroke();\n }\n } else if (item.kind === \"points\" && kind[i] === POINT) {\n const scale =\n item.perspective && !frame.orthographic\n ? Math.max(\n 0.5,\n Math.min(2, frame.distance / Math.max(p.w[e], 1e-6)),\n )\n : 1;\n const radius = Math.max(0.5, (f32[e * 5 + 3] * dpr * scale) / 2);\n const c = e * 20 + 16;\n const wx = f32[e * 5] - frame.eye[0];\n const wy = f32[e * 5 + 1] - frame.eye[1];\n const wz = f32[e * 5 + 2] - frame.eye[2];\n const fog =\n Math.max(\n 0,\n Math.min(1, (Math.hypot(wx, wy, wz) - near) / (2 * frame.radius)),\n ) * 0.45;\n const r = u8[c] + (fogR - u8[c]) * fog;\n const g = u8[c + 1] + (fogG - u8[c + 1]) * fog;\n const b = u8[c + 2] + (fogB - u8[c + 2]) * fog;\n alpha(item.opacity * (u8[c + 3] / 255));\n ctx.fillStyle = style(r, g, b);\n if (radius < 1.5) {\n ctx.fillRect(\n p.x[e] - radius,\n p.y[e] - radius,\n radius * 2,\n radius * 2,\n );\n } else {\n ctx.beginPath();\n ctx.arc(p.x[e], p.y[e], radius, 0, Math.PI * 2);\n ctx.fill();\n }\n } else if (item.kind === \"lines\" && kind[i] === SEGMENT) {\n const c = e * 28 + 24;\n const half = p.x.length / 2;\n alpha(item.opacity * (u8[c + 3] / 255));\n ctx.strokeStyle = style(u8[c], u8[c + 1], u8[c + 2]);\n ctx.lineWidth = Math.max(0.5, item.width * dpr);\n ctx.beginPath();\n ctx.moveTo(p.x[e], p.y[e]);\n ctx.lineTo(p.x[half + e], p.y[half + e]);\n ctx.stroke();\n }\n }\n ctx.globalAlpha = 1;\n };\n\n return {\n kind: \"canvas2d\",\n canvas,\n resize(width, height) {\n canvas.width = Math.max(1, width);\n canvas.height = Math.max(1, height);\n },\n render(items, frame) {\n render(items, frame);\n },\n destroy() {\n styles.clear();\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n },\n };\n};\n\nconst concat = (a: Float32Array, b: Float32Array) => {\n const out = new Float32Array(a.length + b.length);\n out.set(a, 0);\n out.set(b, a.length);\n return out;\n};\n"],"mappings":"sCAaA,IAAaE,EAAmB,IAE1BC,EAAW,EACXC,EAAQ,EACRC,EAAU,EASVC,GACJ,EACA,EACA,EACA,EACA,EACA,EACA,IACc,CACd,IAAMC,EAAI,IAAI,aAAaC,CAAK,EAC1BC,EAAI,IAAI,aAAaD,CAAK,EAC1BE,EAAI,IAAI,aAAaF,CAAK,EAC1BG,EAAI,IAAI,aAAaH,CAAK,EAChC,IAAK,IAAII,EAAI,EAAGA,EAAIJ,EAAO,IAAK,CAC9B,IAAMK,EAAID,EAAIE,EAASC,EACjBC,EAAKC,EAAKJ,GACVK,EAAKD,EAAKJ,EAAI,GACdM,EAAKF,EAAKJ,EAAI,GACdO,EAAKC,EAAE,GAAKL,EAAKK,EAAE,GAAKH,EAAKG,EAAE,IAAMF,EAAKE,EAAE,IAC5CC,EAAK,GAAKF,EAAK,KAAOA,EAAK,MACjC,EAAER,KAAOS,EAAE,GAAKL,EAAKK,EAAE,GAAKH,EAAKG,EAAE,GAAKF,EAAKE,EAAE,KAAOC,EAAK,GAAK,GAAMC,EACtE,EAAEX,IACC,GAAKS,EAAE,GAAKL,EAAKK,EAAE,GAAKH,EAAKG,EAAE,GAAKF,EAAKE,EAAE,KAAOC,GAAM,GAAME,EACjE,EAAEZ,IAAMS,EAAE,GAAKL,EAAKK,EAAE,GAAKH,EAAKG,EAAE,IAAMF,EAAKE,EAAE,KAAOC,EACtD,EAAEV,GAAKQ,CACT,CACA,MAAO,CAAE,IAAG,IAAG,IAAG,GAAE,CACtB,EAEMK,EAAY,GAAeC,EAAI,EAAI,EAAIA,EAAI,IAAM,IAAM,KAAK,MAAMA,CAAC,EAE5DC,EACX,GACsB,CACtB,IAAMC,EAAMC,E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AAIS,EAAI,GAAK,GACbqC,EAAOlD,EAAE,EAAE,OAAS,EAC1BS,EAAMvB,EAAK,SAAW0B,EAAGR,EAAI,GAAK,IAAI,EACtC,EAAI,YAActC,EAAM8C,EAAGR,GAAIQ,EAAGR,EAAI,GAAIQ,EAAGR,EAAI,EAAE,EACnD,EAAI,UAAY,KAAK,IAAI,GAAKlB,EAAK,MAAQb,CAAG,EAC9CV,EAAI,UAAU,EACdA,EAAI,OAAOqC,EAAE,EAAEa,GAAIb,EAAE,EAAEa,EAAE,EACzBlD,EAAI,OAAOqC,EAAE,EAAEkD,EAAOrC,GAAIb,EAAE,EAAEkD,EAAOrC,EAAE,EACvClD,EAAI,OAAO,CACb,CACF,CACA,EAAI,YAAc,CACpB,EAEA,MAAO,CACL,KAAM,WACN,SACA,OAAO,EAAO,EAAQ,CACpB,EAAO,MAAQ,KAAK,IAAI,EAAGL,CAAK,EAChC,EAAO,OAAS,KAAK,IAAI,EAAGC,CAAM,CACpC,EACA,OAAO,EAAO,EAAO,CACnBa,EAAOI,EAAOF,CAAK,CACrB,EACA,SAAU,CACRT,EAAO,MAAM,EACbF,EAAI,aAAa,EAAG,EAAG,EAAG,EAAG,EAAG,CAAC,EACjCA,EAAI,UAAU,EAAG,EAAGC,EAAO,MAAOA,EAAO,MAAM,CACjD,CACF,CACF,EAEMyC,GAAU,EAAiB,IAAoB,CACnD,IAAM8C,EAAM,IAAI,aAAahD,EAAE,OAASjC,EAAE,MAAM,EAGhD,OAFAiF,EAAI,IAAIhD,EAAG,CAAC,EACZgD,EAAI,IAAIjF,EAAGiC,EAAE,MAAM,EACZgD,CACT"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { drawOrder as e } from "./render-types.js";
|
|
2
|
+
//#region src/engine/three-d/canvas2d.ts
|
|
3
|
+
var t = 4e4, n = 0, r = 1, i = 2, a = (e, t, n, r, i, a, o) => {
|
|
4
|
+
let s = new Float32Array(i), c = new Float32Array(i), l = new Float32Array(i), u = new Float32Array(i);
|
|
5
|
+
for (let d = 0; d < i; d++) {
|
|
6
|
+
let i = d * n + r, f = t[i], p = t[i + 1], m = t[i + 2], h = e[3] * f + e[7] * p + e[11] * m + e[15], g = 1 / (h > 1e-9 ? h : 1e-9);
|
|
7
|
+
s[d] = ((e[0] * f + e[4] * p + e[8] * m + e[12]) * g + 1) * .5 * a, c[d] = (1 - (e[1] * f + e[5] * p + e[9] * m + e[13]) * g) * .5 * o, l[d] = (e[2] * f + e[6] * p + e[10] * m + e[14]) * g, u[d] = h;
|
|
8
|
+
}
|
|
9
|
+
return {
|
|
10
|
+
x: s,
|
|
11
|
+
y: c,
|
|
12
|
+
z: l,
|
|
13
|
+
w: u
|
|
14
|
+
};
|
|
15
|
+
}, o = (e) => e < 0 ? 0 : e > 255 ? 255 : Math.round(e), s = (s) => {
|
|
16
|
+
let l = s.getContext("2d");
|
|
17
|
+
if (!l) return null;
|
|
18
|
+
let u = /* @__PURE__ */ new Map(), d = (e, t, n) => {
|
|
19
|
+
let r = o(e) << 16 | o(t) << 8 | o(n), i = u.get(r);
|
|
20
|
+
return i === void 0 && (i = `rgb(${r >> 16},${r >> 8 & 255},${r & 255})`, u.size > 4096 && u.clear(), u.set(r, i)), i;
|
|
21
|
+
}, f = (o, u) => {
|
|
22
|
+
let { width: f, height: p } = s, m = u.dpr;
|
|
23
|
+
l.setTransform(1, 0, 0, 1, 0, 0), l.clearRect(0, 0, f, p);
|
|
24
|
+
let h = e(o), g = u.viewProj, [_, v, y, b] = u.lighting, x = u.light, S = u.fog[0] * 255, C = u.fog[1] * 255, w = u.fog[2] * 255, T = 0;
|
|
25
|
+
for (let e of h) e.kind === "points" && (T += e.count);
|
|
26
|
+
let E = Math.max(1, Math.ceil(T / t)), D = [], O = [], k = [], A = 0;
|
|
27
|
+
for (let e of h) A += e.kind === "mesh" ? e.indices.length / 3 : e.kind === "points" ? Math.ceil(e.count / E) : e.count;
|
|
28
|
+
let j = new Float32Array(A), M = new Uint8Array(A), N = new Uint16Array(A), P = new Uint32Array(A), F = 0;
|
|
29
|
+
h.forEach((e, t) => {
|
|
30
|
+
let o = e.kind === "mesh" ? e.vertices : e.data;
|
|
31
|
+
if (O.push(new Float32Array(o)), k.push(new Uint8Array(o)), e.kind === "mesh") {
|
|
32
|
+
let r = O[t], i = a(g, r, 7, 0, e.vertexCount, f, p);
|
|
33
|
+
D.push(i);
|
|
34
|
+
let o = e.indices;
|
|
35
|
+
for (let e = 0; e + 2 < o.length; e += 3) {
|
|
36
|
+
let r = o[e], a = o[e + 1], s = o[e + 2];
|
|
37
|
+
i.w[r] <= 0 || i.w[a] <= 0 || i.w[s] <= 0 || (j[F] = (i.z[r] + i.z[a] + i.z[s]) / 3, M[F] = n, N[F] = t, P[F] = e, F++);
|
|
38
|
+
}
|
|
39
|
+
} else if (e.kind === "points") {
|
|
40
|
+
let n = O[t], i = a(g, n, 5, 0, e.count, f, p);
|
|
41
|
+
D.push(i);
|
|
42
|
+
for (let n = 0; n < e.count; n += E) i.w[n] <= 0 || (j[F] = i.z[n], M[F] = r, N[F] = t, P[F] = n, F++);
|
|
43
|
+
} else {
|
|
44
|
+
let n = O[t], r = a(g, n, 7, 0, e.count, f, p), o = a(g, n, 7, 3, e.count, f, p);
|
|
45
|
+
D.push({
|
|
46
|
+
x: c(r.x, o.x),
|
|
47
|
+
y: c(r.y, o.y),
|
|
48
|
+
z: c(r.z, o.z),
|
|
49
|
+
w: c(r.w, o.w)
|
|
50
|
+
});
|
|
51
|
+
let s = e.bias * 5;
|
|
52
|
+
for (let n = 0; n < e.count; n++) r.w[n] <= 0 || o.w[n] <= 0 || (j[F] = (r.z[n] + o.z[n]) / 2 - s, M[F] = i, N[F] = t, P[F] = n, F++);
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
let I = new Uint32Array(F);
|
|
56
|
+
for (let e = 0; e < F; e++) I[e] = e;
|
|
57
|
+
I.sort((e, t) => j[t] - j[e]), l.lineJoin = "round", l.lineCap = "round";
|
|
58
|
+
let L = -1, R = (e) => {
|
|
59
|
+
e !== L && (l.globalAlpha = e, L = e);
|
|
60
|
+
}, z = u.distance - u.radius;
|
|
61
|
+
for (let e = 0; e < F; e++) {
|
|
62
|
+
let t = I[e], a = h[N[t]], o = D[N[t]], s = O[N[t]], c = k[N[t]];
|
|
63
|
+
if (!a || !o || !s || !c) continue;
|
|
64
|
+
let f = P[t];
|
|
65
|
+
if (a.kind === "mesh" && M[t] === n) {
|
|
66
|
+
let e = a.indices[f], t = a.indices[f + 1], n = a.indices[f + 2], r = s[e * 7], i = s[e * 7 + 1], p = s[e * 7 + 2], m = s[t * 7] - r, h = s[t * 7 + 1] - i, g = s[t * 7 + 2] - p, S = s[n * 7] - r, C = s[n * 7 + 1] - i, w = s[n * 7 + 2] - p, T = h * w - g * C, E = g * S - m * w, D = m * C - h * S, O = Math.hypot(T, E, D) || 1;
|
|
67
|
+
T /= O, E /= O, D /= O;
|
|
68
|
+
let k = u.eye[0] - r, A = u.eye[1] - i, j = u.eye[2] - p, M = Math.hypot(k, A, j) || 1;
|
|
69
|
+
k /= M, A /= M, j /= M, T * k + E * A + D * j < 0 && (T = -T, E = -E, D = -D);
|
|
70
|
+
let N = Math.max(0, T * x[0] + E * x[1] + D * x[2]), P = x[0] + k, F = x[1] + A, I = x[2] + j, L = Math.hypot(P, F, I) || 1;
|
|
71
|
+
P /= L, F /= L, I /= L;
|
|
72
|
+
let z = Math.max(0, T * P + E * F + D * I) ** +b * y * 255, B = _ + v * N, V = e * 28 + 24, H = t * 28 + 24, U = n * 28 + 24, W = (c[V] + c[H] + c[U]) / 3, G = (c[V + 1] + c[H + 1] + c[U + 1]) / 3, K = (c[V + 2] + c[H + 2] + c[U + 2]) / 3, q = (c[V + 3] + c[H + 3] + c[U + 3]) / 765, J = d(W * B + z, G * B + z, K * B + z);
|
|
73
|
+
R(a.opacity * q), l.beginPath(), l.moveTo(o.x[e], o.y[e]), l.lineTo(o.x[t], o.y[t]), l.lineTo(o.x[n], o.y[n]), l.closePath(), l.fillStyle = J, l.fill(), a.opacity >= 1 && (l.strokeStyle = J, l.lineWidth = .75, l.stroke());
|
|
74
|
+
} else if (a.kind === "points" && M[t] === r) {
|
|
75
|
+
let e = a.perspective && !u.orthographic ? Math.max(.5, Math.min(2, u.distance / Math.max(o.w[f], 1e-6))) : 1, t = Math.max(.5, s[f * 5 + 3] * m * e / 2), n = f * 20 + 16, r = s[f * 5] - u.eye[0], i = s[f * 5 + 1] - u.eye[1], p = s[f * 5 + 2] - u.eye[2], h = Math.max(0, Math.min(1, (Math.hypot(r, i, p) - z) / (2 * u.radius))) * .45, g = c[n] + (S - c[n]) * h, _ = c[n + 1] + (C - c[n + 1]) * h, v = c[n + 2] + (w - c[n + 2]) * h;
|
|
76
|
+
R(a.opacity * (c[n + 3] / 255)), l.fillStyle = d(g, _, v), t < 1.5 ? l.fillRect(o.x[f] - t, o.y[f] - t, t * 2, t * 2) : (l.beginPath(), l.arc(o.x[f], o.y[f], t, 0, Math.PI * 2), l.fill());
|
|
77
|
+
} else if (a.kind === "lines" && M[t] === i) {
|
|
78
|
+
let e = f * 28 + 24, t = o.x.length / 2;
|
|
79
|
+
R(a.opacity * (c[e + 3] / 255)), l.strokeStyle = d(c[e], c[e + 1], c[e + 2]), l.lineWidth = Math.max(.5, a.width * m), l.beginPath(), l.moveTo(o.x[f], o.y[f]), l.lineTo(o.x[t + f], o.y[t + f]), l.stroke();
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
l.globalAlpha = 1;
|
|
83
|
+
};
|
|
84
|
+
return {
|
|
85
|
+
kind: "canvas2d",
|
|
86
|
+
canvas: s,
|
|
87
|
+
resize(e, t) {
|
|
88
|
+
s.width = Math.max(1, e), s.height = Math.max(1, t);
|
|
89
|
+
},
|
|
90
|
+
render(e, t) {
|
|
91
|
+
f(e, t);
|
|
92
|
+
},
|
|
93
|
+
destroy() {
|
|
94
|
+
u.clear(), l.setTransform(1, 0, 0, 1, 0, 0), l.clearRect(0, 0, s.width, s.height);
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
}, c = (e, t) => {
|
|
98
|
+
let n = new Float32Array(e.length + t.length);
|
|
99
|
+
return n.set(e, 0), n.set(t, e.length), n;
|
|
100
|
+
};
|
|
101
|
+
//#endregion
|
|
102
|
+
export { t as CPU_POINT_BUDGET, s as createCanvas2d3D };
|
|
103
|
+
|
|
104
|
+
//# sourceMappingURL=canvas2d.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"canvas2d.js","names":["CPU_POINT_BUDGET","TRIANGLE","POINT","SEGMENT","projectAll","x","count","y","z","w","i","o","stride","offset","px","data","py","pz","cw","m","iw","width","height","clamp255","v","createCanvas2d3D","ctx","canvas","styles","style","key","r","g","b","s","render","dpr","frame","ordered","drawOrder","items","ambient","diffuse","specular","shininess","L","fogR","fogG","fogB","totalPoints","item","pointStride","projected","floats","bytes","capacity","depth","kind","owner","element","n","raw","f32","k","p","idx","t","a","c","concat","bias","order","currentAlpha","alpha","value","near","u8","e","ax","ay","az","ux","uy","uz","vx","vy","vz","nx","ny","nz","len","ex","ey","ez","el","lambert","hx","hy","hz","hl","spec","light","ca","cb","cc","bl","ac","fill","scale","radius","wx","wy","wz","fog","half","out"],"sources":["../../../../../charts/src/engine/three-d/canvas2d.ts"],"sourcesContent":["// Canvas2D backend of the 3D charts: CPU projection and the painter's\n// algorithm (every triangle, dot and segment sorted back to front), flat\n// lighting per triangle. Point clouds are decimated to a fixed budget; the\n// chart also resamples the surfaces (`CPU_BUDGET`) for this backend.\n\nimport {\n drawOrder,\n type Frame3D,\n type Item3D,\n type Renderer3D,\n} from \"./render-types\";\n\n/** Largest number of dots drawn per frame (by stride over every point item) */\nexport const CPU_POINT_BUDGET = 40_000;\n\nconst TRIANGLE = 0;\nconst POINT = 1;\nconst SEGMENT = 2;\n\ninterface Projected {\n x: Float32Array;\n y: Float32Array;\n z: Float32Array;\n w: Float32Array;\n}\n\nconst projectAll = (\n m: Float32Array,\n data: Float32Array,\n stride: number,\n offset: number,\n count: number,\n width: number,\n height: number,\n): Projected => {\n const x = new Float32Array(count);\n const y = new Float32Array(count);\n const z = new Float32Array(count);\n const w = new Float32Array(count);\n for (let i = 0; i < count; i++) {\n const o = i * stride + offset;\n const px = data[o];\n const py = data[o + 1];\n const pz = data[o + 2];\n const cw = m[3] * px + m[7] * py + m[11] * pz + m[15];\n const iw = 1 / (cw > 1e-9 ? cw : 1e-9);\n x[i] = ((m[0] * px + m[4] * py + m[8] * pz + m[12]) * iw + 1) * 0.5 * width;\n y[i] =\n (1 - (m[1] * px + m[5] * py + m[9] * pz + m[13]) * iw) * 0.5 * height;\n z[i] = (m[2] * px + m[6] * py + m[10] * pz + m[14]) * iw;\n w[i] = cw;\n }\n return { x, y, z, w };\n};\n\nconst clamp255 = (v: number) => (v < 0 ? 0 : v > 255 ? 255 : Math.round(v));\n\nexport const createCanvas2d3D = (\n canvas: HTMLCanvasElement,\n): Renderer3D | null => {\n const ctx = canvas.getContext(\"2d\");\n if (!ctx) return null;\n const styles = new Map<number, string>();\n const style = (r: number, g: number, b: number) => {\n const key = (clamp255(r) << 16) | (clamp255(g) << 8) | clamp255(b);\n let s = styles.get(key);\n if (s === undefined) {\n s = `rgb(${key >> 16},${(key >> 8) & 255},${key & 255})`;\n if (styles.size > 4096) styles.clear();\n styles.set(key, s);\n }\n return s;\n };\n\n const render = (items: readonly Item3D[], frame: Frame3D) => {\n const { width, height } = canvas;\n const dpr = frame.dpr;\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.clearRect(0, 0, width, height);\n const ordered = drawOrder(items);\n const m = frame.viewProj;\n const [ambient, diffuse, specular, shininess] = frame.lighting;\n const L = frame.light;\n const fogR = frame.fog[0] * 255;\n const fogG = frame.fog[1] * 255;\n const fogB = frame.fog[2] * 255;\n\n let totalPoints = 0;\n for (const item of ordered)\n if (item.kind === \"points\") totalPoints += item.count;\n const pointStride = Math.max(1, Math.ceil(totalPoints / CPU_POINT_BUDGET));\n\n // ---- collect the primitives\n const projected: (Projected | null)[] = [];\n // typed views of every item (floats and bytes of the same buffer)\n const floats: Float32Array[] = [];\n const bytes: Uint8Array[] = [];\n let capacity = 0;\n for (const item of ordered) {\n capacity +=\n item.kind === \"mesh\"\n ? item.indices.length / 3\n : item.kind === \"points\"\n ? Math.ceil(item.count / pointStride)\n : item.count;\n }\n const depth = new Float32Array(capacity);\n const kind = new Uint8Array(capacity);\n const owner = new Uint16Array(capacity);\n const element = new Uint32Array(capacity);\n let n = 0;\n ordered.forEach((item, k) => {\n const raw = item.kind === \"mesh\" ? item.vertices : item.data;\n floats.push(new Float32Array(raw));\n bytes.push(new Uint8Array(raw));\n if (item.kind === \"mesh\") {\n const f32 = floats[k]!;\n const p = projectAll(m, f32, 7, 0, item.vertexCount, width, height);\n projected.push(p);\n const idx = item.indices;\n for (let t = 0; t + 2 < idx.length; t += 3) {\n const a = idx[t];\n const b = idx[t + 1];\n const c = idx[t + 2];\n if (p.w[a] <= 0 || p.w[b] <= 0 || p.w[c] <= 0) continue;\n depth[n] = (p.z[a] + p.z[b] + p.z[c]) / 3;\n kind[n] = TRIANGLE;\n owner[n] = k;\n element[n] = t;\n n++;\n }\n } else if (item.kind === \"points\") {\n const f32 = floats[k]!;\n const p = projectAll(m, f32, 5, 0, item.count, width, height);\n projected.push(p);\n for (let i = 0; i < item.count; i += pointStride) {\n if (p.w[i] <= 0) continue;\n depth[n] = p.z[i];\n kind[n] = POINT;\n owner[n] = k;\n element[n] = i;\n n++;\n }\n } else {\n const f32 = floats[k]!;\n // both ends: projected as two interleaved point lists\n const a = projectAll(m, f32, 7, 0, item.count, width, height);\n const b = projectAll(m, f32, 7, 3, item.count, width, height);\n projected.push({\n x: concat(a.x, b.x),\n y: concat(a.y, b.y),\n z: concat(a.z, b.z),\n w: concat(a.w, b.w),\n });\n const bias = item.bias * 5;\n for (let i = 0; i < item.count; i++) {\n if (a.w[i] <= 0 || b.w[i] <= 0) continue;\n depth[n] = (a.z[i] + b.z[i]) / 2 - bias;\n kind[n] = SEGMENT;\n owner[n] = k;\n element[n] = i;\n n++;\n }\n }\n });\n const order = new Uint32Array(n);\n for (let i = 0; i < n; i++) order[i] = i;\n order.sort((a, b) => depth[b] - depth[a]);\n\n // ---- draw back to front\n ctx.lineJoin = \"round\";\n ctx.lineCap = \"round\";\n let currentAlpha = -1;\n const alpha = (value: number) => {\n if (value !== currentAlpha) {\n ctx.globalAlpha = value;\n currentAlpha = value;\n }\n };\n const near = frame.distance - frame.radius;\n for (let o = 0; o < n; o++) {\n const i = order[o];\n const item = ordered[owner[i]];\n const p = projected[owner[i]];\n const f32 = floats[owner[i]];\n const u8 = bytes[owner[i]];\n if (!item || !p || !f32 || !u8) continue;\n const e = element[i];\n if (item.kind === \"mesh\" && kind[i] === TRIANGLE) {\n const a = item.indices[e];\n const b = item.indices[e + 1];\n const c = item.indices[e + 2];\n // flat normal facing the camera\n const ax = f32[a * 7],\n ay = f32[a * 7 + 1],\n az = f32[a * 7 + 2];\n const ux = f32[b * 7] - ax,\n uy = f32[b * 7 + 1] - ay,\n uz = f32[b * 7 + 2] - az;\n const vx = f32[c * 7] - ax,\n vy = f32[c * 7 + 1] - ay,\n vz = f32[c * 7 + 2] - az;\n let nx = uy * vz - uz * vy;\n let ny = uz * vx - ux * vz;\n let nz = ux * vy - uy * vx;\n const len = Math.hypot(nx, ny, nz) || 1;\n nx /= len;\n ny /= len;\n nz /= len;\n let ex = frame.eye[0] - ax;\n let ey = frame.eye[1] - ay;\n let ez = frame.eye[2] - az;\n const el = Math.hypot(ex, ey, ez) || 1;\n ex /= el;\n ey /= el;\n ez /= el;\n if (nx * ex + ny * ey + nz * ez < 0) {\n nx = -nx;\n ny = -ny;\n nz = -nz;\n }\n const lambert = Math.max(0, nx * L[0] + ny * L[1] + nz * L[2]);\n let hx = L[0] + ex;\n let hy = L[1] + ey;\n let hz = L[2] + ez;\n const hl = Math.hypot(hx, hy, hz) || 1;\n hx /= hl;\n hy /= hl;\n hz /= hl;\n const spec =\n Math.pow(Math.max(0, nx * hx + ny * hy + nz * hz), shininess) *\n specular *\n 255;\n const light = ambient + diffuse * lambert;\n const ca = a * 28 + 24;\n const cb = b * 28 + 24;\n const cc = c * 28 + 24;\n const r = (u8[ca] + u8[cb] + u8[cc]) / 3;\n const g = (u8[ca + 1] + u8[cb + 1] + u8[cc + 1]) / 3;\n const bl = (u8[ca + 2] + u8[cb + 2] + u8[cc + 2]) / 3;\n const ac = (u8[ca + 3] + u8[cb + 3] + u8[cc + 3]) / 765;\n const fill = style(\n r * light + spec,\n g * light + spec,\n bl * light + spec,\n );\n alpha(item.opacity * ac);\n ctx.beginPath();\n ctx.moveTo(p.x[a], p.y[a]);\n ctx.lineTo(p.x[b], p.y[b]);\n ctx.lineTo(p.x[c], p.y[c]);\n ctx.closePath();\n ctx.fillStyle = fill;\n ctx.fill();\n if (item.opacity >= 1) {\n // hides the seams between neighbouring triangles\n ctx.strokeStyle = fill;\n ctx.lineWidth = 0.75;\n ctx.stroke();\n }\n } else if (item.kind === \"points\" && kind[i] === POINT) {\n const scale =\n item.perspective && !frame.orthographic\n ? Math.max(\n 0.5,\n Math.min(2, frame.distance / Math.max(p.w[e], 1e-6)),\n )\n : 1;\n const radius = Math.max(0.5, (f32[e * 5 + 3] * dpr * scale) / 2);\n const c = e * 20 + 16;\n const wx = f32[e * 5] - frame.eye[0];\n const wy = f32[e * 5 + 1] - frame.eye[1];\n const wz = f32[e * 5 + 2] - frame.eye[2];\n const fog =\n Math.max(\n 0,\n Math.min(1, (Math.hypot(wx, wy, wz) - near) / (2 * frame.radius)),\n ) * 0.45;\n const r = u8[c] + (fogR - u8[c]) * fog;\n const g = u8[c + 1] + (fogG - u8[c + 1]) * fog;\n const b = u8[c + 2] + (fogB - u8[c + 2]) * fog;\n alpha(item.opacity * (u8[c + 3] / 255));\n ctx.fillStyle = style(r, g, b);\n if (radius < 1.5) {\n ctx.fillRect(\n p.x[e] - radius,\n p.y[e] - radius,\n radius * 2,\n radius * 2,\n );\n } else {\n ctx.beginPath();\n ctx.arc(p.x[e], p.y[e], radius, 0, Math.PI * 2);\n ctx.fill();\n }\n } else if (item.kind === \"lines\" && kind[i] === SEGMENT) {\n const c = e * 28 + 24;\n const half = p.x.length / 2;\n alpha(item.opacity * (u8[c + 3] / 255));\n ctx.strokeStyle = style(u8[c], u8[c + 1], u8[c + 2]);\n ctx.lineWidth = Math.max(0.5, item.width * dpr);\n ctx.beginPath();\n ctx.moveTo(p.x[e], p.y[e]);\n ctx.lineTo(p.x[half + e], p.y[half + e]);\n ctx.stroke();\n }\n }\n ctx.globalAlpha = 1;\n };\n\n return {\n kind: \"canvas2d\",\n canvas,\n resize(width, height) {\n canvas.width = Math.max(1, width);\n canvas.height = Math.max(1, height);\n },\n render(items, frame) {\n render(items, frame);\n },\n destroy() {\n styles.clear();\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n },\n };\n};\n\nconst concat = (a: Float32Array, b: Float32Array) => {\n const out = new Float32Array(a.length + b.length);\n out.set(a, 0);\n out.set(b, a.length);\n return out;\n};\n"],"mappings":";;AAaA,IAAaA,IAAmB,KAE1BC,IAAW,GACXC,IAAQ,GACRC,IAAU,GASVC,KACJ,GACA,GACA,GACA,GACA,GACA,GACA,MACc;CACd,IAAMC,IAAI,IAAI,aAAaC,CAAK,GAC1BC,IAAI,IAAI,aAAaD,CAAK,GAC1BE,IAAI,IAAI,aAAaF,CAAK,GAC1BG,IAAI,IAAI,aAAaH,CAAK;CAChC,KAAK,IAAII,IAAI,GAAGA,IAAIJ,GAAO,KAAK;EAC9B,IAAMK,IAAID,IAAIE,IAASC,GACjBC,IAAKC,EAAKJ,IACVK,IAAKD,EAAKJ,IAAI,IACdM,IAAKF,EAAKJ,IAAI,IACdO,IAAKC,EAAE,KAAKL,IAAKK,EAAE,KAAKH,IAAKG,EAAE,MAAMF,IAAKE,EAAE,KAC5CC,IAAK,KAAKF,IAAK,OAAOA,IA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,GAAO;GACnB,EAAOkB,GAAOH,CAAK;EACrB;EACA,UAAU;GAGR,AAFAT,EAAO,MAAM,GACbF,EAAI,aAAa,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC,GACjCA,EAAI,UAAU,GAAG,GAAGC,EAAO,OAAOA,EAAO,MAAM;EACjD;CACF;AACF,GAEM0C,KAAU,GAAiB,MAAoB;CACnD,IAAM8C,IAAM,IAAI,aAAahD,EAAE,SAASlC,EAAE,MAAM;CAGhD,OAFAkF,EAAI,IAAIhD,GAAG,CAAC,GACZgD,EAAI,IAAIlF,GAAGkC,EAAE,MAAM,GACZgD;AACT"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const e=require("../color.cjs"),t=require("../locale.cjs"),n=require("../scale.cjs"),r=require("../theme.cjs"),i=require("./colormap.cjs"),a=require("./detect.cjs"),o=require("./dom.cjs"),s=require("./labels.cjs"),c=require("./model.cjs"),l=require("./geometry.cjs"),u=require("./hover.cjs"),d=require("./math.cjs"),f=require("./overlay.cjs"),ee=require("./pick.cjs"),te=require("./sort.cjs");var ne=(e,t,n)=>{let r=t===1?e*16:t===2?e*400:e;return Math.exp(Math.max(-1,Math.min(1,r*(n?.01:.0025))))},p={ambient:.5,diffuse:.6,specular:.25,shininess:32},re=12,ie=.45,ae=5,oe=380,se=e=>d.clampCamera({azimuth:e?.azimuth??d.DEFAULT_CAMERA.azimuth,elevation:e?.elevation??d.DEFAULT_CAMERA.elevation,zoom:e?.zoom??d.DEFAULT_CAMERA.zoom,pan:[0,0],projection:e?.projection??d.DEFAULT_CAMERA.projection}),m=e=>({...e,pan:[e.pan[0],e.pan[1]]}),ce=(e,t)=>e.azimuth===t.azimuth&&e.elevation===t.elevation&&e.zoom===t.zoom&&e.pan[0]===t.pan[0]&&e.pan[1]===t.pan[1]&&e.projection===t.projection,le=(e,t,n)=>{let r=(t.azimuth-e.azimuth)%360;return r>180&&(r-=360),r<-180&&(r+=360),d.clampCamera({azimuth:e.azimuth+r*n,elevation:e.elevation+(t.elevation-e.elevation)*n,zoom:e.zoom*(t.zoom/e.zoom)**+n,pan:[e.pan[0]+(t.pan[0]-e.pan[0])*n,e.pan[1]+(t.pan[1]-e.pan[1])*n],projection:n<.5?e.projection:t.projection})},ue=(e,t,n)=>{let r=Math.max(30,Math.min(72,e*.08)),i=Math.max(14,Math.min(28,t*.05)),a=Math.max(30,Math.min(56,t*.1)),o=n?74:0,s={x:r,y:i,width:Math.max(10,e-r*2-o),height:Math.max(10,t-i-a)};if(!n)return{fit:s,bar:null};let c=Math.max(40,Math.min(260,t*.62));return{fit:s,bar:{x:e-66,y:(t-c)/2+8,w:12,h:c}}},de=(de,pe)=>{let h=de.ownerDocument,g=h.defaultView,_=o.createChart3DDom(de),v=_.stage,y=pe,b=r.readTheme(_.root,y.palette),me=0,x=!1,S=new Map,C=(e,t)=>{S.get(e)?.forEach(e=>e(t))},he=new Set,w=c.buildModel(y),T,E,ge=``,_e=0,ve=l.createGeometryBuilder(),D={items:[],targets:[],counts:[]},O=!0,k=ee.createPicker(),ye=te.createDepthSorter(),A=null,be=0,xe=()=>{},Se=new Promise(e=>{xe=e}),j=se(y.camera),Ce=JSON.stringify(y.camera??{}),M=m(j),N=null,P=0,F=!0,I=null,L=null,R=f.overlayStyle(b,fe(b)),z=null,B=null,V=null,H=null,we=!1,U=!0,W=0,G=typeof g?.matchMedia==`function`?g.matchMedia(`(prefers-reduced-motion: reduce)`):null,K=()=>{let e=y.interaction;if(e===!1)return null;let t=typeof e==`object`?e:{};return{rotate:t.rotate??!0,zoom:t.zoom??!0,wheel:t.wheel??`modifier`,pan:t.pan??!0,keyboard:t.keyboard??!0}},Te=()=>{let e=y.autoRotate;return e===!0?re:typeof e==`number`&&Number.isFinite(e)?e:0},Ee=()=>y.colorBar!==!1&&!!w.colorDomain,De=()=>({...y,series:y.series.map((e,t)=>{let n=e.id??String(t);return he.has(n)?{...e,hidden:!e.hidden}:e})}),Oe=t=>b.resolve?b.resolve(t,[.5,.5,.5,1]):e.parseColor(t)??[.5,.5,.5,1],ke=()=>{let t=`${JSON.stringify(y.colorScale??`viridis`)}|${me}`;(t!==ge||!E)&&(ge=t,E=i.colorLut(i.colorStops(y.colorScale,(t,n)=>b.resolve?b.resolve(t,n):e.parseColor(t)??n)),_e++);let n=b.palette.length?b.palette:[b.primary];T={series:w.series.map((e,t)=>e.color?Oe(e.color):n[t%n.length]??b.primary),resolve:Oe,lut:E,wire:[b.text[0],b.text[1],b.text[2],.38]}},q=()=>{w=c.buildModel(De()),ke(),O=!0,R=f.overlayStyle(b,fe(b)),je(),Me(),J(!0),z&&H&&Ue(H.x,H.y)},Ae=``,je=()=>{let t=y.legend,n=w.series.filter(e=>e.name).length,r=t===void 0?n>1:!!t,i=typeof t==`object`?t:{},a=i.toggle??!0,c=i.position===`bottom`,l=`${r}|${c}|${a}`;if(r&&w.series.forEach((t,n)=>{l+=`\n${t.id}\u0001${t.name}\u0001${e.toCss(T.series[n]??b.primary)}\u0001${t.hidden}`}),l===Ae)return;Ae=l;let u=[..._.legend.children].indexOf(h.activeElement);_.legend.replaceChildren(),_.legend.style.display=r?`flex`:`none`,r&&(_.legend.style.order=c?`1`:`0`,_.legend.style.padding=c?`8px 4px 0`:`0 4px 8px`,w.series.forEach((t,n)=>{if(!t.name)return;let r=h.createElement(a?`button`:`span`);r instanceof HTMLButtonElement&&(r.type=`button`,r.setAttribute(`aria-pressed`,String(!t.hidden)),r.addEventListener(`click`,()=>{he.has(t.id)?he.delete(t.id):he.add(t.id);let{labels:e}=w.locale;_.live.textContent=s.fill(t.hidden?e.shown:e.hidden,{name:t.name}),q()})),o.style(r,{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:t.hidden?`0.45`:`1`,textDecoration:t.hidden?`line-through`:`none`}),r.append(o.swatch(h,e.toCss(T.series[n]??b.primary),t.type!==`bar`&&t.type!==`surface`),h.createTextNode(t.name)),_.legend.appendChild(r)}),u>=0&&_.legend.children[u]?.focus())},Me=()=>{let{labels:e,count:t}=w.locale,n=w.series.map(e=>e.name).filter(Boolean).join(e.listSeparator);v.setAttribute(`aria-roledescription`,e.chart),v.setAttribute(`aria-label`,y.ariaLabel??(n?s.fill(e.chartNamed,{names:n}):e.chart)),K()?.keyboard?v.tabIndex=0:v.removeAttribute(`tabindex`),v.style.cursor=K()?.rotate?`grab`:`default`;let r=[];r.push(s.fill(e.seriesCount,{count:t(w.series.length)}));for(let n of w.series){let i=n.name||s.fill(e.series,{n:n.index+1}),a=n.type===`surface`?s.fill(e.grid,{rows:t(n.grid.rows),cols:t(n.grid.cols)}):n.type===`bar`?s.fill(e.bars,{count:t(n.bars.count)}):s.fill(n.type===`line`?e.vertices:e.points,{count:t(n.cols.count)});r.push(s.fill(n.hidden?e.seriesSummaryHidden:e.seriesSummary,{name:i,type:e[n.type],size:a}))}for(let t of[`x`,`y`,`z`]){let n=w[t],i=n.categories?n.categories.join(e.listSeparator):s.fill(e.range,{min:n.format(n.domain[0]),max:n.format(n.domain[1])});r.push(s.fill(n.title?e.axisTitled:e.axis,{axis:t.toUpperCase(),title:n.title,range:i}))}_.summary.textContent=r.join(` `)};function J(e=!0){e&&(F=!0),!(x||P||!g)&&(P=g.requestAnimationFrame(Fe))}let Ne=()=>Te()!==0&&U&&!we&&!Z&&!N&&!G?.matches&&h.visibilityState!==`hidden`,Pe=e=>{let t=[0,0,0];for(let n=0;n<3;n++)t[n]=-e.right[n]*.35+e.up[n]*.55-e.forward[n]*.7;return t[2]+=.35,d.normalize(t)};function Fe(e){if(P=0,x)return;let t=v.clientWidth,n=v.clientHeight;if(t<=0||n<=0)return;let r=g?.devicePixelRatio||1;if(N){let t=Math.min(1,(e-N.start)/oe),n=1-(1-t)**3;M=le(N.from,N.to,n),t>=1&&(M=m(N.to),N=null,C(`camera`,m(M))),F=!0}else if(Ne()){let t=W?Math.min(.1,(e-W)/1e3):0;t>0&&(M=d.clampCamera({...M,azimuth:M.azimuth-Te()*t}),F=!0),W=e}else W=0;o.sizeCanvas(_.background,t,n,r),o.sizeCanvas(_.foreground,t,n,r);let i=ue(t,n,Ee()),a=y.camera?.fov??32,s=[w.x.half,w.y.half,w.z.half],c=d.cameraFrame(M,s,t,n,i.fit,a);if(I=c,L=i,F){F=!1;let e=_.background.getContext(`2d`);if(e&&(e.setTransform(r,0,0,r,0,0),e.clearRect(0,0,t,n),y.box!==!1&&f.drawWalls(e,c,w,R)),A){O&&(D=ve(w,T,A.kind===`canvas2d`?l.CPU_BUDGET:l.GPU_BUDGET,_e),O=!1,k.reset());let e=Math.max(1,Math.round(t*r)),i=Math.max(1,Math.round(n*r));(A.canvas.width!==e||A.canvas.height!==i)&&A.resize(e,i),A.canvas.style.width=`${t}px`,A.canvas.style.height=`${n}px`;let a=y.lighting??{},o={viewProj:c.viewProj,eye:c.eye,light:Pe(c),orthographic:c.orthographic,distance:c.distance,radius:c.radius,width:e,height:i,dpr:r,lighting:[a.ambient??p.ambient,a.diffuse??p.diffuse,a.specular??p.specular,a.shininess??p.shininess],fog:b.background};A.render(A.kind===`canvas2d`?D.items:ye(D.items,o),o)}}Ie(c,i,t,n,r),(N||Ne())&&J(!0)}let Ie=(e,t,n,r,i)=>{let a=_.foreground.getContext(`2d`);if(a){if(a.setTransform(i,0,0,i,0,0),a.clearRect(0,0,n,r),y.box!==!1&&f.drawAxes(a,e,w,R,{left:4,top:4,right:t.bar?t.bar.x-10:n-4,bottom:r-4}),t.bar&&w.colorDomain){let e=typeof y.colorBar==`object`?y.colorBar:{};f.drawColorBar(a,t.bar,E,w.colorDomain,e.format??Le(),e.title??(w.colorFromZ?w.z.title:``),R,n)}if(z&&B){let t=u.highlightShape(D.targets,z,B.color);t&&f.drawHighlight(a,e,w,t,R)}}},Le=()=>{let e=w.colorDomain,{locale:t}=w;if(!e)return t.value;if(w.colorFromZ&&y.zAxis?.format)return y.zAxis.format;let r=n.tickStep(e[0],e[1],5);return r>0?t.ticks(r,Math.max(Math.abs(e[0]),Math.abs(e[1]))):t.value},Re=()=>y.tooltip!==!1,ze=()=>({x:v.offsetLeft,y:v.offsetTop}),Y=e=>{let t=e&&!O?u.hoverEvent(w,D.targets,e,T,ze()):null,n=t===null!=(B===null)||!!t&&!!B&&(t.seriesIndex!==B.seriesIndex||t.index!==B.index||t.type!==B.type);if(z=t?e:null,B=t,Be(),I&&L){let e=v.clientWidth,t=v.clientHeight;e>0&&t>0&&Ie(I,L,e,t,g?.devicePixelRatio||1)}n&&C(`hover`,t)},Be=()=>{let e=_.tooltip;if(!B||!z||!Re()){e.style.display=`none`;return}let t=typeof y.tooltip==`object`?y.tooltip.render:void 0,n=t?t(B):Ve(B);if(n===null){e.style.display=`none`;return}typeof n==`string`?e.textContent=n:e.replaceChildren(n),e.style.display=`block`;let r=v.clientWidth,i=v.clientHeight,a=e.offsetWidth,o=e.offsetHeight,s=z.x+16;s+a>r-4&&(s=z.x-16-a),s=Math.max(4,s);let c=Math.max(4,Math.min(i-o-4,z.y-o/2));e.style.transform=`translate(${Math.round(s)}px, ${Math.round(c)}px)`},Ve=e=>{let t=h.createDocumentFragment(),n=o.style(h.createElement(`div`),{display:`flex`,alignItems:`center`,gap:`6px`,fontWeight:`600`,marginBottom:`4px`,color:`var(--text-color, #1f2937)`});n.append(o.swatch(h,e.color,e.type!==`bar`),h.createTextNode(e.seriesName||s.fill(w.locale.labels.series,{n:e.seriesIndex+1}))),t.append(n);let r=typeof y.colorBar==`object`&&y.colorBar.title?y.colorBar.title:``;for(let n of u.tooltipRows(w,e,r)){let e=o.style(h.createElement(`div`),{display:`flex`,alignItems:`center`,gap:`8px`}),r=o.style(h.createElement(`span`),{flex:`1 1 auto`,color:`var(--text-secondary-color, #6b7280)`});r.textContent=n.name;let i=o.style(h.createElement(`span`),{fontWeight:n.name?`600`:`400`,fontVariantNumeric:`tabular-nums`,marginLeft:n.name?`12px`:`0`});i.textContent=n.value,n.name?e.append(r,i):e.append(i),t.append(e)}return t},He=(e,t)=>!I||O||!A?null:k.pick(D.targets,I,e,t),X=0,Ue=(e,t)=>{V={x:e,y:t},!X&&g&&(X=g.requestAnimationFrame(()=>{X=0;let e=V;V=null,!(!e||x||Z)&&Y(He(e.x,e.y))}))},Z=null,Q=new Map,We=e=>{let t=v.getBoundingClientRect();return{x:e.clientX-t.left,y:e.clientY-t.top}},Ge=()=>L?.fit.height??Math.max(1,v.clientHeight),$=(e,t=!0)=>{let n=d.clampCamera(e);ce(n,M)||(M=n,N=null,z&&Y(null),J(!0),t&&C(`camera`,m(M)))},Ke=e=>{if(G?.matches||!g){$(e);return}N={from:m(M),to:m(e),start:g.performance.now()},J(!0)},qe=()=>{let e=[...Q.values()],t=e[0]??{x:0,y:0},n=e[1]??t;return{distance:Math.hypot(t.x-n.x,t.y-n.y),center:{x:(t.x+n.x)/2,y:(t.y+n.y)/2}}},Je=(e,t)=>{Z={mode:e,pointers:Q,start:m(M),origin:t,distance:e===`pinch`?qe().distance:0,moved:!1},N=null,z&&Y(null),v.style.cursor=e===`rotate`?`grabbing`:`move`},Ye=e=>{let t=K();if(!t)return;let n=We(e);if(Q.set(e.pointerId,n),v.setPointerCapture?.(e.pointerId),Q.size===2&&(t.zoom||t.pan)){Je(`pinch`,qe().center);return}if(Q.size>1)return;let r=t.pan&&(e.button===2||e.shiftKey||e.button===1);r?Je(`pan`,n):t.rotate&&e.button===0?Je(`rotate`,n):Z=null,(r||e.button===1)&&e.preventDefault()},Xe=e=>{let t=We(e);if(H=t,Q.has(e.pointerId)&&Q.set(e.pointerId,t),!Z){if(e.pointerType===`touch`&&Q.size)return;(Re()||S.get(`hover`)?.size||S.get(`click`)?.size)&&Ue(t.x,t.y);return}let n=K();if(!n)return;if(Z.mode===`pinch`){let{distance:e,center:t}=qe(),r=Z.distance>0?e/Z.distance:1,i=Ge();$({...Z.start,zoom:n.zoom?Z.start.zoom*r:Z.start.zoom,pan:n.pan?[Z.start.pan[0]+(t.x-Z.origin.x)/i,Z.start.pan[1]+(t.y-Z.origin.y)/i]:Z.start.pan}),Z.moved=!0;return}let r=t.x-Z.origin.x,i=t.y-Z.origin.y;if(!(!Z.moved&&Math.hypot(r,i)<3)){if(Z.moved=!0,Z.mode===`pan`){let e=Ge();$({...Z.start,pan:[Z.start.pan[0]+r/e,Z.start.pan[1]+i/e]})}else $({...Z.start,azimuth:Z.start.azimuth-r*ie,elevation:Z.start.elevation+i*ie})}},Ze=e=>{let t=Z;if(Q.delete(e.pointerId),v.hasPointerCapture?.(e.pointerId)&&v.releasePointerCapture(e.pointerId),Q.size===1&&t?.mode===`pinch`){let e=[...Q.values()][0];Je(`rotate`,e);return}if(!Q.size){if(Z=null,v.style.cursor=K()?.rotate?`grab`:`default`,t&&!t.moved&&e.button===0){let t=We(e),n=He(t.x,t.y);Y(n),B&&C(`click`,B)}Ne()&&J(!1)}},Qe=e=>{Q.delete(e.pointerId),Q.size||(Z=null,v.style.cursor=K()?.rotate?`grab`:`default`)},$e=e=>{e.pointerType!==`touch`&&(we=!0)},et=()=>{we=!1,V=null,H=null,!Z&&z&&Y(null),Ne()&&J(!1)},tt=e=>{let t=K();if(!t?.zoom)return;let n=e.ctrlKey&&!e.metaKey;if(t.wheel===`modifier`&&!e.ctrlKey&&!e.metaKey)return;e.preventDefault();let r=ne(e.deltaY,e.deltaMode,n),i=M.zoom/r,a=L;if(!a){$({...M,zoom:i});return}let o=d.clampCamera({...M,zoom:i}),s=o.zoom/M.zoom,c=a.fit.height,l=a.fit.x+a.fit.width/2+M.pan[0]*c,u=a.fit.y+a.fit.height/2+M.pan[1]*c,f=We(e),ee=f.x-s*(f.x-l),te=f.y-s*(f.y-u);$({...o,pan:[M.pan[0]+(ee-l)/c,M.pan[1]+(te-u)/c]}),z&&Y(null)},nt=e=>{K()&&(e.preventDefault(),Ke(j))},rt=e=>{K()?.pan&&e.preventDefault()},it=()=>{let e;try{e=v.matches(`:focus-visible`)}catch{e=!0}e&&(v.style.boxShadow=`0 0 0 2px var(--primary-color, #4f46e5)`)},at=()=>{v.style.boxShadow=``},ot=e=>{let t=K();if(!t?.keyboard)return;let n=null,r=e.shiftKey?15:ae;switch(e.key){case`ArrowLeft`:t.rotate&&(n={...M,azimuth:M.azimuth+r});break;case`ArrowRight`:t.rotate&&(n={...M,azimuth:M.azimuth-r});break;case`ArrowUp`:t.rotate&&(n={...M,elevation:M.elevation+r});break;case`ArrowDown`:t.rotate&&(n={...M,elevation:M.elevation-r});break;case`+`:case`=`:t.zoom&&(n={...M,zoom:M.zoom*1.2});break;case`-`:case`_`:t.zoom&&(n={...M,zoom:M.zoom/1.2});break;case`0`:case`Home`:e.preventDefault(),Ke(j);return;case`Escape`:H=null,z&&(e.preventDefault(),Y(null));return;default:return}n&&(e.preventDefault(),$(n))};v.addEventListener(`pointerdown`,Ye),v.addEventListener(`pointermove`,Xe),v.addEventListener(`pointerup`,Ze),v.addEventListener(`pointercancel`,Qe),v.addEventListener(`pointerenter`,$e),v.addEventListener(`pointerleave`,et),v.addEventListener(`wheel`,tt,{passive:!1}),v.addEventListener(`dblclick`,nt),v.addEventListener(`contextmenu`,rt),v.addEventListener(`keydown`,ot),v.addEventListener(`focus`,it),v.addEventListener(`blur`,at);let st=typeof ResizeObserver==`function`?new ResizeObserver(()=>{k.reset(),J(!0)}):null;st?.observe(v);let ct=typeof IntersectionObserver==`function`?new IntersectionObserver(e=>{let t=e[e.length-1];if(!t)return;let n=U;U=t.isIntersecting,U&&!n&&J(!0)}):null;ct?.observe(v);let lt=()=>{h.visibilityState!==`hidden`&&J(!1)};h.addEventListener(`visibilitychange`,lt);let ut=null,dt=()=>{ft(),J(!0)},ft=()=>{ut?.removeEventListener?.(`change`,dt),ut=typeof g?.matchMedia==`function`?g.matchMedia(`(resolution: ${g.devicePixelRatio||1}dppx)`):null,ut?.addEventListener?.(`change`,dt)};ft();let pt=()=>J(!1);G?.addEventListener?.(`change`,pt);let mt=()=>{if(x)return;let e=r.readTheme(_.root,y.palette);r.themeColorsChanged(b,e)&&me++,b=e,q()},ht=r.watchTheme(mt),gt=typeof g?.MutationObserver==`function`?new g.MutationObserver(()=>{!x&&t.resolveLocale(y.locale)!==w.locale.locale&&q()}):null;gt?.observe(h.documentElement,{attributes:!0,attributeFilter:[`lang`]});let _t=async(e=new Set)=>{let t=++be,n=await a.createRenderer3D(y.renderer??`auto`,()=>{let e=o.layerCanvas(h);return e.className=`minerva-chart-data`,e},t=>{x||A?.kind!==t||(A.destroy(),A.canvas.remove(),A=null,_t(new Set([...e,t])))},e);if(x||t!==be){n?.destroy();return}A&&(A.destroy(),A.canvas.remove()),A=n,O=!0,n?(_.root.dataset.renderer=n.kind,v.insertBefore(n.canvas,_.foreground),C(`renderer`,n.kind)):delete _.root.dataset.renderer,xe(n?.kind??null),J(!0)};return ke(),q(),_t(),{setOptions(e){if(x)return;let t=y;y=e,(e.palette??[]).join()!==(t.palette??[]).join()&&(b=r.readTheme(_.root,e.palette),me++);let n=JSON.stringify(e.camera??{});n!==Ce&&(Ce=n,j=se(e.camera),$({...j})),(e.renderer??`auto`)!==(t.renderer??`auto`)&&_t(),q()},resize(){k.reset(),J(!0)},resetCamera(){$(m(j))},getCamera:()=>m(M),setCamera(e){x||$({azimuth:e.azimuth??M.azimuth,elevation:e.elevation??M.elevation,zoom:e.zoom??M.zoom,pan:e.pan?[e.pan[0],e.pan[1]]:M.pan,projection:e.projection??M.projection})},getRenderer:()=>A?.kind??null,ready:Se,refreshTheme:mt,on(e,t){let n=S.get(e);return n||(n=new Set,S.set(e,n)),n.add(t),()=>{n.delete(t)}},destroy(){x||(x=!0,be++,P&&g?.cancelAnimationFrame(P),X&&g?.cancelAnimationFrame(X),P=0,X=0,st?.disconnect(),ct?.disconnect(),h.removeEventListener(`visibilitychange`,lt),ut?.removeEventListener?.(`change`,dt),G?.removeEventListener?.(`change`,pt),ht(),gt?.disconnect(),v.removeEventListener(`pointerdown`,Ye),v.removeEventListener(`pointermove`,Xe),v.removeEventListener(`pointerup`,Ze),v.removeEventListener(`pointercancel`,Qe),v.removeEventListener(`pointerenter`,$e),v.removeEventListener(`pointerleave`,et),v.removeEventListener(`wheel`,tt),v.removeEventListener(`dblclick`,nt),v.removeEventListener(`contextmenu`,rt),v.removeEventListener(`keydown`,ot),v.removeEventListener(`focus`,it),v.removeEventListener(`blur`,at),A?.destroy(),A=null,S.clear(),xe(null),_.root.remove())}}};function fe(t){return e.luminance(t.background)<.4||e.luminance(t.text)>.6}exports.createChart3D=de,exports.initialCamera=se,exports.stageLayout=ue;
|
|
2
|
+
//# sourceMappingURL=chart.cjs.map
|