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
|
@@ -85,15 +85,16 @@ function O(e) {
|
|
|
85
85
|
});
|
|
86
86
|
}
|
|
87
87
|
function k(e) {
|
|
88
|
-
let { data: t, xCategories: i, yCategories: a, colorScale: o, valueRange: s,
|
|
88
|
+
let { data: t, xCategories: i, yCategories: a, colorScale: o, valueRange: s, colorMidpoint: c, name: l, radius: u, format: f } = e, p = x(() => d({
|
|
89
89
|
data: t,
|
|
90
90
|
xCategories: i,
|
|
91
91
|
yCategories: a,
|
|
92
92
|
colorScale: o,
|
|
93
93
|
valueRange: s,
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
94
|
+
colorMidpoint: c,
|
|
95
|
+
name: l,
|
|
96
|
+
radius: u,
|
|
97
|
+
format: f
|
|
97
98
|
}).series, [
|
|
98
99
|
t,
|
|
99
100
|
i,
|
|
@@ -102,10 +103,11 @@ function k(e) {
|
|
|
102
103
|
s,
|
|
103
104
|
c,
|
|
104
105
|
l,
|
|
105
|
-
u
|
|
106
|
-
|
|
106
|
+
u,
|
|
107
|
+
f
|
|
108
|
+
]), m = r({
|
|
107
109
|
...e,
|
|
108
|
-
series:
|
|
110
|
+
series: p
|
|
109
111
|
});
|
|
110
112
|
return /* @__PURE__ */ C(n, {
|
|
111
113
|
options: {
|
|
@@ -114,12 +116,12 @@ function k(e) {
|
|
|
114
116
|
xCategories: i,
|
|
115
117
|
yCategories: a
|
|
116
118
|
}, {
|
|
117
|
-
...
|
|
119
|
+
...m,
|
|
118
120
|
legend: e.legend,
|
|
119
121
|
interaction: e.interaction,
|
|
120
122
|
tooltip: e.tooltip
|
|
121
123
|
}),
|
|
122
|
-
series:
|
|
124
|
+
series: p
|
|
123
125
|
},
|
|
124
126
|
...w(e)
|
|
125
127
|
});
|
|
@@ -323,27 +325,33 @@ function z(t) {
|
|
|
323
325
|
});
|
|
324
326
|
}
|
|
325
327
|
function B(t) {
|
|
326
|
-
let { series: i, groups: a, name: c, whisker: l, orientation: u, locale: d } = t,
|
|
328
|
+
let { series: i, groups: a, name: c, whisker: l, orientation: u, locale: d, outlierShape: f, outlierSize: p } = t, h = c ?? m(e(d)).values, g = x(() => s([...a?.length ? [{
|
|
327
329
|
id: "boxplot",
|
|
328
|
-
name:
|
|
330
|
+
name: h,
|
|
329
331
|
data: o(a, { whisker: l })
|
|
330
|
-
}] : [], ...i ?? []])
|
|
332
|
+
}] : [], ...i ?? []]).map((e) => e.type === "boxplot" ? {
|
|
333
|
+
...e,
|
|
334
|
+
outlierShape: e.outlierShape ?? f,
|
|
335
|
+
outlierSize: e.outlierSize ?? p
|
|
336
|
+
} : e), [
|
|
331
337
|
i,
|
|
332
338
|
a,
|
|
339
|
+
h,
|
|
340
|
+
l,
|
|
333
341
|
f,
|
|
334
|
-
|
|
342
|
+
p
|
|
335
343
|
]);
|
|
336
344
|
return /* @__PURE__ */ C(n, {
|
|
337
345
|
options: r({
|
|
338
346
|
...t,
|
|
339
|
-
series:
|
|
347
|
+
series: g,
|
|
340
348
|
orientation: u
|
|
341
349
|
}),
|
|
342
350
|
...w(t)
|
|
343
351
|
});
|
|
344
352
|
}
|
|
345
353
|
function V(t) {
|
|
346
|
-
let { steps: i, name: a, upColor: o, downColor: s, totalColor: c, start: l, labels: u = !0, format: d,
|
|
354
|
+
let { steps: i, name: a, upColor: o, downColor: s, totalColor: c, start: l, labels: u = !0, format: d, connector: f, orientation: p, locale: m } = t, h = e(m), g = x(() => [b(i, {
|
|
347
355
|
name: a,
|
|
348
356
|
upColor: o,
|
|
349
357
|
downColor: s,
|
|
@@ -351,7 +359,8 @@ function V(t) {
|
|
|
351
359
|
start: l,
|
|
352
360
|
labels: u,
|
|
353
361
|
format: d,
|
|
354
|
-
|
|
362
|
+
connector: f,
|
|
363
|
+
locale: h
|
|
355
364
|
})], [
|
|
356
365
|
i,
|
|
357
366
|
a,
|
|
@@ -361,26 +370,28 @@ function V(t) {
|
|
|
361
370
|
l,
|
|
362
371
|
u,
|
|
363
372
|
d,
|
|
364
|
-
|
|
373
|
+
f,
|
|
374
|
+
h
|
|
365
375
|
]);
|
|
366
376
|
return /* @__PURE__ */ C(n, {
|
|
367
377
|
options: r({
|
|
368
378
|
...t,
|
|
369
379
|
labels: void 0,
|
|
370
|
-
series:
|
|
371
|
-
orientation:
|
|
380
|
+
series: g,
|
|
381
|
+
orientation: p
|
|
372
382
|
}),
|
|
373
383
|
...w(t)
|
|
374
384
|
});
|
|
375
385
|
}
|
|
376
386
|
function H(t) {
|
|
377
|
-
let { tasks: i, colors: a, taskName: o, progressName: s, milestoneName: c, formatProgress: l,
|
|
387
|
+
let { tasks: i, colors: a, taskName: o, progressName: s, milestoneName: c, formatProgress: l, dependenciesName: d, today: f = !1, todayLabel: p, xAxis: m, yAxis: h, annotations: g, interaction: _, legend: v, locale: y } = t, b = e(y), T = x(() => u(i, {
|
|
378
388
|
colors: a,
|
|
379
389
|
taskName: o,
|
|
380
390
|
progressName: s,
|
|
381
391
|
milestoneName: c,
|
|
382
392
|
formatProgress: l,
|
|
383
|
-
|
|
393
|
+
dependenciesName: d,
|
|
394
|
+
locale: b
|
|
384
395
|
}), [
|
|
385
396
|
i,
|
|
386
397
|
a,
|
|
@@ -388,36 +399,37 @@ function H(t) {
|
|
|
388
399
|
s,
|
|
389
400
|
c,
|
|
390
401
|
l,
|
|
391
|
-
|
|
392
|
-
|
|
402
|
+
d,
|
|
403
|
+
b
|
|
404
|
+
]), [E] = S(() => Date.now()), D = f === !1 ? null : f === !0 ? E : f instanceof Date ? f.getTime() : f, O = D === null ? [] : [{
|
|
393
405
|
type: "line",
|
|
394
406
|
axis: "y",
|
|
395
|
-
value:
|
|
407
|
+
value: D,
|
|
396
408
|
color: "var(--danger-color, #dc2626)",
|
|
397
409
|
dash: [4, 3],
|
|
398
|
-
label:
|
|
410
|
+
label: p
|
|
399
411
|
}];
|
|
400
412
|
return /* @__PURE__ */ C(n, {
|
|
401
413
|
options: {
|
|
402
414
|
...r({
|
|
403
415
|
...t,
|
|
404
|
-
series:
|
|
416
|
+
series: T.series,
|
|
405
417
|
orientation: "horizontal"
|
|
406
418
|
}),
|
|
407
419
|
xAxis: {
|
|
408
420
|
type: "category",
|
|
409
|
-
categories:
|
|
410
|
-
...
|
|
421
|
+
categories: T.categories,
|
|
422
|
+
...m
|
|
411
423
|
},
|
|
412
424
|
yAxis: {
|
|
413
425
|
type: "time",
|
|
414
|
-
min:
|
|
415
|
-
max:
|
|
416
|
-
...
|
|
426
|
+
min: T.domain[0],
|
|
427
|
+
max: T.domain[1],
|
|
428
|
+
...h
|
|
417
429
|
},
|
|
418
|
-
annotations: [...
|
|
419
|
-
interaction:
|
|
420
|
-
legend:
|
|
430
|
+
annotations: [...g ?? [], ...O],
|
|
431
|
+
interaction: _ ?? { zoom: "y" },
|
|
432
|
+
legend: v ?? T.series.length > 1
|
|
421
433
|
},
|
|
422
434
|
...w(t)
|
|
423
435
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"charts.js","names":["frameProps","props","LineChart","input","series","useMemo","lineSeries","area","stacked","percent","curve","ChartBase","engineOptions","AreaChart","areaSeries","BarChart","barSeries","labels","CandlestickChart","candlestickSeries","HeatmapChart","heatmapChartOptions","data","xCategories","yCategories","colorScale","valueRange","name","radius","format","base","Sparkline","options","sparklineOptions","type","color","reference","renderer","tooltip","palette","ariaLabel","locale","ref","ScatterChart","scatterSeries","CORNERS","cornerStyle","left","corner","top","split","plot","QuadrantChart","geometry","quadrantChartOptions","draggable","onPointDrop","overlay","quadrantContent","x0","x1","xDomain","y0","y1","yDomain","xs","xSplit","ys","ySplit","fx","fy","reverseX","onPointClick","index","event","points","onQuadrantClick","quadrantOf","at","renderTooltip","HorizontalBarChart","RangeAreaChart","rangeAreaSeries","MixedChart","Chart","BubbleChart","bubbleSeries","minSize","maxSize","maxValue","HistogramChart","extra","lang","resolveLocale","histogramSeries","values","formatBin","bins","domain","nice","BoxPlotChart","groupName","presetLabels","boxplotSeries","groups","boxplotData","whisker","WaterfallChart","waterfallSeries","steps","upColor","downColor","totalColor","start","GanttChart","gantt","ganttSeries","tasks","colors","taskName","progressName","milestoneName","formatProgress","mountedAt","useState","now","today","lines","todayLabel","xAxis","yAxis","annotations","interaction","legend"],"sources":["../../../../charts/src/react/charts.tsx"],"sourcesContent":["import { useMemo, useState, type CSSProperties } from \"react\";\nimport {\n areaSeries,\n barSeries,\n boxplotData,\n boxplotSeries,\n bubbleSeries,\n candlestickSeries,\n ganttSeries,\n heatmapChartOptions,\n histogramSeries,\n lineSeries,\n presetLabels,\n quadrantChartOptions,\n quadrantOf,\n rangeAreaSeries,\n scatterSeries,\n sparklineOptions,\n waterfallSeries,\n type QuadrantCorner,\n} from \"../engine/presets\";\nimport { resolveLocale } from \"../engine/locale\";\nimport type { ChartAnnotation, ChartRect } from \"../engine/types\";\nimport { Chart, ChartBase, engineOptions } from \"./Chart\";\nimport type {\n AreaChartProps,\n BarChartProps,\n BoxPlotChartProps,\n BubbleChartProps,\n CandlestickChartProps,\n ChartCommonProps,\n GanttChartProps,\n HeatmapChartProps,\n HistogramChartProps,\n HorizontalBarChartProps,\n LineChartProps,\n MixedChartProps,\n QuadrantChartProps,\n RangeAreaChartProps,\n ScatterChartProps,\n SparklineProps,\n WaterfallChartProps,\n} from \"./types\";\n\nconst frameProps = (props: Omit<ChartCommonProps, \"labels\">) => ({\n height: props.height,\n width: props.width,\n className: props.className,\n style: props.style,\n handleRef: props.ref,\n onHover: props.onHover,\n onPointClick: props.onPointClick,\n onPlotClick: props.onPlotClick,\n onZoom: props.onZoom,\n onRendererChange: props.onRendererChange,\n renderTooltip: props.renderTooltip,\n});\n\n/** Line (or area) chart; handles millions of points on the GPU */\nexport function LineChart(props: LineChartProps) {\n const {\n series: input,\n area = false,\n curve,\n stacked = false,\n percent = false,\n } = props;\n const series = useMemo(\n () => lineSeries(input, area, { curve, stacked: stacked || percent }),\n [input, area, curve, stacked, percent],\n );\n return (\n <ChartBase\n options={engineOptions({\n ...props,\n series,\n stackMode: percent ? \"percent\" : undefined,\n })}\n {...frameProps(props)}\n />\n );\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 series = useMemo(\n () => areaSeries(input, { curve, stacked: stacked || percent }),\n [input, curve, stacked, percent],\n );\n return (\n <ChartBase\n options={engineOptions({\n ...props,\n series,\n stackMode: percent ? \"percent\" : undefined,\n })}\n {...frameProps(props)}\n />\n );\n}\n\n/** Bar chart: grouped side by side, stacked or 100% stacked, with optional value labels */\nexport function BarChart(props: BarChartProps) {\n const {\n series: input,\n stacked = false,\n percent = false,\n labels = false,\n } = props;\n const series = useMemo(\n () => barSeries(input, stacked || percent, labels),\n [input, stacked, percent, labels],\n );\n return (\n <ChartBase\n options={engineOptions({\n ...props,\n labels: undefined,\n series,\n stackMode: percent ? \"percent\" : undefined,\n })}\n {...frameProps(props)}\n />\n );\n}\n\n/** Candlestick (OHLC) chart: rising and falling candles, zoomable on the GPU */\nexport function CandlestickChart(props: CandlestickChartProps) {\n const { series: input } = props;\n const series = useMemo(() => candlestickSeries(input), [input]);\n return (\n <ChartBase\n options={engineOptions({ ...props, series })}\n {...frameProps(props)}\n />\n );\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 } = props;\n const series = useMemo(\n () =>\n heatmapChartOptions({\n data,\n xCategories,\n yCategories,\n colorScale,\n valueRange,\n name,\n radius,\n format,\n }).series,\n [\n data,\n xCategories,\n yCategories,\n colorScale,\n valueRange,\n name,\n radius,\n format,\n ],\n );\n const base = engineOptions({ ...props, series });\n return (\n <ChartBase\n options={{\n ...heatmapChartOptions(\n { data, xCategories, yCategories },\n {\n ...base,\n legend: props.legend,\n interaction: props.interaction,\n tooltip: props.tooltip,\n },\n ),\n series,\n }}\n {...frameProps(props)}\n />\n );\n}\n\n/** Word-sized chart without axes: a trend in a table cell, 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 renderer,\n tooltip,\n palette,\n ariaLabel,\n locale,\n labels,\n className,\n style,\n ref,\n onHover,\n renderTooltip,\n } = props;\n const options = useMemo(\n () =>\n sparklineOptions(\n { data, type, color, curve, name, reference, format },\n { renderer, tooltip, palette, ariaLabel, locale, labels },\n ),\n [\n data,\n type,\n color,\n curve,\n name,\n reference,\n format,\n renderer,\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 className={className}\n style={style}\n handleRef={ref}\n onHover={onHover}\n renderTooltip={renderTooltip}\n />\n );\n}\n\n/** Scatter chart: zooms on both axes, hit testing through a spatial index */\nexport function ScatterChart(props: ScatterChartProps) {\n const { series: input } = props;\n const series = useMemo(() => scatterSeries(input), [input]);\n return (\n <ChartBase\n options={engineOptions({ ...props, series })}\n {...frameProps(props)}\n />\n );\n}\n\nconst CORNERS: QuadrantCorner[] = [\n \"topLeft\",\n \"topRight\",\n \"bottomLeft\",\n \"bottomRight\",\n];\n\nconst cornerStyle = (\n corner: QuadrantCorner,\n plot: ChartRect,\n split: { x: number; y: number },\n): CSSProperties => {\n const left = corner.endsWith(\"Left\");\n const top = corner.startsWith(\"top\");\n return {\n position: \"absolute\",\n left: left ? 0 : split.x - plot.x,\n top: top ? 0 : split.y - plot.y,\n width: left ? split.x - plot.x : plot.x + plot.width - split.x,\n height: top ? split.y - plot.y : plot.y + plot.height - split.y,\n pointerEvents: \"none\",\n };\n};\n\n/**\n * Four-quadrant matrix (priority matrix, Eisenhower, BCG, ...): tinted\n * quadrants with titles, dividers, and labelled dots placed without\n * overlapping labels. Dots can be dragged to another quadrant.\n */\nexport function QuadrantChart(props: QuadrantChartProps) {\n const {\n points,\n xDomain,\n yDomain,\n xSplit,\n ySplit,\n quadrants,\n xLabel,\n yLabel,\n axisLabels,\n showTicks,\n reverseX,\n showLabels,\n pointSize,\n name,\n draggable,\n onPointClick,\n onPointDrop,\n onQuadrantClick,\n renderTooltip,\n quadrantContent,\n } = props;\n const geometry = { xDomain, yDomain, xSplit, ySplit, reverseX };\n\n const options = quadrantChartOptions(\n {\n points,\n xDomain,\n yDomain,\n xSplit,\n ySplit,\n quadrants,\n xLabel,\n yLabel,\n axisLabels,\n showTicks,\n reverseX,\n showLabels,\n pointSize,\n name,\n draggable: draggable ?? !!onPointDrop,\n },\n engineOptions({ ...props, series: [] }),\n );\n\n const overlay = quadrantContent\n ? (plot: ChartRect) => {\n const [x0, x1] = xDomain ?? [0, 10];\n const [y0, y1] = yDomain ?? [0, 10];\n const xs = xSplit ?? (x0 + x1) / 2;\n const ys = ySplit ?? (y0 + y1) / 2;\n const fx = (xs - x0) / (x1 - x0 || 1);\n const fy = (ys - y0) / (y1 - y0 || 1);\n const split = {\n x: plot.x + plot.width * (reverseX ? 1 - fx : fx),\n y: plot.y + plot.height * (1 - fy),\n };\n return CORNERS.map((corner) =>\n quadrantContent[corner] ? (\n <div\n key={corner}\n className={`minerva-chart-quadrant minerva-chart-quadrant-${corner}`}\n style={cornerStyle(corner, plot, split)}\n >\n {quadrantContent[corner]}\n </div>\n ) : null,\n );\n }\n : undefined;\n\n return (\n <ChartBase\n options={options}\n {...frameProps({\n ...props,\n onPointClick: undefined,\n renderTooltip: undefined,\n })}\n overlay={overlay}\n onPointClick={\n onPointClick\n ? (event) => {\n const index = event.items[0]?.index;\n if (index !== undefined && points[index])\n onPointClick(points[index], index);\n }\n : undefined\n }\n onPlotClick={\n onQuadrantClick\n ? (at) => onQuadrantClick(quadrantOf(geometry, at.x, at.y), at)\n : undefined\n }\n onDrop={\n onPointDrop\n ? (event) => {\n const index = event.item.index;\n if (!points[index]) return;\n onPointDrop(points[index], index, {\n x: event.x,\n y: event.y,\n quadrant: quadrantOf(geometry, event.x, event.y),\n });\n }\n : undefined\n }\n renderTooltip={\n renderTooltip\n ? (event) => {\n const index = event.items[0]?.index;\n return index !== undefined && points[index]\n ? renderTooltip(points[index], index)\n : null;\n }\n : undefined\n }\n />\n );\n}\n\n/**\n * Horizontal bar chart: categories down the left side, values from the\n * left (rankings, long names, diverging surveys, stacked progress)\n */\nexport function HorizontalBarChart(props: HorizontalBarChartProps) {\n return <BarChart {...props} orientation=\"horizontal\" />;\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 series = useMemo(() => rangeAreaSeries(input, curve), [input, curve]);\n return (\n <ChartBase\n options={engineOptions({ ...props, series })}\n {...frameProps(props)}\n />\n );\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 return <Chart {...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 series = useMemo(\n () => bubbleSeries(input, { minSize, maxSize, maxValue }),\n [input, minSize, maxSize, maxValue],\n );\n return (\n <ChartBase\n options={engineOptions({ ...props, series })}\n {...frameProps(props)}\n />\n );\n}\n\n/**\n * Histogram: the distribution of raw samples in bins of equal width\n * (Freedman-Diaconis, Sturges or a count); millions of samples are binned\n * in milliseconds\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 locale,\n } = props;\n // page language read at every render: a language switch renames the series\n const lang = resolveLocale(locale);\n const series = useMemo(\n () => [\n histogramSeries(values, {\n bins,\n domain,\n nice,\n name,\n color,\n format: formatBin,\n locale: lang,\n }),\n ...(extra ?? []),\n ],\n [values, bins, domain, nice, name, color, formatBin, extra, lang],\n );\n return (\n <ChartBase\n options={engineOptions({ ...props, series })}\n {...frameProps(props)}\n />\n );\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 { series: input, groups, name, whisker, orientation, locale } = props;\n const groupName = name ?? presetLabels(resolveLocale(locale)).values;\n const series = useMemo(\n () =>\n boxplotSeries([\n ...(groups?.length\n ? [\n {\n id: \"boxplot\",\n name: groupName,\n data: boxplotData(groups, { whisker }),\n },\n ]\n : []),\n ...(input ?? []),\n ]),\n [input, groups, groupName, whisker],\n );\n return (\n <ChartBase\n options={engineOptions({ ...props, series, orientation })}\n {...frameProps(props)}\n />\n );\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 lang = resolveLocale(locale);\n const series = useMemo(\n () => [\n waterfallSeries(steps, {\n name,\n upColor,\n downColor,\n totalColor,\n start,\n labels,\n format,\n locale: lang,\n }),\n ],\n [steps, name, upColor, downColor, totalColor, start, labels, format, lang],\n );\n return (\n <ChartBase\n options={engineOptions({\n ...props,\n labels: undefined,\n series,\n orientation,\n })}\n {...frameProps(props)}\n />\n );\n}\n\n/**\n * Gantt chart: tasks as bars on a time axis with their progress, groups,\n * milestones and a today line; zooms and pans 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 lang = resolveLocale(locale);\n const gantt = useMemo(\n () =>\n ganttSeries(tasks, {\n colors,\n taskName,\n progressName,\n milestoneName,\n formatProgress,\n locale: lang,\n }),\n [\n tasks,\n colors,\n taskName,\n progressName,\n milestoneName,\n formatProgress,\n lang,\n ],\n );\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 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 <ChartBase\n options={{\n ...engineOptions({\n ...props,\n series: gantt.series,\n orientation: \"horizontal\",\n }),\n xAxis: {\n type: \"category\",\n categories: gantt.categories,\n ...xAxis,\n },\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 {...frameProps(props)}\n />\n );\n}\n"],"mappings":";;;;;;;AA4CA,IAAMA,KAAc,OAA6C;CAC/D,QAAQC,EAAM;CACd,OAAOA,EAAM;CACb,WAAWA,EAAM;CACjB,OAAOA,EAAM;CACb,WAAWA,EAAM;CACjB,SAASA,EAAM;CACf,cAAcA,EAAM;CACpB,aAAaA,EAAM;CACnB,QAAQA,EAAM;CACd,kBAAkBA,EAAM;CACxB,eAAeA,EAAM;AACvB;AAGA,SAAgBC,EAAU,GAAuB;CAC/C,IAAM,EACJ,QAAQC,GACR,UAAO,IACP,UACA,aAAU,IACV,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EL;AAGA,SAAgBmB,EAAa,GAA0B;CACrD,IAAM,EACJ,SACA,gBACA,gBACA,eACA,eACA,SACA,WACA,cACEnB,GACEG,IAASC,QAEXgB,EAAoB;EAClB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC,CAAC,CAAC,QACL;EACEC;EACAC;EACAC;EACAC;EACAC;EACAC;EACAC;EACAC;CACF,CACF,GACMC,IAAOlB,EAAc;EAAE,GAAGX;EAAO;CAAO,CAAC;CAC/C,OACE,kBAACU,GAAD;EACE,SAAS;GACP,GAAGU,EACD;IAAE;IAAM;IAAa;GAAY,GACjC;IACE,GAAGS;IACH,QAAQ7B,EAAM;IACd,aAAaA,EAAM;IACnB,SAASA,EAAM;GACjB,CACF;GACA;EACF;EACA,GAAID,EAAWC,CAAK;CACrB,CAAA;AAEL;AAGA,SAAgB8B,EAAU,GAAuB;CAC/C,IAAM,EACJ,SACA,SACA,UACA,UACA,SACA,cACA,WACA,YAAS,IACT,UACA,aACA,YACA,YACA,cACA,WACA,WACA,cACA,UACA,QACA,YACA,qBACE9B,GACE+B,IAAU3B,QAEZ4B,EACE;EAAE;EAAM;EAAM;EAAO;EAAO;EAAM;EAAW;CAAO,GACpD;EAAE;EAAU;EAAS;EAAS;EAAW;EAAQ;CAAO,CAC1D,GACF;EACEX;EACAY;EACAC;EACAzB;EACAiB;EACAS;EACAP;EACAQ;EACAC;EACAC;EACAC;EACAC;EACAxB;CACF,CACF;CACA,OACE,kBAACN,GAAD;EACW;EACD;EACD;EACI;EACJ;EACP,WAAW+B;EACF;EACM;CAChB,CAAA;AAEL;AAGA,SAAgBC,EAAa,GAA0B;CACrD,IAAM,EAAE,QAAQxC,MAAUF,GACpBG,IAASC,QAAcuC,EAAczC,CAAK,GAAG,CAACA,CAAK,CAAC;CAC1D,OACE,kBAACQ,GAAD;EACE,SAASC,EAAc;GAAE,GAAGX;GAAO;EAAO,CAAC;EAC3C,GAAID,EAAWC,CAAK;CACrB,CAAA;AAEL;AAEA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M;EACN,MAAM;EACN,OAAOA;EACP,OAAO;EACP,MAAM,CAAC,GAAG,CAAC;EACX,OAAOG;CACT,CACF;CACN,OACE,kBAACrH,GAAD;EACE,SAAS;GACP,GAAGC,EAAc;IACf,GAAGX;IACH,QAAQkH,EAAM;IACd,aAAa;GACf,CAAC;GACD,OAAO;IACL,MAAM;IACN,YAAYA,EAAM;IAClB,GAAGc;GACL;GACA,OAAO;IACL,MAAM;IACN,KAAKd,EAAM,OAAO;IAClB,KAAKA,EAAM,OAAO;IAClB,GAAGe;GACL;GACA,aAAa,CAAC,GAAIC,KAAe,CAAC,GAAI,GAAGJ,CAAK;GAC9C,aAAaK,KAAe,EAAE,MAAM,IAAI;GACxC,QAAQC,KAAUlB,EAAM,OAAO,SAAS;EAC1C;EACA,GAAInH,EAAWC,CAAK;CACrB,CAAA;AAEL"}
|
|
1
|
+
{"version":3,"file":"charts.js","names":["frameProps","props","LineChart","input","series","useMemo","lineSeries","area","stacked","percent","curve","ChartBase","engineOptions","AreaChart","areaSeries","BarChart","barSeries","labels","CandlestickChart","candlestickSeries","HeatmapChart","heatmapChartOptions","data","xCategories","yCategories","colorScale","valueRange","colorMidpoint","name","radius","format","base","Sparkline","options","sparklineOptions","type","color","reference","renderer","tooltip","palette","ariaLabel","locale","ref","ScatterChart","scatterSeries","CORNERS","cornerStyle","left","corner","top","split","plot","QuadrantChart","geometry","quadrantChartOptions","draggable","onPointDrop","overlay","quadrantContent","x0","x1","xDomain","y0","y1","yDomain","xs","xSplit","ys","ySplit","fx","fy","reverseX","onPointClick","index","event","points","onQuadrantClick","quadrantOf","at","renderTooltip","HorizontalBarChart","RangeAreaChart","rangeAreaSeries","MixedChart","Chart","BubbleChart","bubbleSeries","minSize","maxSize","maxValue","HistogramChart","extra","lang","resolveLocale","histogramSeries","values","formatBin","bins","domain","nice","BoxPlotChart","groupName","presetLabels","boxplotSeries","groups","boxplotData","s","outlierShape","outlierSize","whisker","WaterfallChart","waterfallSeries","steps","upColor","downColor","totalColor","start","connector","GanttChart","gantt","ganttSeries","tasks","colors","taskName","progressName","milestoneName","formatProgress","dependenciesName","mountedAt","useState","now","today","lines","todayLabel","xAxis","yAxis","annotations","interaction","legend"],"sources":["../../../../charts/src/react/charts.tsx"],"sourcesContent":["import { useMemo, useState, type CSSProperties } from \"react\";\nimport {\n areaSeries,\n barSeries,\n boxplotData,\n boxplotSeries,\n bubbleSeries,\n candlestickSeries,\n ganttSeries,\n heatmapChartOptions,\n histogramSeries,\n lineSeries,\n presetLabels,\n quadrantChartOptions,\n quadrantOf,\n rangeAreaSeries,\n scatterSeries,\n sparklineOptions,\n waterfallSeries,\n type QuadrantCorner,\n} from \"../engine/presets\";\nimport { resolveLocale } from \"../engine/locale\";\nimport type { ChartAnnotation, ChartRect } from \"../engine/types\";\nimport { Chart, ChartBase, engineOptions } from \"./Chart\";\nimport type {\n AreaChartProps,\n BarChartProps,\n BoxPlotChartProps,\n BubbleChartProps,\n CandlestickChartProps,\n ChartCommonProps,\n GanttChartProps,\n HeatmapChartProps,\n HistogramChartProps,\n HorizontalBarChartProps,\n LineChartProps,\n MixedChartProps,\n QuadrantChartProps,\n RangeAreaChartProps,\n ScatterChartProps,\n SparklineProps,\n WaterfallChartProps,\n} from \"./types\";\n\nconst frameProps = (props: Omit<ChartCommonProps, \"labels\">) => ({\n height: props.height,\n width: props.width,\n className: props.className,\n style: props.style,\n handleRef: props.ref,\n onHover: props.onHover,\n onPointClick: props.onPointClick,\n onPlotClick: props.onPlotClick,\n onZoom: props.onZoom,\n onRendererChange: props.onRendererChange,\n renderTooltip: props.renderTooltip,\n});\n\n/** Line (or area) chart; handles millions of points on the GPU */\nexport function LineChart(props: LineChartProps) {\n const {\n series: input,\n area = false,\n curve,\n stacked = false,\n percent = false,\n } = props;\n const series = useMemo(\n () => lineSeries(input, area, { curve, stacked: stacked || percent }),\n [input, area, curve, stacked, percent],\n );\n return (\n <ChartBase\n options={engineOptions({\n ...props,\n series,\n stackMode: percent ? \"percent\" : undefined,\n })}\n {...frameProps(props)}\n />\n );\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 series = useMemo(\n () => areaSeries(input, { curve, stacked: stacked || percent }),\n [input, curve, stacked, percent],\n );\n return (\n <ChartBase\n options={engineOptions({\n ...props,\n series,\n stackMode: percent ? \"percent\" : undefined,\n })}\n {...frameProps(props)}\n />\n );\n}\n\n/** Bar chart: grouped side by side, stacked or 100% stacked, with optional value labels */\nexport function BarChart(props: BarChartProps) {\n const {\n series: input,\n stacked = false,\n percent = false,\n labels = false,\n } = props;\n const series = useMemo(\n () => barSeries(input, stacked || percent, labels),\n [input, stacked, percent, labels],\n );\n return (\n <ChartBase\n options={engineOptions({\n ...props,\n labels: undefined,\n series,\n stackMode: percent ? \"percent\" : undefined,\n })}\n {...frameProps(props)}\n />\n );\n}\n\n/** Candlestick (OHLC) chart: rising and falling candles, zoomable on the GPU */\nexport function CandlestickChart(props: CandlestickChartProps) {\n const { series: input } = props;\n const series = useMemo(() => candlestickSeries(input), [input]);\n return (\n <ChartBase\n options={engineOptions({ ...props, series })}\n {...frameProps(props)}\n />\n );\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 } = props;\n const series = useMemo(\n () =>\n heatmapChartOptions({\n data,\n xCategories,\n yCategories,\n colorScale,\n valueRange,\n colorMidpoint,\n name,\n radius,\n format,\n }).series,\n [\n data,\n xCategories,\n yCategories,\n colorScale,\n valueRange,\n colorMidpoint,\n name,\n radius,\n format,\n ],\n );\n const base = engineOptions({ ...props, series });\n return (\n <ChartBase\n options={{\n ...heatmapChartOptions(\n { data, xCategories, yCategories },\n {\n ...base,\n legend: props.legend,\n interaction: props.interaction,\n tooltip: props.tooltip,\n },\n ),\n series,\n }}\n {...frameProps(props)}\n />\n );\n}\n\n/** Word-sized chart without axes: a trend in a table cell, 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 renderer,\n tooltip,\n palette,\n ariaLabel,\n locale,\n labels,\n className,\n style,\n ref,\n onHover,\n renderTooltip,\n } = props;\n const options = useMemo(\n () =>\n sparklineOptions(\n { data, type, color, curve, name, reference, format },\n { renderer, tooltip, palette, ariaLabel, locale, labels },\n ),\n [\n data,\n type,\n color,\n curve,\n name,\n reference,\n format,\n renderer,\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 className={className}\n style={style}\n handleRef={ref}\n onHover={onHover}\n renderTooltip={renderTooltip}\n />\n );\n}\n\n/** Scatter chart: zooms on both axes, hit testing through a spatial index */\nexport function ScatterChart(props: ScatterChartProps) {\n const { series: input } = props;\n const series = useMemo(() => scatterSeries(input), [input]);\n return (\n <ChartBase\n options={engineOptions({ ...props, series })}\n {...frameProps(props)}\n />\n );\n}\n\nconst CORNERS: QuadrantCorner[] = [\n \"topLeft\",\n \"topRight\",\n \"bottomLeft\",\n \"bottomRight\",\n];\n\nconst cornerStyle = (\n corner: QuadrantCorner,\n plot: ChartRect,\n split: { x: number; y: number },\n): CSSProperties => {\n const left = corner.endsWith(\"Left\");\n const top = corner.startsWith(\"top\");\n return {\n position: \"absolute\",\n left: left ? 0 : split.x - plot.x,\n top: top ? 0 : split.y - plot.y,\n width: left ? split.x - plot.x : plot.x + plot.width - split.x,\n height: top ? split.y - plot.y : plot.y + plot.height - split.y,\n pointerEvents: \"none\",\n };\n};\n\n/**\n * Four-quadrant matrix (priority matrix, Eisenhower, BCG, ...): tinted\n * quadrants with titles, dividers, and labelled dots placed without\n * overlapping labels. Dots can be dragged to another quadrant.\n */\nexport function QuadrantChart(props: QuadrantChartProps) {\n const {\n points,\n xDomain,\n yDomain,\n xSplit,\n ySplit,\n quadrants,\n xLabel,\n yLabel,\n axisLabels,\n showTicks,\n reverseX,\n showLabels,\n pointSize,\n name,\n draggable,\n onPointClick,\n onPointDrop,\n onQuadrantClick,\n renderTooltip,\n quadrantContent,\n } = props;\n const geometry = { xDomain, yDomain, xSplit, ySplit, reverseX };\n\n const options = quadrantChartOptions(\n {\n points,\n xDomain,\n yDomain,\n xSplit,\n ySplit,\n quadrants,\n xLabel,\n yLabel,\n axisLabels,\n showTicks,\n reverseX,\n showLabels,\n pointSize,\n name,\n draggable: draggable ?? !!onPointDrop,\n },\n engineOptions({ ...props, series: [] }),\n );\n\n const overlay = quadrantContent\n ? (plot: ChartRect) => {\n const [x0, x1] = xDomain ?? [0, 10];\n const [y0, y1] = yDomain ?? [0, 10];\n const xs = xSplit ?? (x0 + x1) / 2;\n const ys = ySplit ?? (y0 + y1) / 2;\n const fx = (xs - x0) / (x1 - x0 || 1);\n const fy = (ys - y0) / (y1 - y0 || 1);\n const split = {\n x: plot.x + plot.width * (reverseX ? 1 - fx : fx),\n y: plot.y + plot.height * (1 - fy),\n };\n return CORNERS.map((corner) =>\n quadrantContent[corner] ? (\n <div\n key={corner}\n className={`minerva-chart-quadrant minerva-chart-quadrant-${corner}`}\n style={cornerStyle(corner, plot, split)}\n >\n {quadrantContent[corner]}\n </div>\n ) : null,\n );\n }\n : undefined;\n\n return (\n <ChartBase\n options={options}\n {...frameProps({\n ...props,\n onPointClick: undefined,\n renderTooltip: undefined,\n })}\n overlay={overlay}\n onPointClick={\n onPointClick\n ? (event) => {\n const index = event.items[0]?.index;\n if (index !== undefined && points[index])\n onPointClick(points[index], index);\n }\n : undefined\n }\n onPlotClick={\n onQuadrantClick\n ? (at) => onQuadrantClick(quadrantOf(geometry, at.x, at.y), at)\n : undefined\n }\n onDrop={\n onPointDrop\n ? (event) => {\n const index = event.item.index;\n if (!points[index]) return;\n onPointDrop(points[index], index, {\n x: event.x,\n y: event.y,\n quadrant: quadrantOf(geometry, event.x, event.y),\n });\n }\n : undefined\n }\n renderTooltip={\n renderTooltip\n ? (event) => {\n const index = event.items[0]?.index;\n return index !== undefined && points[index]\n ? renderTooltip(points[index], index)\n : null;\n }\n : undefined\n }\n />\n );\n}\n\n/**\n * Horizontal bar chart: categories down the left side, values from the\n * left (rankings, long names, diverging surveys, stacked progress)\n */\nexport function HorizontalBarChart(props: HorizontalBarChartProps) {\n return <BarChart {...props} orientation=\"horizontal\" />;\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 series = useMemo(() => rangeAreaSeries(input, curve), [input, curve]);\n return (\n <ChartBase\n options={engineOptions({ ...props, series })}\n {...frameProps(props)}\n />\n );\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 return <Chart {...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 series = useMemo(\n () => bubbleSeries(input, { minSize, maxSize, maxValue }),\n [input, minSize, maxSize, maxValue],\n );\n return (\n <ChartBase\n options={engineOptions({ ...props, series })}\n {...frameProps(props)}\n />\n );\n}\n\n/**\n * Histogram: the distribution of raw samples in bins of equal width\n * (Freedman-Diaconis, Sturges or a count); millions of samples are binned\n * in milliseconds\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 locale,\n } = props;\n // page language read at every render: a language switch renames the series\n const lang = resolveLocale(locale);\n const series = useMemo(\n () => [\n histogramSeries(values, {\n bins,\n domain,\n nice,\n name,\n color,\n format: formatBin,\n locale: lang,\n }),\n ...(extra ?? []),\n ],\n [values, bins, domain, nice, name, color, formatBin, extra, lang],\n );\n return (\n <ChartBase\n options={engineOptions({ ...props, series })}\n {...frameProps(props)}\n />\n );\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,\n whisker,\n orientation,\n locale,\n outlierShape,\n outlierSize,\n } = props;\n const groupName = name ?? presetLabels(resolveLocale(locale)).values;\n const series = useMemo(\n () =>\n boxplotSeries([\n ...(groups?.length\n ? [\n {\n id: \"boxplot\",\n name: groupName,\n data: boxplotData(groups, { whisker }),\n },\n ]\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 [input, groups, groupName, whisker, outlierShape, outlierSize],\n );\n return (\n <ChartBase\n options={engineOptions({ ...props, series, orientation })}\n {...frameProps(props)}\n />\n );\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 lang = resolveLocale(locale);\n const series = useMemo(\n () => [\n waterfallSeries(steps, {\n name,\n upColor,\n downColor,\n totalColor,\n start,\n labels,\n format,\n connector,\n locale: lang,\n }),\n ],\n [\n steps,\n name,\n upColor,\n downColor,\n totalColor,\n start,\n labels,\n format,\n connector,\n lang,\n ],\n );\n return (\n <ChartBase\n options={engineOptions({\n ...props,\n labels: undefined,\n series,\n orientation,\n })}\n {...frameProps(props)}\n />\n );\n}\n\n/**\n * Gantt chart: tasks as bars on a time axis with their progress, groups,\n * milestones and a today line; zooms and pans 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 lang = resolveLocale(locale);\n const gantt = useMemo(\n () =>\n ganttSeries(tasks, {\n colors,\n taskName,\n progressName,\n milestoneName,\n formatProgress,\n dependenciesName,\n locale: lang,\n }),\n [\n tasks,\n colors,\n taskName,\n progressName,\n milestoneName,\n formatProgress,\n dependenciesName,\n lang,\n ],\n );\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 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 <ChartBase\n options={{\n ...engineOptions({\n ...props,\n series: gantt.series,\n orientation: \"horizontal\",\n }),\n xAxis: {\n type: \"category\",\n categories: gantt.categories,\n ...xAxis,\n },\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 {...frameProps(props)}\n />\n );\n}\n"],"mappings":";;;;;;;AA4CA,IAAMA,KAAc,OAA6C;CAC/D,QAAQC,EAAM;CACd,OAAOA,EAAM;CACb,WAAWA,EAAM;CACjB,OAAOA,EAAM;CACb,WAAWA,EAAM;CACjB,SAASA,EAAM;CACf,cAAcA,EAAM;CACpB,aAAaA,EAAM;CACnB,QAAQA,EAAM;CACd,kBAAkBA,EAAM;CACxB,eAAeA,EAAM;AACvB;AAGA,SAAgBC,EAAU,GAAuB;CAC/C,IAAM,EACJ,QAAQC,GACR,UAAO,IACP,UACA,aAAU,IACV,aAAU,OACRF,GACEG,IAASC,QACPC,EAAWH,GAAOI,GAA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,SACA,gBACA,gBACA,eACA,eACA,kBACA,SACA,WACA,cACEnB,GACEG,IAASC,QAEXgB,EAAoB;EAClB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC,CAAC,CAAC,QACL;EACEC;EACAC;EACAC;EACAC;EACAC;EACAC;EACAC;EACAC;EACAC;CACF,CACF,GACMC,IAAOnB,EAAc;EAAE,GAAGX;EAAO;CAAO,CAAC;CAC/C,OACE,kBAACU,GAAD;EACE,SAAS;GACP,GAAGU,EACD;IAAE;IAAM;IAAa;GAAY,GACjC;IACE,GAAGU;IACH,QAAQ9B,EAAM;IACd,aAAaA,EAAM;IACnB,SAASA,EAAM;GACjB,CACF;GACA;EACF;EACA,GAAID,EAAWC,CAAK;CACrB,CAAA;AAEL;AAGA,SAAgB+B,EAAU,GAAuB;CAC/C,IAAM,EACJ,SACA,SACA,UACA,UACA,SACA,cACA,WACA,YAAS,IACT,UACA,aACA,YACA,YACA,cACA,WACA,WACA,cACA,UACA,QACA,YACA,qBACE/B,GACEgC,IAAU5B,QAEZ6B,EACE;EAAE;EAAM;EAAM;EAAO;EAAO;EAAM;EAAW;CAAO,GACpD;EAAE;EAAU;EAAS;EAAS;EAAW;EAAQ;CAAO,CAC1D,GACF;EACEZ;EACAa;EACAC;EACA1B;EACAkB;EACAS;EACAP;EACAQ;EACAC;EACAC;EACAC;EACAC;EACAzB;CACF,CACF;CACA,OACE,kBAACN,GAAD;EACW;EACD;EACD;EACI;EACJ;EACP,WAAWgC;EACF;EACM;CAChB,CAAA;AAEL;AAGA,SAAgBC,EAAa,GAA0B;CACrD,IAAM,EAAE,QAAQzC,MAAUF,GACpBG,IAASC,QAAcwC,EAAc1C,CAAK,GAAG,CAACA,CAAK,CAAC;CAC1D,OACE,kBAACQ,GAAD;EACE,SAASC,EAAc;GAAE,GAAGX;GAAO;EAAO,CAAC;EAC3C,GAAID,EAAWC,CAAK;CACrB,CAAA;AAEL;AAEA,IAAM6C,IAA4B;CAChC;CACA;C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I,EAAYD,GAAQ,EAAE,WAAQ,CAAC;CACvC,CACF,IACA,CAAC,GACL,GAAItG,KAAS,CAAC,CAChB,CAAC,CAAC,CAAC,KAAK,MACNwG,EAAE,SAAS,YACP;EACE,GAAGA;EACH,cAAcA,EAAE,gBAAgBC;EAChC,aAAaD,EAAE,eAAeE;CAChC,IACAF,CACN,GACF;EAACxG;EAAOsG;EAAQH;EAAWQ;EAASF;EAAcC;CAAW,CAC/D;CACA,OACE,kBAAClG,GAAD;EACE,SAASC,EAAc;GAAE,GAAGX;GAAO;GAAQ;EAAY,CAAC;EACxD,GAAID,EAAWC,CAAK;CACrB,CAAA;AAEL;AAMA,SAAgB8G,EAAe,GAA4B;CACzD,IAAM,EACJ,UACA,SACA,YACA,cACA,eACA,UACA,YAAS,IACT,WACA,cACA,gBACA,cACE9G,GACE4F,IAAOC,EAAcpD,CAAM,GAC3BtC,IAASC,QACP,CACJ2G,EAAgBC,GAAO;EACrB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,QAAQpB;CACV,CAAC,CACH,GACA;EACEoB;EACArF;EACAsF;EACAC;EACAC;EACAC;EACApG;EACAa;EACAwF;EACAzB;CACF,CACF;CACA,OACE,kBAAClF,GAAD;EACE,SAASC,EAAc;GACrB,GAAGX;GACH,QAAQ,KAAA;GACR;GACA;EACF,CAAC;EACD,GAAID,EAAWC,CAAK;CACrB,CAAA;AAEL;AAMA,SAAgBsH,EAAW,GAAwB;CACjD,IAAM,EACJ,UACA,WACA,aACA,iBACA,kBACA,mBACA,qBACA,WAAQ,IACR,eACA,UACA,UACA,gBACA,gBACA,WACA,cACEtH,GACE4F,IAAOC,EAAcpD,CAAM,GAC3B8E,IAAQnH,QAEVoH,EAAYC,GAAO;EACjB;EACA;EACA;EACA;EACA;EACA;EACA,QAAQ7B;CACV,CAAC,GACH;EACE6B;EACAC;EACAC;EACAC;EACAC;EACAC;EACAC;EACAnC;CACF,CACF,GACM,CAACoC,KAAaC,QAAe,KAAK,IAAI,CAAC,GACvCC,IACJC,MAAU,KACN,OACAA,MAAU,KACRH,IACAG,aAAiB,OACfA,EAAM,QAAQ,IACdA,GACJC,IACJF,MAAQ,OACJ,CAAC,IACD,CACE;EACE,MAAM;EACN,MAAM;EACN,OAAOA;EACP,OAAO;EACP,MAAM,CAAC,GAAG,CAAC;EACX,OAAOG;CACT,CACF;CACN,OACE,kBAAC3H,GAAD;EACE,SAAS;GACP,GAAGC,EAAc;IACf,GAAGX;IACH,QAAQuH,EAAM;IACd,aAAa;GACf,CAAC;GACD,OAAO;IACL,MAAM;IACN,YAAYA,EAAM;IAClB,GAAGe;GACL;GACA,OAAO;IACL,MAAM;IACN,KAAKf,EAAM,OAAO;IAClB,KAAKA,EAAM,OAAO;IAClB,GAAGgB;GACL;GACA,aAAa,CAAC,GAAIC,KAAe,CAAC,GAAI,GAAGJ,CAAK;GAC9C,aAAaK,KAAe,EAAE,MAAM,IAAI;GACxC,QAAQC,KAAUnB,EAAM,OAAO,SAAS;EAC1C;EACA,GAAIxH,EAAWC,CAAK;CACrB,CAAA;AAEL"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";const e=require("../engine/graph/chart.cjs");let t=require("react"),n=require("react/jsx-runtime");var r=e=>{if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null},i=(e,t)=>{let n=Object.keys(e);return n.length===Object.keys(t).length&&n.every(n=>e[n]===t[n]&&Object.prototype.hasOwnProperty.call(t,n))},a=(e,t)=>e===t?!0:Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every((e,n)=>e===t[n]):r(e)&&r(t)&&i(e,t),o=(e,t)=>{if(e===t)return!0;let n=Object.keys(e);return n.length===Object.keys(t).length&&n.every(n=>Object.prototype.hasOwnProperty.call(t,n)&&a(e[n],t[n]))},s=(e,t)=>e===void 0?t:typeof e==`number`?`${e}px`:e;function c({options:r,height:i,width:a,className:c,style:l,handleRef:u,...d}){let f=(0,t.useRef)(null),p=(0,t.useRef)(null),m=(0,t.useRef)(d),[h,g]=(0,t.useState)(r);h!==r&&!o(h,r)&&g(r);let _=(0,t.useRef)(h);return(0,t.useEffect)(()=>{m.current=d}),(0,t.useEffect)(()=>{let t=f.current;if(!t)return;let n=e.createGraphChart(t,_.current);p.current=n;let r=[n.on(`hover`,e=>m.current.onHover?.(e)),n.on(`click`,e=>m.current.onItemClick?.(e)),n.on(`select`,e=>m.current.onSelectionChange?.(e.ids)),n.on(`toggle`,e=>m.current.onToggle?.(e)),n.on(`groupToggle`,e=>m.current.onGroupToggle?.(e)),n.on(`layoutEnd`,e=>m.current.onLayoutEnd?.(e)),n.on(`renderer`,e=>m.current.onRendererChange?.(e))];return()=>{r.forEach(e=>e()),n.destroy(),p.current=null}},[]),(0,t.useEffect)(()=>{_.current!==h&&(_.current=h,p.current?.setOptions(h))},[h]),(0,t.useImperativeHandle)(u,()=>({fit:e=>p.current?.fit(e),focusNode:(e,t)=>p.current?.focusNode(e,t),setData:e=>p.current?.setData(e),select:e=>p.current?.select(e),getSelection:()=>p.current?.getSelection()??[],expand:e=>p.current?.expand(e),collapse:e=>p.current?.collapse(e),toggle:e=>p.current?.toggle(e),getPositions:()=>p.current?.getPositions()??{},relayout:()=>p.current?.relayout(),getRenderer:()=>p.current?.getRenderer()??null,getInstance:()=>p.current}),[]),(0,n.jsx)(`div`,{className:c,style:{position:`relative`,width:s(a,`100%`),height:s(i,`480px`),...l},children:(0,n.jsx)(`div`,{ref:f,style:{position:`absolute`,inset:0}})})}function l({props:e,layout:t}){let{nodes:r,edges:i,groups:a,height:o,width:s,nodeShape:l,nodeSize:u,edgeStyle:d,edgeWidth:f,edgeColor:p,arrows:m,nodeLabels:h,edgeLabels:g,highlight:_,selected:v,animation:y,fitPadding:b,controls:x,legend:S,tooltip:C,interaction:w,renderer:T,palette:E,ariaLabel:D,locale:O,labels:k,onHover:A,onItemClick:j,onSelectionChange:M,onToggle:N,onGroupToggle:P,onLayoutEnd:F,onRendererChange:I,className:L,style:R,ref:z}=e,B={nodes:r,edges:i,groups:a,...t,nodeShape:l,nodeSize:u,edgeStyle:d,edgeWidth:f,edgeColor:p,arrows:m,nodeLabels:h,edgeLabels:g,highlight:_,selected:v,animation:y,fitPadding:b,controls:x,legend:S,tooltip:C,interaction:w,renderer:T,palette:E,ariaLabel:D,locale:O,labels:k};return(0,n.jsx)(c,{options:B,height:o,width:s,className:L,style:R,handleRef:z,onHover:A,onItemClick:j,onSelectionChange:M,onToggle:N,onGroupToggle:P,onLayoutEnd:F,onRendererChange:I})}function u(e){let{layout:t,direction:r,force:i,circular:a,dag:o,tree:s}=e;return(0,n.jsx)(l,{props:e,layout:{layout:t??`force`,direction:r,force:i,circular:a,dag:o,tree:s}})}function d(e){let{direction:t,dag:r,criticalPath:i}=e;return(0,n.jsx)(l,{props:e,layout:{layout:`dag`,direction:t??`TB`,dag:i===void 0?r:{...r,criticalPath:i}}})}function f(e){let{layout:t,direction:r,tree:i}=e;return(0,n.jsx)(l,{props:e,layout:{layout:t??`tree`,direction:r,tree:i}})}exports.DependencyGraph=d,exports.GraphChart=u,exports.TreeChart=f;
|
|
2
|
+
//# sourceMappingURL=graph.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph.cjs","names":["useRef","useState","createGraphChart","require_chart","react","react_jsx_runtime","isPlainObject","value","proto","shallowEqual","keys","a","b","key","sameValue","v","i","sameGraphOptions","cssSize","fallback","GraphBase","handlers","containerRef","chartRef","handlersRef","stable","setStable","options","optionsRef","container","chart","offs","r","off","handleRef","animate","id","opts","data","ids","width","height","style","GraphFrame","props","layout","ref","GraphChart","DependencyGraph","direction","criticalPath","dag","TreeChart"],"sources":["../../../../charts/src/react/graph.tsx"],"sourcesContent":["import {\n useEffect,\n useImperativeHandle,\n useRef,\n useState,\n type CSSProperties,\n type Ref,\n} from \"react\";\nimport { createGraphChart } from \"../engine/graph/chart\";\nimport type {\n GraphChartInstance,\n GraphChartLabels,\n GraphChartOptions,\n GraphCircularOptions,\n GraphDagOptions,\n GraphData,\n GraphDirection,\n GraphEdge,\n GraphEdgeStyle,\n GraphForceOptions,\n GraphGroup,\n GraphGroupToggleEvent,\n GraphHoverEvent,\n GraphInteractionOptions,\n GraphLayoutEndEvent,\n GraphLayoutType,\n GraphLegendOptions,\n GraphNode,\n GraphNodeShape,\n GraphPoint,\n GraphToggleEvent,\n GraphTooltipOptions,\n GraphTreeOptions,\n} from \"../engine/graph/types\";\nimport type {\n ChartRendererKind,\n ChartRendererPreference,\n} from \"../engine/types\";\n\n/** Imperative handle of the graph components (`ref`) */\nexport interface GraphChartHandle {\n /** Fits the visible nodes in the view */\n fit(animate?: boolean): void;\n /** Centers a node (expanding its collapsed ancestors), optionally zooming */\n focusNode(id: string, options?: { zoom?: number; animate?: boolean }): void;\n /** Replaces the data until the next render with new props */\n setData(data: GraphData): void;\n /** Selects nodes (`null` clears the selection) */\n select(ids: readonly string[] | string | null): void;\n /** Ids of the selected nodes */\n getSelection(): string[];\n /** Expands a node (all nodes without an id) */\n expand(id?: string): void;\n /** Collapses a node (all nodes with children without an id) */\n collapse(id?: string): void;\n /** Collapses / expands a node */\n toggle(id: string): void;\n /** Current positions of the nodes in layout units */\n getPositions(): Record<string, GraphPoint>;\n /** Computes the layout again */\n relayout(): void;\n /** Backend in use, `null` until ready */\n getRenderer(): ChartRendererKind | null;\n /** The underlying engine instance (minerva-design/charts/core) */\n getInstance(): GraphChartInstance | null;\n}\n\n/** Props shared by `GraphChart`, `DependencyGraph` and `TreeChart` */\nexport interface GraphCommonProps {\n /** The nodes */\n nodes: readonly GraphNode[];\n /** The edges (parent → child in trees, prerequisite → dependent in DAGs) */\n edges: readonly GraphEdge[];\n /** Groups: legend order, names and colors */\n groups?: readonly GraphGroup[];\n /**\n * Height of the chart (the legend included); numbers are pixels\n * @default 480\n */\n height?: number | string;\n /**\n * Width of the chart; numbers are pixels\n * @default \"100%\"\n */\n width?: number | string;\n /** Shape of the nodes without `shape` (boxes for DAGs, org charts and mind maps, circles otherwise) */\n nodeShape?: GraphNodeShape;\n /** Circle diameter in layout units, or `[min, max]` scaled by the node `value` */\n nodeSize?: number | readonly [number, number];\n /** Edge shape; depends on the layout when omitted */\n edgeStyle?: GraphEdgeStyle;\n /** Edge width in CSS pixels, or `[min, max]` scaled by the edge `value` */\n edgeWidth?: number | readonly [number, number];\n /**\n * Edge colors: neutral or tinted with the source / target node\n * @default \"neutral\"\n */\n edgeColor?: \"neutral\" | \"source\" | \"target\";\n /** Arrowheads on the edges without `directed` */\n arrows?: boolean;\n /**\n * Node labels; `auto` hides minor and overlapping labels when zoomed out.\n * Text inside boxes keeps a readable minimum size and is shortened with an ellipsis;\n * it is hidden only when the box is too small for any text, or with `false`\n * @default \"auto\"\n */\n nodeLabels?: boolean | \"auto\";\n /**\n * Edge labels: always, `auto` (zoomed in or highlighted), only `hover`, or never\n * @default \"auto\"\n */\n edgeLabels?: boolean | \"auto\" | \"hover\";\n /** What hovering / selecting a node highlights */\n highlight?: \"neighbors\" | \"lineage\" | \"none\";\n /** Ids of the selected nodes (changing it updates the selection) */\n selected?: readonly string[];\n /**\n * Animates layout and data changes; a number is the duration in ms\n * @default true\n */\n animation?: boolean | number;\n /**\n * Padding around the graph when fitting it, in CSS pixels\n * @default 24\n */\n fitPadding?: number;\n /**\n * Zoom buttons (zoom in, zoom out, fit)\n * @default true\n */\n controls?: boolean;\n /** Legend of the groups; shown by default with several groups */\n legend?: boolean | GraphLegendOptions;\n /** Tooltip; `false` disables it */\n tooltip?: boolean | GraphTooltipOptions;\n /**\n * Drag pans, Ctrl / ⌘ + wheel and pinch zoom, nodes can be dragged\n * (force, circular), click selects, arrow keys move between nodes;\n * `false` makes the chart static\n * @default true\n */\n interaction?: boolean | GraphInteractionOptions;\n /**\n * Backend of the nodes and edges: `auto` tries WebGPU, then WebGL2, then\n * WebGL, then Canvas2D, skipping GPUs running in software\n * @default \"auto\"\n */\n renderer?: ChartRendererPreference;\n /** Group colors (defaults to the `--chart-series-1..8` CSS variables, then the theme colors) */\n palette?: readonly string[];\n /** Accessible name of the chart */\n ariaLabel?: string;\n /**\n * Language of the built-in texts (summary, announcements, tooltip,\n * buttons); built-in texts in English, Chinese, Japanese and French\n * @default the page language (`<html lang>`), then the browser language\n */\n locale?: string;\n /** Overrides of the built-in texts of the `locale` */\n labels?: Partial<GraphChartLabels>;\n /** Called when the hovered (or keyboard-focused) node / edge changes */\n onHover?: (event: GraphHoverEvent | null) => void;\n /** Called when a node or an edge is clicked (or a node activated with Enter) */\n onItemClick?: (event: GraphHoverEvent) => void;\n /** Called with the ids of the selected nodes when the selection changes */\n onSelectionChange?: (ids: string[]) => void;\n /** Called when a tree node is collapsed or expanded */\n onToggle?: (event: GraphToggleEvent) => void;\n /** Called when the legend shows / hides a group */\n onGroupToggle?: (event: GraphGroupToggleEvent) => void;\n /** Called when the layout is done (the force simulation cooled down) */\n onLayoutEnd?: (event: GraphLayoutEndEvent) => void;\n /** Called with the backend once it is ready (and after a fallback) */\n onRendererChange?: (renderer: ChartRendererKind) => void;\n /** Class of the outer element */\n className?: string;\n /** Style of the outer element */\n style?: CSSProperties;\n /** Imperative handle */\n ref?: Ref<GraphChartHandle>;\n}\n\n/** Props of `GraphChart` */\nexport interface GraphChartProps extends GraphCommonProps {\n /**\n * Placement of the nodes\n * @default \"force\"\n */\n layout?: GraphLayoutType;\n /** Direction of the `dag` and `tree` layouts */\n direction?: GraphDirection;\n /** Force layout settings (Barnes–Hut, worker for large graphs) */\n force?: GraphForceOptions;\n /** Circular / arc layout settings */\n circular?: GraphCircularOptions;\n /** Layered layout settings (`layout=\"dag\"`) */\n dag?: GraphDagOptions;\n /** Tree layout settings (tree layouts) */\n tree?: GraphTreeOptions;\n}\n\n/** Props of `DependencyGraph` */\nexport interface DependencyGraphProps extends GraphCommonProps {\n /**\n * Flow direction\n * @default \"TB\"\n */\n direction?: GraphDirection;\n /** Layer / node spacing, crossing reduction sweeps */\n dag?: GraphDagOptions;\n /**\n * Highlights the longest path (node `value` = duration); `true` computes it, a list of ids sets it\n * @default false\n */\n criticalPath?: boolean | readonly string[];\n}\n\n/** Props of `TreeChart` */\nexport interface TreeChartProps extends GraphCommonProps {\n /**\n * Kind of tree: tidy tree, radial tree, two-sided mind map or org chart\n * @default \"tree\"\n */\n layout?: \"tree\" | \"radial\" | \"mindmap\" | \"org\";\n /**\n * Direction of `layout=\"tree\"`\n * @default \"LR\"\n */\n direction?: GraphDirection;\n /** Root, spacing, collapsing, card size */\n tree?: GraphTreeOptions;\n}\n\n// ----------------------------------------------------------------- base\n\ninterface Handlers {\n onHover?: (event: GraphHoverEvent | null) => void;\n onItemClick?: (event: GraphHoverEvent) => void;\n onSelectionChange?: (ids: string[]) => void;\n onToggle?: (event: GraphToggleEvent) => void;\n onGroupToggle?: (event: GraphGroupToggleEvent) => void;\n onLayoutEnd?: (event: GraphLayoutEndEvent) => void;\n onRendererChange?: (renderer: ChartRendererKind) => void;\n}\n\nconst isPlainObject = (value: unknown): value is Record<string, unknown> => {\n if (typeof value !== \"object\" || value === null) return false;\n const proto = Object.getPrototypeOf(value);\n return proto === Object.prototype || proto === null;\n};\n\nconst shallowEqual = (\n a: Record<string, unknown>,\n b: Record<string, unknown>,\n): boolean => {\n const keys = Object.keys(a);\n if (keys.length !== Object.keys(b).length) return false;\n return keys.every(\n (key) => a[key] === b[key] && Object.prototype.hasOwnProperty.call(b, key),\n );\n};\n\nconst sameValue = (a: unknown, b: unknown): boolean => {\n if (a === b) return true;\n if (Array.isArray(a) && Array.isArray(b))\n return a.length === b.length && a.every((v, i) => v === b[i]);\n return isPlainObject(a) && isPlainObject(b) && shallowEqual(a, b);\n};\n\n/**\n * Whether two option objects describe the same chart: top-level values by\n * identity, one level deep for inline arrays / objects (node and edge\n * arrays rebuilt with the same objects are the same data)\n */\nconst sameGraphOptions = (\n a: GraphChartOptions,\n b: GraphChartOptions,\n): boolean => {\n if (a === b) return true;\n const keys = Object.keys(a) as (keyof GraphChartOptions)[];\n if (keys.length !== Object.keys(b).length) return false;\n return keys.every(\n (key) =>\n Object.prototype.hasOwnProperty.call(b, key) && sameValue(a[key], b[key]),\n );\n};\n\nconst cssSize = (value: number | string | undefined, fallback: string) =>\n value === undefined\n ? fallback\n : typeof value === \"number\"\n ? `${value}px`\n : value;\n\ninterface GraphBaseProps extends Handlers {\n options: GraphChartOptions;\n height?: number | string;\n width?: number | string;\n className?: string;\n style?: CSSProperties;\n handleRef?: Ref<GraphChartHandle>;\n}\n\nfunction GraphBase({\n options,\n height,\n width,\n className,\n style,\n handleRef,\n ...handlers\n}: GraphBaseProps) {\n const containerRef = useRef<HTMLDivElement>(null);\n const chartRef = useRef<GraphChartInstance | null>(null);\n const handlersRef = useRef<Handlers>(handlers);\n // keep the previous options while they describe the same chart\n const [stable, setStable] = useState(options);\n if (stable !== options && !sameGraphOptions(stable, options))\n setStable(options);\n const optionsRef = useRef(stable);\n\n useEffect(() => {\n handlersRef.current = handlers;\n });\n\n useEffect(() => {\n const container = containerRef.current;\n if (!container) return;\n const chart = createGraphChart(container, optionsRef.current);\n chartRef.current = chart;\n const offs = [\n chart.on(\"hover\", (e) => handlersRef.current.onHover?.(e)),\n chart.on(\"click\", (e) => handlersRef.current.onItemClick?.(e)),\n chart.on(\"select\", (e) => handlersRef.current.onSelectionChange?.(e.ids)),\n chart.on(\"toggle\", (e) => handlersRef.current.onToggle?.(e)),\n chart.on(\"groupToggle\", (e) => handlersRef.current.onGroupToggle?.(e)),\n chart.on(\"layoutEnd\", (e) => handlersRef.current.onLayoutEnd?.(e)),\n chart.on(\"renderer\", (r) => handlersRef.current.onRendererChange?.(r)),\n ];\n return () => {\n offs.forEach((off) => off());\n chart.destroy();\n chartRef.current = null;\n };\n }, []);\n\n useEffect(() => {\n if (optionsRef.current === stable) return;\n optionsRef.current = stable;\n chartRef.current?.setOptions(stable);\n }, [stable]);\n\n useImperativeHandle(\n handleRef,\n () => ({\n fit: (animate) => chartRef.current?.fit(animate),\n focusNode: (id, opts) => chartRef.current?.focusNode(id, opts),\n setData: (data) => chartRef.current?.setData(data),\n select: (ids) => chartRef.current?.select(ids),\n getSelection: () => chartRef.current?.getSelection() ?? [],\n expand: (id) => chartRef.current?.expand(id),\n collapse: (id) => chartRef.current?.collapse(id),\n toggle: (id) => chartRef.current?.toggle(id),\n getPositions: () => chartRef.current?.getPositions() ?? {},\n relayout: () => chartRef.current?.relayout(),\n getRenderer: () => chartRef.current?.getRenderer() ?? null,\n getInstance: () => chartRef.current,\n }),\n [],\n );\n\n return (\n <div\n className={className}\n style={{\n position: \"relative\",\n width: cssSize(width, \"100%\"),\n height: cssSize(height, \"480px\"),\n ...style,\n }}\n >\n <div ref={containerRef} style={{ position: \"absolute\", inset: 0 }} />\n </div>\n );\n}\n\n/** Renders a chart from the common props and the layout options */\nfunction GraphFrame({\n props,\n layout,\n}: {\n props: GraphCommonProps;\n layout: Pick<\n GraphChartOptions,\n \"layout\" | \"direction\" | \"force\" | \"circular\" | \"dag\" | \"tree\"\n >;\n}) {\n const {\n nodes,\n edges,\n groups,\n height,\n width,\n nodeShape,\n nodeSize,\n edgeStyle,\n edgeWidth,\n edgeColor,\n arrows,\n nodeLabels,\n edgeLabels,\n highlight,\n selected,\n animation,\n fitPadding,\n controls,\n legend,\n tooltip,\n interaction,\n renderer,\n palette,\n ariaLabel,\n locale,\n labels,\n onHover,\n onItemClick,\n onSelectionChange,\n onToggle,\n onGroupToggle,\n onLayoutEnd,\n onRendererChange,\n className,\n style,\n ref,\n } = props;\n const options: GraphChartOptions = {\n nodes,\n edges,\n groups,\n ...layout,\n nodeShape,\n nodeSize,\n edgeStyle,\n edgeWidth,\n edgeColor,\n arrows,\n nodeLabels,\n edgeLabels,\n highlight,\n selected,\n animation,\n fitPadding,\n controls,\n legend,\n tooltip,\n interaction,\n renderer,\n palette,\n ariaLabel,\n locale,\n labels,\n };\n return (\n <GraphBase\n options={options}\n height={height}\n width={width}\n className={className}\n style={style}\n handleRef={ref}\n onHover={onHover}\n onItemClick={onItemClick}\n onSelectionChange={onSelectionChange}\n onToggle={onToggle}\n onGroupToggle={onGroupToggle}\n onLayoutEnd={onLayoutEnd}\n onRendererChange={onRendererChange}\n />\n );\n}\n\n// ----------------------------------------------------------- components\n\n/**\n * Relationship network (关系图): force-directed by default (Barnes–Hut,\n * a Web Worker for large graphs), or circular, arc diagram, layered or\n * tree layouts; GPU rendering, pan / zoom, drag, neighbor highlight,\n * legend toggles and keyboard navigation.\n */\nexport function GraphChart(props: GraphChartProps) {\n const { layout, direction, force, circular, dag, tree } = props;\n return (\n <GraphFrame\n props={props}\n layout={{\n layout: layout ?? \"force\",\n direction,\n force,\n circular,\n dag,\n tree,\n }}\n />\n );\n}\n\n/**\n * Dependency graph (依赖图): layered (Sugiyama) layout of a DAG with\n * crossing reduction, spline or orthogonal edges with arrowheads,\n * upstream / downstream highlight and the critical path.\n */\nexport function DependencyGraph(props: DependencyGraphProps) {\n const { direction, dag, criticalPath } = props;\n return (\n <GraphFrame\n props={props}\n layout={{\n layout: \"dag\",\n direction: direction ?? \"TB\",\n dag: criticalPath === undefined ? dag : { ...dag, criticalPath },\n }}\n />\n );\n}\n\n/**\n * Tree chart (树图): tidy tree, radial tree, mind map or org chart, with\n * animated collapse / expand of the subtrees.\n */\nexport function TreeChart(props: TreeChartProps) {\n const { layout, direction, tree } = props;\n return (\n <GraphFrame\n props={props}\n layout={{ layout: layout ?? \"tree\", direction, tree }}\n />\n );\n}\n"],"mappings":"gHAqPA,IAAMM,EAAiB,GAAqD,CAC1E,GAAI,OAAOC,GAAU,WAAYA,EAAgB,MAAO,GACxD,IAAMC,EAAQ,OAAO,eAAeD,CAAK,EACzC,OAAOC,IAAU,OAAO,WAAaA,IAAU,IACjD,EAEMC,GACJ,EACA,IACY,CACZ,IAAMC,EAAO,OAAO,KAAKC,CAAC,EAE1B,OADID,EAAK,SAAW,OAAO,KAAKE,CAAC,CAAC,CAAC,QAC5BF,EAAK,MACT,GAAQC,EAAEE,KAASD,EAAEC,IAAQ,OAAO,UAA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AAS,SAAS,aAAa,GAAK,CAAC,EACzD,aAAgBA,EAAS,SAAS,SAAS,EAC3C,gBAAmBA,EAAS,SAAS,YAAY,GAAK,KACtD,gBAAmBA,EAAS,OAC9B,GACA,CAAC,CACH,GAGE,EAAAlB,EAAA,IAAA,CAAC,MAAD,CACa,YACX,MAAO,CACL,SAAU,WACV,MAAOa,EAAQsB,EAAO,MAAM,EAC5B,OAAQtB,EAAQuB,EAAQ,OAAO,EAC/B,GAAGC,CACL,EAEA,UAAA,EAAArC,EAAA,IAAA,CAAC,MAAD,CAAK,IAAKiB,EAAc,MAAO,CAAE,SAAU,WAAY,MAAO,CAAE,CAAI,CAAA,CACjE,CAAA,CAET,CAGA,SAASqB,EAAW,CAClB,QACA,UAOC,CACD,GAAM,CACJ,QACA,QACA,SACA,SACA,QACA,YACA,WACA,YACA,YACA,YACA,SACA,aACA,aACA,YACA,WACA,YACA,aACA,WACA,SACA,UACA,cACA,WACA,UACA,YACA,SACA,SACA,UACA,cACA,oBACA,WACA,gBACA,cACA,mBACA,YACA,QACA,OACEC,EACEjB,EAA6B,CACjC,QACA,QACA,SACA,GAAGkB,EACH,YACA,WACA,YACA,YACA,YACA,SACA,aACA,aACA,YACA,WACA,YACA,aACA,WACA,SACA,UACA,cACA,WACA,UACA,YACA,SACA,QACF,EACA,OACE,EAAAxC,EAAA,IAAA,CAACe,EAAD,CACW,UACD,SACD,QACI,YACJ,QACP,UAAW0B,EACF,UACI,cACM,oBACT,WACK,gBACF,cACK,kBACnB,CAAA,CAEL,CAUA,SAAgBC,EAAW,EAAwB,CACjD,GAAM,CAAE,SAAQ,YAAW,QAAO,WAAU,MAAK,QAASH,EAC1D,OACE,EAAAvC,EAAA,IAAA,CAACsC,EAAD,CACS,QACP,OAAQ,CACN,OAAQE,GAAU,QAClB,YACA,QACA,WACA,MACA,MACF,CACD,CAAA,CAEL,CAOA,SAAgBG,EAAgB,EAA6B,CAC3D,GAAM,CAAE,YAAW,MAAK,gBAAiBJ,EACzC,OACE,EAAAvC,EAAA,IAAA,CAACsC,EAAD,CACS,QACP,OAAQ,CACN,OAAQ,MACR,UAAWM,GAAa,KACxB,IAAKC,IAAiB,IAAA,GAAYC,EAAM,CAAE,GAAGA,EAAK,cAAa,CACjE,CACD,CAAA,CAEL,CAMA,SAAgBC,EAAU,EAAuB,CAC/C,GAAM,CAAE,SAAQ,YAAW,QAASR,EACpC,OACE,EAAAvC,EAAA,IAAA,CAACsC,EAAD,CACS,QACP,OAAQ,CAAE,OAAQE,GAAU,OAAQ,YAAW,MAAK,CACrD,CAAA,CAEL"}
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import { CSSProperties, Ref } from 'react';
|
|
2
|
+
import { GraphChartInstance, GraphChartLabels, GraphCircularOptions, GraphDagOptions, GraphData, GraphDirection, GraphEdge, GraphEdgeStyle, GraphForceOptions, GraphGroup, GraphGroupToggleEvent, GraphHoverEvent, GraphInteractionOptions, GraphLayoutEndEvent, GraphLayoutType, GraphLegendOptions, GraphNode, GraphNodeShape, GraphPoint, GraphToggleEvent, GraphTooltipOptions, GraphTreeOptions } from '../engine/graph/types.cjs';
|
|
3
|
+
import { ChartRendererKind, ChartRendererPreference } from '../engine/types.cjs';
|
|
4
|
+
/** Imperative handle of the graph components (`ref`) */
|
|
5
|
+
export interface GraphChartHandle {
|
|
6
|
+
/** Fits the visible nodes in the view */
|
|
7
|
+
fit(animate?: boolean): void;
|
|
8
|
+
/** Centers a node (expanding its collapsed ancestors), optionally zooming */
|
|
9
|
+
focusNode(id: string, options?: {
|
|
10
|
+
zoom?: number;
|
|
11
|
+
animate?: boolean;
|
|
12
|
+
}): void;
|
|
13
|
+
/** Replaces the data until the next render with new props */
|
|
14
|
+
setData(data: GraphData): void;
|
|
15
|
+
/** Selects nodes (`null` clears the selection) */
|
|
16
|
+
select(ids: readonly string[] | string | null): void;
|
|
17
|
+
/** Ids of the selected nodes */
|
|
18
|
+
getSelection(): string[];
|
|
19
|
+
/** Expands a node (all nodes without an id) */
|
|
20
|
+
expand(id?: string): void;
|
|
21
|
+
/** Collapses a node (all nodes with children without an id) */
|
|
22
|
+
collapse(id?: string): void;
|
|
23
|
+
/** Collapses / expands a node */
|
|
24
|
+
toggle(id: string): void;
|
|
25
|
+
/** Current positions of the nodes in layout units */
|
|
26
|
+
getPositions(): Record<string, GraphPoint>;
|
|
27
|
+
/** Computes the layout again */
|
|
28
|
+
relayout(): void;
|
|
29
|
+
/** Backend in use, `null` until ready */
|
|
30
|
+
getRenderer(): ChartRendererKind | null;
|
|
31
|
+
/** The underlying engine instance (minerva-design/charts/core) */
|
|
32
|
+
getInstance(): GraphChartInstance | null;
|
|
33
|
+
}
|
|
34
|
+
/** Props shared by `GraphChart`, `DependencyGraph` and `TreeChart` */
|
|
35
|
+
export interface GraphCommonProps {
|
|
36
|
+
/** The nodes */
|
|
37
|
+
nodes: readonly GraphNode[];
|
|
38
|
+
/** The edges (parent → child in trees, prerequisite → dependent in DAGs) */
|
|
39
|
+
edges: readonly GraphEdge[];
|
|
40
|
+
/** Groups: legend order, names and colors */
|
|
41
|
+
groups?: readonly GraphGroup[];
|
|
42
|
+
/**
|
|
43
|
+
* Height of the chart (the legend included); numbers are pixels
|
|
44
|
+
* @default 480
|
|
45
|
+
*/
|
|
46
|
+
height?: number | string;
|
|
47
|
+
/**
|
|
48
|
+
* Width of the chart; numbers are pixels
|
|
49
|
+
* @default "100%"
|
|
50
|
+
*/
|
|
51
|
+
width?: number | string;
|
|
52
|
+
/** Shape of the nodes without `shape` (boxes for DAGs, org charts and mind maps, circles otherwise) */
|
|
53
|
+
nodeShape?: GraphNodeShape;
|
|
54
|
+
/** Circle diameter in layout units, or `[min, max]` scaled by the node `value` */
|
|
55
|
+
nodeSize?: number | readonly [number, number];
|
|
56
|
+
/** Edge shape; depends on the layout when omitted */
|
|
57
|
+
edgeStyle?: GraphEdgeStyle;
|
|
58
|
+
/** Edge width in CSS pixels, or `[min, max]` scaled by the edge `value` */
|
|
59
|
+
edgeWidth?: number | readonly [number, number];
|
|
60
|
+
/**
|
|
61
|
+
* Edge colors: neutral or tinted with the source / target node
|
|
62
|
+
* @default "neutral"
|
|
63
|
+
*/
|
|
64
|
+
edgeColor?: "neutral" | "source" | "target";
|
|
65
|
+
/** Arrowheads on the edges without `directed` */
|
|
66
|
+
arrows?: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Node labels; `auto` hides minor and overlapping labels when zoomed out.
|
|
69
|
+
* Text inside boxes keeps a readable minimum size and is shortened with an ellipsis;
|
|
70
|
+
* it is hidden only when the box is too small for any text, or with `false`
|
|
71
|
+
* @default "auto"
|
|
72
|
+
*/
|
|
73
|
+
nodeLabels?: boolean | "auto";
|
|
74
|
+
/**
|
|
75
|
+
* Edge labels: always, `auto` (zoomed in or highlighted), only `hover`, or never
|
|
76
|
+
* @default "auto"
|
|
77
|
+
*/
|
|
78
|
+
edgeLabels?: boolean | "auto" | "hover";
|
|
79
|
+
/** What hovering / selecting a node highlights */
|
|
80
|
+
highlight?: "neighbors" | "lineage" | "none";
|
|
81
|
+
/** Ids of the selected nodes (changing it updates the selection) */
|
|
82
|
+
selected?: readonly string[];
|
|
83
|
+
/**
|
|
84
|
+
* Animates layout and data changes; a number is the duration in ms
|
|
85
|
+
* @default true
|
|
86
|
+
*/
|
|
87
|
+
animation?: boolean | number;
|
|
88
|
+
/**
|
|
89
|
+
* Padding around the graph when fitting it, in CSS pixels
|
|
90
|
+
* @default 24
|
|
91
|
+
*/
|
|
92
|
+
fitPadding?: number;
|
|
93
|
+
/**
|
|
94
|
+
* Zoom buttons (zoom in, zoom out, fit)
|
|
95
|
+
* @default true
|
|
96
|
+
*/
|
|
97
|
+
controls?: boolean;
|
|
98
|
+
/** Legend of the groups; shown by default with several groups */
|
|
99
|
+
legend?: boolean | GraphLegendOptions;
|
|
100
|
+
/** Tooltip; `false` disables it */
|
|
101
|
+
tooltip?: boolean | GraphTooltipOptions;
|
|
102
|
+
/**
|
|
103
|
+
* Drag pans, Ctrl / ⌘ + wheel and pinch zoom, nodes can be dragged
|
|
104
|
+
* (force, circular), click selects, arrow keys move between nodes;
|
|
105
|
+
* `false` makes the chart static
|
|
106
|
+
* @default true
|
|
107
|
+
*/
|
|
108
|
+
interaction?: boolean | GraphInteractionOptions;
|
|
109
|
+
/**
|
|
110
|
+
* Backend of the nodes and edges: `auto` tries WebGPU, then WebGL2, then
|
|
111
|
+
* WebGL, then Canvas2D, skipping GPUs running in software
|
|
112
|
+
* @default "auto"
|
|
113
|
+
*/
|
|
114
|
+
renderer?: ChartRendererPreference;
|
|
115
|
+
/** Group colors (defaults to the `--chart-series-1..8` CSS variables, then the theme colors) */
|
|
116
|
+
palette?: readonly string[];
|
|
117
|
+
/** Accessible name of the chart */
|
|
118
|
+
ariaLabel?: string;
|
|
119
|
+
/**
|
|
120
|
+
* Language of the built-in texts (summary, announcements, tooltip,
|
|
121
|
+
* buttons); built-in texts in English, Chinese, Japanese and French
|
|
122
|
+
* @default the page language (`<html lang>`), then the browser language
|
|
123
|
+
*/
|
|
124
|
+
locale?: string;
|
|
125
|
+
/** Overrides of the built-in texts of the `locale` */
|
|
126
|
+
labels?: Partial<GraphChartLabels>;
|
|
127
|
+
/** Called when the hovered (or keyboard-focused) node / edge changes */
|
|
128
|
+
onHover?: (event: GraphHoverEvent | null) => void;
|
|
129
|
+
/** Called when a node or an edge is clicked (or a node activated with Enter) */
|
|
130
|
+
onItemClick?: (event: GraphHoverEvent) => void;
|
|
131
|
+
/** Called with the ids of the selected nodes when the selection changes */
|
|
132
|
+
onSelectionChange?: (ids: string[]) => void;
|
|
133
|
+
/** Called when a tree node is collapsed or expanded */
|
|
134
|
+
onToggle?: (event: GraphToggleEvent) => void;
|
|
135
|
+
/** Called when the legend shows / hides a group */
|
|
136
|
+
onGroupToggle?: (event: GraphGroupToggleEvent) => void;
|
|
137
|
+
/** Called when the layout is done (the force simulation cooled down) */
|
|
138
|
+
onLayoutEnd?: (event: GraphLayoutEndEvent) => void;
|
|
139
|
+
/** Called with the backend once it is ready (and after a fallback) */
|
|
140
|
+
onRendererChange?: (renderer: ChartRendererKind) => void;
|
|
141
|
+
/** Class of the outer element */
|
|
142
|
+
className?: string;
|
|
143
|
+
/** Style of the outer element */
|
|
144
|
+
style?: CSSProperties;
|
|
145
|
+
/** Imperative handle */
|
|
146
|
+
ref?: Ref<GraphChartHandle>;
|
|
147
|
+
}
|
|
148
|
+
/** Props of `GraphChart` */
|
|
149
|
+
export interface GraphChartProps extends GraphCommonProps {
|
|
150
|
+
/**
|
|
151
|
+
* Placement of the nodes
|
|
152
|
+
* @default "force"
|
|
153
|
+
*/
|
|
154
|
+
layout?: GraphLayoutType;
|
|
155
|
+
/** Direction of the `dag` and `tree` layouts */
|
|
156
|
+
direction?: GraphDirection;
|
|
157
|
+
/** Force layout settings (Barnes–Hut, worker for large graphs) */
|
|
158
|
+
force?: GraphForceOptions;
|
|
159
|
+
/** Circular / arc layout settings */
|
|
160
|
+
circular?: GraphCircularOptions;
|
|
161
|
+
/** Layered layout settings (`layout="dag"`) */
|
|
162
|
+
dag?: GraphDagOptions;
|
|
163
|
+
/** Tree layout settings (tree layouts) */
|
|
164
|
+
tree?: GraphTreeOptions;
|
|
165
|
+
}
|
|
166
|
+
/** Props of `DependencyGraph` */
|
|
167
|
+
export interface DependencyGraphProps extends GraphCommonProps {
|
|
168
|
+
/**
|
|
169
|
+
* Flow direction
|
|
170
|
+
* @default "TB"
|
|
171
|
+
*/
|
|
172
|
+
direction?: GraphDirection;
|
|
173
|
+
/** Layer / node spacing, crossing reduction sweeps */
|
|
174
|
+
dag?: GraphDagOptions;
|
|
175
|
+
/**
|
|
176
|
+
* Highlights the longest path (node `value` = duration); `true` computes it, a list of ids sets it
|
|
177
|
+
* @default false
|
|
178
|
+
*/
|
|
179
|
+
criticalPath?: boolean | readonly string[];
|
|
180
|
+
}
|
|
181
|
+
/** Props of `TreeChart` */
|
|
182
|
+
export interface TreeChartProps extends GraphCommonProps {
|
|
183
|
+
/**
|
|
184
|
+
* Kind of tree: tidy tree, radial tree, two-sided mind map or org chart
|
|
185
|
+
* @default "tree"
|
|
186
|
+
*/
|
|
187
|
+
layout?: "tree" | "radial" | "mindmap" | "org";
|
|
188
|
+
/**
|
|
189
|
+
* Direction of `layout="tree"`
|
|
190
|
+
* @default "LR"
|
|
191
|
+
*/
|
|
192
|
+
direction?: GraphDirection;
|
|
193
|
+
/** Root, spacing, collapsing, card size */
|
|
194
|
+
tree?: GraphTreeOptions;
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Relationship network (关系图): force-directed by default (Barnes–Hut,
|
|
198
|
+
* a Web Worker for large graphs), or circular, arc diagram, layered or
|
|
199
|
+
* tree layouts; GPU rendering, pan / zoom, drag, neighbor highlight,
|
|
200
|
+
* legend toggles and keyboard navigation.
|
|
201
|
+
*/
|
|
202
|
+
export declare function GraphChart(props: GraphChartProps): import('react').JSX.Element;
|
|
203
|
+
/**
|
|
204
|
+
* Dependency graph (依赖图): layered (Sugiyama) layout of a DAG with
|
|
205
|
+
* crossing reduction, spline or orthogonal edges with arrowheads,
|
|
206
|
+
* upstream / downstream highlight and the critical path.
|
|
207
|
+
*/
|
|
208
|
+
export declare function DependencyGraph(props: DependencyGraphProps): import('react').JSX.Element;
|
|
209
|
+
/**
|
|
210
|
+
* Tree chart (树图): tidy tree, radial tree, mind map or org chart, with
|
|
211
|
+
* animated collapse / expand of the subtrees.
|
|
212
|
+
*/
|
|
213
|
+
export declare function TreeChart(props: TreeChartProps): import('react').JSX.Element;
|