minerva-design 1.3.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 +9 -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 +7 -2
- package/dist/charts/canvas.d.ts +7 -2
- package/dist/charts/core.cjs +1 -1
- package/dist/charts/core.d.cts +7 -4
- package/dist/charts/core.d.ts +7 -4
- package/dist/charts/core.js +19 -8
- 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 +118 -68
- package/dist/charts/engine/canvas.js.map +1 -1
- package/dist/charts/engine/chart.cjs +1 -1
- package/dist/charts/engine/chart.cjs.map +1 -1
- package/dist/charts/engine/chart.d.cts +1 -1
- package/dist/charts/engine/chart.d.ts +1 -1
- package/dist/charts/engine/chart.js +307 -285
- 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.js +2 -2
- package/dist/charts/engine/color.js.map +1 -1
- package/dist/charts/engine/controller.cjs +1 -1
- package/dist/charts/engine/controller.cjs.map +1 -1
- package/dist/charts/engine/controller.d.cts +12 -3
- package/dist/charts/engine/controller.d.ts +12 -3
- package/dist/charts/engine/controller.js +359 -299
- package/dist/charts/engine/controller.js.map +1 -1
- package/dist/charts/engine/data.cjs +1 -1
- package/dist/charts/engine/data.cjs.map +1 -1
- package/dist/charts/engine/data.d.cts +6 -0
- package/dist/charts/engine/data.d.ts +6 -0
- package/dist/charts/engine/data.js +63 -49
- package/dist/charts/engine/data.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 +211 -54
- 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 +39 -1
- package/dist/charts/engine/model.d.ts +39 -1
- package/dist/charts/engine/model.js +212 -105
- 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 -2
- package/dist/charts/engine/overlay.d.ts +18 -2
- package/dist/charts/engine/overlay.js +132 -96
- package/dist/charts/engine/overlay.js.map +1 -1
- package/dist/charts/engine/presets.cjs +2 -2
- package/dist/charts/engine/presets.cjs.map +1 -1
- package/dist/charts/engine/presets.d.cts +249 -1
- package/dist/charts/engine/presets.d.ts +249 -1
- package/dist/charts/engine/presets.js +367 -29
- package/dist/charts/engine/presets.js.map +1 -1
- package/dist/charts/engine/renderers/detect.cjs +1 -1
- package/dist/charts/engine/renderers/detect.cjs.map +1 -1
- package/dist/charts/engine/renderers/detect.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/shaders.cjs +143 -1
- package/dist/charts/engine/renderers/shaders.cjs.map +1 -1
- package/dist/charts/engine/renderers/shaders.d.cts +16 -0
- package/dist/charts/engine/renderers/shaders.d.ts +16 -0
- package/dist/charts/engine/renderers/shaders.js +139 -1
- package/dist/charts/engine/renderers/shaders.js.map +1 -1
- package/dist/charts/engine/renderers/webgl.cjs +2 -0
- package/dist/charts/engine/renderers/webgl.cjs.map +1 -0
- package/dist/charts/engine/renderers/webgl.d.cts +4 -0
- package/dist/charts/engine/renderers/webgl.d.ts +4 -0
- package/dist/charts/engine/renderers/webgl.js +133 -0
- package/dist/charts/engine/renderers/webgl.js.map +1 -0
- package/dist/charts/engine/renderers/webgl2.cjs +1 -1
- package/dist/charts/engine/renderers/webgl2.cjs.map +1 -1
- package/dist/charts/engine/renderers/webgl2.d.cts +0 -1
- package/dist/charts/engine/renderers/webgl2.d.ts +0 -1
- package/dist/charts/engine/renderers/webgl2.js +59 -108
- package/dist/charts/engine/renderers/webgl2.js.map +1 -1
- package/dist/charts/engine/scale.cjs +1 -1
- package/dist/charts/engine/scale.cjs.map +1 -1
- package/dist/charts/engine/scale.js +1 -1
- package/dist/charts/engine/scale.js.map +1 -1
- package/dist/charts/engine/scene.cjs +1 -1
- package/dist/charts/engine/scene.cjs.map +1 -1
- package/dist/charts/engine/scene.d.cts +14 -4
- package/dist/charts/engine/scene.d.ts +14 -4
- package/dist/charts/engine/scene.js +292 -163
- package/dist/charts/engine/scene.js.map +1 -1
- package/dist/charts/engine/shapes/bullet.cjs +2 -0
- package/dist/charts/engine/shapes/bullet.cjs.map +1 -0
- package/dist/charts/engine/shapes/bullet.d.cts +6 -0
- package/dist/charts/engine/shapes/bullet.d.ts +6 -0
- package/dist/charts/engine/shapes/bullet.js +255 -0
- package/dist/charts/engine/shapes/bullet.js.map +1 -0
- package/dist/charts/engine/shapes/calendar.cjs +2 -0
- package/dist/charts/engine/shapes/calendar.cjs.map +1 -0
- package/dist/charts/engine/shapes/calendar.d.cts +38 -0
- package/dist/charts/engine/shapes/calendar.d.ts +38 -0
- package/dist/charts/engine/shapes/calendar.js +369 -0
- package/dist/charts/engine/shapes/calendar.js.map +1 -0
- package/dist/charts/engine/shapes/canvas.cjs +1 -1
- package/dist/charts/engine/shapes/canvas.cjs.map +1 -1
- package/dist/charts/engine/shapes/canvas.d.cts +7 -0
- package/dist/charts/engine/shapes/canvas.d.ts +7 -0
- package/dist/charts/engine/shapes/canvas.js +22 -13
- package/dist/charts/engine/shapes/canvas.js.map +1 -1
- package/dist/charts/engine/shapes/chart.cjs +1 -1
- package/dist/charts/engine/shapes/chart.cjs.map +1 -1
- package/dist/charts/engine/shapes/chart.d.cts +3 -2
- package/dist/charts/engine/shapes/chart.d.ts +3 -2
- package/dist/charts/engine/shapes/chart.js +45 -26
- package/dist/charts/engine/shapes/chart.js.map +1 -1
- package/dist/charts/engine/shapes/draw.cjs +1 -1
- package/dist/charts/engine/shapes/draw.cjs.map +1 -1
- package/dist/charts/engine/shapes/draw.d.cts +3 -1
- package/dist/charts/engine/shapes/draw.d.ts +3 -1
- package/dist/charts/engine/shapes/draw.js +31 -18
- package/dist/charts/engine/shapes/draw.js.map +1 -1
- package/dist/charts/engine/shapes/funnel.cjs +1 -1
- package/dist/charts/engine/shapes/funnel.cjs.map +1 -1
- package/dist/charts/engine/shapes/funnel.js +3 -3
- package/dist/charts/engine/shapes/funnel.js.map +1 -1
- package/dist/charts/engine/shapes/gauge.cjs +1 -1
- package/dist/charts/engine/shapes/gauge.cjs.map +1 -1
- package/dist/charts/engine/shapes/gauge.js +132 -95
- package/dist/charts/engine/shapes/gauge.js.map +1 -1
- package/dist/charts/engine/shapes/hit.cjs +1 -1
- package/dist/charts/engine/shapes/hit.cjs.map +1 -1
- package/dist/charts/engine/shapes/hit.d.cts +3 -1
- package/dist/charts/engine/shapes/hit.d.ts +3 -1
- package/dist/charts/engine/shapes/hit.js +29 -8
- package/dist/charts/engine/shapes/hit.js.map +1 -1
- package/dist/charts/engine/shapes/index.d.cts +4 -1
- package/dist/charts/engine/shapes/index.d.ts +4 -1
- 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 +2 -2
- package/dist/charts/engine/shapes/layout.cjs.map +1 -1
- package/dist/charts/engine/shapes/layout.d.cts +8 -3
- package/dist/charts/engine/shapes/layout.d.ts +8 -3
- package/dist/charts/engine/shapes/layout.js +200 -113
- package/dist/charts/engine/shapes/layout.js.map +1 -1
- package/dist/charts/engine/shapes/pie.cjs +1 -1
- package/dist/charts/engine/shapes/pie.cjs.map +1 -1
- package/dist/charts/engine/shapes/pie.js +2 -2
- package/dist/charts/engine/shapes/pie.js.map +1 -1
- package/dist/charts/engine/shapes/radar.cjs +1 -1
- package/dist/charts/engine/shapes/radar.cjs.map +1 -1
- package/dist/charts/engine/shapes/radar.d.cts +2 -2
- package/dist/charts/engine/shapes/radar.d.ts +2 -2
- package/dist/charts/engine/shapes/radar.js +50 -49
- package/dist/charts/engine/shapes/radar.js.map +1 -1
- package/dist/charts/engine/shapes/radialBar.cjs +2 -0
- package/dist/charts/engine/shapes/radialBar.cjs.map +1 -0
- package/dist/charts/engine/shapes/radialBar.d.cts +8 -0
- package/dist/charts/engine/shapes/radialBar.d.ts +8 -0
- package/dist/charts/engine/shapes/radialBar.js +155 -0
- package/dist/charts/engine/shapes/radialBar.js.map +1 -0
- package/dist/charts/engine/shapes/runtime.cjs +1 -1
- package/dist/charts/engine/shapes/runtime.cjs.map +1 -1
- package/dist/charts/engine/shapes/runtime.d.cts +9 -2
- package/dist/charts/engine/shapes/runtime.d.ts +9 -2
- package/dist/charts/engine/shapes/runtime.js +61 -51
- package/dist/charts/engine/shapes/runtime.js.map +1 -1
- package/dist/charts/engine/shapes/sankey.cjs +2 -0
- package/dist/charts/engine/shapes/sankey.cjs.map +1 -0
- package/dist/charts/engine/shapes/sankey.d.cts +29 -0
- package/dist/charts/engine/shapes/sankey.d.ts +29 -0
- package/dist/charts/engine/shapes/sankey.js +372 -0
- package/dist/charts/engine/shapes/sankey.js.map +1 -0
- package/dist/charts/engine/shapes/scene.cjs +1 -1
- package/dist/charts/engine/shapes/scene.cjs.map +1 -1
- package/dist/charts/engine/shapes/scene.d.cts +62 -8
- package/dist/charts/engine/shapes/scene.d.ts +62 -8
- package/dist/charts/engine/shapes/scene.js +33 -31
- package/dist/charts/engine/shapes/scene.js.map +1 -1
- package/dist/charts/engine/shapes/sunburst.cjs +2 -0
- package/dist/charts/engine/shapes/sunburst.cjs.map +1 -0
- package/dist/charts/engine/shapes/sunburst.d.cts +6 -0
- package/dist/charts/engine/shapes/sunburst.d.ts +6 -0
- package/dist/charts/engine/shapes/sunburst.js +261 -0
- package/dist/charts/engine/shapes/sunburst.js.map +1 -0
- package/dist/charts/engine/shapes/treemap.cjs +1 -1
- package/dist/charts/engine/shapes/treemap.cjs.map +1 -1
- package/dist/charts/engine/shapes/treemap.js +2 -2
- package/dist/charts/engine/shapes/treemap.js.map +1 -1
- package/dist/charts/engine/shapes/types.d.cts +439 -12
- package/dist/charts/engine/shapes/types.d.ts +439 -12
- 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 +165 -14
- package/dist/charts/engine/types.d.ts +165 -14
- package/dist/charts/index.cjs +1 -1
- package/dist/charts/index.d.cts +7 -4
- package/dist/charts/index.d.ts +7 -4
- package/dist/charts/index.js +22 -11
- package/dist/charts/react/Chart.cjs +1 -1
- package/dist/charts/react/Chart.cjs.map +1 -1
- package/dist/charts/react/Chart.d.cts +4 -4
- package/dist/charts/react/Chart.d.ts +4 -4
- package/dist/charts/react/Chart.js +5 -1
- package/dist/charts/react/Chart.js.map +1 -1
- package/dist/charts/react/charts.cjs +1 -1
- package/dist/charts/react/charts.cjs.map +1 -1
- package/dist/charts/react/charts.d.cts +39 -1
- package/dist/charts/react/charts.d.ts +39 -1
- package/dist/charts/react/charts.js +303 -131
- 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 +1 -1
- package/dist/charts/react/shapes.cjs.map +1 -1
- package/dist/charts/react/shapes.d.cts +291 -9
- package/dist/charts/react/shapes.d.ts +291 -9
- package/dist/charts/react/shapes.js +280 -93
- package/dist/charts/react/shapes.js.map +1 -1
- package/dist/charts/react/three-d.cjs +2 -0
- package/dist/charts/react/three-d.cjs.map +1 -0
- package/dist/charts/react/three-d.d.cts +151 -0
- package/dist/charts/react/three-d.d.ts +151 -0
- package/dist/charts/react/three-d.js +154 -0
- package/dist/charts/react/three-d.js.map +1 -0
- package/dist/charts/react/trading.cjs +2 -0
- package/dist/charts/react/trading.cjs.map +1 -0
- package/dist/charts/react/trading.d.cts +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 +132 -8
- package/dist/charts/react/types.d.ts +132 -8
- package/dist/core/contracts.cjs +1 -1
- package/dist/core/contracts.cjs.map +1 -1
- package/dist/core/contracts.js +1 -1
- package/dist/core/contracts.js.map +1 -1
- package/dist/native/charts/src/canvas.cjs +1 -1
- package/dist/native/charts/src/canvas.js +9 -3
- package/dist/native/charts/src/engine/axis.cjs +1 -1
- package/dist/native/charts/src/engine/axis.cjs.map +1 -1
- package/dist/native/charts/src/engine/axis.js +6 -6
- package/dist/native/charts/src/engine/axis.js.map +1 -1
- package/dist/native/charts/src/engine/controller.cjs +1 -1
- package/dist/native/charts/src/engine/controller.cjs.map +1 -1
- package/dist/native/charts/src/engine/controller.js +352 -292
- package/dist/native/charts/src/engine/controller.js.map +1 -1
- package/dist/native/charts/src/engine/data.cjs +1 -1
- package/dist/native/charts/src/engine/data.cjs.map +1 -1
- package/dist/native/charts/src/engine/data.js +63 -49
- package/dist/native/charts/src/engine/data.js.map +1 -1
- package/dist/native/charts/src/engine/format.cjs +1 -1
- package/dist/native/charts/src/engine/format.cjs.map +1 -1
- package/dist/native/charts/src/engine/format.js +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 +223 -116
- package/dist/native/charts/src/engine/model.js.map +1 -1
- package/dist/native/charts/src/engine/overlay.cjs +1 -1
- package/dist/native/charts/src/engine/overlay.cjs.map +1 -1
- package/dist/native/charts/src/engine/overlay.js +46 -23
- package/dist/native/charts/src/engine/overlay.js.map +1 -1
- package/dist/native/charts/src/engine/presets.cjs +2 -2
- package/dist/native/charts/src/engine/presets.cjs.map +1 -1
- package/dist/native/charts/src/engine/presets.js +448 -33
- 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 +296 -167
- 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/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 +234 -217
- 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 +154 -84
- 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 +7517 -1856
- 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 +8 -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 +1433 -4478
- 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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hit.cjs","names":["TAU","padAngleAt","sectorPad","require_scene","require_draw","VERTEX_RADIUS","wrapFrom","d","a","from","pointInSector","dx","x","s","dy","y","span","half","off","pointInPolygon","n","points","inside","i","j","xi","yi","xj","yj","polygonArea","nodeContains","node","hitRadar","radar","scene","best","bestD","k","area","index","indicator","diff","angle","hitTestShapes","enter","valid","it","current","hoverAnchor","item","hover","ind","stepHover","items","pos","first","direction","forward","count","next"],"sources":["../../../../../charts/src/engine/shapes/hit.ts"],"sourcesContent":["// Hit testing of a ShapeScene and keyboard navigation between its items.\n\nimport { padAngleAt, sectorPad } from \"./draw\";\nimport { TAU, type ShapeHover, type ShapeNode, type ShapeScene } from \"./scene\";\n\n/** Distance (px) under which a radar vertex is picked */\nconst VERTEX_RADIUS = 12;\n\n/** Angle `a` brought into [from, from + 2π) */\nconst wrapFrom = (a: number, from: number) => {\n let d = (a - from) % TAU;\n if (d < 0) d += TAU;\n return from + d;\n};\n\n/** Whether a point is in an annular sector (gaps included, corners approximated) */\nexport const pointInSector = (\n x: number,\n y: number,\n s: {\n cx: number;\n cy: number;\n r0: number;\n r1: number;\n a0: number;\n a1: number;\n pad?: number;\n },\n): boolean => {\n const dx = x - s.cx;\n const dy = y - s.cy;\n const d = Math.hypot(dx, dy);\n if (d > s.r1 || d < s.r0) return false;\n const span = s.a1 - s.a0;\n if (span >= TAU - 1e-6) return true;\n if (span <= 0) return false;\n const a = wrapFrom(Math.atan2(dy, dx), s.a0);\n const half = (s.pad ?? 0) / 2;\n const off = half > 0 ? padAngleAt(half, d) : 0;\n return a >= s.a0 + off && a <= s.a1 - off;\n};\n\n/** Even-odd test of a point in a polygon given as a flat x, y list */\nexport const pointInPolygon = (\n x: number,\n y: number,\n points: readonly number[],\n): boolean => {\n const n = points.length >> 1;\n let inside = false;\n for (let i = 0, j = n - 1; i < n; j = i++) {\n const xi = points[i * 2];\n const yi = points[i * 2 + 1];\n const xj = points[j * 2];\n const yj = points[j * 2 + 1];\n if (yi > y !== yj > y && x < ((xj - xi) * (y - yi)) / (yj - yi) + xi)\n inside = !inside;\n }\n return inside;\n};\n\nconst polygonArea = (points: readonly number[]) => {\n const n = points.length >> 1;\n let a = 0;\n for (let i = 0, j = n - 1; i < n; j = i++)\n a += points[j * 2] * points[i * 2 + 1] - points[i * 2] * points[j * 2 + 1];\n return Math.abs(a) / 2;\n};\n\nconst nodeContains = (node: ShapeNode, x: number, y: number): boolean => {\n switch (node.kind) {\n case \"sector\":\n return pointInSector(x, y, { ...node, pad: sectorPad(node) });\n case \"polygon\":\n return (\n pointInPolygon(x, y, node.points) &&\n !(node.hole && pointInPolygon(x, y, node.hole))\n );\n case \"rect\":\n return (\n x >= node.x &&\n x <= node.x + node.width &&\n y >= node.y &&\n y <= node.y + node.height\n );\n case \"circle\":\n return Math.hypot(x - node.cx, y - node.cy) <= node.r;\n case \"arc\": {\n const d = Math.hypot(x - node.cx, y - node.cy);\n if (Math.abs(d - node.r) > node.width / 2 + 4) return false;\n if (node.a1 - node.a0 >= TAU - 1e-6) return true;\n const a = wrapFrom(Math.atan2(y - node.cy, x - node.cx), node.a0);\n return a <= node.a1;\n }\n default:\n return false;\n }\n};\n\n/** Radar: the vertex under the pointer, else the smallest polygon containing it */\nconst hitRadar = (\n scene: ShapeScene,\n x: number,\n y: number,\n): ShapeHover | null => {\n const radar = scene.radar;\n if (!radar || !radar.series.length) return null;\n let best: ShapeHover | null = null;\n let bestD = VERTEX_RADIUS;\n for (const s of radar.series) {\n for (let k = 0; k < s.points.length >> 1; k++) {\n const d = Math.hypot(x - s.points[k * 2], y - s.points[k * 2 + 1]);\n if (d <= bestD) {\n bestD = d;\n best = { index: s.index, indicator: k };\n }\n }\n }\n if (best) return best;\n let area = Infinity;\n let index = -1;\n for (const s of radar.series) {\n if (s.points.length < 6 || !pointInPolygon(x, y, s.points)) continue;\n const a = polygonArea(s.points);\n if (a < area) {\n area = a;\n index = s.index;\n }\n }\n if (index < 0) return null;\n // nearest indicator by angle\n const a = Math.atan2(y - radar.cy, x - radar.cx);\n let indicator = 0;\n let diff = Infinity;\n radar.angles.forEach((angle, k) => {\n const d = Math.abs(wrapFrom(a - angle + Math.PI, 0) - Math.PI);\n if (d < diff) {\n diff = d;\n indicator = k;\n }\n });\n return { index, indicator };\n};\n\n/**\n * Item under a point (CSS pixels). `current` is the hovered item: its\n * popped-out geometry also counts so a moved slice keeps the hover.\n */\nexport const hitTestShapes = (\n scene: ShapeScene,\n x: number,\n y: number,\n current: ShapeHover | null = null,\n): ShapeHover | null => {\n if (scene.empty) return null;\n if (scene.type === \"radar\") return hitRadar(scene, x, y);\n const enter = scene.enter;\n if (enter && enter.scale > 0 && enter.scale !== 1) {\n x = enter.cx + (x - enter.cx) / enter.scale;\n y = enter.cy + (y - enter.cy) / enter.scale;\n }\n const valid = new Set(scene.items.map((it) => it.index));\n for (let i = scene.nodes.length - 1; i >= 0; i--) {\n const node = scene.nodes[i];\n if (node.hit === undefined || !valid.has(node.hit)) continue;\n if (node.kind === \"text\" || node.kind === \"line\") continue;\n if (nodeContains(node, x, y)) return { index: node.hit };\n if (current?.index === node.hit && node.shift) {\n const [dx, dy] = node.shift;\n if (nodeContains(node, x - dx, y - dy)) return { index: node.hit };\n }\n }\n return null;\n};\n\n/** Where the tooltip of a keyboard-focused item goes */\nexport const hoverAnchor = (\n scene: ShapeScene,\n hover: ShapeHover,\n): { x: number; y: number } | null => {\n const item = scene.items.find((it) => it.index === hover.index);\n if (!item) return null;\n const ind =\n hover.indicator !== undefined ? item.indicators?.[hover.indicator] : null;\n return ind ? { x: ind.x, y: ind.y } : { x: item.x, y: item.y };\n};\n\n/**\n * Next focused item for the arrow keys: `next` / `prev` walk the items\n * (radar: the indicators of the series), `up` / `down` the radar series.\n */\nexport const stepHover = (\n scene: ShapeScene,\n current: ShapeHover | null,\n direction: \"next\" | \"prev\" | \"up\" | \"down\",\n): ShapeHover | null => {\n const items = scene.items;\n if (!items.length) return null;\n const pos = current\n ? items.findIndex((it) => it.index === current.index)\n : -1;\n const radar = scene.type === \"radar\";\n if (pos < 0) {\n const first =\n direction === \"prev\" || direction === \"up\" ? items.length - 1 : 0;\n return radar\n ? { index: items[first].index, indicator: 0 }\n : { index: items[first].index };\n }\n const forward = direction === \"next\" || direction === \"down\";\n if (radar && (direction === \"next\" || direction === \"prev\")) {\n const count = items[pos].indicators?.length ?? 1;\n const k = current?.indicator ?? 0;\n return {\n index: items[pos].index,\n indicator: (k + (forward ? 1 : -1) + count) % count,\n };\n }\n const next = items[(pos + (forward ? 1 : -1) + items.length) % items.length];\n return radar\n ? { index: next.index, indicator: current?.indicator ?? 0 }\n : { index: next.index };\n};\n"],"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UAAW,CAAE,EAC1C,CAAE,MAAOF,EAAME,EAAM,CAAC,KAAM,CAClC,CACA,IAAME,EAAUD,IAAc,QAAUA,IAAc,OACtD,GAAIvB,IAAUuB,IAAc,QAAUA,IAAc,QAAS,CAC3D,IAAME,EAAQL,EAAMC,EAAI,CAAC,YAAY,QAAU,EACzCjB,EAAIU,GAAS,WAAa,EAChC,MAAO,CACL,MAAOM,EAAMC,EAAI,CAAC,MAClB,WAAYjB,GAAKoB,EAAU,EAAI,IAAMC,GAASA,CAChD,CACF,CACA,IAAMC,EAAON,GAAOC,GAAOG,EAAU,EAAI,IAAMJ,EAAM,QAAUA,EAAM,QACrE,OAAOpB,EACH,CAAE,MAAO0B,EAAK,MAAO,UAAWZ,GAAS,WAAa,CAAE,EACxD,CAAE,MAAOY,EAAK,KAAM,CAC1B"}
|
|
1
|
+
{"version":3,"file":"hit.cjs","names":["TAU","padAngleAt","sectorPad","require_scene","require_draw","VERTEX_RADIUS","wrapFrom","d","a","from","pointInSector","dx","x","s","dy","y","span","half","off","pointInPolygon","n","points","inside","i","j","xi","yi","xj","yj","polygonArea","nodeContains","node","pad","pointNearLink","LINK_SEGMENTS","left","right","xm","at","u","t","b0","b1","b2","b3","px","py","k","qx","qy","len2","clampUnit","v","hitRadar","radar","scene","best","bestD","area","index","indicator","diff","angle","hitTestShapes","enter","valid","it","current","hoverAnchor","item","hover","ind","stepHover","items","pos","first","direction","forward","step","count","next"],"sources":["../../../../../charts/src/engine/shapes/hit.ts"],"sourcesContent":["// Hit testing of a ShapeScene and keyboard navigation between its items.\n\nimport { padAngleAt, sectorPad } from \"./draw\";\nimport {\n TAU,\n type LinkNode,\n type ShapeHover,\n type ShapeNode,\n type ShapeScene,\n} from \"./scene\";\n\n/** Distance (px) under which a radar vertex is picked */\nconst VERTEX_RADIUS = 12;\n\n/** Angle `a` brought into [from, from + 2π) */\nconst wrapFrom = (a: number, from: number) => {\n let d = (a - from) % TAU;\n if (d < 0) d += TAU;\n return from + d;\n};\n\n/** Whether a point is in an annular sector (gaps included, corners approximated) */\nexport const pointInSector = (\n x: number,\n y: number,\n s: {\n cx: number;\n cy: number;\n r0: number;\n r1: number;\n a0: number;\n a1: number;\n pad?: number;\n },\n): boolean => {\n const dx = x - s.cx;\n const dy = y - s.cy;\n const d = Math.hypot(dx, dy);\n if (d > s.r1 || d < s.r0) return false;\n const span = s.a1 - s.a0;\n if (span >= TAU - 1e-6) return true;\n if (span <= 0) return false;\n const a = wrapFrom(Math.atan2(dy, dx), s.a0);\n const half = (s.pad ?? 0) / 2;\n const off = half > 0 ? padAngleAt(half, d) : 0;\n return a >= s.a0 + off && a <= s.a1 - off;\n};\n\n/** Even-odd test of a point in a polygon given as a flat x, y list */\nexport const pointInPolygon = (\n x: number,\n y: number,\n points: readonly number[],\n): boolean => {\n const n = points.length >> 1;\n let inside = false;\n for (let i = 0, j = n - 1; i < n; j = i++) {\n const xi = points[i * 2];\n const yi = points[i * 2 + 1];\n const xj = points[j * 2];\n const yj = points[j * 2 + 1];\n if (yi > y !== yj > y && x < ((xj - xi) * (y - yi)) / (yj - yi) + xi)\n inside = !inside;\n }\n return inside;\n};\n\nconst polygonArea = (points: readonly number[]) => {\n const n = points.length >> 1;\n let a = 0;\n for (let i = 0, j = n - 1; i < n; j = i++)\n a += points[j * 2] * points[i * 2 + 1] - points[i * 2] * points[j * 2 + 1];\n return Math.abs(a) / 2;\n};\n\nconst nodeContains = (node: ShapeNode, x: number, y: number): boolean => {\n switch (node.kind) {\n case \"sector\":\n return pointInSector(x, y, { ...node, pad: sectorPad(node) });\n case \"polygon\":\n return (\n pointInPolygon(x, y, node.points) &&\n !(node.hole && pointInPolygon(x, y, node.hole))\n );\n case \"rect\": {\n const pad = node.hitPad ?? 0;\n return (\n x >= node.x - pad &&\n x <= node.x + node.width + pad &&\n y >= node.y - pad &&\n y <= node.y + node.height + pad\n );\n }\n case \"circle\":\n return Math.hypot(x - node.cx, y - node.cy) <= node.r;\n case \"arc\": {\n const d = Math.hypot(x - node.cx, y - node.cy);\n if (Math.abs(d - node.r) > node.width / 2 + (node.hitPad ?? 4))\n return false;\n if (node.a1 - node.a0 >= TAU - 1e-6) return true;\n const a = wrapFrom(Math.atan2(y - node.cy, x - node.cx), node.a0);\n return a <= node.a1;\n }\n case \"link\":\n return pointNearLink(x, y, node);\n default:\n return false;\n }\n};\n\n/** Segments of the polyline approximating a link's center curve */\nconst LINK_SEGMENTS = 24;\n\n/** Whether a point is within a sankey link (its thickness, plus 2 px) */\nexport const pointNearLink = (x: number, y: number, node: LinkNode) => {\n const half = Math.max(1, node.width) / 2 + 2;\n const left = Math.min(node.x0, node.x1);\n const right = Math.max(node.x0, node.x1);\n if (x < left - half || x > right + half) return false;\n if (\n y < Math.min(node.y0, node.y1) - half ||\n y > Math.max(node.y0, node.y1) + half\n )\n return false;\n const xm = (node.x0 + node.x1) / 2;\n // cubic Bézier (x0, y0) (xm, y0) (xm, y1) (x1, y1)\n const at = (t: number): [number, number] => {\n const u = 1 - t;\n const b0 = u * u * u;\n const b1 = 3 * u * u * t;\n const b2 = 3 * u * t * t;\n const b3 = t * t * t;\n return [\n b0 * node.x0 + (b1 + b2) * xm + b3 * node.x1,\n (b0 + b1) * node.y0 + (b2 + b3) * node.y1,\n ];\n };\n let [px, py] = at(0);\n for (let k = 1; k <= LINK_SEGMENTS; k++) {\n const [qx, qy] = at(k / LINK_SEGMENTS);\n const dx = qx - px;\n const dy = qy - py;\n const len2 = dx * dx + dy * dy;\n const s = len2 > 0 ? clampUnit(((x - px) * dx + (y - py) * dy) / len2) : 0;\n if (Math.hypot(x - (px + s * dx), y - (py + s * dy)) <= half) return true;\n px = qx;\n py = qy;\n }\n return false;\n};\n\nconst clampUnit = (v: number) => (v < 0 ? 0 : v > 1 ? 1 : v);\n\n/** Radar: the vertex under the pointer, else the smallest polygon containing it */\nconst hitRadar = (\n scene: ShapeScene,\n x: number,\n y: number,\n): ShapeHover | null => {\n const radar = scene.radar;\n if (!radar || !radar.series.length) return null;\n let best: ShapeHover | null = null;\n let bestD = VERTEX_RADIUS;\n for (const s of radar.series) {\n for (let k = 0; k < s.points.length >> 1; k++) {\n const d = Math.hypot(x - s.points[k * 2], y - s.points[k * 2 + 1]);\n if (d <= bestD) {\n bestD = d;\n best = { index: s.index, indicator: k };\n }\n }\n }\n if (best) return best;\n let area = Infinity;\n let index = -1;\n for (const s of radar.series) {\n if (s.points.length < 6 || !pointInPolygon(x, y, s.points)) continue;\n const a = polygonArea(s.points);\n if (a < area) {\n area = a;\n index = s.index;\n }\n }\n if (index < 0) return null;\n // nearest indicator by angle\n const a = Math.atan2(y - radar.cy, x - radar.cx);\n let indicator = 0;\n let diff = Infinity;\n radar.angles.forEach((angle, k) => {\n const d = Math.abs(wrapFrom(a - angle + Math.PI, 0) - Math.PI);\n if (d < diff) {\n diff = d;\n indicator = k;\n }\n });\n return { index, indicator };\n};\n\n/**\n * Item under a point (CSS pixels). `current` is the hovered item: its\n * popped-out geometry also counts so a moved slice keeps the hover.\n */\nexport const hitTestShapes = (\n scene: ShapeScene,\n x: number,\n y: number,\n current: ShapeHover | null = null,\n): ShapeHover | null => {\n if (scene.empty) return null;\n if (scene.type === \"radar\") return hitRadar(scene, x, y);\n const enter = scene.enter;\n if (enter && enter.scale > 0 && enter.scale !== 1) {\n x = enter.cx + (x - enter.cx) / enter.scale;\n y = enter.cy + (y - enter.cy) / enter.scale;\n }\n const valid = new Set(scene.items.map((it) => it.index));\n for (let i = scene.nodes.length - 1; i >= 0; i--) {\n const node = scene.nodes[i];\n if (node.hit === undefined || !valid.has(node.hit)) continue;\n if (node.kind === \"text\" || node.kind === \"line\") continue;\n if (nodeContains(node, x, y)) return { index: node.hit };\n if (current?.index === node.hit && node.shift) {\n const [dx, dy] = node.shift;\n if (nodeContains(node, x - dx, y - dy)) return { index: node.hit };\n }\n }\n return null;\n};\n\n/** Where the tooltip of a keyboard-focused item goes */\nexport const hoverAnchor = (\n scene: ShapeScene,\n hover: ShapeHover,\n): { x: number; y: number } | null => {\n const item = scene.items.find((it) => it.index === hover.index);\n if (!item) return null;\n const ind =\n hover.indicator !== undefined ? item.indicators?.[hover.indicator] : null;\n return ind ? { x: ind.x, y: ind.y } : { x: item.x, y: item.y };\n};\n\n/**\n * Next focused item for the arrow keys: `next` / `prev` walk the items\n * (radar: the indicators of the series), `up` / `down` the radar series.\n */\nexport const stepHover = (\n scene: ShapeScene,\n current: ShapeHover | null,\n direction: \"next\" | \"prev\" | \"up\" | \"down\",\n): ShapeHover | null => {\n const items = scene.items;\n if (!items.length) return null;\n const pos = current\n ? items.findIndex((it) => it.index === current.index)\n : -1;\n const radar = scene.type === \"radar\";\n if (pos < 0) {\n const first =\n direction === \"prev\" || direction === \"up\" ? items.length - 1 : 0;\n return radar\n ? { index: items[first].index, indicator: 0 }\n : { index: items[first].index };\n }\n const forward = direction === \"next\" || direction === \"down\";\n if (scene.steps) {\n const step =\n direction === \"next\" || direction === \"prev\"\n ? scene.steps.next\n : scene.steps.down;\n const target = items[pos + (forward ? step : -step)];\n return { index: (target ?? items[pos]).index };\n }\n if (radar && (direction === \"next\" || direction === \"prev\")) {\n const count = items[pos].indicators?.length ?? 1;\n const k = current?.indicator ?? 0;\n return {\n index: items[pos].index,\n indicator: (k + (forward ? 1 : -1) + count) % count,\n };\n }\n const next = items[(pos + (forward ? 1 : -1) + items.length) % items.length];\n return radar\n ? { index: next.index, indicator: current?.indicator ?? 0 }\n : { index: next.index };\n};\n"],"mappings":"uDAYA,IAAMK,EAAgB,GAGhBC,GAAY,EAAW,IAAiB,CAC5C,IAAIC,GAAKC,EAAIC,GAAQT,EAAAA,IAErB,OADIO,EAAI,IAAG,GAAKP,EAAAA,KACTS,EAAOF,CAChB,EAGaG,GACX,EACA,EACA,IASY,CACZ,IAAMC,EAAKC,EAAIC,EAAE,GACXC,EAAKC,EAAIF,EAAE,GACXN,EAAI,KAAK,MAAMI,EAAIG,CAAE,EAC3B,GAAIP,EAAIM,EAAE,IAAMN,EAAIM,EAAE,GAAI,MA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AAO,CACf,IAAMuB,EACJF,IAAc,QAAUA,IAAc,OAClCrB,EAAM,MAAM,KACZA,EAAM,MAAM,KAElB,MAAO,CAAE,OADMkB,EAAMC,GAAOG,EAAUC,EAAO,CAACA,KACnBL,EAAMC,GAAA,CAAM,KAAM,CAC/C,CACA,GAAIpB,IAAUsB,IAAc,QAAUA,IAAc,QAAS,CAC3D,IAAMG,EAAQN,EAAMC,EAAI,CAAC,YAAY,QAAU,EACzC3B,EAAIoB,GAAS,WAAa,EAChC,MAAO,CACL,MAAOM,EAAMC,EAAI,CAAC,MAClB,WAAY3B,GAAK8B,EAAU,EAAI,IAAME,GAASA,CAChD,CACF,CACA,IAAMC,EAAOP,GAAOC,GAAOG,EAAU,EAAI,IAAMJ,EAAM,QAAUA,EAAM,QACrE,OAAOnB,EACH,CAAE,MAAO0B,EAAK,MAAO,UAAWb,GAAS,WAAa,CAAE,EACxD,CAAE,MAAOa,EAAK,KAAM,CAC1B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ShapeHover, ShapeScene } from './scene.cjs';
|
|
1
|
+
import { LinkNode, ShapeHover, ShapeScene } from './scene.cjs';
|
|
2
2
|
/** Whether a point is in an annular sector (gaps included, corners approximated) */
|
|
3
3
|
export declare const pointInSector: (x: number, y: number, s: {
|
|
4
4
|
cx: number;
|
|
@@ -11,6 +11,8 @@ export declare const pointInSector: (x: number, y: number, s: {
|
|
|
11
11
|
}) => boolean;
|
|
12
12
|
/** Even-odd test of a point in a polygon given as a flat x, y list */
|
|
13
13
|
export declare const pointInPolygon: (x: number, y: number, points: readonly number[]) => boolean;
|
|
14
|
+
/** Whether a point is within a sankey link (its thickness, plus 2 px) */
|
|
15
|
+
export declare const pointNearLink: (x: number, y: number, node: LinkNode) => boolean;
|
|
14
16
|
/**
|
|
15
17
|
* Item under a point (CSS pixels). `current` is the hovered item: its
|
|
16
18
|
* popped-out geometry also counts so a moved slice keeps the hover.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ShapeHover, ShapeScene } from './scene.js';
|
|
1
|
+
import { LinkNode, ShapeHover, ShapeScene } from './scene.js';
|
|
2
2
|
/** Whether a point is in an annular sector (gaps included, corners approximated) */
|
|
3
3
|
export declare const pointInSector: (x: number, y: number, s: {
|
|
4
4
|
cx: number;
|
|
@@ -11,6 +11,8 @@ export declare const pointInSector: (x: number, y: number, s: {
|
|
|
11
11
|
}) => boolean;
|
|
12
12
|
/** Even-odd test of a point in a polygon given as a flat x, y list */
|
|
13
13
|
export declare const pointInPolygon: (x: number, y: number, points: readonly number[]) => boolean;
|
|
14
|
+
/** Whether a point is within a sankey link (its thickness, plus 2 px) */
|
|
15
|
+
export declare const pointNearLink: (x: number, y: number, node: LinkNode) => boolean;
|
|
14
16
|
/**
|
|
15
17
|
* Item under a point (CSS pixels). `current` is the hovered item: its
|
|
16
18
|
* popped-out geometry also counts so a moved slice keeps the hover.
|
|
@@ -30,15 +30,32 @@ var r = 12, i = (t, n) => {
|
|
|
30
30
|
pad: n(t)
|
|
31
31
|
});
|
|
32
32
|
case "polygon": return o(r, s, t.points) && !(t.hole && o(r, s, t.hole));
|
|
33
|
-
case "rect":
|
|
33
|
+
case "rect": {
|
|
34
|
+
let e = t.hitPad ?? 0;
|
|
35
|
+
return r >= t.x - e && r <= t.x + t.width + e && s >= t.y - e && s <= t.y + t.height + e;
|
|
36
|
+
}
|
|
34
37
|
case "circle": return Math.hypot(r - t.cx, s - t.cy) <= t.r;
|
|
35
38
|
case "arc": {
|
|
36
39
|
let n = Math.hypot(r - t.cx, s - t.cy);
|
|
37
|
-
return Math.abs(n - t.r) > t.width / 2 + 4 ? !1 : t.a1 - t.a0 >= e - 1e-6 || i(Math.atan2(s - t.cy, r - t.cx), t.a0) <= t.a1;
|
|
40
|
+
return Math.abs(n - t.r) > t.width / 2 + (t.hitPad ?? 4) ? !1 : t.a1 - t.a0 >= e - 1e-6 || i(Math.atan2(s - t.cy, r - t.cx), t.a0) <= t.a1;
|
|
38
41
|
}
|
|
42
|
+
case "link": return u(r, s, t);
|
|
39
43
|
default: return !1;
|
|
40
44
|
}
|
|
41
|
-
}, l = (e, t, n) => {
|
|
45
|
+
}, l = 24, u = (e, t, n) => {
|
|
46
|
+
let r = Math.max(1, n.width) / 2 + 2, i = Math.min(n.x0, n.x1), a = Math.max(n.x0, n.x1);
|
|
47
|
+
if (e < i - r || e > a + r || t < Math.min(n.y0, n.y1) - r || t > Math.max(n.y0, n.y1) + r) return !1;
|
|
48
|
+
let o = (n.x0 + n.x1) / 2, s = (e) => {
|
|
49
|
+
let t = 1 - e, r = t * t * t, i = 3 * t * t * e, a = 3 * t * e * e, s = e * e * e;
|
|
50
|
+
return [r * n.x0 + (i + a) * o + s * n.x1, (r + i) * n.y0 + (a + s) * n.y1];
|
|
51
|
+
}, [c, u] = s(0);
|
|
52
|
+
for (let n = 1; n <= l; n++) {
|
|
53
|
+
let [i, a] = s(n / l), o = i - c, f = a - u, p = o * o + f * f, m = p > 0 ? d(((e - c) * o + (t - u) * f) / p) : 0;
|
|
54
|
+
if (Math.hypot(e - (c + m * o), t - (u + m * f)) <= r) return !0;
|
|
55
|
+
c = i, u = a;
|
|
56
|
+
}
|
|
57
|
+
return !1;
|
|
58
|
+
}, d = (e) => e < 0 ? 0 : e > 1 ? 1 : e, f = (e, t, n) => {
|
|
42
59
|
let a = e.radar;
|
|
43
60
|
if (!a || !a.series.length) return null;
|
|
44
61
|
let c = null, l = r;
|
|
@@ -65,9 +82,9 @@ var r = 12, i = (t, n) => {
|
|
|
65
82
|
index: d,
|
|
66
83
|
indicator: p
|
|
67
84
|
};
|
|
68
|
-
},
|
|
85
|
+
}, p = (e, t, n, r = null) => {
|
|
69
86
|
if (e.empty) return null;
|
|
70
|
-
if (e.type === "radar") return
|
|
87
|
+
if (e.type === "radar") return f(e, t, n);
|
|
71
88
|
let i = e.enter;
|
|
72
89
|
i && i.scale > 0 && i.scale !== 1 && (t = i.cx + (t - i.cx) / i.scale, n = i.cy + (n - i.cy) / i.scale);
|
|
73
90
|
let a = new Set(e.items.map((e) => e.index));
|
|
@@ -82,7 +99,7 @@ var r = 12, i = (t, n) => {
|
|
|
82
99
|
}
|
|
83
100
|
}
|
|
84
101
|
return null;
|
|
85
|
-
},
|
|
102
|
+
}, m = (e, t) => {
|
|
86
103
|
let n = e.items.find((e) => e.index === t.index);
|
|
87
104
|
if (!n) return null;
|
|
88
105
|
let r = t.indicator === void 0 ? null : n.indicators?.[t.indicator];
|
|
@@ -93,7 +110,7 @@ var r = 12, i = (t, n) => {
|
|
|
93
110
|
x: n.x,
|
|
94
111
|
y: n.y
|
|
95
112
|
};
|
|
96
|
-
},
|
|
113
|
+
}, h = (e, t, n) => {
|
|
97
114
|
let r = e.items;
|
|
98
115
|
if (!r.length) return null;
|
|
99
116
|
let i = t ? r.findIndex((e) => e.index === t.index) : -1, a = e.type === "radar";
|
|
@@ -105,6 +122,10 @@ var r = 12, i = (t, n) => {
|
|
|
105
122
|
} : { index: r[e].index };
|
|
106
123
|
}
|
|
107
124
|
let o = n === "next" || n === "down";
|
|
125
|
+
if (e.steps) {
|
|
126
|
+
let t = n === "next" || n === "prev" ? e.steps.next : e.steps.down;
|
|
127
|
+
return { index: (r[i + (o ? t : -t)] ?? r[i]).index };
|
|
128
|
+
}
|
|
108
129
|
if (a && (n === "next" || n === "prev")) {
|
|
109
130
|
let e = r[i].indicators?.length ?? 1, n = t?.indicator ?? 0;
|
|
110
131
|
return {
|
|
@@ -119,6 +140,6 @@ var r = 12, i = (t, n) => {
|
|
|
119
140
|
} : { index: s.index };
|
|
120
141
|
};
|
|
121
142
|
//#endregion
|
|
122
|
-
export {
|
|
143
|
+
export { p as hitTestShapes, m as hoverAnchor, o as pointInPolygon, a as pointInSector, u as pointNearLink, h as stepHover };
|
|
123
144
|
|
|
124
145
|
//# sourceMappingURL=hit.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hit.js","names":["VERTEX_RADIUS","wrapFrom","d","a","from","TAU","pointInSector","dx","x","s","dy","y","span","half","off","padAngleAt","pointInPolygon","n","points","inside","i","j","xi","yi","xj","yj","polygonArea","nodeContains","node","sectorPad","hitRadar","radar","scene","best","bestD","k","area","index","indicator","diff","angle","hitTestShapes","enter","valid","it","current","hoverAnchor","item","hover","ind","stepHover","items","pos","first","direction","forward","count","next"],"sources":["../../../../../charts/src/engine/shapes/hit.ts"],"sourcesContent":["// Hit testing of a ShapeScene and keyboard navigation between its items.\n\nimport { padAngleAt, sectorPad } from \"./draw\";\nimport { TAU, type ShapeHover, type ShapeNode, type ShapeScene } from \"./scene\";\n\n/** Distance (px) under which a radar vertex is picked */\nconst VERTEX_RADIUS = 12;\n\n/** Angle `a` brought into [from, from + 2π) */\nconst wrapFrom = (a: number, from: number) => {\n let d = (a - from) % TAU;\n if (d < 0) d += TAU;\n return from + d;\n};\n\n/** Whether a point is in an annular sector (gaps included, corners approximated) */\nexport const pointInSector = (\n x: number,\n y: number,\n s: {\n cx: number;\n cy: number;\n r0: number;\n r1: number;\n a0: number;\n a1: number;\n pad?: number;\n },\n): boolean => {\n const dx = x - s.cx;\n const dy = y - s.cy;\n const d = Math.hypot(dx, dy);\n if (d > s.r1 || d < s.r0) return false;\n const span = s.a1 - s.a0;\n if (span >= TAU - 1e-6) return true;\n if (span <= 0) return false;\n const a = wrapFrom(Math.atan2(dy, dx), s.a0);\n const half = (s.pad ?? 0) / 2;\n const off = half > 0 ? padAngleAt(half, d) : 0;\n return a >= s.a0 + off && a <= s.a1 - off;\n};\n\n/** Even-odd test of a point in a polygon given as a flat x, y list */\nexport const pointInPolygon = (\n x: number,\n y: number,\n points: readonly number[],\n): boolean => {\n const n = points.length >> 1;\n let inside = false;\n for (let i = 0, j = n - 1; i < n; j = i++) {\n const xi = points[i * 2];\n const yi = points[i * 2 + 1];\n const xj = points[j * 2];\n const yj = points[j * 2 + 1];\n if (yi > y !== yj > y && x < ((xj - xi) * (y - yi)) / (yj - yi) + xi)\n inside = !inside;\n }\n return inside;\n};\n\nconst polygonArea = (points: readonly number[]) => {\n const n = points.length >> 1;\n let a = 0;\n for (let i = 0, j = n - 1; i < n; j = i++)\n a += points[j * 2] * points[i * 2 + 1] - points[i * 2] * points[j * 2 + 1];\n return Math.abs(a) / 2;\n};\n\nconst nodeContains = (node: ShapeNode, x: number, y: number): boolean => {\n switch (node.kind) {\n case \"sector\":\n return pointInSector(x, y, { ...node, pad: sectorPad(node) });\n case \"polygon\":\n return (\n pointInPolygon(x, y, node.points) &&\n !(node.hole && pointInPolygon(x, y, node.hole))\n );\n case \"rect\":\n return (\n x >= node.x &&\n x <= node.x + node.width &&\n y >= node.y &&\n y <= node.y + node.height\n );\n case \"circle\":\n return Math.hypot(x - node.cx, y - node.cy) <= node.r;\n case \"arc\": {\n const d = Math.hypot(x - node.cx, y - node.cy);\n if (Math.abs(d - node.r) > node.width / 2 + 4) return false;\n if (node.a1 - node.a0 >= TAU - 1e-6) return true;\n const a = wrapFrom(Math.atan2(y - node.cy, x - node.cx), node.a0);\n return a <= node.a1;\n }\n default:\n return false;\n }\n};\n\n/** Radar: the vertex under the pointer, else the smallest polygon containing it */\nconst hitRadar = (\n scene: ShapeScene,\n x: number,\n y: number,\n): ShapeHover | null => {\n const radar = scene.radar;\n if (!radar || !radar.series.length) return null;\n let best: ShapeHover | null = null;\n let bestD = VERTEX_RADIUS;\n for (const s of radar.series) {\n for (let k = 0; k < s.points.length >> 1; k++) {\n const d = Math.hypot(x - s.points[k * 2], y - s.points[k * 2 + 1]);\n if (d <= bestD) {\n bestD = d;\n best = { index: s.index, indicator: k };\n }\n }\n }\n if (best) return best;\n let area = Infinity;\n let index = -1;\n for (const s of radar.series) {\n if (s.points.length < 6 || !pointInPolygon(x, y, s.points)) continue;\n const a = polygonArea(s.points);\n if (a < area) {\n area = a;\n index = s.index;\n }\n }\n if (index < 0) return null;\n // nearest indicator by angle\n const a = Math.atan2(y - radar.cy, x - radar.cx);\n let indicator = 0;\n let diff = Infinity;\n radar.angles.forEach((angle, k) => {\n const d = Math.abs(wrapFrom(a - angle + Math.PI, 0) - Math.PI);\n if (d < diff) {\n diff = d;\n indicator = k;\n }\n });\n return { index, indicator };\n};\n\n/**\n * Item under a point (CSS pixels). `current` is the hovered item: its\n * popped-out geometry also counts so a moved slice keeps the hover.\n */\nexport const hitTestShapes = (\n scene: ShapeScene,\n x: number,\n y: number,\n current: ShapeHover | null = null,\n): ShapeHover | null => {\n if (scene.empty) return null;\n if (scene.type === \"radar\") return hitRadar(scene, x, y);\n const enter = scene.enter;\n if (enter && enter.scale > 0 && enter.scale !== 1) {\n x = enter.cx + (x - enter.cx) / enter.scale;\n y = enter.cy + (y - enter.cy) / enter.scale;\n }\n const valid = new Set(scene.items.map((it) => it.index));\n for (let i = scene.nodes.length - 1; i >= 0; i--) {\n const node = scene.nodes[i];\n if (node.hit === undefined || !valid.has(node.hit)) continue;\n if (node.kind === \"text\" || node.kind === \"line\") continue;\n if (nodeContains(node, x, y)) return { index: node.hit };\n if (current?.index === node.hit && node.shift) {\n const [dx, dy] = node.shift;\n if (nodeContains(node, x - dx, y - dy)) return { index: node.hit };\n }\n }\n return null;\n};\n\n/** Where the tooltip of a keyboard-focused item goes */\nexport const hoverAnchor = (\n scene: ShapeScene,\n hover: ShapeHover,\n): { x: number; y: number } | null => {\n const item = scene.items.find((it) => it.index === hover.index);\n if (!item) return null;\n const ind =\n hover.indicator !== undefined ? item.indicators?.[hover.indicator] : null;\n return ind ? { x: ind.x, y: ind.y } : { x: item.x, y: item.y };\n};\n\n/**\n * Next focused item for the arrow keys: `next` / `prev` walk the items\n * (radar: the indicators of the series), `up` / `down` the radar series.\n */\nexport const stepHover = (\n scene: ShapeScene,\n current: ShapeHover | null,\n direction: \"next\" | \"prev\" | \"up\" | \"down\",\n): ShapeHover | null => {\n const items = scene.items;\n if (!items.length) return null;\n const pos = current\n ? items.findIndex((it) => it.index === current.index)\n : -1;\n const radar = scene.type === \"radar\";\n if (pos < 0) {\n const first =\n direction === \"prev\" || direction === \"up\" ? items.length - 1 : 0;\n return radar\n ? { index: items[first].index, indicator: 0 }\n : { index: items[first].index };\n }\n const forward = direction === \"next\" || direction === \"down\";\n if (radar && (direction === \"next\" || direction === \"prev\")) {\n const count = items[pos].indicators?.length ?? 1;\n const k = current?.indicator ?? 0;\n return {\n index: items[pos].index,\n indicator: (k + (forward ? 1 : -1) + count) % count,\n };\n }\n const next = items[(pos + (forward ? 1 : -1) + items.length) % items.length];\n return radar\n ? { index: next.index, indicator: current?.indicator ?? 0 }\n : { index: next.index };\n};\n"],"mappings":";;;AAMA,IAAMA,IAAgB,IAGhBC,KAAY,GAAW,MAAiB;CAC5C,IAAIC,KAAKC,IAAIC,KAAQC;CAErB,OADIH,IAAI,MAAG,KAAKG,IACTD,IAAOF;AAChB,GAGaI,KACX,GACA,GACA,MASY;CACZ,IAAMC,IAAKC,IAAIC,EAAE,IACXC,IAAKC,IAAIF,EAAE,IACXP,IAAI,KAAK,MAAMK,GAAIG,CAAE;CAC3B,IAAIR,IAAIO,EAAE,MAAMP,IAAIO,EAAE,IAAI,OAAO;CACjC,IAAMG,IAAOH,EAAE,KAAKA,EAAE;CACtB,IAAIG,KAAQP,IAAM,MAAM,OAAO;CAC/B,IAAIO,KAAQ,GAAG,OAAO;CACtB,IAAMT,IAAIF,EAAS,KAAK,MAAMS,GAAIH,CAAE,GAAGE,EAAE,EAAE,GACrCI,KAAQJ,EAAE,OAAO,KAAK,GACtBK,IAAMD,IAAO,IAAIE,EAAWF,GAAMX,CAAC,IAAI;CAC7C,OAAOC,KAAKM,EAAE,KAAKK,KAAOX,KAAKM,EAAE,KAAKK;AACxC,GAGaE,KACX,GACA,GACA,MACY;CACZ,IAAMC,IAAIC,EAAO,UAAU,GACvBC,IAAS;CACb,KAAK,IAAIC,IAAI,GAAGC,IAAIJ,IAAI,GAAGG,IAAIH,GAAG,IAAI,KAAK;EACzC,IAAMK,IAAKJ,EAAOE,IAAI,IAChBG,IAAKL,EAAOE,IAAI,IAAI,IACpBI,IAAK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;CACtB,IAAMC,IAAQnB,EAAM;CACpB,IAAI,CAACmB,EAAM,QAAQ,OAAO;CAC1B,IAAMC,IAAMP,IACRM,EAAM,WAAW,MAAOP,EAAG,UAAUC,EAAQ,KAAK,IAClD,IACEd,IAAQC,EAAM,SAAS;CAC7B,IAAIoB,IAAM,GAAG;EACX,IAAMC,IACJC,MAAc,UAAUA,MAAc,OAAOH,EAAM,SAAS,IAAI;EAClE,OAAOpB,IACH;GAAE,OAAOoB,EAAME,EAAM,CAAC;GAAO,WAAW;EAAE,IAC1C,EAAE,OAAOF,EAAME,EAAM,CAAC,MAAM;CAClC;CACA,IAAME,IAAUD,MAAc,UAAUA,MAAc;CACtD,IAAIvB,MAAUuB,MAAc,UAAUA,MAAc,SAAS;EAC3D,IAAME,IAAQL,EAAMC,EAAI,CAAC,YAAY,UAAU,GACzCjB,IAAIU,GAAS,aAAa;EAChC,OAAO;GACL,OAAOM,EAAMC,EAAI,CAAC;GAClB,YAAYjB,KAAKoB,IAAU,IAAI,MAAMC,KAASA;EAChD;CACF;CACA,IAAMC,IAAON,GAAOC,KAAOG,IAAU,IAAI,MAAMJ,EAAM,UAAUA,EAAM;CACrE,OAAOpB,IACH;EAAE,OAAO0B,EAAK;EAAO,WAAWZ,GAAS,aAAa;CAAE,IACxD,EAAE,OAAOY,EAAK,MAAM;AAC1B"}
|
|
1
|
+
{"version":3,"file":"hit.js","names":["VERTEX_RADIUS","wrapFrom","d","a","from","TAU","pointInSector","dx","x","s","dy","y","span","half","off","padAngleAt","pointInPolygon","n","points","inside","i","j","xi","yi","xj","yj","polygonArea","nodeContains","node","sectorPad","pad","pointNearLink","LINK_SEGMENTS","left","right","xm","at","u","t","b0","b1","b2","b3","px","py","k","qx","qy","len2","clampUnit","v","hitRadar","radar","scene","best","bestD","area","index","indicator","diff","angle","hitTestShapes","enter","valid","it","current","hoverAnchor","item","hover","ind","stepHover","items","pos","first","direction","forward","step","count","next"],"sources":["../../../../../charts/src/engine/shapes/hit.ts"],"sourcesContent":["// Hit testing of a ShapeScene and keyboard navigation between its items.\n\nimport { padAngleAt, sectorPad } from \"./draw\";\nimport {\n TAU,\n type LinkNode,\n type ShapeHover,\n type ShapeNode,\n type ShapeScene,\n} from \"./scene\";\n\n/** Distance (px) under which a radar vertex is picked */\nconst VERTEX_RADIUS = 12;\n\n/** Angle `a` brought into [from, from + 2π) */\nconst wrapFrom = (a: number, from: number) => {\n let d = (a - from) % TAU;\n if (d < 0) d += TAU;\n return from + d;\n};\n\n/** Whether a point is in an annular sector (gaps included, corners approximated) */\nexport const pointInSector = (\n x: number,\n y: number,\n s: {\n cx: number;\n cy: number;\n r0: number;\n r1: number;\n a0: number;\n a1: number;\n pad?: number;\n },\n): boolean => {\n const dx = x - s.cx;\n const dy = y - s.cy;\n const d = Math.hypot(dx, dy);\n if (d > s.r1 || d < s.r0) return false;\n const span = s.a1 - s.a0;\n if (span >= TAU - 1e-6) return true;\n if (span <= 0) return false;\n const a = wrapFrom(Math.atan2(dy, dx), s.a0);\n const half = (s.pad ?? 0) / 2;\n const off = half > 0 ? padAngleAt(half, d) : 0;\n return a >= s.a0 + off && a <= s.a1 - off;\n};\n\n/** Even-odd test of a point in a polygon given as a flat x, y list */\nexport const pointInPolygon = (\n x: number,\n y: number,\n points: readonly number[],\n): boolean => {\n const n = points.length >> 1;\n let inside = false;\n for (let i = 0, j = n - 1; i < n; j = i++) {\n const xi = points[i * 2];\n const yi = points[i * 2 + 1];\n const xj = points[j * 2];\n const yj = points[j * 2 + 1];\n if (yi > y !== yj > y && x < ((xj - xi) * (y - yi)) / (yj - yi) + xi)\n inside = !inside;\n }\n return inside;\n};\n\nconst polygonArea = (points: readonly number[]) => {\n const n = points.length >> 1;\n let a = 0;\n for (let i = 0, j = n - 1; i < n; j = i++)\n a += points[j * 2] * points[i * 2 + 1] - points[i * 2] * points[j * 2 + 1];\n return Math.abs(a) / 2;\n};\n\nconst nodeContains = (node: ShapeNode, x: number, y: number): boolean => {\n switch (node.kind) {\n case \"sector\":\n return pointInSector(x, y, { ...node, pad: sectorPad(node) });\n case \"polygon\":\n return (\n pointInPolygon(x, y, node.points) &&\n !(node.hole && pointInPolygon(x, y, node.hole))\n );\n case \"rect\": {\n const pad = node.hitPad ?? 0;\n return (\n x >= node.x - pad &&\n x <= node.x + node.width + pad &&\n y >= node.y - pad &&\n y <= node.y + node.height + pad\n );\n }\n case \"circle\":\n return Math.hypot(x - node.cx, y - node.cy) <= node.r;\n case \"arc\": {\n const d = Math.hypot(x - node.cx, y - node.cy);\n if (Math.abs(d - node.r) > node.width / 2 + (node.hitPad ?? 4))\n return false;\n if (node.a1 - node.a0 >= TAU - 1e-6) return true;\n const a = wrapFrom(Math.atan2(y - node.cy, x - node.cx), node.a0);\n return a <= node.a1;\n }\n case \"link\":\n return pointNearLink(x, y, node);\n default:\n return false;\n }\n};\n\n/** Segments of the polyline approximating a link's center curve */\nconst LINK_SEGMENTS = 24;\n\n/** Whether a point is within a sankey link (its thickness, plus 2 px) */\nexport const pointNearLink = (x: number, y: number, node: LinkNode) => {\n const half = Math.max(1, node.width) / 2 + 2;\n const left = Math.min(node.x0, node.x1);\n const right = Math.max(node.x0, node.x1);\n if (x < left - half || x > right + half) return false;\n if (\n y < Math.min(node.y0, node.y1) - half ||\n y > Math.max(node.y0, node.y1) + half\n )\n return false;\n const xm = (node.x0 + node.x1) / 2;\n // cubic Bézier (x0, y0) (xm, y0) (xm, y1) (x1, y1)\n const at = (t: number): [number, number] => {\n const u = 1 - t;\n const b0 = u * u * u;\n const b1 = 3 * u * u * t;\n const b2 = 3 * u * t * t;\n const b3 = t * t * t;\n return [\n b0 * node.x0 + (b1 + b2) * xm + b3 * node.x1,\n (b0 + b1) * node.y0 + (b2 + b3) * node.y1,\n ];\n };\n let [px, py] = at(0);\n for (let k = 1; k <= LINK_SEGMENTS; k++) {\n const [qx, qy] = at(k / LINK_SEGMENTS);\n const dx = qx - px;\n const dy = qy - py;\n const len2 = dx * dx + dy * dy;\n const s = len2 > 0 ? clampUnit(((x - px) * dx + (y - py) * dy) / len2) : 0;\n if (Math.hypot(x - (px + s * dx), y - (py + s * dy)) <= half) return true;\n px = qx;\n py = qy;\n }\n return false;\n};\n\nconst clampUnit = (v: number) => (v < 0 ? 0 : v > 1 ? 1 : v);\n\n/** Radar: the vertex under the pointer, else the smallest polygon containing it */\nconst hitRadar = (\n scene: ShapeScene,\n x: number,\n y: number,\n): ShapeHover | null => {\n const radar = scene.radar;\n if (!radar || !radar.series.length) return null;\n let best: ShapeHover | null = null;\n let bestD = VERTEX_RADIUS;\n for (const s of radar.series) {\n for (let k = 0; k < s.points.length >> 1; k++) {\n const d = Math.hypot(x - s.points[k * 2], y - s.points[k * 2 + 1]);\n if (d <= bestD) {\n bestD = d;\n best = { index: s.index, indicator: k };\n }\n }\n }\n if (best) return best;\n let area = Infinity;\n let index = -1;\n for (const s of radar.series) {\n if (s.points.length < 6 || !pointInPolygon(x, y, s.points)) continue;\n const a = polygonArea(s.points);\n if (a < area) {\n area = a;\n index = s.index;\n }\n }\n if (index < 0) return null;\n // nearest indicator by angle\n const a = Math.atan2(y - radar.cy, x - radar.cx);\n let indicator = 0;\n let diff = Infinity;\n radar.angles.forEach((angle, k) => {\n const d = Math.abs(wrapFrom(a - angle + Math.PI, 0) - Math.PI);\n if (d < diff) {\n diff = d;\n indicator = k;\n }\n });\n return { index, indicator };\n};\n\n/**\n * Item under a point (CSS pixels). `current` is the hovered item: its\n * popped-out geometry also counts so a moved slice keeps the hover.\n */\nexport const hitTestShapes = (\n scene: ShapeScene,\n x: number,\n y: number,\n current: ShapeHover | null = null,\n): ShapeHover | null => {\n if (scene.empty) return null;\n if (scene.type === \"radar\") return hitRadar(scene, x, y);\n const enter = scene.enter;\n if (enter && enter.scale > 0 && enter.scale !== 1) {\n x = enter.cx + (x - enter.cx) / enter.scale;\n y = enter.cy + (y - enter.cy) / enter.scale;\n }\n const valid = new Set(scene.items.map((it) => it.index));\n for (let i = scene.nodes.length - 1; i >= 0; i--) {\n const node = scene.nodes[i];\n if (node.hit === undefined || !valid.has(node.hit)) continue;\n if (node.kind === \"text\" || node.kind === \"line\") continue;\n if (nodeContains(node, x, y)) return { index: node.hit };\n if (current?.index === node.hit && node.shift) {\n const [dx, dy] = node.shift;\n if (nodeContains(node, x - dx, y - dy)) return { index: node.hit };\n }\n }\n return null;\n};\n\n/** Where the tooltip of a keyboard-focused item goes */\nexport const hoverAnchor = (\n scene: ShapeScene,\n hover: ShapeHover,\n): { x: number; y: number } | null => {\n const item = scene.items.find((it) => it.index === hover.index);\n if (!item) return null;\n const ind =\n hover.indicator !== undefined ? item.indicators?.[hover.indicator] : null;\n return ind ? { x: ind.x, y: ind.y } : { x: item.x, y: item.y };\n};\n\n/**\n * Next focused item for the arrow keys: `next` / `prev` walk the items\n * (radar: the indicators of the series), `up` / `down` the radar series.\n */\nexport const stepHover = (\n scene: ShapeScene,\n current: ShapeHover | null,\n direction: \"next\" | \"prev\" | \"up\" | \"down\",\n): ShapeHover | null => {\n const items = scene.items;\n if (!items.length) return null;\n const pos = current\n ? items.findIndex((it) => it.index === current.index)\n : -1;\n const radar = scene.type === \"radar\";\n if (pos < 0) {\n const first =\n direction === \"prev\" || direction === \"up\" ? items.length - 1 : 0;\n return radar\n ? { index: items[first].index, indicator: 0 }\n : { index: items[first].index };\n }\n const forward = direction === \"next\" || direction === \"down\";\n if (scene.steps) {\n const step =\n direction === \"next\" || direction === \"prev\"\n ? scene.steps.next\n : scene.steps.down;\n const target = items[pos + (forward ? step : -step)];\n return { index: (target ?? items[pos]).index };\n }\n if (radar && (direction === \"next\" || direction === \"prev\")) {\n const count = items[pos].indicators?.length ?? 1;\n const k = current?.indicator ?? 0;\n return {\n index: items[pos].index,\n indicator: (k + (forward ? 1 : -1) + count) % count,\n };\n }\n const next = items[(pos + (forward ? 1 : -1) + items.length) % items.length];\n return radar\n ? { index: next.index, indicator: current?.indicator ?? 0 }\n : { index: next.index };\n};\n"],"mappings":";;;AAYA,IAAMA,IAAgB,IAG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K,IAClD,IACEb,IAAQC,EAAM,SAAS;CAC7B,IAAImB,IAAM,GAAG;EACX,IAAMC,IACJC,MAAc,UAAUA,MAAc,OAAOH,EAAM,SAAS,IAAI;EAClE,OAAOnB,IACH;GAAE,OAAOmB,EAAME,EAAM,CAAC;GAAO,WAAW;EAAE,IAC1C,EAAE,OAAOF,EAAME,EAAM,CAAC,MAAM;CAClC;CACA,IAAME,IAAUD,MAAc,UAAUA,MAAc;CACtD,IAAIrB,EAAM,OAAO;EACf,IAAMuB,IACJF,MAAc,UAAUA,MAAc,SAClCrB,EAAM,MAAM,OACZA,EAAM,MAAM;EAElB,OAAO,EAAE,QADMkB,EAAMC,KAAOG,IAAUC,IAAO,CAACA,OACnBL,EAAMC,GAAA,CAAM,MAAM;CAC/C;CACA,IAAIpB,MAAUsB,MAAc,UAAUA,MAAc,SAAS;EAC3D,IAAMG,IAAQN,EAAMC,EAAI,CAAC,YAAY,UAAU,GACzC3B,IAAIoB,GAAS,aAAa;EAChC,OAAO;GACL,OAAOM,EAAMC,EAAI,CAAC;GAClB,YAAY3B,KAAK8B,IAAU,IAAI,MAAME,KAASA;EAChD;CACF;CACA,IAAMC,IAAOP,GAAOC,KAAOG,IAAU,IAAI,MAAMJ,EAAM,UAAUA,EAAM;CACrE,OAAOnB,IACH;EAAE,OAAO0B,EAAK;EAAO,WAAWb,GAAS,aAAa;CAAE,IACxD,EAAE,OAAOa,EAAK,MAAM;AAC1B"}
|
|
@@ -5,5 +5,8 @@ export { hitTestShapes, hoverAnchor, pointInPolygon, pointInSector, stepHover, }
|
|
|
5
5
|
export { describeChart, describeScene, hoverEvent, layoutShapeLegend, layoutShapeScene, layoutShapeTooltip, placeShapeTooltip, shapeLegend, shapeValues, tooltipContent, type ShapeLayoutInput, type ShapeLegendBox, type ShapeTooltipBox, type ShapeTooltipContent, } from './layout.cjs';
|
|
6
6
|
export { gaugeBandIndex } from './gauge.cjs';
|
|
7
7
|
export { squarify, treemapLeaves } from './treemap.cjs';
|
|
8
|
+
export { resolveSankey, sankeyColumns } from './sankey.cjs';
|
|
9
|
+
export { calendarDay, calendarIso, localeWeekStart } from './calendar.cjs';
|
|
10
|
+
export { bulletScale } from './bullet.cjs';
|
|
8
11
|
export type { MeasureText, ShapeHover, ShapeItem, ShapeLegendEntry, ShapeNode, ShapeRect, ShapeScene, ShapeTooltipRow, } from './scene.cjs';
|
|
9
|
-
export type { FunnelChartOptions, GaugeBand, GaugeChartOptions, PieChartOptions, RadarChartOptions, RadarIndicator, RadarSeries, ShapeChartCommonOptions, ShapeChartEventMap, ShapeChartInstance, ShapeChartOptions, ShapeChartType, ShapeDatum, ShapeHoverEvent, ShapeLegendOptions, ShapeToggleEvent, ShapeTooltipOptions, TreemapChartOptions, TreemapNode, } from './types.cjs';
|
|
12
|
+
export type { BulletChartOptions, BulletDatum, CalendarDate, CalendarDatum, CalendarHeatmapOptions, FunnelChartOptions, GaugeBand, GaugeChartOptions, PieChartOptions, RadarChartOptions, RadarIndicator, RadarSeries, RadialBarChartOptions, RadialBarDatum, SankeyChartOptions, SankeyLink, SankeyNode, ShapeChartCommonOptions, ShapeChartEventMap, ShapeChartInstance, ShapeChartLabels, ShapeChartOptions, ShapeChartType, ShapeDatum, ShapeDrillEvent, ShapeHoverEvent, ShapeLegendOptions, ShapeToggleEvent, ShapeTooltipOptions, SunburstChartOptions, TreemapChartOptions, TreemapNode, } from './types.cjs';
|
|
@@ -5,5 +5,8 @@ export { hitTestShapes, hoverAnchor, pointInPolygon, pointInSector, stepHover, }
|
|
|
5
5
|
export { describeChart, describeScene, hoverEvent, layoutShapeLegend, layoutShapeScene, layoutShapeTooltip, placeShapeTooltip, shapeLegend, shapeValues, tooltipContent, type ShapeLayoutInput, type ShapeLegendBox, type ShapeTooltipBox, type ShapeTooltipContent, } from './layout.js';
|
|
6
6
|
export { gaugeBandIndex } from './gauge.js';
|
|
7
7
|
export { squarify, treemapLeaves } from './treemap.js';
|
|
8
|
+
export { resolveSankey, sankeyColumns } from './sankey.js';
|
|
9
|
+
export { calendarDay, calendarIso, localeWeekStart } from './calendar.js';
|
|
10
|
+
export { bulletScale } from './bullet.js';
|
|
8
11
|
export type { MeasureText, ShapeHover, ShapeItem, ShapeLegendEntry, ShapeNode, ShapeRect, ShapeScene, ShapeTooltipRow, } from './scene.js';
|
|
9
|
-
export type { FunnelChartOptions, GaugeBand, GaugeChartOptions, PieChartOptions, RadarChartOptions, RadarIndicator, RadarSeries, ShapeChartCommonOptions, ShapeChartEventMap, ShapeChartInstance, ShapeChartOptions, ShapeChartType, ShapeDatum, ShapeHoverEvent, ShapeLegendOptions, ShapeToggleEvent, ShapeTooltipOptions, TreemapChartOptions, TreemapNode, } from './types.js';
|
|
12
|
+
export type { BulletChartOptions, BulletDatum, CalendarDate, CalendarDatum, CalendarHeatmapOptions, FunnelChartOptions, GaugeBand, GaugeChartOptions, PieChartOptions, RadarChartOptions, RadarIndicator, RadarSeries, RadialBarChartOptions, RadialBarDatum, SankeyChartOptions, SankeyLink, SankeyNode, ShapeChartCommonOptions, ShapeChartEventMap, ShapeChartInstance, ShapeChartLabels, ShapeChartOptions, ShapeChartType, ShapeDatum, ShapeDrillEvent, ShapeHoverEvent, ShapeLegendOptions, ShapeToggleEvent, ShapeTooltipOptions, SunburstChartOptions, TreemapChartOptions, TreemapNode, } from './types.js';
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const e=require("../locale.cjs");var t={en:{noData:`No data`,value:`Value`,share:`Share`,ofFirstStage:`Of first stage`,conversion:`Conversion`,ofRange:`Of range`,ofName:`Of {name}`,incoming:`Incoming`,outgoing:`Outgoing`,max:`Max`,progress:`Progress`,target:`Target`,ofTarget:`Of target`,range:`Range`,series:`Series {index}`,pieChart:`Pie chart`,donutChart:`Donut chart`,roseChart:`Rose chart`,radarChart:`Radar chart`,gaugeChart:`Gauge`,gaugeChartNamed:`Gauge: {label}`,funnelChart:`Funnel chart`,treemapChart:`Treemap`,sankeyChart:`Sankey diagram`,sunburstChart:`Sunburst chart`,radialBarChart:`Radial bar chart`,calendarHeatmap:`Calendar heatmap`,bulletChart:`Bullet chart`},zh:{noData:`暂无数据`,value:`数值`,share:`占比`,ofFirstStage:`占首阶段`,conversion:`转化率`,ofRange:`占量程`,ofName:`占{name}`,incoming:`流入`,outgoing:`流出`,max:`最大值`,progress:`进度`,target:`目标`,ofTarget:`目标达成`,range:`区间`,series:`系列 {index}`,pieChart:`饼图`,donutChart:`环形图`,roseChart:`玫瑰图`,radarChart:`雷达图`,gaugeChart:`仪表盘`,gaugeChartNamed:`仪表盘:{label}`,funnelChart:`漏斗图`,treemapChart:`矩形树图`,sankeyChart:`桑基图`,sunburstChart:`旭日图`,radialBarChart:`径向条形图`,calendarHeatmap:`日历热力图`,bulletChart:`子弹图`},ja:{noData:`データなし`,value:`値`,share:`割合`,ofFirstStage:`初段階比`,conversion:`転換率`,ofRange:`範囲比`,ofName:`{name}比`,incoming:`流入`,outgoing:`流出`,max:`最大`,progress:`進捗`,target:`目標`,ofTarget:`目標達成率`,range:`範囲`,series:`系列 {index}`,pieChart:`円グラフ`,donutChart:`ドーナツグラフ`,roseChart:`鶏頭図`,radarChart:`レーダーチャート`,gaugeChart:`ゲージ`,gaugeChartNamed:`ゲージ:{label}`,funnelChart:`ファネルチャート`,treemapChart:`ツリーマップ`,sankeyChart:`サンキー図`,sunburstChart:`サンバースト図`,radialBarChart:`円形棒グラフ`,calendarHeatmap:`カレンダーヒートマップ`,bulletChart:`ブレットグラフ`},fr:{noData:`Aucune donnée`,value:`Valeur`,share:`Part`,ofFirstStage:`Part de la 1re étape`,conversion:`Conversion`,ofRange:`Part de la plage`,ofName:`Part de {name}`,incoming:`Entrées`,outgoing:`Sorties`,max:`Max`,progress:`Progression`,target:`Objectif`,ofTarget:`Atteinte de l’objectif`,range:`Plage`,series:`Série {index}`,pieChart:`Graphique circulaire`,donutChart:`Graphique en anneau`,roseChart:`Diagramme de Nightingale`,radarChart:`Graphique radar`,gaugeChart:`Jauge`,gaugeChartNamed:`Jauge : {label}`,funnelChart:`Graphique en entonnoir`,treemapChart:`Treemap`,sankeyChart:`Diagramme de Sankey`,sunburstChart:`Diagramme en rayons de soleil`,radialBarChart:`Graphique à barres radiales`,calendarHeatmap:`Calendrier thermique`,bulletChart:`Graphique à puces`}},n=n=>e.localeLabels(t,n.locale,n.texts),r=(e,t)=>e.replace(/\{(\w+)\}/g,(e,n)=>n in t?String(t[n]):e),i=t=>{let n=e.resolveLocale(t),r=e.compactUnits(n);return t=>{if(!Number.isFinite(t))return String(t);if(Object.is(t,-0)||t===0)return`0`;let i=Math.abs(t);for(let[a,o]of r)if(i>=a)return e.numberFormat(n,{maximumFractionDigits:2}).format(t/a)+o;if(i<1e-4)return t.toExponential(1);let a=Math.floor(Math.log10(i)+1e-9),o=Math.min(6,Math.max(0,-a)+2);return e.numberFormat(n,{maximumFractionDigits:o}).format(t)}},a=t=>{let n=e.resolveLocale(t);return t=>Number.isFinite(t)?e.numberFormat(n,{style:`percent`,minimumFractionDigits:1,maximumFractionDigits:1}).format(t):`–`};exports.SHAPE_LABELS=t,exports.interpolate=r,exports.localeFormat=i,exports.localePercent=a,exports.shapeLabels=n;
|
|
2
|
+
//# sourceMappingURL=labels.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"labels.cjs","names":["localeLabels","resolveLocale","compactUnits","numberFormat","require_locale","SHAPE_LABELS","shapeLabels","o","interpolate","template","key","values","all","localeFormat","tag","locale","units","value","abs","unit","suffix","magnitude","decimals","localePercent","share"],"sources":["../../../../../charts/src/engine/shapes/labels.ts"],"sourcesContent":["// Language of the shape charts: built-in texts (tooltip rows, accessible\n// names, \"No data\") and locale-aware number / percent formatting. The locale\n// is resolved on every layout, so a page language switch followed by a\n// re-render updates the texts.\n\nimport {\n compactUnits,\n localeLabels,\n numberFormat,\n resolveLocale,\n type LabelDictionary,\n} from \"../locale\";\nimport type { ShapeChartLabels, ShapeChartOptions } from \"./types\";\n\nexport const SHAPE_LABELS: LabelDictionary<ShapeChartLabels> = {\n en: {\n noData: \"No data\",\n value: \"Value\",\n share: \"Share\",\n ofFirstStage: \"Of first stage\",\n conversion: \"Conversion\",\n ofRange: \"Of range\",\n ofName: \"Of {name}\",\n incoming: \"Incoming\",\n outgoing: \"Outgoing\",\n max: \"Max\",\n progress: \"Progress\",\n target: \"Target\",\n ofTarget: \"Of target\",\n range: \"Range\",\n series: \"Series {index}\",\n pieChart: \"Pie chart\",\n donutChart: \"Donut chart\",\n roseChart: \"Rose chart\",\n radarChart: \"Radar chart\",\n gaugeChart: \"Gauge\",\n gaugeChartNamed: \"Gauge: {label}\",\n funnelChart: \"Funnel chart\",\n treemapChart: \"Treemap\",\n sankeyChart: \"Sankey diagram\",\n sunburstChart: \"Sunburst chart\",\n radialBarChart: \"Radial bar chart\",\n calendarHeatmap: \"Calendar heatmap\",\n bulletChart: \"Bullet chart\",\n },\n zh: {\n noData: \"暂无数据\",\n value: \"数值\",\n share: \"占比\",\n ofFirstStage: \"占首阶段\",\n conversion: \"转化率\",\n ofRange: \"占量程\",\n ofName: \"占{name}\",\n incoming: \"流入\",\n outgoing: \"流出\",\n max: \"最大值\",\n progress: \"进度\",\n target: \"目标\",\n ofTarget: \"目标达成\",\n range: \"区间\",\n series: \"系列 {index}\",\n pieChart: \"饼图\",\n donutChart: \"环形图\",\n roseChart: \"玫瑰图\",\n radarChart: \"雷达图\",\n gaugeChart: \"仪表盘\",\n gaugeChartNamed: \"仪表盘:{label}\",\n funnelChart: \"漏斗图\",\n treemapChart: \"矩形树图\",\n sankeyChart: \"桑基图\",\n sunburstChart: \"旭日图\",\n radialBarChart: \"径向条形图\",\n calendarHeatmap: \"日历热力图\",\n bulletChart: \"子弹图\",\n },\n ja: {\n noData: \"データなし\",\n value: \"値\",\n share: \"割合\",\n ofFirstStage: \"初段階比\",\n conversion: \"転換率\",\n ofRange: \"範囲比\",\n ofName: \"{name}比\",\n incoming: \"流入\",\n outgoing: \"流出\",\n max: \"最大\",\n progress: \"進捗\",\n target: \"目標\",\n ofTarget: \"目標達成率\",\n range: \"範囲\",\n series: \"系列 {index}\",\n pieChart: \"円グラフ\",\n donutChart: \"ドーナツグラフ\",\n roseChart: \"鶏頭図\",\n radarChart: \"レーダーチャート\",\n gaugeChart: \"ゲージ\",\n gaugeChartNamed: \"ゲージ:{label}\",\n funnelChart: \"ファネルチャート\",\n treemapChart: \"ツリーマップ\",\n sankeyChart: \"サンキー図\",\n sunburstChart: \"サンバースト図\",\n radialBarChart: \"円形棒グラフ\",\n calendarHeatmap: \"カレンダーヒートマップ\",\n bulletChart: \"ブレットグラフ\",\n },\n fr: {\n noData: \"Aucune donnée\",\n value: \"Valeur\",\n share: \"Part\",\n ofFirstStage: \"Part de la 1re étape\",\n conversion: \"Conversion\",\n ofRange: \"Part de la plage\",\n ofName: \"Part de {name}\",\n incoming: \"Entrées\",\n outgoing: \"Sorties\",\n max: \"Max\",\n progress: \"Progression\",\n target: \"Objectif\",\n ofTarget: \"Atteinte de l’objectif\",\n range: \"Plage\",\n series: \"Série {index}\",\n pieChart: \"Graphique circulaire\",\n donutChart: \"Graphique en anneau\",\n roseChart: \"Diagramme de Nightingale\",\n radarChart: \"Graphique radar\",\n gaugeChart: \"Jauge\",\n gaugeChartNamed: \"Jauge : {label}\",\n funnelChart: \"Graphique en entonnoir\",\n treemapChart: \"Treemap\",\n sankeyChart: \"Diagramme de Sankey\",\n sunburstChart: \"Diagramme en rayons de soleil\",\n radialBarChart: \"Graphique à barres radiales\",\n calendarHeatmap: \"Calendrier thermique\",\n bulletChart: \"Graphique à puces\",\n },\n};\n\n/** Texts of a chart: its `locale` (the page language by default) and `texts` overrides */\nexport const shapeLabels = (\n o: Pick<ShapeChartOptions, \"locale\" | \"texts\">,\n): ShapeChartLabels => localeLabels(SHAPE_LABELS, o.locale, o.texts);\n\n/** Replaces the `{key}` placeholders of a text */\nexport const interpolate = (\n template: string,\n values: Record<string, string | number>,\n): string =>\n template.replace(/\\{(\\w+)\\}/g, (all, key: string) =>\n key in values ? String(values[key]) : all,\n );\n\n/**\n * Compact number of a locale: `1.23k` / `12.3万` / `1,2 k`; small values\n * keep enough decimals to be told apart\n */\nexport const localeFormat = (locale?: string) => {\n const tag = resolveLocale(locale);\n const units = compactUnits(tag);\n return (value: number): string => {\n if (!Number.isFinite(value)) return String(value);\n if (Object.is(value, -0) || value === 0) return \"0\";\n const abs = Math.abs(value);\n for (const [unit, suffix] of units)\n if (abs >= unit)\n return (\n numberFormat(tag, { maximumFractionDigits: 2 }).format(value / unit) +\n suffix\n );\n if (abs < 1e-4) return value.toExponential(1);\n // at least two decimals, two more than the magnitude (0.0123, 1.25)\n const magnitude = Math.floor(Math.log10(abs) + 1e-9);\n const decimals = Math.min(6, Math.max(0, -magnitude) + 2);\n return numberFormat(tag, { maximumFractionDigits: decimals }).format(value);\n };\n};\n\n/** Share 0-1 as a locale percent with one decimal: `40.0%`, `40,0 %` */\nexport const localePercent = (locale?: string) => {\n const tag = resolveLocale(locale);\n return (share: number): string =>\n Number.isFinite(share)\n ? numberFormat(tag, {\n style: \"percent\",\n minimumFractionDigits: 1,\n maximumFractionDigits: 1,\n }).format(share)\n : \"–\";\n};\n"],"mappings":"iCAcA,IAAaK,EAAkD,CAC7D,GAAI,CACF,OAAQ,UACR,MAAO,QACP,MAAO,QACP,aAAc,iBACd,WAAY,aACZ,QAAS,WACT,OAAQ,YACR,SAAU,WACV,SAAU,WACV,IAAK,MACL,SAAU,WACV,OAAQ,SACR,SAAU,YACV,MAAO,QACP,OAAQ,iBACR,SAAU,YACV,WAAY,cACZ,UAAW,aACX,WAAY,cACZ,WAAY,QACZ,gBAAiB,iBACjB,YAAa,eACb,aAAc,UACd,YAAa,iBACb,cAAe,iBACf,eAAgB,mBAChB,gBAAiB,mBACjB,YAAa,cACf,EACA,GAAI,CACF,OAAQ,OACR,MAAO,KACP,MAAO,KACP,aAAc,OACd,WAAY,MACZ,QAAS,MACT,OAAQ,UACR,SAAU,KACV,SAAU,KACV,IAAK,MACL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ASG,CAAK,EAAG,OAAO,OAAOA,CAAK,EAChD,GAAI,OAAO,GAAGA,EAAO,EAAE,GAAKA,IAAU,EAAG,MAAO,IAChD,IAAMC,EAAM,KAAK,IAAID,CAAK,EAC1B,IAAK,GAAM,CAACE,EAAMC,KAAWJ,EAC3B,GAAIE,GAAOC,EACT,OACEhB,EAAAA,aAAaW,EAAK,CAAE,sBAAuB,CAAE,CAAC,CAAC,CAAC,OAAOG,EAAQE,CAAI,EACnEC,EAEN,GAAIF,EAAM,KAAM,OAAOD,EAAM,cAAc,CAAC,EAE5C,IAAMI,EAAY,KAAK,MAAM,KAAK,MAAMH,CAAG,EAAI,IAAI,EAC7CI,EAAW,KAAK,IAAI,EAAG,KAAK,IAAI,EAAG,CAACD,CAAS,EAAI,CAAC,EACxD,OAAOlB,EAAAA,aAAaW,EAAK,CAAE,sBAAuBQ,CAAS,CAAC,CAAC,CAAC,OAAOL,CAAK,CAC5E,CACF,EAGaM,EAAiB,GAAoB,CAChD,IAAMT,EAAMb,EAAAA,cAAcc,CAAM,EAChC,MAAQ,IACN,OAAO,SAASS,CAAK,EACjBrB,EAAAA,aAAaW,EAAK,CAChB,MAAO,UACP,sBAAuB,EACvB,sBAAuB,CACzB,CAAC,CAAC,CAAC,OAAOU,CAAK,EACf,GACR"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { LabelDictionary } from '../locale.cjs';
|
|
2
|
+
import { ShapeChartLabels, ShapeChartOptions } from './types.cjs';
|
|
3
|
+
export declare const SHAPE_LABELS: LabelDictionary<ShapeChartLabels>;
|
|
4
|
+
/** Texts of a chart: its `locale` (the page language by default) and `texts` overrides */
|
|
5
|
+
export declare const shapeLabels: (o: Pick<ShapeChartOptions, "locale" | "texts">) => ShapeChartLabels;
|
|
6
|
+
/** Replaces the `{key}` placeholders of a text */
|
|
7
|
+
export declare const interpolate: (template: string, values: Record<string, string | number>) => string;
|
|
8
|
+
/**
|
|
9
|
+
* Compact number of a locale: `1.23k` / `12.3万` / `1,2 k`; small values
|
|
10
|
+
* keep enough decimals to be told apart
|
|
11
|
+
*/
|
|
12
|
+
export declare const localeFormat: (locale?: string) => (value: number) => string;
|
|
13
|
+
/** Share 0-1 as a locale percent with one decimal: `40.0%`, `40,0 %` */
|
|
14
|
+
export declare const localePercent: (locale?: string) => (share: number) => string;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { LabelDictionary } from '../locale.js';
|
|
2
|
+
import { ShapeChartLabels, ShapeChartOptions } from './types.js';
|
|
3
|
+
export declare const SHAPE_LABELS: LabelDictionary<ShapeChartLabels>;
|
|
4
|
+
/** Texts of a chart: its `locale` (the page language by default) and `texts` overrides */
|
|
5
|
+
export declare const shapeLabels: (o: Pick<ShapeChartOptions, "locale" | "texts">) => ShapeChartLabels;
|
|
6
|
+
/** Replaces the `{key}` placeholders of a text */
|
|
7
|
+
export declare const interpolate: (template: string, values: Record<string, string | number>) => string;
|
|
8
|
+
/**
|
|
9
|
+
* Compact number of a locale: `1.23k` / `12.3万` / `1,2 k`; small values
|
|
10
|
+
* keep enough decimals to be told apart
|
|
11
|
+
*/
|
|
12
|
+
export declare const localeFormat: (locale?: string) => (value: number) => string;
|
|
13
|
+
/** Share 0-1 as a locale percent with one decimal: `40.0%`, `40,0 %` */
|
|
14
|
+
export declare const localePercent: (locale?: string) => (share: number) => string;
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { compactUnits as e, localeLabels as t, numberFormat as n, resolveLocale as r } from "../locale.js";
|
|
2
|
+
//#region src/engine/shapes/labels.ts
|
|
3
|
+
var i = {
|
|
4
|
+
en: {
|
|
5
|
+
noData: "No data",
|
|
6
|
+
value: "Value",
|
|
7
|
+
share: "Share",
|
|
8
|
+
ofFirstStage: "Of first stage",
|
|
9
|
+
conversion: "Conversion",
|
|
10
|
+
ofRange: "Of range",
|
|
11
|
+
ofName: "Of {name}",
|
|
12
|
+
incoming: "Incoming",
|
|
13
|
+
outgoing: "Outgoing",
|
|
14
|
+
max: "Max",
|
|
15
|
+
progress: "Progress",
|
|
16
|
+
target: "Target",
|
|
17
|
+
ofTarget: "Of target",
|
|
18
|
+
range: "Range",
|
|
19
|
+
series: "Series {index}",
|
|
20
|
+
pieChart: "Pie chart",
|
|
21
|
+
donutChart: "Donut chart",
|
|
22
|
+
roseChart: "Rose chart",
|
|
23
|
+
radarChart: "Radar chart",
|
|
24
|
+
gaugeChart: "Gauge",
|
|
25
|
+
gaugeChartNamed: "Gauge: {label}",
|
|
26
|
+
funnelChart: "Funnel chart",
|
|
27
|
+
treemapChart: "Treemap",
|
|
28
|
+
sankeyChart: "Sankey diagram",
|
|
29
|
+
sunburstChart: "Sunburst chart",
|
|
30
|
+
radialBarChart: "Radial bar chart",
|
|
31
|
+
calendarHeatmap: "Calendar heatmap",
|
|
32
|
+
bulletChart: "Bullet chart"
|
|
33
|
+
},
|
|
34
|
+
zh: {
|
|
35
|
+
noData: "暂无数据",
|
|
36
|
+
value: "数值",
|
|
37
|
+
share: "占比",
|
|
38
|
+
ofFirstStage: "占首阶段",
|
|
39
|
+
conversion: "转化率",
|
|
40
|
+
ofRange: "占量程",
|
|
41
|
+
ofName: "占{name}",
|
|
42
|
+
incoming: "流入",
|
|
43
|
+
outgoing: "流出",
|
|
44
|
+
max: "最大值",
|
|
45
|
+
progress: "进度",
|
|
46
|
+
target: "目标",
|
|
47
|
+
ofTarget: "目标达成",
|
|
48
|
+
range: "区间",
|
|
49
|
+
series: "系列 {index}",
|
|
50
|
+
pieChart: "饼图",
|
|
51
|
+
donutChart: "环形图",
|
|
52
|
+
roseChart: "玫瑰图",
|
|
53
|
+
radarChart: "雷达图",
|
|
54
|
+
gaugeChart: "仪表盘",
|
|
55
|
+
gaugeChartNamed: "仪表盘:{label}",
|
|
56
|
+
funnelChart: "漏斗图",
|
|
57
|
+
treemapChart: "矩形树图",
|
|
58
|
+
sankeyChart: "桑基图",
|
|
59
|
+
sunburstChart: "旭日图",
|
|
60
|
+
radialBarChart: "径向条形图",
|
|
61
|
+
calendarHeatmap: "日历热力图",
|
|
62
|
+
bulletChart: "子弹图"
|
|
63
|
+
},
|
|
64
|
+
ja: {
|
|
65
|
+
noData: "データなし",
|
|
66
|
+
value: "値",
|
|
67
|
+
share: "割合",
|
|
68
|
+
ofFirstStage: "初段階比",
|
|
69
|
+
conversion: "転換率",
|
|
70
|
+
ofRange: "範囲比",
|
|
71
|
+
ofName: "{name}比",
|
|
72
|
+
incoming: "流入",
|
|
73
|
+
outgoing: "流出",
|
|
74
|
+
max: "最大",
|
|
75
|
+
progress: "進捗",
|
|
76
|
+
target: "目標",
|
|
77
|
+
ofTarget: "目標達成率",
|
|
78
|
+
range: "範囲",
|
|
79
|
+
series: "系列 {index}",
|
|
80
|
+
pieChart: "円グラフ",
|
|
81
|
+
donutChart: "ドーナツグラフ",
|
|
82
|
+
roseChart: "鶏頭図",
|
|
83
|
+
radarChart: "レーダーチャート",
|
|
84
|
+
gaugeChart: "ゲージ",
|
|
85
|
+
gaugeChartNamed: "ゲージ:{label}",
|
|
86
|
+
funnelChart: "ファネルチャート",
|
|
87
|
+
treemapChart: "ツリーマップ",
|
|
88
|
+
sankeyChart: "サンキー図",
|
|
89
|
+
sunburstChart: "サンバースト図",
|
|
90
|
+
radialBarChart: "円形棒グラフ",
|
|
91
|
+
calendarHeatmap: "カレンダーヒートマップ",
|
|
92
|
+
bulletChart: "ブレットグラフ"
|
|
93
|
+
},
|
|
94
|
+
fr: {
|
|
95
|
+
noData: "Aucune donnée",
|
|
96
|
+
value: "Valeur",
|
|
97
|
+
share: "Part",
|
|
98
|
+
ofFirstStage: "Part de la 1re étape",
|
|
99
|
+
conversion: "Conversion",
|
|
100
|
+
ofRange: "Part de la plage",
|
|
101
|
+
ofName: "Part de {name}",
|
|
102
|
+
incoming: "Entrées",
|
|
103
|
+
outgoing: "Sorties",
|
|
104
|
+
max: "Max",
|
|
105
|
+
progress: "Progression",
|
|
106
|
+
target: "Objectif",
|
|
107
|
+
ofTarget: "Atteinte de l’objectif",
|
|
108
|
+
range: "Plage",
|
|
109
|
+
series: "Série {index}",
|
|
110
|
+
pieChart: "Graphique circulaire",
|
|
111
|
+
donutChart: "Graphique en anneau",
|
|
112
|
+
roseChart: "Diagramme de Nightingale",
|
|
113
|
+
radarChart: "Graphique radar",
|
|
114
|
+
gaugeChart: "Jauge",
|
|
115
|
+
gaugeChartNamed: "Jauge : {label}",
|
|
116
|
+
funnelChart: "Graphique en entonnoir",
|
|
117
|
+
treemapChart: "Treemap",
|
|
118
|
+
sankeyChart: "Diagramme de Sankey",
|
|
119
|
+
sunburstChart: "Diagramme en rayons de soleil",
|
|
120
|
+
radialBarChart: "Graphique à barres radiales",
|
|
121
|
+
calendarHeatmap: "Calendrier thermique",
|
|
122
|
+
bulletChart: "Graphique à puces"
|
|
123
|
+
}
|
|
124
|
+
}, a = (e) => t(i, e.locale, e.texts), o = (e, t) => e.replace(/\{(\w+)\}/g, (e, n) => n in t ? String(t[n]) : e), s = (t) => {
|
|
125
|
+
let i = r(t), a = e(i);
|
|
126
|
+
return (e) => {
|
|
127
|
+
if (!Number.isFinite(e)) return String(e);
|
|
128
|
+
if (Object.is(e, -0) || e === 0) return "0";
|
|
129
|
+
let t = Math.abs(e);
|
|
130
|
+
for (let [r, o] of a) if (t >= r) return n(i, { maximumFractionDigits: 2 }).format(e / r) + o;
|
|
131
|
+
if (t < 1e-4) return e.toExponential(1);
|
|
132
|
+
let r = Math.floor(Math.log10(t) + 1e-9), o = Math.min(6, Math.max(0, -r) + 2);
|
|
133
|
+
return n(i, { maximumFractionDigits: o }).format(e);
|
|
134
|
+
};
|
|
135
|
+
}, c = (e) => {
|
|
136
|
+
let t = r(e);
|
|
137
|
+
return (e) => Number.isFinite(e) ? n(t, {
|
|
138
|
+
style: "percent",
|
|
139
|
+
minimumFractionDigits: 1,
|
|
140
|
+
maximumFractionDigits: 1
|
|
141
|
+
}).format(e) : "–";
|
|
142
|
+
};
|
|
143
|
+
//#endregion
|
|
144
|
+
export { i as SHAPE_LABELS, o as interpolate, s as localeFormat, c as localePercent, a as shapeLabels };
|
|
145
|
+
|
|
146
|
+
//# sourceMappingURL=labels.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"labels.js","names":["SHAPE_LABELS","shapeLabels","localeLabels","o","interpolate","template","key","values","all","localeFormat","tag","resolveLocale","locale","units","compactUnits","value","abs","unit","suffix","numberFormat","magnitude","decimals","localePercent","share"],"sources":["../../../../../charts/src/engine/shapes/labels.ts"],"sourcesContent":["// Language of the shape charts: built-in texts (tooltip rows, accessible\n// names, \"No data\") and locale-aware number / percent formatting. The locale\n// is resolved on every layout, so a page language switch followed by a\n// re-render updates the texts.\n\nimport {\n compactUnits,\n localeLabels,\n numberFormat,\n resolveLocale,\n type LabelDictionary,\n} from \"../locale\";\nimport type { ShapeChartLabels, ShapeChartOptions } from \"./types\";\n\nexport const SHAPE_LABELS: LabelDictionary<ShapeChartLabels> = {\n en: {\n noData: \"No data\",\n value: \"Value\",\n share: \"Share\",\n ofFirstStage: \"Of first stage\",\n conversion: \"Conversion\",\n ofRange: \"Of range\",\n ofName: \"Of {name}\",\n incoming: \"Incoming\",\n outgoing: \"Outgoing\",\n max: \"Max\",\n progress: \"Progress\",\n target: \"Target\",\n ofTarget: \"Of target\",\n range: \"Range\",\n series: \"Series {index}\",\n pieChart: \"Pie chart\",\n donutChart: \"Donut chart\",\n roseChart: \"Rose chart\",\n radarChart: \"Radar chart\",\n gaugeChart: \"Gauge\",\n gaugeChartNamed: \"Gauge: {label}\",\n funnelChart: \"Funnel chart\",\n treemapChart: \"Treemap\",\n sankeyChart: \"Sankey diagram\",\n sunburstChart: \"Sunburst chart\",\n radialBarChart: \"Radial bar chart\",\n calendarHeatmap: \"Calendar heatmap\",\n bulletChart: \"Bullet chart\",\n },\n zh: {\n noData: \"暂无数据\",\n value: \"数值\",\n share: \"占比\",\n ofFirstStage: \"占首阶段\",\n conversion: \"转化率\",\n ofRange: \"占量程\",\n ofName: \"占{name}\",\n incoming: \"流入\",\n outgoing: \"流出\",\n max: \"最大值\",\n progress: \"进度\",\n target: \"目标\",\n ofTarget: \"目标达成\",\n range: \"区间\",\n series: \"系列 {index}\",\n pieChart: \"饼图\",\n donutChart: \"环形图\",\n roseChart: \"玫瑰图\",\n radarChart: \"雷达图\",\n gaugeChart: \"仪表盘\",\n gaugeChartNamed: \"仪表盘:{label}\",\n funnelChart: \"漏斗图\",\n treemapChart: \"矩形树图\",\n sankeyChart: \"桑基图\",\n sunburstChart: \"旭日图\",\n radialBarChart: \"径向条形图\",\n calendarHeatmap: \"日历热力图\",\n bulletChart: \"子弹图\",\n },\n ja: {\n noData: \"データなし\",\n value: \"値\",\n share: \"割合\",\n ofFirstStage: \"初段階比\",\n conversion: \"転換率\",\n ofRange: \"範囲比\",\n ofName: \"{name}比\",\n incoming: \"流入\",\n outgoing: \"流出\",\n max: \"最大\",\n progress: \"進捗\",\n target: \"目標\",\n ofTarget: \"目標達成率\",\n range: \"範囲\",\n series: \"系列 {index}\",\n pieChart: \"円グラフ\",\n donutChart: \"ドーナツグラフ\",\n roseChart: \"鶏頭図\",\n radarChart: \"レーダーチャート\",\n gaugeChart: \"ゲージ\",\n gaugeChartNamed: \"ゲージ:{label}\",\n funnelChart: \"ファネルチャート\",\n treemapChart: \"ツリーマップ\",\n sankeyChart: \"サンキー図\",\n sunburstChart: \"サンバースト図\",\n radialBarChart: \"円形棒グラフ\",\n calendarHeatmap: \"カレンダーヒートマップ\",\n bulletChart: \"ブレットグラフ\",\n },\n fr: {\n noData: \"Aucune donnée\",\n value: \"Valeur\",\n share: \"Part\",\n ofFirstStage: \"Part de la 1re étape\",\n conversion: \"Conversion\",\n ofRange: \"Part de la plage\",\n ofName: \"Part de {name}\",\n incoming: \"Entrées\",\n outgoing: \"Sorties\",\n max: \"Max\",\n progress: \"Progression\",\n target: \"Objectif\",\n ofTarget: \"Atteinte de l’objectif\",\n range: \"Plage\",\n series: \"Série {index}\",\n pieChart: \"Graphique circulaire\",\n donutChart: \"Graphique en anneau\",\n roseChart: \"Diagramme de Nightingale\",\n radarChart: \"Graphique radar\",\n gaugeChart: \"Jauge\",\n gaugeChartNamed: \"Jauge : {label}\",\n funnelChart: \"Graphique en entonnoir\",\n treemapChart: \"Treemap\",\n sankeyChart: \"Diagramme de Sankey\",\n sunburstChart: \"Diagramme en rayons de soleil\",\n radialBarChart: \"Graphique à barres radiales\",\n calendarHeatmap: \"Calendrier thermique\",\n bulletChart: \"Graphique à puces\",\n },\n};\n\n/** Texts of a chart: its `locale` (the page language by default) and `texts` overrides */\nexport const shapeLabels = (\n o: Pick<ShapeChartOptions, \"locale\" | \"texts\">,\n): ShapeChartLabels => localeLabels(SHAPE_LABELS, o.locale, o.texts);\n\n/** Replaces the `{key}` placeholders of a text */\nexport const interpolate = (\n template: string,\n values: Record<string, string | number>,\n): string =>\n template.replace(/\\{(\\w+)\\}/g, (all, key: string) =>\n key in values ? String(values[key]) : all,\n );\n\n/**\n * Compact number of a locale: `1.23k` / `12.3万` / `1,2 k`; small values\n * keep enough decimals to be told apart\n */\nexport const localeFormat = (locale?: string) => {\n const tag = resolveLocale(locale);\n const units = compactUnits(tag);\n return (value: number): string => {\n if (!Number.isFinite(value)) return String(value);\n if (Object.is(value, -0) || value === 0) return \"0\";\n const abs = Math.abs(value);\n for (const [unit, suffix] of units)\n if (abs >= unit)\n return (\n numberFormat(tag, { maximumFractionDigits: 2 }).format(value / unit) +\n suffix\n );\n if (abs < 1e-4) return value.toExponential(1);\n // at least two decimals, two more than the magnitude (0.0123, 1.25)\n const magnitude = Math.floor(Math.log10(abs) + 1e-9);\n const decimals = Math.min(6, Math.max(0, -magnitude) + 2);\n return numberFormat(tag, { maximumFractionDigits: decimals }).format(value);\n };\n};\n\n/** Share 0-1 as a locale percent with one decimal: `40.0%`, `40,0 %` */\nexport const localePercent = (locale?: string) => {\n const tag = resolveLocale(locale);\n return (share: number): string =>\n Number.isFinite(share)\n ? numberFormat(tag, {\n style: \"percent\",\n minimumFractionDigits: 1,\n maximumFractionDigits: 1,\n }).format(share)\n : \"–\";\n};\n"],"mappings":";;AAcA,IAAaA,IAAkD;CAC7D,IAAI;EACF,QAAQ;EACR,OAAO;EACP,OAAO;EACP,cAAc;EACd,YAAY;EACZ,SAAS;EACT,QAAQ;EACR,UAAU;EACV,UAAU;EACV,KAAK;EACL,UAAU;EACV,QAAQ;EACR,UAAU;EACV,OAAO;EACP,QAAQ;EACR,UAAU;EACV,YAAY;EACZ,WAAW;EACX,YAAY;EACZ,YAAY;EACZ,iBAAiB;EACjB,aAAa;EACb,cAAc;EACd,aAAa;EACb,eAAe;EACf,gBAAgB;EAChB,iBAAiB;EACjB,aAAa;CACf;CACA,IAAI;EACF,QAAQ;EACR,OAAO;EACP,OAAO;EACP,cAAc;EACd,YAAY;EACZ,SAAS;EACT,QAAQ;EACR,UAAU;EACV,UAAU;EACV,KAAK;EACL,UAAU;EACV,QAAQ;EACR,UAAU;EACV,OAAO;EACP,QAAQ;EACR,UAAU;EACV,YAAY;EACZ,WAAW;EACX,YAAY;EACZ,YAAY;EACZ,iBAAiB;EACjB,aAAa;EACb,cAAc;EACd,aAAa;EACb,eAAe;EACf,gBAAgB;EAChB,iBAAiB;EACjB,aAAa;CACf;CACA,IAAI;EACF,QAAQ;EACR,OAAO;EACP,OAAO;EACP,cAAc;EACd,YAAY;EACZ,SAAS;EACT,QAAQ;EACR,UAAU;EACV,UAAU;EACV,KAAK;EACL,UAAU;EACV,QAAQ;EACR,UAAU;EACV,OAAO;EACP,QAAQ;EACR,UAAU;EACV,YAAY;EACZ,WAAW;EACX,YAAY;EACZ,YAAY;EACZ,iBAAiB;EACjB,aAAa;EACb,cAAc;EACd,aAAa;EACb,eAAe;EACf,gBAAgB;EAChB,iBAAiB;EACjB,aAAa;CACf;CACA,IAAI;EACF,QAAQ;EACR,OAAO;EACP,OAAO;EACP,cAAc;EACd,YAAY;EACZ,SAAS;EACT,QAAQ;EACR,UAAU;EACV,UAAU;EACV,KAAK;EAC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AAuB;CACzB,CAAC,CAAC,CAAC,OAAOa,CAAK,IACf;AACR"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
const e=require("../color.cjs"),t=require("../
|
|
2
|
-
`);let n
|
|
1
|
+
const e=require("../color.cjs"),t=require("../locale.cjs"),n=require("../overlay.cjs"),r=require("./labels.cjs"),i=require("./scene.cjs"),a=require("./calendar.cjs"),o=require("./bullet.cjs"),s=require("./funnel.cjs"),c=require("./gauge.cjs"),l=require("./pie.cjs"),u=require("./radar.cjs"),d=require("./radialBar.cjs"),f=require("./sankey.cjs"),p=require("./sunburst.cjs"),m=require("./treemap.cjs");var h=new Set,g=[],_=e=>{let{options:n,theme:_,width:v,height:y}=e,b=e.bounds??{x:0,y:0,width:v,height:y},x=e.from??null,S=i.clamp(e.t??1,0,1),C=_.palette.length?_.palette:[_.primary],w=t.resolveLocale(n.locale),T=r.shapeLabels(n),E={theme:_,measure:e.measure,hidden:e.hidden??h,enter:i.clamp(e.enter??1,0,1),value:(e,t)=>{if(!x||S>=1)return t;let n=x.get(e)??0;return n+(t-n)*S},format:n.format??r.localeFormat(w),percent:n.percentFormat??r.localePercent(w),labels:T,locale:w,color:(e,t)=>i.resolveWith(_,e,C[t%C.length]),area:i.inset(b,n.padding),focus:e.focus??g},D;switch(n.type){case`pie`:D=l.layoutPie(n,E);break;case`radar`:D=u.layoutRadar(n,E);break;case`gauge`:D=c.layoutGauge(n,E);break;case`funnel`:D=s.layoutFunnel(n,E);break;case`sankey`:D=f.layoutSankey(n,E);break;case`sunburst`:D=p.layoutSunburst(n,E);break;case`radialBar`:D=d.layoutRadialBar(n,E);break;case`calendarHeatmap`:D=a.layoutCalendar(n,E);break;case`bullet`:D=o.layoutBullet(n,E);break;default:D=m.layoutTreemap(n,E)}return{type:n.type,width:v,height:y,labels:T,locale:w,...D}},v=(e,t=h,n=g)=>{let r=new Map;switch(e.type){case`pie`:l.pieValues(e,t,r);break;case`radar`:u.radarValues(e,t,r);break;case`gauge`:c.gaugeValues(e,t,r);break;case`funnel`:s.funnelValues(e,t,r);break;case`sankey`:f.sankeyValues(e,t,r);break;case`sunburst`:p.sunburstValues(e,t,n,r);break;case`radialBar`:d.radialBarValues(e,t,r);break;case`calendarHeatmap`:a.calendarValues(e,t,r);break;case`bullet`:o.bulletValues(e,t,r);break;default:m.treemapValues(e,t,r)}return r},y=(e,t,n)=>{let r=new Map;return t.forEach((t,i)=>{let a=e.get(i)??0;r.set(i,a+(t-a)*n)}),r},b=(e,t)=>{if(e.size!==t.size)return!1;for(let[n,r]of e){let e=t.get(n);if(e===void 0||Math.abs(e-r)>1e-12)return!1}return!0},x=e=>{let t=typeof e.legend==`object`?e.legend:{};return{position:t.position??`bottom`,toggle:t.toggle??!0}},S=(t,n,o=h)=>{if(t.legend===!1)return null;let c=n.palette.length?n.palette:[n.primary],l=(t,r)=>e.toCss(i.resolveWith(n,t,c[r%c.length])),p=[],m=t.legend!==void 0;switch(t.type){case`pie`:m=!0,p=t.data.map((e,t)=>({index:t,name:e.name,color:l(e.color,t),hidden:o.has(t)}));break;case`funnel`:m=!0,p=s.funnelOrder(t,h).map(e=>({index:e,name:t.data[e].name,color:l(t.data[e].color,e),hidden:o.has(e)}));break;case`radar`:m||(m=t.series.length>1),p=t.series.map((e,n)=>({index:n,name:u.seriesName(t,n,r.shapeLabels(t)),color:l(e.color,n),hidden:o.has(n)}));break;case`treemap`:case`sunburst`:p=t.data.map((e,t)=>({index:t,name:e.name,color:l(e.color,t),hidden:o.has(t)}));break;case`radialBar`:m||(m=!d.radialBarLabels(t)),p=t.data.map((e,t)=>({index:t,name:e.name,color:l(e.color,t),hidden:o.has(t)}));break;case`bullet`:p=t.data.map((e,t)=>({index:t,name:e.name,color:l(e.color,t),hidden:o.has(t)}));break;case`sankey`:{let e=f.resolveSankey(t);p=e.names.map((t,n)=>({index:n,name:t,color:l(e.colors[n],n),hidden:o.has(n)}));break}case`calendarHeatmap`:m=!0,p=a.calendarLegend(t,n,o)}return m&&p.length?p:null},C=e=>{switch(e.type){case`radar`:return e.series.length;case`gauge`:return 0;case`sankey`:return f.resolveSankey(e).names.length;case`calendarHeatmap`:return a.calendarModel(e)?.count??0;default:return e.data.length}},w=(e,t)=>{if(!t)return null;let n=e.items.find(e=>e.index===t.index);if(!n)return null;if(n.indicators){let e=i.clamp(t.indicator??0,0,n.indicators.length-1),r=n.indicators[e];return{index:n.index,indicator:e,name:n.name,value:r.value,percent:r.percent,color:n.color}}return{index:n.index,name:n.name,value:n.value,percent:n.percent,color:n.color,...n.path?{path:n.path}:{},...n.event}},T=(e,t)=>e===t||!!e&&!!t&&e.index===t.index&&e.indicator===t.indicator,E=(e,t)=>{let n=e.items.find(e=>e.index===t.index);if(!n)return null;let r=n.indicators?n.rows.map((e,n)=>n===(t.indicator??-1)?{...e,strong:!0}:e):n.rows;return{title:n.path?n.path.join(` / `):n.name,color:n.color,rows:r}},D=(e,t)=>{let n=e.items.find(e=>e.index===t.index);if(!n)return``;if(n.indicators){let e=i.clamp(t.indicator??0,0,n.indicators.length-1);return`${n.name}, ${n.indicators[e].name}: ${n.rows[e]?.value??n.indicators[e].value}`}return`${n.path?n.path.join(` / `):n.name}: ${n.rows[0]?.value??n.value} (${n.share??r.localePercent(e.locale)(n.percent)})`},O=e=>{let t=r.shapeLabels(e);switch(e.type){case`pie`:return e.rose?t.roseChart:(e.innerRadius??0)>0?t.donutChart:t.pieChart;case`radar`:return t.radarChart;case`gauge`:return e.label?r.interpolate(t.gaugeChartNamed,{label:e.label}):t.gaugeChart;case`funnel`:return t.funnelChart;case`sankey`:return t.sankeyChart;case`sunburst`:return t.sunburstChart;case`radialBar`:return t.radialBarChart;case`calendarHeatmap`:return t.calendarHeatmap;case`bullet`:return t.bulletChart;default:return t.treemapChart}},k=e=>e.empty?(e.labels??r.SHAPE_LABELS.en).noData:e.items.slice(0,12).map(t=>t.indicators?`${t.name}: ${t.indicators.map((e,n)=>`${e.name} ${t.rows[n]?.value??e.value}`).join(`, `)}`:D(e,{index:t.index})).join(`; `),A=20,j=(e,t,r,i,a,o)=>{let s=n.font(a,12),c=[[]],l=0;for(let n of e){let e=Math.min(t-8,16+o(n.name,s)),r=c[c.length-1];r.length&&l+14+e>t-8&&(c.push(r=[]),l=0),r.length&&(l+=14),r.push({...n,x:l,y:0,width:e,height:A}),l+=e}let u=c.length*A+8,d=r===`top`?2:i-u+6,f=[];return c.forEach((e,n)=>{let r=e[e.length-1],i=(t-(r?r.x+r.width:0))/2;for(let t of e)f.push({...t,x:t.x+i,y:d+n*A})}),{boxes:f,height:u}},M=6,N=14,P=(e,t)=>Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x))*Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y)),F=(e,t,n,r,i,a,o)=>{let s=M,c=(e,t)=>({x:Math.max(s,Math.min(e,a-r-s)),y:Math.max(s,Math.min(t,o-i-s))}),{x:l,y:u}=n,d=e?.radar;if(!d||!e||!t){let e=l+16;return e+r>a-s&&(e=l-16-r),c(e,u-i/2)}let f=[[l,u]],p=e.items.find(e=>e.index===t.index),m=p?.indicators&&t.indicator!==void 0?p.indicators[t.indicator]:void 0;m&&f.push([m.x,m.y]);let h=d.labels??[],g=l-d.cx,_=u-d.cy,v=Math.hypot(g,_);v>1?(g/=v,_/=v):(g=1,_=0);let y=N,b=[[l+y,u-i/2],[l-y-r,u-i/2],[l-r/2,u-y-i],[l-r/2,u+y],[l+y,u-y-i],[l+y,u+y],[l-y-r,u-y-i],[l-y-r,u+y]],x=c(b[0][0],b[0][1]),S=1/0;for(let[e,t]of b){let n=c(e,t),a={x:n.x,y:n.y,width:r,height:i},o=0;for(let[e,t]of f)e>a.x-8&&e<a.x+r+8&&t>a.y-8&&t<a.y+i+8&&(o+=1e6);for(let e of h)o+=P(a,e)*4;let s=n.x+r/2-l,d=n.y+i/2-u,p=Math.hypot(s,d)||1;o+=p*.5,o-=(s*g+d*_)/p*40,o+=Math.abs(n.x-e)+Math.abs(n.y-t),o<S&&(S=o,x=n)}return x},I=(e,t,r,i,a,o,s,c=null,l=null)=>{let u=0,d,f,p;if(typeof e==`string`){p=e.split(`
|
|
2
|
+
`);let t=n.font(o,12);for(let e of p)u=Math.max(u,s(e,t));d=p.length}else{f=e,u=(e.color?14:0)+s(e.title,n.font(o,12,600));for(let t of e.rows)u=Math.max(u,(t.color?14:0)+s(t.name,n.font(o,12))+16+s(t.value,n.font(o,12,600)));d=1+e.rows.length}let m=Math.max(96,Math.ceil(u+18+4)),h=d*18+18,{x:g,y:_}=F(c,l,{x:t,y:r},m,h,i,a);return{x:g,y:_,width:m,height:h,padding:9,lineHeight:18,...f?{content:f}:{},...p?{text:p}:{}}};exports.blendValues=y,exports.describeChart=O,exports.describeItem=D,exports.describeScene=k,exports.hoverEvent=w,exports.layoutShapeLegend=j,exports.layoutShapeScene=_,exports.layoutShapeTooltip=I,exports.legendConfig=x,exports.placeShapeTooltip=F,exports.sameHover=T,exports.sameValues=b,exports.shapeLegend=S,exports.shapeValues=v,exports.toggleCount=C,exports.tooltipContent=E;
|
|
3
3
|
//# sourceMappingURL=layout.cjs.map
|