minerva-design 1.5.0 → 1.6.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 +6 -0
- package/custom-elements.json +122 -5
- package/dist/angular/fesm2022/minerva-angular.mjs +55 -0
- package/dist/angular/fesm2022/minerva-angular.mjs.map +1 -1
- package/dist/angular/types/minerva-angular.d.ts +23 -2
- package/dist/charts/canvas.d.cts +2 -1
- package/dist/charts/canvas.d.ts +2 -1
- package/dist/charts/core.d.cts +1 -1
- package/dist/charts/core.d.ts +1 -1
- package/dist/charts/engine/canvas.cjs +1 -1
- package/dist/charts/engine/canvas.cjs.map +1 -1
- package/dist/charts/engine/canvas.js +2 -1
- 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.js +144 -143
- package/dist/charts/engine/chart.js.map +1 -1
- package/dist/charts/engine/controller.cjs +2 -2
- package/dist/charts/engine/controller.cjs.map +1 -1
- package/dist/charts/engine/controller.d.cts +3 -1
- package/dist/charts/engine/controller.d.ts +3 -1
- package/dist/charts/engine/controller.js +130 -132
- package/dist/charts/engine/controller.js.map +1 -1
- package/dist/charts/engine/defaults.cjs.map +1 -1
- package/dist/charts/engine/defaults.d.cts +4 -4
- package/dist/charts/engine/defaults.d.ts +4 -4
- package/dist/charts/engine/defaults.js.map +1 -1
- package/dist/charts/engine/graph/chart.cjs +1 -1
- package/dist/charts/engine/graph/chart.cjs.map +1 -1
- package/dist/charts/engine/graph/chart.js +740 -597
- package/dist/charts/engine/graph/chart.js.map +1 -1
- package/dist/charts/engine/graph/dag.cjs +1 -1
- package/dist/charts/engine/graph/dag.cjs.map +1 -1
- package/dist/charts/engine/graph/dag.js +191 -166
- package/dist/charts/engine/graph/dag.js.map +1 -1
- package/dist/charts/engine/graph/force.cjs +1 -1
- package/dist/charts/engine/graph/force.cjs.map +1 -1
- package/dist/charts/engine/graph/force.d.cts +9 -0
- package/dist/charts/engine/graph/force.d.ts +9 -0
- package/dist/charts/engine/graph/force.js +279 -181
- package/dist/charts/engine/graph/force.js.map +1 -1
- package/dist/charts/engine/graph/geometry.cjs +1 -1
- package/dist/charts/engine/graph/geometry.cjs.map +1 -1
- package/dist/charts/engine/graph/geometry.d.cts +14 -1
- package/dist/charts/engine/graph/geometry.d.ts +14 -1
- package/dist/charts/engine/graph/geometry.js +77 -24
- package/dist/charts/engine/graph/geometry.js.map +1 -1
- package/dist/charts/engine/graph/model.cjs +1 -1
- package/dist/charts/engine/graph/model.cjs.map +1 -1
- package/dist/charts/engine/graph/model.d.cts +9 -0
- package/dist/charts/engine/graph/model.d.ts +9 -0
- package/dist/charts/engine/graph/model.js +63 -43
- package/dist/charts/engine/graph/model.js.map +1 -1
- package/dist/charts/engine/graph/types.d.cts +14 -0
- package/dist/charts/engine/graph/types.d.ts +14 -0
- package/dist/charts/engine/graph/worker.cjs +12 -6
- package/dist/charts/engine/graph/worker.cjs.map +1 -1
- package/dist/charts/engine/graph/worker.js +12 -6
- package/dist/charts/engine/graph/worker.js.map +1 -1
- package/dist/charts/engine/labels.cjs.map +1 -1
- package/dist/charts/engine/labels.d.cts +17 -0
- package/dist/charts/engine/labels.d.ts +17 -0
- package/dist/charts/engine/labels.js.map +1 -1
- package/dist/charts/engine/model.cjs +1 -1
- package/dist/charts/engine/model.cjs.map +1 -1
- package/dist/charts/engine/model.d.cts +33 -0
- package/dist/charts/engine/model.d.ts +33 -0
- package/dist/charts/engine/model.js +149 -126
- package/dist/charts/engine/model.js.map +1 -1
- package/dist/charts/engine/orderbook/field.cjs +37 -0
- package/dist/charts/engine/orderbook/field.cjs.map +1 -0
- package/dist/charts/engine/orderbook/field.d.cts +92 -0
- package/dist/charts/engine/orderbook/field.d.ts +92 -0
- package/dist/charts/engine/orderbook/field.js +297 -0
- package/dist/charts/engine/orderbook/field.js.map +1 -0
- package/dist/charts/engine/orderbook/heatmap.cjs +1 -1
- package/dist/charts/engine/orderbook/heatmap.cjs.map +1 -1
- package/dist/charts/engine/orderbook/heatmap.js +413 -441
- package/dist/charts/engine/orderbook/heatmap.js.map +1 -1
- package/dist/charts/engine/orderbook/host.cjs +1 -1
- package/dist/charts/engine/orderbook/host.cjs.map +1 -1
- package/dist/charts/engine/orderbook/host.d.cts +8 -1
- package/dist/charts/engine/orderbook/host.d.ts +8 -1
- package/dist/charts/engine/orderbook/host.js +27 -5
- package/dist/charts/engine/orderbook/host.js.map +1 -1
- package/dist/charts/engine/orderbook/ladder.cjs +1 -1
- package/dist/charts/engine/orderbook/ladder.cjs.map +1 -1
- package/dist/charts/engine/orderbook/ladder.js +1 -1
- package/dist/charts/engine/orderbook/ladder.js.map +1 -1
- package/dist/charts/engine/orderbook/layout.cjs +1 -1
- package/dist/charts/engine/orderbook/layout.cjs.map +1 -1
- package/dist/charts/engine/orderbook/layout.d.cts +5 -0
- package/dist/charts/engine/orderbook/layout.d.ts +5 -0
- package/dist/charts/engine/orderbook/layout.js +8 -2
- package/dist/charts/engine/orderbook/layout.js.map +1 -1
- package/dist/charts/engine/orderbook/tape.cjs +1 -1
- package/dist/charts/engine/orderbook/tape.cjs.map +1 -1
- package/dist/charts/engine/orderbook/tape.js +3 -3
- package/dist/charts/engine/orderbook/tape.js.map +1 -1
- package/dist/charts/engine/orderbook/types.d.cts +12 -4
- package/dist/charts/engine/orderbook/types.d.ts +12 -4
- package/dist/charts/engine/overlay.cjs +1 -1
- package/dist/charts/engine/overlay.cjs.map +1 -1
- package/dist/charts/engine/overlay.d.cts +17 -0
- package/dist/charts/engine/overlay.d.ts +17 -0
- package/dist/charts/engine/overlay.js +29 -13
- package/dist/charts/engine/overlay.js.map +1 -1
- package/dist/charts/engine/presets.cjs +1 -1
- package/dist/charts/engine/presets.cjs.map +1 -1
- package/dist/charts/engine/presets.d.cts +12 -2
- package/dist/charts/engine/presets.d.ts +12 -2
- package/dist/charts/engine/presets.js +8 -2
- package/dist/charts/engine/presets.js.map +1 -1
- package/dist/charts/engine/renderers/canvas2d.cjs +1 -1
- package/dist/charts/engine/renderers/canvas2d.cjs.map +1 -1
- package/dist/charts/engine/renderers/canvas2d.js +13 -9
- package/dist/charts/engine/renderers/canvas2d.js.map +1 -1
- package/dist/charts/engine/renderers/follow.cjs +2 -0
- package/dist/charts/engine/renderers/follow.cjs.map +1 -0
- package/dist/charts/engine/renderers/follow.d.cts +8 -0
- package/dist/charts/engine/renderers/follow.d.ts +8 -0
- package/dist/charts/engine/renderers/follow.js +10 -0
- package/dist/charts/engine/renderers/follow.js.map +1 -0
- package/dist/charts/engine/renderers/gl-budget.cjs +2 -0
- package/dist/charts/engine/renderers/gl-budget.cjs.map +1 -0
- package/dist/charts/engine/renderers/gl-budget.d.cts +32 -0
- package/dist/charts/engine/renderers/gl-budget.d.ts +32 -0
- package/dist/charts/engine/renderers/gl-budget.js +95 -0
- package/dist/charts/engine/renderers/gl-budget.js.map +1 -0
- package/dist/charts/engine/renderers/gl.cjs +1 -1
- package/dist/charts/engine/renderers/gl.cjs.map +1 -1
- package/dist/charts/engine/renderers/gl.js +1 -1
- package/dist/charts/engine/renderers/gl.js.map +1 -1
- package/dist/charts/engine/renderers/shaders.cjs +9 -6
- package/dist/charts/engine/renderers/shaders.cjs.map +1 -1
- package/dist/charts/engine/renderers/shaders.d.cts +1 -1
- package/dist/charts/engine/renderers/shaders.d.ts +1 -1
- package/dist/charts/engine/renderers/shaders.js +9 -6
- package/dist/charts/engine/renderers/shaders.js.map +1 -1
- package/dist/charts/engine/renderers/types.cjs.map +1 -1
- package/dist/charts/engine/renderers/types.d.cts +2 -0
- package/dist/charts/engine/renderers/types.d.ts +2 -0
- package/dist/charts/engine/renderers/types.js.map +1 -1
- package/dist/charts/engine/renderers/webgl.cjs +1 -1
- package/dist/charts/engine/renderers/webgl.cjs.map +1 -1
- package/dist/charts/engine/renderers/webgl.js +85 -64
- package/dist/charts/engine/renderers/webgl.js.map +1 -1
- 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.js +72 -58
- package/dist/charts/engine/renderers/webgl2.js.map +1 -1
- package/dist/charts/engine/renderers/webgpu.cjs +1 -1
- package/dist/charts/engine/renderers/webgpu.cjs.map +1 -1
- package/dist/charts/engine/renderers/webgpu.js +1 -1
- package/dist/charts/engine/renderers/webgpu.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 +51 -4
- package/dist/charts/engine/scene.d.ts +51 -4
- package/dist/charts/engine/scene.js +188 -122
- package/dist/charts/engine/scene.js.map +1 -1
- package/dist/charts/engine/shapes/chord.cjs +1 -1
- package/dist/charts/engine/shapes/chord.cjs.map +1 -1
- package/dist/charts/engine/shapes/chord.js +108 -103
- package/dist/charts/engine/shapes/chord.js.map +1 -1
- package/dist/charts/engine/shapes/types.d.cts +5 -3
- package/dist/charts/engine/shapes/types.d.ts +5 -3
- package/dist/charts/engine/three-d/canvas2d.cjs +1 -1
- package/dist/charts/engine/three-d/canvas2d.cjs.map +1 -1
- package/dist/charts/engine/three-d/canvas2d.d.cts +36 -1
- package/dist/charts/engine/three-d/canvas2d.d.ts +36 -1
- package/dist/charts/engine/three-d/canvas2d.js +155 -80
- package/dist/charts/engine/three-d/canvas2d.js.map +1 -1
- package/dist/charts/engine/three-d/chart.cjs +1 -1
- package/dist/charts/engine/three-d/chart.cjs.map +1 -1
- package/dist/charts/engine/three-d/chart.js +219 -215
- package/dist/charts/engine/three-d/chart.js.map +1 -1
- package/dist/charts/engine/three-d/oit.cjs +109 -0
- package/dist/charts/engine/three-d/oit.cjs.map +1 -0
- package/dist/charts/engine/three-d/oit.d.cts +34 -0
- package/dist/charts/engine/three-d/oit.d.ts +34 -0
- package/dist/charts/engine/three-d/oit.js +111 -0
- package/dist/charts/engine/three-d/oit.js.map +1 -0
- package/dist/charts/engine/three-d/render-types.cjs +1 -1
- package/dist/charts/engine/three-d/render-types.cjs.map +1 -1
- package/dist/charts/engine/three-d/render-types.d.cts +16 -3
- package/dist/charts/engine/three-d/render-types.d.ts +16 -3
- package/dist/charts/engine/three-d/render-types.js +6 -9
- package/dist/charts/engine/three-d/render-types.js.map +1 -1
- package/dist/charts/engine/three-d/shaders.cjs +52 -26
- package/dist/charts/engine/three-d/shaders.cjs.map +1 -1
- package/dist/charts/engine/three-d/shaders.d.cts +11 -3
- package/dist/charts/engine/three-d/shaders.d.ts +11 -3
- package/dist/charts/engine/three-d/shaders.js +84 -40
- package/dist/charts/engine/three-d/shaders.js.map +1 -1
- package/dist/charts/engine/three-d/sort.cjs +1 -1
- package/dist/charts/engine/three-d/sort.cjs.map +1 -1
- package/dist/charts/engine/three-d/sort.d.cts +6 -4
- package/dist/charts/engine/three-d/sort.d.ts +6 -4
- package/dist/charts/engine/three-d/sort.js +51 -39
- package/dist/charts/engine/three-d/sort.js.map +1 -1
- package/dist/charts/engine/three-d/types.d.cts +9 -0
- package/dist/charts/engine/three-d/types.d.ts +9 -0
- package/dist/charts/engine/three-d/webgl.cjs +1 -1
- package/dist/charts/engine/three-d/webgl.cjs.map +1 -1
- package/dist/charts/engine/three-d/webgl.d.cts +9 -0
- package/dist/charts/engine/three-d/webgl.d.ts +9 -0
- package/dist/charts/engine/three-d/webgl.js +199 -76
- package/dist/charts/engine/three-d/webgl.js.map +1 -1
- package/dist/charts/engine/three-d/webgpu.cjs +1 -1
- package/dist/charts/engine/three-d/webgpu.cjs.map +1 -1
- package/dist/charts/engine/three-d/webgpu.js +225 -99
- package/dist/charts/engine/three-d/webgpu.js.map +1 -1
- package/dist/charts/engine/trading/chart.cjs +1 -1
- package/dist/charts/engine/trading/chart.cjs.map +1 -1
- package/dist/charts/engine/trading/chart.d.cts +0 -1
- package/dist/charts/engine/trading/chart.d.ts +0 -1
- package/dist/charts/engine/trading/chart.js +1048 -883
- package/dist/charts/engine/trading/chart.js.map +1 -1
- package/dist/charts/engine/trading/drawings.cjs +2 -2
- package/dist/charts/engine/trading/drawings.cjs.map +1 -1
- package/dist/charts/engine/trading/drawings.d.cts +6 -0
- package/dist/charts/engine/trading/drawings.d.ts +6 -0
- package/dist/charts/engine/trading/drawings.js +100 -88
- package/dist/charts/engine/trading/drawings.js.map +1 -1
- package/dist/charts/engine/trading/format.cjs +1 -1
- package/dist/charts/engine/trading/format.cjs.map +1 -1
- package/dist/charts/engine/trading/format.d.cts +6 -0
- package/dist/charts/engine/trading/format.d.ts +6 -0
- package/dist/charts/engine/trading/format.js +42 -30
- package/dist/charts/engine/trading/format.js.map +1 -1
- package/dist/charts/engine/trading/geometry.cjs +1 -1
- package/dist/charts/engine/trading/geometry.cjs.map +1 -1
- package/dist/charts/engine/trading/geometry.d.cts +16 -0
- package/dist/charts/engine/trading/geometry.d.ts +16 -0
- package/dist/charts/engine/trading/geometry.js +19 -4
- package/dist/charts/engine/trading/geometry.js.map +1 -1
- package/dist/charts/engine/trading/labels.cjs +1 -1
- package/dist/charts/engine/trading/labels.cjs.map +1 -1
- package/dist/charts/engine/trading/labels.js +24 -4
- package/dist/charts/engine/trading/labels.js.map +1 -1
- package/dist/charts/engine/trading/studies.cjs +1 -1
- package/dist/charts/engine/trading/studies.cjs.map +1 -1
- package/dist/charts/engine/trading/studies.d.cts +8 -0
- package/dist/charts/engine/trading/studies.d.ts +8 -0
- package/dist/charts/engine/trading/studies.js +4 -1
- package/dist/charts/engine/trading/studies.js.map +1 -1
- package/dist/charts/engine/trading/types.d.cts +34 -11
- package/dist/charts/engine/trading/types.d.ts +34 -11
- package/dist/charts/engine/types.d.cts +25 -4
- package/dist/charts/engine/types.d.ts +25 -4
- package/dist/charts/react/charts.cjs +1 -1
- package/dist/charts/react/charts.cjs.map +1 -1
- package/dist/charts/react/charts.js +20 -15
- package/dist/charts/react/charts.js.map +1 -1
- package/dist/charts/react/graph.cjs +1 -1
- package/dist/charts/react/graph.cjs.map +1 -1
- package/dist/charts/react/graph.d.cts +6 -0
- package/dist/charts/react/graph.d.ts +6 -0
- package/dist/charts/react/graph.js +28 -27
- package/dist/charts/react/graph.js.map +1 -1
- package/dist/charts/react/orderbook.cjs +1 -1
- package/dist/charts/react/orderbook.cjs.map +1 -1
- package/dist/charts/react/orderbook.d.cts +3 -1
- package/dist/charts/react/orderbook.d.ts +3 -1
- package/dist/charts/react/orderbook.js +1 -0
- package/dist/charts/react/orderbook.js.map +1 -1
- package/dist/charts/react/shapes.cjs.map +1 -1
- package/dist/charts/react/shapes.d.cts +4 -3
- package/dist/charts/react/shapes.d.ts +4 -3
- package/dist/charts/react/shapes.js.map +1 -1
- package/dist/charts/react/three-d.cjs +1 -1
- package/dist/charts/react/three-d.cjs.map +1 -1
- package/dist/charts/react/three-d.d.cts +7 -0
- package/dist/charts/react/three-d.d.ts +7 -0
- package/dist/charts/react/three-d.js +14 -13
- package/dist/charts/react/three-d.js.map +1 -1
- package/dist/charts/react/trading.cjs.map +1 -1
- package/dist/charts/react/trading.d.cts +3 -3
- package/dist/charts/react/trading.d.ts +3 -3
- package/dist/charts/react/trading.js.map +1 -1
- 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 +4 -3
- package/dist/native/charts/src/engine/controller.cjs +2 -2
- package/dist/native/charts/src/engine/controller.cjs.map +1 -1
- package/dist/native/charts/src/engine/controller.js +102 -104
- package/dist/native/charts/src/engine/controller.js.map +1 -1
- package/dist/native/charts/src/engine/labels.cjs +1 -1
- package/dist/native/charts/src/engine/labels.cjs.map +1 -1
- package/dist/native/charts/src/engine/labels.js +14 -1
- package/dist/native/charts/src/engine/labels.js.map +1 -1
- 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 +180 -157
- package/dist/native/charts/src/engine/model.js.map +1 -1
- package/dist/native/charts/src/engine/overlay.cjs.map +1 -1
- package/dist/native/charts/src/engine/overlay.js.map +1 -1
- package/dist/native/charts/src/engine/presets.cjs +1 -1
- package/dist/native/charts/src/engine/presets.cjs.map +1 -1
- package/dist/native/charts/src/engine/presets.js +8 -2
- package/dist/native/charts/src/engine/presets.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 +188 -122
- package/dist/native/charts/src/engine/scene.js.map +1 -1
- package/dist/native/charts/src/engine/shapes/chord.cjs +1 -1
- package/dist/native/charts/src/engine/shapes/chord.cjs.map +1 -1
- package/dist/native/charts/src/engine/shapes/chord.js +108 -103
- package/dist/native/charts/src/engine/shapes/chord.js.map +1 -1
- package/dist/native/charts/src/engine/shapes/layout.cjs +2 -2
- package/dist/native/charts/src/engine/shapes/layout.cjs.map +1 -1
- package/dist/native/charts/src/engine/shapes/layout.js +88 -73
- package/dist/native/charts/src/engine/shapes/layout.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.js +127 -115
- 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.js +8 -5
- package/dist/native/components/Chart/charts.js.map +1 -1
- 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.d.cts +6 -1
- package/dist/native/components/Chart/scene.d.ts +6 -1
- package/dist/native/components/Chart/scene.js +99 -50
- package/dist/native/components/Chart/scene.js.map +1 -1
- package/dist/native/components/Chart/types.d.cts +7 -1
- package/dist/native/components/Chart/types.d.ts +7 -1
- package/dist/native/components/Charts/charts.cjs +1 -1
- package/dist/native/components/Charts/charts.cjs.map +1 -1
- package/dist/native/components/Charts/charts.js +23 -18
- package/dist/native/components/Charts/charts.js.map +1 -1
- package/dist/native/components/ShapeChart/ShapeChartBase.cjs +1 -1
- package/dist/native/components/ShapeChart/ShapeChartBase.cjs.map +1 -1
- package/dist/native/components/ShapeChart/ShapeChartBase.d.cts +1 -1
- package/dist/native/components/ShapeChart/ShapeChartBase.d.ts +1 -1
- package/dist/native/components/ShapeChart/ShapeChartBase.js +97 -107
- package/dist/native/components/ShapeChart/ShapeChartBase.js.map +1 -1
- package/dist/native/components/ShapeChart/geometry.cjs +1 -1
- package/dist/native/components/ShapeChart/geometry.cjs.map +1 -1
- package/dist/native/components/ShapeChart/geometry.js +120 -36
- package/dist/native/components/ShapeChart/geometry.js.map +1 -1
- package/dist/native/components/ShapeChart/types.d.cts +6 -4
- package/dist/native/components/ShapeChart/types.d.ts +6 -4
- package/dist/native/source/components/Chart/ChartBase.tsx +19 -6
- package/dist/native/source/components/Chart/charts.tsx +10 -3
- package/dist/native/source/components/Chart/scene.tsx +85 -0
- package/dist/native/source/components/Chart/types.ts +7 -0
- package/dist/native/source/components/Charts/charts.tsx +7 -0
- package/dist/native/source/components/ShapeChart/ShapeChartBase.tsx +10 -36
- package/dist/native/source/components/ShapeChart/geometry.ts +188 -18
- package/dist/native/source/components/ShapeChart/types.ts +6 -4
- package/dist/taro/chart-a11y.d.ts +7 -0
- package/dist/taro/charts.d.ts +4 -1
- package/dist/taro/index.js +3212 -3049
- package/dist/taro/shape-charts.d.ts +6 -4
- package/dist/uni/AreaChart.vue +2 -1
- package/dist/uni/AreaChart.vue.d.ts +1 -1
- package/dist/uni/BarChart.vue +2 -1
- package/dist/uni/BarChart.vue.d.ts +1 -1
- package/dist/uni/BoxPlotChart.vue +2 -1
- package/dist/uni/BubbleChart.vue +2 -1
- package/dist/uni/CandlestickChart.vue +2 -1
- package/dist/uni/Chart.vue +2 -1
- package/dist/uni/Divider.vue.d.ts +1 -1
- package/dist/uni/DonutChart.vue.d.ts +1 -1
- package/dist/uni/GanttChart.vue +2 -1
- package/dist/uni/GanttChart.vue.d.ts +11 -0
- package/dist/uni/GaugeChart.vue.d.ts +1 -1
- package/dist/uni/HeatmapChart.vue +2 -1
- package/dist/uni/HistogramChart.vue +2 -1
- package/dist/uni/HorizontalBarChart.vue +2 -1
- package/dist/uni/HorizontalBarChart.vue.d.ts +1 -1
- package/dist/uni/LineChart.vue +2 -1
- package/dist/uni/MixedChart.vue +2 -1
- package/dist/uni/PieChart.vue.d.ts +1 -1
- package/dist/uni/QuadrantChart.vue +2 -1
- package/dist/uni/RangeAreaChart.vue +2 -1
- package/dist/uni/ScatterChart.vue +2 -1
- package/dist/uni/Sparkline.vue +2 -1
- package/dist/uni/WaterfallChart.vue +2 -1
- package/dist/uni/chart-a11y.d.ts +7 -0
- package/dist/uni/chart-a11y.js +29 -0
- package/dist/uni/chart-canvas.d.ts +9 -0
- package/dist/uni/chart-canvas.js +11 -1
- package/dist/uni/chart-types.d.ts +8 -1
- package/dist/uni/chart-types.js +5 -1
- package/dist/uni/charts-canvas.js +2 -1
- package/dist/uni/named-chart-options.d.ts +2 -0
- package/dist/uni/named-chart-options.js +3 -0
- package/dist/uni/shape-chart-canvas.d.ts +0 -2
- package/dist/uni/shape-chart-canvas.js +4 -36
- package/dist/uni/shape-chart-types.d.ts +2 -2
- package/dist/uni/shape-chart-types.js +2 -2
- package/dist/vue/components/Chart/Bar3DChart.vue.d.ts +2 -0
- package/dist/vue/components/Chart/DependencyGraph.vue.d.ts +2 -0
- package/dist/vue/components/Chart/GanttChart.vue.d.ts +15 -0
- package/dist/vue/components/Chart/GanttChart.vue.js.map +1 -1
- package/dist/vue/components/Chart/GanttChart.vue_vue_type_script_setup_true_lang.js +8 -0
- package/dist/vue/components/Chart/GanttChart.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/vue/components/Chart/GraphChart.vue.d.ts +2 -0
- package/dist/vue/components/Chart/Line3DChart.vue.d.ts +2 -0
- package/dist/vue/components/Chart/Scatter3DChart.vue.d.ts +2 -0
- package/dist/vue/components/Chart/Surface3DChart.vue.d.ts +2 -0
- package/dist/vue/components/Chart/TradingChart.vue.d.ts +9 -0
- package/dist/vue/components/Chart/TreeChart.vue.d.ts +2 -0
- package/dist/vue/components/Chart/graph.d.ts +3 -0
- package/dist/vue/components/Chart/graph.js +2 -0
- package/dist/vue/components/Chart/graph.js.map +1 -1
- package/dist/vue/components/Chart/three-d.d.ts +3 -0
- package/dist/vue/components/Chart/three-d.js +2 -0
- package/dist/vue/components/Chart/three-d.js.map +1 -1
- package/dist/vue/components/Chart/trading.d.ts +7 -2
- package/dist/vue/components/Chart/trading.js +1 -0
- package/dist/vue/components/Chart/trading.js.map +1 -1
- package/dist/weapp/area-chart/index.wxml +1 -1
- package/dist/weapp/bar-chart/index.wxml +1 -1
- package/dist/weapp/box-plot-chart/index.wxml +1 -1
- package/dist/weapp/bubble-chart/index.wxml +1 -1
- package/dist/weapp/candlestick-chart/index.wxml +1 -1
- package/dist/weapp/chart/index.wxml +1 -1
- package/dist/weapp/charts/canvas.js +326 -54
- package/dist/weapp/charts/core.js +2 -0
- package/dist/weapp/controls.js +58 -27
- package/dist/weapp/gantt-chart/index.wxml +1 -1
- package/dist/weapp/heatmap-chart/index.wxml +1 -1
- package/dist/weapp/histogram-chart/index.wxml +1 -1
- package/dist/weapp/horizontal-bar-chart/index.wxml +1 -1
- package/dist/weapp/line-chart/index.wxml +1 -1
- package/dist/weapp/mixed-chart/index.wxml +1 -1
- package/dist/weapp/quadrant-chart/index.wxml +1 -1
- package/dist/weapp/range-area-chart/index.wxml +1 -1
- package/dist/weapp/scatter-chart/index.wxml +1 -1
- package/dist/weapp/sparkline/index.wxml +1 -1
- package/dist/weapp/types.d.ts +11 -2
- package/dist/weapp/waterfall-chart/index.wxml +1 -1
- package/dist/web-components/components/chart/extended.d.ts +4 -0
- package/dist/web-components/components/chart/extended.js +8 -2
- package/dist/web-components/components/chart/extended.js.map +1 -1
- package/dist/web-components/components/chart-3d/chart-3d.d.ts +1 -1
- package/dist/web-components/components/chart-3d/chart-3d.js.map +1 -1
- package/dist/web-components/components/graph/graph.d.ts +2 -0
- package/dist/web-components/components/graph/graph.js +3 -2
- package/dist/web-components/components/graph/graph.js.map +1 -1
- package/dist/web-components/components/trading-chart/trading-chart.d.ts +1 -1
- package/dist/web-components/components/trading-chart/trading-chart.js.map +1 -1
- package/dist/web-components/html-custom-data.json +45 -0
- package/dist/web-components/types/react.d.ts +4 -4
- package/dist/web-components/types/solid.d.ts +8 -8
- package/dist/web-components/types/svelte.d.ts +8 -8
- package/dist/web-components/types/vue.d.ts +4 -4
- package/package.json +1 -1
|
@@ -242,6 +242,86 @@ const dashedLine = (
|
|
|
242
242
|
|
|
243
243
|
const crisp = (v: number, width = 1) => Math.round(v) + 0.5 - width / 2;
|
|
244
244
|
|
|
245
|
+
/**
|
|
246
|
+
* Views of an elbow arrow (relative to `ox`, `oy`): a thin box per leg (the
|
|
247
|
+
* legs are horizontal or vertical) and a triangle made of borders
|
|
248
|
+
*/
|
|
249
|
+
export const arrowViews = (
|
|
250
|
+
key: string,
|
|
251
|
+
arrow: ChartScene["arrows"][number],
|
|
252
|
+
ox: number,
|
|
253
|
+
oy: number,
|
|
254
|
+
): ReactElement[] => {
|
|
255
|
+
const out: ReactElement[] = [];
|
|
256
|
+
const w = arrow.width;
|
|
257
|
+
const pts = arrow.points;
|
|
258
|
+
for (let k = 1; k < pts.length; k++) {
|
|
259
|
+
const p = pts[k - 1]!;
|
|
260
|
+
const q = pts[k]!;
|
|
261
|
+
const x0 = Math.min(p.x, q.x) - ox;
|
|
262
|
+
const y0 = Math.min(p.y, q.y) - oy;
|
|
263
|
+
// legs overlap by half a width so the corners are closed
|
|
264
|
+
out.push(
|
|
265
|
+
p.y === q.y
|
|
266
|
+
? box(
|
|
267
|
+
`${key}-${k}`,
|
|
268
|
+
x0 - w / 2,
|
|
269
|
+
y0 - w / 2,
|
|
270
|
+
Math.abs(q.x - p.x) + w,
|
|
271
|
+
w,
|
|
272
|
+
arrow.color,
|
|
273
|
+
)
|
|
274
|
+
: box(
|
|
275
|
+
`${key}-${k}`,
|
|
276
|
+
x0 - w / 2,
|
|
277
|
+
y0 - w / 2,
|
|
278
|
+
w,
|
|
279
|
+
Math.abs(q.y - p.y) + w,
|
|
280
|
+
arrow.color,
|
|
281
|
+
),
|
|
282
|
+
);
|
|
283
|
+
}
|
|
284
|
+
const [tip, b0, b1] = arrow.head;
|
|
285
|
+
const length = Math.hypot(
|
|
286
|
+
tip.x - (b0.x + b1.x) / 2,
|
|
287
|
+
tip.y - (b0.y + b1.y) / 2,
|
|
288
|
+
);
|
|
289
|
+
const half = Math.hypot(b1.x - b0.x, b1.y - b0.y) / 2;
|
|
290
|
+
const clear = "transparent";
|
|
291
|
+
const style: ViewStyle = { position: "absolute", width: 0, height: 0 };
|
|
292
|
+
const baseX = (b0.x + b1.x) / 2;
|
|
293
|
+
const baseY = (b0.y + b1.y) / 2;
|
|
294
|
+
if (Math.abs(tip.x - baseX) >= Math.abs(tip.y - baseY)) {
|
|
295
|
+
const right = tip.x > baseX;
|
|
296
|
+
Object.assign(style, {
|
|
297
|
+
left: (right ? baseX : tip.x) - ox,
|
|
298
|
+
top: tip.y - half - oy,
|
|
299
|
+
borderTopWidth: half,
|
|
300
|
+
borderBottomWidth: half,
|
|
301
|
+
borderTopColor: clear,
|
|
302
|
+
borderBottomColor: clear,
|
|
303
|
+
...(right
|
|
304
|
+
? { borderLeftWidth: length, borderLeftColor: arrow.color }
|
|
305
|
+
: { borderRightWidth: length, borderRightColor: arrow.color }),
|
|
306
|
+
});
|
|
307
|
+
} else {
|
|
308
|
+
const down = tip.y > baseY;
|
|
309
|
+
Object.assign(style, {
|
|
310
|
+
left: tip.x - half - ox,
|
|
311
|
+
top: (down ? baseY : tip.y) - oy,
|
|
312
|
+
borderLeftWidth: half,
|
|
313
|
+
borderRightWidth: half,
|
|
314
|
+
borderLeftColor: clear,
|
|
315
|
+
borderRightColor: clear,
|
|
316
|
+
...(down
|
|
317
|
+
? { borderTopWidth: length, borderTopColor: arrow.color }
|
|
318
|
+
: { borderBottomWidth: length, borderBottomColor: arrow.color }),
|
|
319
|
+
});
|
|
320
|
+
}
|
|
321
|
+
out.push(<View key={`${key}-head`} style={style} />);
|
|
322
|
+
return out;
|
|
323
|
+
};
|
|
324
|
+
|
|
245
325
|
// ------------------------------------------------------------------ data
|
|
246
326
|
|
|
247
327
|
/** Thins a run of interleaved points to `max` points and drops sub-pixel steps */
|
|
@@ -810,6 +890,11 @@ function drawForeground(scene: ChartScene, family?: string): ReactElement[] {
|
|
|
810
890
|
);
|
|
811
891
|
});
|
|
812
892
|
|
|
893
|
+
// dependency arrows (Gantt charts): axis-aligned legs and a border triangle
|
|
894
|
+
scene.arrows.forEach((a, i) => {
|
|
895
|
+
out.push(...arrowViews(`arrow-${i}`, a, ox, oy));
|
|
896
|
+
});
|
|
897
|
+
|
|
813
898
|
annotations.forEach((a, i) => {
|
|
814
899
|
if (a.type !== "line") return;
|
|
815
900
|
const color = css(a.color);
|
|
@@ -4,6 +4,7 @@ import type {
|
|
|
4
4
|
ChartAnnotation,
|
|
5
5
|
ChartAxisOptions,
|
|
6
6
|
ChartController,
|
|
7
|
+
ChartDependency,
|
|
7
8
|
ChartHoverEvent,
|
|
8
9
|
ChartInteractionOptions,
|
|
9
10
|
ChartLabels,
|
|
@@ -142,6 +143,12 @@ export interface ChartProps extends ChartCommonProps {
|
|
|
142
143
|
* @default "vertical"
|
|
143
144
|
*/
|
|
144
145
|
orientation?: ChartOrientation;
|
|
146
|
+
/**
|
|
147
|
+
* Arrows between categories, e.g. the dependencies of a Gantt chart
|
|
148
|
+
* (`ganttSeries(...).dependencies`): elbows from the end of a bar to the
|
|
149
|
+
* start of another
|
|
150
|
+
*/
|
|
151
|
+
dependencies?: readonly ChartDependency[];
|
|
145
152
|
}
|
|
146
153
|
|
|
147
154
|
/** Props of LineChart */
|
|
@@ -441,6 +441,8 @@ export function GanttChart(props: GanttChartProps) {
|
|
|
441
441
|
milestoneName,
|
|
442
442
|
formatProgress,
|
|
443
443
|
dependenciesName,
|
|
444
|
+
dependencyArrows,
|
|
445
|
+
dependencyColor,
|
|
444
446
|
today = false,
|
|
445
447
|
todayLabel,
|
|
446
448
|
xAxis,
|
|
@@ -468,6 +470,8 @@ export function GanttChart(props: GanttChartProps) {
|
|
|
468
470
|
milestoneName,
|
|
469
471
|
formatProgress,
|
|
470
472
|
dependenciesName,
|
|
473
|
+
dependencyArrows,
|
|
474
|
+
dependencyColor,
|
|
471
475
|
locale: locale ?? base.locale,
|
|
472
476
|
});
|
|
473
477
|
const lines: ChartAnnotation[] =
|
|
@@ -487,6 +491,7 @@ export function GanttChart(props: GanttChartProps) {
|
|
|
487
491
|
...base,
|
|
488
492
|
...(locale ? { locale } : null),
|
|
489
493
|
series: gantt.series,
|
|
494
|
+
dependencies: gantt.dependencies,
|
|
490
495
|
orientation: "horizontal",
|
|
491
496
|
xAxis: { type: "category", categories: gantt.categories, ...xAxis },
|
|
492
497
|
yAxis: {
|
|
@@ -509,6 +514,8 @@ export function GanttChart(props: GanttChartProps) {
|
|
|
509
514
|
milestoneName,
|
|
510
515
|
formatProgress,
|
|
511
516
|
dependenciesName,
|
|
517
|
+
dependencyArrows,
|
|
518
|
+
dependencyColor,
|
|
512
519
|
now,
|
|
513
520
|
todayLabel,
|
|
514
521
|
xAxis,
|
|
@@ -27,6 +27,7 @@ import {
|
|
|
27
27
|
} from "react-native";
|
|
28
28
|
import {
|
|
29
29
|
createCanvasShapeChart,
|
|
30
|
+
describeShapeChart as describeShapeType,
|
|
30
31
|
type CanvasShapeChartInstance,
|
|
31
32
|
type ChartCanvas,
|
|
32
33
|
type ChartThemeInput,
|
|
@@ -35,7 +36,7 @@ import {
|
|
|
35
36
|
type ShapeHoverEvent,
|
|
36
37
|
type ShapeToggleEvent,
|
|
37
38
|
} from "../../../charts/src/canvas.js";
|
|
38
|
-
import { useTheme } from "../../theme/MinervaProvider";
|
|
39
|
+
import { useI18n, useTheme } from "../../theme/MinervaProvider";
|
|
39
40
|
import { part } from "../../internal/parts";
|
|
40
41
|
import { chartThemeInput } from "../Chart/theme";
|
|
41
42
|
import { renderPrims } from "./draw";
|
|
@@ -71,39 +72,9 @@ interface TouchPoint {
|
|
|
71
72
|
locationY?: number;
|
|
72
73
|
}
|
|
73
74
|
|
|
74
|
-
/** Default accessible name of a chart (
|
|
75
|
-
export const describeShapeChart = (o: ShapeChartOptions): string =>
|
|
76
|
-
|
|
77
|
-
case "pie":
|
|
78
|
-
return o.rose
|
|
79
|
-
? "Rose chart"
|
|
80
|
-
: (o.innerRadius ?? 0) > 0
|
|
81
|
-
? "Donut chart"
|
|
82
|
-
: "Pie chart";
|
|
83
|
-
case "radar":
|
|
84
|
-
return "Radar chart";
|
|
85
|
-
case "gauge":
|
|
86
|
-
return o.label ? `Gauge: ${o.label}` : "Gauge";
|
|
87
|
-
case "funnel":
|
|
88
|
-
return "Funnel chart";
|
|
89
|
-
case "treemap":
|
|
90
|
-
return "Treemap";
|
|
91
|
-
case "sankey":
|
|
92
|
-
return "Sankey diagram";
|
|
93
|
-
case "sunburst":
|
|
94
|
-
return "Sunburst chart";
|
|
95
|
-
case "radialBar":
|
|
96
|
-
return "Radial bar chart";
|
|
97
|
-
case "calendarHeatmap":
|
|
98
|
-
return "Calendar heatmap";
|
|
99
|
-
case "bullet":
|
|
100
|
-
return "Bullet chart";
|
|
101
|
-
case "chord":
|
|
102
|
-
return "Chord diagram";
|
|
103
|
-
default:
|
|
104
|
-
return "Chart";
|
|
105
|
-
}
|
|
106
|
-
};
|
|
75
|
+
/** Default accessible name of a chart: its type, in its locale ("Pie chart", "弦图") */
|
|
76
|
+
export const describeShapeChart = (o: ShapeChartOptions): string =>
|
|
77
|
+
o.ariaLabel ?? describeShapeType(o);
|
|
107
78
|
|
|
108
79
|
interface ShapeStore {
|
|
109
80
|
subscribe(listener: () => void): () => void;
|
|
@@ -383,11 +354,14 @@ export function ShapeChartBase({
|
|
|
383
354
|
...handlers
|
|
384
355
|
}: ShapeChartBaseProps) {
|
|
385
356
|
const { tokens, fonts, reducedMotion } = useTheme();
|
|
357
|
+
const { language } = useI18n();
|
|
386
358
|
const family = fonts.sans;
|
|
387
359
|
const theme = useMemo(() => chartThemeInput(tokens), [tokens]);
|
|
388
360
|
const customTooltip = !!renderTooltip && options.tooltip !== false;
|
|
389
361
|
const resolved = useMemo((): ShapeChartOptions => {
|
|
390
362
|
let next = options;
|
|
363
|
+
// the provider's language when the chart has no locale (no `<html lang>` on devices)
|
|
364
|
+
if (!next.locale) next = { ...next, locale: language };
|
|
391
365
|
if (reducedMotion && next.animation !== false)
|
|
392
366
|
next = { ...next, animation: false };
|
|
393
367
|
if (customTooltip) {
|
|
@@ -396,7 +370,7 @@ export function ShapeChartBase({
|
|
|
396
370
|
next = { ...next, tooltip: { ...base, render: () => "" } };
|
|
397
371
|
}
|
|
398
372
|
return next;
|
|
399
|
-
}, [options, customTooltip, reducedMotion]);
|
|
373
|
+
}, [options, customTooltip, reducedMotion, language]);
|
|
400
374
|
|
|
401
375
|
const [store] = useState(() =>
|
|
402
376
|
createShapeStore(
|
|
@@ -468,7 +442,7 @@ export function ShapeChartBase({
|
|
|
468
442
|
style={StyleSheet.absoluteFill}
|
|
469
443
|
accessible
|
|
470
444
|
accessibilityRole="image"
|
|
471
|
-
accessibilityLabel={
|
|
445
|
+
accessibilityLabel={describeShapeChart(resolved)}
|
|
472
446
|
onStartShouldSetResponder={() => true}
|
|
473
447
|
onResponderGrant={store.touchStart}
|
|
474
448
|
onResponderMove={store.touchMove}
|
|
@@ -560,14 +560,13 @@ function pieceViews(piece: Piece, base: Base, color: string): Prim[] {
|
|
|
560
560
|
y1 = Math.min(y1, base.cy + base.r1);
|
|
561
561
|
}
|
|
562
562
|
if (!(x1 > x0 && y1 > y0)) return [];
|
|
563
|
-
// the centroid may lie outside the disc: distances from it, generously
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
ref
|
|
569
|
-
|
|
570
|
-
);
|
|
563
|
+
// the centroid may lie outside the disc: distances from it, generously;
|
|
564
|
+
// the squares must also reach the guards (pieces cut in gradient bands are
|
|
565
|
+
// much smaller than the outline they keep)
|
|
566
|
+
let extent = 2 * Math.hypot(x1 - x0, y1 - y0) + SEAM;
|
|
567
|
+
for (const guard of piece.guards)
|
|
568
|
+
extent = Math.max(extent, side(guard, ref) + SEAM);
|
|
569
|
+
return clipViews(planes, base, color, ref, extent);
|
|
571
570
|
}
|
|
572
571
|
|
|
573
572
|
// ------------------------------------------------------------ recognition
|
|
@@ -1006,14 +1005,31 @@ export function regionViews(
|
|
|
1006
1005
|
const box = asRoundRect(firstSub.items);
|
|
1007
1006
|
if (box) return [roundBox(box, color, shadow)];
|
|
1008
1007
|
const ring = asConcentric(firstSub.items);
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
wedgeViews(firstSub.items, ring.base, color)
|
|
1013
|
-
|
|
1014
|
-
);
|
|
1008
|
+
const views =
|
|
1009
|
+
ring &&
|
|
1010
|
+
(roundedWedge(firstSub.items, ring.base, color) ??
|
|
1011
|
+
wedgeViews(firstSub.items, ring.base, color));
|
|
1012
|
+
if (views) return views;
|
|
1015
1013
|
}
|
|
1016
1014
|
|
|
1015
|
+
const out: Prim[] = [];
|
|
1016
|
+
for (const part of regionParts(subs))
|
|
1017
|
+
out.push(...piecesViews(part.pieces, part.base, color));
|
|
1018
|
+
return out;
|
|
1019
|
+
}
|
|
1020
|
+
|
|
1021
|
+
interface Part {
|
|
1022
|
+
pieces: Piece[];
|
|
1023
|
+
base: Base;
|
|
1024
|
+
}
|
|
1025
|
+
|
|
1026
|
+
/** Convex pieces of closed subpaths (nonzero rule), on their clipping base */
|
|
1027
|
+
function regionParts(subs: readonly { start: Pt; items: Item[] }[]): Part[] {
|
|
1028
|
+
const firstSub = subs[0];
|
|
1029
|
+
if (subs.length === 1 && firstSub) {
|
|
1030
|
+
const ring = asConcentric(firstSub.items);
|
|
1031
|
+
if (ring) return [{ pieces: convexPieces(ring.outline), base: ring.base }];
|
|
1032
|
+
}
|
|
1017
1033
|
const polys = subs.map((s) => flatten(s.items, s.start));
|
|
1018
1034
|
// an outline and a hole wound the other way (radar rings)
|
|
1019
1035
|
const [outer, hole] = polys;
|
|
@@ -1024,10 +1040,134 @@ export function regionViews(
|
|
|
1024
1040
|
area(outer) * area(hole) < 0 &&
|
|
1025
1041
|
contains(outer, hole)
|
|
1026
1042
|
)
|
|
1027
|
-
return
|
|
1043
|
+
return [{ pieces: bandPieces(outer, hole), base: { t: "plane" } }];
|
|
1044
|
+
return polys.map((poly) => ({
|
|
1045
|
+
pieces: convexPieces(poly),
|
|
1046
|
+
base: { t: "plane" },
|
|
1047
|
+
}));
|
|
1048
|
+
}
|
|
1049
|
+
|
|
1050
|
+
/** Most bands of a gradient fill */
|
|
1051
|
+
const MAX_BANDS = 8;
|
|
1052
|
+
/** Most convex pieces of a gradient fill, all bands together */
|
|
1053
|
+
const MAX_BAND_PIECES = 240;
|
|
1054
|
+
|
|
1055
|
+
/**
|
|
1056
|
+
* Keeps the part of a convex piece where `t(p) = n·p` lies in [lo, hi]; the
|
|
1057
|
+
* new edges are shared with the neighbor bands (they overlap by the seam)
|
|
1058
|
+
*/
|
|
1059
|
+
function clipPiece(piece: Piece, n: Pt, lo: number, hi: number): Piece | null {
|
|
1060
|
+
let pts = piece.pts;
|
|
1061
|
+
let internal = piece.internal;
|
|
1062
|
+
const cut = (inside: (p: Pt) => number) => {
|
|
1063
|
+
const P: Pt[] = [];
|
|
1064
|
+
const I: boolean[] = [];
|
|
1065
|
+
pts.forEach((a, i) => {
|
|
1066
|
+
const b = pt(pts, (i + 1) % pts.length);
|
|
1067
|
+
const sa = inside(a);
|
|
1068
|
+
const sb = inside(b);
|
|
1069
|
+
const flag = internal[i] ?? false;
|
|
1070
|
+
const at = (): Pt => {
|
|
1071
|
+
const k = sa / (sa - sb);
|
|
1072
|
+
return [a[0] + (b[0] - a[0]) * k, a[1] + (b[1] - a[1]) * k];
|
|
1073
|
+
};
|
|
1074
|
+
if (sa >= 0) {
|
|
1075
|
+
P.push(a);
|
|
1076
|
+
I.push(flag);
|
|
1077
|
+
if (sb < 0) {
|
|
1078
|
+
P.push(at());
|
|
1079
|
+
I.push(true);
|
|
1080
|
+
}
|
|
1081
|
+
} else if (sb >= 0) {
|
|
1082
|
+
P.push(at());
|
|
1083
|
+
I.push(flag);
|
|
1084
|
+
}
|
|
1085
|
+
});
|
|
1086
|
+
pts = P;
|
|
1087
|
+
internal = I;
|
|
1088
|
+
};
|
|
1089
|
+
const t = (p: Pt) => n[0] * p[0] + n[1] * p[1];
|
|
1090
|
+
if (Number.isFinite(lo)) cut((p) => t(p) - lo);
|
|
1091
|
+
if (Number.isFinite(hi)) cut((p) => hi - t(p));
|
|
1092
|
+
// repeated points: the kept one takes the flag of the edge leaving the run
|
|
1093
|
+
const kept: Pt[] = [];
|
|
1094
|
+
const flags: boolean[] = [];
|
|
1095
|
+
pts.forEach((p, i) => {
|
|
1096
|
+
const last = kept[kept.length - 1];
|
|
1097
|
+
if (last && dist(last, p) <= 1e-3)
|
|
1098
|
+
flags[flags.length - 1] = internal[i] ?? true;
|
|
1099
|
+
else {
|
|
1100
|
+
kept.push(p);
|
|
1101
|
+
flags.push(internal[i] ?? true);
|
|
1102
|
+
}
|
|
1103
|
+
});
|
|
1104
|
+
while (
|
|
1105
|
+
kept.length > 1 &&
|
|
1106
|
+
dist(pt(kept, 0), pt(kept, kept.length - 1)) <= 1e-3
|
|
1107
|
+
) {
|
|
1108
|
+
kept.pop();
|
|
1109
|
+
flags.pop();
|
|
1110
|
+
}
|
|
1111
|
+
if (kept.length < 3 || Math.abs(area(kept)) < 0.05) return null;
|
|
1112
|
+
return { pts: kept, internal: flags, guards: piece.guards };
|
|
1113
|
+
}
|
|
1114
|
+
|
|
1115
|
+
/**
|
|
1116
|
+
* Views filling the subpaths with a linear gradient: bands across its axis,
|
|
1117
|
+
* each of the color at its middle, overlapping their neighbors by the seam.
|
|
1118
|
+
* `null` when one color is enough.
|
|
1119
|
+
*/
|
|
1120
|
+
function gradientViews(
|
|
1121
|
+
paths: readonly Subpath[],
|
|
1122
|
+
colorAt: (p: Pt) => string,
|
|
1123
|
+
g: { x0: number; y0: number; x1: number; y1: number },
|
|
1124
|
+
delta: number,
|
|
1125
|
+
): Prim[] | null {
|
|
1126
|
+
const len = Math.hypot(g.x1 - g.x0, g.y1 - g.y0);
|
|
1127
|
+
if (len < 2 || delta < 8) return null;
|
|
1128
|
+
const n: Pt = [(g.x1 - g.x0) / len, (g.y1 - g.y0) / len];
|
|
1129
|
+
const t0 = n[0] * g.x0 + n[1] * g.y0;
|
|
1130
|
+
const subs = paths
|
|
1131
|
+
.map((sub) => ({ start: [sub.x, sub.y] as Pt, items: itemsOf(sub, true) }))
|
|
1132
|
+
.filter((s) => s.items.length > 0);
|
|
1133
|
+
const parts = regionParts(subs);
|
|
1134
|
+
let lo = Infinity;
|
|
1135
|
+
let hi = -Infinity;
|
|
1136
|
+
for (const part of parts)
|
|
1137
|
+
for (const piece of part.pieces)
|
|
1138
|
+
for (const p of piece.pts) {
|
|
1139
|
+
const t = n[0] * p[0] + n[1] * p[1] - t0;
|
|
1140
|
+
lo = Math.min(lo, t);
|
|
1141
|
+
hi = Math.max(hi, t);
|
|
1142
|
+
}
|
|
1143
|
+
// the colors only change between the ends of the axis
|
|
1144
|
+
const a = Math.min(Math.max(0, lo), hi);
|
|
1145
|
+
const b = Math.min(Math.max(len, lo), hi);
|
|
1146
|
+
const count = Math.min(
|
|
1147
|
+
MAX_BANDS,
|
|
1148
|
+
Math.ceil(delta / 20),
|
|
1149
|
+
Math.floor((b - a) / 6),
|
|
1150
|
+
);
|
|
1151
|
+
if (count < 2) return null;
|
|
1028
1152
|
const out: Prim[] = [];
|
|
1029
|
-
|
|
1030
|
-
|
|
1153
|
+
let budget = MAX_BAND_PIECES;
|
|
1154
|
+
for (let k = 0; k < count && budget > 0; k++) {
|
|
1155
|
+
const from = k === 0 ? -Infinity : t0 + a + ((b - a) * k) / count;
|
|
1156
|
+
const to =
|
|
1157
|
+
k === count - 1 ? Infinity : t0 + a + ((b - a) * (k + 1)) / count;
|
|
1158
|
+
const mid = t0 + a + ((b - a) * (k + 0.5)) / count;
|
|
1159
|
+
const color = colorAt([n[0] * mid, n[1] * mid]);
|
|
1160
|
+
for (const part of parts)
|
|
1161
|
+
for (const piece of part.pieces) {
|
|
1162
|
+
if (budget <= 0) break;
|
|
1163
|
+
const ts = piece.pts.map((p) => n[0] * p[0] + n[1] * p[1]);
|
|
1164
|
+
if (Math.max(...ts) <= from || Math.min(...ts) >= to) continue;
|
|
1165
|
+
const band = clipPiece(piece, n, from, to);
|
|
1166
|
+
if (!band) continue;
|
|
1167
|
+
budget--;
|
|
1168
|
+
out.push(...pieceViews(band, part.base, color));
|
|
1169
|
+
}
|
|
1170
|
+
}
|
|
1031
1171
|
return out;
|
|
1032
1172
|
}
|
|
1033
1173
|
|
|
@@ -1311,7 +1451,37 @@ const boundsCenter = (paths: readonly Subpath[]): Pt => {
|
|
|
1311
1451
|
};
|
|
1312
1452
|
|
|
1313
1453
|
function fillOp(op: FillOp): Prim[] {
|
|
1314
|
-
const
|
|
1454
|
+
const { paint } = op;
|
|
1455
|
+
const stops = paint.gradient?.stops ?? [];
|
|
1456
|
+
if (paint.gradient && stops.length > 1) {
|
|
1457
|
+
const alpha = Math.max(...stops.map((s) => s.color.a));
|
|
1458
|
+
const opacity = alpha * op.alpha;
|
|
1459
|
+
if (opacity <= 0.002) return [];
|
|
1460
|
+
let delta = 0;
|
|
1461
|
+
for (const s of stops) {
|
|
1462
|
+
const c = stops[0]?.color ?? s.color;
|
|
1463
|
+
delta = Math.max(
|
|
1464
|
+
delta,
|
|
1465
|
+
Math.abs(s.color.r - c.r),
|
|
1466
|
+
Math.abs(s.color.g - c.g),
|
|
1467
|
+
Math.abs(s.color.b - c.b),
|
|
1468
|
+
Math.abs(s.color.a - c.a) * 255,
|
|
1469
|
+
);
|
|
1470
|
+
}
|
|
1471
|
+
const views = gradientViews(
|
|
1472
|
+
op.paths,
|
|
1473
|
+
(p) => {
|
|
1474
|
+
const c = paintAt(paint, p[0], p[1]);
|
|
1475
|
+
return alpha > 0 && c.a < alpha - 1e-3
|
|
1476
|
+
? cssWithAlpha(c, 1 / alpha)
|
|
1477
|
+
: opaqueCss(c);
|
|
1478
|
+
},
|
|
1479
|
+
paint.gradient,
|
|
1480
|
+
delta,
|
|
1481
|
+
);
|
|
1482
|
+
if (views) return wrap(views, opacity);
|
|
1483
|
+
}
|
|
1484
|
+
const color: Color = paintAt(paint, ...boundsCenter(op.paths));
|
|
1315
1485
|
const opacity = color.a * op.alpha;
|
|
1316
1486
|
if (opacity <= 0.002) return [];
|
|
1317
1487
|
return wrap(regionViews(op.paths, opaqueCss(color), op.shadow), opacity);
|
|
@@ -128,7 +128,7 @@ export interface ShapeChartCommonProps extends ShapeChartFrameProps {
|
|
|
128
128
|
padding?: ChartPadding;
|
|
129
129
|
/**
|
|
130
130
|
* Accessible name of the chart
|
|
131
|
-
* @default the chart type, e.g. "Donut chart"
|
|
131
|
+
* @default the chart type in its locale, e.g. "Donut chart" (a gauge: "Gauge: {label}")
|
|
132
132
|
*/
|
|
133
133
|
ariaLabel?: string;
|
|
134
134
|
/**
|
|
@@ -577,9 +577,11 @@ export interface ChordChartProps extends ShapeChartCommonProps {
|
|
|
577
577
|
/** Flows as a list (by group name or index); takes precedence over `matrix` */
|
|
578
578
|
links?: readonly ChordLink[];
|
|
579
579
|
/**
|
|
580
|
-
* `false`: one ribbon per pair of groups,
|
|
581
|
-
*
|
|
582
|
-
*
|
|
580
|
+
* `false`: one ribbon per pair of groups, as wide as the flows between
|
|
581
|
+
* them in both directions (a symmetric matrix counts each relation once),
|
|
582
|
+
* arcs sized by the ribbons of the group. `true`: one ribbon per
|
|
583
|
+
* direction (same width at both ends), arcs sized by the outgoing plus
|
|
584
|
+
* the incoming flows; flows from a group to itself are ignored.
|
|
583
585
|
* @default false
|
|
584
586
|
*/
|
|
585
587
|
directed?: boolean;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ChartOptions, ShapeChartOptions } from '../charts/core.js';
|
|
2
|
+
/** Language of the page or the system, when the runtime has one (H5) */
|
|
3
|
+
export declare const systemLocale: () => string | undefined;
|
|
4
|
+
/** Default accessible name of a cartesian chart: its series */
|
|
5
|
+
export declare const describeCartesianChart: (o: ChartOptions) => string;
|
|
6
|
+
/** Default accessible name of a shape chart: its type, in its locale ("Pie chart", "弦图") */
|
|
7
|
+
export declare const describeShapeChart: (o: ShapeChartOptions) => string;
|
package/dist/taro/charts.d.ts
CHANGED
|
@@ -47,7 +47,10 @@ export interface ChartCommonProps {
|
|
|
47
47
|
padding?: ChartPadding;
|
|
48
48
|
/** Series colors (defaults to the `--chart-series-1..8` tokens, then the theme colors) */
|
|
49
49
|
palette?: readonly string[];
|
|
50
|
-
/**
|
|
50
|
+
/**
|
|
51
|
+
* Accessible name of the chart
|
|
52
|
+
* @default the series names in the chart's locale, e.g. "Chart: Revenue, Costs"
|
|
53
|
+
*/
|
|
51
54
|
ariaLabel?: string;
|
|
52
55
|
/**
|
|
53
56
|
* Locale of the texts and numbers the chart writes (tooltip rows, compact
|