minerva-design 1.4.0 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/README.md +21 -21
- package/custom-elements.json +4047 -1703
- package/dist/angular/fesm2022/minerva-angular.mjs +1436 -5
- package/dist/angular/fesm2022/minerva-angular.mjs.map +1 -1
- package/dist/angular/types/minerva-angular.d.ts +573 -4
- package/dist/charts/canvas.d.cts +2 -2
- package/dist/charts/canvas.d.ts +2 -2
- package/dist/charts/core.cjs +1 -1
- package/dist/charts/core.d.cts +6 -4
- package/dist/charts/core.d.ts +6 -4
- package/dist/charts/core.js +24 -16
- package/dist/charts/engine/axis.cjs +1 -1
- package/dist/charts/engine/axis.cjs.map +1 -1
- package/dist/charts/engine/axis.js +42 -19
- package/dist/charts/engine/axis.js.map +1 -1
- package/dist/charts/engine/canvas.cjs +1 -1
- package/dist/charts/engine/canvas.cjs.map +1 -1
- package/dist/charts/engine/canvas.js +154 -127
- 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 +365 -251
- package/dist/charts/engine/chart.js.map +1 -1
- package/dist/charts/engine/color.cjs +1 -1
- package/dist/charts/engine/color.cjs.map +1 -1
- package/dist/charts/engine/color.d.cts +18 -0
- package/dist/charts/engine/color.d.ts +18 -0
- package/dist/charts/engine/color.js +48 -2
- package/dist/charts/engine/color.js.map +1 -1
- package/dist/charts/engine/controller.cjs +2 -2
- package/dist/charts/engine/controller.cjs.map +1 -1
- package/dist/charts/engine/controller.d.cts +32 -1
- package/dist/charts/engine/controller.d.ts +32 -1
- package/dist/charts/engine/controller.js +310 -263
- package/dist/charts/engine/controller.js.map +1 -1
- package/dist/charts/engine/data.cjs +1 -1
- package/dist/charts/engine/data.cjs.map +1 -1
- package/dist/charts/engine/data.d.cts +3 -1
- package/dist/charts/engine/data.d.ts +3 -1
- package/dist/charts/engine/data.js +6 -4
- package/dist/charts/engine/data.js.map +1 -1
- package/dist/charts/engine/defaults.cjs +2 -0
- package/dist/charts/engine/defaults.cjs.map +1 -0
- package/dist/charts/engine/defaults.d.cts +20 -0
- package/dist/charts/engine/defaults.d.ts +20 -0
- package/dist/charts/engine/defaults.js +35 -0
- package/dist/charts/engine/defaults.js.map +1 -0
- package/dist/charts/engine/format.cjs +1 -1
- package/dist/charts/engine/format.cjs.map +1 -1
- package/dist/charts/engine/format.d.cts +6 -0
- package/dist/charts/engine/format.d.ts +6 -0
- package/dist/charts/engine/format.js +15 -2
- package/dist/charts/engine/format.js.map +1 -1
- package/dist/charts/engine/graph/chart.cjs +2 -0
- package/dist/charts/engine/graph/chart.cjs.map +1 -0
- package/dist/charts/engine/graph/chart.d.cts +3 -0
- package/dist/charts/engine/graph/chart.d.ts +3 -0
- package/dist/charts/engine/graph/chart.js +1565 -0
- package/dist/charts/engine/graph/chart.js.map +1 -0
- package/dist/charts/engine/graph/circular.cjs +2 -0
- package/dist/charts/engine/graph/circular.cjs.map +1 -0
- package/dist/charts/engine/graph/circular.d.cts +16 -0
- package/dist/charts/engine/graph/circular.d.ts +16 -0
- package/dist/charts/engine/graph/circular.js +62 -0
- package/dist/charts/engine/graph/circular.js.map +1 -0
- package/dist/charts/engine/graph/dag.cjs +2 -0
- package/dist/charts/engine/graph/dag.cjs.map +1 -0
- package/dist/charts/engine/graph/dag.d.cts +34 -0
- package/dist/charts/engine/graph/dag.d.ts +34 -0
- package/dist/charts/engine/graph/dag.js +314 -0
- package/dist/charts/engine/graph/dag.js.map +1 -0
- package/dist/charts/engine/graph/dom.cjs +2 -0
- package/dist/charts/engine/graph/dom.cjs.map +1 -0
- package/dist/charts/engine/graph/dom.d.cts +23 -0
- package/dist/charts/engine/graph/dom.d.ts +23 -0
- package/dist/charts/engine/graph/dom.js +158 -0
- package/dist/charts/engine/graph/dom.js.map +1 -0
- package/dist/charts/engine/graph/force.cjs +2 -0
- package/dist/charts/engine/graph/force.cjs.map +1 -0
- package/dist/charts/engine/graph/force.d.cts +67 -0
- package/dist/charts/engine/graph/force.d.ts +67 -0
- package/dist/charts/engine/graph/force.js +325 -0
- package/dist/charts/engine/graph/force.js.map +1 -0
- package/dist/charts/engine/graph/geometry.cjs +2 -0
- package/dist/charts/engine/graph/geometry.cjs.map +1 -0
- package/dist/charts/engine/graph/geometry.d.cts +37 -0
- package/dist/charts/engine/graph/geometry.d.ts +37 -0
- package/dist/charts/engine/graph/geometry.js +144 -0
- package/dist/charts/engine/graph/geometry.js.map +1 -0
- package/dist/charts/engine/graph/index.cjs +1 -0
- package/dist/charts/engine/graph/index.d.cts +6 -0
- package/dist/charts/engine/graph/index.d.ts +6 -0
- package/dist/charts/engine/graph/index.js +6 -0
- package/dist/charts/engine/graph/labels.cjs +2 -0
- package/dist/charts/engine/graph/labels.cjs.map +1 -0
- package/dist/charts/engine/graph/labels.d.cts +12 -0
- package/dist/charts/engine/graph/labels.d.ts +12 -0
- package/dist/charts/engine/graph/labels.js +128 -0
- package/dist/charts/engine/graph/labels.js.map +1 -0
- package/dist/charts/engine/graph/model.cjs +2 -0
- package/dist/charts/engine/graph/model.cjs.map +1 -0
- package/dist/charts/engine/graph/model.d.cts +43 -0
- package/dist/charts/engine/graph/model.d.ts +43 -0
- package/dist/charts/engine/graph/model.js +88 -0
- package/dist/charts/engine/graph/model.js.map +1 -0
- package/dist/charts/engine/graph/sizing.cjs +2 -0
- package/dist/charts/engine/graph/sizing.cjs.map +1 -0
- package/dist/charts/engine/graph/sizing.d.cts +33 -0
- package/dist/charts/engine/graph/sizing.d.ts +33 -0
- package/dist/charts/engine/graph/sizing.js +60 -0
- package/dist/charts/engine/graph/sizing.js.map +1 -0
- package/dist/charts/engine/graph/tree.cjs +2 -0
- package/dist/charts/engine/graph/tree.cjs.map +1 -0
- package/dist/charts/engine/graph/tree.d.cts +30 -0
- package/dist/charts/engine/graph/tree.d.ts +30 -0
- package/dist/charts/engine/graph/tree.js +218 -0
- package/dist/charts/engine/graph/tree.js.map +1 -0
- package/dist/charts/engine/graph/types.d.cts +626 -0
- package/dist/charts/engine/graph/types.d.ts +626 -0
- package/dist/charts/engine/graph/worker.cjs +46 -0
- package/dist/charts/engine/graph/worker.cjs.map +1 -0
- package/dist/charts/engine/graph/worker.d.cts +36 -0
- package/dist/charts/engine/graph/worker.d.ts +36 -0
- package/dist/charts/engine/graph/worker.js +129 -0
- package/dist/charts/engine/graph/worker.js.map +1 -0
- package/dist/charts/engine/items.cjs +1 -1
- package/dist/charts/engine/items.cjs.map +1 -1
- package/dist/charts/engine/items.d.cts +15 -2
- package/dist/charts/engine/items.d.ts +15 -2
- package/dist/charts/engine/items.js +131 -112
- package/dist/charts/engine/items.js.map +1 -1
- package/dist/charts/engine/labels.cjs +1 -1
- package/dist/charts/engine/labels.cjs.map +1 -1
- package/dist/charts/engine/labels.js +28 -4
- package/dist/charts/engine/labels.js.map +1 -1
- package/dist/charts/engine/layout.cjs +1 -1
- package/dist/charts/engine/layout.cjs.map +1 -1
- package/dist/charts/engine/layout.d.cts +9 -0
- package/dist/charts/engine/layout.d.ts +9 -0
- package/dist/charts/engine/layout.js +11 -2
- package/dist/charts/engine/layout.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 +40 -3
- package/dist/charts/engine/model.d.ts +40 -3
- package/dist/charts/engine/model.js +246 -165
- package/dist/charts/engine/model.js.map +1 -1
- package/dist/charts/engine/orderbook/format.cjs +1 -1
- package/dist/charts/engine/orderbook/format.cjs.map +1 -1
- package/dist/charts/engine/orderbook/format.d.cts +3 -2
- package/dist/charts/engine/orderbook/format.d.ts +3 -2
- package/dist/charts/engine/orderbook/format.js +5 -5
- package/dist/charts/engine/orderbook/format.js.map +1 -1
- 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 +527 -408
- package/dist/charts/engine/orderbook/heatmap.js.map +1 -1
- package/dist/charts/engine/orderbook/layout.cjs +2 -0
- package/dist/charts/engine/orderbook/layout.cjs.map +1 -0
- package/dist/charts/engine/orderbook/layout.d.cts +37 -0
- package/dist/charts/engine/orderbook/layout.d.ts +37 -0
- package/dist/charts/engine/orderbook/layout.js +70 -0
- package/dist/charts/engine/orderbook/layout.js.map +1 -0
- package/dist/charts/engine/orderbook/tape.cjs +1 -1
- package/dist/charts/engine/orderbook/tape.cjs.map +1 -1
- package/dist/charts/engine/orderbook/tape.js +1 -1
- package/dist/charts/engine/orderbook/tape.js.map +1 -1
- package/dist/charts/engine/orderbook/types.d.cts +18 -2
- package/dist/charts/engine/orderbook/types.d.ts +18 -2
- package/dist/charts/engine/overlay.cjs +1 -1
- package/dist/charts/engine/overlay.cjs.map +1 -1
- package/dist/charts/engine/overlay.d.cts +10 -0
- package/dist/charts/engine/overlay.d.ts +10 -0
- package/dist/charts/engine/overlay.js +6 -0
- package/dist/charts/engine/overlay.js.map +1 -1
- package/dist/charts/engine/presets.cjs +2 -2
- package/dist/charts/engine/presets.cjs.map +1 -1
- package/dist/charts/engine/presets.d.cts +25 -3
- package/dist/charts/engine/presets.d.ts +25 -3
- package/dist/charts/engine/presets.js +115 -101
- package/dist/charts/engine/presets.js.map +1 -1
- package/dist/charts/engine/renderers/detect.cjs +1 -1
- package/dist/charts/engine/renderers/detect.cjs.map +1 -1
- package/dist/charts/engine/renderers/detect.d.cts +2 -1
- package/dist/charts/engine/renderers/detect.d.ts +2 -1
- package/dist/charts/engine/renderers/detect.js +23 -21
- package/dist/charts/engine/renderers/detect.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 +57 -4
- package/dist/charts/engine/scene.d.ts +57 -4
- package/dist/charts/engine/scene.js +335 -182
- package/dist/charts/engine/scene.js.map +1 -1
- package/dist/charts/engine/shapes/bullet.cjs +1 -1
- package/dist/charts/engine/shapes/bullet.cjs.map +1 -1
- package/dist/charts/engine/shapes/bullet.js +110 -110
- package/dist/charts/engine/shapes/bullet.js.map +1 -1
- package/dist/charts/engine/shapes/chart.cjs +1 -1
- package/dist/charts/engine/shapes/chart.cjs.map +1 -1
- package/dist/charts/engine/shapes/chart.js +4 -1
- package/dist/charts/engine/shapes/chart.js.map +1 -1
- package/dist/charts/engine/shapes/chord.cjs +2 -0
- package/dist/charts/engine/shapes/chord.cjs.map +1 -0
- package/dist/charts/engine/shapes/chord.d.cts +18 -0
- package/dist/charts/engine/shapes/chord.d.ts +18 -0
- package/dist/charts/engine/shapes/chord.js +414 -0
- package/dist/charts/engine/shapes/chord.js.map +1 -0
- package/dist/charts/engine/shapes/draw.cjs +1 -1
- package/dist/charts/engine/shapes/draw.cjs.map +1 -1
- package/dist/charts/engine/shapes/draw.d.cts +5 -1
- package/dist/charts/engine/shapes/draw.d.ts +5 -1
- package/dist/charts/engine/shapes/draw.js +47 -17
- package/dist/charts/engine/shapes/draw.js.map +1 -1
- package/dist/charts/engine/shapes/hit.cjs +1 -1
- package/dist/charts/engine/shapes/hit.cjs.map +1 -1
- package/dist/charts/engine/shapes/hit.d.cts +3 -1
- package/dist/charts/engine/shapes/hit.d.ts +3 -1
- package/dist/charts/engine/shapes/hit.js +75 -46
- package/dist/charts/engine/shapes/hit.js.map +1 -1
- package/dist/charts/engine/shapes/index.d.cts +3 -2
- package/dist/charts/engine/shapes/index.d.ts +3 -2
- package/dist/charts/engine/shapes/labels.cjs +1 -1
- package/dist/charts/engine/shapes/labels.cjs.map +1 -1
- package/dist/charts/engine/shapes/labels.js +12 -4
- package/dist/charts/engine/shapes/labels.js.map +1 -1
- package/dist/charts/engine/shapes/layout.cjs +2 -2
- package/dist/charts/engine/shapes/layout.cjs.map +1 -1
- package/dist/charts/engine/shapes/layout.d.cts +3 -1
- package/dist/charts/engine/shapes/layout.d.ts +3 -1
- package/dist/charts/engine/shapes/layout.js +106 -78
- package/dist/charts/engine/shapes/layout.js.map +1 -1
- package/dist/charts/engine/shapes/scene.cjs +1 -1
- package/dist/charts/engine/shapes/scene.cjs.map +1 -1
- package/dist/charts/engine/shapes/scene.d.cts +33 -3
- package/dist/charts/engine/shapes/scene.d.ts +33 -3
- package/dist/charts/engine/shapes/scene.js +62 -19
- package/dist/charts/engine/shapes/scene.js.map +1 -1
- package/dist/charts/engine/shapes/types.d.cts +119 -8
- package/dist/charts/engine/shapes/types.d.ts +119 -8
- package/dist/charts/engine/signature.cjs +1 -1
- package/dist/charts/engine/signature.cjs.map +1 -1
- package/dist/charts/engine/signature.js +1 -1
- package/dist/charts/engine/signature.js.map +1 -1
- package/dist/charts/engine/three-d/canvas2d.cjs +1 -1
- package/dist/charts/engine/three-d/canvas2d.cjs.map +1 -1
- package/dist/charts/engine/three-d/canvas2d.d.cts +5 -2
- package/dist/charts/engine/three-d/canvas2d.d.ts +5 -2
- package/dist/charts/engine/three-d/canvas2d.js +89 -65
- package/dist/charts/engine/three-d/canvas2d.js.map +1 -1
- package/dist/charts/engine/three-d/detect.cjs +1 -1
- package/dist/charts/engine/three-d/detect.cjs.map +1 -1
- package/dist/charts/engine/three-d/detect.d.cts +3 -2
- package/dist/charts/engine/three-d/detect.d.ts +3 -2
- package/dist/charts/engine/three-d/detect.js +22 -20
- package/dist/charts/engine/three-d/detect.js.map +1 -1
- package/dist/charts/engine/three-d/geometry.cjs +1 -1
- package/dist/charts/engine/three-d/geometry.cjs.map +1 -1
- package/dist/charts/engine/three-d/geometry.d.cts +6 -0
- package/dist/charts/engine/three-d/geometry.d.ts +6 -0
- package/dist/charts/engine/three-d/geometry.js +106 -90
- package/dist/charts/engine/three-d/geometry.js.map +1 -1
- package/dist/charts/engine/three-d/model.cjs +1 -1
- package/dist/charts/engine/three-d/model.cjs.map +1 -1
- package/dist/charts/engine/three-d/model.d.cts +2 -0
- package/dist/charts/engine/three-d/model.d.ts +2 -0
- package/dist/charts/engine/three-d/model.js +2 -0
- package/dist/charts/engine/three-d/model.js.map +1 -1
- package/dist/charts/engine/three-d/overlay.cjs +1 -1
- package/dist/charts/engine/three-d/overlay.cjs.map +1 -1
- package/dist/charts/engine/three-d/overlay.js +43 -36
- package/dist/charts/engine/three-d/overlay.js.map +1 -1
- 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 +24 -3
- package/dist/charts/engine/three-d/render-types.d.ts +24 -3
- package/dist/charts/engine/three-d/render-types.js +6 -7
- package/dist/charts/engine/three-d/render-types.js.map +1 -1
- package/dist/charts/engine/three-d/shaders.cjs +63 -28
- package/dist/charts/engine/three-d/shaders.cjs.map +1 -1
- package/dist/charts/engine/three-d/shaders.d.cts +2 -3
- package/dist/charts/engine/three-d/shaders.d.ts +2 -3
- package/dist/charts/engine/three-d/shaders.js +41 -22
- 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 +15 -4
- package/dist/charts/engine/three-d/sort.d.ts +15 -4
- package/dist/charts/engine/three-d/sort.js +117 -43
- package/dist/charts/engine/three-d/sort.js.map +1 -1
- package/dist/charts/engine/three-d/types.d.cts +27 -0
- package/dist/charts/engine/three-d/types.d.ts +27 -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.js +15 -13
- 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 +50 -39
- 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 +10 -0
- package/dist/charts/engine/trading/chart.d.ts +10 -0
- package/dist/charts/engine/trading/chart.js +1475 -776
- package/dist/charts/engine/trading/chart.js.map +1 -1
- package/dist/charts/engine/trading/drawings.cjs +2 -1
- package/dist/charts/engine/trading/drawings.cjs.map +1 -1
- package/dist/charts/engine/trading/drawings.d.cts +47 -9
- package/dist/charts/engine/trading/drawings.d.ts +47 -9
- package/dist/charts/engine/trading/drawings.js +338 -75
- 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 +13 -0
- package/dist/charts/engine/trading/format.d.ts +13 -0
- package/dist/charts/engine/trading/format.js +51 -19
- package/dist/charts/engine/trading/format.js.map +1 -1
- package/dist/charts/engine/trading/index.cjs +1 -1
- package/dist/charts/engine/trading/index.d.cts +2 -1
- package/dist/charts/engine/trading/index.d.ts +2 -1
- package/dist/charts/engine/trading/index.js +4 -3
- package/dist/charts/engine/trading/indicators.cjs +1 -1
- package/dist/charts/engine/trading/indicators.cjs.map +1 -1
- package/dist/charts/engine/trading/indicators.d.cts +180 -10
- package/dist/charts/engine/trading/indicators.d.ts +180 -10
- package/dist/charts/engine/trading/indicators.js +449 -173
- package/dist/charts/engine/trading/indicators.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 +84 -4
- package/dist/charts/engine/trading/labels.js.map +1 -1
- package/dist/charts/engine/trading/store.cjs +1 -1
- package/dist/charts/engine/trading/store.cjs.map +1 -1
- package/dist/charts/engine/trading/store.d.cts +21 -0
- package/dist/charts/engine/trading/store.d.ts +21 -0
- package/dist/charts/engine/trading/store.js +22 -1
- package/dist/charts/engine/trading/store.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 +41 -8
- package/dist/charts/engine/trading/studies.d.ts +41 -8
- package/dist/charts/engine/trading/studies.js +349 -93
- package/dist/charts/engine/trading/studies.js.map +1 -1
- package/dist/charts/engine/trading/sync.cjs +2 -0
- package/dist/charts/engine/trading/sync.cjs.map +1 -0
- package/dist/charts/engine/trading/sync.d.cts +8 -0
- package/dist/charts/engine/trading/sync.d.ts +8 -0
- package/dist/charts/engine/trading/sync.js +25 -0
- package/dist/charts/engine/trading/sync.js.map +1 -0
- package/dist/charts/engine/trading/types.d.cts +484 -9
- package/dist/charts/engine/trading/types.d.ts +484 -9
- package/dist/charts/engine/types.d.cts +82 -8
- package/dist/charts/engine/types.d.ts +82 -8
- package/dist/charts/index.cjs +1 -1
- package/dist/charts/index.d.cts +3 -2
- package/dist/charts/index.d.ts +3 -2
- package/dist/charts/index.js +30 -22
- package/dist/charts/react/charts.cjs +1 -1
- package/dist/charts/react/charts.cjs.map +1 -1
- package/dist/charts/react/charts.js +46 -34
- package/dist/charts/react/charts.js.map +1 -1
- package/dist/charts/react/graph.cjs +2 -0
- package/dist/charts/react/graph.cjs.map +1 -0
- package/dist/charts/react/graph.d.cts +213 -0
- package/dist/charts/react/graph.d.ts +213 -0
- package/dist/charts/react/graph.js +159 -0
- package/dist/charts/react/graph.js.map +1 -0
- package/dist/charts/react/shapes.cjs +1 -1
- package/dist/charts/react/shapes.cjs.map +1 -1
- package/dist/charts/react/shapes.d.cts +87 -4
- package/dist/charts/react/shapes.d.ts +87 -4
- package/dist/charts/react/shapes.js +55 -12
- package/dist/charts/react/shapes.js.map +1 -1
- package/dist/charts/react/trading.cjs +1 -1
- package/dist/charts/react/trading.cjs.map +1 -1
- package/dist/charts/react/trading.d.cts +53 -1
- package/dist/charts/react/trading.d.ts +53 -1
- package/dist/charts/react/trading.js +68 -37
- package/dist/charts/react/trading.js.map +1 -1
- package/dist/charts/react/types.d.cts +11 -0
- package/dist/charts/react/types.d.ts +11 -0
- 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 +3 -3
- package/dist/native/charts/src/engine/axis.cjs +1 -1
- package/dist/native/charts/src/engine/axis.cjs.map +1 -1
- package/dist/native/charts/src/engine/axis.js +42 -19
- package/dist/native/charts/src/engine/axis.js.map +1 -1
- package/dist/native/charts/src/engine/color.cjs +1 -1
- package/dist/native/charts/src/engine/color.cjs.map +1 -1
- package/dist/native/charts/src/engine/color.js +47 -5
- package/dist/native/charts/src/engine/color.js.map +1 -1
- package/dist/native/charts/src/engine/controller.cjs +2 -2
- package/dist/native/charts/src/engine/controller.cjs.map +1 -1
- package/dist/native/charts/src/engine/controller.js +300 -253
- package/dist/native/charts/src/engine/controller.js.map +1 -1
- package/dist/native/charts/src/engine/data.cjs +1 -1
- package/dist/native/charts/src/engine/data.cjs.map +1 -1
- package/dist/native/charts/src/engine/data.js +6 -4
- package/dist/native/charts/src/engine/data.js.map +1 -1
- package/dist/native/charts/src/engine/format.cjs +1 -1
- package/dist/native/charts/src/engine/format.cjs.map +1 -1
- package/dist/native/charts/src/engine/format.js +15 -2
- package/dist/native/charts/src/engine/format.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 +28 -4
- package/dist/native/charts/src/engine/labels.js.map +1 -1
- package/dist/native/charts/src/engine/layout.cjs +1 -1
- package/dist/native/charts/src/engine/layout.cjs.map +1 -1
- package/dist/native/charts/src/engine/layout.js +11 -2
- package/dist/native/charts/src/engine/layout.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 +252 -171
- 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 +2 -2
- package/dist/native/charts/src/engine/presets.cjs.map +1 -1
- package/dist/native/charts/src/engine/presets.js +104 -90
- 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 +341 -188
- package/dist/native/charts/src/engine/scene.js.map +1 -1
- package/dist/native/charts/src/engine/shapes/bullet.cjs +1 -1
- package/dist/native/charts/src/engine/shapes/bullet.cjs.map +1 -1
- package/dist/native/charts/src/engine/shapes/bullet.js +110 -110
- package/dist/native/charts/src/engine/shapes/bullet.js.map +1 -1
- package/dist/native/charts/src/engine/shapes/calendar.cjs +1 -1
- package/dist/native/charts/src/engine/shapes/calendar.cjs.map +1 -1
- package/dist/native/charts/src/engine/shapes/calendar.js +21 -16
- package/dist/native/charts/src/engine/shapes/calendar.js.map +1 -1
- package/dist/native/charts/src/engine/shapes/chord.cjs +2 -0
- package/dist/native/charts/src/engine/shapes/chord.cjs.map +1 -0
- package/dist/native/charts/src/engine/shapes/chord.js +414 -0
- package/dist/native/charts/src/engine/shapes/chord.js.map +1 -0
- package/dist/native/charts/src/engine/shapes/draw.cjs +1 -1
- package/dist/native/charts/src/engine/shapes/draw.cjs.map +1 -1
- package/dist/native/charts/src/engine/shapes/draw.js +47 -17
- package/dist/native/charts/src/engine/shapes/draw.js.map +1 -1
- package/dist/native/charts/src/engine/shapes/hit.cjs +1 -1
- package/dist/native/charts/src/engine/shapes/hit.cjs.map +1 -1
- package/dist/native/charts/src/engine/shapes/hit.js +73 -44
- package/dist/native/charts/src/engine/shapes/hit.js.map +1 -1
- package/dist/native/charts/src/engine/shapes/labels.cjs +1 -1
- package/dist/native/charts/src/engine/shapes/labels.cjs.map +1 -1
- package/dist/native/charts/src/engine/shapes/labels.js +12 -4
- package/dist/native/charts/src/engine/shapes/labels.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 +117 -90
- package/dist/native/charts/src/engine/shapes/layout.js.map +1 -1
- package/dist/native/charts/src/engine/shapes/scene.cjs +1 -1
- package/dist/native/charts/src/engine/shapes/scene.cjs.map +1 -1
- package/dist/native/charts/src/engine/shapes/scene.js +62 -19
- package/dist/native/charts/src/engine/shapes/scene.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.js +140 -71
- package/dist/native/components/Chart/scene.js.map +1 -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 +54 -42
- package/dist/native/components/Charts/charts.js.map +1 -1
- package/dist/native/components/Charts/types.d.cts +11 -0
- package/dist/native/components/Charts/types.d.ts +11 -0
- 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.js +1 -0
- package/dist/native/components/ShapeChart/ShapeChartBase.js.map +1 -1
- package/dist/native/components/ShapeChart/charts.cjs +1 -1
- package/dist/native/components/ShapeChart/charts.cjs.map +1 -1
- package/dist/native/components/ShapeChart/charts.d.cts +6 -1
- package/dist/native/components/ShapeChart/charts.d.ts +6 -1
- package/dist/native/components/ShapeChart/charts.js +138 -96
- package/dist/native/components/ShapeChart/charts.js.map +1 -1
- package/dist/native/components/ShapeChart/draw.cjs +1 -1
- package/dist/native/components/ShapeChart/draw.cjs.map +1 -1
- package/dist/native/components/ShapeChart/draw.d.cts +1 -1
- package/dist/native/components/ShapeChart/draw.d.ts +1 -1
- package/dist/native/components/ShapeChart/draw.js +26 -17
- package/dist/native/components/ShapeChart/draw.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 +138 -59
- package/dist/native/components/ShapeChart/geometry.js.map +1 -1
- package/dist/native/components/ShapeChart/index.cjs +1 -1
- package/dist/native/components/ShapeChart/index.d.cts +1 -1
- package/dist/native/components/ShapeChart/index.d.ts +1 -1
- package/dist/native/components/ShapeChart/index.js +2 -2
- package/dist/native/components/ShapeChart/recorder.cjs +1 -1
- package/dist/native/components/ShapeChart/recorder.cjs.map +1 -1
- package/dist/native/components/ShapeChart/recorder.d.cts +10 -1
- package/dist/native/components/ShapeChart/recorder.d.ts +10 -1
- package/dist/native/components/ShapeChart/recorder.js +19 -10
- package/dist/native/components/ShapeChart/recorder.js.map +1 -1
- package/dist/native/components/ShapeChart/types.d.cts +92 -7
- package/dist/native/components/ShapeChart/types.d.ts +92 -7
- package/dist/native/index.cjs +1 -1
- package/dist/native/index.js +2 -2
- package/dist/native/source/components/Chart/scene.tsx +158 -14
- package/dist/native/source/components/Charts/charts.tsx +30 -2
- package/dist/native/source/components/Charts/types.ts +11 -0
- package/dist/native/source/components/ShapeChart/ShapeChartBase.tsx +2 -0
- package/dist/native/source/components/ShapeChart/charts.tsx +91 -35
- package/dist/native/source/components/ShapeChart/draw.tsx +39 -8
- package/dist/native/source/components/ShapeChart/geometry.ts +189 -8
- package/dist/native/source/components/ShapeChart/index.ts +1 -0
- package/dist/native/source/components/ShapeChart/recorder.ts +20 -5
- package/dist/native/source/components/ShapeChart/types.ts +96 -5
- package/dist/native/source/manifest.ts +1 -0
- package/dist/taro/charts.d.ts +25 -5
- package/dist/taro/index.js +3900 -2836
- package/dist/taro/shape-charts.d.ts +96 -4
- package/dist/uni/AreaChart.vue.d.ts +5 -1
- package/dist/uni/Badge.vue.d.ts +1 -1
- package/dist/uni/BarChart.vue.d.ts +5 -1
- package/dist/uni/BoxPlotChart.vue.d.ts +8 -0
- package/dist/uni/BubbleChart.vue.d.ts +4 -0
- package/dist/uni/BulletChart.vue.d.ts +4 -0
- package/dist/uni/CalendarHeatmap.vue.d.ts +2 -0
- package/dist/uni/CandlestickChart.vue.d.ts +4 -0
- package/dist/uni/Chart.vue.d.ts +4 -0
- package/dist/uni/ChordChart.vue +93 -0
- package/dist/uni/ChordChart.vue.d.ts +136 -0
- package/dist/uni/DonutChart.vue.d.ts +4 -0
- package/dist/uni/FunnelChart.vue.d.ts +4 -0
- package/dist/uni/GanttChart.vue.d.ts +4 -0
- package/dist/uni/GaugeChart.vue.d.ts +4 -0
- package/dist/uni/HeatmapChart.vue.d.ts +8 -2
- package/dist/uni/HistogramChart.vue.d.ts +4 -0
- package/dist/uni/HorizontalBarChart.vue.d.ts +3 -1
- package/dist/uni/LineChart.vue.d.ts +4 -0
- package/dist/uni/MixedChart.vue.d.ts +4 -0
- package/dist/uni/PieChart.vue.d.ts +4 -0
- package/dist/uni/QuadrantChart.vue.d.ts +4 -0
- package/dist/uni/RadarChart.vue.d.ts +4 -0
- package/dist/uni/RadialBarChart.vue.d.ts +4 -0
- package/dist/uni/RangeAreaChart.vue.d.ts +4 -0
- package/dist/uni/SankeyChart.vue.d.ts +4 -0
- package/dist/uni/ScatterChart.vue.d.ts +4 -0
- package/dist/uni/Sparkline.vue.d.ts +4 -0
- package/dist/uni/SunburstChart.vue.d.ts +4 -0
- package/dist/uni/ToastProvider.vue.d.ts +1 -1
- package/dist/uni/TreemapChart.vue.d.ts +4 -0
- package/dist/uni/WaterfallChart.vue.d.ts +9 -0
- package/dist/uni/chart-canvas.d.ts +3 -0
- package/dist/uni/chart-canvas.js +4 -0
- package/dist/uni/chart-types.d.ts +28 -4
- package/dist/uni/chart-types.js +26 -2
- package/dist/uni/charts-canvas.js +1 -1
- package/dist/uni/index.d.ts +2 -1
- package/dist/uni/index.js +1 -0
- package/dist/uni/manifest.d.ts +7 -0
- package/dist/uni/manifest.js +10 -0
- package/dist/uni/named-chart-options.d.ts +9 -2
- package/dist/uni/named-chart-options.js +18 -1
- package/dist/uni/shape-chart-canvas.d.ts +3 -1
- package/dist/uni/shape-chart-canvas.js +15 -24
- package/dist/uni/shape-chart-types.d.ts +52 -2
- package/dist/uni/shape-chart-types.js +44 -0
- package/dist/vue/charts-global.d.ts +48 -0
- package/dist/vue/charts.d.ts +18 -0
- package/dist/vue/charts.js +56 -0
- package/dist/vue/charts.js.map +1 -0
- package/dist/vue/components/Chart/BoxPlotChart.vue.d.ts +8 -0
- package/dist/vue/components/Chart/BoxPlotChart.vue.js.map +1 -1
- package/dist/vue/components/Chart/BoxPlotChart.vue_vue_type_script_setup_true_lang.js +8 -2
- package/dist/vue/components/Chart/BoxPlotChart.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/vue/components/Chart/ChordChart.vue.d.ts +153 -0
- package/dist/vue/components/Chart/ChordChart.vue.js +7 -0
- package/dist/vue/components/Chart/ChordChart.vue.js.map +1 -0
- package/dist/vue/components/Chart/ChordChart.vue_vue_type_script_setup_true_lang.js +81 -0
- package/dist/vue/components/Chart/ChordChart.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/vue/components/Chart/DependencyGraph.vue.d.ts +179 -0
- package/dist/vue/components/Chart/DependencyGraph.vue.js +7 -0
- package/dist/vue/components/Chart/DependencyGraph.vue.js.map +1 -0
- package/dist/vue/components/Chart/DependencyGraph.vue_vue_type_script_setup_true_lang.js +65 -0
- package/dist/vue/components/Chart/DependencyGraph.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/vue/components/Chart/GanttChart.vue.d.ts +4 -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 +4 -1
- 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 +184 -0
- package/dist/vue/components/Chart/GraphChart.vue.js +7 -0
- package/dist/vue/components/Chart/GraphChart.vue.js.map +1 -0
- package/dist/vue/components/Chart/GraphChart.vue_vue_type_script_setup_true_lang.js +62 -0
- package/dist/vue/components/Chart/GraphChart.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/vue/components/Chart/HeatmapChart.vue.d.ts +9 -5
- package/dist/vue/components/Chart/HeatmapChart.vue.js.map +1 -1
- package/dist/vue/components/Chart/HeatmapChart.vue_vue_type_script_setup_true_lang.js +3 -1
- package/dist/vue/components/Chart/HeatmapChart.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/vue/components/Chart/OrderBookHeatmap.vue.d.ts +2 -0
- package/dist/vue/components/Chart/TimeAndSales.vue.d.ts +2 -0
- package/dist/vue/components/Chart/TradingChart.vue.d.ts +49 -1
- package/dist/vue/components/Chart/TradingChart.vue.js.map +1 -1
- package/dist/vue/components/Chart/TradingChart.vue_vue_type_script_setup_true_lang.js +31 -0
- package/dist/vue/components/Chart/TradingChart.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/vue/components/Chart/TreeChart.vue.d.ts +172 -0
- package/dist/vue/components/Chart/TreeChart.vue.js +7 -0
- package/dist/vue/components/Chart/TreeChart.vue.js.map +1 -0
- package/dist/vue/components/Chart/TreeChart.vue_vue_type_script_setup_true_lang.js +56 -0
- package/dist/vue/components/Chart/TreeChart.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/vue/components/Chart/WaterfallChart.vue.d.ts +12 -1
- package/dist/vue/components/Chart/WaterfallChart.vue.js.map +1 -1
- package/dist/vue/components/Chart/WaterfallChart.vue_vue_type_script_setup_true_lang.js +8 -2
- package/dist/vue/components/Chart/WaterfallChart.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/vue/components/Chart/graph.d.ts +153 -0
- package/dist/vue/components/Chart/graph.js +135 -0
- package/dist/vue/components/Chart/graph.js.map +1 -0
- package/dist/vue/components/Chart/index.d.ts +5 -1
- package/dist/vue/components/Chart/index.js +5 -1
- package/dist/vue/components/Chart/orderbook.d.ts +5 -1
- package/dist/vue/components/Chart/orderbook.js +2 -0
- package/dist/vue/components/Chart/orderbook.js.map +1 -1
- package/dist/vue/components/Chart/trading.d.ts +24 -2
- package/dist/vue/components/Chart/trading.js +8 -0
- package/dist/vue/components/Chart/trading.js.map +1 -1
- package/dist/vue/components/Chart/types.d.ts +74 -2
- package/dist/vue/global.d.ts +2 -38
- package/dist/vue/groups/charts.js +10 -2
- package/dist/vue/groups/charts.js.map +1 -1
- package/dist/vue/index.js +6 -2
- package/dist/vue/internal/register.d.ts +7 -0
- package/dist/vue/internal/register.js +14 -0
- package/dist/vue/internal/register.js.map +1 -0
- package/dist/vue/plugin.d.ts +9 -4
- package/dist/vue/plugin.js +6 -11
- package/dist/vue/plugin.js.map +1 -1
- package/dist/weapp/charts/canvas.js +1687 -147
- package/dist/weapp/charts/core.js +1 -0
- package/dist/weapp/chord-chart/index.js +1 -0
- package/dist/weapp/chord-chart/index.json +1 -0
- package/dist/weapp/chord-chart/index.wxml +1 -0
- package/dist/weapp/chord-chart/index.wxss +1 -0
- package/dist/weapp/controls.js +92 -32
- package/dist/weapp/types.d.ts +87 -4
- package/dist/web-components/components/chart/charts.d.ts +4 -2
- package/dist/web-components/components/chart/charts.js +8 -1
- package/dist/web-components/components/chart/charts.js.map +1 -1
- package/dist/web-components/components/chart/extended.d.ts +17 -7
- package/dist/web-components/components/chart/extended.js +23 -9
- package/dist/web-components/components/chart/extended.js.map +1 -1
- package/dist/web-components/components/chart/shapes-extended.d.ts +37 -1
- package/dist/web-components/components/chart/shapes-extended.js +27 -1
- package/dist/web-components/components/chart/shapes-extended.js.map +1 -1
- package/dist/web-components/components/graph/graph.d.ts +154 -0
- package/dist/web-components/components/graph/graph.js +149 -0
- package/dist/web-components/components/graph/graph.js.map +1 -0
- package/dist/web-components/components/trading-chart/trading-chart.d.ts +49 -2
- package/dist/web-components/components/trading-chart/trading-chart.js +62 -0
- package/dist/web-components/components/trading-chart/trading-chart.js.map +1 -1
- package/dist/web-components/elements/chart.d.ts +1 -1
- package/dist/web-components/elements/chart.js +6 -5
- package/dist/web-components/elements/chart.js.map +1 -1
- package/dist/web-components/elements/graph.d.ts +2 -0
- package/dist/web-components/elements/graph.js +12 -0
- package/dist/web-components/elements/graph.js.map +1 -0
- package/dist/web-components/html-custom-data.json +273 -4
- package/dist/web-components/types/react.d.ts +63 -4
- package/dist/web-components/types/solid.d.ts +55 -8
- package/dist/web-components/types/svelte.d.ts +55 -8
- package/dist/web-components/types/vue.d.ts +55 -4
- package/package.json +16 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scene.js","names":["annotationRect","annotationLine","annotationTextBox","_Fragment","SHAPE_BUDGET","C","lineHeightOf","size","slack","measureChartText","text","o","label","lh","pad","w","top","valign","y","horizontal","align","x","frameWidth","Text","extra","key","box","View","color","dot","cx","d","cy","segment","dx","x2","x1","dy","y2","y1","length","width","dashRuns","pattern","dash","v","period","a","b","runs","scale","max","out","at","i","step","dashedLine","start","run","axis","from","crisp","thin","stride","k","lx","ly","areaStrips","transposed","points","plot","frame","n","forward","xs","ys","bs","bottom","baseline","to","column","j","left","c","right","mid","x0","t","h","primitiveLimits","scene","visible","s","lines","scatters","perLine","maxDots","drawData","primitives","scenePrimitives","options","ox","oy","dotsLeft","barsLeft","p","total","pts","r","count","radius","css","toCss","alpha","drawBackground","layout","scales","bottomAxis","model","leftAxis","bottomTicks","leftTicks","bottomPx","leftPx","fs","theme","rectOf","grid","py","px","line","tick","title","lastRight","lastBottom","y2Ticks","e","swatch","part","drawForeground","fw","halo","labelHeight","annotations","where","lineOf","pos","tx","ty","textBox","pointColor","l","clip","drawStatic","Fragment","family","drawHover","background","hover","StyleSheet","m","dragging","tip","customTooltip","muted","font","weight","row","lineHeight","tooltipCard","padding","content"],"sources":["../../../../../native/src/components/Chart/scene.tsx"],"sourcesContent":["// Draws a chart scene (`ChartController.getScene()`) with plain views: no\n// canvas, SVG or native drawing module. The engine already resolves every\n// position in pixels; this file only turns them into absolutely positioned\n// <View> / <Text> elements, keeping the number of views bounded by the size\n// of the chart (lines decimated per column, dots merged per cell, bars\n// merged per pixel column), whatever the size of the data.\n\nimport type { ReactElement, ReactNode } from \"react\";\nimport {\n StyleSheet,\n Text,\n View,\n type TextStyle,\n type ViewStyle,\n} from \"react-native\";\nimport {\n annotationLine,\n annotationRect,\n annotationTextBox,\n scenePrimitives,\n toCss,\n type ChartPrimitive,\n type ChartRect,\n type ChartScene,\n} from \"@minerva/charts/canvas\";\nimport { part } from \"../../internal/parts\";\nimport { measureChartText } from \"./measure\";\n\ntype Rgba = ChartScene[\"theme\"][\"text\"];\n\n/** Upper bounds of the views drawn for the data of a chart */\nexport const SHAPE_BUDGET = {\n /** Points of all the lines (one view per segment) */\n linePoints: 1200,\n /** Dots of one scatter series before they are merged per cell */\n dotsPerSeries: 800,\n /** Dots of all the series */\n dots: 2000,\n /** Bars of one series before neighbors are merged per pixel column */\n barsPerSeries: 600,\n /** Bars of all the series */\n bars: 1500,\n /** Vertical strips filling one area */\n areaColumns: 200,\n /** Dashes of one dashed line */\n dashes: 200,\n} as const;\n\nconst C = \"chart\";\n\n// ------------------------------------------------------------------ text\n\ninterface TextOptions {\n size: number;\n color: string;\n weight?: number;\n family?: string;\n /** Halo color: keeps the text readable over the data */\n halo?: string;\n}\n\ntype Align = \"left\" | \"center\" | \"right\";\ntype VAlign = \"top\" | \"middle\" | \"bottom\";\n\nconst lineHeightOf = (size: number) => Math.ceil(size * 1.35);\n\n/** Box wide enough for the estimated width (the real one may differ) */\nconst slack = (text: string, o: TextOptions) =>\n Math.ceil(\n measureChartText(text, `${o.weight ?? 400} ${o.size}px sans-serif`) * 1.4 +\n o.size * 2,\n );\n\n/**\n * A one-line text anchored at (x, y) of a container `frameWidth` wide:\n * `left` starts there, `right` ends there, `center` is centered on it;\n * `top` / `bottom` place the em box like the canvas text baselines\n */\nfunction label(\n key: string,\n text: string,\n x: number,\n y: number,\n align: Align,\n valign: VAlign,\n o: TextOptions,\n frameWidth: number,\n extra?: TextStyle,\n): ReactElement {\n const lh = lineHeightOf(o.size);\n const pad = (lh - o.size) / 2;\n const w = slack(text, o);\n const top =\n valign === \"top\"\n ? y - pad\n : valign === \"bottom\"\n ? y - lh + pad\n : y - lh / 2;\n const horizontal: TextStyle =\n align === \"left\"\n ? { left: x, width: w }\n : align === \"right\"\n ? { right: frameWidth - x, width: w }\n : { left: x - w / 2, width: w };\n return (\n <Text\n key={key}\n numberOfLines={1}\n style={[\n {\n position: \"absolute\",\n top,\n ...horizontal,\n textAlign: align,\n fontSize: o.size,\n lineHeight: lh,\n color: o.color,\n fontWeight: String(o.weight ?? 400) as TextStyle[\"fontWeight\"],\n includeFontPadding: false,\n ...(o.family ? { fontFamily: o.family } : null),\n ...(o.halo\n ? {\n textShadowColor: o.halo,\n textShadowRadius: 3,\n textShadowOffset: { width: 0, height: 0 },\n }\n : null),\n },\n extra,\n ]}\n >\n {text}\n </Text>\n );\n}\n\n// ---------------------------------------------------------------- shapes\n\nconst box = (\n key: string,\n x: number,\n y: number,\n width: number,\n height: number,\n color: string,\n extra?: ViewStyle,\n): ReactElement => (\n <View\n key={key}\n style={[\n {\n position: \"absolute\",\n left: x,\n top: y,\n width,\n height,\n backgroundColor: color,\n },\n extra,\n ]}\n />\n);\n\nconst dot = (\n key: string,\n cx: number,\n cy: number,\n d: number,\n color: string,\n extra?: ViewStyle,\n) =>\n box(key, cx - d / 2, cy - d / 2, d, d, color, {\n borderRadius: d / 2,\n ...extra,\n });\n\n/** A straight stroke: one view, rotated around its center */\nconst segment = (\n key: string,\n x1: number,\n y1: number,\n x2: number,\n y2: number,\n width: number,\n color: string,\n) => {\n const dx = x2 - x1;\n const dy = y2 - y1;\n const length = Math.hypot(dx, dy) + width;\n return box(\n key,\n (x1 + x2) / 2 - length / 2,\n (y1 + y2) / 2 - width / 2,\n length,\n width,\n color,\n {\n borderRadius: width / 2,\n transform: [{ rotate: `${Math.atan2(dy, dx)}rad` }],\n },\n );\n};\n\n/** Dash runs `[start, length]` along a line (canvas `setLineDash` pattern) */\nexport function dashRuns(\n length: number,\n dash: readonly number[],\n max: number = SHAPE_BUDGET.dashes,\n): [number, number][] {\n let pattern = dash.filter((v) => Number.isFinite(v) && v >= 0);\n // odd patterns repeat twice, like the canvas\n if (pattern.length % 2) pattern = [...pattern, ...pattern];\n const period = pattern.reduce((a, b) => a + b, 0);\n if (!pattern.length || period <= 0) return [[0, length]];\n const runs = (length / period) * (pattern.length / 2);\n const scale = runs > max ? runs / max : 1;\n const out: [number, number][] = [];\n let at = 0;\n for (let i = 0; at < length; i = (i + 1) % pattern.length) {\n const step = pattern[i] * scale;\n if (i % 2 === 0 && step > 0) out.push([at, Math.min(step, length - at)]);\n at += Math.max(step, 0.5);\n }\n return out;\n}\n\nconst dashedLine = (\n key: string,\n axis: \"x\" | \"y\",\n at: number,\n from: number,\n length: number,\n width: number,\n color: string,\n dash: readonly number[],\n) =>\n dashRuns(length, dash).map(([start, run], i) =>\n axis === \"y\"\n ? box(`${key}-${i}`, from + start, at, run, width, color)\n : box(`${key}-${i}`, at, from + start, width, run, color),\n );\n\nconst crisp = (v: number, width = 1) => Math.round(v) + 0.5 - width / 2;\n\n// ------------------------------------------------------------------ data\n\n/** Thins a run of interleaved points to `max` points and drops sub-pixel steps */\nfunction thin(run: readonly number[], max: number): number[] {\n const n = run.length / 2;\n const stride = n > max ? Math.ceil(n / max) : 1;\n const out: number[] = [];\n for (let i = 0; i < n; i += stride) {\n const x = run[i * 2];\n const y = run[i * 2 + 1];\n const k = out.length;\n if (k && Math.hypot(x - out[k - 2], y - out[k - 1]) < 1.5) continue;\n out.push(x, y);\n }\n const lx = run[n * 2 - 2];\n const ly = run[n * 2 - 1];\n const k = out.length;\n if (n > 1 && (out[k - 2] !== lx || out[k - 1] !== ly)) out.push(lx, ly);\n return out;\n}\n\n/**\n * Vertical strips between the line and the baseline (or the stack below),\n * one per column; horizontal strips, one per row, for horizontal charts\n */\nfunction areaStrips(\n key: string,\n points: readonly number[],\n baseline: number,\n color: string,\n opacity: number,\n frame: ChartRect,\n /** Y pixel (x pixel when `transposed`) of the bottom edge under every point */\n bottom?: readonly number[],\n /** Horizontal charts: the area grows from the left edge */\n transposed = false,\n): ReactElement[] {\n // horizontal charts are filled like vertical ones with x and y swapped\n const run = transposed\n ? points.map((_, i) => points[i % 2 ? i - 1 : i + 1])\n : points;\n const plot = transposed\n ? { x: frame.y, y: frame.x, width: frame.height, height: frame.width }\n : frame;\n const n = run.length / 2;\n if (n < 2) return [];\n // left to right (reversed axes list their points right to left)\n const forward = run[0] <= run[n * 2 - 2];\n const at = (i: number) => (forward ? i : n - 1 - i);\n const xs = (i: number) => run[at(i) * 2];\n const ys = (i: number) => run[at(i) * 2 + 1];\n const bs = (i: number) => (bottom ? bottom[at(i)] : baseline);\n const from = Math.max(plot.x, xs(0));\n const to = Math.min(plot.x + plot.width, xs(n - 1));\n if (to <= from) return [];\n const column = Math.max(2, plot.width / SHAPE_BUDGET.areaColumns);\n const out: ReactElement[] = [];\n let j = 0;\n for (let left = Math.floor(from), c = 0; left < to; c++) {\n const right = Math.min(Math.ceil(to), Math.round(left + column));\n const mid = (left + right) / 2;\n while (j < n - 2 && xs(j + 1) < mid) j++;\n const x0 = xs(j);\n const x1 = xs(j + 1);\n const t = x1 === x0 ? 0 : Math.max(0, Math.min(1, (mid - x0) / (x1 - x0)));\n const y = ys(j) + (ys(j + 1) - ys(j)) * t;\n const b = bs(j) + (bs(j + 1) - bs(j)) * t;\n if (Number.isFinite(y) && Number.isFinite(b)) {\n const top = Math.min(y, b);\n const h = Math.abs(b - y);\n out.push(\n transposed\n ? box(\n `${key}-${c}`,\n top - plot.y,\n left - plot.x,\n h,\n right - left,\n color,\n {\n opacity,\n },\n )\n : box(\n `${key}-${c}`,\n left - plot.x,\n top - plot.y,\n right - left,\n h,\n color,\n {\n opacity,\n },\n ),\n );\n }\n left = right;\n }\n return out;\n}\n\n/** Limits of `scenePrimitives` for the views budget */\nexport function primitiveLimits(scene: ChartScene) {\n const { plot } = scene.layout;\n const visible = scene.model.series.filter((s) => !s.hidden);\n const lines = visible.filter(\n (s) => s.type === \"line\" || s.type === \"area\",\n ).length;\n const scatters = visible.filter((s) => s.type === \"scatter\").length;\n const perLine = Math.max(150, SHAPE_BUDGET.linePoints / Math.max(1, lines));\n const maxDots = Math.max(\n 100,\n Math.min(\n SHAPE_BUDGET.dotsPerSeries,\n SHAPE_BUDGET.dots / Math.max(1, scatters),\n ),\n );\n return {\n perLine,\n options: {\n // decimation keeps up to 4 points per column\n columnWidth: Math.max(3, (plot.width * 4) / perLine),\n maxDots,\n maxBars: SHAPE_BUDGET.barsPerSeries,\n dotCell: Math.max(\n 4,\n Math.sqrt((plot.width * plot.height) / maxDots) * 1.15 + 1,\n ),\n },\n };\n}\n\nfunction drawData(scene: ChartScene): ReactElement[] {\n const { plot } = scene.layout;\n const { perLine, options } = primitiveLimits(scene);\n const primitives: ChartPrimitive[] = scenePrimitives(scene, options);\n const ox = plot.x;\n const oy = plot.y;\n const out: ReactElement[] = [];\n let dotsLeft: number = SHAPE_BUDGET.dots;\n let barsLeft: number = SHAPE_BUDGET.bars;\n primitives.forEach((p, k) => {\n const key = `${p.kind}${p.seriesIndex}-${k}`;\n if (p.kind === \"area\") {\n p.segments.forEach((run, r) =>\n out.push(\n ...areaStrips(\n `${key}-${r}`,\n run,\n p.baseline,\n p.color,\n p.opacity,\n plot,\n p.bottoms?.[r],\n p.horizontal,\n ),\n ),\n );\n return;\n }\n if (p.kind === \"line\") {\n let total = 0;\n for (const run of p.segments) total += run.length / 2;\n p.segments.forEach((run, r) => {\n const pts = thin(\n run,\n Math.max(\n 2,\n Math.round((perLine * run.length) / 2 / Math.max(1, total)),\n ),\n );\n if (pts.length === 2) {\n out.push(\n dot(\n `${key}-${r}`,\n pts[0] - ox,\n pts[1] - oy,\n p.width * 1.5,\n p.color,\n ),\n );\n return;\n }\n for (let i = 0; i + 3 < pts.length; i += 2) {\n out.push(\n segment(\n `${key}-${r}-${i}`,\n pts[i] - ox,\n pts[i + 1] - oy,\n pts[i + 2] - ox,\n pts[i + 3] - oy,\n p.width,\n p.color,\n ),\n );\n }\n });\n return;\n }\n if (p.kind === \"bars\") {\n const count = p.rects.length / 4;\n const stride =\n count > barsLeft ? Math.ceil(count / Math.max(1, barsLeft)) : 1;\n for (let i = 0; i < count; i += stride) {\n const [x, y, w, h] = p.rects.slice(i * 4, i * 4 + 4);\n const radius = Math.min(p.radius ?? 0, w / 2, h / 2);\n out.push(\n box(\n `${key}-${i}`,\n x - ox,\n y - oy,\n Math.max(w, 0.5),\n h,\n p.colors?.[i] ?? p.color,\n radius > 0.5 || p.opacity !== undefined\n ? {\n ...(radius > 0.5 ? { borderRadius: radius } : null),\n ...(p.opacity !== undefined ? { opacity: p.opacity } : null),\n }\n : undefined,\n ),\n );\n }\n barsLeft = Math.max(0, barsLeft - Math.ceil(count / stride));\n return;\n }\n const count = p.dots.length / 3;\n const stride =\n count > dotsLeft ? Math.ceil(count / Math.max(1, dotsLeft)) : 1;\n for (let i = 0; i < count; i += stride) {\n out.push(\n dot(\n `${key}-${i}`,\n p.dots[i * 3] - ox,\n p.dots[i * 3 + 1] - oy,\n p.dots[i * 3 + 2],\n p.colors[i],\n {\n opacity: p.opacity,\n },\n ),\n );\n }\n dotsLeft = Math.max(0, dotsLeft - Math.ceil(count / stride));\n });\n return out;\n}\n\n// ------------------------------------------------------------ background\n\nconst css = (c: Rgba, alpha?: number) => toCss(c, alpha);\n\nfunction drawBackground(scene: ChartScene, family?: string): ReactElement[] {\n const { width, theme, model, layout, annotations } = scene;\n const { plot, scales, y2Ticks } = layout;\n // horizontal charts: the value axis along the bottom, the x axis on the left\n const horizontal = scales.horizontal;\n const bottomAxis = horizontal ? model.y : model.x;\n const leftAxis = horizontal ? model.x : model.y;\n const bottomTicks = horizontal ? layout.yTicks : layout.xTicks;\n const leftTicks = horizontal ? layout.xTicks : layout.yTicks;\n const bottomPx = horizontal ? scales.yToPx : scales.xToPx;\n const leftPx = horizontal ? scales.xToPx : scales.yToPx;\n const fs = theme.fontSize;\n const out: ReactElement[] = [];\n\n annotations.forEach((a, i) => {\n if (a.type !== \"rect\") return;\n const r = annotationRect(a, scales);\n if (r.width <= 0 || r.height <= 0) return;\n out.push(\n box(`area-${i}`, r.x, r.y, r.width, r.height, css(a.color, a.opacity)),\n );\n });\n\n const grid = css(theme.grid);\n if (leftAxis.grid) {\n leftTicks.values.forEach((v, i) => {\n const py = leftPx(v);\n if (py < plot.y - 1 || py > plot.y + plot.height + 1) return;\n out.push(box(`ygrid-${i}`, plot.x, crisp(py), plot.width, 1, grid));\n });\n }\n if (bottomAxis.grid) {\n bottomTicks.values.forEach((v, i) => {\n const px = bottomPx(v);\n if (px < plot.x - 1 || px > plot.x + plot.width + 1) return;\n out.push(box(`xgrid-${i}`, crisp(px), plot.y, 1, plot.height, grid));\n });\n }\n\n const line = Math.ceil(fs * 1.4);\n const tick: TextOptions = { size: fs, color: css(theme.textMuted), family };\n const title: TextOptions = {\n size: fs + 1,\n weight: 500,\n color: css(theme.text, 0.8),\n family,\n };\n const bottom = plot.y + plot.height;\n\n if (bottomAxis.visible) {\n out.push(\n box(\"xaxis\", plot.x, crisp(bottom), plot.width, 1, css(theme.axis)),\n );\n let lastRight = -Infinity;\n bottomTicks.values\n .map((v, i) => ({ px: bottomPx(v), text: bottomTicks.labels[i] ?? \"\" }))\n .sort((a, b) => a.px - b.px)\n .forEach(({ px, text }, i) => {\n if (!text || px < plot.x - 0.5 || px > plot.x + plot.width + 0.5)\n return;\n const w = measureChartText(text, `400 ${fs}px sans-serif`);\n const left = Math.max(0, Math.min(width - w, px - w / 2));\n if (left < lastRight + 6) return;\n lastRight = left + w;\n out.push(\n label(\n `xtick-${i}`,\n text,\n left + w / 2,\n bottom + 7,\n \"center\",\n \"top\",\n tick,\n width,\n ),\n );\n });\n if (bottomAxis.title)\n out.push(\n label(\n \"xtitle\",\n bottomAxis.title,\n plot.x + plot.width / 2,\n bottom + line + 10,\n \"center\",\n \"top\",\n title,\n width,\n ),\n );\n }\n\n if (leftAxis.visible) {\n let lastBottom = -Infinity;\n leftTicks.values\n .map((v, i) => ({ py: leftPx(v), text: leftTicks.labels[i] ?? \"\" }))\n .sort((a, b) => a.py - b.py)\n .forEach(({ py, text }, i) => {\n if (!text || py < plot.y - 0.5 || py > plot.y + plot.height + 0.5)\n return;\n // category rows of horizontal charts never overlap\n if (horizontal) {\n if (py - (fs + 2) / 2 < lastBottom) return;\n lastBottom = py + (fs + 2) / 2;\n }\n out.push(\n label(\n `ytick-${i}`,\n text,\n plot.x - 8,\n py,\n \"right\",\n \"middle\",\n tick,\n width,\n ),\n );\n });\n if (leftAxis.title)\n out.push(\n label(\n \"ytitle\",\n leftAxis.title,\n line / 2 + 4,\n plot.y + plot.height / 2,\n \"center\",\n \"middle\",\n title,\n width,\n {\n transform: [{ rotate: \"-90deg\" }],\n },\n ),\n );\n }\n\n const y2 = horizontal ? null : model.y2;\n if (y2 && y2Ticks && y2.visible) {\n const right = plot.x + plot.width;\n y2Ticks.values.forEach((v, i) => {\n const py = scales.yToPx(v);\n const text = y2Ticks.labels[i];\n if (!text || py < plot.y - 0.5 || py > plot.y + plot.height + 0.5) return;\n out.push(\n label(\n `y2tick-${i}`,\n text,\n right + 8,\n py,\n \"left\",\n \"middle\",\n tick,\n width,\n ),\n );\n });\n if (y2.title)\n out.push(\n label(\n \"y2title\",\n y2.title,\n width - line / 2 - 4,\n plot.y + plot.height / 2,\n \"center\",\n \"middle\",\n title,\n width,\n {\n transform: [{ rotate: \"90deg\" }],\n },\n ),\n );\n }\n\n if (scene.legend) {\n for (const e of scene.legend.entries) {\n // coordinates relative to the entry box\n const cy = e.box.height / 2;\n const swatch =\n e.shape === \"dot\"\n ? dot(\"swatch\", 5, cy, 8, e.color)\n : e.shape === \"line\"\n ? box(\"swatch\", 0, cy - 1, 10, 2, e.color)\n : box(\"swatch\", 1, cy - 4, 8, 8, e.color);\n out.push(\n <View\n key={`legend-${e.id}`}\n style={{\n position: \"absolute\",\n left: e.box.x,\n top: e.box.y,\n width: e.box.width,\n height: e.box.height,\n opacity: e.hidden ? 0.45 : 1,\n }}\n {...part(C, \"legend-item\", { hidden: e.hidden })}\n >\n {swatch}\n {label(\n \"name\",\n e.name,\n 14,\n cy,\n \"left\",\n \"middle\",\n { size: 12, color: css(theme.textMuted), family },\n e.box.width,\n e.hidden ? { textDecorationLine: \"line-through\" } : undefined,\n )}\n </View>,\n );\n }\n }\n return out;\n}\n\n// ------------------------------------------------------------ foreground\n\nfunction drawForeground(scene: ChartScene, family?: string): ReactElement[] {\n const { theme, annotations, layout } = scene;\n const { plot, scales } = layout;\n const fs = theme.fontSize;\n const ox = plot.x;\n const oy = plot.y;\n const fw = plot.width;\n const halo = css(theme.background, 0.9);\n const labelHeight = fs + 4;\n const out: ReactElement[] = [];\n\n annotations.forEach((a, i) => {\n if (a.type !== \"line\") return;\n const color = css(a.color);\n const where = annotationLine(a, scales);\n if (!where.vertical) {\n const py = where.at;\n out.push(\n ...dashedLine(\n `line-${i}`,\n \"y\",\n crisp(py, a.width) - oy,\n 0,\n plot.width,\n a.width,\n color,\n a.dash,\n ),\n );\n if (a.label)\n out.push(\n label(\n `line-label-${i}`,\n a.label,\n plot.width - 6,\n py - 3 - oy,\n \"right\",\n \"bottom\",\n { size: fs, weight: 500, color, halo, family },\n fw,\n ),\n );\n } else {\n const px = where.at;\n out.push(\n ...dashedLine(\n `line-${i}`,\n \"x\",\n crisp(px, a.width) - ox,\n 0,\n plot.height,\n a.width,\n color,\n a.dash,\n ),\n );\n if (a.label)\n out.push(\n label(\n `line-label-${i}`,\n a.label,\n px + 5 - ox,\n 5,\n \"left\",\n \"top\",\n { size: fs, weight: 500, color, halo, family },\n fw,\n ),\n );\n }\n });\n\n annotations.forEach((a, i) => {\n if (a.type !== \"rect\" || !a.label) return;\n const r = annotationRect(a, scales);\n if (r.width <= 0 || r.height <= 0) return;\n const pad = 10;\n const pos = a.labelPosition;\n const align: Align = pos.endsWith(\"left\")\n ? \"left\"\n : pos.endsWith(\"right\")\n ? \"right\"\n : \"center\";\n const tx =\n align === \"left\"\n ? r.x + pad\n : align === \"right\"\n ? r.x + r.width - pad\n : r.x + r.width / 2;\n const ty = pos.startsWith(\"top\")\n ? r.y + pad\n : pos.startsWith(\"bottom\")\n ? r.y + r.height - pad - labelHeight\n : r.y + (r.height - labelHeight) / 2;\n out.push(\n label(\n `area-label-${i}`,\n a.label,\n tx - ox,\n ty - oy,\n align,\n \"top\",\n { size: fs + 1, weight: 600, color: css(a.labelColor), family },\n fw,\n ),\n );\n });\n\n annotations.forEach((a, i) => {\n if (a.type !== \"text\" || !a.text) return;\n const w = measureChartText(a.text, `${a.weight} ${fs}px sans-serif`);\n const b = annotationTextBox(a, scales, w, labelHeight);\n out.push(\n label(\n `text-${i}`,\n a.text,\n b.x - ox,\n b.y + b.height / 2 - oy,\n \"left\",\n \"middle\",\n { size: fs, weight: a.weight, color: css(a.color), halo, family },\n fw,\n ),\n );\n });\n\n const pointColor = css(theme.text, 0.85);\n scene.pointLabels.forEach(({ label: l, box: b }, i) => {\n out.push(\n label(\n `point-label-${i}`,\n l.text,\n b.x - ox,\n b.y + b.height / 2 - oy,\n \"left\",\n \"middle\",\n { size: fs, color: pointColor, halo, family },\n fw,\n ),\n );\n });\n return out;\n}\n\nconst clip = (plot: ChartRect): ViewStyle => ({\n position: \"absolute\",\n left: plot.x,\n top: plot.y,\n width: plot.width,\n height: plot.height,\n overflow: \"hidden\",\n});\n\n/**\n * Everything but the hover state: axes, grid, legend, annotations, data and\n * labels (cached by the caller while the model, view and size are the same)\n */\nexport function drawStatic(scene: ChartScene, family?: string): ReactNode {\n const { plot } = scene.layout;\n return (\n <>\n {drawBackground(scene, family)}\n <View key=\"data\" style={clip(plot)} {...part(C, \"data\")}>\n {drawData(scene)}\n </View>\n <View key=\"labels\" style={clip(plot)} {...part(C, \"labels\")}>\n {drawForeground(scene, family)}\n </View>\n </>\n );\n}\n\n/** Crosshair, highlighted points, dragged point and the default tooltip */\nexport function drawHover(\n scene: ChartScene,\n family: string | undefined,\n customTooltip: boolean,\n): ReactNode {\n const { theme, layout, hover, dragging } = scene;\n const { plot } = layout;\n const background = css(theme.background);\n const out: ReactElement[] = [];\n if (hover && hover.crosshairY !== null) {\n out.push(\n <View\n key=\"crosshair-y\"\n style={StyleSheet.absoluteFill}\n {...part(C, \"crosshair\")}\n >\n {dashedLine(\n \"dash\",\n \"y\",\n Math.round(hover.crosshairY),\n plot.x,\n plot.width,\n 1,\n css(theme.textMuted, 0.55),\n [3, 3],\n )}\n </View>,\n );\n }\n if (hover && hover.crosshairX !== null) {\n out.push(\n <View\n key=\"crosshair\"\n style={StyleSheet.absoluteFill}\n {...part(C, \"crosshair\")}\n >\n {dashedLine(\n \"dash\",\n \"x\",\n Math.round(hover.crosshairX),\n plot.y,\n plot.height,\n 1,\n css(theme.textMuted, 0.55),\n [3, 3],\n )}\n </View>,\n );\n }\n hover?.marks.forEach((m, i) => {\n if (m.kind === \"band\") {\n out.push(\n box(`mark-${i}`, m.x, m.y, m.width, m.height, css(theme.text, 0.05), {\n borderRadius: 6,\n }),\n );\n return;\n }\n if (m.kind === \"cell\") {\n out.push(\n box(\n `mark-${i}`,\n m.x - 1.5,\n m.y - 1.5,\n m.width + 3,\n m.height + 3,\n \"transparent\",\n {\n borderRadius: 4,\n borderWidth: 1.5,\n borderColor: css(theme.text, 0.55),\n },\n ),\n );\n return;\n }\n // soft halo, then the dot with a thin ring in the background color\n out.push(\n dot(`halo-${i}`, m.x, m.y, m.size + 8, m.halo),\n dot(`mark-${i}`, m.x, m.y, m.size, m.color, {\n borderWidth: 2,\n borderColor: background,\n }),\n );\n });\n if (dragging) {\n out.push(\n <View key=\"drag\" {...part(C, \"drag\")} style={StyleSheet.absoluteFill}>\n {dot(\n \"ghost\",\n dragging.x,\n dragging.y,\n dragging.size + 2,\n dragging.color,\n {\n opacity: 0.85,\n borderWidth: 2,\n borderColor: background,\n },\n )}\n </View>,\n );\n }\n const tip = hover?.tooltip;\n if (tip && !customTooltip) {\n const { box: b, lineHeight, padding, content } = tip;\n const text = css(theme.text);\n const muted = css(theme.textMuted);\n const font = (weight: number, color: string): TextStyle => ({\n fontSize: 12,\n lineHeight,\n color,\n fontWeight: String(weight) as TextStyle[\"fontWeight\"],\n includeFontPadding: false,\n ...(family ? { fontFamily: family } : null),\n });\n const swatch = (color: string) => (\n <View\n style={{\n width: 8,\n height: 8,\n borderRadius: 4,\n marginRight: 6,\n backgroundColor: color,\n }}\n />\n );\n const row: ViewStyle = {\n height: lineHeight,\n flexDirection: \"row\",\n alignItems: \"center\",\n };\n out.push(\n <View\n key=\"tooltip\"\n {...part(C, \"tooltip\")}\n style={[\n tooltipCard(scene),\n {\n left: b.x,\n top: b.y,\n width: b.width,\n height: b.height,\n paddingHorizontal: padding + 1,\n paddingVertical: padding - 1,\n },\n ]}\n >\n {tip.text\n ? tip.text.map((t, i) => (\n <Text key={i} numberOfLines={1} style={font(400, text)}>\n {t}\n </Text>\n ))\n : [\n <View key=\"title\" style={row}>\n {content.titleColor ? swatch(content.titleColor) : null}\n <Text\n numberOfLines={1}\n style={[font(600, text), { flexShrink: 1 }]}\n >\n {content.title}\n </Text>\n </View>,\n ...content.rows.map((r, i) => (\n <View key={i} style={row}>\n {r.color ? swatch(r.color) : null}\n <Text\n numberOfLines={1}\n style={[font(400, muted), { flexShrink: 1 }]}\n >\n {r.name}\n </Text>\n <Text\n numberOfLines={1}\n style={[\n font(600, text),\n { flexGrow: 1, marginLeft: 16, textAlign: \"right\" },\n ]}\n >\n {r.value}\n </Text>\n </View>\n )),\n ]}\n </View>,\n );\n }\n return out;\n}\n\n/** Look of the tooltips (default and `renderTooltip` content) */\nexport const tooltipCard = (scene: ChartScene): ViewStyle => ({\n position: \"absolute\",\n backgroundColor: css(scene.theme.background),\n borderColor: css(scene.theme.axis),\n borderWidth: 1,\n borderRadius: 8,\n shadowColor: \"#0f172a\",\n shadowOpac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":"scene.js","names":["annotationRect","annotationLine","annotationTextBox","_Fragment","SHAPE_BUDGET","C","lineHeightOf","size","slack","measureChartText","text","o","label","lh","pad","w","top","valign","y","horizontal","align","x","frameWidth","Text","extra","key","box","View","color","dot","cx","d","cy","segment","dx","x2","x1","dy","y2","y1","length","width","dashRuns","pattern","dash","v","period","a","b","runs","scale","max","out","at","i","step","dashedLine","start","run","axis","from","crisp","thin","stride","k","lx","ly","areaStrips","transposed","points","plot","frame","n","forward","xs","ys","bs","bottom","baseline","to","column","j","left","c","right","mid","x0","t","h","primitiveLimits","scene","visible","s","lines","scatters","perLine","maxDots","drawData","primitives","scenePrimitives","options","ox","oy","dotsLeft","barsLeft","p","total","pts","r","count","radius","stroke","css","toCss","alpha","drawBackground","layout","scales","bottomAxis","model","leftAxis","bottomTicks","leftTicks","bottomPx","leftPx","fs","theme","rectOf","grid","py","px","line","tick","title","lastRight","lastBottom","y2Ticks","ramp","bar","stops","part","l","e","swatch","drawForeground","fw","halo","labelHeight","along","annotations","where","lineOf","pos","tx","ty","textBox","pointColor","clip","drawStatic","Fragment","family","drawHover","background","hover","StyleSheet","m","grow","inset","dragging","tip","customTooltip","muted","font","weight","row","lineHeight","tooltipCard","padding","content"],"sources":["../../../../../native/src/components/Chart/scene.tsx"],"sourcesContent":["// Draws a chart scene (`ChartController.getScene()`) with plain views: no\n// canvas, SVG or native drawing module. The engine already resolves every\n// position in pixels; this file only turns them into absolutely positioned\n// <View> / <Text> elements, keeping the number of views bounded by the size\n// of the chart (lines decimated per column, dots merged per cell, bars\n// merged per pixel column), whatever the size of the data.\n\nimport type { ReactElement, ReactNode } from \"react\";\nimport {\n StyleSheet,\n Text,\n View,\n type TextStyle,\n type ViewStyle,\n} from \"react-native\";\nimport {\n annotationLine,\n annotationRect,\n annotationTextBox,\n scenePrimitives,\n toCss,\n type ChartPrimitive,\n type ChartRect,\n type ChartScene,\n} from \"@minerva/charts/canvas\";\nimport { part } from \"../../internal/parts\";\nimport { measureChartText } from \"./measure\";\n\ntype Rgba = ChartScene[\"theme\"][\"text\"];\n\n/** Upper bounds of the views drawn for the data of a chart */\nexport const SHAPE_BUDGET = {\n /** Points of all the lines (one view per segment) */\n linePoints: 1200,\n /** Dots of one scatter series before they are merged per cell */\n dotsPerSeries: 800,\n /** Dots of all the series */\n dots: 2000,\n /** Bars of one series before neighbors are merged per pixel column */\n barsPerSeries: 600,\n /** Bars of all the series */\n bars: 1500,\n /** Vertical strips filling one area */\n areaColumns: 200,\n /** Dashes of one dashed line */\n dashes: 200,\n} as const;\n\nconst C = \"chart\";\n\n// ------------------------------------------------------------------ text\n\ninterface TextOptions {\n size: number;\n color: string;\n weight?: number;\n family?: string;\n /** Halo color: keeps the text readable over the data */\n halo?: string;\n}\n\ntype Align = \"left\" | \"center\" | \"right\";\ntype VAlign = \"top\" | \"middle\" | \"bottom\";\n\nconst lineHeightOf = (size: number) => Math.ceil(size * 1.35);\n\n/** Box wide enough for the estimated width (the real one may differ) */\nconst slack = (text: string, o: TextOptions) =>\n Math.ceil(\n measureChartText(text, `${o.weight ?? 400} ${o.size}px sans-serif`) * 1.4 +\n o.size * 2,\n );\n\n/**\n * A one-line text anchored at (x, y) of a container `frameWidth` wide:\n * `left` starts there, `right` ends there, `center` is centered on it;\n * `top` / `bottom` place the em box like the canvas text baselines\n */\nfunction label(\n key: string,\n text: string,\n x: number,\n y: number,\n align: Align,\n valign: VAlign,\n o: TextOptions,\n frameWidth: number,\n extra?: TextStyle,\n): ReactElement {\n const lh = lineHeightOf(o.size);\n const pad = (lh - o.size) / 2;\n const w = slack(text, o);\n const top =\n valign === \"top\"\n ? y - pad\n : valign === \"bottom\"\n ? y - lh + pad\n : y - lh / 2;\n const horizontal: TextStyle =\n align === \"left\"\n ? { left: x, width: w }\n : align === \"right\"\n ? { right: frameWidth - x, width: w }\n : { left: x - w / 2, width: w };\n return (\n <Text\n key={key}\n numberOfLines={1}\n style={[\n {\n position: \"absolute\",\n top,\n ...horizontal,\n textAlign: align,\n fontSize: o.size,\n lineHeight: lh,\n color: o.color,\n fontWeight: String(o.weight ?? 400) as TextStyle[\"fontWeight\"],\n includeFontPadding: false,\n ...(o.family ? { fontFamily: o.family } : null),\n ...(o.halo\n ? {\n textShadowColor: o.halo,\n textShadowRadius: 3,\n textShadowOffset: { width: 0, height: 0 },\n }\n : null),\n },\n extra,\n ]}\n >\n {text}\n </Text>\n );\n}\n\n// ---------------------------------------------------------------- shapes\n\nconst box = (\n key: string,\n x: number,\n y: number,\n width: number,\n height: number,\n color: string,\n extra?: ViewStyle,\n): ReactElement => (\n <View\n key={key}\n style={[\n {\n position: \"absolute\",\n left: x,\n top: y,\n width,\n height,\n backgroundColor: color,\n },\n extra,\n ]}\n />\n);\n\nconst dot = (\n key: string,\n cx: number,\n cy: number,\n d: number,\n color: string,\n extra?: ViewStyle,\n) =>\n box(key, cx - d / 2, cy - d / 2, d, d, color, {\n borderRadius: d / 2,\n ...extra,\n });\n\n/** A straight stroke: one view, rotated around its center */\nconst segment = (\n key: string,\n x1: number,\n y1: number,\n x2: number,\n y2: number,\n width: number,\n color: string,\n) => {\n const dx = x2 - x1;\n const dy = y2 - y1;\n const length = Math.hypot(dx, dy) + width;\n return box(\n key,\n (x1 + x2) / 2 - length / 2,\n (y1 + y2) / 2 - width / 2,\n length,\n width,\n color,\n {\n borderRadius: width / 2,\n transform: [{ rotate: `${Math.atan2(dy, dx)}rad` }],\n },\n );\n};\n\n/** Dash runs `[start, length]` along a line (canvas `setLineDash` pattern) */\nexport function dashRuns(\n length: number,\n dash: readonly number[],\n max: number = SHAPE_BUDGET.dashes,\n): [number, number][] {\n let pattern = dash.filter((v) => Number.isFinite(v) && v >= 0);\n // odd patterns repeat twice, like the canvas\n if (pattern.length % 2) pattern = [...pattern, ...pattern];\n const period = pattern.reduce((a, b) => a + b, 0);\n if (!pattern.length || period <= 0) return [[0, length]];\n const runs = (length / period) * (pattern.length / 2);\n const scale = runs > max ? runs / max : 1;\n const out: [number, number][] = [];\n let at = 0;\n for (let i = 0; at < length; i = (i + 1) % pattern.length) {\n const step = pattern[i] * scale;\n if (i % 2 === 0 && step > 0) out.push([at, Math.min(step, length - at)]);\n at += Math.max(step, 0.5);\n }\n return out;\n}\n\nconst dashedLine = (\n key: string,\n axis: \"x\" | \"y\",\n at: number,\n from: number,\n length: number,\n width: number,\n color: string,\n dash: readonly number[],\n) =>\n dashRuns(length, dash).map(([start, run], i) =>\n axis === \"y\"\n ? box(`${key}-${i}`, from + start, at, run, width, color)\n : box(`${key}-${i}`, at, from + start, width, run, color),\n );\n\nconst crisp = (v: number, width = 1) => Math.round(v) + 0.5 - width / 2;\n\n// ------------------------------------------------------------------ data\n\n/** Thins a run of interleaved points to `max` points and drops sub-pixel steps */\nfunction thin(run: readonly number[], max: number): number[] {\n const n = run.length / 2;\n const stride = n > max ? Math.ceil(n / max) : 1;\n const out: number[] = [];\n for (let i = 0; i < n; i += stride) {\n const x = run[i * 2];\n const y = run[i * 2 + 1];\n const k = out.length;\n if (k && Math.hypot(x - out[k - 2], y - out[k - 1]) < 1.5) continue;\n out.push(x, y);\n }\n const lx = run[n * 2 - 2];\n const ly = run[n * 2 - 1];\n const k = out.length;\n if (n > 1 && (out[k - 2] !== lx || out[k - 1] !== ly)) out.push(lx, ly);\n return out;\n}\n\n/**\n * Vertical strips between the line and the baseline (or the stack below),\n * one per column; horizontal strips, one per row, for horizontal charts\n */\nfunction areaStrips(\n key: string,\n points: readonly number[],\n baseline: number,\n color: string,\n opacity: number,\n frame: ChartRect,\n /** Y pixel (x pixel when `transposed`) of the bottom edge under every point */\n bottom?: readonly number[],\n /** Horizontal charts: the area grows from the left edge */\n transposed = false,\n): ReactElement[] {\n // horizontal charts are filled like vertical ones with x and y swapped\n const run = transposed\n ? points.map((_, i) => points[i % 2 ? i - 1 : i + 1])\n : points;\n const plot = transposed\n ? { x: frame.y, y: frame.x, width: frame.height, height: frame.width }\n : frame;\n const n = run.length / 2;\n if (n < 2) return [];\n // left to right (reversed axes list their points right to left)\n const forward = run[0] <= run[n * 2 - 2];\n const at = (i: number) => (forward ? i : n - 1 - i);\n const xs = (i: number) => run[at(i) * 2];\n const ys = (i: number) => run[at(i) * 2 + 1];\n const bs = (i: number) => (bottom ? bottom[at(i)] : baseline);\n const from = Math.max(plot.x, xs(0));\n const to = Math.min(plot.x + plot.width, xs(n - 1));\n if (to <= from) return [];\n const column = Math.max(2, plot.width / SHAPE_BUDGET.areaColumns);\n const out: ReactElement[] = [];\n let j = 0;\n for (let left = Math.floor(from), c = 0; left < to; c++) {\n const right = Math.min(Math.ceil(to), Math.round(left + column));\n const mid = (left + right) / 2;\n while (j < n - 2 && xs(j + 1) < mid) j++;\n const x0 = xs(j);\n const x1 = xs(j + 1);\n const t = x1 === x0 ? 0 : Math.max(0, Math.min(1, (mid - x0) / (x1 - x0)));\n const y = ys(j) + (ys(j + 1) - ys(j)) * t;\n const b = bs(j) + (bs(j + 1) - bs(j)) * t;\n if (Number.isFinite(y) && Number.isFinite(b)) {\n const top = Math.min(y, b);\n const h = Math.abs(b - y);\n out.push(\n transposed\n ? box(\n `${key}-${c}`,\n top - plot.y,\n left - plot.x,\n h,\n right - left,\n color,\n {\n opacity,\n },\n )\n : box(\n `${key}-${c}`,\n left - plot.x,\n top - plot.y,\n right - left,\n h,\n color,\n {\n opacity,\n },\n ),\n );\n }\n left = right;\n }\n return out;\n}\n\n/** Limits of `scenePrimitives` for the views budget */\nexport function primitiveLimits(scene: ChartScene) {\n const { plot } = scene.layout;\n const visible = scene.model.series.filter((s) => !s.hidden);\n const lines = visible.filter(\n (s) => s.type === \"line\" || s.type === \"area\",\n ).length;\n const scatters = visible.filter((s) => s.type === \"scatter\").length;\n const perLine = Math.max(150, SHAPE_BUDGET.linePoints / Math.max(1, lines));\n const maxDots = Math.max(\n 100,\n Math.min(\n SHAPE_BUDGET.dotsPerSeries,\n SHAPE_BUDGET.dots / Math.max(1, scatters),\n ),\n );\n return {\n perLine,\n options: {\n // decimation keeps up to 4 points per column\n columnWidth: Math.max(3, (plot.width * 4) / perLine),\n maxDots,\n maxBars: SHAPE_BUDGET.barsPerSeries,\n dotCell: Math.max(\n 4,\n Math.sqrt((plot.width * plot.height) / maxDots) * 1.15 + 1,\n ),\n },\n };\n}\n\nfunction drawData(scene: ChartScene): ReactElement[] {\n const { plot } = scene.layout;\n const { perLine, options } = primitiveLimits(scene);\n const primitives: ChartPrimitive[] = scenePrimitives(scene, options);\n const ox = plot.x;\n const oy = plot.y;\n const out: ReactElement[] = [];\n let dotsLeft: number = SHAPE_BUDGET.dots;\n let barsLeft: number = SHAPE_BUDGET.bars;\n primitives.forEach((p, k) => {\n const key = `${p.kind}${p.seriesIndex}-${k}`;\n if (p.kind === \"area\") {\n p.segments.forEach((run, r) =>\n out.push(\n ...areaStrips(\n `${key}-${r}`,\n run,\n p.baseline,\n p.color,\n p.opacity,\n plot,\n p.bottoms?.[r],\n p.horizontal,\n ),\n ),\n );\n return;\n }\n if (p.kind === \"line\") {\n let total = 0;\n for (const run of p.segments) total += run.length / 2;\n p.segments.forEach((run, r) => {\n const pts = thin(\n run,\n Math.max(\n 2,\n Math.round((perLine * run.length) / 2 / Math.max(1, total)),\n ),\n );\n if (pts.length === 2) {\n out.push(\n dot(\n `${key}-${r}`,\n pts[0] - ox,\n pts[1] - oy,\n p.width * 1.5,\n p.color,\n ),\n );\n return;\n }\n for (let i = 0; i + 3 < pts.length; i += 2) {\n out.push(\n segment(\n `${key}-${r}-${i}`,\n pts[i] - ox,\n pts[i + 1] - oy,\n pts[i + 2] - ox,\n pts[i + 3] - oy,\n p.width,\n p.color,\n ),\n );\n }\n });\n return;\n }\n if (p.kind === \"bars\") {\n const count = p.rects.length / 4;\n const stride =\n count > barsLeft ? Math.ceil(count / Math.max(1, barsLeft)) : 1;\n for (let i = 0; i < count; i += stride) {\n const [x, y, w, h] = p.rects.slice(i * 4, i * 4 + 4);\n const radius = Math.min(p.radius ?? 0, w / 2, h / 2);\n out.push(\n box(\n `${key}-${i}`,\n x - ox,\n y - oy,\n Math.max(w, 0.5),\n h,\n p.colors?.[i] ?? p.color,\n radius > 0.5 || p.opacity !== undefined\n ? {\n ...(radius > 0.5 ? { borderRadius: radius } : null),\n ...(p.opacity !== undefined ? { opacity: p.opacity } : null),\n }\n : undefined,\n ),\n );\n }\n barsLeft = Math.max(0, barsLeft - Math.ceil(count / stride));\n return;\n }\n const count = p.dots.length / 3;\n const stride =\n count > dotsLeft ? Math.ceil(count / Math.max(1, dotsLeft)) : 1;\n const stroke = p.stroke ?? 0;\n for (let i = 0; i < count; i += stride) {\n const color = p.colors[i] ?? \"#888\";\n out.push(\n dot(\n `${key}-${i}`,\n p.dots[i * 3] - ox,\n p.dots[i * 3 + 1] - oy,\n p.dots[i * 3 + 2],\n // rings (hollow box plot outliers): the border only\n p.opacity > 0 ? color : \"transparent\",\n stroke > 0 && p.opacity < 1\n ? { borderWidth: stroke, borderColor: color, opacity: 1 }\n : { opacity: p.opacity },\n ),\n );\n }\n dotsLeft = Math.max(0, dotsLeft - Math.ceil(count / stride));\n });\n return out;\n}\n\n// ------------------------------------------------------------ background\n\nconst css = (c: Rgba, alpha?: number) => toCss(c, alpha);\n\nfunction drawBackground(scene: ChartScene, family?: string): ReactElement[] {\n const { width, theme, model, layout, annotations } = scene;\n const { plot, scales, y2Ticks } = layout;\n // horizontal charts: the value axis along the bottom, the x axis on the left\n const horizontal = scales.horizontal;\n const bottomAxis = horizontal ? model.y : model.x;\n const leftAxis = horizontal ? model.x : model.y;\n const bottomTicks = horizontal ? layout.yTicks : layout.xTicks;\n const leftTicks = horizontal ? layout.xTicks : layout.yTicks;\n const bottomPx = horizontal ? scales.yToPx : scales.xToPx;\n const leftPx = horizontal ? scales.xToPx : scales.yToPx;\n const fs = theme.fontSize;\n const out: ReactElement[] = [];\n\n annotations.forEach((a, i) => {\n if (a.type !== \"rect\") return;\n const r = annotationRect(a, scales);\n if (r.width <= 0 || r.height <= 0) return;\n out.push(\n box(`area-${i}`, r.x, r.y, r.width, r.height, css(a.color, a.opacity)),\n );\n });\n\n const grid = css(theme.grid);\n if (leftAxis.grid) {\n leftTicks.values.forEach((v, i) => {\n const py = leftPx(v);\n if (py < plot.y - 1 || py > plot.y + plot.height + 1) return;\n out.push(box(`ygrid-${i}`, plot.x, crisp(py), plot.width, 1, grid));\n });\n }\n if (bottomAxis.grid) {\n bottomTicks.values.forEach((v, i) => {\n const px = bottomPx(v);\n if (px < plot.x - 1 || px > plot.x + plot.width + 1) return;\n out.push(box(`xgrid-${i}`, crisp(px), plot.y, 1, plot.height, grid));\n });\n }\n\n const line = Math.ceil(fs * 1.4);\n const tick: TextOptions = { size: fs, color: css(theme.textMuted), family };\n const title: TextOptions = {\n size: fs + 1,\n weight: 500,\n color: css(theme.text, 0.8),\n family,\n };\n const bottom = plot.y + plot.height;\n\n if (bottomAxis.visible) {\n out.push(\n box(\"xaxis\", plot.x, crisp(bottom), plot.width, 1, css(theme.axis)),\n );\n let lastRight = -Infinity;\n bottomTicks.values\n .map((v, i) => ({ px: bottomPx(v), text: bottomTicks.labels[i] ?? \"\" }))\n .sort((a, b) => a.px - b.px)\n .forEach(({ px, text }, i) => {\n if (!text || px < plot.x - 0.5 || px > plot.x + plot.width + 0.5)\n return;\n const w = measureChartText(text, `400 ${fs}px sans-serif`);\n const left = Math.max(0, Math.min(width - w, px - w / 2));\n if (left < lastRight + 6) return;\n lastRight = left + w;\n out.push(\n label(\n `xtick-${i}`,\n text,\n left + w / 2,\n bottom + 7,\n \"center\",\n \"top\",\n tick,\n width,\n ),\n );\n });\n if (bottomAxis.title)\n out.push(\n label(\n \"xtitle\",\n bottomAxis.title,\n plot.x + plot.width / 2,\n bottom + line + 10,\n \"center\",\n \"top\",\n title,\n width,\n ),\n );\n }\n\n if (leftAxis.visible) {\n let lastBottom = -Infinity;\n leftTicks.values\n .map((v, i) => ({ py: leftPx(v), text: leftTicks.labels[i] ?? \"\" }))\n .sort((a, b) => a.py - b.py)\n .forEach(({ py, text }, i) => {\n if (!text || py < plot.y - 0.5 || py > plot.y + plot.height + 0.5)\n return;\n // category rows of horizontal charts never overlap\n if (horizontal) {\n if (py - (fs + 2) / 2 < lastBottom) return;\n lastBottom = py + (fs + 2) / 2;\n }\n out.push(\n label(\n `ytick-${i}`,\n text,\n plot.x - 8,\n py,\n \"right\",\n \"middle\",\n tick,\n width,\n ),\n );\n });\n if (leftAxis.title)\n out.push(\n label(\n \"ytitle\",\n leftAxis.title,\n line / 2 + 4,\n plot.y + plot.height / 2,\n \"center\",\n \"middle\",\n title,\n width,\n {\n transform: [{ rotate: \"-90deg\" }],\n },\n ),\n );\n }\n\n const y2 = horizontal ? null : model.y2;\n if (y2 && y2Ticks && y2.visible) {\n const right = plot.x + plot.width;\n y2Ticks.values.forEach((v, i) => {\n const py = scales.yToPx(v);\n const text = y2Ticks.labels[i];\n if (!text || py < plot.y - 0.5 || py > plot.y + plot.height + 0.5) return;\n out.push(\n label(\n `y2tick-${i}`,\n text,\n right + 8,\n py,\n \"left\",\n \"middle\",\n tick,\n width,\n ),\n );\n });\n if (y2.title)\n out.push(\n label(\n \"y2title\",\n y2.title,\n width - line / 2 - 4,\n plot.y + plot.height / 2,\n \"center\",\n \"middle\",\n title,\n width,\n {\n transform: [{ rotate: \"90deg\" }],\n },\n ),\n );\n }\n\n const ramp = scene.legend?.colors;\n if (ramp) {\n // visual map: the ramp in even steps, the values at its ends\n const { bar, stops } = ramp;\n const step = bar.width / Math.max(1, stops.length);\n out.push(\n <View\n key=\"color-legend\"\n {...part(C, \"color-legend\")}\n style={{\n position: \"absolute\",\n left: bar.x,\n top: bar.y,\n width: bar.width,\n height: bar.height,\n borderRadius: bar.height / 2,\n overflow: \"hidden\",\n flexDirection: \"row\",\n }}\n >\n {stops.map((c, k) => (\n <View\n key={k}\n style={{ width: step, height: bar.height, backgroundColor: c }}\n />\n ))}\n </View>,\n );\n ramp.ticks.forEach((t, k) =>\n out.push(\n box(\n `color-tick-${k}`,\n Math.round(t),\n bar.y - 2,\n 1,\n bar.height + 4,\n css(theme.text, 0.35),\n ),\n ),\n );\n ramp.labels.forEach((l, k) =>\n out.push(\n label(\n `color-label-${k}`,\n l.text,\n l.x,\n l.y,\n l.align,\n \"middle\",\n { size: 11, color: css(theme.textMuted), family },\n width,\n ),\n ),\n );\n }\n\n if (scene.legend) {\n for (const e of scene.legend.entries) {\n // coordinates relative to the entry box\n const cy = e.box.height / 2;\n const swatch =\n e.shape === \"dot\"\n ? dot(\"swatch\", 5, cy, 8, e.color)\n : e.shape === \"line\"\n ? box(\"swatch\", 0, cy - 1, 10, 2, e.color)\n : box(\"swatch\", 1, cy - 4, 8, 8, e.color);\n out.push(\n <View\n key={`legend-${e.id}`}\n style={{\n position: \"absolute\",\n left: e.box.x,\n top: e.box.y,\n width: e.box.width,\n height: e.box.height,\n opacity: e.hidden ? 0.45 : 1,\n }}\n {...part(C, \"legend-item\", { hidden: e.hidden })}\n >\n {swatch}\n {label(\n \"name\",\n e.name,\n 14,\n cy,\n \"left\",\n \"middle\",\n { size: 12, color: css(theme.textMuted), family },\n e.box.width,\n e.hidden ? { textDecorationLine: \"line-through\" } : undefined,\n )}\n </View>,\n );\n }\n }\n return out;\n}\n\n// ------------------------------------------------------------ foreground\n\nfunction drawForeground(scene: ChartScene, family?: string): ReactElement[] {\n const { theme, annotations, layout } = scene;\n const { plot, scales } = layout;\n const fs = theme.fontSize;\n const ox = plot.x;\n const oy = plot.y;\n const fw = plot.width;\n const halo = css(theme.background, 0.9);\n const labelHeight = fs + 4;\n const out: ReactElement[] = [];\n\n // waterfall connectors: thin dashed lines between the bars\n scene.connectors.forEach((c, i) => {\n const along = c.y0 === c.y1;\n out.push(\n ...(along\n ? dashedLine(\n `connector-${i}`,\n \"y\",\n crisp(c.y0, c.width) - oy,\n Math.min(c.x0, c.x1) - ox,\n Math.abs(c.x1 - c.x0),\n c.width,\n c.color,\n c.dash,\n )\n : dashedLine(\n `connector-${i}`,\n \"x\",\n crisp(c.x0, c.width) - ox,\n Math.min(c.y0, c.y1) - oy,\n Math.abs(c.y1 - c.y0),\n c.width,\n c.color,\n c.dash,\n )),\n );\n });\n\n annotations.forEach((a, i) => {\n if (a.type !== \"line\") return;\n const color = css(a.color);\n const where = annotationLine(a, scales);\n if (!where.vertical) {\n const py = where.at;\n out.push(\n ...dashedLine(\n `line-${i}`,\n \"y\",\n crisp(py, a.width) - oy,\n 0,\n plot.width,\n a.width,\n color,\n a.dash,\n ),\n );\n if (a.label)\n out.push(\n label(\n `line-label-${i}`,\n a.label,\n plot.width - 6,\n py - 3 - oy,\n \"right\",\n \"bottom\",\n { size: fs, weight: 500, color, halo, family },\n fw,\n ),\n );\n } else {\n const px = where.at;\n out.push(\n ...dashedLine(\n `line-${i}`,\n \"x\",\n crisp(px, a.width) - ox,\n 0,\n plot.height,\n a.width,\n color,\n a.dash,\n ),\n );\n if (a.label)\n out.push(\n label(\n `line-label-${i}`,\n a.label,\n px + 5 - ox,\n 5,\n \"left\",\n \"top\",\n { size: fs, weight: 500, color, halo, family },\n fw,\n ),\n );\n }\n });\n\n annotations.forEach((a, i) => {\n if (a.type !== \"rect\" || !a.label) return;\n const r = annotationRect(a, scales);\n if (r.width <= 0 || r.height <= 0) return;\n const pad = 10;\n const pos = a.labelPosition;\n const align: Align = pos.endsWith(\"left\")\n ? \"left\"\n : pos.endsWith(\"right\")\n ? \"right\"\n : \"center\";\n const tx =\n align === \"left\"\n ? r.x + pad\n : align === \"right\"\n ? r.x + r.width - pad\n : r.x + r.width / 2;\n const ty = pos.startsWith(\"top\")\n ? r.y + pad\n : pos.startsWith(\"bottom\")\n ? r.y + r.height - pad - labelHeight\n : r.y + (r.height - labelHeight) / 2;\n out.push(\n label(\n `area-label-${i}`,\n a.label,\n tx - ox,\n ty - oy,\n align,\n \"top\",\n { size: fs + 1, weight: 600, color: css(a.labelColor), family },\n fw,\n ),\n );\n });\n\n annotations.forEach((a, i) => {\n if (a.type !== \"text\" || !a.text) return;\n const w = measureChartText(a.text, `${a.weight} ${fs}px sans-serif`);\n const b = annotationTextBox(a, scales, w, labelHeight);\n out.push(\n label(\n `text-${i}`,\n a.text,\n b.x - ox,\n b.y + b.height / 2 - oy,\n \"left\",\n \"middle\",\n { size: fs, weight: a.weight, color: css(a.color), halo, family },\n fw,\n ),\n );\n });\n\n const pointColor = css(theme.text, 0.85);\n scene.pointLabels.forEach(({ label: l, box: b }, i) => {\n out.push(\n label(\n `point-label-${i}`,\n l.text,\n b.x - ox,\n b.y + b.height / 2 - oy,\n \"left\",\n \"middle\",\n { size: fs, color: pointColor, halo, family },\n fw,\n ),\n );\n });\n return out;\n}\n\nconst clip = (plot: ChartRect): ViewStyle => ({\n position: \"absolute\",\n left: plot.x,\n top: plot.y,\n width: plot.width,\n height: plot.height,\n overflow: \"hidden\",\n});\n\n/**\n * Everything but the hover state: axes, grid, legend, annotations, data and\n * labels (cached by the caller while the model, view and size are the same)\n */\nexport function drawStatic(scene: ChartScene, family?: string): ReactNode {\n const { plot } = scene.layout;\n return (\n <>\n {drawBackground(scene, family)}\n <View key=\"data\" style={clip(plot)} {...part(C, \"data\")}>\n {drawData(scene)}\n </View>\n <View key=\"labels\" style={clip(plot)} {...part(C, \"labels\")}>\n {drawForeground(scene, family)}\n </View>\n </>\n );\n}\n\n/** Crosshair, highlighted points, dragged point and the default tooltip */\nexport function drawHover(\n scene: ChartScene,\n family: string | undefined,\n customTooltip: boolean,\n): ReactNode {\n const { theme, layout, hover, dragging } = scene;\n const { plot } = layout;\n const background = css(theme.background);\n const out: ReactElement[] = [];\n if (hover && hover.crosshairY !== null) {\n out.push(\n <View\n key=\"crosshair-y\"\n style={StyleSheet.absoluteFill}\n {...part(C, \"crosshair\")}\n >\n {dashedLine(\n \"dash\",\n \"y\",\n Math.round(hover.crosshairY),\n plot.x,\n plot.width,\n 1,\n css(theme.textMuted, 0.55),\n [3, 3],\n )}\n </View>,\n );\n }\n if (hover && hover.crosshairX !== null) {\n out.push(\n <View\n key=\"crosshair\"\n style={StyleSheet.absoluteFill}\n {...part(C, \"crosshair\")}\n >\n {dashedLine(\n \"dash\",\n \"x\",\n Math.round(hover.crosshairX),\n plot.y,\n plot.height,\n 1,\n css(theme.textMuted, 0.55),\n [3, 3],\n )}\n </View>,\n );\n }\n hover?.marks.forEach((m, i) => {\n if (m.kind === \"band\") {\n out.push(\n box(`mark-${i}`, m.x, m.y, m.width, m.height, css(theme.text, 0.05), {\n borderRadius: 6,\n }),\n );\n return;\n }\n if (m.kind === \"guide\") {\n // the row / column of the hovered heatmap cell\n out.push(\n box(`mark-${i}`, m.x, m.y, m.width, m.height, css(theme.text, 0.06)),\n );\n return;\n }\n if (m.kind === \"cell\") {\n // lifted: a little larger, a shadow, a ring inside its edge\n const grow = Math.min(3, m.width * 0.06, m.height * 0.06);\n const inset = Math.min(2, m.width / 5, m.height / 5);\n out.push(\n box(\n `mark-${i}`,\n m.x - grow,\n m.y - grow,\n m.width + grow * 2,\n m.height + grow * 2,\n m.color,\n {\n borderRadius: Math.max(2, m.radius),\n shadowColor: \"#0f172a\",\n shadowOpacity: 0.45,\n shadowRadius: 6,\n shadowOffset: { width: 0, height: 3 },\n elevation: 4,\n },\n ),\n );\n if (m.width > 8 && m.height > 8)\n out.push(\n box(\n `ring-${i}`,\n m.x - grow + inset,\n m.y - grow + inset,\n m.width + (grow - inset) * 2,\n m.height + (grow - inset) * 2,\n \"transparent\",\n {\n borderRadius: Math.max(1, m.radius - inset / 2),\n borderWidth: 1.5,\n borderColor: m.ring,\n },\n ),\n );\n return;\n }\n // soft halo, then the dot with a thin ring in the background color\n out.push(\n dot(`halo-${i}`, m.x, m.y, m.size + 8, m.halo),\n dot(`mark-${i}`, m.x, m.y, m.size, m.color, {\n borderWidth: 2,\n borderColor: background,\n }),\n );\n });\n if (dragging) {\n out.push(\n <View key=\"drag\" {...part(C, \"drag\")} style={StyleSheet.absoluteFill}>\n {dot(\n \"ghost\",\n dragging.x,\n dragging.y,\n dragging.size + 2,\n dragging.color,\n {\n opacity: 0.85,\n borderWidth: 2,\n borderColor: background,\n },\n )}\n </View>,\n );\n }\n const tip = hover?.tooltip;\n if (tip && !customTooltip) {\n const { box: b, lineHeight, padding, content } = tip;\n const text = css(theme.text);\n const muted = css(theme.textMuted);\n const font = (weight: number, color: string): TextStyle => ({\n fontSize: 12,\n lineHeight,\n color,\n fontWeight: String(weight) as TextStyle[\"fontWeight\"],\n includeFontPadding: false,\n ...(family ? { fontFamily: family } : null),\n });\n const swatch = (color: string) => (\n <View\n style={{\n width: 8,\n height: 8,\n borderRadius: 4,\n marginRight: 6,\n backgroundColor: color,\n }}\n />\n );\n const row: ViewStyle = {\n height: lineHeight,\n flexDirection: \"row\",\n alignItems: \"center\",\n };\n out.push(\n <View\n key=\"tooltip\"\n {...part(C, \"tooltip\")}\n style={[\n tooltipCard(scene),\n {\n left: b.x,\n top: b.y,\n width: b.width,\n height: b.height,\n paddingHorizontal: padding + 1,\n paddingVertical: padding - 1,\n },\n ]}\n >\n {tip.text\n ? tip.text.map((t, i) => (\n <Text key={i} numberOfLines={1} style={font(400, text)}>\n {t}\n </Text>\n ))\n : [\n <View key=\"title\" style={row}>\n {content.titleColor ? swatch(content.titleColor) : null}\n <Text\n numberOfLines={1}\n style={[font(600, text), { flexShrink: 1 }]}\n >\n {content.title}\n </Text>\n </View>,\n ...(content.subtitle\n ? [\n <View key=\"subtitle\" style={row}>\n <Text\n numberOfLines={1}\n style={[\n font(400, muted),\n {\n fontSize: 11,\n paddingLeft: content.titleColor ? 14 : 0,\n },\n ]}\n >\n {content.subtitle}\n </Text>\n </View>,\n ]\n : []),\n // a label column (after the swatch column) and right-aligned values\n ...content.rows.map((r, i) => (\n <View key={i} style={row}>\n {tip.swatchWidth > 0 ? (\n <View style={{ width: tip.swatchWidth }}>\n {r.color ? swatch(r.color) : null}\n </View>\n ) : null}\n <Text\n numberOfLines={1}\n style={[font(400, muted), { flexShrink: 1 }]}\n >\n {r.name}\n </Text>\n <Text\n numberOfLines={1}\n style={[\n font(600, text),\n {\n flexGrow: 1,\n marginLeft: 16,\n textAlign: \"right\",\n fontVariant: [\"tabular-nums\"],\n },\n ]}\n >\n {r.value}\n </Text>\n </View>\n )),\n ]}\n </View>,\n );\n }\n return out;\n}\n\n/** Look of the tooltips (default and `renderTooltip` content) */\nexport const tooltipCard = (scene: ChartScene): ViewStyle => ({\n position: \"absolute\",\n backgroundColor: css(scene.theme.background),\n borderColor: css(scene.theme.axis),\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});\n"],"mappings":";;;;;;;;;AA+BA,IAAaI,IAAe;CAE1B,YAAY;CAEZ,eAAe;CAEf,MAAM;CAEN,eAAe;CAEf,MAAM;CAEN,aAAa;CAEb,QAAQ;AACV,GAEMC,IAAI,SAgBJC,KAAgB,MAAiB,KAAK,KAAKC,IAAO,IAAI,GAGtDC,KAAS,GAAc,MAC3B,KAAK,KACHC,EAAiBC,GAAM,GAAGC,EAAE,UAAU,IAAI,GAAGA,EAAE,KAAK,cAAc,IAAI,MACpEA,EAAE,OAAO,CACb;AAOF,SAASC,EACP,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACc;CACd,IAAMC,IAAKP,EAAa,EAAE,IAAI,GACxBQ,KAAOD,IAAK,EAAE,QAAQ,GACtBE,IAAIP,EAAME,GAAM,CAAC,GACjBM,IACJC,MAAW,QACPC,IAAIJ,IACJG,MAAW,WACTC,IAAIL,IAAKC,IACTI,IAAIL,IAAK,GACXM,IACJC,MAAU,SACN;EAAE,MAAMC;EAAG,OAAON;CAAE,IACpBK,MAAU,UACR;EAAE,OAAOE,IAAaD;EAAG,OAAON;CAAE,IAClC;EAAE,MAAMM,IAAIN,IAAI;EAAG,OAAOA;CAAE;CACpC,OACE,kBAACQ,GAAD;EAEE,eAAe;EACf,OAAO,CACL;GACE,UAAU;GACV;GACA,GAAGJ;GACH,WAAWC;GACX,UAAU,EAAE;GACZ,YAAYP;GACZ,OA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AD;OACE,eAAe;OACf,OAAO,CAACqJ,EAAK,KAAKD,CAAK,GAAG,EAAE,YAAY,EAAE,CAAC;OAE1C,UAAA/D,EAAE;MACC,CAAA;MACN,kBAACrF,GAAD;OACE,eAAe;OACf,OAAO,CACLqJ,EAAK,KAAKlK,CAAI,GACd;QACE,UAAU;QACV,YAAY;QACZ,WAAW;QACX,aAAa,CAAC,cAAc;OAC9B,CACF;OAEC,UAAAkG,EAAE;MACC,CAAA;KACF;IA1BK,GAAAtD,CA0BL,CACP;GACH;EACA,GA/EA,SA+EA,CACR;CACF;CACA,OAAOF;AACT;AAGA,IAAa4H,KAAe,OAAkC;CAC5D,UAAU;CACV,iBAAiBhE,EAAItB,EAAM,MAAM,UAAU;CAC3C,aAAasB,EAAItB,EAAM,MAAM,IAAI;CACjC,aAAa;CACb,cAAc;CACd,aAAa;CACb,eAAe;CACf,cAAc;CACd,cAAc;EAAE,OAAO;EAAG,QAAQ;CAAE;CACpC,WAAW;AACb"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require("../../charts/src/engine/presets.cjs");require("../../charts/src/canvas.cjs");const t=require("../Chart/ChartBase.cjs");let n=require("react"),r=require("react/jsx-runtime");var i=(e,t)=>{let n=Object.keys(e);return n.length===Object.keys(t).length&&n.every(n=>Object.is(e[n],t[n]))};function a(e){let[t,r]=(0,n.useState)(e);return t!==e&&!i(t,e)?(r(e),e):t}var o=[];function s(e){let{labels:n}=e;return a(t.engineOptions({...e,labels:typeof n==`object`?n:void 0,series:o}))}var c=e=>({height:e.height,width:e.width,style:e.style,testID:e.testID,handleRef:e.ref,onHover:e.onHover,onPointClick:e.onPointClick,onPlotClick:e.onPlotClick,onZoom:e.onZoom,renderTooltip:e.renderTooltip});function l(i){let{series:a,curve:o=`smooth`,stacked:l=!1,percent:u=!1}=i,d=s(i),f=(0,n.useMemo)(()=>({...d,series:e.areaSeries(a,{curve:o,stacked:l||u}),stackMode:u?`percent`:void 0}),[d,a,o,l,u]);return(0,r.jsx)(t.ChartBase,{options:f,...c(i)})}function u(i){let{series:a}=i,o=s(i),l=(0,n.useMemo)(()=>({...o,series:e.candlestickSeries(a)}),[o,a]);return(0,r.jsx)(t.ChartBase,{options:l,...c(i)})}function d(i){let{data:a,xCategories:o,yCategories:l,colorScale:u,valueRange:d,
|
|
1
|
+
const e=require("../../charts/src/engine/presets.cjs");require("../../charts/src/canvas.cjs");const t=require("../Chart/ChartBase.cjs");let n=require("react"),r=require("react/jsx-runtime");var i=(e,t)=>{let n=Object.keys(e);return n.length===Object.keys(t).length&&n.every(n=>Object.is(e[n],t[n]))};function a(e){let[t,r]=(0,n.useState)(e);return t!==e&&!i(t,e)?(r(e),e):t}var o=[];function s(e){let{labels:n}=e;return a(t.engineOptions({...e,labels:typeof n==`object`?n:void 0,series:o}))}var c=e=>({height:e.height,width:e.width,style:e.style,testID:e.testID,handleRef:e.ref,onHover:e.onHover,onPointClick:e.onPointClick,onPlotClick:e.onPlotClick,onZoom:e.onZoom,renderTooltip:e.renderTooltip});function l(i){let{series:a,curve:o=`smooth`,stacked:l=!1,percent:u=!1}=i,d=s(i),f=(0,n.useMemo)(()=>({...d,series:e.areaSeries(a,{curve:o,stacked:l||u}),stackMode:u?`percent`:void 0}),[d,a,o,l,u]);return(0,r.jsx)(t.ChartBase,{options:f,...c(i)})}function u(i){let{series:a}=i,o=s(i),l=(0,n.useMemo)(()=>({...o,series:e.candlestickSeries(a)}),[o,a]);return(0,r.jsx)(t.ChartBase,{options:l,...c(i)})}function d(i){let{data:a,xCategories:o,yCategories:l,colorScale:u,valueRange:d,colorMidpoint:f,name:p,radius:m,format:h,legend:g,interaction:_,tooltip:v}=i,y=s(i),b=(0,n.useMemo)(()=>e.heatmapChartOptions({data:a,xCategories:o,yCategories:l,colorScale:u,valueRange:d,colorMidpoint:f,name:p,radius:m,format:h},{...y,legend:g,interaction:_,tooltip:v}),[y,a,o,l,u,d,f,p,m,h,g,_,v]);return(0,r.jsx)(t.ChartBase,{options:b,...c(i)})}function f(i){let{data:a,type:o,color:s,curve:c,name:l,reference:u,format:d,height:f=48,width:p,tooltip:m,palette:h,ariaLabel:g,locale:_,labels:v,style:y,testID:b,ref:x,onHover:S,renderTooltip:C}=i,w=(0,n.useMemo)(()=>e.sparklineOptions({data:a,type:o,color:s,curve:c,name:l,reference:u,format:d},{tooltip:m,palette:h,ariaLabel:g,locale:_,labels:v}),[a,o,s,c,l,u,d,m,h,g,_,v]);return(0,r.jsx)(t.ChartBase,{options:w,height:f,width:p,style:y,testID:b,handleRef:x,onHover:S,renderTooltip:C})}function p(i){let{series:a,curve:o=`smooth`}=i,l=s(i),u=(0,n.useMemo)(()=>({...l,series:e.rangeAreaSeries(a,o)}),[l,a,o]);return(0,r.jsx)(t.ChartBase,{options:u,...c(i)})}function m(e){let{series:i,yAxis2:a,stackMode:o,orientation:l}=e,u=s(e),d=(0,n.useMemo)(()=>({...u,series:i,...a?{yAxis2:a}:null,...o?{stackMode:o}:null,...l?{orientation:l}:null}),[u,i,a,o,l]);return(0,r.jsx)(t.ChartBase,{options:d,...c(e)})}function h(i){let{series:a,minSize:o,maxSize:l,maxValue:u}=i,d=s(i),f=(0,n.useMemo)(()=>({...d,series:e.bubbleSeries(a,{minSize:o,maxSize:l,maxValue:u})}),[d,a,o,l,u]);return(0,r.jsx)(t.ChartBase,{options:f,...c(i)})}function g(i){let{values:a,bins:o,domain:l,nice:u,name:d,color:f,formatBin:p,series:m}=i,h=s(i),g=(0,n.useMemo)(()=>({...h,series:[e.histogramSeries(a,{bins:o,domain:l,nice:u,name:d,color:f,format:p,locale:h.locale}),...m??[]]}),[h,a,o,l,u,d,f,p,m]);return(0,r.jsx)(t.ChartBase,{options:g,...c(i)})}function _(i){let{series:a,groups:o,name:l=`Values`,whisker:u,orientation:d,outlierShape:f,outlierSize:p}=i,m=s(i),h=(0,n.useMemo)(()=>({...m,series:e.boxplotSeries([...o?.length?[{id:`boxplot`,name:l,data:e.boxplotData(o,{whisker:u})}]:[],...a??[]]).map(e=>e.type===`boxplot`?{...e,outlierShape:e.outlierShape??f,outlierSize:e.outlierSize??p}:e),...d?{orientation:d}:null}),[m,a,o,l,u,d,f,p]);return(0,r.jsx)(t.ChartBase,{options:h,...c(i)})}function v(i){let{steps:a,name:o,upColor:l,downColor:u,totalColor:d,start:f,labels:p=!0,format:m,connector:h,orientation:g,locale:_}=i,v=s(i),y=(0,n.useMemo)(()=>({...v,..._?{locale:_}:null,series:[e.waterfallSeries(a,{name:o,upColor:l,downColor:u,totalColor:d,start:f,labels:p,format:m,connector:h,locale:_??v.locale})],...g?{orientation:g}:null}),[v,_,a,o,l,u,d,f,p,m,h,g]);return(0,r.jsx)(t.ChartBase,{options:y,...c(i)})}function y(i){let{tasks:a,colors:o,taskName:l,progressName:u,milestoneName:d,formatProgress:f,dependenciesName:p,today:m=!1,todayLabel:h,xAxis:g,yAxis:_,annotations:v,interaction:y,legend:b,locale:x}=i,S=s(i),[C]=(0,n.useState)(()=>Date.now()),w=m===!1?null:m===!0?C:m instanceof Date?m.getTime():m,T=(0,n.useMemo)(()=>{let t=e.ganttSeries(a,{colors:o,taskName:l,progressName:u,milestoneName:d,formatProgress:f,dependenciesName:p,locale:x??S.locale}),n=w===null?[]:[{type:`line`,axis:`y`,value:w,color:`var(--danger-color, #dc2626)`,dash:[4,3],label:h}];return{...S,...x?{locale:x}:null,series:t.series,orientation:`horizontal`,xAxis:{type:`category`,categories:t.categories,...g},yAxis:{type:`time`,min:t.domain[0],max:t.domain[1],..._},annotations:[...v??[],...n],interaction:y??{zoom:`y`},legend:b??t.series.length>1}},[S,x,a,o,l,u,d,f,p,w,h,g,_,v,y,b]);return(0,r.jsx)(t.ChartBase,{options:T,...c(i)})}exports.AreaChart=l,exports.BoxPlotChart=_,exports.BubbleChart=h,exports.CandlestickChart=u,exports.GanttChart=y,exports.HeatmapChart=d,exports.HistogramChart=g,exports.MixedChart=m,exports.RangeAreaChart=p,exports.Sparkline=f,exports.WaterfallChart=v;
|
|
2
2
|
//# sourceMappingURL=charts.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"charts.cjs","names":["useState","engineOptions","useMemo","areaSeries","ChartBase","candlestickSeries","heatmapChartOptions","sparklineOptions","rangeAreaSeries","bubbleSeries","histogramSeries","boxplotSeries","boxplotData","waterfallSeries","ganttSeries","require_presets","require_ChartBase","react","react_jsx_runtime","shallowEqual","keys","a","b","key","useShallowStable","stable","setStable","value","NO_SERIES","useBaseOptions","props","labels","frameProps","AreaChart","input","base","options","stacked","percent","curve","CandlestickChart","HeatmapChart","data","xCategories","yCategories","colorScale","valueRange","name","radius","format","legend","interaction","tooltip","Sparkline","type","color","reference","palette","ariaLabel","locale","ref","RangeAreaChart","MixedChart","yAxis2","stackMode","orientation","series","BubbleChart","minSize","maxSize","maxValue","HistogramChart","extra","values","formatBin","bins","domain","nice","BoxPlotChart","groups","whisker","WaterfallChart","steps","upColor","downColor","totalColor","start","GanttChart","mountedAt","now","today","gantt","tasks","lines","todayLabel","xAxis","yAxis","annotations","colors","taskName","progressName","milestoneName","formatProgress"],"sources":["../../../../../native/src/components/Charts/charts.tsx"],"sourcesContent":["// Named cartesian charts of React Native: thin wrappers mapping the props\n// of the web components (minerva-design/charts) to engine options through\n// the presets of @minerva/charts/canvas, drawn by the view-based ChartBase.\n\nimport { useMemo, useState } from \"react\";\nimport {\n areaSeries,\n boxplotData,\n boxplotSeries,\n bubbleSeries,\n candlestickSeries,\n ganttSeries,\n heatmapChartOptions,\n histogramSeries,\n rangeAreaSeries,\n sparklineOptions,\n waterfallSeries,\n type ChartAnnotation,\n type ChartOptions,\n type ChartSeries,\n} from \"@minerva/charts/canvas\";\nimport { ChartBase, engineOptions } from \"../Chart/ChartBase\";\nimport type { ChartCommonProps } from \"../Chart/types\";\nimport type {\n AreaChartProps,\n BoxPlotChartProps,\n BubbleChartProps,\n CandlestickChartProps,\n GanttChartProps,\n HeatmapChartProps,\n HistogramChartProps,\n MixedChartProps,\n RangeAreaChartProps,\n SparklineProps,\n WaterfallChartProps,\n} from \"./types\";\n\nconst shallowEqual = (\n a: Record<string, unknown>,\n b: Record<string, unknown>,\n) => {\n const keys = Object.keys(a);\n return (\n keys.length === Object.keys(b).length &&\n keys.every((key) => Object.is(a[key], b[key]))\n );\n};\n\n/**\n * The same object while every key keeps the same value (derived state:\n * the engine keeps its zoom and animations while the props are equal)\n */\nfunction useShallowStable<T extends object>(value: T): T {\n const [stable, setStable] = useState(value);\n if (\n stable !== value &&\n !shallowEqual(\n stable as Record<string, unknown>,\n value as Record<string, unknown>,\n )\n ) {\n setStable(value);\n return value;\n }\n return stable;\n}\n\nconst NO_SERIES: readonly ChartSeries[] = [];\n\ntype BaseProps = Omit<ChartCommonProps, \"crosshair\" | \"labels\"> & {\n crosshair?: boolean;\n /** Texts of the engine; a boolean is the `labels` prop of a chart (value labels) */\n labels?: ChartCommonProps[\"labels\"] | boolean;\n};\n\n/** Engine options of the common props (every option of `engineOptions`), stable while they are equal */\nfunction useBaseOptions(props: BaseProps) {\n const { labels } = props;\n return useShallowStable(\n engineOptions({\n ...props,\n labels: typeof labels === \"object\" ? labels : undefined,\n series: NO_SERIES,\n }),\n );\n}\n\nconst frameProps = (props: BaseProps) => ({\n height: props.height,\n width: props.width,\n style: props.style,\n testID: props.testID,\n handleRef: props.ref,\n onHover: props.onHover,\n onPointClick: props.onPointClick,\n onPlotClick: props.onPlotClick,\n onZoom: props.onZoom,\n renderTooltip: props.renderTooltip,\n});\n\n/** Area chart: smooth by default, stacked or 100% stacked */\nexport function AreaChart(props: AreaChartProps) {\n const {\n series: input,\n curve = \"smooth\",\n stacked = false,\n percent = false,\n } = props;\n const base = useBaseOptions(props);\n const options = useMemo(\n (): ChartOptions => ({\n ...base,\n series: areaSeries(input, { curve, stacked: stacked || percent }),\n stackMode: percent ? \"percent\" : undefined,\n }),\n [base, input, curve, stacked, percent],\n );\n return <ChartBase options={options} {...frameProps(props)} />;\n}\n\n/** Candlestick (OHLC) chart: rising and falling candles, pinch to zoom */\nexport function CandlestickChart(props: CandlestickChartProps) {\n const { series: input } = props;\n const base = useBaseOptions(props);\n const options = useMemo(\n (): ChartOptions => ({ ...base, series: candlestickSeries(input) }),\n [base, input],\n );\n return <ChartBase options={options} {...frameProps(props)} />;\n}\n\n/** Heatmap: a grid of cells colored by value (categories or numbers on both axes) */\nexport function HeatmapChart(props: HeatmapChartProps) {\n const {\n data,\n xCategories,\n yCategories,\n colorScale,\n valueRange,\n name,\n radius,\n format,\n legend,\n interaction,\n tooltip,\n } = props;\n const base = useBaseOptions(props);\n const options = useMemo(\n () =>\n heatmapChartOptions(\n {\n data,\n xCategories,\n yCategories,\n colorScale,\n valueRange,\n name,\n radius,\n format,\n },\n { ...base, legend, interaction, tooltip },\n ),\n [\n base,\n data,\n xCategories,\n yCategories,\n colorScale,\n valueRange,\n name,\n radius,\n format,\n legend,\n interaction,\n tooltip,\n ],\n );\n return <ChartBase options={options} {...frameProps(props)} />;\n}\n\n/** Word-sized chart without axes: a trend in a list row, a KPI card, ... */\nexport function Sparkline(props: SparklineProps) {\n const {\n data,\n type,\n color,\n curve,\n name,\n reference,\n format,\n height = 48,\n width,\n tooltip,\n palette,\n ariaLabel,\n locale,\n labels,\n style,\n testID,\n ref,\n onHover,\n renderTooltip,\n } = props;\n const options = useMemo(\n () =>\n sparklineOptions(\n { data, type, color, curve, name, reference, format },\n { tooltip, palette, ariaLabel, locale, labels },\n ),\n [\n data,\n type,\n color,\n curve,\n name,\n reference,\n format,\n tooltip,\n palette,\n ariaLabel,\n locale,\n labels,\n ],\n );\n return (\n <ChartBase\n options={options}\n height={height}\n width={width}\n style={style}\n testID={testID}\n handleRef={ref}\n onHover={onHover}\n renderTooltip={renderTooltip}\n />\n );\n}\n\n/**\n * Range area chart: bands between a lower (`y0`) and an upper edge\n * (confidence intervals, min-max ranges), mixable with lines\n */\nexport function RangeAreaChart(props: RangeAreaChartProps) {\n const { series: input, curve = \"smooth\" } = props;\n const base = useBaseOptions(props);\n const options = useMemo(\n (): ChartOptions => ({ ...base, series: rangeAreaSeries(input, curve) }),\n [base, input, curve],\n );\n return <ChartBase options={options} {...frameProps(props)} />;\n}\n\n/**\n * Combination chart: bars, lines and areas on one or two value axes\n * (`yAxis: \"right\"` series use `yAxis2`, aligned on the left grid)\n */\nexport function MixedChart(props: MixedChartProps) {\n const { series, yAxis2, stackMode, orientation } = props;\n const base = useBaseOptions(props);\n const options = useMemo(\n (): ChartOptions => ({\n ...base,\n series,\n ...(yAxis2 ? { yAxis2 } : null),\n ...(stackMode ? { stackMode } : null),\n ...(orientation ? { orientation } : null),\n }),\n [base, series, yAxis2, stackMode, orientation],\n );\n return <ChartBase options={options} {...frameProps(props)} />;\n}\n\n/** Bubble chart: x, y and a value sized by area (√value diameters) */\nexport function BubbleChart(props: BubbleChartProps) {\n const { series: input, minSize, maxSize, maxValue } = props;\n const base = useBaseOptions(props);\n const options = useMemo(\n (): ChartOptions => ({\n ...base,\n series: bubbleSeries(input, { minSize, maxSize, maxValue }),\n }),\n [base, input, minSize, maxSize, maxValue],\n );\n return <ChartBase options={options} {...frameProps(props)} />;\n}\n\n/**\n * Histogram: the distribution of raw samples in bins of equal width\n * (Freedman-Diaconis, Sturges or a count)\n */\nexport function HistogramChart(props: HistogramChartProps) {\n const {\n values,\n bins,\n domain,\n nice,\n name,\n color,\n formatBin,\n series: extra,\n } = props;\n const base = useBaseOptions(props);\n const options = useMemo(\n (): ChartOptions => ({\n ...base,\n series: [\n histogramSeries(values, {\n bins,\n domain,\n nice,\n name,\n color,\n format: formatBin,\n locale: base.locale,\n }),\n ...(extra ?? []),\n ],\n }),\n [base, values, bins, domain, nice, name, color, formatBin, extra],\n );\n return <ChartBase options={options} {...frameProps(props)} />;\n}\n\n/**\n * Box plot: medians, quartiles, whiskers and outliers of samples, from raw\n * values (`groups`) or computed statistics (`series`)\n */\nexport function BoxPlotChart(props: BoxPlotChartProps) {\n const {\n series: input,\n groups,\n name = \"Values\",\n whisker,\n orientation,\n } = props;\n const base = useBaseOptions(props);\n const options = useMemo(\n (): ChartOptions => ({\n ...base,\n series: boxplotSeries([\n ...(groups?.length\n ? [{ id: \"boxplot\", name, data: boxplotData(groups, { whisker }) }]\n : []),\n ...(input ?? []),\n ]),\n ...(orientation ? { orientation } : null),\n }),\n [base, input, groups, name, whisker, orientation],\n );\n return <ChartBase options={options} {...frameProps(props)} />;\n}\n\n/**\n * Waterfall (bridge) chart: how changes take a value from a start to an\n * end, with subtotals and totals (P&L bridges, budget variances)\n */\nexport function WaterfallChart(props: WaterfallChartProps) {\n const {\n steps,\n name,\n upColor,\n downColor,\n totalColor,\n start,\n labels = true,\n format,\n orientation,\n locale,\n } = props;\n const base = useBaseOptions(props);\n const options = useMemo(\n (): ChartOptions => ({\n ...base,\n ...(locale ? { locale } : null),\n series: [\n waterfallSeries(steps, {\n name,\n upColor,\n downColor,\n totalColor,\n start,\n labels,\n format,\n locale: locale ?? base.locale,\n }),\n ],\n ...(orientation ? { orientation } : null),\n }),\n [\n base,\n locale,\n steps,\n name,\n upColor,\n downColor,\n totalColor,\n start,\n labels,\n format,\n orientation,\n ],\n );\n return <ChartBase options={options} {...frameProps(props)} />;\n}\n\n/**\n * Gantt chart: tasks as bars on a time axis with their progress, groups,\n * milestones and a today line; pinch to zoom along the time\n */\nexport function GanttChart(props: GanttChartProps) {\n const {\n tasks,\n colors,\n taskName,\n progressName,\n milestoneName,\n formatProgress,\n today = false,\n todayLabel,\n xAxis,\n yAxis,\n annotations,\n interaction,\n legend,\n locale,\n } = props;\n const base = useBaseOptions(props);\n const [mountedAt] = useState(() => Date.now());\n const now =\n today === false\n ? null\n : today === true\n ? mountedAt\n : today instanceof Date\n ? today.getTime()\n : today;\n const options = useMemo((): ChartOptions => {\n const gantt = ganttSeries(tasks, {\n colors,\n taskName,\n progressName,\n milestoneName,\n formatProgress,\n locale: locale ?? base.locale,\n });\n const lines: ChartAnnotation[] =\n now === null\n ? []\n : [\n {\n type: \"line\",\n axis: \"y\",\n value: now,\n color: \"var(--danger-color, #dc2626)\",\n dash: [4, 3],\n label: todayLabel,\n },\n ];\n return {\n ...base,\n ...(locale ? { locale } : null),\n series: gantt.series,\n orientation: \"horizontal\",\n xAxis: { type: \"category\", categories: gantt.categories, ...xAxis },\n yAxis: {\n type: \"time\",\n min: gantt.domain[0],\n max: gantt.domain[1],\n ...yAxis,\n },\n annotations: [...(annotations ?? []), ...lines],\n interaction: interaction ?? { zoom: \"y\" },\n legend: legend ?? gantt.series.length > 1,\n };\n }, [\n base,\n locale,\n tasks,\n colors,\n taskName,\n progressName,\n milestoneName,\n formatProgress,\n now,\n todayLabel,\n xAxis,\n yAxis,\n annotations,\n interaction,\n legend,\n ]);\n return <ChartBase options={options} {...frameProps(props)} />;\n}\n"],"mappings":"8LAqCA,IAAMmB,GACJ,EACA,IACG,CACH,IAAMC,EAAO,OAAO,KAAKC,CAAC,EAC1B,OACED,EAAK,SAAW,OAAO,KAAKE,CAAC,CAAC,CAAC,QAC/BF,EAAK,MAAO,GAAQ,OAAO,GAAGC,EAAEE,GAAMD,EAAEC,EAAI,CAAC,CAEjD,EAMA,SAASC,EAAmC,EAAa,CACvD,GAAM,CAACC,EAAQC,IAAA,EAAa1B,EAAAA,SAAAA,CAAS2B,CAAK,EAW1C,OATEF,IAAWE,GACX,CAACR,EACCM,EACAE,CACF,GAEAD,EAAUC,CAAK,EACRA,GAEFF,CACT,CAEA,IAAMG,EAAoC,CAAC,EAS3C,SAASC,EAAe,EAAkB,CACxC,GAAM,CAAE,UAAWC,EACnB,OAAON,EACLvB,EAAAA,cAAc,CACZ,GAAG6B,EACH,OAAQ,OAAOC,GAAW,SAAWA,EAAS,IAAA,GAC9C,OAAQH,CACV,CAAC,CACH,CACF,CAEA,IAAMI,EAAc,IAAsB,CACxC,OAAQF,EAAM,OACd,MAAOA,EAAM,MACb,MAAOA,EAAM,MACb,OAAQA,EAAM,OACd,UAAWA,EAAM,IACjB,QAASA,EAAM,QACf,aAAcA,EAAM,aACpB,YAAaA,E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F,EACAE,aAAiB,KACfA,EAAM,QAAQ,EACdA,EACJtD,GAAA,EAAUlC,EAAAA,QAAAA,KAA4B,CAC1C,IAAMyF,EAAQ7E,EAAAA,YAAY8E,EAAO,CAC/B,SACA,WACA,eACA,gBACA,iBACA,OAAQjC,GAAUxB,EAAK,MACzB,CAAC,EACK0D,EACJJ,IAAQ,KACJ,CAAC,EACD,CACE,CACE,KAAM,OACN,KAAM,IACN,MAAOA,EACP,MAAO,+BACP,KAAM,CAAC,EAAG,CAAC,EACX,MAAOK,CACT,CACF,EACN,MAAO,CACL,GAAG3D,EACH,GAAIwB,EAAS,CAAE,QAAO,EAAI,KAC1B,OAAQgC,EAAM,OACd,YAAa,aACb,MAAO,CAAE,KAAM,WAAY,WAAYA,EAAM,WAAY,GAAGI,CAAM,EAClE,MAAO,CACL,KAAM,OACN,IAAKJ,EAAM,OAAO,GAClB,IAAKA,EAAM,OAAO,GAClB,GAAGK,CACL,EACA,YAAa,CAAC,GAAIC,GAAe,CAAC,EAAI,GAAGJ,CAAK,EAC9C,YAAa1C,GAAe,CAAE,KAAM,GAAI,EACxC,OAAQD,GAAUyC,EAAM,OAAO,OAAS,CAC1C,CACF,EAAG,CACDxD,EACAwB,EACAiC,EACAM,EACAC,EACAC,EACAC,EACAC,EACAb,EACAK,EACAC,EACAC,EACAC,EACA9C,EACAD,CACF,CAAC,EACD,OAAO,EAAAhC,EAAA,IAAA,CAACd,EAAAA,UAAD,CAAoB,UAAS,GAAI4B,EAAWF,CAAK,CAAI,CAAA,CAC9D"}
|
|
1
|
+
{"version":3,"file":"charts.cjs","names":["useState","engineOptions","useMemo","areaSeries","ChartBase","candlestickSeries","heatmapChartOptions","sparklineOptions","rangeAreaSeries","bubbleSeries","histogramSeries","boxplotSeries","boxplotData","waterfallSeries","ganttSeries","require_presets","require_ChartBase","react","react_jsx_runtime","shallowEqual","keys","a","b","key","useShallowStable","stable","setStable","value","NO_SERIES","useBaseOptions","props","labels","frameProps","AreaChart","input","base","options","stacked","percent","curve","CandlestickChart","HeatmapChart","data","xCategories","yCategories","colorScale","valueRange","colorMidpoint","name","radius","format","legend","interaction","tooltip","Sparkline","type","color","reference","palette","ariaLabel","locale","ref","RangeAreaChart","MixedChart","yAxis2","stackMode","orientation","series","BubbleChart","minSize","maxSize","maxValue","HistogramChart","extra","values","formatBin","bins","domain","nice","BoxPlotChart","groups","s","outlierShape","outlierSize","whisker","WaterfallChart","steps","upColor","downColor","totalColor","start","connector","GanttChart","mountedAt","now","today","gantt","tasks","lines","todayLabel","xAxis","yAxis","annotations","colors","taskName","progressName","milestoneName","formatProgress","dependenciesName"],"sources":["../../../../../native/src/components/Charts/charts.tsx"],"sourcesContent":["// Named cartesian charts of React Native: thin wrappers mapping the props\n// of the web components (minerva-design/charts) to engine options through\n// the presets of @minerva/charts/canvas, drawn by the view-based ChartBase.\n\nimport { useMemo, useState } from \"react\";\nimport {\n areaSeries,\n boxplotData,\n boxplotSeries,\n bubbleSeries,\n candlestickSeries,\n ganttSeries,\n heatmapChartOptions,\n histogramSeries,\n rangeAreaSeries,\n sparklineOptions,\n waterfallSeries,\n type ChartAnnotation,\n type ChartOptions,\n type ChartSeries,\n} from \"@minerva/charts/canvas\";\nimport { ChartBase, engineOptions } from \"../Chart/ChartBase\";\nimport type { ChartCommonProps } from \"../Chart/types\";\nimport type {\n AreaChartProps,\n BoxPlotChartProps,\n BubbleChartProps,\n CandlestickChartProps,\n GanttChartProps,\n HeatmapChartProps,\n HistogramChartProps,\n MixedChartProps,\n RangeAreaChartProps,\n SparklineProps,\n WaterfallChartProps,\n} from \"./types\";\n\nconst shallowEqual = (\n a: Record<string, unknown>,\n b: Record<string, unknown>,\n) => {\n const keys = Object.keys(a);\n return (\n keys.length === Object.keys(b).length &&\n keys.every((key) => Object.is(a[key], b[key]))\n );\n};\n\n/**\n * The same object while every key keeps the same value (derived state:\n * the engine keeps its zoom and animations while the props are equal)\n */\nfunction useShallowStable<T extends object>(value: T): T {\n const [stable, setStable] = useState(value);\n if (\n stable !== value &&\n !shallowEqual(\n stable as Record<string, unknown>,\n value as Record<string, unknown>,\n )\n ) {\n setStable(value);\n return value;\n }\n return stable;\n}\n\nconst NO_SERIES: readonly ChartSeries[] = [];\n\ntype BaseProps = Omit<ChartCommonProps, \"crosshair\" | \"labels\"> & {\n crosshair?: boolean;\n /** Texts of the engine; a boolean is the `labels` prop of a chart (value labels) */\n labels?: ChartCommonProps[\"labels\"] | boolean;\n};\n\n/** Engine options of the common props (every option of `engineOptions`), stable while they are equal */\nfunction useBaseOptions(props: BaseProps) {\n const { labels } = props;\n return useShallowStable(\n engineOptions({\n ...props,\n labels: typeof labels === \"object\" ? labels : undefined,\n series: NO_SERIES,\n }),\n );\n}\n\nconst frameProps = (props: BaseProps) => ({\n height: props.height,\n width: props.width,\n style: props.style,\n testID: props.testID,\n handleRef: props.ref,\n onHover: props.onHover,\n onPointClick: props.onPointClick,\n onPlotClick: props.onPlotClick,\n onZoom: props.onZoom,\n renderTooltip: props.renderTooltip,\n});\n\n/** Area chart: smooth by default, stacked or 100% stacked */\nexport function AreaChart(props: AreaChartProps) {\n const {\n series: input,\n curve = \"smooth\",\n stacked = false,\n percent = false,\n } = props;\n const base = useBaseOptions(props);\n const options = useMemo(\n (): ChartOptions => ({\n ...base,\n series: areaSeries(input, { curve, stacked: stacked || percent }),\n stackMode: percent ? \"percent\" : undefined,\n }),\n [base, input, curve, stacked, percent],\n );\n return <ChartBase options={options} {...frameProps(props)} />;\n}\n\n/** Candlestick (OHLC) chart: rising and falling candles, pinch to zoom */\nexport function CandlestickChart(props: CandlestickChartProps) {\n const { series: input } = props;\n const base = useBaseOptions(props);\n const options = useMemo(\n (): ChartOptions => ({ ...base, series: candlestickSeries(input) }),\n [base, input],\n );\n return <ChartBase options={options} {...frameProps(props)} />;\n}\n\n/** Heatmap: a grid of cells colored by value (categories or numbers on both axes) */\nexport function HeatmapChart(props: HeatmapChartProps) {\n const {\n data,\n xCategories,\n yCategories,\n colorScale,\n valueRange,\n colorMidpoint,\n name,\n radius,\n format,\n legend,\n interaction,\n tooltip,\n } = props;\n const base = useBaseOptions(props);\n const options = useMemo(\n () =>\n heatmapChartOptions(\n {\n data,\n xCategories,\n yCategories,\n colorScale,\n valueRange,\n colorMidpoint,\n name,\n radius,\n format,\n },\n { ...base, legend, interaction, tooltip },\n ),\n [\n base,\n data,\n xCategories,\n yCategories,\n colorScale,\n valueRange,\n colorMidpoint,\n name,\n radius,\n format,\n legend,\n interaction,\n tooltip,\n ],\n );\n return <ChartBase options={options} {...frameProps(props)} />;\n}\n\n/** Word-sized chart without axes: a trend in a list row, a KPI card, ... */\nexport function Sparkline(props: SparklineProps) {\n const {\n data,\n type,\n color,\n curve,\n name,\n reference,\n format,\n height = 48,\n width,\n tooltip,\n palette,\n ariaLabel,\n locale,\n labels,\n style,\n testID,\n ref,\n onHover,\n renderTooltip,\n } = props;\n const options = useMemo(\n () =>\n sparklineOptions(\n { data, type, color, curve, name, reference, format },\n { tooltip, palette, ariaLabel, locale, labels },\n ),\n [\n data,\n type,\n color,\n curve,\n name,\n reference,\n format,\n tooltip,\n palette,\n ariaLabel,\n locale,\n labels,\n ],\n );\n return (\n <ChartBase\n options={options}\n height={height}\n width={width}\n style={style}\n testID={testID}\n handleRef={ref}\n onHover={onHover}\n renderTooltip={renderTooltip}\n />\n );\n}\n\n/**\n * Range area chart: bands between a lower (`y0`) and an upper edge\n * (confidence intervals, min-max ranges), mixable with lines\n */\nexport function RangeAreaChart(props: RangeAreaChartProps) {\n const { series: input, curve = \"smooth\" } = props;\n const base = useBaseOptions(props);\n const options = useMemo(\n (): ChartOptions => ({ ...base, series: rangeAreaSeries(input, curve) }),\n [base, input, curve],\n );\n return <ChartBase options={options} {...frameProps(props)} />;\n}\n\n/**\n * Combination chart: bars, lines and areas on one or two value axes\n * (`yAxis: \"right\"` series use `yAxis2`, aligned on the left grid)\n */\nexport function MixedChart(props: MixedChartProps) {\n const { series, yAxis2, stackMode, orientation } = props;\n const base = useBaseOptions(props);\n const options = useMemo(\n (): ChartOptions => ({\n ...base,\n series,\n ...(yAxis2 ? { yAxis2 } : null),\n ...(stackMode ? { stackMode } : null),\n ...(orientation ? { orientation } : null),\n }),\n [base, series, yAxis2, stackMode, orientation],\n );\n return <ChartBase options={options} {...frameProps(props)} />;\n}\n\n/** Bubble chart: x, y and a value sized by area (√value diameters) */\nexport function BubbleChart(props: BubbleChartProps) {\n const { series: input, minSize, maxSize, maxValue } = props;\n const base = useBaseOptions(props);\n const options = useMemo(\n (): ChartOptions => ({\n ...base,\n series: bubbleSeries(input, { minSize, maxSize, maxValue }),\n }),\n [base, input, minSize, maxSize, maxValue],\n );\n return <ChartBase options={options} {...frameProps(props)} />;\n}\n\n/**\n * Histogram: the distribution of raw samples in bins of equal width\n * (Freedman-Diaconis, Sturges or a count)\n */\nexport function HistogramChart(props: HistogramChartProps) {\n const {\n values,\n bins,\n domain,\n nice,\n name,\n color,\n formatBin,\n series: extra,\n } = props;\n const base = useBaseOptions(props);\n const options = useMemo(\n (): ChartOptions => ({\n ...base,\n series: [\n histogramSeries(values, {\n bins,\n domain,\n nice,\n name,\n color,\n format: formatBin,\n locale: base.locale,\n }),\n ...(extra ?? []),\n ],\n }),\n [base, values, bins, domain, nice, name, color, formatBin, extra],\n );\n return <ChartBase options={options} {...frameProps(props)} />;\n}\n\n/**\n * Box plot: medians, quartiles, whiskers and outliers of samples, from raw\n * values (`groups`) or computed statistics (`series`)\n */\nexport function BoxPlotChart(props: BoxPlotChartProps) {\n const {\n series: input,\n groups,\n name = \"Values\",\n whisker,\n orientation,\n outlierShape,\n outlierSize,\n } = props;\n const base = useBaseOptions(props);\n const options = useMemo(\n (): ChartOptions => ({\n ...base,\n series: boxplotSeries([\n ...(groups?.length\n ? [{ id: \"boxplot\", name, data: boxplotData(groups, { whisker }) }]\n : []),\n ...(input ?? []),\n ]).map((s) =>\n s.type === \"boxplot\"\n ? {\n ...s,\n outlierShape: s.outlierShape ?? outlierShape,\n outlierSize: s.outlierSize ?? outlierSize,\n }\n : s,\n ),\n ...(orientation ? { orientation } : null),\n }),\n [\n base,\n input,\n groups,\n name,\n whisker,\n orientation,\n outlierShape,\n outlierSize,\n ],\n );\n return <ChartBase options={options} {...frameProps(props)} />;\n}\n\n/**\n * Waterfall (bridge) chart: how changes take a value from a start to an\n * end, with subtotals and totals (P&L bridges, budget variances)\n */\nexport function WaterfallChart(props: WaterfallChartProps) {\n const {\n steps,\n name,\n upColor,\n downColor,\n totalColor,\n start,\n labels = true,\n format,\n connector,\n orientation,\n locale,\n } = props;\n const base = useBaseOptions(props);\n const options = useMemo(\n (): ChartOptions => ({\n ...base,\n ...(locale ? { locale } : null),\n series: [\n waterfallSeries(steps, {\n name,\n upColor,\n downColor,\n totalColor,\n start,\n labels,\n format,\n connector,\n locale: locale ?? base.locale,\n }),\n ],\n ...(orientation ? { orientation } : null),\n }),\n [\n base,\n locale,\n steps,\n name,\n upColor,\n downColor,\n totalColor,\n start,\n labels,\n format,\n connector,\n orientation,\n ],\n );\n return <ChartBase options={options} {...frameProps(props)} />;\n}\n\n/**\n * Gantt chart: tasks as bars on a time axis with their progress, groups,\n * milestones and a today line; pinch to zoom along the time\n */\nexport function GanttChart(props: GanttChartProps) {\n const {\n tasks,\n colors,\n taskName,\n progressName,\n milestoneName,\n formatProgress,\n dependenciesName,\n today = false,\n todayLabel,\n xAxis,\n yAxis,\n annotations,\n interaction,\n legend,\n locale,\n } = props;\n const base = useBaseOptions(props);\n const [mountedAt] = useState(() => Date.now());\n const now =\n today === false\n ? null\n : today === true\n ? mountedAt\n : today instanceof Date\n ? today.getTime()\n : today;\n const options = useMemo((): ChartOptions => {\n const gantt = ganttSeries(tasks, {\n colors,\n taskName,\n progressName,\n milestoneName,\n formatProgress,\n dependenciesName,\n locale: locale ?? base.locale,\n });\n const lines: ChartAnnotation[] =\n now === null\n ? []\n : [\n {\n type: \"line\",\n axis: \"y\",\n value: now,\n color: \"var(--danger-color, #dc2626)\",\n dash: [4, 3],\n label: todayLabel,\n },\n ];\n return {\n ...base,\n ...(locale ? { locale } : null),\n series: gantt.series,\n orientation: \"horizontal\",\n xAxis: { type: \"category\", categories: gantt.categories, ...xAxis },\n yAxis: {\n type: \"time\",\n min: gantt.domain[0],\n max: gantt.domain[1],\n ...yAxis,\n },\n annotations: [...(annotations ?? []), ...lines],\n interaction: interaction ?? { zoom: \"y\" },\n legend: legend ?? gantt.series.length > 1,\n };\n }, [\n base,\n locale,\n tasks,\n colors,\n taskName,\n progressName,\n milestoneName,\n formatProgress,\n dependenciesName,\n now,\n todayLabel,\n xAxis,\n yAxis,\n annotations,\n interaction,\n legend,\n ]);\n return <ChartBase options={options} {...frameProps(props)} />;\n}\n"],"mappings":"8LAqCA,IAAMmB,GACJ,EACA,IACG,CACH,IAAMC,EAAO,OAAO,KAAKC,CAAC,EAC1B,OACED,EAAK,SAAW,OAAO,KAAKE,CAAC,CAAC,CAAC,QAC/BF,EAAK,MAAO,GAAQ,OAAO,GAAGC,EAAEE,GAAMD,EAAEC,EAAI,CAAC,CAEjD,EAMA,SAASC,EAAmC,EAAa,CACvD,GAAM,CAACC,EAAQC,IAAA,EAAa1B,EAAAA,SAAAA,CAAS2B,CAAK,EAW1C,OATEF,IAAWE,GACX,CAACR,EACCM,EACAE,CACF,GAEAD,EAAUC,CAAK,EACRA,GAEFF,CACT,CAEA,IAAMG,EAAoC,CAAC,EAS3C,SAASC,EAAe,EAAkB,CACxC,GAAM,CAAE,UAAWC,EACnB,OAAON,EACLvB,EAAAA,cAAc,CACZ,GAAG6B,EACH,OAAQ,OAAOC,GAAW,SAAWA,EAAS,IAAA,GAC9C,OAAQH,CACV,CAAC,CACH,CACF,CAEA,IAAMI,EAAc,IAAsB,CACxC,OAAQF,EAAM,OACd,MAAOA,EAAM,MACb,MAAOA,EAAM,MACb,OAAQA,EAAM,OACd,UAAWA,EAAM,IACjB,QAASA,EAAM,QACf,aAAcA,EAAM,aACpB,YAAaA,EAAM,YACnB,OAAQA,EAAM,OACd,cAA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SACA,UACE9D,EACEK,EAAON,EAAeC,CAAK,EAC3B,CAAC+D,IAAA,EAAa7F,EAAAA,SAAAA,KAAe,KAAK,IAAI,CAAC,EACvC8F,EACJC,IAAU,GACN,KACAA,IAAU,GACRF,EACAE,aAAiB,KACfA,EAAM,QAAQ,EACdA,EACJ3D,GAAA,EAAUlC,EAAAA,QAAAA,KAA4B,CAC1C,IAAM8F,EAAQlF,EAAAA,YAAYmF,EAAO,CAC/B,SACA,WACA,eACA,gBACA,iBACA,mBACA,OAAQrC,GAAUzB,EAAK,MACzB,CAAC,EACK+D,EACJJ,IAAQ,KACJ,CAAC,EACD,CACE,CACE,KAAM,OACN,KAAM,IACN,MAAOA,EACP,MAAO,+BACP,KAAM,CAAC,EAAG,CAAC,EACX,MAAOK,CACT,CACF,EACN,MAAO,CACL,GAAGhE,EACH,GAAIyB,EAAS,CAAE,QAAO,EAAI,KAC1B,OAAQoC,EAAM,OACd,YAAa,aACb,MAAO,CAAE,KAAM,WAAY,WAAYA,EAAM,WAAY,GAAGI,CAAM,EAClE,MAAO,CACL,KAAM,OACN,IAAKJ,EAAM,OAAO,GAClB,IAAKA,EAAM,OAAO,GAClB,GAAGK,CACL,EACA,YAAa,CAAC,GAAIC,GAAe,CAAC,EAAI,GAAGJ,CAAK,EAC9C,YAAa9C,GAAe,CAAE,KAAM,GAAI,EACxC,OAAQD,GAAU6C,EAAM,OAAO,OAAS,CAC1C,CACF,EAAG,CACD7D,EACAyB,EACAqC,EACAM,EACAC,EACAC,EACAC,EACAC,EACAC,EACAd,EACAK,EACAC,EACAC,EACAC,EACAlD,EACAD,CACF,CAAC,EACD,OAAO,EAAAjC,EAAA,IAAA,CAACd,EAAAA,UAAD,CAAoB,UAAS,GAAI4B,EAAWF,CAAK,CAAI,CAAA,CAC9D"}
|
|
@@ -64,22 +64,23 @@ function S(e) {
|
|
|
64
64
|
});
|
|
65
65
|
}
|
|
66
66
|
function C(e) {
|
|
67
|
-
let { data: t, xCategories: n, yCategories: r, colorScale: i, valueRange: a,
|
|
67
|
+
let { data: t, xCategories: n, yCategories: r, colorScale: i, valueRange: a, colorMidpoint: s, name: c, radius: l, format: u, legend: f, interaction: m, tooltip: g } = e, _ = y(e), v = p(() => o({
|
|
68
68
|
data: t,
|
|
69
69
|
xCategories: n,
|
|
70
70
|
yCategories: r,
|
|
71
71
|
colorScale: i,
|
|
72
72
|
valueRange: a,
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
73
|
+
colorMidpoint: s,
|
|
74
|
+
name: c,
|
|
75
|
+
radius: l,
|
|
76
|
+
format: u
|
|
76
77
|
}, {
|
|
77
|
-
...
|
|
78
|
-
legend:
|
|
79
|
-
interaction:
|
|
80
|
-
tooltip:
|
|
78
|
+
..._,
|
|
79
|
+
legend: f,
|
|
80
|
+
interaction: m,
|
|
81
|
+
tooltip: g
|
|
81
82
|
}), [
|
|
82
|
-
|
|
83
|
+
_,
|
|
83
84
|
t,
|
|
84
85
|
n,
|
|
85
86
|
r,
|
|
@@ -90,10 +91,11 @@ function C(e) {
|
|
|
90
91
|
l,
|
|
91
92
|
u,
|
|
92
93
|
f,
|
|
93
|
-
m
|
|
94
|
+
m,
|
|
95
|
+
g
|
|
94
96
|
]);
|
|
95
97
|
return /* @__PURE__ */ h(d, {
|
|
96
|
-
options:
|
|
98
|
+
options: v,
|
|
97
99
|
...b(e)
|
|
98
100
|
});
|
|
99
101
|
}
|
|
@@ -219,31 +221,37 @@ function O(e) {
|
|
|
219
221
|
});
|
|
220
222
|
}
|
|
221
223
|
function k(e) {
|
|
222
|
-
let { series: r, groups: i, name: a = "Values", whisker: o, orientation: s } = e,
|
|
223
|
-
...
|
|
224
|
+
let { series: r, groups: i, name: a = "Values", whisker: o, orientation: s, outlierShape: c, outlierSize: l } = e, u = y(e), f = p(() => ({
|
|
225
|
+
...u,
|
|
224
226
|
series: n([...i?.length ? [{
|
|
225
227
|
id: "boxplot",
|
|
226
228
|
name: a,
|
|
227
229
|
data: t(i, { whisker: o })
|
|
228
|
-
}] : [], ...r ?? []])
|
|
230
|
+
}] : [], ...r ?? []]).map((e) => e.type === "boxplot" ? {
|
|
231
|
+
...e,
|
|
232
|
+
outlierShape: e.outlierShape ?? c,
|
|
233
|
+
outlierSize: e.outlierSize ?? l
|
|
234
|
+
} : e),
|
|
229
235
|
...s ? { orientation: s } : null
|
|
230
236
|
}), [
|
|
231
|
-
|
|
237
|
+
u,
|
|
232
238
|
r,
|
|
233
239
|
i,
|
|
234
240
|
a,
|
|
235
241
|
o,
|
|
236
|
-
s
|
|
242
|
+
s,
|
|
243
|
+
c,
|
|
244
|
+
l
|
|
237
245
|
]);
|
|
238
246
|
return /* @__PURE__ */ h(d, {
|
|
239
|
-
options:
|
|
247
|
+
options: f,
|
|
240
248
|
...b(e)
|
|
241
249
|
});
|
|
242
250
|
}
|
|
243
251
|
function A(e) {
|
|
244
|
-
let { steps: t, name: n, upColor: r, downColor: i, totalColor: a, start: o, labels: s = !0, format: c,
|
|
245
|
-
...
|
|
246
|
-
...
|
|
252
|
+
let { steps: t, name: n, upColor: r, downColor: i, totalColor: a, start: o, labels: s = !0, format: c, connector: l, orientation: f, locale: m } = e, g = y(e), _ = p(() => ({
|
|
253
|
+
...g,
|
|
254
|
+
...m ? { locale: m } : null,
|
|
247
255
|
series: [u(t, {
|
|
248
256
|
name: n,
|
|
249
257
|
upColor: r,
|
|
@@ -252,12 +260,13 @@ function A(e) {
|
|
|
252
260
|
start: o,
|
|
253
261
|
labels: s,
|
|
254
262
|
format: c,
|
|
255
|
-
|
|
263
|
+
connector: l,
|
|
264
|
+
locale: m ?? g.locale
|
|
256
265
|
})],
|
|
257
|
-
...
|
|
266
|
+
...f ? { orientation: f } : null
|
|
258
267
|
}), [
|
|
268
|
+
g,
|
|
259
269
|
m,
|
|
260
|
-
f,
|
|
261
270
|
t,
|
|
262
271
|
n,
|
|
263
272
|
r,
|
|
@@ -266,69 +275,72 @@ function A(e) {
|
|
|
266
275
|
o,
|
|
267
276
|
s,
|
|
268
277
|
c,
|
|
269
|
-
l
|
|
278
|
+
l,
|
|
279
|
+
f
|
|
270
280
|
]);
|
|
271
281
|
return /* @__PURE__ */ h(d, {
|
|
272
|
-
options:
|
|
282
|
+
options: _,
|
|
273
283
|
...b(e)
|
|
274
284
|
});
|
|
275
285
|
}
|
|
276
286
|
function j(e) {
|
|
277
|
-
let { tasks: t, colors: n, taskName: r, progressName: i, milestoneName: o, formatProgress: s,
|
|
287
|
+
let { tasks: t, colors: n, taskName: r, progressName: i, milestoneName: o, formatProgress: s, dependenciesName: c, today: l = !1, todayLabel: u, xAxis: f, yAxis: g, annotations: _, interaction: v, legend: x, locale: S } = e, C = y(e), [w] = m(() => Date.now()), T = l === !1 ? null : l === !0 ? w : l instanceof Date ? l.getTime() : l, E = p(() => {
|
|
278
288
|
let e = a(t, {
|
|
279
289
|
colors: n,
|
|
280
290
|
taskName: r,
|
|
281
291
|
progressName: i,
|
|
282
292
|
milestoneName: o,
|
|
283
293
|
formatProgress: s,
|
|
284
|
-
|
|
285
|
-
|
|
294
|
+
dependenciesName: c,
|
|
295
|
+
locale: S ?? C.locale
|
|
296
|
+
}), l = T === null ? [] : [{
|
|
286
297
|
type: "line",
|
|
287
298
|
axis: "y",
|
|
288
|
-
value:
|
|
299
|
+
value: T,
|
|
289
300
|
color: "var(--danger-color, #dc2626)",
|
|
290
301
|
dash: [4, 3],
|
|
291
|
-
label:
|
|
302
|
+
label: u
|
|
292
303
|
}];
|
|
293
304
|
return {
|
|
294
|
-
...
|
|
295
|
-
...
|
|
305
|
+
...C,
|
|
306
|
+
...S ? { locale: S } : null,
|
|
296
307
|
series: e.series,
|
|
297
308
|
orientation: "horizontal",
|
|
298
309
|
xAxis: {
|
|
299
310
|
type: "category",
|
|
300
311
|
categories: e.categories,
|
|
301
|
-
...
|
|
312
|
+
...f
|
|
302
313
|
},
|
|
303
314
|
yAxis: {
|
|
304
315
|
type: "time",
|
|
305
316
|
min: e.domain[0],
|
|
306
317
|
max: e.domain[1],
|
|
307
|
-
...
|
|
318
|
+
...g
|
|
308
319
|
},
|
|
309
|
-
annotations: [...
|
|
310
|
-
interaction:
|
|
311
|
-
legend:
|
|
320
|
+
annotations: [..._ ?? [], ...l],
|
|
321
|
+
interaction: v ?? { zoom: "y" },
|
|
322
|
+
legend: x ?? e.series.length > 1
|
|
312
323
|
};
|
|
313
324
|
}, [
|
|
325
|
+
C,
|
|
314
326
|
S,
|
|
315
|
-
x,
|
|
316
327
|
t,
|
|
317
328
|
n,
|
|
318
329
|
r,
|
|
319
330
|
i,
|
|
320
331
|
o,
|
|
321
332
|
s,
|
|
322
|
-
|
|
323
|
-
|
|
333
|
+
c,
|
|
334
|
+
T,
|
|
324
335
|
u,
|
|
325
336
|
f,
|
|
326
337
|
g,
|
|
327
338
|
_,
|
|
328
|
-
v
|
|
339
|
+
v,
|
|
340
|
+
x
|
|
329
341
|
]);
|
|
330
342
|
return /* @__PURE__ */ h(d, {
|
|
331
|
-
options:
|
|
343
|
+
options: E,
|
|
332
344
|
...b(e)
|
|
333
345
|
});
|
|
334
346
|
}
|