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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ShapeChartBase.js","names":["TAP_SLOP","requestFrame","id","callback","describeShapeChart","o","createShapeStore","recorder","createRecorder","options","initialOptions","theme","initialTheme","size","initialSize","instance","version","listeners","committed","cache","hover","finger","origin","press","frames","nextFrame","notify","listener","commit","ops","canvas","local","t","pointOf","n","event","renderNow","framePrims","chart","createCanvasShapeChart","offs","e","handlers","off","frame","next","width","height","p","tap","CustomTooltip","useTheme","setSize","useState","left","anchor","top","View","part","w","h","previous","colors","ShapeChartBase","family","fonts","useMemo","chartThemeInput","tokens","customTooltip","renderTooltip","resolved","reducedMotion","base","store","useSyncExternalStore","useLayoutEffect","handlersRef","useRef","useEffect","useImperativeHandle","handleRef","onLayout","prims","tip","tooltip","content","style","StyleSheet","renderPrims"],"sources":["../../../../../native/src/components/ShapeChart/ShapeChartBase.tsx"],"sourcesContent":["// The shape chart host of React Native. The platform-free engine\n// (`createCanvasShapeChart` of @minerva/charts/canvas: layouts, animations,\n// legend, tooltip, hover dimming, toggles, events) draws every frame on a\n// recording canvas (./recorder); the recorded operations become views\n// (./geometry, ./draw). No canvas, SVG or native drawing module is needed,\n// and every shape type of the engine is drawn the same way.\n\nimport {\n useEffect,\n useImperativeHandle,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n useSyncExternalStore,\n type ReactNode,\n type Ref,\n} from \"react\";\nimport {\n StyleSheet,\n View,\n type DimensionValue,\n type GestureResponderEvent,\n type LayoutChangeEvent,\n type StyleProp,\n type ViewStyle,\n} from \"react-native\";\nimport {\n createCanvasShapeChart,\n type CanvasShapeChartInstance,\n type ChartCanvas,\n type ChartThemeInput,\n type ShapeChartOptions,\n type ShapeDrillEvent,\n type ShapeHoverEvent,\n type ShapeToggleEvent,\n} from \"@minerva/charts/canvas\";\nimport { useTheme } from \"../../theme/MinervaProvider\";\nimport { part } from \"../../internal/parts\";\nimport { chartThemeInput } from \"../Chart/theme\";\nimport { renderPrims } from \"./draw\";\nimport { framePrims, type Prim } from \"./geometry\";\nimport { createRecorder, type DrawOp } from \"./recorder\";\nimport type { ShapeChartHandle } from \"./types\";\n\ninterface Handlers {\n onHover?: (event: ShapeHoverEvent | null) => void;\n onClick?: (event: ShapeHoverEvent) => void;\n onToggle?: (event: ShapeToggleEvent) => void;\n onDrill?: (event: ShapeDrillEvent) => void;\n}\n\n/** Fingers moving less than this (px) tap */\nconst TAP_SLOP = 8;\n\ntype Frame = { cancel: () => void };\n\nconst requestFrame = (callback: () => void): Frame => {\n if (typeof requestAnimationFrame === \"function\") {\n const id = requestAnimationFrame(callback);\n return { cancel: () => cancelAnimationFrame(id) };\n }\n const id = setTimeout(callback, 16);\n return { cancel: () => clearTimeout(id) };\n};\n\ninterface TouchPoint {\n pageX: number;\n pageY: number;\n locationX?: number;\n locationY?: number;\n}\n\n/** Default accessible name of a chart (like the web charts) */\nexport const describeShapeChart = (o: ShapeChartOptions): string => {\n switch (o.type) {\n case \"pie\":\n return o.rose\n ? \"Rose chart\"\n : (o.innerRadius ?? 0) > 0\n ? \"Donut chart\"\n : \"Pie chart\";\n case \"radar\":\n return \"Radar chart\";\n case \"gauge\":\n return o.label ? `Gauge: ${o.label}` : \"Gauge\";\n case \"funnel\":\n return \"Funnel chart\";\n case \"treemap\":\n return \"Treemap\";\n case \"sankey\":\n return \"Sankey diagram\";\n case \"sunburst\":\n return \"Sunburst chart\";\n case \"radialBar\":\n return \"Radial bar chart\";\n case \"calendarHeatmap\":\n return \"Calendar heatmap\";\n case \"bullet\":\n return \"Bullet chart\";\n case \"chord\":\n return \"Chord diagram\";\n default:\n return \"Chart\";\n }\n};\n\ninterface ShapeStore {\n subscribe(listener: () => void): () => void;\n version(): number;\n /** Views of the last frame */\n prims(): Prim[];\n /** Creates the engine (in an effect); returns its teardown */\n mount(handlers: () => Handlers): () => void;\n instance(): CanvasShapeChartInstance | null;\n setOptions(options: ShapeChartOptions): void;\n setTheme(theme: ChartThemeInput): void;\n setSize(width: number, height: number): void;\n size(): [number, number] | null;\n /** Hovered mark and finger, for `renderTooltip` */\n tip(): { event: ShapeHoverEvent; x: number; y: number } | null;\n touchStart(event: GestureResponderEvent): void;\n touchMove(event: GestureResponderEvent): void;\n touchEnd(event: GestureResponderEvent): void;\n touchCancel(): void;\n}\n\nfunction createShapeStore(\n initialOptions: ShapeChartOptions,\n initialTheme: ChartThemeInput,\n initialSize: [number, number] | null,\n): ShapeStore {\n const recorder = createRecorder();\n let options = initialOptions;\n let theme = initialTheme;\n let size = initialSize;\n let instance: CanvasShapeChartInstance | null = null;\n let version = 0;\n const listeners = new Set<() => void>();\n let committed: DrawOp[] | null = null;\n let cache: { ops: DrawOp[]; prims: Prim[] } | null = null;\n let hover: ShapeHoverEvent | null = null;\n let finger = { x: 0, y: 0 };\n let origin = { x: 0, y: 0 };\n let press: { x: number; y: number; moved: boolean } | null = null;\n const frames = new Map<number, Frame>();\n let nextFrame = 1;\n\n const notify = () => {\n version++;\n listeners.forEach((listener) => listener());\n };\n /** Draws the views of a new frame */\n const commit = () => {\n const ops = recorder.ops();\n if (ops === committed) return;\n committed = ops;\n notify();\n };\n\n const canvas: ChartCanvas = {\n width: 0,\n height: 0,\n getContext: () => recorder.context,\n requestAnimationFrame(callback) {\n const id = nextFrame++;\n frames.set(\n id,\n requestFrame(() => {\n frames.delete(id);\n callback();\n commit();\n }),\n );\n return id;\n },\n cancelAnimationFrame(id) {\n frames.get(id)?.cancel();\n frames.delete(id);\n },\n };\n\n const local = (t: TouchPoint) => ({\n x: t.pageX - origin.x,\n y: t.pageY - origin.y,\n });\n const pointOf = (event: GestureResponderEvent) => {\n const n = event.nativeEvent;\n const t: TouchPoint =\n (n.changedTouches?.[0] as TouchPoint | undefined) ??\n (n.touches?.[0] as TouchPoint | undefined) ??\n (n as unknown as TouchPoint);\n return local(t);\n };\n /** Renders now (sizes, options) instead of on the next frame */\n const renderNow = () => {\n if (!instance) return;\n instance.render();\n commit();\n };\n\n const store: ShapeStore = {\n subscribe(listener) {\n listeners.add(listener);\n return () => {\n listeners.delete(listener);\n };\n },\n version: () => version,\n prims() {\n const ops = committed ?? [];\n if (!cache || cache.ops !== ops) cache = { ops, prims: framePrims(ops) };\n return cache.prims;\n },\n mount(handlers) {\n const chart = createCanvasShapeChart({\n canvas,\n width: size?.[0] ?? 0,\n height: size?.[1] ?? 0,\n pixelRatio: 1,\n options,\n theme,\n });\n instance = chart;\n const offs = [\n chart.on(\"hover\", (e) => {\n hover = e;\n handlers().onHover?.(e);\n }),\n chart.on(\"click\", (e) => handlers().onClick?.(e)),\n chart.on(\"toggle\", (e) => handlers().onToggle?.(e)),\n chart.on(\"drill\", (e) => handlers().onDrill?.(e)),\n ];\n commit();\n return () => {\n offs.forEach((off) => off());\n chart.destroy();\n frames.forEach((frame) => frame.cancel());\n frames.clear();\n if (instance === chart) instance = null;\n hover = null;\n };\n },\n instance: () => instance,\n setOptions(next) {\n if (next === options) return;\n options = next;\n instance?.setOptions(next);\n renderNow();\n },\n setTheme(next) {\n if (next === theme) return;\n theme = next;\n instance?.setTheme(next);\n renderNow();\n },\n setSize(width, height) {\n if (size && size[0] === width && size[1] === height) return;\n size = [width, height];\n instance?.resize(width, height, 1);\n renderNow();\n },\n size: () => size,\n tip: () => (hover ? { event: hover, x: finger.x, y: finger.y } : null),\n touchStart(event) {\n const n = event.nativeEvent as unknown as TouchPoint;\n // the drawing ignores touches: `location` is relative to the surface\n if (n.locationX !== undefined)\n origin = { x: n.pageX - n.locationX, y: n.pageY - (n.locationY ?? 0) };\n const p = local(n);\n finger = p;\n press = { x: p.x, y: p.y, moved: false };\n // pressing highlights the mark under the finger (and shows its tooltip)\n instance?.pointerMove(p.x, p.y);\n },\n touchMove(event) {\n const p = pointOf(event);\n finger = p;\n if (press && Math.hypot(p.x - press.x, p.y - press.y) > TAP_SLOP)\n press.moved = true;\n instance?.pointerMove(p.x, p.y);\n },\n touchEnd(event) {\n const p = pointOf(event);\n const tap = press && !press.moved;\n press = null;\n // a tap toggles a legend item or clicks a mark\n if (tap && instance) {\n finger = p;\n instance.pointerDown(p.x, p.y);\n instance.pointerUp(p.x, p.y);\n }\n },\n touchCancel() {\n press = null;\n instance?.pointerLeave();\n },\n };\n return store;\n}\n\n/** A `renderTooltip` node, placed next to the finger once measured */\nfunction CustomTooltip({\n anchor,\n width,\n height,\n children,\n}: {\n anchor: { x: number; y: number };\n width: number;\n height: number;\n children: ReactNode;\n}) {\n const { colors } = useTheme();\n const [size, setSize] = useState<{ width: number; height: number } | null>(\n null,\n );\n let left = anchor.x + 14;\n let top = anchor.y;\n if (size) {\n if (left + size.width > width - 4) left = anchor.x - 14 - size.width;\n left = Math.max(4, Math.min(left, width - size.width - 4));\n top = Math.max(\n 4,\n Math.min(anchor.y - size.height - 12, height - size.height - 4),\n );\n }\n return (\n <View\n pointerEvents=\"none\"\n {...part(\"chart\", \"tooltip\", { custom: true })}\n onLayout={(e: LayoutChangeEvent) => {\n const { width: w, height: h } = e.nativeEvent.layout;\n setSize((previous) =>\n previous && previous.width === w && previous.height === h\n ? previous\n : { width: w, height: h },\n );\n }}\n style={{\n position: \"absolute\",\n left: 0,\n top: 0,\n maxWidth: Math.max(0, width - 8),\n padding: 8,\n backgroundColor: colors[\"surface-color\"],\n borderColor: colors[\"border-color\"],\n borderWidth: 1,\n borderRadius: 8,\n shadowColor: \"#0f172a\",\n shadowOpacity: 0.18,\n shadowRadius: 8,\n shadowOffset: { width: 0, height: 6 },\n elevation: 6,\n opacity: size ? 1 : 0,\n transform: [{ translateX: left }, { translateY: top }],\n }}\n >\n {children}\n </View>\n );\n}\n\nexport interface ShapeChartBaseProps extends Handlers {\n options: ShapeChartOptions;\n height?: DimensionValue;\n width?: DimensionValue;\n style?: StyleProp<ViewStyle>;\n testID?: string;\n handleRef?: Ref<ShapeChartHandle>;\n renderTooltip?: (event: ShapeHoverEvent) => ReactNode;\n}\n\n/** Sizes the chart, forwards options / theme / touches to the engine and draws its frames */\nexport function ShapeChartBase({\n options,\n height = 320,\n width = \"100%\",\n style,\n testID,\n handleRef,\n renderTooltip,\n ...handlers\n}: ShapeChartBaseProps) {\n const { tokens, fonts, reducedMotion } = useTheme();\n const family = fonts.sans;\n const theme = useMemo(() => chartThemeInput(tokens), [tokens]);\n const customTooltip = !!renderTooltip && options.tooltip !== false;\n const resolved = useMemo((): ShapeChartOptions => {\n let next = options;\n if (reducedMotion && next.animation !== false)\n next = { ...next, animation: false };\n if (customTooltip) {\n const base = typeof next.tooltip === \"object\" ? next.tooltip : {};\n // an empty text: the engine draws no tooltip, the React one shows\n next = { ...next, tooltip: { ...base, render: () => \"\" } };\n }\n return next;\n }, [options, customTooltip, reducedMotion]);\n\n const [store] = useState(() =>\n createShapeStore(\n resolved,\n theme,\n typeof width === \"number\" && typeof height === \"number\"\n ? [width, height]\n : null,\n ),\n );\n useSyncExternalStore(store.subscribe, store.version, store.version);\n\n useLayoutEffect(() => {\n store.setTheme(theme);\n store.setOptions(resolved);\n }, [store, resolved, theme]);\n\n useLayoutEffect(() => {\n if (typeof width === \"number\" && typeof height === \"number\")\n store.setSize(width, height);\n }, [store, width, height]);\n\n const handlersRef = useRef<Handlers>(handlers);\n useLayoutEffect(() => {\n handlersRef.current = handlers;\n });\n useEffect(() => {\n const h = handlersRef;\n return store.mount(() => h.current);\n }, [store]);\n\n useImperativeHandle(\n handleRef,\n () => ({ getInstance: () => store.instance() }),\n [store],\n );\n\n const onLayout = (e: LayoutChangeEvent) => {\n const { width: w, height: h } = e.nativeEvent.layout;\n if (w > 0 && h > 0) store.setSize(w, h);\n };\n\n const prims = store.prims();\n const frame = store.size();\n const tip = customTooltip ? store.tip() : null;\n let tooltip: ReactNode = null;\n if (tip && frame && renderTooltip) {\n const content = renderTooltip(tip.event);\n if (content !== null && content !== undefined && content !== false)\n tooltip = (\n <CustomTooltip\n anchor={{ x: tip.x, y: tip.y }}\n width={frame[0]}\n height={frame[1]}\n >\n {content}\n </CustomTooltip>\n );\n }\n\n return (\n <View\n testID={testID}\n onLayout={onLayout}\n style={[{ width, height }, style]}\n {...part(\"chart\", \"root\")}\n >\n <View\n style={StyleSheet.absoluteFill}\n accessible\n accessibilityRole=\"image\"\n accessibilityLabel={options.ariaLabel ?? describeShapeChart(options)}\n onStartShouldSetResponder={() => true}\n onResponderGrant={store.touchStart}\n onResponderMove={store.touchMove}\n onResponderRelease={store.touchEnd}\n onResponderTerminate={store.touchCancel}\n {...part(\"chart\", \"surface\")}\n >\n <View pointerEvents=\"none\" style={StyleSheet.absoluteFill}>\n {renderPrims(prims, family)}\n </View>\n </View>\n {tooltip}\n </View>\n );\n}\n"],"mappings":";;;;;;;;;;;;AAqDA,IAAMA,IAAW,GAIXC,KAAgB,MAAgC;CACpD,IAAI,OAAO,yBAA0B,YAAY;EAC/C,IAAMC,IAAK,sBAAsBC,CAAQ;EACzC,OAAO,EAAE,cAAc,qBAAqBD,CAAE,EAAE;CAClD;CACA,IAAMA,IAAK,WAAWC,GAAU,EAAE;CAClC,OAAO,EAAE,cAAc,aAAaD,CAAE,EAAE;AAC1C,GAUaE,KAAsB,MAAiC;CAClE,QAAQC,EAAE,MAAV;EACE,KAAK,OACH,OAAOA,EAAE,OACL,gBACCA,EAAE,eAAe,KAAK,IACrB,gBACA;EACR,KAAK,SACH,OAAO;EACT,KAAK,SACH,OAAOA,EAAE,QAAQ,UAAUA,EAA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M,EAAE,YAAY;EAC9C,AAAID,IAAI,KAAKC,IAAI,KAAGc,EAAM,QAAQf,GAAGC,CAAC;CACxC,GAEMuB,IAAQT,EAAM,MAAM,GACpB9B,IAAQ8B,EAAM,KAAK,GACnBU,IAAMf,IAAgBK,EAAM,IAAI,IAAI,MACtCW,IAAqB;CACzB,IAAID,KAAOxC,KAAS0B,GAAe;EACjC,IAAMgB,IAAUhB,EAAcc,EAAI,KAAK;EACvC,AAAIE,KAAY,QAAiCA,MAAY,OAC3D,IACE,kBAACpC,GAAD;GACE,QAAQ;IAAE,GAAGkC,EAAI;IAAG,GAAGA,EAAI;GAAE;GAC7B,OAAOxC,EAAM;GACb,QAAQA,EAAM;GAEb,UAAA0C;EACY,CAAA;CAErB;CAEA,OACE,kBAAC7B,GAAD;EACU;EACE;EACV,OAAO,CAAC;GAAE;GAAO;EAAO,GAAG8B,CAAK;EAChC,GAAI7B,EAAK,SAAS,MAAM;EAJ1B,UAAA,CAME,kBAACD,GAAD;GACE,OAAO+B,EAAW;GAClB,YAAA;GACA,mBAAkB;GAClB,oBAAoB/E,EAAQ,aAAaL,EAAmBK,CAAO;GACnE,iCAAiC;GACjC,kBAAkBiE,EAAM;GACxB,iBAAiBA,EAAM;GACvB,oBAAoBA,EAAM;GAC1B,sBAAsBA,EAAM;GAC5B,GAAIhB,EAAK,SAAS,SAAS;GAE3B,UAAA,kBAACD,GAAD;IAAM,eAAc;IAAO,OAAO+B,EAAW;IAC1C,UAAAC,EAAYN,GAAOnB,CAAM;GACtB,CAAA;EACF,CAAA,GACLqB,CACG;;AAEV"}
|
|
1
|
+
{"version":3,"file":"ShapeChartBase.js","names":["describeShapeType","TAP_SLOP","requestFrame","id","callback","describeShapeChart","o","describeChart","createShapeStore","recorder","createRecorder","options","initialOptions","theme","initialTheme","size","initialSize","instance","version","listeners","committed","cache","hover","finger","origin","press","frames","nextFrame","notify","listener","commit","ops","canvas","local","t","pointOf","n","event","renderNow","framePrims","chart","createCanvasShapeChart","offs","e","handlers","off","frame","next","width","height","p","tap","CustomTooltip","useTheme","setSize","useState","left","anchor","top","View","part","w","h","previous","colors","ShapeChartBase","useI18n","family","fonts","useMemo","chartThemeInput","tokens","customTooltip","renderTooltip","resolved","language","reducedMotion","base","store","useSyncExternalStore","useLayoutEffect","handlersRef","useRef","useEffect","useImperativeHandle","handleRef","onLayout","prims","tip","tooltip","content","style","StyleSheet","renderPrims"],"sources":["../../../../../native/src/components/ShapeChart/ShapeChartBase.tsx"],"sourcesContent":["// The shape chart host of React Native. The platform-free engine\n// (`createCanvasShapeChart` of @minerva/charts/canvas: layouts, animations,\n// legend, tooltip, hover dimming, toggles, events) draws every frame on a\n// recording canvas (./recorder); the recorded operations become views\n// (./geometry, ./draw). No canvas, SVG or native drawing module is needed,\n// and every shape type of the engine is drawn the same way.\n\nimport {\n useEffect,\n useImperativeHandle,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n useSyncExternalStore,\n type ReactNode,\n type Ref,\n} from \"react\";\nimport {\n StyleSheet,\n View,\n type DimensionValue,\n type GestureResponderEvent,\n type LayoutChangeEvent,\n type StyleProp,\n type ViewStyle,\n} from \"react-native\";\nimport {\n createCanvasShapeChart,\n describeShapeChart as describeShapeType,\n type CanvasShapeChartInstance,\n type ChartCanvas,\n type ChartThemeInput,\n type ShapeChartOptions,\n type ShapeDrillEvent,\n type ShapeHoverEvent,\n type ShapeToggleEvent,\n} from \"@minerva/charts/canvas\";\nimport { useI18n, useTheme } from \"../../theme/MinervaProvider\";\nimport { part } from \"../../internal/parts\";\nimport { chartThemeInput } from \"../Chart/theme\";\nimport { renderPrims } from \"./draw\";\nimport { framePrims, type Prim } from \"./geometry\";\nimport { createRecorder, type DrawOp } from \"./recorder\";\nimport type { ShapeChartHandle } from \"./types\";\n\ninterface Handlers {\n onHover?: (event: ShapeHoverEvent | null) => void;\n onClick?: (event: ShapeHoverEvent) => void;\n onToggle?: (event: ShapeToggleEvent) => void;\n onDrill?: (event: ShapeDrillEvent) => void;\n}\n\n/** Fingers moving less than this (px) tap */\nconst TAP_SLOP = 8;\n\ntype Frame = { cancel: () => void };\n\nconst requestFrame = (callback: () => void): Frame => {\n if (typeof requestAnimationFrame === \"function\") {\n const id = requestAnimationFrame(callback);\n return { cancel: () => cancelAnimationFrame(id) };\n }\n const id = setTimeout(callback, 16);\n return { cancel: () => clearTimeout(id) };\n};\n\ninterface TouchPoint {\n pageX: number;\n pageY: number;\n locationX?: number;\n locationY?: number;\n}\n\n/** Default accessible name of a chart: its type, in its locale (\"Pie chart\", \"弦图\") */\nexport const describeShapeChart = (o: ShapeChartOptions): string =>\n o.ariaLabel ?? describeShapeType(o);\n\ninterface ShapeStore {\n subscribe(listener: () => void): () => void;\n version(): number;\n /** Views of the last frame */\n prims(): Prim[];\n /** Creates the engine (in an effect); returns its teardown */\n mount(handlers: () => Handlers): () => void;\n instance(): CanvasShapeChartInstance | null;\n setOptions(options: ShapeChartOptions): void;\n setTheme(theme: ChartThemeInput): void;\n setSize(width: number, height: number): void;\n size(): [number, number] | null;\n /** Hovered mark and finger, for `renderTooltip` */\n tip(): { event: ShapeHoverEvent; x: number; y: number } | null;\n touchStart(event: GestureResponderEvent): void;\n touchMove(event: GestureResponderEvent): void;\n touchEnd(event: GestureResponderEvent): void;\n touchCancel(): void;\n}\n\nfunction createShapeStore(\n initialOptions: ShapeChartOptions,\n initialTheme: ChartThemeInput,\n initialSize: [number, number] | null,\n): ShapeStore {\n const recorder = createRecorder();\n let options = initialOptions;\n let theme = initialTheme;\n let size = initialSize;\n let instance: CanvasShapeChartInstance | null = null;\n let version = 0;\n const listeners = new Set<() => void>();\n let committed: DrawOp[] | null = null;\n let cache: { ops: DrawOp[]; prims: Prim[] } | null = null;\n let hover: ShapeHoverEvent | null = null;\n let finger = { x: 0, y: 0 };\n let origin = { x: 0, y: 0 };\n let press: { x: number; y: number; moved: boolean } | null = null;\n const frames = new Map<number, Frame>();\n let nextFrame = 1;\n\n const notify = () => {\n version++;\n listeners.forEach((listener) => listener());\n };\n /** Draws the views of a new frame */\n const commit = () => {\n const ops = recorder.ops();\n if (ops === committed) return;\n committed = ops;\n notify();\n };\n\n const canvas: ChartCanvas = {\n width: 0,\n height: 0,\n getContext: () => recorder.context,\n requestAnimationFrame(callback) {\n const id = nextFrame++;\n frames.set(\n id,\n requestFrame(() => {\n frames.delete(id);\n callback();\n commit();\n }),\n );\n return id;\n },\n cancelAnimationFrame(id) {\n frames.get(id)?.cancel();\n frames.delete(id);\n },\n };\n\n const local = (t: TouchPoint) => ({\n x: t.pageX - origin.x,\n y: t.pageY - origin.y,\n });\n const pointOf = (event: GestureResponderEvent) => {\n const n = event.nativeEvent;\n const t: TouchPoint =\n (n.changedTouches?.[0] as TouchPoint | undefined) ??\n (n.touches?.[0] as TouchPoint | undefined) ??\n (n as unknown as TouchPoint);\n return local(t);\n };\n /** Renders now (sizes, options) instead of on the next frame */\n const renderNow = () => {\n if (!instance) return;\n instance.render();\n commit();\n };\n\n const store: ShapeStore = {\n subscribe(listener) {\n listeners.add(listener);\n return () => {\n listeners.delete(listener);\n };\n },\n version: () => version,\n prims() {\n const ops = committed ?? [];\n if (!cache || cache.ops !== ops) cache = { ops, prims: framePrims(ops) };\n return cache.prims;\n },\n mount(handlers) {\n const chart = createCanvasShapeChart({\n canvas,\n width: size?.[0] ?? 0,\n height: size?.[1] ?? 0,\n pixelRatio: 1,\n options,\n theme,\n });\n instance = chart;\n const offs = [\n chart.on(\"hover\", (e) => {\n hover = e;\n handlers().onHover?.(e);\n }),\n chart.on(\"click\", (e) => handlers().onClick?.(e)),\n chart.on(\"toggle\", (e) => handlers().onToggle?.(e)),\n chart.on(\"drill\", (e) => handlers().onDrill?.(e)),\n ];\n commit();\n return () => {\n offs.forEach((off) => off());\n chart.destroy();\n frames.forEach((frame) => frame.cancel());\n frames.clear();\n if (instance === chart) instance = null;\n hover = null;\n };\n },\n instance: () => instance,\n setOptions(next) {\n if (next === options) return;\n options = next;\n instance?.setOptions(next);\n renderNow();\n },\n setTheme(next) {\n if (next === theme) return;\n theme = next;\n instance?.setTheme(next);\n renderNow();\n },\n setSize(width, height) {\n if (size && size[0] === width && size[1] === height) return;\n size = [width, height];\n instance?.resize(width, height, 1);\n renderNow();\n },\n size: () => size,\n tip: () => (hover ? { event: hover, x: finger.x, y: finger.y } : null),\n touchStart(event) {\n const n = event.nativeEvent as unknown as TouchPoint;\n // the drawing ignores touches: `location` is relative to the surface\n if (n.locationX !== undefined)\n origin = { x: n.pageX - n.locationX, y: n.pageY - (n.locationY ?? 0) };\n const p = local(n);\n finger = p;\n press = { x: p.x, y: p.y, moved: false };\n // pressing highlights the mark under the finger (and shows its tooltip)\n instance?.pointerMove(p.x, p.y);\n },\n touchMove(event) {\n const p = pointOf(event);\n finger = p;\n if (press && Math.hypot(p.x - press.x, p.y - press.y) > TAP_SLOP)\n press.moved = true;\n instance?.pointerMove(p.x, p.y);\n },\n touchEnd(event) {\n const p = pointOf(event);\n const tap = press && !press.moved;\n press = null;\n // a tap toggles a legend item or clicks a mark\n if (tap && instance) {\n finger = p;\n instance.pointerDown(p.x, p.y);\n instance.pointerUp(p.x, p.y);\n }\n },\n touchCancel() {\n press = null;\n instance?.pointerLeave();\n },\n };\n return store;\n}\n\n/** A `renderTooltip` node, placed next to the finger once measured */\nfunction CustomTooltip({\n anchor,\n width,\n height,\n children,\n}: {\n anchor: { x: number; y: number };\n width: number;\n height: number;\n children: ReactNode;\n}) {\n const { colors } = useTheme();\n const [size, setSize] = useState<{ width: number; height: number } | null>(\n null,\n );\n let left = anchor.x + 14;\n let top = anchor.y;\n if (size) {\n if (left + size.width > width - 4) left = anchor.x - 14 - size.width;\n left = Math.max(4, Math.min(left, width - size.width - 4));\n top = Math.max(\n 4,\n Math.min(anchor.y - size.height - 12, height - size.height - 4),\n );\n }\n return (\n <View\n pointerEvents=\"none\"\n {...part(\"chart\", \"tooltip\", { custom: true })}\n onLayout={(e: LayoutChangeEvent) => {\n const { width: w, height: h } = e.nativeEvent.layout;\n setSize((previous) =>\n previous && previous.width === w && previous.height === h\n ? previous\n : { width: w, height: h },\n );\n }}\n style={{\n position: \"absolute\",\n left: 0,\n top: 0,\n maxWidth: Math.max(0, width - 8),\n padding: 8,\n backgroundColor: colors[\"surface-color\"],\n borderColor: colors[\"border-color\"],\n borderWidth: 1,\n borderRadius: 8,\n shadowColor: \"#0f172a\",\n shadowOpacity: 0.18,\n shadowRadius: 8,\n shadowOffset: { width: 0, height: 6 },\n elevation: 6,\n opacity: size ? 1 : 0,\n transform: [{ translateX: left }, { translateY: top }],\n }}\n >\n {children}\n </View>\n );\n}\n\nexport interface ShapeChartBaseProps extends Handlers {\n options: ShapeChartOptions;\n height?: DimensionValue;\n width?: DimensionValue;\n style?: StyleProp<ViewStyle>;\n testID?: string;\n handleRef?: Ref<ShapeChartHandle>;\n renderTooltip?: (event: ShapeHoverEvent) => ReactNode;\n}\n\n/** Sizes the chart, forwards options / theme / touches to the engine and draws its frames */\nexport function ShapeChartBase({\n options,\n height = 320,\n width = \"100%\",\n style,\n testID,\n handleRef,\n renderTooltip,\n ...handlers\n}: ShapeChartBaseProps) {\n const { tokens, fonts, reducedMotion } = useTheme();\n const { language } = useI18n();\n const family = fonts.sans;\n const theme = useMemo(() => chartThemeInput(tokens), [tokens]);\n const customTooltip = !!renderTooltip && options.tooltip !== false;\n const resolved = useMemo((): ShapeChartOptions => {\n let next = options;\n // the provider's language when the chart has no locale (no `<html lang>` on devices)\n if (!next.locale) next = { ...next, locale: language };\n if (reducedMotion && next.animation !== false)\n next = { ...next, animation: false };\n if (customTooltip) {\n const base = typeof next.tooltip === \"object\" ? next.tooltip : {};\n // an empty text: the engine draws no tooltip, the React one shows\n next = { ...next, tooltip: { ...base, render: () => \"\" } };\n }\n return next;\n }, [options, customTooltip, reducedMotion, language]);\n\n const [store] = useState(() =>\n createShapeStore(\n resolved,\n theme,\n typeof width === \"number\" && typeof height === \"number\"\n ? [width, height]\n : null,\n ),\n );\n useSyncExternalStore(store.subscribe, store.version, store.version);\n\n useLayoutEffect(() => {\n store.setTheme(theme);\n store.setOptions(resolved);\n }, [store, resolved, theme]);\n\n useLayoutEffect(() => {\n if (typeof width === \"number\" && typeof height === \"number\")\n store.setSize(width, height);\n }, [store, width, height]);\n\n const handlersRef = useRef<Handlers>(handlers);\n useLayoutEffect(() => {\n handlersRef.current = handlers;\n });\n useEffect(() => {\n const h = handlersRef;\n return store.mount(() => h.current);\n }, [store]);\n\n useImperativeHandle(\n handleRef,\n () => ({ getInstance: () => store.instance() }),\n [store],\n );\n\n const onLayout = (e: LayoutChangeEvent) => {\n const { width: w, height: h } = e.nativeEvent.layout;\n if (w > 0 && h > 0) store.setSize(w, h);\n };\n\n const prims = store.prims();\n const frame = store.size();\n const tip = customTooltip ? store.tip() : null;\n let tooltip: ReactNode = null;\n if (tip && frame && renderTooltip) {\n const content = renderTooltip(tip.event);\n if (content !== null && content !== undefined && content !== false)\n tooltip = (\n <CustomTooltip\n anchor={{ x: tip.x, y: tip.y }}\n width={frame[0]}\n height={frame[1]}\n >\n {content}\n </CustomTooltip>\n );\n }\n\n return (\n <View\n testID={testID}\n onLayout={onLayout}\n style={[{ width, height }, style]}\n {...part(\"chart\", \"root\")}\n >\n <View\n style={StyleSheet.absoluteFill}\n accessible\n accessibilityRole=\"image\"\n accessibilityLabel={describeShapeChart(resolved)}\n onStartShouldSetResponder={() => true}\n onResponderGrant={store.touchStart}\n onResponderMove={store.touchMove}\n onResponderRelease={store.touchEnd}\n onResponderTerminate={store.touchCancel}\n {...part(\"chart\", \"surface\")}\n >\n <View pointerEvents=\"none\" style={StyleSheet.absoluteFill}>\n {renderPrims(prims, family)}\n </View>\n </View>\n {tooltip}\n </View>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AAsDA,IAAMC,IAAW,GAIXC,KAAgB,MAAgC;CACpD,IAAI,OAAO,yBAA0B,YAAY;EAC/C,IAAMC,IAAK,sBAAsBC,CAAQ;EACzC,OAAO,EAAE,cAAc,qBAAqBD,CAAE,EAAE;C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/i];return a[0]*(n[0]-e[0])+a[1]*(n[1]-e[1])<0&&(a=[-a[0],-a[1]]),{n:a,d:a[0]*e[0]+a[1]*e[1]-r}},o=e=>[e.reduce((e,t)=>e+t[0],0)/Math.max(1,e.length),e.reduce((e,t)=>e+t[1],0)/Math.max(1,e.length)],s=(e,t)=>e[t],c=(e,t,n)=>(t[0]-e[0])*(n[1]-e[1])-(t[1]-e[1])*(n[0]-e[0]),l=(e,t)=>Math.hypot(e[0]-t[0],e[1]-t[1]),u=(e,t,n,r)=>[e+n*Math.cos(r),t+n*Math.sin(r)],d=(e,t)=>{let n=Math.cos(t),r=Math.sin(t);return[e[0]*n-e[1]*r,e[0]*r+e[1]*n]},f=e=>{let t=0;for(let n=0;n<e.length;n++){let r=s(e,n),i=s(e,(n+1)%e.length);t+=r[0]*i[1]-i[0]*r[1]}return t/2};function p(e,t){let n=[],r=[e.x,e.y],i=(e,t)=>{l(r,e)>.001&&n.push(t?{t:`L`,from:r,to:e,q:t}:{t:`L`,from:r,to:e}),r=e};for(let t of e.segs)t.t===`L`?i([t.x,t.y],t.q):(i(u(t.cx,t.cy,t.r,t.a0)),n.push({...t}),r=u(t.cx,t.cy,t.r,t.a1));return t&&i([e.x,e.y]),n}function m(e,t,n=.2){let r=[t];for(let t of e)if(t.t===`L`)r.push(t.to);else{let e=t.a1-t.a0,i=t.r>n?Math.max(.04,2*Math.acos(Math.max(-1,1-n/t.r))):Math.PI/2,a=Math.min(128,Math.max(1,Math.ceil(Math.abs(e)/i)));r.push(u(t.cx,t.cy,t.r,t.a0));for(let n=1;n<=a;n++)r.push(u(t.cx,t.cy,t.r,t.a0+e*n/a))}return h(r)}function h(e,t=!0){let n=[];for(let t of e){let e=n[n.length-1];(!e||l(e,t)>.001)&&n.push(t)}return t&&n.length>1&&l(s(n,0),s(n,n.length-1))<=.001&&n.pop(),n}function g(e){let t=h(e),n=!0;for(;n&&t.length>3;){n=!1;for(let e=0;e<t.length;e++){let r=s(t,(e-1+t.length)%t.length),i=s(t,e),a=s(t,(e+1)%t.length),o=Math.max(l(r,i),l(i,a),1e-9),u=c(r,i,a)/o,d=(i[0]-r[0])*(a[0]-i[0])+(i[1]-r[1])*(a[1]-i[1])>0;if(Math.abs(u)<1e-4&&d){t=t.filter((t,n)=>n!==e),n=!0;break}}}return t}var _=e=>e?.t===`A`&&Math.abs(e.a1-e.a0)>=t-1e-6;function v(e){let t=e.length;if(t<3)return[];let n=e.map((e,t)=>t);f(e)<0&&(n=n.reverse());let r=[],i=(e,t,n,r)=>c(t,n,e)>1e-9&&c(n,r,e)>1e-9&&c(r,t,e)>1e-9,a=0;for(;n.length>3&&a++<t*t+10;){let t=!1;for(let a=0;a<n.length;a++){let o=n[(a-1+n.length)%n.length],u=n[a],d=n[(a+1)%n.length],f=s(e,o),p=s(e,u),m=s(e,d);if(c(f,p,m)<=1e-9)continue;let h=!1;for(let t of n){if(t===o||t===u||t===d)continue;let n=s(e,t);if(!(l(n,f)<1e-6||l(n,p)<1e-6||l(n,m)<1e-6)&&i(n,f,p,m)){h=!0;break}}if(!h){r.push([o,u,d]),n.splice(a,1),t=!0;break}}if(!t){let t=0,r=1/0;for(let i=0;i<n.length;i++){let a=Math.abs(c(s(e,n[(i-1+n.length)%n.length]),s(e,n[i]),s(e,n[(i+1)%n.length])));a<r&&(r=a,t=i)}n.splice(t,1)}}if(n.length===3){let[t,i,a]=n;c(s(e,t),s(e,i),s(e,a))>1e-9&&r.push([t,i,a])}return r}var y=(e,t)=>{for(let n=0;n<t.length;n++){let r=s(e,t[(n-1+t.length)%t.length]),i=s(e,t[n]),a=s(e,t[(n+1)%t.length]);if(c(r,i,a)<-1e-7*Math.max(1,l(r,i)*l(i,a)))return!1}return!0};function b(e,t){let n=t.map(t=>f(t.map(t=>s(e,t)))<0?[...t].reverse():[...t]),r=!0;for(;r;){r=!1;outer:for(let t=0;t<n.length;t++){let i=n[t];for(let a=0;a<i.length;a++){let o=i[a],s=i[(a+1)%i.length];for(let c=t+1;c<n.length;c++){let l=n[c],u=l.findIndex((e,t)=>e===s&&l[(t+1)%l.length]===o);if(u<0)continue;let d=(a+1)%i.length,f=[];for(let e=0;e<i.length;e++)f.push(i[(d+e)%i.length]);let p=[];for(let e=2;e<l.length;e++)p.push(l[(u+e)%l.length]);let m=[...f,...p];if(y(e,m)){n[t]=m,n.splice(c,1),r=!0;break outer}}}}}let c=new Set;for(let e of n)for(let t=0;t<e.length;t++)c.add(`${e[t]},${e[(t+1)%e.length]}`);let l=e=>e.map((t,n)=>c.has(`${e[(n+1)%e.length]},${t}`)),u=[];for(let t of n){let n=o(t.map(t=>s(e,t)));l(t).forEach((e,r)=>{e||u.push({a:t[r],b:t[(r+1)%t.length],ref:n})})}return n.map(t=>{let n=t.map(t=>s(e,t)),r=l(t),o=new Set;r.forEach((e,n)=>{e&&(o.add(t[n]),o.add(t[(n+1)%t.length]))});let c=new Set(t.map((e,n)=>`${e},${t[(n+1)%t.length]}`)),d=[];for(let t of u){if(!(o.has(t.a)||o.has(t.b))||c.has(`${t.a},${t.b}`))continue;let r=a(s(e,t.a),s(e,t.b),t.ref,0);r&&n.every(e=>i(r,e)>=-1e-6)&&d.push(r)}return{pts:n,internal:r,guards:d}})}function x(e){let t=g(e);return t.length<3?[]:b(t,v(t))}function S(e,n){let r=g(e),i=g(n);if(r.length<3||i.length<3)return x(e);let a=e=>f(e)<0?[...e].reverse():e,o=a(r),c=a(i),l=[c.reduce((e,t)=>e+t[0],0)/c.length,c.reduce((e,t)=>e+t[1],0)/c.length],u=e=>{let n=e.map(e=>Math.atan2(e[1]-l[1],e[0]-l[0])),r=0;n.forEach((e,t)=>{e<n[r]&&(r=t)});let i=e.map((t,n)=>(r+n)%e.length),a=[],o=-1/0;for(let e of i){let r=n[e];for(;r<o;)r+=t;a.push(r),o=r}return a.push(a[0]+t),{order:i,angles:a}},d=u(o),p=u(c),m=[...o,...c],h=e=>d.order[e%o.length],_=e=>o.length+p.order[e%c.length],v=[],y=0,S=0;for(;y<o.length||S<c.length;)(y<o.length?d.angles[y+1]:1/0)<=(S<c.length?p.angles[S+1]:1/0)?(v.push([h(y),h(y+1),_(S)]),y++):(v.push([h(y),_(S+1),_(S)]),S++);return b(m,v.filter(e=>Math.abs(f(e.map(e=>s(m,e))))>1e-6))}function C(e,t,n,r,a){let o=[];for(let n of e){if(t.t===`disc`){let e=i(n,[t.cx,t.cy]);if(e>=t.r1-.001)continue;if(e<=-t.r1)return[]}o.push(n)}if(t.t===`plane`&&!o.length)return[];let s=Math.ceil(2*a+8),c=s/2,l=[],u=l,f=[0,0],p=0;for(let{n:e,d:t}of o){let n=Math.atan2(-e[0],e[1]),i=[e[1],-e[0]],a=e[0]*r[0]+e[1]*r[1]-t,o=[r[0]-a*e[0],r[1]-a*e[1]],l=[o[0]-c*i[0],o[1]-c*i[1]],m=n-p,h=d([l[0]-f[0],l[1]-f[1]],-p),g=d([c,c],m),_={t:`clip`,x:h[0]-c+g[0],y:h[1]-c+g[1],size:s,rotate:m,children:[]};u.push(_),u=_.children,f=l,p=n}if(t.t===`disc`){let e=d([t.cx-f[0],t.cy-f[1]],-p);u.push({t:`box`,x:e[0]-t.r1,y:e[1]-t.r1,w:t.r1*2,h:t.r1*2,radius:t.r1,...t.r0>.25?{borderWidth:t.r1-t.r0,borderColor:n}:{color:n}})}else u.push({t:`box`,x:0,y:0,w:s,h:s,color:n});return l}function w(e,t,r){let{pts:i}=e;if(i.length<3)return[];let c=o(i),l=[];i.forEach((t,r)=>{let o=a(t,s(i,(r+1)%i.length),c,e.internal[r]?n:0);o&&l.push(o)}),l.push(...e.guards);let u=1/0,d=1/0,f=-1/0,p=-1/0;for(let e of i)u=Math.min(u,e[0]),d=Math.min(d,e[1]),f=Math.max(f,e[0]),p=Math.max(p,e[1]);return t.t===`disc`&&(u=Math.max(u,t.cx-t.r1),d=Math.max(d,t.cy-t.r1),f=Math.min(f,t.cx+t.r1),p=Math.min(p,t.cy+t.r1)),f>u&&p>d?C(l,t,r,c,2*Math.hypot(f-u,p-d)+n):[]}function T(e){let t=e.filter(e=>e.t===`A`);if(t.length!==0&&t.length!==4)return null;let n=0,r=1/0,i=1/0,a=-1/0,o=-1/0,s=(e,t)=>{r=Math.min(r,e),i=Math.min(i,t),a=Math.max(a,e),o=Math.max(o,t)};for(let t of e)if(t.t===`L`){let e=Math.abs(t.to[0]-t.from[0]),n=Math.abs(t.to[1]-t.from[1]);if(e>.001&&n>.001)return null;s(t.from[0],t.from[1]),s(t.to[0],t.to[1])}else{if(Math.abs(Math.abs(t.a1-t.a0)-Math.PI/2)>.02||n&&Math.abs(t.r-n)>.01)return null;n=t.r,s(t.cx-t.r,t.cy-t.r),s(t.cx+t.r,t.cy+t.r)}if(!(a>r&&o>i))return null;for(let t of e)if(t.t===`A`){let e=Math.abs(t.cx-(r+n))<.05||Math.abs(t.cx-(a-n))<.05,s=Math.abs(t.cy-(i+n))<.05||Math.abs(t.cy-(o-n))<.05;if(!e||!s)return null}else if(Math.abs(t.to[0]-t.from[0])<=.001?!(e=>Math.abs(e-r)<.05||Math.abs(e-a)<.05)(t.from[0]):!(e=>Math.abs(e-i)<.05||Math.abs(e-o)<.05)(t.from[1]))return null;return!t.length&&e.length<4?null:{x:r,y:i,w:a-r,h:o-i,r:n}}function E(e){let t=e.filter(e=>e.t===`A`),n=t[0];if(!n)return null;let{cx:r,cy:i}=n,a=0;for(let e of t){if(Math.hypot(e.cx-r,e.cy-i)>.5)return null;a=Math.max(a,e.r)}let o=0;for(let e of t)if(!(Math.abs(e.r-a)<=.5)){if(o&&Math.abs(e.r-o)>.5)return null;o=e.r}let s=[r,i];for(let t of e)if(t.t===`L`)for(let e of[t.from,t.to]){let t=l(e,s);if(t>a+.5||o>0&&t<o-.5)return null}let c={t:`disc`,cx:r,cy:i,r0:o,r1:a};return{base:c,outline:D(e,c)}}function D(e,{cx:t,cy:n,r1:r}){let i=[];for(let a of e){if(a.t===`L`){i.push(a.from,a.to);continue}let e=a.a1-a.a0;if(Math.abs(a.r-r)<=.5){let o=Math.max(1,Math.ceil(Math.abs(e)/(Math.PI/4))),s=e/o,c=r/Math.cos(s/2);i.push(u(t,n,r,a.a0));for(let e=0;e<o;e++)i.push(u(t,n,c,a.a0+(e+.5)*s)),i.push(u(t,n,r,a.a0+(e+1)*s))}else{let r=Math.max(1,Math.ceil(Math.abs(e)/(Math.PI/2)));for(let o=0;o<=r;o++)i.push(u(t,n,a.r,a.a0+e*o/r))}}return i}var O=(e,t,n,r,i)=>({t:`box`,x:e-n,y:t-n,w:n*2,h:n*2,radius:n,...r>.25?{borderWidth:n-r,borderColor:i}:{color:i}});function k(e,r,o,s=0){let{cx:c,cy:d,r0:f,r1:p}=r,m=[c,d],h=e.filter(e=>e.t===`A`),g=h.filter(e=>Math.abs(e.r-p)<=.5),_=g[0];if(!_||g.length!==1||h.length-g.length>1)return null;let v=Math.min(_.a0,_.a1),y=Math.max(_.a0,_.a1),b=y-v;if(b>=t-.001)return null;let x=(e,n)=>{let r=Math.abs(e-n)%t;return Math.min(r,t-r)},S=null,w=null,T=e=>l(e.from,e.to);for(let t of e){if(t.t!==`L`||T(t)<.3)continue;let e=l(t.from,m)>l(t.to,m)?t.from:t.to,n=l(e,m);if(n<.5)continue;let r=(t.to[0]-t.from[0])/T(t),i=(t.to[1]-t.from[1])/T(t),a=(e[0]-c)/n,o=(e[1]-d)/n;if(Math.abs(r*o-i*a)>.14)continue;let s=Math.atan2(e[1]-d,e[0]-c);x(s,v)<=x(s,y)?(!S||T(t)>T(S))&&(S=t):(!w||T(t)>T(w))&&(w=t)}if(!S||!w)return null;let E=(v+y)/2,D=f>0?(f+p)/2:p/2,O=u(c,d,D,E),k=a(S.from,S.to,O,s),A=a(w.from,w.to,O,s);if(!k||!A||i(k,O)<=0||i(A,O)<=0)return null;let j=2*p+n;if(b<=Math.PI-.001)return C([k,A],r,o,O,j);let M=[c+Math.cos(E),d+Math.sin(E)],N=u(c,d,D,v+b/4),P=u(c,d,D,y-b/4),F=a(m,M,N,n),I=a(m,M,P,n);return!F||!I?null:[...C([k,F],r,o,N,j),...C([A,I],r,o,P,j)]}function A(e,t,n,r,i,a){let o=[t[0]-e[0],t[1]-e[1]],s=o[0]*n[0]+o[1]*n[1],c=[n[1],-n[0]];o[0]*c[0]+o[1]*c[1]<0&&(c=[-c[0],-c[1]]);let l=o[0]*o[0]+o[1]*o[1],u=2*(i?r+s:r-s);if(u<=1e-6)return null;let d=Math.min(a,(i?r*r-l:l-r*r)/u);if(!(d>.5))return null;let f=i?r-d:r+d,p=f*f-(s+d)*(s+d);if(p<=0)return null;let m=Math.sqrt(p),h=t=>[e[0]+m*c[0]+t*n[0],e[1]+m*c[1]+t*n[1]],g=h(s+d),_=r/f;return{o:g,r:d,side:h(s),ring:[e[0]+(g[0]-e[0])*_,e[1]+(g[1]-e[1])*_]}}function j(e,r,o){let{cx:s,cy:c,r0:d,r1:f}=r,p=[s,c],m=(f-d)/2,h=e=>{let t=l(e,p);return Math.abs(t-f)<=.5?f:d>0&&Math.abs(t-d)<=.5?d:0},g=new Map;for(let t of e){if(t.t!==`L`||!t.q||g.has(t.q))continue;let e=t.q,n=h(e.ctrl);if(!n)return null;let r=h(e.from)!==n,i=r?e.from:e.to,o=r?e.to:e.from;if(h(o)!==n||h(i)===n)return null;let s=a(i,e.ctrl,o,0),c=s&&A(p,i,s.n,n,n===f,m);if(!s||!c)return null;g.set(e,{fillet:c,plane:s,sideFirst:r})}if(!g.size)return null;let _=[],v;for(let t of e){let e=t.t===`L`?t.q:void 0;if(e!==v&&e){let{fillet:t,sideFirst:n}=g.get(e),[r,i]=n?[t.side,t.ring]:[t.ring,t.side];_.push({t:`L`,from:r,to:i})}else e||_.push(t);v=e}let y=e=>e-t*Math.round(e/t),b=e=>Math.atan2(e[1]-c,e[0]-s),S=e=>e.t===`L`?[e.from,e.to]:[u(e.cx,e.cy,e.r,e.a0),u(e.cx,e.cy,e.r,e.a1)],w=_.length,T=_.map((e,t)=>{if(e.t!==`A`)return e;let n=S(_[(t-1+w)%w])[1],r=S(_[(t+1)%w])[0],i=Math.abs(l(n,p)-e.r)<=.5?e.a0+y(b(n)-e.a0):e.a0,a=Math.abs(l(r,p)-e.r)<=.5?e.a1+y(b(r)-e.a1):e.a1;return{...e,a0:i,a1:a}});if(T.some((e,t)=>e.t===`A`&&(e.a1-e.a0)*(_[t].a1-_[t].a0)<0))return null;let E=N(x(D(T,r)),r,o),O=[...g.values()].map(e=>e.plane),k=[...g.values()].every(({fillet:e})=>O.every(t=>i(t,e.side)>=-.5));for(let{fillet:e}of g.values())E.push(...C(k?O:[],{t:`disc`,cx:e.o[0],cy:e.o[1],r0:0,r1:e.r},o,e.o,2*e.r+n));return E}var M=(e,t,n)=>({t:`box`,x:e.x,y:e.y,w:e.w,h:e.h,color:t,...e.r>0?{radius:e.r}:null,...n?{shadow:n}:null});function N(e,t,n){let i=[];for(let a of e.slice(0,r))i.push(...w(a,t,n));return i}function P(e,t,n=!1){let r=e.map(e=>({start:[e.x,e.y],items:p(e,!0)})).filter(e=>e.items.length>0);if(!r.length)return[];if(r.every(e=>e.items.length===1&&_(e.items[0]))){let e=r.map(e=>e.items[0]),[n,i]=e;return n&&i&&e.length===2&&Math.hypot(n.cx-i.cx,n.cy-i.cy)<.5&&Math.abs(n.r-i.r)>.25&&n.a1-n.a0>0!=i.a1-i.a0>0?[O(n.cx,n.cy,Math.max(n.r,i.r),Math.min(n.r,i.r),t)]:e.map(e=>O(e.cx,e.cy,e.r,0,t))}let i=r[0];if(r.length===1&&i){let e=T(i.items);if(e)return[M(e,t,n)];let r=E(i.items);if(r)return j(i.items,r.base,t)??k(i.items,r.base,t)??N(x(r.outline),r.base,t)}let a=r.map(e=>m(e.items,e.start)),[o,s]=a;if(a.length===2&&o&&s&&f(o)*f(s)<0&&F(o,s))return N(S(o,s),{t:`plane`},t);let c=[];for(let e of a)c.push(...N(x(e),{t:`plane`},t));return c}function F(e,t){let n=e=>{let t=1/0,n=1/0,r=-1/0,i=-1/0;for(let a of e)t=Math.min(t,a[0]),n=Math.min(n,a[1]),r=Math.max(r,a[0]),i=Math.max(i,a[1]);return{x0:t,y0:n,x1:r,y1:i}},r=n(e),i=n(t);return i.x0>=r.x0-.5&&i.y0>=r.y0-.5&&i.x1<=r.x1+.5&&i.y1<=r.y1+.5}function I(e,t){let n=t.filter(e=>Number.isFinite(e)&&e>=0);n.length%2&&(n=[...n,...n]);let r=n.reduce((e,t)=>e+t,0);if(!n.length||r<=0)return[e.slice()];let i=0;for(let t=1;t<e.length;t++)i+=l(s(e,t-1),s(e,t));let a=i/r>300?i/r/300:1,o=[],c=0,u=n[0]*a,d=!0,f=[s(e,0)];for(let t=1;t<e.length;t++){let r=s(e,t-1),i=s(e,t),p=l(r,i);for(;p>1e-9;){let e=Math.min(u,p),t=e/p,s=[r[0]+(i[0]-r[0])*t,r[1]+(i[1]-r[1])*t];d&&f.push(s),r=s,p-=e,u-=e,u<=1e-9&&(d&&f.length>1&&o.push(f),d=!d,c=(c+1)%n.length,u=Math.max(n[c]*a,d?0:.5),f=[s])}}return d&&f.length>1&&o.push(f),o}var L=(e,t,n,r,i)=>{let a=i===`butt`?0:n,o=l(e,t)+a;return{t:`box`,x:(e[0]+t[0])/2-o/2,y:(e[1]+t[1])/2-n/2,w:o,h:n,color:r,...i===`round`?{radius:n/2}:null,rotate:Math.atan2(t[1]-e[1],t[0]-e[0])}},R=(e,t,n)=>({t:`box`,x:e[0]-t/2,y:e[1]-t/2,w:t,h:t,radius:t/2,color:n});function z(e,t){let r=e.width,i=e.paths.map(e=>({start:[e.x,e.y],items:p(e,e.closed),closed:e.closed})).filter(e=>e.items.length>0);if(!i.length||!(r>0))return[];let a=!e.paint.gradient&&e.dash.length===0,o=i[0];if(a&&i.length===1&&o){let{items:i}=o,a=i[0];if(i.length===1&&a&&_(a))return[O(a.cx,a.cy,a.r+r/2,Math.max(0,a.r-r/2),t([a.cx,a.cy]))];if(i.length===1&&a?.t===`A`){let i=a.r+r/2,o=a.r-r/2,s=t([a.cx,a.cy]),c={...B(a.cx,a.cy,i,a.a0),closed:!0,segs:[{t:`A`,cx:a.cx,cy:a.cy,r:i,a0:a.a0,a1:a.a1},o>.25?{t:`A`,cx:a.cx,cy:a.cy,r:o,a0:a.a1,a1:a.a0}:{t:`L`,x:a.cx,y:a.cy}]},l=e.cap===`round`,d=E(p(c,!0)),f=d&&k(p(c,!0),d.base,s,l?n:0)||P([c],s);return l&&f.push(R(u(a.cx,a.cy,a.r,a.a0),r,s),R(u(a.cx,a.cy,a.r,a.a1),r,s)),f}if(o.closed){let e=T(i);if(e)return[{t:`box`,x:e.x-r/2,y:e.y-r/2,w:e.w+r,h:e.h+r,radius:e.r>0?e.r+r/2:0,borderWidth:r,borderColor:t([e.x,e.y])}]}}let c=[];for(let n of i){let i=m(n.items,n.start,.25),a=h(n.closed?[...i,s(i,0)]:i,!1);if(a.length<2)continue;let o=e.dash.length?I(a,e.dash):[a];for(let n of o){let i=n.length,a=i>2&&l(s(n,0),s(n,i-1))<.001,o=Array(i).fill(0),u=[];if(e.cap!==`round`&&r>=1.5)for(let t=+!a;t<i-1;t++){let a=s(n,t===0?i-2:t-1),c=s(n,t),d=s(n,t+1),f=l(a,c),p=l(c,d),m=f>1e-9&&p>1e-9?((c[0]-a[0])*(d[0]-c[0])+(c[1]-a[1])*(d[1]-c[1]))/(f*p):1,h=Math.acos(Math.max(-1,Math.min(1,m)));e.cap===`butt`&&r>=6&&h<Math.PI/4?(o[t]=r/2*Math.tan(h/2)+.5,t===0&&(o[i-1]=o[0])):u.push(t)}for(let a=1;a<i;a++){let i=s(n,a-1),u=s(n,a),d=l(i,u),f=o[a-1],p=o[a];if(d>1e-9&&(f>0||p>0)){let e=(u[0]-i[0])/d,t=(u[1]-i[1])/d;i=[i[0]-e*f,i[1]-t*f],u=[u[0]+e*p,u[1]+t*p]}let m=[(i[0]+u[0])/2,(i[1]+u[1])/2];c.push(L(i,u,r,t(m),e.cap))}for(let e of u)c.push(R(s(n,e),r,t(s(n,e))))}}return c}var B=(e,t,n,r)=>{let[i,a]=u(e,t,n,r);return{x:i,y:a}},V=(e,t)=>e.length?t>=.999?e:[{t:`group`,opacity:t,children:e}]:[],H=e=>{let t=1/0,n=1/0,r=-1/0,i=-1/0;for(let a of e){let e=(e,a)=>{t=Math.min(t,e),n=Math.min(n,a),r=Math.max(r,e),i=Math.max(i,a)};e(a.x,a.y);for(let t of a.segs)t.t===`L`?e(t.x,t.y):(e(t.cx-t.r,t.cy-t.r),e(t.cx+t.r,t.cy+t.r))}return Number.isFinite(t)?[(t+r)/2,(n+i)/2]:[0,0]};function U(t){let n=e.paintAt(t.paint,...H(t.paths)),r=n.a*t.alpha;return r<=.002?[]:V(P(t.paths,e.opaqueCss(n),t.shadow),r)}function W(t){let{paint:n}=t,r=n.color.a;n.gradient?.stops.length&&(r=Math.max(...n.gradient.stops.map(e=>e.color.a)));let i=r*t.alpha;return i<=.002?[]:V(z(t,t=>{let i=e.paintAt(n,t[0],t[1]);return n.gradient&&r>0&&i.a<r-.001?e.cssWithAlpha(i,1/r):e.opaqueCss(i)}),i)}function G(t){return!t.text||t.alpha*t.color.a<=.002?[]:[{t:`text`,text:t.text,x:t.x,y:t.y,size:t.size,weight:t.weight,align:t.align,baseline:t.baseline,color:e.cssWithAlpha(t.color,t.alpha),rotate:t.rotate,...t.maxWidth===void 0?null:{maxWidth:t.maxWidth},...t.halo?{halo:e.cssWithAlpha(t.halo,t.alpha)}:null}]}function K(e){let t=[];for(let n of e)n.kind===`fill`?t.push(...U(n)):n.kind===`stroke`?t.push(...W(n)):t.push(...G(n));return t}exports.area=f,exports.convexPieces=x,exports.dashPolyline=I,exports.framePrims=K,exports.mergeConvex=b,exports.regionViews=P,exports.triangulate=v;
|
|
1
|
+
const e=require("./recorder.cjs");var t=Math.PI*2,n=.5,r=160,i=(e,t)=>e.n[0]*t[0]+e.n[1]*t[1]-e.d,a=(e,t,n,r)=>{let i=Math.hypot(t[0]-e[0],t[1]-e[1]);if(i<1e-6)return null;let a=[-(t[1]-e[1])/i,(t[0]-e[0])/i];return a[0]*(n[0]-e[0])+a[1]*(n[1]-e[1])<0&&(a=[-a[0],-a[1]]),{n:a,d:a[0]*e[0]+a[1]*e[1]-r}},o=e=>[e.reduce((e,t)=>e+t[0],0)/Math.max(1,e.length),e.reduce((e,t)=>e+t[1],0)/Math.max(1,e.length)],s=(e,t)=>e[t],c=(e,t,n)=>(t[0]-e[0])*(n[1]-e[1])-(t[1]-e[1])*(n[0]-e[0]),l=(e,t)=>Math.hypot(e[0]-t[0],e[1]-t[1]),u=(e,t,n,r)=>[e+n*Math.cos(r),t+n*Math.sin(r)],d=(e,t)=>{let n=Math.cos(t),r=Math.sin(t);return[e[0]*n-e[1]*r,e[0]*r+e[1]*n]},f=e=>{let t=0;for(let n=0;n<e.length;n++){let r=s(e,n),i=s(e,(n+1)%e.length);t+=r[0]*i[1]-i[0]*r[1]}return t/2};function p(e,t){let n=[],r=[e.x,e.y],i=(e,t)=>{l(r,e)>.001&&n.push(t?{t:`L`,from:r,to:e,q:t}:{t:`L`,from:r,to:e}),r=e};for(let t of e.segs)t.t===`L`?i([t.x,t.y],t.q):(i(u(t.cx,t.cy,t.r,t.a0)),n.push({...t}),r=u(t.cx,t.cy,t.r,t.a1));return t&&i([e.x,e.y]),n}function m(e,t,n=.2){let r=[t];for(let t of e)if(t.t===`L`)r.push(t.to);else{let e=t.a1-t.a0,i=t.r>n?Math.max(.04,2*Math.acos(Math.max(-1,1-n/t.r))):Math.PI/2,a=Math.min(128,Math.max(1,Math.ceil(Math.abs(e)/i)));r.push(u(t.cx,t.cy,t.r,t.a0));for(let n=1;n<=a;n++)r.push(u(t.cx,t.cy,t.r,t.a0+e*n/a))}return h(r)}function h(e,t=!0){let n=[];for(let t of e){let e=n[n.length-1];(!e||l(e,t)>.001)&&n.push(t)}return t&&n.length>1&&l(s(n,0),s(n,n.length-1))<=.001&&n.pop(),n}function g(e){let t=h(e),n=!0;for(;n&&t.length>3;){n=!1;for(let e=0;e<t.length;e++){let r=s(t,(e-1+t.length)%t.length),i=s(t,e),a=s(t,(e+1)%t.length),o=Math.max(l(r,i),l(i,a),1e-9),u=c(r,i,a)/o,d=(i[0]-r[0])*(a[0]-i[0])+(i[1]-r[1])*(a[1]-i[1])>0;if(Math.abs(u)<1e-4&&d){t=t.filter((t,n)=>n!==e),n=!0;break}}}return t}var _=e=>e?.t===`A`&&Math.abs(e.a1-e.a0)>=t-1e-6;function v(e){let t=e.length;if(t<3)return[];let n=e.map((e,t)=>t);f(e)<0&&(n=n.reverse());let r=[],i=(e,t,n,r)=>c(t,n,e)>1e-9&&c(n,r,e)>1e-9&&c(r,t,e)>1e-9,a=0;for(;n.length>3&&a++<t*t+10;){let t=!1;for(let a=0;a<n.length;a++){let o=n[(a-1+n.length)%n.length],u=n[a],d=n[(a+1)%n.length],f=s(e,o),p=s(e,u),m=s(e,d);if(c(f,p,m)<=1e-9)continue;let h=!1;for(let t of n){if(t===o||t===u||t===d)continue;let n=s(e,t);if(!(l(n,f)<1e-6||l(n,p)<1e-6||l(n,m)<1e-6)&&i(n,f,p,m)){h=!0;break}}if(!h){r.push([o,u,d]),n.splice(a,1),t=!0;break}}if(!t){let t=0,r=1/0;for(let i=0;i<n.length;i++){let a=Math.abs(c(s(e,n[(i-1+n.length)%n.length]),s(e,n[i]),s(e,n[(i+1)%n.length])));a<r&&(r=a,t=i)}n.splice(t,1)}}if(n.length===3){let[t,i,a]=n;c(s(e,t),s(e,i),s(e,a))>1e-9&&r.push([t,i,a])}return r}var y=(e,t)=>{for(let n=0;n<t.length;n++){let r=s(e,t[(n-1+t.length)%t.length]),i=s(e,t[n]),a=s(e,t[(n+1)%t.length]);if(c(r,i,a)<-1e-7*Math.max(1,l(r,i)*l(i,a)))return!1}return!0};function b(e,t){let n=t.map(t=>f(t.map(t=>s(e,t)))<0?[...t].reverse():[...t]),r=!0;for(;r;){r=!1;outer:for(let t=0;t<n.length;t++){let i=n[t];for(let a=0;a<i.length;a++){let o=i[a],s=i[(a+1)%i.length];for(let c=t+1;c<n.length;c++){let l=n[c],u=l.findIndex((e,t)=>e===s&&l[(t+1)%l.length]===o);if(u<0)continue;let d=(a+1)%i.length,f=[];for(let e=0;e<i.length;e++)f.push(i[(d+e)%i.length]);let p=[];for(let e=2;e<l.length;e++)p.push(l[(u+e)%l.length]);let m=[...f,...p];if(y(e,m)){n[t]=m,n.splice(c,1),r=!0;break outer}}}}}let c=new Set;for(let e of n)for(let t=0;t<e.length;t++)c.add(`${e[t]},${e[(t+1)%e.length]}`);let l=e=>e.map((t,n)=>c.has(`${e[(n+1)%e.length]},${t}`)),u=[];for(let t of n){let n=o(t.map(t=>s(e,t)));l(t).forEach((e,r)=>{e||u.push({a:t[r],b:t[(r+1)%t.length],ref:n})})}return n.map(t=>{let n=t.map(t=>s(e,t)),r=l(t),o=new Set;r.forEach((e,n)=>{e&&(o.add(t[n]),o.add(t[(n+1)%t.length]))});let c=new Set(t.map((e,n)=>`${e},${t[(n+1)%t.length]}`)),d=[];for(let t of u){if(!(o.has(t.a)||o.has(t.b))||c.has(`${t.a},${t.b}`))continue;let r=a(s(e,t.a),s(e,t.b),t.ref,0);r&&n.every(e=>i(r,e)>=-1e-6)&&d.push(r)}return{pts:n,internal:r,guards:d}})}function x(e){let t=g(e);return t.length<3?[]:b(t,v(t))}function S(e,n){let r=g(e),i=g(n);if(r.length<3||i.length<3)return x(e);let a=e=>f(e)<0?[...e].reverse():e,o=a(r),c=a(i),l=[c.reduce((e,t)=>e+t[0],0)/c.length,c.reduce((e,t)=>e+t[1],0)/c.length],u=e=>{let n=e.map(e=>Math.atan2(e[1]-l[1],e[0]-l[0])),r=0;n.forEach((e,t)=>{e<n[r]&&(r=t)});let i=e.map((t,n)=>(r+n)%e.length),a=[],o=-1/0;for(let e of i){let r=n[e];for(;r<o;)r+=t;a.push(r),o=r}return a.push(a[0]+t),{order:i,angles:a}},d=u(o),p=u(c),m=[...o,...c],h=e=>d.order[e%o.length],_=e=>o.length+p.order[e%c.length],v=[],y=0,S=0;for(;y<o.length||S<c.length;)(y<o.length?d.angles[y+1]:1/0)<=(S<c.length?p.angles[S+1]:1/0)?(v.push([h(y),h(y+1),_(S)]),y++):(v.push([h(y),_(S+1),_(S)]),S++);return b(m,v.filter(e=>Math.abs(f(e.map(e=>s(m,e))))>1e-6))}function C(e,t,n,r,a){let o=[];for(let n of e){if(t.t===`disc`){let e=i(n,[t.cx,t.cy]);if(e>=t.r1-.001)continue;if(e<=-t.r1)return[]}o.push(n)}if(t.t===`plane`&&!o.length)return[];let s=Math.ceil(2*a+8),c=s/2,l=[],u=l,f=[0,0],p=0;for(let{n:e,d:t}of o){let n=Math.atan2(-e[0],e[1]),i=[e[1],-e[0]],a=e[0]*r[0]+e[1]*r[1]-t,o=[r[0]-a*e[0],r[1]-a*e[1]],l=[o[0]-c*i[0],o[1]-c*i[1]],m=n-p,h=d([l[0]-f[0],l[1]-f[1]],-p),g=d([c,c],m),_={t:`clip`,x:h[0]-c+g[0],y:h[1]-c+g[1],size:s,rotate:m,children:[]};u.push(_),u=_.children,f=l,p=n}if(t.t===`disc`){let e=d([t.cx-f[0],t.cy-f[1]],-p);u.push({t:`box`,x:e[0]-t.r1,y:e[1]-t.r1,w:t.r1*2,h:t.r1*2,radius:t.r1,...t.r0>.25?{borderWidth:t.r1-t.r0,borderColor:n}:{color:n}})}else u.push({t:`box`,x:0,y:0,w:s,h:s,color:n});return l}function w(e,t,r){let{pts:c}=e;if(c.length<3)return[];let l=o(c),u=[];c.forEach((t,r)=>{let i=a(t,s(c,(r+1)%c.length),l,e.internal[r]?n:0);i&&u.push(i)}),u.push(...e.guards);let d=1/0,f=1/0,p=-1/0,m=-1/0;for(let e of c)d=Math.min(d,e[0]),f=Math.min(f,e[1]),p=Math.max(p,e[0]),m=Math.max(m,e[1]);if(t.t===`disc`&&(d=Math.max(d,t.cx-t.r1),f=Math.max(f,t.cy-t.r1),p=Math.min(p,t.cx+t.r1),m=Math.min(m,t.cy+t.r1)),!(p>d&&m>f))return[];let h=2*Math.hypot(p-d,m-f)+n;for(let t of e.guards)h=Math.max(h,i(t,l)+n);return C(u,t,r,l,h)}function T(e){let t=e.filter(e=>e.t===`A`);if(t.length!==0&&t.length!==4)return null;let n=0,r=1/0,i=1/0,a=-1/0,o=-1/0,s=(e,t)=>{r=Math.min(r,e),i=Math.min(i,t),a=Math.max(a,e),o=Math.max(o,t)};for(let t of e)if(t.t===`L`){let e=Math.abs(t.to[0]-t.from[0]),n=Math.abs(t.to[1]-t.from[1]);if(e>.001&&n>.001)return null;s(t.from[0],t.from[1]),s(t.to[0],t.to[1])}else{if(Math.abs(Math.abs(t.a1-t.a0)-Math.PI/2)>.02||n&&Math.abs(t.r-n)>.01)return null;n=t.r,s(t.cx-t.r,t.cy-t.r),s(t.cx+t.r,t.cy+t.r)}if(!(a>r&&o>i))return null;for(let t of e)if(t.t===`A`){let e=Math.abs(t.cx-(r+n))<.05||Math.abs(t.cx-(a-n))<.05,s=Math.abs(t.cy-(i+n))<.05||Math.abs(t.cy-(o-n))<.05;if(!e||!s)return null}else if(Math.abs(t.to[0]-t.from[0])<=.001?!(e=>Math.abs(e-r)<.05||Math.abs(e-a)<.05)(t.from[0]):!(e=>Math.abs(e-i)<.05||Math.abs(e-o)<.05)(t.from[1]))return null;return!t.length&&e.length<4?null:{x:r,y:i,w:a-r,h:o-i,r:n}}function E(e){let t=e.filter(e=>e.t===`A`),n=t[0];if(!n)return null;let{cx:r,cy:i}=n,a=0;for(let e of t){if(Math.hypot(e.cx-r,e.cy-i)>.5)return null;a=Math.max(a,e.r)}let o=0;for(let e of t)if(!(Math.abs(e.r-a)<=.5)){if(o&&Math.abs(e.r-o)>.5)return null;o=e.r}let s=[r,i];for(let t of e)if(t.t===`L`)for(let e of[t.from,t.to]){let t=l(e,s);if(t>a+.5||o>0&&t<o-.5)return null}let c={t:`disc`,cx:r,cy:i,r0:o,r1:a};return{base:c,outline:D(e,c)}}function D(e,{cx:t,cy:n,r1:r}){let i=[];for(let a of e){if(a.t===`L`){i.push(a.from,a.to);continue}let e=a.a1-a.a0;if(Math.abs(a.r-r)<=.5){let o=Math.max(1,Math.ceil(Math.abs(e)/(Math.PI/4))),s=e/o,c=r/Math.cos(s/2);i.push(u(t,n,r,a.a0));for(let e=0;e<o;e++)i.push(u(t,n,c,a.a0+(e+.5)*s)),i.push(u(t,n,r,a.a0+(e+1)*s))}else{let r=Math.max(1,Math.ceil(Math.abs(e)/(Math.PI/2)));for(let o=0;o<=r;o++)i.push(u(t,n,a.r,a.a0+e*o/r))}}return i}var O=(e,t,n,r,i)=>({t:`box`,x:e-n,y:t-n,w:n*2,h:n*2,radius:n,...r>.25?{borderWidth:n-r,borderColor:i}:{color:i}});function k(e,r,o,s=0){let{cx:c,cy:d,r0:f,r1:p}=r,m=[c,d],h=e.filter(e=>e.t===`A`),g=h.filter(e=>Math.abs(e.r-p)<=.5),_=g[0];if(!_||g.length!==1||h.length-g.length>1)return null;let v=Math.min(_.a0,_.a1),y=Math.max(_.a0,_.a1),b=y-v;if(b>=t-.001)return null;let x=(e,n)=>{let r=Math.abs(e-n)%t;return Math.min(r,t-r)},S=null,w=null,T=e=>l(e.from,e.to);for(let t of e){if(t.t!==`L`||T(t)<.3)continue;let e=l(t.from,m)>l(t.to,m)?t.from:t.to,n=l(e,m);if(n<.5)continue;let r=(t.to[0]-t.from[0])/T(t),i=(t.to[1]-t.from[1])/T(t),a=(e[0]-c)/n,o=(e[1]-d)/n;if(Math.abs(r*o-i*a)>.14)continue;let s=Math.atan2(e[1]-d,e[0]-c);x(s,v)<=x(s,y)?(!S||T(t)>T(S))&&(S=t):(!w||T(t)>T(w))&&(w=t)}if(!S||!w)return null;let E=(v+y)/2,D=f>0?(f+p)/2:p/2,O=u(c,d,D,E),k=a(S.from,S.to,O,s),A=a(w.from,w.to,O,s);if(!k||!A||i(k,O)<=0||i(A,O)<=0)return null;let j=2*p+n;if(b<=Math.PI-.001)return C([k,A],r,o,O,j);let M=[c+Math.cos(E),d+Math.sin(E)],N=u(c,d,D,v+b/4),P=u(c,d,D,y-b/4),F=a(m,M,N,n),I=a(m,M,P,n);return!F||!I?null:[...C([k,F],r,o,N,j),...C([A,I],r,o,P,j)]}function A(e,t,n,r,i,a){let o=[t[0]-e[0],t[1]-e[1]],s=o[0]*n[0]+o[1]*n[1],c=[n[1],-n[0]];o[0]*c[0]+o[1]*c[1]<0&&(c=[-c[0],-c[1]]);let l=o[0]*o[0]+o[1]*o[1],u=2*(i?r+s:r-s);if(u<=1e-6)return null;let d=Math.min(a,(i?r*r-l:l-r*r)/u);if(!(d>.5))return null;let f=i?r-d:r+d,p=f*f-(s+d)*(s+d);if(p<=0)return null;let m=Math.sqrt(p),h=t=>[e[0]+m*c[0]+t*n[0],e[1]+m*c[1]+t*n[1]],g=h(s+d),_=r/f;return{o:g,r:d,side:h(s),ring:[e[0]+(g[0]-e[0])*_,e[1]+(g[1]-e[1])*_]}}function j(e,r,o){let{cx:s,cy:c,r0:d,r1:f}=r,p=[s,c],m=(f-d)/2,h=e=>{let t=l(e,p);return Math.abs(t-f)<=.5?f:d>0&&Math.abs(t-d)<=.5?d:0},g=new Map;for(let t of e){if(t.t!==`L`||!t.q||g.has(t.q))continue;let e=t.q,n=h(e.ctrl);if(!n)return null;let r=h(e.from)!==n,i=r?e.from:e.to,o=r?e.to:e.from;if(h(o)!==n||h(i)===n)return null;let s=a(i,e.ctrl,o,0),c=s&&A(p,i,s.n,n,n===f,m);if(!s||!c)return null;g.set(e,{fillet:c,plane:s,sideFirst:r})}if(!g.size)return null;let _=[],v;for(let t of e){let e=t.t===`L`?t.q:void 0;if(e!==v&&e){let{fillet:t,sideFirst:n}=g.get(e),[r,i]=n?[t.side,t.ring]:[t.ring,t.side];_.push({t:`L`,from:r,to:i})}else e||_.push(t);v=e}let y=e=>e-t*Math.round(e/t),b=e=>Math.atan2(e[1]-c,e[0]-s),S=e=>e.t===`L`?[e.from,e.to]:[u(e.cx,e.cy,e.r,e.a0),u(e.cx,e.cy,e.r,e.a1)],w=_.length,T=_.map((e,t)=>{if(e.t!==`A`)return e;let n=S(_[(t-1+w)%w])[1],r=S(_[(t+1)%w])[0],i=Math.abs(l(n,p)-e.r)<=.5?e.a0+y(b(n)-e.a0):e.a0,a=Math.abs(l(r,p)-e.r)<=.5?e.a1+y(b(r)-e.a1):e.a1;return{...e,a0:i,a1:a}});if(T.some((e,t)=>e.t===`A`&&(e.a1-e.a0)*(_[t].a1-_[t].a0)<0))return null;let E=N(x(D(T,r)),r,o),O=[...g.values()].map(e=>e.plane),k=[...g.values()].every(({fillet:e})=>O.every(t=>i(t,e.side)>=-.5));for(let{fillet:e}of g.values())E.push(...C(k?O:[],{t:`disc`,cx:e.o[0],cy:e.o[1],r0:0,r1:e.r},o,e.o,2*e.r+n));return E}var M=(e,t,n)=>({t:`box`,x:e.x,y:e.y,w:e.w,h:e.h,color:t,...e.r>0?{radius:e.r}:null,...n?{shadow:n}:null});function N(e,t,n){let i=[];for(let a of e.slice(0,r))i.push(...w(a,t,n));return i}function P(e,t,n=!1){let r=e.map(e=>({start:[e.x,e.y],items:p(e,!0)})).filter(e=>e.items.length>0);if(!r.length)return[];if(r.every(e=>e.items.length===1&&_(e.items[0]))){let e=r.map(e=>e.items[0]),[n,i]=e;return n&&i&&e.length===2&&Math.hypot(n.cx-i.cx,n.cy-i.cy)<.5&&Math.abs(n.r-i.r)>.25&&n.a1-n.a0>0!=i.a1-i.a0>0?[O(n.cx,n.cy,Math.max(n.r,i.r),Math.min(n.r,i.r),t)]:e.map(e=>O(e.cx,e.cy,e.r,0,t))}let i=r[0];if(r.length===1&&i){let e=T(i.items);if(e)return[M(e,t,n)];let r=E(i.items),a=r&&(j(i.items,r.base,t)??k(i.items,r.base,t));if(a)return a}let a=[];for(let e of F(r))a.push(...N(e.pieces,e.base,t));return a}function F(e){let t=e[0];if(e.length===1&&t){let e=E(t.items);if(e)return[{pieces:x(e.outline),base:e.base}]}let n=e.map(e=>m(e.items,e.start)),[r,i]=n;return n.length===2&&r&&i&&f(r)*f(i)<0&&B(r,i)?[{pieces:S(r,i),base:{t:`plane`}}]:n.map(e=>({pieces:x(e),base:{t:`plane`}}))}var I=8,L=240;function R(e,t,n,r){let i=e.pts,a=e.internal,o=e=>{let t=[],n=[];i.forEach((r,o)=>{let c=s(i,(o+1)%i.length),l=e(r),u=e(c),d=a[o]??!1,f=()=>{let e=l/(l-u);return[r[0]+(c[0]-r[0])*e,r[1]+(c[1]-r[1])*e]};l>=0?(t.push(r),n.push(d),u<0&&(t.push(f()),n.push(!0))):u>=0&&(t.push(f()),n.push(d))}),i=t,a=n},c=e=>t[0]*e[0]+t[1]*e[1];Number.isFinite(n)&&o(e=>c(e)-n),Number.isFinite(r)&&o(e=>r-c(e));let u=[],d=[];for(i.forEach((e,t)=>{let n=u[u.length-1];n&&l(n,e)<=.001?d[d.length-1]=a[t]??!0:(u.push(e),d.push(a[t]??!0))});u.length>1&&l(s(u,0),s(u,u.length-1))<=.001;)u.pop(),d.pop();return u.length<3||Math.abs(f(u))<.05?null:{pts:u,internal:d,guards:e.guards}}function z(e,t,n,r){let i=Math.hypot(n.x1-n.x0,n.y1-n.y0);if(i<2||r<8)return null;let a=[(n.x1-n.x0)/i,(n.y1-n.y0)/i],o=a[0]*n.x0+a[1]*n.y0,s=F(e.map(e=>({start:[e.x,e.y],items:p(e,!0)})).filter(e=>e.items.length>0)),c=1/0,l=-1/0;for(let e of s)for(let t of e.pieces)for(let e of t.pts){let t=a[0]*e[0]+a[1]*e[1]-o;c=Math.min(c,t),l=Math.max(l,t)}let u=Math.min(Math.max(0,c),l),d=Math.min(Math.max(i,c),l),f=Math.min(I,Math.ceil(r/20),Math.floor((d-u)/6));if(f<2)return null;let m=[],h=L;for(let e=0;e<f&&h>0;e++){let n=e===0?-1/0:o+u+(d-u)*e/f,r=e===f-1?1/0:o+u+(d-u)*(e+1)/f,i=o+u+(d-u)*(e+.5)/f,c=t([a[0]*i,a[1]*i]);for(let e of s)for(let t of e.pieces){if(h<=0)break;let i=t.pts.map(e=>a[0]*e[0]+a[1]*e[1]);if(Math.max(...i)<=n||Math.min(...i)>=r)continue;let o=R(t,a,n,r);o&&(h--,m.push(...w(o,e.base,c)))}}return m}function B(e,t){let n=e=>{let t=1/0,n=1/0,r=-1/0,i=-1/0;for(let a of e)t=Math.min(t,a[0]),n=Math.min(n,a[1]),r=Math.max(r,a[0]),i=Math.max(i,a[1]);return{x0:t,y0:n,x1:r,y1:i}},r=n(e),i=n(t);return i.x0>=r.x0-.5&&i.y0>=r.y0-.5&&i.x1<=r.x1+.5&&i.y1<=r.y1+.5}function V(e,t){let n=t.filter(e=>Number.isFinite(e)&&e>=0);n.length%2&&(n=[...n,...n]);let r=n.reduce((e,t)=>e+t,0);if(!n.length||r<=0)return[e.slice()];let i=0;for(let t=1;t<e.length;t++)i+=l(s(e,t-1),s(e,t));let a=i/r>300?i/r/300:1,o=[],c=0,u=n[0]*a,d=!0,f=[s(e,0)];for(let t=1;t<e.length;t++){let r=s(e,t-1),i=s(e,t),p=l(r,i);for(;p>1e-9;){let e=Math.min(u,p),t=e/p,s=[r[0]+(i[0]-r[0])*t,r[1]+(i[1]-r[1])*t];d&&f.push(s),r=s,p-=e,u-=e,u<=1e-9&&(d&&f.length>1&&o.push(f),d=!d,c=(c+1)%n.length,u=Math.max(n[c]*a,d?0:.5),f=[s])}}return d&&f.length>1&&o.push(f),o}var H=(e,t,n,r,i)=>{let a=i===`butt`?0:n,o=l(e,t)+a;return{t:`box`,x:(e[0]+t[0])/2-o/2,y:(e[1]+t[1])/2-n/2,w:o,h:n,color:r,...i===`round`?{radius:n/2}:null,rotate:Math.atan2(t[1]-e[1],t[0]-e[0])}},U=(e,t,n)=>({t:`box`,x:e[0]-t/2,y:e[1]-t/2,w:t,h:t,radius:t/2,color:n});function W(e,t){let r=e.width,i=e.paths.map(e=>({start:[e.x,e.y],items:p(e,e.closed),closed:e.closed})).filter(e=>e.items.length>0);if(!i.length||!(r>0))return[];let a=!e.paint.gradient&&e.dash.length===0,o=i[0];if(a&&i.length===1&&o){let{items:i}=o,a=i[0];if(i.length===1&&a&&_(a))return[O(a.cx,a.cy,a.r+r/2,Math.max(0,a.r-r/2),t([a.cx,a.cy]))];if(i.length===1&&a?.t===`A`){let i=a.r+r/2,o=a.r-r/2,s=t([a.cx,a.cy]),c={...G(a.cx,a.cy,i,a.a0),closed:!0,segs:[{t:`A`,cx:a.cx,cy:a.cy,r:i,a0:a.a0,a1:a.a1},o>.25?{t:`A`,cx:a.cx,cy:a.cy,r:o,a0:a.a1,a1:a.a0}:{t:`L`,x:a.cx,y:a.cy}]},l=e.cap===`round`,d=E(p(c,!0)),f=d&&k(p(c,!0),d.base,s,l?n:0)||P([c],s);return l&&f.push(U(u(a.cx,a.cy,a.r,a.a0),r,s),U(u(a.cx,a.cy,a.r,a.a1),r,s)),f}if(o.closed){let e=T(i);if(e)return[{t:`box`,x:e.x-r/2,y:e.y-r/2,w:e.w+r,h:e.h+r,radius:e.r>0?e.r+r/2:0,borderWidth:r,borderColor:t([e.x,e.y])}]}}let c=[];for(let n of i){let i=m(n.items,n.start,.25),a=h(n.closed?[...i,s(i,0)]:i,!1);if(a.length<2)continue;let o=e.dash.length?V(a,e.dash):[a];for(let n of o){let i=n.length,a=i>2&&l(s(n,0),s(n,i-1))<.001,o=Array(i).fill(0),u=[];if(e.cap!==`round`&&r>=1.5)for(let t=+!a;t<i-1;t++){let a=s(n,t===0?i-2:t-1),c=s(n,t),d=s(n,t+1),f=l(a,c),p=l(c,d),m=f>1e-9&&p>1e-9?((c[0]-a[0])*(d[0]-c[0])+(c[1]-a[1])*(d[1]-c[1]))/(f*p):1,h=Math.acos(Math.max(-1,Math.min(1,m)));e.cap===`butt`&&r>=6&&h<Math.PI/4?(o[t]=r/2*Math.tan(h/2)+.5,t===0&&(o[i-1]=o[0])):u.push(t)}for(let a=1;a<i;a++){let i=s(n,a-1),u=s(n,a),d=l(i,u),f=o[a-1],p=o[a];if(d>1e-9&&(f>0||p>0)){let e=(u[0]-i[0])/d,t=(u[1]-i[1])/d;i=[i[0]-e*f,i[1]-t*f],u=[u[0]+e*p,u[1]+t*p]}let m=[(i[0]+u[0])/2,(i[1]+u[1])/2];c.push(H(i,u,r,t(m),e.cap))}for(let e of u)c.push(U(s(n,e),r,t(s(n,e))))}}return c}var G=(e,t,n,r)=>{let[i,a]=u(e,t,n,r);return{x:i,y:a}},K=(e,t)=>e.length?t>=.999?e:[{t:`group`,opacity:t,children:e}]:[],q=e=>{let t=1/0,n=1/0,r=-1/0,i=-1/0;for(let a of e){let e=(e,a)=>{t=Math.min(t,e),n=Math.min(n,a),r=Math.max(r,e),i=Math.max(i,a)};e(a.x,a.y);for(let t of a.segs)t.t===`L`?e(t.x,t.y):(e(t.cx-t.r,t.cy-t.r),e(t.cx+t.r,t.cy+t.r))}return Number.isFinite(t)?[(t+r)/2,(n+i)/2]:[0,0]};function J(t){let{paint:n}=t,r=n.gradient?.stops??[];if(n.gradient&&r.length>1){let i=Math.max(...r.map(e=>e.color.a)),a=i*t.alpha;if(a<=.002)return[];let o=0;for(let e of r){let t=r[0]?.color??e.color;o=Math.max(o,Math.abs(e.color.r-t.r),Math.abs(e.color.g-t.g),Math.abs(e.color.b-t.b),Math.abs(e.color.a-t.a)*255)}let s=z(t.paths,t=>{let r=e.paintAt(n,t[0],t[1]);return i>0&&r.a<i-.001?e.cssWithAlpha(r,1/i):e.opaqueCss(r)},n.gradient,o);if(s)return K(s,a)}let i=e.paintAt(n,...q(t.paths)),a=i.a*t.alpha;return a<=.002?[]:K(P(t.paths,e.opaqueCss(i),t.shadow),a)}function Y(t){let{paint:n}=t,r=n.color.a;n.gradient?.stops.length&&(r=Math.max(...n.gradient.stops.map(e=>e.color.a)));let i=r*t.alpha;return i<=.002?[]:K(W(t,t=>{let i=e.paintAt(n,t[0],t[1]);return n.gradient&&r>0&&i.a<r-.001?e.cssWithAlpha(i,1/r):e.opaqueCss(i)}),i)}function X(t){return!t.text||t.alpha*t.color.a<=.002?[]:[{t:`text`,text:t.text,x:t.x,y:t.y,size:t.size,weight:t.weight,align:t.align,baseline:t.baseline,color:e.cssWithAlpha(t.color,t.alpha),rotate:t.rotate,...t.maxWidth===void 0?null:{maxWidth:t.maxWidth},...t.halo?{halo:e.cssWithAlpha(t.halo,t.alpha)}:null}]}function Z(e){let t=[];for(let n of e)n.kind===`fill`?t.push(...J(n)):n.kind===`stroke`?t.push(...Y(n)):t.push(...X(n));return t}exports.area=f,exports.convexPieces=x,exports.dashPolyline=V,exports.framePrims=Z,exports.mergeConvex=b,exports.regionViews=P,exports.triangulate=v;
|
|
2
2
|
//# sourceMappingURL=geometry.cjs.map
|