minerva-design 1.1.0 → 1.3.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 +15 -0
- package/dist/charts/canvas.d.cts +10 -0
- package/dist/charts/canvas.d.ts +10 -0
- package/dist/charts/core.cjs +1 -1
- package/dist/charts/core.d.cts +8 -1
- package/dist/charts/core.d.ts +8 -1
- package/dist/charts/core.js +6 -1
- package/dist/charts/engine/canvas.cjs +2 -0
- package/dist/charts/engine/canvas.cjs.map +1 -0
- package/dist/charts/engine/canvas.d.cts +85 -0
- package/dist/charts/engine/canvas.d.ts +85 -0
- package/dist/charts/engine/canvas.js +177 -0
- package/dist/charts/engine/canvas.js.map +1 -0
- package/dist/charts/engine/chart.cjs +1 -2
- package/dist/charts/engine/chart.cjs.map +1 -1
- package/dist/charts/engine/chart.js +450 -489
- 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 +27 -0
- package/dist/charts/engine/color.d.ts +27 -0
- package/dist/charts/engine/color.js +100 -4
- package/dist/charts/engine/color.js.map +1 -1
- package/dist/charts/engine/controller.cjs +3 -0
- package/dist/charts/engine/controller.cjs.map +1 -0
- package/dist/charts/engine/controller.d.cts +188 -0
- package/dist/charts/engine/controller.d.ts +188 -0
- package/dist/charts/engine/controller.js +592 -0
- package/dist/charts/engine/controller.js.map +1 -0
- package/dist/charts/engine/curve.cjs +2 -0
- package/dist/charts/engine/curve.cjs.map +1 -0
- package/dist/charts/engine/curve.d.cts +15 -0
- package/dist/charts/engine/curve.d.ts +15 -0
- package/dist/charts/engine/curve.js +56 -0
- package/dist/charts/engine/curve.js.map +1 -0
- package/dist/charts/engine/data.cjs +1 -1
- package/dist/charts/engine/data.cjs.map +1 -1
- package/dist/charts/engine/data.d.cts +15 -2
- package/dist/charts/engine/data.d.ts +15 -2
- package/dist/charts/engine/data.js +98 -38
- package/dist/charts/engine/data.js.map +1 -1
- package/dist/charts/engine/dom.cjs +1 -1
- package/dist/charts/engine/dom.cjs.map +1 -1
- package/dist/charts/engine/dom.d.cts +5 -3
- package/dist/charts/engine/dom.d.ts +5 -3
- package/dist/charts/engine/dom.js +27 -22
- package/dist/charts/engine/dom.js.map +1 -1
- package/dist/charts/engine/items.cjs +1 -1
- package/dist/charts/engine/items.cjs.map +1 -1
- package/dist/charts/engine/items.js +132 -61
- package/dist/charts/engine/items.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 +32 -5
- package/dist/charts/engine/model.d.ts +32 -5
- package/dist/charts/engine/model.js +226 -109
- package/dist/charts/engine/model.js.map +1 -1
- package/dist/charts/engine/overlay.cjs +1 -1
- package/dist/charts/engine/overlay.cjs.map +1 -1
- package/dist/charts/engine/overlay.d.cts +19 -1
- package/dist/charts/engine/overlay.d.ts +19 -1
- package/dist/charts/engine/overlay.js +77 -63
- package/dist/charts/engine/overlay.js.map +1 -1
- package/dist/charts/engine/presets.cjs +3 -0
- package/dist/charts/engine/presets.cjs.map +1 -0
- package/dist/charts/engine/presets.d.cts +169 -0
- package/dist/charts/engine/presets.d.ts +169 -0
- package/dist/charts/engine/presets.js +240 -0
- package/dist/charts/engine/presets.js.map +1 -0
- package/dist/charts/engine/renderers/canvas2d.cjs +1 -1
- package/dist/charts/engine/renderers/canvas2d.cjs.map +1 -1
- package/dist/charts/engine/renderers/canvas2d.d.cts +17 -1
- package/dist/charts/engine/renderers/canvas2d.d.ts +17 -1
- package/dist/charts/engine/renderers/canvas2d.js +176 -101
- package/dist/charts/engine/renderers/canvas2d.js.map +1 -1
- package/dist/charts/engine/renderers/range.cjs +1 -1
- package/dist/charts/engine/renderers/range.cjs.map +1 -1
- package/dist/charts/engine/renderers/range.js +4 -4
- package/dist/charts/engine/renderers/range.js.map +1 -1
- package/dist/charts/engine/renderers/shaders.cjs +37 -19
- package/dist/charts/engine/renderers/shaders.cjs.map +1 -1
- package/dist/charts/engine/renderers/shaders.d.cts +2 -2
- package/dist/charts/engine/renderers/shaders.d.ts +2 -2
- package/dist/charts/engine/renderers/shaders.js +37 -19
- package/dist/charts/engine/renderers/shaders.js.map +1 -1
- package/dist/charts/engine/renderers/types.cjs.map +1 -1
- package/dist/charts/engine/renderers/types.d.cts +11 -4
- package/dist/charts/engine/renderers/types.d.ts +11 -4
- package/dist/charts/engine/renderers/types.js.map +1 -1
- package/dist/charts/engine/renderers/webgl2.cjs +1 -1
- package/dist/charts/engine/renderers/webgl2.cjs.map +1 -1
- package/dist/charts/engine/renderers/webgl2.js +33 -12
- package/dist/charts/engine/renderers/webgl2.js.map +1 -1
- package/dist/charts/engine/renderers/webgpu.cjs +1 -1
- package/dist/charts/engine/renderers/webgpu.cjs.map +1 -1
- package/dist/charts/engine/renderers/webgpu.js +18 -15
- package/dist/charts/engine/renderers/webgpu.js.map +1 -1
- package/dist/charts/engine/scene.cjs +2 -0
- package/dist/charts/engine/scene.cjs.map +1 -0
- package/dist/charts/engine/scene.d.cts +102 -0
- package/dist/charts/engine/scene.d.ts +102 -0
- package/dist/charts/engine/scene.js +353 -0
- package/dist/charts/engine/scene.js.map +1 -0
- package/dist/charts/engine/shapes/canvas.cjs +2 -0
- package/dist/charts/engine/shapes/canvas.cjs.map +1 -0
- package/dist/charts/engine/shapes/canvas.d.cts +58 -0
- package/dist/charts/engine/shapes/canvas.d.ts +58 -0
- package/dist/charts/engine/shapes/canvas.js +159 -0
- package/dist/charts/engine/shapes/canvas.js.map +1 -0
- package/dist/charts/engine/shapes/chart.cjs +2 -0
- package/dist/charts/engine/shapes/chart.cjs.map +1 -0
- package/dist/charts/engine/shapes/chart.d.cts +6 -0
- package/dist/charts/engine/shapes/chart.d.ts +6 -0
- package/dist/charts/engine/shapes/chart.js +273 -0
- package/dist/charts/engine/shapes/chart.js.map +1 -0
- package/dist/charts/engine/shapes/draw.cjs +2 -0
- package/dist/charts/engine/shapes/draw.cjs.map +1 -0
- package/dist/charts/engine/shapes/draw.d.cts +20 -0
- package/dist/charts/engine/shapes/draw.d.ts +20 -0
- package/dist/charts/engine/shapes/draw.js +152 -0
- package/dist/charts/engine/shapes/draw.js.map +1 -0
- package/dist/charts/engine/shapes/funnel.cjs +2 -0
- package/dist/charts/engine/shapes/funnel.cjs.map +1 -0
- package/dist/charts/engine/shapes/funnel.d.cts +6 -0
- package/dist/charts/engine/shapes/funnel.d.ts +6 -0
- package/dist/charts/engine/shapes/funnel.js +149 -0
- package/dist/charts/engine/shapes/funnel.js.map +1 -0
- package/dist/charts/engine/shapes/gauge.cjs +2 -0
- package/dist/charts/engine/shapes/gauge.cjs.map +1 -0
- package/dist/charts/engine/shapes/gauge.d.cts +7 -0
- package/dist/charts/engine/shapes/gauge.d.ts +7 -0
- package/dist/charts/engine/shapes/gauge.js +173 -0
- package/dist/charts/engine/shapes/gauge.js.map +1 -0
- package/dist/charts/engine/shapes/hit.cjs +2 -0
- package/dist/charts/engine/shapes/hit.cjs.map +1 -0
- package/dist/charts/engine/shapes/hit.d.cts +28 -0
- package/dist/charts/engine/shapes/hit.d.ts +28 -0
- package/dist/charts/engine/shapes/hit.js +124 -0
- package/dist/charts/engine/shapes/hit.js.map +1 -0
- package/dist/charts/engine/shapes/index.d.cts +9 -0
- package/dist/charts/engine/shapes/index.d.ts +9 -0
- package/dist/charts/engine/shapes/layout.cjs +3 -0
- package/dist/charts/engine/shapes/layout.cjs.map +1 -0
- package/dist/charts/engine/shapes/layout.d.cts +88 -0
- package/dist/charts/engine/shapes/layout.d.ts +88 -0
- package/dist/charts/engine/shapes/layout.js +266 -0
- package/dist/charts/engine/shapes/layout.js.map +1 -0
- package/dist/charts/engine/shapes/pie.cjs +2 -0
- package/dist/charts/engine/shapes/pie.cjs.map +1 -0
- package/dist/charts/engine/shapes/pie.d.cts +20 -0
- package/dist/charts/engine/shapes/pie.d.ts +20 -0
- package/dist/charts/engine/shapes/pie.js +302 -0
- package/dist/charts/engine/shapes/pie.js.map +1 -0
- package/dist/charts/engine/shapes/radar.cjs +2 -0
- package/dist/charts/engine/shapes/radar.cjs.map +1 -0
- package/dist/charts/engine/shapes/radar.d.cts +8 -0
- package/dist/charts/engine/shapes/radar.d.ts +8 -0
- package/dist/charts/engine/shapes/radar.js +197 -0
- package/dist/charts/engine/shapes/radar.js.map +1 -0
- package/dist/charts/engine/shapes/runtime.cjs +2 -0
- package/dist/charts/engine/shapes/runtime.cjs.map +1 -0
- package/dist/charts/engine/shapes/runtime.d.cts +29 -0
- package/dist/charts/engine/shapes/runtime.d.ts +29 -0
- package/dist/charts/engine/shapes/runtime.js +97 -0
- package/dist/charts/engine/shapes/runtime.js.map +1 -0
- package/dist/charts/engine/shapes/scene.cjs +2 -0
- package/dist/charts/engine/shapes/scene.cjs.map +1 -0
- package/dist/charts/engine/shapes/scene.d.cts +257 -0
- package/dist/charts/engine/shapes/scene.d.ts +257 -0
- package/dist/charts/engine/shapes/scene.js +123 -0
- package/dist/charts/engine/shapes/scene.js.map +1 -0
- package/dist/charts/engine/shapes/treemap.cjs +2 -0
- package/dist/charts/engine/shapes/treemap.cjs.map +1 -0
- package/dist/charts/engine/shapes/treemap.d.cts +14 -0
- package/dist/charts/engine/shapes/treemap.d.ts +14 -0
- package/dist/charts/engine/shapes/treemap.js +213 -0
- package/dist/charts/engine/shapes/treemap.js.map +1 -0
- package/dist/charts/engine/shapes/types.d.cts +292 -0
- package/dist/charts/engine/shapes/types.d.ts +292 -0
- package/dist/charts/engine/signature.cjs +2 -0
- package/dist/charts/engine/signature.cjs.map +1 -0
- package/dist/charts/engine/signature.d.cts +9 -0
- package/dist/charts/engine/signature.d.ts +9 -0
- package/dist/charts/engine/signature.js +13 -0
- package/dist/charts/engine/signature.js.map +1 -0
- package/dist/charts/engine/theme.cjs +1 -1
- package/dist/charts/engine/theme.cjs.map +1 -1
- package/dist/charts/engine/theme.d.cts +35 -2
- package/dist/charts/engine/theme.d.ts +35 -2
- package/dist/charts/engine/theme.js +66 -26
- package/dist/charts/engine/theme.js.map +1 -1
- package/dist/charts/engine/types.d.cts +139 -11
- package/dist/charts/engine/types.d.ts +139 -11
- package/dist/charts/index.cjs +1 -1
- package/dist/charts/index.d.cts +4 -2
- package/dist/charts/index.d.ts +4 -2
- package/dist/charts/index.js +8 -2
- package/dist/charts/react/Chart.cjs +1 -1
- package/dist/charts/react/Chart.cjs.map +1 -1
- package/dist/charts/react/Chart.d.cts +18 -4
- package/dist/charts/react/Chart.d.ts +18 -4
- package/dist/charts/react/Chart.js +102 -41
- package/dist/charts/react/Chart.js.map +1 -1
- package/dist/charts/react/charts.cjs +1 -1
- package/dist/charts/react/charts.cjs.map +1 -1
- package/dist/charts/react/charts.d.cts +11 -3
- package/dist/charts/react/charts.d.ts +11 -3
- package/dist/charts/react/charts.js +221 -144
- package/dist/charts/react/charts.js.map +1 -1
- package/dist/charts/react/shapes.cjs +2 -0
- package/dist/charts/react/shapes.cjs.map +1 -0
- package/dist/charts/react/shapes.d.cts +255 -0
- package/dist/charts/react/shapes.d.ts +255 -0
- package/dist/charts/react/shapes.js +242 -0
- package/dist/charts/react/shapes.js.map +1 -0
- package/dist/charts/react/types.d.cts +100 -63
- package/dist/charts/react/types.d.ts +100 -63
- package/dist/native/charts/src/canvas.cjs +1 -0
- package/dist/native/charts/src/canvas.js +6 -0
- package/dist/native/charts/src/engine/axis.cjs +2 -0
- package/dist/native/charts/src/engine/axis.cjs.map +1 -0
- package/dist/native/charts/src/engine/axis.js +38 -0
- package/dist/native/charts/src/engine/axis.js.map +1 -0
- package/dist/native/charts/src/engine/canvas.cjs +1 -0
- package/dist/native/charts/src/engine/canvas.js +1 -0
- package/dist/native/charts/src/engine/color.cjs +2 -0
- package/dist/native/charts/src/engine/color.cjs.map +1 -0
- package/dist/native/charts/src/engine/color.js +139 -0
- package/dist/native/charts/src/engine/color.js.map +1 -0
- package/dist/native/charts/src/engine/controller.cjs +3 -0
- package/dist/native/charts/src/engine/controller.cjs.map +1 -0
- package/dist/native/charts/src/engine/controller.js +592 -0
- package/dist/native/charts/src/engine/controller.js.map +1 -0
- package/dist/native/charts/src/engine/curve.cjs +2 -0
- package/dist/native/charts/src/engine/curve.cjs.map +1 -0
- package/dist/native/charts/src/engine/curve.js +56 -0
- package/dist/native/charts/src/engine/curve.js.map +1 -0
- package/dist/native/charts/src/engine/data.cjs +2 -0
- package/dist/native/charts/src/engine/data.cjs.map +1 -0
- package/dist/native/charts/src/engine/data.js +164 -0
- package/dist/native/charts/src/engine/data.js.map +1 -0
- package/dist/native/charts/src/engine/decimate.cjs +2 -0
- package/dist/native/charts/src/engine/decimate.cjs.map +1 -0
- package/dist/native/charts/src/engine/decimate.js +28 -0
- package/dist/native/charts/src/engine/decimate.js.map +1 -0
- package/dist/native/charts/src/engine/format.cjs +2 -0
- package/dist/native/charts/src/engine/format.cjs.map +1 -0
- package/dist/native/charts/src/engine/format.js +34 -0
- package/dist/native/charts/src/engine/format.js.map +1 -0
- package/dist/native/charts/src/engine/layout.cjs +2 -0
- package/dist/native/charts/src/engine/layout.cjs.map +1 -0
- package/dist/native/charts/src/engine/layout.js +26 -0
- package/dist/native/charts/src/engine/layout.js.map +1 -0
- package/dist/native/charts/src/engine/model.cjs +2 -0
- package/dist/native/charts/src/engine/model.cjs.map +1 -0
- package/dist/native/charts/src/engine/model.js +292 -0
- package/dist/native/charts/src/engine/model.js.map +1 -0
- package/dist/native/charts/src/engine/overlay.cjs +2 -0
- package/dist/native/charts/src/engine/overlay.cjs.map +1 -0
- package/dist/native/charts/src/engine/overlay.js +49 -0
- package/dist/native/charts/src/engine/overlay.js.map +1 -0
- package/dist/native/charts/src/engine/presets.cjs +3 -0
- package/dist/native/charts/src/engine/presets.cjs.map +1 -0
- package/dist/native/charts/src/engine/presets.js +154 -0
- package/dist/native/charts/src/engine/presets.js.map +1 -0
- package/dist/native/charts/src/engine/scale.cjs +2 -0
- package/dist/native/charts/src/engine/scale.cjs.map +1 -0
- package/dist/native/charts/src/engine/scale.js +37 -0
- package/dist/native/charts/src/engine/scale.js.map +1 -0
- package/dist/native/charts/src/engine/scene.cjs +2 -0
- package/dist/native/charts/src/engine/scene.cjs.map +1 -0
- package/dist/native/charts/src/engine/scene.js +353 -0
- package/dist/native/charts/src/engine/scene.js.map +1 -0
- package/dist/native/charts/src/engine/spatial.cjs +2 -0
- package/dist/native/charts/src/engine/spatial.cjs.map +1 -0
- package/dist/native/charts/src/engine/spatial.js +53 -0
- package/dist/native/charts/src/engine/spatial.js.map +1 -0
- package/dist/native/charts/src/engine/theme.cjs +2 -0
- package/dist/native/charts/src/engine/theme.cjs.map +1 -0
- package/dist/native/charts/src/engine/theme.js +62 -0
- package/dist/native/charts/src/engine/theme.js.map +1 -0
- package/dist/native/charts/src/engine/time.cjs +2 -0
- package/dist/native/charts/src/engine/time.cjs.map +1 -0
- package/dist/native/charts/src/engine/time.js +189 -0
- package/dist/native/charts/src/engine/time.js.map +1 -0
- package/dist/native/charts/src/engine/viewport.cjs +2 -0
- package/dist/native/charts/src/engine/viewport.cjs.map +1 -0
- package/dist/native/charts/src/engine/viewport.js +12 -0
- package/dist/native/charts/src/engine/viewport.js.map +1 -0
- package/dist/native/components/Chart/ChartBase.cjs +2 -0
- package/dist/native/components/Chart/ChartBase.cjs.map +1 -0
- package/dist/native/components/Chart/ChartBase.d.cts +29 -0
- package/dist/native/components/Chart/ChartBase.d.ts +29 -0
- package/dist/native/components/Chart/ChartBase.js +287 -0
- package/dist/native/components/Chart/ChartBase.js.map +1 -0
- package/dist/native/components/Chart/charts.cjs +2 -0
- package/dist/native/components/Chart/charts.cjs.map +1 -0
- package/dist/native/components/Chart/charts.d.cts +19 -0
- package/dist/native/components/Chart/charts.d.ts +19 -0
- package/dist/native/components/Chart/charts.js +173 -0
- package/dist/native/components/Chart/charts.js.map +1 -0
- package/dist/native/components/Chart/index.cjs +1 -0
- package/dist/native/components/Chart/index.d.cts +2 -0
- package/dist/native/components/Chart/index.d.ts +2 -0
- package/dist/native/components/Chart/index.js +2 -0
- package/dist/native/components/Chart/measure.cjs +2 -0
- package/dist/native/components/Chart/measure.cjs.map +1 -0
- package/dist/native/components/Chart/measure.d.cts +5 -0
- package/dist/native/components/Chart/measure.d.ts +5 -0
- package/dist/native/components/Chart/measure.js +11 -0
- package/dist/native/components/Chart/measure.js.map +1 -0
- package/dist/native/components/Chart/scene.cjs +2 -0
- package/dist/native/components/Chart/scene.cjs.map +1 -0
- package/dist/native/components/Chart/scene.d.cts +41 -0
- package/dist/native/components/Chart/scene.d.ts +41 -0
- package/dist/native/components/Chart/scene.js +431 -0
- package/dist/native/components/Chart/scene.js.map +1 -0
- package/dist/native/components/Chart/theme.cjs +2 -0
- package/dist/native/components/Chart/theme.cjs.map +1 -0
- package/dist/native/components/Chart/theme.d.cts +10 -0
- package/dist/native/components/Chart/theme.d.ts +10 -0
- package/dist/native/components/Chart/theme.js +10 -0
- package/dist/native/components/Chart/theme.js.map +1 -0
- package/dist/native/components/Chart/types.d.cts +129 -0
- package/dist/native/components/Chart/types.d.ts +129 -0
- package/dist/native/index.cjs +1 -1
- package/dist/native/index.d.cts +1 -0
- package/dist/native/index.d.ts +1 -0
- package/dist/native/index.js +6 -4
- package/dist/native/manifest.d.cts +7 -0
- package/dist/native/manifest.d.ts +7 -0
- package/dist/native/source/components/Chart/ChartBase.tsx +545 -0
- package/dist/native/source/components/Chart/charts.tsx +291 -0
- package/dist/native/source/components/Chart/index.ts +8 -0
- package/dist/native/source/components/Chart/measure.ts +50 -0
- package/dist/native/source/components/Chart/scene.tsx +1021 -0
- package/dist/native/source/components/Chart/theme.ts +16 -0
- package/dist/native/source/components/Chart/types.ts +194 -0
- package/dist/native/source/index.ts +1 -0
- package/dist/native/source/manifest.ts +14 -0
- package/dist/taro/charts.d.ts +144 -0
- package/dist/taro/index.d.ts +1 -0
- package/dist/taro/index.js +3544 -618
- package/dist/uni/BarChart.vue +75 -0
- package/dist/uni/BarChart.vue.d.ts +111 -0
- package/dist/uni/Chart.vue +68 -0
- package/dist/uni/Chart.vue.d.ts +100 -0
- package/dist/uni/LineChart.vue +75 -0
- package/dist/uni/LineChart.vue.d.ts +111 -0
- package/dist/uni/ProgressIndicator.vue.d.ts +1 -1
- package/dist/uni/QuadrantChart.vue +184 -0
- package/dist/uni/QuadrantChart.vue.d.ts +173 -0
- package/dist/uni/ScatterChart.vue +69 -0
- package/dist/uni/ScatterChart.vue.d.ts +100 -0
- package/dist/uni/chart-canvas.d.ts +68 -0
- package/dist/uni/chart-canvas.js +363 -0
- package/dist/uni/chart-types.d.ts +135 -0
- package/dist/uni/chart-types.js +84 -0
- package/dist/uni/charts-canvas.d.ts +1 -0
- package/dist/uni/charts-canvas.js +10 -0
- package/dist/uni/index.d.ts +6 -0
- package/dist/uni/index.js +6 -0
- package/dist/weapp/bar-chart/index.js +1 -0
- package/dist/weapp/bar-chart/index.json +1 -0
- package/dist/weapp/bar-chart/index.wxml +1 -0
- package/dist/weapp/bar-chart/index.wxss +1 -0
- package/dist/weapp/chart/index.js +1 -0
- package/dist/weapp/chart/index.json +1 -0
- package/dist/weapp/chart/index.wxml +1 -0
- package/dist/weapp/chart/index.wxss +1 -0
- package/dist/weapp/controls.js +4760 -266
- package/dist/weapp/line-chart/index.js +1 -0
- package/dist/weapp/line-chart/index.json +1 -0
- package/dist/weapp/line-chart/index.wxml +1 -0
- package/dist/weapp/line-chart/index.wxss +1 -0
- package/dist/weapp/quadrant-chart/index.js +1 -0
- package/dist/weapp/quadrant-chart/index.json +1 -0
- package/dist/weapp/quadrant-chart/index.wxml +1 -0
- package/dist/weapp/quadrant-chart/index.wxss +1 -0
- package/dist/weapp/scatter-chart/index.js +1 -0
- package/dist/weapp/scatter-chart/index.json +1 -0
- package/dist/weapp/scatter-chart/index.wxml +1 -0
- package/dist/weapp/scatter-chart/index.wxss +1 -0
- package/dist/weapp/types.d.ts +295 -0
- package/package.json +21 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scene.cjs","names":["mix","axisTicks","computePlot","createScales","formatValue","plottedY","nearestIndex","toCss","unpackColor","require_data","require_color","require_layout","require_model","require_format","require_axis","DEFAULT_PADDING","fallbackResolve","fallback","resolveAnnotations","resolve","theme","annotations","a","color","layoutChart","input","yCount","model","height","yTicks","view","yLabelWidth","label","measure","categoryWidth","step","i","padding","plot","xCount","xTicks","collectPointLabels","labels","axisFormat","series","format","top","x0","x1","count","xv","x","y","negative","s","texts","text","xi","yi","d","size","pointOf","sc","candidateOf","p","inside","half","base","px","py","high","b","low","dotSize","nearestScatter","radius","slop","yv","rx","ry","best","bestDist","cellAt","hx","hy","found","nearestX","sorted","bestD","hoverItemOf","pc","index","extra","o","open","v","value","packed","eventOf","candidates","items","c","hitTest","margin","scatter","others","all","bestDx","bandPx","aligned","first","event","sameHover","it","tooltipContent","yFormat","firstSeries","yName","rows","rowOf","change","ohlc","name","totals","stack","stackIdOf","total","row","k","seriesIndex","hoverMarks","marks","bandLo","bandHi","cx","cy","hw","hh","rgba","pad","legendShape","type","showsCrosshair","crosshair"],"sources":["../../../../charts/src/engine/scene.ts"],"sourcesContent":["// The DOM-free half of a chart: annotations, layout, point labels, hit\n// testing and tooltip content. Shared by createChart (DOM + GPU),\n// createCanvasChart (any 2D context) and the React Native views.\n\nimport { axisTicks, type AxisTicks } from \"./axis\";\nimport { mix, toCss, unpackColor, type Rgba } from \"./color\";\nimport { nearestIndex } from \"./data\";\nimport { formatValue } from \"./format\";\nimport { computePlot, createScales, type Rect, type Scales } from \"./layout\";\nimport { gridOf, plottedY, type ChartModel, type SeriesModel } from \"./model\";\nimport type { PointLabel, ResolvedAnnotation } from \"./overlay\";\nimport type { ChartTheme } from \"./theme\";\nimport type {\n ChartAnnotation,\n ChartHoverEvent,\n ChartHoverItem,\n ChartPadding,\n ChartView,\n} from \"./types\";\n\nexport const MAX_POINT_LABELS = 300;\nexport const DEFAULT_PADDING = { top: 12, right: 16, bottom: 4, left: 4 };\n\nexport const fallbackResolve = (_value: string, fallback: Rgba) => fallback;\n\n/** Annotation colors resolved against the theme */\nexport const resolveAnnotations = (\n annotations: readonly ChartAnnotation[] | undefined,\n theme: ChartTheme,\n): ResolvedAnnotation[] => {\n const resolve = theme.resolve ?? fallbackResolve;\n return (annotations ?? []).map((a) => {\n if (a.type === \"rect\") {\n const color = a.color ? resolve(a.color, theme.primary) : theme.primary;\n return {\n type: \"rect\",\n x0: a.x0,\n x1: a.x1,\n y0: a.y0,\n y1: a.y1,\n color,\n opacity: a.opacity ?? 0.08,\n label: a.label,\n labelPosition: a.labelPosition ?? \"top-left\",\n labelColor: a.labelColor\n ? resolve(a.labelColor, color)\n : mix(color, theme.text, 0.2),\n };\n }\n if (a.type === \"text\") {\n return {\n type: \"text\",\n x: a.x,\n y: a.y,\n text: a.text,\n anchor: a.anchor ?? \"center\",\n color: a.color ? resolve(a.color, theme.textMuted) : theme.textMuted,\n weight: a.weight ?? 500,\n };\n }\n return {\n type: \"line\",\n axis: a.axis,\n value: a.value,\n color: a.color ? resolve(a.color, theme.textMuted) : theme.textMuted,\n width: a.width ?? 1,\n dash: [...(a.dash ?? [4, 4])],\n label: a.label,\n };\n });\n};\n\nexport interface ChartLayout {\n plot: Rect;\n scales: Scales;\n xTicks: AxisTicks;\n yTicks: AxisTicks;\n}\n\nexport interface LayoutInput {\n model: ChartModel;\n view: ChartView;\n theme: ChartTheme;\n /** Size of the drawing area (legend excluded), CSS pixels */\n width: number;\n height: number;\n padding?: ChartPadding;\n /** Offset of the drawing area (e.g. below a legend) */\n top?: number;\n /** Width of a tick label in the theme font */\n measure: (text: string) => number;\n}\n\n/** Ticks, room for the axes and the plot rectangle */\nexport const layoutChart = (input: LayoutInput): ChartLayout => {\n const { model, view, theme, width, height, measure } = input;\n // same count as the nice range of the model (its ends are then ticks),\n // fewer on short charts; category rows get a label each when they fit\n const yCount =\n model.y.tickCount ??\n (model.y.type === \"category\"\n ? Math.max(1, Math.floor((height - 40) / (theme.fontSize + 5)))\n : height >= 220\n ? 5\n : Math.max(2, Math.round((height - 48) / 52)));\n const yTicks = axisTicks(model.y, view.y, yCount);\n let yLabelWidth = 0;\n if (model.y.visible) {\n for (const label of yTicks.labels)\n yLabelWidth = Math.max(yLabelWidth, measure(label));\n }\n let categoryWidth = 48;\n if (model.x.type === \"category\") {\n categoryWidth = 0;\n const step = Math.max(1, Math.floor(model.x.categories.length / 200));\n for (let i = 0; i < model.x.categories.length; i += step) {\n categoryWidth = Math.max(categoryWidth, measure(model.x.categories[i]));\n }\n }\n const padding = { ...DEFAULT_PADDING, ...input.padding };\n const plot = computePlot({\n width,\n height,\n padding,\n yLabelWidth: model.y.visible ? Math.ceil(yLabelWidth) : 0,\n xAxisVisible: model.x.visible,\n xTitle: !!model.x.title && model.x.visible,\n yTitle: !!model.y.title && model.y.visible,\n fontSize: theme.fontSize,\n });\n if (input.top) plot.y += input.top;\n const xCount =\n model.x.type === \"category\"\n ? Math.max(1, Math.floor(plot.width / (categoryWidth + 14)))\n : (model.x.tickCount ?? Math.max(3, Math.floor(plot.width / 88)));\n const xTicks = axisTicks(model.x, view.x, xCount);\n const scales = createScales(plot, view, model.x.reverse, model.y.reverse);\n return { plot, scales, xTicks, yTicks };\n};\n\n/** Labels of the visible scatter points and bar values (`showLabels`) */\nexport const collectPointLabels = (\n model: ChartModel,\n view: ChartView,\n s: Scales,\n yTicks?: AxisTicks | null,\n): PointLabel[] => {\n const labels: PointLabel[] = [];\n // 100% stacks: the axis shows percents, the labels the actual values\n const axisFormat = model.percent\n ? formatValue\n : (yTicks?.formatValue ?? formatValue);\n for (const series of model.series) {\n if (series.hidden || !series.showLabels) continue;\n if (series.type === \"bar\" && series.barTop) {\n const format = series.format ?? axisFormat;\n const { x, y, count } = series.cols;\n const top = series.barTop;\n const [x0, x1] = view.x[0] <= view.x[1] ? view.x : [view.x[1], view.x[0]];\n for (let i = 0; i < count && labels.length < MAX_POINT_LABELS; i++) {\n const xv = x[i] + series.barOffset;\n if (!Number.isFinite(y[i]) || xv < x0 || xv > x1) continue;\n const negative = top[i] < (series.barBase?.[i] ?? 0);\n labels.push({\n x: s.xToPx(xv),\n y: s.yToPx(top[i]),\n r: 0,\n text: format(y[i]),\n placement: negative ? \"below\" : \"above\",\n });\n }\n continue;\n }\n if (series.type !== \"scatter\") continue;\n const { x, y, count, labels: texts, size } = series.cols;\n if (!texts) continue;\n for (let i = 0; i < count && labels.length < MAX_POINT_LABELS; i++) {\n const text = texts[i];\n if (!text) continue;\n const xi = x[i];\n const yi = y[i];\n if (xi < view.x[0] || xi > view.x[1] || yi < view.y[0] || yi > view.y[1])\n continue;\n const d = size && size[i] > 0 ? size[i] : series.pointSize;\n labels.push({ x: s.xToPx(xi), y: s.yToPx(yi), r: d / 2, text });\n }\n }\n return labels;\n};\n\n// ---------------------------------------------------------------- hit tests\n\ninterface Candidate {\n series: SeriesModel;\n index: number;\n /** Pixel position of the point */\n px: number;\n py: number;\n dx: number;\n dist: number;\n inside: boolean;\n}\n\n/** Pixel position of a point (the top of a bar or stack, the close of a candle) */\nexport const pointOf = (s: SeriesModel, i: number, sc: Scales) => {\n const xv = s.cols.x[i] + (s.type === \"bar\" ? s.barOffset : 0);\n return { px: sc.xToPx(xv), py: sc.yToPx(plottedY(s, i)) };\n};\n\nconst candidateOf = (\n s: SeriesModel,\n i: number,\n px: number,\n py: number,\n sc: Scales,\n): Candidate => {\n const p = pointOf(s, i, sc);\n let inside = false;\n if (s.type === \"bar\" && s.barBase) {\n const half = s.barHalfWidth / sc.xPerPx;\n const base = sc.yToPx(s.barBase[i]);\n inside =\n Math.abs(px - p.px) <= half &&\n py >= Math.min(base, p.py) - 2 &&\n py <= Math.max(base, p.py) + 2;\n } else if (s.type === \"candlestick\") {\n const { high, low, y } = s.cols;\n const half = Math.max(s.barHalfWidth / sc.xPerPx, 3);\n const a = sc.yToPx(high ? high[i] : y[i]);\n const b = sc.yToPx(low ? low[i] : y[i]);\n inside =\n Math.abs(px - p.px) <= half &&\n py >= Math.min(a, b) - 2 &&\n py <= Math.max(a, b) + 2;\n }\n return {\n series: s,\n index: i,\n px: p.px,\n py: p.py,\n dx: Math.abs(sc.xToPx(s.cols.x[i]) - px),\n dist: inside ? 0 : Math.hypot(p.px - px, p.py - py),\n inside,\n };\n};\n\n/** Diameter of a scatter dot */\nexport const dotSize = (s: SeriesModel, i: number) =>\n s.cols.size && s.cols.size[i] > 0 ? s.cols.size[i] : s.pointSize;\n\nconst nearestScatter = (\n s: SeriesModel,\n px: number,\n py: number,\n sc: Scales,\n slop: number,\n) => {\n const radius = Math.max(s.pointSize / 2 + 6, 10) + slop;\n const xv = sc.pxToX(px);\n const yv = sc.pxToY(py);\n const rx = radius * sc.xPerPx;\n const ry = radius * sc.yPerPx;\n let best = -1;\n let bestDist = Infinity;\n const { x, y } = s.cols;\n gridOf(s).query(xv - rx, xv + rx, yv - ry, yv + ry, (i) => {\n const d = Math.hypot(sc.xToPx(x[i]) - px, sc.yToPx(y[i]) - py);\n const reach = Math.max(dotSize(s, i) / 2 + 4, 8) + slop;\n if (d <= reach && d <= bestDist) {\n bestDist = d;\n best = i;\n }\n });\n return best;\n};\n\n/** Heatmap cell containing a data position, -1 if none */\nconst cellAt = (s: SeriesModel, xv: number, yv: number) => {\n const { x: hx, y: hy } = s.cellHalf;\n const { x, y } = s.cols;\n let found = -1;\n gridOf(s).query(xv - hx, xv + hx, yv - hy, yv + hy, (i) => {\n if (\n s.cellColors?.[i] &&\n Math.abs(x[i] - xv) <= hx &&\n Math.abs(y[i] - yv) <= hy\n ) {\n found = i;\n }\n });\n return found;\n};\n\nconst nearestX = (s: SeriesModel, xv: number) => {\n const { x, y, count, sorted } = s.cols;\n if (sorted) return nearestIndex(x, y, count, xv);\n let best = -1;\n let bestD = Infinity;\n for (let i = 0; i < count; i++) {\n if (!Number.isFinite(y[i])) continue;\n const d = Math.abs(x[i] - xv);\n if (d < bestD) {\n bestD = d;\n best = i;\n }\n }\n return best;\n};\n\n/** Hover payload item of a point */\nexport const hoverItemOf = (s: SeriesModel, index: number): ChartHoverItem => {\n const pc = s.pointColors?.[index];\n const label = s.cols.labels?.[index];\n const { open, high, low, value } = s.cols;\n let color = pc ? toCss(pc) : s.colorCss;\n const extra: Partial<ChartHoverItem> = {};\n if (s.type === \"candlestick\") {\n const o = open ? open[index] : NaN;\n if (Number.isFinite(o)) extra.open = o;\n if (high && Number.isFinite(high[index])) extra.high = high[index];\n if (low && Number.isFinite(low[index])) extra.low = low[index];\n color = toCss(s.cols.y[index] < o ? s.downColor : s.upColor);\n } else if (s.type === \"heatmap\") {\n const v = value ? value[index] : s.cols.y[index];\n if (Number.isFinite(v)) extra.value = v;\n const packed = s.cellColors?.[index];\n if (packed) color = toCss(unpackColor(packed));\n }\n return {\n seriesIndex: s.index,\n seriesId: s.id,\n seriesName: s.name,\n index,\n x: s.cols.x[index],\n y: s.cols.y[index],\n color,\n ...(label !== undefined ? { label } : {}),\n ...extra,\n };\n};\n\nconst eventOf = (\n candidates: Candidate[],\n xTicks: AxisTicks | null,\n): ChartHoverEvent | null => {\n if (!candidates.length) return null;\n candidates.sort((a, b) => a.series.index - b.series.index);\n const items = candidates.map((c) => hoverItemOf(c.series, c.index));\n const x = items[0].x;\n return { items, x, xLabel: xTicks?.formatValue(x) ?? String(x) };\n};\n\n/**\n * Points under a pixel of the stage: the nearest point (scatter / `nearest`\n * tooltips) or every series at the nearest x (`axis` tooltips).\n * `slop` widens the reach of the dots (touch screens).\n */\nexport const hitTest = (\n model: ChartModel,\n sc: Scales,\n xTicks: AxisTicks | null,\n px: number,\n py: number,\n slop = 0,\n): ChartHoverEvent | null => {\n const { plot } = sc;\n const margin = 6 + slop;\n if (\n px < plot.x - margin ||\n px > plot.x + plot.width + margin ||\n py < plot.y - margin ||\n py > plot.y + plot.height + margin\n ) {\n return null;\n }\n const xv = sc.pxToX(px);\n const scatter: Candidate[] = [];\n const others: Candidate[] = [];\n for (const s of model.series) {\n if (s.hidden || s.cols.count === 0) continue;\n if (s.type === \"scatter\") {\n const i = nearestScatter(s, px, py, sc, slop);\n if (i >= 0) scatter.push(candidateOf(s, i, px, py, sc));\n } else if (s.type === \"heatmap\") {\n const i = cellAt(s, sc.pxToX(px), sc.pxToY(py));\n if (i >= 0) {\n const c = candidateOf(s, i, px, py, sc);\n c.inside = true;\n c.dist = 0;\n scatter.push(c);\n }\n } else {\n const i = nearestX(s, xv);\n if (i >= 0) others.push(candidateOf(s, i, px, py, sc));\n }\n }\n if (model.tooltipMode === \"nearest\") {\n const all = [...scatter, ...others].filter(\n (c) => c.inside || c.series.type === \"scatter\" || c.dist <= 32 + slop,\n );\n if (!all.length) return null;\n const best = all.reduce((a, b) => (b.dist <= a.dist ? b : a));\n return eventOf([best], xTicks);\n }\n if (!others.length) {\n if (!scatter.length) return null;\n return eventOf(\n [scatter.reduce((a, b) => (b.dist <= a.dist ? b : a))],\n xTicks,\n );\n }\n const bestDx = Math.min(...others.map((c) => c.dx));\n const bandPx = model.x.type === \"category\" ? 0.5 / sc.xPerPx : 0;\n const aligned = others.filter((c) => c.dx <= bestDx + Math.max(1, bandPx));\n const first = aligned.reduce((a, b) => (b.dx < a.dx ? b : a));\n const ordered = [first, ...aligned.filter((c) => c !== first), ...scatter];\n const event = eventOf(ordered, xTicks);\n if (event) {\n event.x = hoverItemOf(first.series, first.index).x;\n event.xLabel = xTicks?.formatValue(event.x) ?? String(event.x);\n }\n return event;\n};\n\n/** Whether two hover payloads point at the same points */\nexport const sameHover = (\n a: ChartHoverEvent | null,\n b: ChartHoverEvent | null,\n): boolean =>\n a === b ||\n (!!a &&\n !!b &&\n a.items.length === b.items.length &&\n a.items.every(\n (it, i) =>\n it.index === b.items[i].index &&\n it.seriesIndex === b.items[i].seriesIndex,\n ));\n\n// ------------------------------------------------------------------ tooltip\n\nexport interface TooltipRow {\n /** Swatch color (CSS) */\n color: string | null;\n name: string;\n value: string;\n}\n\nexport interface TooltipContent {\n title: string;\n /** Swatch of the title (single scatter point) */\n titleColor: string | null;\n rows: TooltipRow[];\n}\n\n/** Default tooltip content of a hover payload */\nexport const tooltipContent = (\n model: ChartModel,\n event: ChartHoverEvent,\n yTicks: AxisTicks | null,\n): TooltipContent => {\n const yFormat = yTicks?.formatValue ?? String;\n const first = event.items[0];\n const firstSeries = first ? model.series[first.seriesIndex] : null;\n if (event.items.length === 1 && firstSeries?.type === \"heatmap\") {\n const yName =\n model.y.type === \"category\"\n ? (model.y.categories[Math.round(first.y)] ?? yFormat(first.y))\n : yFormat(first.y);\n return {\n title: `${event.xLabel} · ${yName}`,\n titleColor: null,\n rows: [\n {\n color: first.color,\n name: first.label ?? firstSeries.name,\n value:\n first.value === undefined\n ? \"–\"\n : (firstSeries.format ?? formatValue)(first.value),\n },\n ],\n };\n }\n const scatterOnly = event.items.every(\n (it) => model.series[it.seriesIndex].type === \"scatter\",\n );\n if (scatterOnly && event.items.length === 1) {\n const it = event.items[0];\n const rows: TooltipRow[] = [\n { color: null, name: model.x.title ?? \"x\", value: event.xLabel },\n { color: null, name: model.y.title ?? \"y\", value: yFormat(it.y) },\n ];\n if (it.label !== undefined && model.series.length > 1)\n rows.push({ color: null, name: \"\", value: it.seriesName });\n return { title: it.label ?? it.seriesName, titleColor: it.color, rows };\n }\n const rows: TooltipRow[] = [];\n /** Row of every item */\n const rowOf: number[] = [];\n for (const it of event.items) {\n const s = model.series[it.seriesIndex];\n rowOf.push(rows.length);\n if (s.type === \"candlestick\") {\n const change =\n it.open !== undefined && it.open !== 0\n ? ((it.y - it.open) / Math.abs(it.open)) * 100\n : NaN;\n rows.push({\n color: it.color,\n name: s.name,\n value: Number.isFinite(change)\n ? `${change >= 0 ? \"+\" : \"\"}${change.toFixed(2)}%`\n : \"\",\n });\n const ohlc: [string, number | undefined][] = [\n [\"Open\", it.open],\n [\"High\", it.high],\n [\"Low\", it.low],\n [\"Close\", it.y],\n ];\n for (const [name, v] of ohlc) {\n if (v !== undefined && Number.isFinite(v))\n rows.push({ color: null, name, value: (s.format ?? yFormat)(v) });\n }\n continue;\n }\n rows.push({\n color: it.color,\n name: it.label ? `${it.seriesName} · ${it.label}` : it.seriesName,\n value: (s.format ?? yFormat)(it.y),\n });\n }\n if (model.percent) {\n // 100% stacks: the share of every value next to it\n const totals = new Map<string, number>();\n for (const it of event.items) {\n const stack = stackIdOf(model, it.seriesIndex);\n if (stack !== null && Number.isFinite(it.y))\n totals.set(stack, (totals.get(stack) ?? 0) + Math.abs(it.y));\n }\n event.items.forEach((it, k) => {\n const stack = stackIdOf(model, it.seriesIndex);\n const total = stack !== null ? totals.get(stack) : undefined;\n const row = rows[rowOf[k]];\n if (total && row && Number.isFinite(it.y)) {\n const format = model.series[it.seriesIndex].format ?? formatValue;\n row.value = `${format(it.y)} · ${((Math.abs(it.y) / total) * 100).toFixed(1)}%`;\n }\n });\n }\n return { title: event.xLabel, titleColor: null, rows };\n};\n\n/** Stack of a series in a 100% chart (`null` when it is not stacked) */\nconst stackIdOf = (model: ChartModel, seriesIndex: number): string | null =>\n model.series[seriesIndex].hidden ? null : model.stacks[seriesIndex];\n\n/**\n * Shape of the hover marker of an item: a dot with a soft halo on a point,\n * a band behind the hovered bar group / candle, or the outline of a cell\n */\nexport type HoverMark =\n | {\n kind: \"dot\";\n x: number;\n y: number;\n size: number;\n color: string;\n /** Translucent series color of the halo around the dot */\n halo: string;\n }\n | { kind: \"band\"; x: number; y: number; width: number; height: number }\n | { kind: \"cell\"; x: number; y: number; width: number; height: number };\n\n/** Markers of the hovered points (pixels of the stage); bands come first */\nexport const hoverMarks = (\n model: ChartModel,\n sc: Scales,\n event: ChartHoverEvent,\n): HoverMark[] => {\n const marks: HoverMark[] = [];\n const { plot } = sc;\n let bandLo = Infinity;\n let bandHi = -Infinity;\n for (const it of event.items) {\n const s = model.series[it.seriesIndex];\n if (s.type === \"bar\" || s.type === \"candlestick\") {\n const cx = sc.xToPx(it.x + s.barOffset);\n const half = Math.max(s.barHalfWidth / sc.xPerPx, 1);\n bandLo = Math.min(bandLo, cx - half);\n bandHi = Math.max(bandHi, cx + half);\n continue;\n }\n if (s.type === \"heatmap\") {\n const cx = sc.xToPx(it.x);\n const cy = sc.yToPx(it.y);\n const hw = Math.abs(s.cellHalf.x / sc.xPerPx);\n const hh = Math.abs(s.cellHalf.y / sc.yPerPx);\n marks.push({\n kind: \"cell\",\n x: cx - hw,\n y: cy - hh,\n width: hw * 2,\n height: hh * 2,\n });\n continue;\n }\n const { px, py } = pointOf(s, it.index, sc);\n if (\n px < plot.x - 1 ||\n px > plot.x + plot.width + 1 ||\n py < plot.y - 1 ||\n py > plot.y + plot.height + 1\n ) {\n continue;\n }\n const size =\n s.type === \"scatter\"\n ? dotSize(s, it.index) + 4\n : Math.max(9, s.lineWidth * 2 + 5);\n const rgba = s.pointColors?.[it.index] ?? s.color;\n marks.push({\n kind: \"dot\",\n x: px,\n y: py,\n size,\n color: it.color,\n halo: toCss(rgba, 0.2),\n });\n }\n if (bandHi > bandLo) {\n // the group of bars plus a margin, clipped to the plot\n const pad = Math.max(4, (bandHi - bandLo) * 0.14);\n const x0 = Math.max(plot.x, bandLo - pad);\n const x1 = Math.min(plot.x + plot.width, bandHi + pad);\n if (x1 > x0) {\n marks.unshift({\n kind: \"band\",\n x: x0,\n y: plot.y,\n width: x1 - x0,\n height: plot.height,\n });\n }\n }\n return marks;\n};\n\n/** Swatch of a series in the legend */\nexport const legendShape = (\n type: SeriesModel[\"type\"],\n): \"dot\" | \"line\" | \"square\" =>\n type === \"scatter\" ? \"dot\" : type === \"line\" ? \"line\" : \"square\";\n\n/** Whether the guide line follows the pointer */\nexport const showsCrosshair = (\n model: ChartModel,\n event: ChartHoverEvent,\n crosshair: boolean | undefined,\n) =>\n crosshair ??\n (model.tooltipMode === \"axis\" &&\n event.items.some((it) => {\n const type = model.series[it.seriesIndex].type;\n return type === \"line\" || type === \"area\";\n }) &&\n // bars get a band instead\n !event.items.some((it) => {\n const type = model.series[it.seriesIndex].type;\n return type === \"bar\" || type === \"candlestick\";\n }));\n"],"mappings":"4JAqBA,IAAae,EAAkB,CAAE,IAAK,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
|
+
import { Rgba } from './color.cjs';
|
|
3
|
+
import { Rect, Scales } from './layout.cjs';
|
|
4
|
+
import { ChartModel, SeriesModel } from './model.cjs';
|
|
5
|
+
import { PointLabel, ResolvedAnnotation } from './overlay.cjs';
|
|
6
|
+
import { ChartTheme } from './theme.cjs';
|
|
7
|
+
import { ChartAnnotation, ChartHoverEvent, ChartHoverItem, ChartPadding, ChartView } from './types.cjs';
|
|
8
|
+
export declare const MAX_POINT_LABELS = 300;
|
|
9
|
+
export declare const DEFAULT_PADDING: {
|
|
10
|
+
top: number;
|
|
11
|
+
right: number;
|
|
12
|
+
bottom: number;
|
|
13
|
+
left: number;
|
|
14
|
+
};
|
|
15
|
+
export declare const fallbackResolve: (_value: string, fallback: Rgba) => Rgba;
|
|
16
|
+
/** Annotation colors resolved against the theme */
|
|
17
|
+
export declare const resolveAnnotations: (annotations: readonly ChartAnnotation[] | undefined, theme: ChartTheme) => ResolvedAnnotation[];
|
|
18
|
+
export interface ChartLayout {
|
|
19
|
+
plot: Rect;
|
|
20
|
+
scales: Scales;
|
|
21
|
+
xTicks: AxisTicks;
|
|
22
|
+
yTicks: AxisTicks;
|
|
23
|
+
}
|
|
24
|
+
export interface LayoutInput {
|
|
25
|
+
model: ChartModel;
|
|
26
|
+
view: ChartView;
|
|
27
|
+
theme: ChartTheme;
|
|
28
|
+
/** Size of the drawing area (legend excluded), CSS pixels */
|
|
29
|
+
width: number;
|
|
30
|
+
height: number;
|
|
31
|
+
padding?: ChartPadding;
|
|
32
|
+
/** Offset of the drawing area (e.g. below a legend) */
|
|
33
|
+
top?: number;
|
|
34
|
+
/** Width of a tick label in the theme font */
|
|
35
|
+
measure: (text: string) => number;
|
|
36
|
+
}
|
|
37
|
+
/** Ticks, room for the axes and the plot rectangle */
|
|
38
|
+
export declare const layoutChart: (input: LayoutInput) => ChartLayout;
|
|
39
|
+
/** Labels of the visible scatter points and bar values (`showLabels`) */
|
|
40
|
+
export declare const collectPointLabels: (model: ChartModel, view: ChartView, s: Scales, yTicks?: AxisTicks | null) => PointLabel[];
|
|
41
|
+
/** Pixel position of a point (the top of a bar or stack, the close of a candle) */
|
|
42
|
+
export declare const pointOf: (s: SeriesModel, i: number, sc: Scales) => {
|
|
43
|
+
px: number;
|
|
44
|
+
py: number;
|
|
45
|
+
};
|
|
46
|
+
/** Diameter of a scatter dot */
|
|
47
|
+
export declare const dotSize: (s: SeriesModel, i: number) => number;
|
|
48
|
+
/** Hover payload item of a point */
|
|
49
|
+
export declare const hoverItemOf: (s: SeriesModel, index: number) => ChartHoverItem;
|
|
50
|
+
/**
|
|
51
|
+
* Points under a pixel of the stage: the nearest point (scatter / `nearest`
|
|
52
|
+
* tooltips) or every series at the nearest x (`axis` tooltips).
|
|
53
|
+
* `slop` widens the reach of the dots (touch screens).
|
|
54
|
+
*/
|
|
55
|
+
export declare const hitTest: (model: ChartModel, sc: Scales, xTicks: AxisTicks | null, px: number, py: number, slop?: number) => ChartHoverEvent | null;
|
|
56
|
+
/** Whether two hover payloads point at the same points */
|
|
57
|
+
export declare const sameHover: (a: ChartHoverEvent | null, b: ChartHoverEvent | null) => boolean;
|
|
58
|
+
export interface TooltipRow {
|
|
59
|
+
/** Swatch color (CSS) */
|
|
60
|
+
color: string | null;
|
|
61
|
+
name: string;
|
|
62
|
+
value: string;
|
|
63
|
+
}
|
|
64
|
+
export interface TooltipContent {
|
|
65
|
+
title: string;
|
|
66
|
+
/** Swatch of the title (single scatter point) */
|
|
67
|
+
titleColor: string | null;
|
|
68
|
+
rows: TooltipRow[];
|
|
69
|
+
}
|
|
70
|
+
/** Default tooltip content of a hover payload */
|
|
71
|
+
export declare const tooltipContent: (model: ChartModel, event: ChartHoverEvent, yTicks: AxisTicks | null) => TooltipContent;
|
|
72
|
+
/**
|
|
73
|
+
* Shape of the hover marker of an item: a dot with a soft halo on a point,
|
|
74
|
+
* a band behind the hovered bar group / candle, or the outline of a cell
|
|
75
|
+
*/
|
|
76
|
+
export type HoverMark = {
|
|
77
|
+
kind: "dot";
|
|
78
|
+
x: number;
|
|
79
|
+
y: number;
|
|
80
|
+
size: number;
|
|
81
|
+
color: string;
|
|
82
|
+
/** Translucent series color of the halo around the dot */
|
|
83
|
+
halo: string;
|
|
84
|
+
} | {
|
|
85
|
+
kind: "band";
|
|
86
|
+
x: number;
|
|
87
|
+
y: number;
|
|
88
|
+
width: number;
|
|
89
|
+
height: number;
|
|
90
|
+
} | {
|
|
91
|
+
kind: "cell";
|
|
92
|
+
x: number;
|
|
93
|
+
y: number;
|
|
94
|
+
width: number;
|
|
95
|
+
height: number;
|
|
96
|
+
};
|
|
97
|
+
/** Markers of the hovered points (pixels of the stage); bands come first */
|
|
98
|
+
export declare const hoverMarks: (model: ChartModel, sc: Scales, event: ChartHoverEvent) => HoverMark[];
|
|
99
|
+
/** Swatch of a series in the legend */
|
|
100
|
+
export declare const legendShape: (type: SeriesModel["type"]) => "dot" | "line" | "square";
|
|
101
|
+
/** Whether the guide line follows the pointer */
|
|
102
|
+
export declare const showsCrosshair: (model: ChartModel, event: ChartHoverEvent, crosshair: boolean | undefined) => boolean;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { AxisTicks } from './axis.js';
|
|
2
|
+
import { Rgba } from './color.js';
|
|
3
|
+
import { Rect, Scales } from './layout.js';
|
|
4
|
+
import { ChartModel, SeriesModel } from './model.js';
|
|
5
|
+
import { PointLabel, ResolvedAnnotation } from './overlay.js';
|
|
6
|
+
import { ChartTheme } from './theme.js';
|
|
7
|
+
import { ChartAnnotation, ChartHoverEvent, ChartHoverItem, ChartPadding, ChartView } from './types.js';
|
|
8
|
+
export declare const MAX_POINT_LABELS = 300;
|
|
9
|
+
export declare const DEFAULT_PADDING: {
|
|
10
|
+
top: number;
|
|
11
|
+
right: number;
|
|
12
|
+
bottom: number;
|
|
13
|
+
left: number;
|
|
14
|
+
};
|
|
15
|
+
export declare const fallbackResolve: (_value: string, fallback: Rgba) => Rgba;
|
|
16
|
+
/** Annotation colors resolved against the theme */
|
|
17
|
+
export declare const resolveAnnotations: (annotations: readonly ChartAnnotation[] | undefined, theme: ChartTheme) => ResolvedAnnotation[];
|
|
18
|
+
export interface ChartLayout {
|
|
19
|
+
plot: Rect;
|
|
20
|
+
scales: Scales;
|
|
21
|
+
xTicks: AxisTicks;
|
|
22
|
+
yTicks: AxisTicks;
|
|
23
|
+
}
|
|
24
|
+
export interface LayoutInput {
|
|
25
|
+
model: ChartModel;
|
|
26
|
+
view: ChartView;
|
|
27
|
+
theme: ChartTheme;
|
|
28
|
+
/** Size of the drawing area (legend excluded), CSS pixels */
|
|
29
|
+
width: number;
|
|
30
|
+
height: number;
|
|
31
|
+
padding?: ChartPadding;
|
|
32
|
+
/** Offset of the drawing area (e.g. below a legend) */
|
|
33
|
+
top?: number;
|
|
34
|
+
/** Width of a tick label in the theme font */
|
|
35
|
+
measure: (text: string) => number;
|
|
36
|
+
}
|
|
37
|
+
/** Ticks, room for the axes and the plot rectangle */
|
|
38
|
+
export declare const layoutChart: (input: LayoutInput) => ChartLayout;
|
|
39
|
+
/** Labels of the visible scatter points and bar values (`showLabels`) */
|
|
40
|
+
export declare const collectPointLabels: (model: ChartModel, view: ChartView, s: Scales, yTicks?: AxisTicks | null) => PointLabel[];
|
|
41
|
+
/** Pixel position of a point (the top of a bar or stack, the close of a candle) */
|
|
42
|
+
export declare const pointOf: (s: SeriesModel, i: number, sc: Scales) => {
|
|
43
|
+
px: number;
|
|
44
|
+
py: number;
|
|
45
|
+
};
|
|
46
|
+
/** Diameter of a scatter dot */
|
|
47
|
+
export declare const dotSize: (s: SeriesModel, i: number) => number;
|
|
48
|
+
/** Hover payload item of a point */
|
|
49
|
+
export declare const hoverItemOf: (s: SeriesModel, index: number) => ChartHoverItem;
|
|
50
|
+
/**
|
|
51
|
+
* Points under a pixel of the stage: the nearest point (scatter / `nearest`
|
|
52
|
+
* tooltips) or every series at the nearest x (`axis` tooltips).
|
|
53
|
+
* `slop` widens the reach of the dots (touch screens).
|
|
54
|
+
*/
|
|
55
|
+
export declare const hitTest: (model: ChartModel, sc: Scales, xTicks: AxisTicks | null, px: number, py: number, slop?: number) => ChartHoverEvent | null;
|
|
56
|
+
/** Whether two hover payloads point at the same points */
|
|
57
|
+
export declare const sameHover: (a: ChartHoverEvent | null, b: ChartHoverEvent | null) => boolean;
|
|
58
|
+
export interface TooltipRow {
|
|
59
|
+
/** Swatch color (CSS) */
|
|
60
|
+
color: string | null;
|
|
61
|
+
name: string;
|
|
62
|
+
value: string;
|
|
63
|
+
}
|
|
64
|
+
export interface TooltipContent {
|
|
65
|
+
title: string;
|
|
66
|
+
/** Swatch of the title (single scatter point) */
|
|
67
|
+
titleColor: string | null;
|
|
68
|
+
rows: TooltipRow[];
|
|
69
|
+
}
|
|
70
|
+
/** Default tooltip content of a hover payload */
|
|
71
|
+
export declare const tooltipContent: (model: ChartModel, event: ChartHoverEvent, yTicks: AxisTicks | null) => TooltipContent;
|
|
72
|
+
/**
|
|
73
|
+
* Shape of the hover marker of an item: a dot with a soft halo on a point,
|
|
74
|
+
* a band behind the hovered bar group / candle, or the outline of a cell
|
|
75
|
+
*/
|
|
76
|
+
export type HoverMark = {
|
|
77
|
+
kind: "dot";
|
|
78
|
+
x: number;
|
|
79
|
+
y: number;
|
|
80
|
+
size: number;
|
|
81
|
+
color: string;
|
|
82
|
+
/** Translucent series color of the halo around the dot */
|
|
83
|
+
halo: string;
|
|
84
|
+
} | {
|
|
85
|
+
kind: "band";
|
|
86
|
+
x: number;
|
|
87
|
+
y: number;
|
|
88
|
+
width: number;
|
|
89
|
+
height: number;
|
|
90
|
+
} | {
|
|
91
|
+
kind: "cell";
|
|
92
|
+
x: number;
|
|
93
|
+
y: number;
|
|
94
|
+
width: number;
|
|
95
|
+
height: number;
|
|
96
|
+
};
|
|
97
|
+
/** Markers of the hovered points (pixels of the stage); bands come first */
|
|
98
|
+
export declare const hoverMarks: (model: ChartModel, sc: Scales, event: ChartHoverEvent) => HoverMark[];
|
|
99
|
+
/** Swatch of a series in the legend */
|
|
100
|
+
export declare const legendShape: (type: SeriesModel["type"]) => "dot" | "line" | "square";
|
|
101
|
+
/** Whether the guide line follows the pointer */
|
|
102
|
+
export declare const showsCrosshair: (model: ChartModel, event: ChartHoverEvent, crosshair: boolean | undefined) => boolean;
|
|
@@ -0,0 +1,353 @@
|
|
|
1
|
+
import { nearestIndex as e } from "./data.js";
|
|
2
|
+
import { mix as t, toCss as n, unpackColor as r } from "./color.js";
|
|
3
|
+
import { computePlot as i, createScales as a } from "./layout.js";
|
|
4
|
+
import { gridOf as o, plottedY as s } from "./model.js";
|
|
5
|
+
import { formatValue as c } from "./format.js";
|
|
6
|
+
import { axisTicks as l } from "./axis.js";
|
|
7
|
+
var u = {
|
|
8
|
+
top: 12,
|
|
9
|
+
right: 16,
|
|
10
|
+
bottom: 4,
|
|
11
|
+
left: 4
|
|
12
|
+
}, d = (e, t) => t, f = (e, n) => {
|
|
13
|
+
let r = n.resolve ?? d;
|
|
14
|
+
return (e ?? []).map((e) => {
|
|
15
|
+
if (e.type === "rect") {
|
|
16
|
+
let i = e.color ? r(e.color, n.primary) : n.primary;
|
|
17
|
+
return {
|
|
18
|
+
type: "rect",
|
|
19
|
+
x0: e.x0,
|
|
20
|
+
x1: e.x1,
|
|
21
|
+
y0: e.y0,
|
|
22
|
+
y1: e.y1,
|
|
23
|
+
color: i,
|
|
24
|
+
opacity: e.opacity ?? .08,
|
|
25
|
+
label: e.label,
|
|
26
|
+
labelPosition: e.labelPosition ?? "top-left",
|
|
27
|
+
labelColor: e.labelColor ? r(e.labelColor, i) : t(i, n.text, .2)
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
return e.type === "text" ? {
|
|
31
|
+
type: "text",
|
|
32
|
+
x: e.x,
|
|
33
|
+
y: e.y,
|
|
34
|
+
text: e.text,
|
|
35
|
+
anchor: e.anchor ?? "center",
|
|
36
|
+
color: e.color ? r(e.color, n.textMuted) : n.textMuted,
|
|
37
|
+
weight: e.weight ?? 500
|
|
38
|
+
} : {
|
|
39
|
+
type: "line",
|
|
40
|
+
axis: e.axis,
|
|
41
|
+
value: e.value,
|
|
42
|
+
color: e.color ? r(e.color, n.textMuted) : n.textMuted,
|
|
43
|
+
width: e.width ?? 1,
|
|
44
|
+
dash: [...e.dash ?? [4, 4]],
|
|
45
|
+
label: e.label
|
|
46
|
+
};
|
|
47
|
+
});
|
|
48
|
+
}, p = (e) => {
|
|
49
|
+
let { model: t, view: n, theme: r, width: o, height: s, measure: c } = e, d = t.y.tickCount ?? (t.y.type === "category" ? Math.max(1, Math.floor((s - 40) / (r.fontSize + 5))) : s >= 220 ? 5 : Math.max(2, Math.round((s - 48) / 52))), f = l(t.y, n.y, d), p = 0;
|
|
50
|
+
if (t.y.visible) for (let e of f.labels) p = Math.max(p, c(e));
|
|
51
|
+
let m = 48;
|
|
52
|
+
if (t.x.type === "category") {
|
|
53
|
+
m = 0;
|
|
54
|
+
let e = Math.max(1, Math.floor(t.x.categories.length / 200));
|
|
55
|
+
for (let n = 0; n < t.x.categories.length; n += e) m = Math.max(m, c(t.x.categories[n]));
|
|
56
|
+
}
|
|
57
|
+
let h = {
|
|
58
|
+
...u,
|
|
59
|
+
...e.padding
|
|
60
|
+
}, g = i({
|
|
61
|
+
width: o,
|
|
62
|
+
height: s,
|
|
63
|
+
padding: h,
|
|
64
|
+
yLabelWidth: t.y.visible ? Math.ceil(p) : 0,
|
|
65
|
+
xAxisVisible: t.x.visible,
|
|
66
|
+
xTitle: !!t.x.title && t.x.visible,
|
|
67
|
+
yTitle: !!t.y.title && t.y.visible,
|
|
68
|
+
fontSize: r.fontSize
|
|
69
|
+
});
|
|
70
|
+
e.top && (g.y += e.top);
|
|
71
|
+
let _ = t.x.type === "category" ? Math.max(1, Math.floor(g.width / (m + 14))) : t.x.tickCount ?? Math.max(3, Math.floor(g.width / 88)), v = l(t.x, n.x, _);
|
|
72
|
+
return {
|
|
73
|
+
plot: g,
|
|
74
|
+
scales: a(g, n, t.x.reverse, t.y.reverse),
|
|
75
|
+
xTicks: v,
|
|
76
|
+
yTicks: f
|
|
77
|
+
};
|
|
78
|
+
}, m = (e, t, n, r) => {
|
|
79
|
+
let i = [], a = e.percent ? c : r?.formatValue ?? c;
|
|
80
|
+
for (let r of e.series) {
|
|
81
|
+
if (r.hidden || !r.showLabels) continue;
|
|
82
|
+
if (r.type === "bar" && r.barTop) {
|
|
83
|
+
let e = r.format ?? a, { x: o, y: s, count: c } = r.cols, l = r.barTop, [u, d] = t.x[0] <= t.x[1] ? t.x : [t.x[1], t.x[0]];
|
|
84
|
+
for (let t = 0; t < c && i.length < 300; t++) {
|
|
85
|
+
let a = o[t] + r.barOffset;
|
|
86
|
+
if (!Number.isFinite(s[t]) || a < u || a > d) continue;
|
|
87
|
+
let c = l[t] < (r.barBase?.[t] ?? 0);
|
|
88
|
+
i.push({
|
|
89
|
+
x: n.xToPx(a),
|
|
90
|
+
y: n.yToPx(l[t]),
|
|
91
|
+
r: 0,
|
|
92
|
+
text: e(s[t]),
|
|
93
|
+
placement: c ? "below" : "above"
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
continue;
|
|
97
|
+
}
|
|
98
|
+
if (r.type !== "scatter") continue;
|
|
99
|
+
let { x: e, y: o, count: s, labels: c, size: l } = r.cols;
|
|
100
|
+
if (c) for (let a = 0; a < s && i.length < 300; a++) {
|
|
101
|
+
let s = c[a];
|
|
102
|
+
if (!s) continue;
|
|
103
|
+
let u = e[a], d = o[a];
|
|
104
|
+
if (u < t.x[0] || u > t.x[1] || d < t.y[0] || d > t.y[1]) continue;
|
|
105
|
+
let f = l && l[a] > 0 ? l[a] : r.pointSize;
|
|
106
|
+
i.push({
|
|
107
|
+
x: n.xToPx(u),
|
|
108
|
+
y: n.yToPx(d),
|
|
109
|
+
r: f / 2,
|
|
110
|
+
text: s
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
return i;
|
|
115
|
+
}, h = (e, t, n) => {
|
|
116
|
+
let r = e.cols.x[t] + (e.type === "bar" ? e.barOffset : 0);
|
|
117
|
+
return {
|
|
118
|
+
px: n.xToPx(r),
|
|
119
|
+
py: n.yToPx(s(e, t))
|
|
120
|
+
};
|
|
121
|
+
}, g = (e, t, n, r, i) => {
|
|
122
|
+
let a = h(e, t, i), o = !1;
|
|
123
|
+
if (e.type === "bar" && e.barBase) {
|
|
124
|
+
let s = e.barHalfWidth / i.xPerPx, c = i.yToPx(e.barBase[t]);
|
|
125
|
+
o = Math.abs(n - a.px) <= s && r >= Math.min(c, a.py) - 2 && r <= Math.max(c, a.py) + 2;
|
|
126
|
+
} else if (e.type === "candlestick") {
|
|
127
|
+
let { high: s, low: c, y: l } = e.cols, u = Math.max(e.barHalfWidth / i.xPerPx, 3), d = i.yToPx(s ? s[t] : l[t]), f = i.yToPx(c ? c[t] : l[t]);
|
|
128
|
+
o = Math.abs(n - a.px) <= u && r >= Math.min(d, f) - 2 && r <= Math.max(d, f) + 2;
|
|
129
|
+
}
|
|
130
|
+
return {
|
|
131
|
+
series: e,
|
|
132
|
+
index: t,
|
|
133
|
+
px: a.px,
|
|
134
|
+
py: a.py,
|
|
135
|
+
dx: Math.abs(i.xToPx(e.cols.x[t]) - n),
|
|
136
|
+
dist: o ? 0 : Math.hypot(a.px - n, a.py - r),
|
|
137
|
+
inside: o
|
|
138
|
+
};
|
|
139
|
+
}, _ = (e, t) => e.cols.size && e.cols.size[t] > 0 ? e.cols.size[t] : e.pointSize, v = (e, t, n, r, i) => {
|
|
140
|
+
let a = Math.max(e.pointSize / 2 + 6, 10) + i, s = r.pxToX(t), c = r.pxToY(n), l = a * r.xPerPx, u = a * r.yPerPx, d = -1, f = Infinity, { x: p, y: m } = e.cols;
|
|
141
|
+
return o(e).query(s - l, s + l, c - u, c + u, (a) => {
|
|
142
|
+
let o = Math.hypot(r.xToPx(p[a]) - t, r.yToPx(m[a]) - n);
|
|
143
|
+
o <= Math.max(_(e, a) / 2 + 4, 8) + i && o <= f && (f = o, d = a);
|
|
144
|
+
}), d;
|
|
145
|
+
}, y = (e, t, n) => {
|
|
146
|
+
let { x: r, y: i } = e.cellHalf, { x: a, y: s } = e.cols, c = -1;
|
|
147
|
+
return o(e).query(t - r, t + r, n - i, n + i, (o) => {
|
|
148
|
+
e.cellColors?.[o] && Math.abs(a[o] - t) <= r && Math.abs(s[o] - n) <= i && (c = o);
|
|
149
|
+
}), c;
|
|
150
|
+
}, b = (t, n) => {
|
|
151
|
+
let { x: r, y: i, count: a, sorted: o } = t.cols;
|
|
152
|
+
if (o) return e(r, i, a, n);
|
|
153
|
+
let s = -1, c = Infinity;
|
|
154
|
+
for (let e = 0; e < a; e++) {
|
|
155
|
+
if (!Number.isFinite(i[e])) continue;
|
|
156
|
+
let t = Math.abs(r[e] - n);
|
|
157
|
+
t < c && (c = t, s = e);
|
|
158
|
+
}
|
|
159
|
+
return s;
|
|
160
|
+
}, x = (e, t) => {
|
|
161
|
+
let i = e.pointColors?.[t], a = e.cols.labels?.[t], { open: o, high: s, low: c, value: l } = e.cols, u = i ? n(i) : e.colorCss, d = {};
|
|
162
|
+
if (e.type === "candlestick") {
|
|
163
|
+
let r = o ? o[t] : NaN;
|
|
164
|
+
Number.isFinite(r) && (d.open = r), s && Number.isFinite(s[t]) && (d.high = s[t]), c && Number.isFinite(c[t]) && (d.low = c[t]), u = n(e.cols.y[t] < r ? e.downColor : e.upColor);
|
|
165
|
+
} else if (e.type === "heatmap") {
|
|
166
|
+
let i = l ? l[t] : e.cols.y[t];
|
|
167
|
+
Number.isFinite(i) && (d.value = i);
|
|
168
|
+
let a = e.cellColors?.[t];
|
|
169
|
+
a && (u = n(r(a)));
|
|
170
|
+
}
|
|
171
|
+
return {
|
|
172
|
+
seriesIndex: e.index,
|
|
173
|
+
seriesId: e.id,
|
|
174
|
+
seriesName: e.name,
|
|
175
|
+
index: t,
|
|
176
|
+
x: e.cols.x[t],
|
|
177
|
+
y: e.cols.y[t],
|
|
178
|
+
color: u,
|
|
179
|
+
...a === void 0 ? {} : { label: a },
|
|
180
|
+
...d
|
|
181
|
+
};
|
|
182
|
+
}, S = (e, t) => {
|
|
183
|
+
if (!e.length) return null;
|
|
184
|
+
e.sort((e, t) => e.series.index - t.series.index);
|
|
185
|
+
let n = e.map((e) => x(e.series, e.index)), r = n[0].x;
|
|
186
|
+
return {
|
|
187
|
+
items: n,
|
|
188
|
+
x: r,
|
|
189
|
+
xLabel: t?.formatValue(r) ?? String(r)
|
|
190
|
+
};
|
|
191
|
+
}, C = (e, t, n, r, i, a = 0) => {
|
|
192
|
+
let { plot: o } = t, s = 6 + a;
|
|
193
|
+
if (r < o.x - s || r > o.x + o.width + s || i < o.y - s || i > o.y + o.height + s) return null;
|
|
194
|
+
let c = t.pxToX(r), l = [], u = [];
|
|
195
|
+
for (let n of e.series) if (!(n.hidden || n.cols.count === 0)) {
|
|
196
|
+
if (n.type === "scatter") {
|
|
197
|
+
let e = v(n, r, i, t, a);
|
|
198
|
+
e >= 0 && l.push(g(n, e, r, i, t));
|
|
199
|
+
} else if (n.type === "heatmap") {
|
|
200
|
+
let e = y(n, t.pxToX(r), t.pxToY(i));
|
|
201
|
+
if (e >= 0) {
|
|
202
|
+
let a = g(n, e, r, i, t);
|
|
203
|
+
a.inside = !0, a.dist = 0, l.push(a);
|
|
204
|
+
}
|
|
205
|
+
} else {
|
|
206
|
+
let e = b(n, c);
|
|
207
|
+
e >= 0 && u.push(g(n, e, r, i, t));
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
if (e.tooltipMode === "nearest") {
|
|
211
|
+
let e = [...l, ...u].filter((e) => e.inside || e.series.type === "scatter" || e.dist <= 32 + a);
|
|
212
|
+
return e.length ? S([e.reduce((e, t) => t.dist <= e.dist ? t : e)], n) : null;
|
|
213
|
+
}
|
|
214
|
+
if (!u.length) return l.length ? S([l.reduce((e, t) => t.dist <= e.dist ? t : e)], n) : null;
|
|
215
|
+
let d = Math.min(...u.map((e) => e.dx)), f = e.x.type === "category" ? .5 / t.xPerPx : 0, p = u.filter((e) => e.dx <= d + Math.max(1, f)), m = p.reduce((e, t) => t.dx < e.dx ? t : e), h = S([
|
|
216
|
+
m,
|
|
217
|
+
...p.filter((e) => e !== m),
|
|
218
|
+
...l
|
|
219
|
+
], n);
|
|
220
|
+
return h && (h.x = x(m.series, m.index).x, h.xLabel = n?.formatValue(h.x) ?? String(h.x)), h;
|
|
221
|
+
}, w = (e, t) => e === t || !!e && !!t && e.items.length === t.items.length && e.items.every((e, n) => e.index === t.items[n].index && e.seriesIndex === t.items[n].seriesIndex), T = (e, t, n) => {
|
|
222
|
+
let r = n?.formatValue ?? String, i = t.items[0], a = i ? e.series[i.seriesIndex] : null;
|
|
223
|
+
if (t.items.length === 1 && a?.type === "heatmap") {
|
|
224
|
+
let n = e.y.type === "category" ? e.y.categories[Math.round(i.y)] ?? r(i.y) : r(i.y);
|
|
225
|
+
return {
|
|
226
|
+
title: `${t.xLabel} · ${n}`,
|
|
227
|
+
titleColor: null,
|
|
228
|
+
rows: [{
|
|
229
|
+
color: i.color,
|
|
230
|
+
name: i.label ?? a.name,
|
|
231
|
+
value: i.value === void 0 ? "–" : (a.format ?? c)(i.value)
|
|
232
|
+
}]
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
if (t.items.every((t) => e.series[t.seriesIndex].type === "scatter") && t.items.length === 1) {
|
|
236
|
+
let n = t.items[0], i = [{
|
|
237
|
+
color: null,
|
|
238
|
+
name: e.x.title ?? "x",
|
|
239
|
+
value: t.xLabel
|
|
240
|
+
}, {
|
|
241
|
+
color: null,
|
|
242
|
+
name: e.y.title ?? "y",
|
|
243
|
+
value: r(n.y)
|
|
244
|
+
}];
|
|
245
|
+
return n.label !== void 0 && e.series.length > 1 && i.push({
|
|
246
|
+
color: null,
|
|
247
|
+
name: "",
|
|
248
|
+
value: n.seriesName
|
|
249
|
+
}), {
|
|
250
|
+
title: n.label ?? n.seriesName,
|
|
251
|
+
titleColor: n.color,
|
|
252
|
+
rows: i
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
let o = [], s = [];
|
|
256
|
+
for (let n of t.items) {
|
|
257
|
+
let t = e.series[n.seriesIndex];
|
|
258
|
+
if (s.push(o.length), t.type === "candlestick") {
|
|
259
|
+
let e = n.open !== void 0 && n.open !== 0 ? (n.y - n.open) / Math.abs(n.open) * 100 : NaN;
|
|
260
|
+
o.push({
|
|
261
|
+
color: n.color,
|
|
262
|
+
name: t.name,
|
|
263
|
+
value: Number.isFinite(e) ? `${e >= 0 ? "+" : ""}${e.toFixed(2)}%` : ""
|
|
264
|
+
});
|
|
265
|
+
let i = [
|
|
266
|
+
["Open", n.open],
|
|
267
|
+
["High", n.high],
|
|
268
|
+
["Low", n.low],
|
|
269
|
+
["Close", n.y]
|
|
270
|
+
];
|
|
271
|
+
for (let [e, n] of i) n !== void 0 && Number.isFinite(n) && o.push({
|
|
272
|
+
color: null,
|
|
273
|
+
name: e,
|
|
274
|
+
value: (t.format ?? r)(n)
|
|
275
|
+
});
|
|
276
|
+
continue;
|
|
277
|
+
}
|
|
278
|
+
o.push({
|
|
279
|
+
color: n.color,
|
|
280
|
+
name: n.label ? `${n.seriesName} · ${n.label}` : n.seriesName,
|
|
281
|
+
value: (t.format ?? r)(n.y)
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
if (e.percent) {
|
|
285
|
+
let n = /* @__PURE__ */ new Map();
|
|
286
|
+
for (let r of t.items) {
|
|
287
|
+
let t = E(e, r.seriesIndex);
|
|
288
|
+
t !== null && Number.isFinite(r.y) && n.set(t, (n.get(t) ?? 0) + Math.abs(r.y));
|
|
289
|
+
}
|
|
290
|
+
t.items.forEach((t, r) => {
|
|
291
|
+
let i = E(e, t.seriesIndex), a = i === null ? void 0 : n.get(i), l = o[s[r]];
|
|
292
|
+
a && l && Number.isFinite(t.y) && (l.value = `${(e.series[t.seriesIndex].format ?? c)(t.y)} · ${(Math.abs(t.y) / a * 100).toFixed(1)}%`);
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
return {
|
|
296
|
+
title: t.xLabel,
|
|
297
|
+
titleColor: null,
|
|
298
|
+
rows: o
|
|
299
|
+
};
|
|
300
|
+
}, E = (e, t) => e.series[t].hidden ? null : e.stacks[t], D = (e, t, r) => {
|
|
301
|
+
let i = [], { plot: a } = t, o = Infinity, s = -Infinity;
|
|
302
|
+
for (let c of r.items) {
|
|
303
|
+
let r = e.series[c.seriesIndex];
|
|
304
|
+
if (r.type === "bar" || r.type === "candlestick") {
|
|
305
|
+
let e = t.xToPx(c.x + r.barOffset), n = Math.max(r.barHalfWidth / t.xPerPx, 1);
|
|
306
|
+
o = Math.min(o, e - n), s = Math.max(s, e + n);
|
|
307
|
+
continue;
|
|
308
|
+
}
|
|
309
|
+
if (r.type === "heatmap") {
|
|
310
|
+
let e = t.xToPx(c.x), n = t.yToPx(c.y), a = Math.abs(r.cellHalf.x / t.xPerPx), o = Math.abs(r.cellHalf.y / t.yPerPx);
|
|
311
|
+
i.push({
|
|
312
|
+
kind: "cell",
|
|
313
|
+
x: e - a,
|
|
314
|
+
y: n - o,
|
|
315
|
+
width: a * 2,
|
|
316
|
+
height: o * 2
|
|
317
|
+
});
|
|
318
|
+
continue;
|
|
319
|
+
}
|
|
320
|
+
let { px: l, py: u } = h(r, c.index, t);
|
|
321
|
+
if (l < a.x - 1 || l > a.x + a.width + 1 || u < a.y - 1 || u > a.y + a.height + 1) continue;
|
|
322
|
+
let d = r.type === "scatter" ? _(r, c.index) + 4 : Math.max(9, r.lineWidth * 2 + 5), f = r.pointColors?.[c.index] ?? r.color;
|
|
323
|
+
i.push({
|
|
324
|
+
kind: "dot",
|
|
325
|
+
x: l,
|
|
326
|
+
y: u,
|
|
327
|
+
size: d,
|
|
328
|
+
color: c.color,
|
|
329
|
+
halo: n(f, .2)
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
if (s > o) {
|
|
333
|
+
let e = Math.max(4, (s - o) * .14), t = Math.max(a.x, o - e), n = Math.min(a.x + a.width, s + e);
|
|
334
|
+
n > t && i.unshift({
|
|
335
|
+
kind: "band",
|
|
336
|
+
x: t,
|
|
337
|
+
y: a.y,
|
|
338
|
+
width: n - t,
|
|
339
|
+
height: a.height
|
|
340
|
+
});
|
|
341
|
+
}
|
|
342
|
+
return i;
|
|
343
|
+
}, O = (e) => e === "scatter" ? "dot" : e === "line" ? "line" : "square", k = (e, t, n) => n ?? (e.tooltipMode === "axis" && t.items.some((t) => {
|
|
344
|
+
let n = e.series[t.seriesIndex].type;
|
|
345
|
+
return n === "line" || n === "area";
|
|
346
|
+
}) && !t.items.some((t) => {
|
|
347
|
+
let n = e.series[t.seriesIndex].type;
|
|
348
|
+
return n === "bar" || n === "candlestick";
|
|
349
|
+
}));
|
|
350
|
+
//#endregion
|
|
351
|
+
export { u as DEFAULT_PADDING, m as collectPointLabels, _ as dotSize, d as fallbackResolve, C as hitTest, x as hoverItemOf, D as hoverMarks, p as layoutChart, O as legendShape, h as pointOf, f as resolveAnnotations, w as sameHover, k as showsCrosshair, T as tooltipContent };
|
|
352
|
+
|
|
353
|
+
//# sourceMappingURL=scene.js.map
|