vccs 0.6.0 → 1.0.0-beta.2
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/LICENSE +25 -0
- package/README.md +133 -112
- package/dist/animation/ActiveDot.d.ts +14 -0
- package/dist/animation/MovingLabels.d.ts +57 -0
- package/dist/animation/SweepClip.d.ts +56 -0
- package/dist/animation/gridTransition.d.ts +38 -0
- package/dist/animation/motion.d.ts +78 -0
- package/dist/animation/ridingLabels.d.ts +29 -0
- package/dist/animation/useAnimationCallbacks.d.ts +5 -0
- package/dist/animation/useKeyedTransition.d.ts +86 -0
- package/dist/animation/usePointTransition.d.ts +40 -0
- package/dist/animation/useReducedMotion.d.ts +2 -0
- package/dist/animation/useTickMotion.d.ts +22 -0
- package/dist/cartesian/ActivePoints.d.ts +71 -0
- package/dist/cartesian/GraphicalItemClipPath.d.ts +27 -2
- package/dist/cartesian/area/Area.d.ts +229 -14
- package/dist/cartesian/area/RenderArea.d.ts +1 -16
- package/dist/cartesian/area/hooks/useArea.d.ts +13 -18
- package/dist/cartesian/area/type.d.ts +32 -81
- package/dist/cartesian/axis/AxisProps.d.ts +101 -0
- package/dist/cartesian/axis/XAxis.d.ts +144 -83
- package/dist/cartesian/axis/YAxis.d.ts +152 -94
- package/dist/cartesian/bar/Bar.d.ts +229 -2
- package/dist/cartesian/bar/components/BarBackground.d.ts +1 -1
- package/dist/cartesian/bar/hooks/useBar.d.ts +31 -15
- package/dist/cartesian/bar/type.d.ts +46 -77
- package/dist/cartesian/brush/Brush.d.ts +150 -2
- package/dist/cartesian/brush/components/BrushText.d.ts +7 -7
- package/dist/cartesian/brush/components/Panorama.d.ts +7 -5
- package/dist/cartesian/brush/components/Slide.d.ts +4 -4
- package/dist/cartesian/brush/components/TravellerLayer.d.ts +21 -13
- package/dist/cartesian/brush/hooks/useBrushHandlers.d.ts +3 -4
- package/dist/cartesian/brush/hooks/useBrushState.d.ts +16 -16
- package/dist/cartesian/brush/type.d.ts +14 -33
- package/dist/cartesian/brush/utils.d.ts +5 -6
- package/dist/cartesian/cartesian-axis/CartesianAxis.d.ts +37 -63
- package/dist/cartesian/cartesian-grid/Background.d.ts +1 -1
- package/dist/cartesian/cartesian-grid/CartesianGrid.d.ts +68 -16
- package/dist/cartesian/cartesian-grid/HorizontalGridLines.d.ts +18 -11
- package/dist/cartesian/cartesian-grid/HorizontalStripes.d.ts +6 -5
- package/dist/cartesian/cartesian-grid/VerticalGridLines.d.ts +17 -10
- package/dist/cartesian/cartesian-grid/VerticalStripes.d.ts +6 -5
- package/dist/cartesian/cartesian-grid/const.d.ts +2 -6
- package/dist/cartesian/cartesian-grid/type.d.ts +21 -30
- package/dist/cartesian/cartesian-grid/utils.d.ts +3 -1
- package/dist/cartesian/cartesianPositionToCSSTranslate.d.ts +1 -1
- package/dist/cartesian/error-bar/ErrorBar.d.ts +11 -30
- package/dist/cartesian/error-bar/ErrorBarContext.d.ts +12 -15
- package/dist/cartesian/funnel/Funnel.d.ts +161 -2
- package/dist/cartesian/funnel/type.d.ts +20 -57
- package/dist/cartesian/getCartesianPosition.d.ts +1 -3
- package/dist/cartesian/line/Line.d.ts +177 -77
- package/dist/cartesian/line/StaticLine.d.ts +0 -15
- package/dist/cartesian/line/hooks/useLine.d.ts +14 -15
- package/dist/cartesian/line/type.d.ts +52 -104
- package/dist/cartesian/reference-area/ReferenceArea.d.ts +42 -90
- package/dist/cartesian/reference-dot/ReferenceDot.d.ts +21 -63
- package/dist/cartesian/reference-line/ReferenceLine.d.ts +35 -67
- package/dist/cartesian/scatter/Scatter.d.ts +72 -53
- package/dist/cartesian/scatter/hooks/useScatter.d.ts +6 -5
- package/dist/cartesian/scatter/type.d.ts +89 -0
- package/dist/cartesian/useNeedsClip.d.ts +3 -2
- package/dist/cartesian/utils/get-ticks.d.ts +5 -6
- package/dist/cartesian/z-axis/ZAxis.d.ts +20 -21
- package/dist/chart/AreaChart.d.ts +231 -1
- package/dist/chart/BarChart.d.ts +231 -1
- package/dist/chart/BarList.d.ts +172 -0
- package/dist/chart/CalendarHeatmap.d.ts +308 -0
- package/dist/chart/CellGridLayer.d.ts +136 -0
- package/dist/chart/ChartShell.d.ts +85 -0
- package/dist/chart/ChartWrapper.d.ts +167 -0
- package/dist/chart/ChartsWrapper.d.ts +75 -87
- package/dist/chart/CohortChart.d.ts +254 -0
- package/dist/chart/ComposedChart.d.ts +231 -1
- package/dist/chart/FunnelChart.d.ts +201 -1
- package/dist/chart/Heatmap.d.ts +687 -0
- package/dist/chart/JourneySankey.d.ts +261 -0
- package/dist/chart/LineChart.d.ts +231 -1
- package/dist/chart/PieChart.d.ts +243 -1
- package/dist/chart/RadarChart.d.ts +243 -1
- package/dist/chart/RadialBarChart.d.ts +273 -1
- package/dist/chart/Sankey.d.ts +85 -157
- package/dist/chart/ScatterChart.d.ts +231 -1
- package/dist/chart/Sparkline.d.ts +257 -0
- package/dist/chart/SunburstChart.d.ts +101 -132
- package/dist/chart/Tracker.d.ts +211 -0
- package/dist/chart/Treemap.d.ts +101 -147
- package/dist/chart/cellGridProps.d.ts +40 -0
- package/dist/chart/cellGridUtils.d.ts +53 -0
- package/dist/chart/chartProps.d.ts +402 -0
- package/dist/chart/chartRoot.d.ts +144 -0
- package/dist/chart/const.d.ts +0 -2
- package/dist/chart/directChartTypes.d.ts +13 -0
- package/dist/chart/journeyTypes.d.ts +99 -0
- package/dist/chart/journeyUtils.d.ts +102 -0
- package/dist/chart/sankeyUtils.d.ts +2 -2
- package/dist/chart/shell.d.ts +14 -0
- package/dist/chart/sunburstUtils.d.ts +7 -3
- package/dist/chart/treemapUtils.d.ts +8 -6
- package/dist/componentNames.d.ts +2 -0
- package/dist/components/Cell.d.ts +1 -1
- package/dist/components/Customized.d.ts +12 -7
- package/dist/components/Text.d.ts +31 -31
- package/dist/components/label/Label.d.ts +14 -26
- package/dist/components/label/LabelList.d.ts +24 -14
- package/dist/components/label/LabelListView.d.ts +23 -0
- package/dist/components/label/LabelView.d.ts +79 -0
- package/dist/components/label/types.d.ts +70 -15
- package/dist/components/label/utils.d.ts +24 -12
- package/dist/components/legend/Legend.d.ts +109 -4
- package/dist/components/legend/LegendSymbol.d.ts +2 -3
- package/dist/components/legend/hooks/useLegend.d.ts +8 -10
- package/dist/components/legend/hooks/useLegendContent.d.ts +7 -14
- package/dist/components/legend/type.d.ts +17 -25
- package/dist/components/legend/utils.d.ts +4 -4
- package/dist/components/tooltip/Cursor.d.ts +19 -0
- package/dist/components/tooltip/DefaultTooltipContent.d.ts +35 -0
- package/dist/components/{Tooltip.d.ts → tooltip/Tooltip.d.ts} +72 -100
- package/dist/components/tooltip/TooltipBoundingBox.d.ts +40 -0
- package/dist/components/tooltip/types.d.ts +59 -0
- package/dist/components/types.d.ts +6 -6
- package/dist/components/utils.d.ts +3 -3
- package/dist/container/ClipPath.d.ts +1 -1
- package/dist/container/Layer.d.ts +1 -1
- package/dist/container/ResponsiveContainer.d.ts +10 -13
- package/dist/container/Surface.d.ts +9 -1
- package/dist/container/useSizeContext.d.ts +4 -10
- package/dist/context/cartesianLabelListContext.d.ts +6 -2
- package/dist/context/polarLabelViewBoxContext.d.ts +1 -1
- package/dist/core/area.d.ts +32 -0
- package/dist/core/axis/data.d.ts +28 -0
- package/dist/core/axis/domain.d.ts +11 -0
- package/dist/core/axis/key.d.ts +7 -0
- package/dist/core/axis/polar.d.ts +11 -0
- package/dist/core/axis/polarSettings.d.ts +5 -0
- package/dist/core/axis/position.d.ts +76 -0
- package/dist/core/axis/range.d.ts +8 -0
- package/dist/core/axis/references.d.ts +6 -0
- package/dist/core/axis/scale.d.ts +21 -0
- package/dist/core/axis/settings.d.ts +4 -0
- package/dist/core/axis/stacks.d.ts +14 -0
- package/dist/core/axis/ticks.d.ts +19 -0
- package/dist/core/axis/userDomain.d.ts +48 -0
- package/dist/core/bar.d.ts +22 -0
- package/dist/core/barSizing.d.ts +43 -0
- package/dist/core/color.d.ts +21 -0
- package/dist/core/coordinates.d.ts +34 -0
- package/dist/core/data.d.ts +2 -0
- package/dist/core/errorBar.d.ts +15 -0
- package/dist/core/funnel.d.ts +17 -0
- package/dist/core/interaction.d.ts +18 -0
- package/dist/core/layout.d.ts +43 -0
- package/dist/core/line.d.ts +14 -0
- package/dist/{state/selectors/pieSelectors.d.ts → core/pie.d.ts} +14 -16
- package/dist/core/polygon.d.ts +5 -0
- package/dist/core/radar.d.ts +20 -0
- package/dist/core/radialBar.d.ts +36 -0
- package/dist/core/rectangle.d.ts +10 -0
- package/dist/core/scatter.d.ts +18 -0
- package/dist/core/tooltip.d.ts +16 -0
- package/dist/es/animation/ActiveDot.mjs +39 -0
- package/dist/es/animation/MovingLabels.mjs +61 -0
- package/dist/es/animation/SweepClip.mjs +40 -0
- package/dist/es/animation/gridTransition.mjs +112 -0
- package/dist/es/animation/motion.mjs +100 -0
- package/dist/es/animation/ridingLabels.mjs +70 -0
- package/dist/es/animation/useAnimationCallbacks.mjs +23 -0
- package/dist/es/animation/useKeyedTransition.mjs +355 -0
- package/dist/es/animation/usePointTransition.mjs +119 -0
- package/dist/es/animation/useReducedMotion.mjs +12 -0
- package/dist/es/animation/useTickMotion.mjs +62 -0
- package/dist/es/cartesian/ActivePoints.mjs +65 -0
- package/dist/es/cartesian/GraphicalItemClipPath.mjs +50 -9
- package/dist/es/cartesian/area/Area.mjs +72 -35
- package/dist/es/cartesian/area/RenderArea.mjs +112 -105
- package/dist/es/cartesian/area/hooks/useArea.mjs +44 -42
- package/dist/es/cartesian/area/type.mjs +14 -46
- package/dist/es/cartesian/axis/AxisProps.mjs +94 -0
- package/dist/es/cartesian/axis/XAxis.mjs +37 -159
- package/dist/es/cartesian/axis/YAxis.mjs +63 -167
- package/dist/es/cartesian/bar/Bar.mjs +122 -53
- package/dist/es/cartesian/bar/components/BarBackground.mjs +1 -1
- package/dist/es/cartesian/bar/components/BarRectangles.mjs +188 -126
- package/dist/es/cartesian/bar/hooks/useBar.mjs +67 -31
- package/dist/es/cartesian/bar/type.mjs +4 -22
- package/dist/es/cartesian/brush/Brush.mjs +294 -0
- package/dist/es/cartesian/brush/components/Background.mjs +25 -0
- package/dist/es/cartesian/brush/components/BrushText.mjs +55 -0
- package/dist/es/cartesian/brush/components/Panorama.mjs +54 -0
- package/dist/es/cartesian/brush/components/Slide.mjs +40 -0
- package/dist/es/cartesian/brush/components/Traveller.mjs +46 -0
- package/dist/es/cartesian/brush/components/TravellerLayer.mjs +68 -0
- package/dist/es/cartesian/brush/hooks/useBrushHandlers.mjs +158 -0
- package/dist/es/cartesian/brush/hooks/useBrushState.mjs +67 -0
- package/dist/es/cartesian/brush/type.mjs +54 -0
- package/dist/es/cartesian/brush/utils.mjs +30 -0
- package/dist/es/cartesian/cartesian-axis/CartesianAxis.mjs +27 -20
- package/dist/es/cartesian/cartesian-grid/CartesianGrid.mjs +157 -72
- package/dist/es/cartesian/cartesian-grid/HorizontalGridLines.mjs +5 -1
- package/dist/es/cartesian/cartesian-grid/VerticalGridLines.mjs +5 -1
- package/dist/es/cartesian/cartesian-grid/const.mjs +3 -320
- package/dist/es/cartesian/cartesian-grid/utils.mjs +1 -1
- package/dist/es/cartesian/error-bar/ErrorBar.mjs +65 -102
- package/dist/es/cartesian/error-bar/ErrorBarContext.mjs +21 -5
- package/dist/es/cartesian/funnel/Funnel.mjs +247 -127
- package/dist/es/cartesian/funnel/type.mjs +8 -14
- package/dist/es/cartesian/line/Line.mjs +72 -25
- package/dist/es/cartesian/line/StaticLine.mjs +129 -166
- package/dist/es/cartesian/line/hooks/useLine.mjs +38 -35
- package/dist/es/cartesian/line/type.mjs +5 -43
- package/dist/es/cartesian/reference-area/ReferenceArea.mjs +108 -88
- package/dist/es/cartesian/reference-dot/ReferenceDot.mjs +87 -67
- package/dist/es/cartesian/reference-line/ReferenceLine.mjs +99 -74
- package/dist/es/cartesian/scatter/Scatter.mjs +188 -190
- package/dist/es/cartesian/scatter/hooks/useScatter.mjs +25 -6
- package/dist/es/cartesian/scatter/type.mjs +79 -0
- package/dist/es/cartesian/useNeedsClip.mjs +6 -14
- package/dist/es/cartesian/utils/get-ticks.mjs +6 -6
- package/dist/es/cartesian/z-axis/ZAxis.mjs +7 -11
- package/dist/es/chart/AreaChart.mjs +12 -4
- package/dist/es/chart/BarChart.mjs +12 -4
- package/dist/es/chart/BarList.mjs +265 -0
- package/dist/es/chart/CalendarHeatmap.mjs +299 -0
- package/dist/es/chart/CellGridLayer.mjs +380 -0
- package/dist/es/chart/ChartShell.mjs +139 -0
- package/dist/es/chart/ChartWrapper.mjs +215 -0
- package/dist/es/chart/ChartsWrapper.mjs +21 -176
- package/dist/es/chart/CohortChart.mjs +169 -0
- package/dist/es/chart/ComposedChart.mjs +14 -4
- package/dist/es/chart/FunnelChart.mjs +11 -5
- package/dist/es/chart/Heatmap.mjs +319 -0
- package/dist/es/chart/JourneySankey.mjs +682 -0
- package/dist/es/chart/LineChart.mjs +13 -4
- package/dist/es/chart/PieChart.mjs +13 -9
- package/dist/es/chart/RadarChart.mjs +13 -9
- package/dist/es/chart/RadialBarChart.mjs +18 -10
- package/dist/es/chart/Sankey.mjs +355 -244
- package/dist/es/chart/ScatterChart.mjs +12 -4
- package/dist/es/chart/Sparkline.mjs +458 -0
- package/dist/es/chart/SunburstChart.mjs +215 -158
- package/dist/es/chart/Tracker.mjs +175 -0
- package/dist/es/chart/Treemap.mjs +357 -300
- package/dist/es/chart/cellGridProps.mjs +42 -0
- package/dist/es/chart/cellGridUtils.mjs +80 -0
- package/dist/es/chart/chartProps.mjs +88 -0
- package/dist/es/chart/chartRoot.mjs +153 -0
- package/dist/es/chart/journeyTypes.mjs +90 -0
- package/dist/es/chart/journeyUtils.mjs +223 -0
- package/dist/es/chart/sankeyUtils.mjs +52 -1
- package/dist/es/chart/shell.mjs +30 -0
- package/dist/es/chart/sunburstUtils.mjs +14 -9
- package/dist/es/chart/treemapUtils.mjs +10 -8
- package/dist/es/componentNames.mjs +84 -0
- package/dist/es/components/Cell.mjs +3 -2
- package/dist/es/components/Customized.mjs +14 -9
- package/dist/es/components/Text.vue_vue_type_script_setup_true_lang.mjs +16 -10
- package/dist/es/components/label/Label.mjs +12 -30
- package/dist/es/components/label/LabelList.mjs +13 -48
- package/dist/es/components/label/LabelListView.mjs +73 -0
- package/dist/es/components/label/LabelView.mjs +45 -0
- package/dist/es/components/label/types.mjs +10 -5
- package/dist/es/components/label/utils.mjs +39 -19
- package/dist/es/components/legend/Legend.mjs +101 -36
- package/dist/es/components/legend/LegendSymbol.mjs +2 -2
- package/dist/es/components/legend/hooks/useLegend.mjs +39 -60
- package/dist/es/components/legend/hooks/useLegendContent.mjs +1 -13
- package/dist/es/components/legend/type.mjs +11 -9
- package/dist/es/components/legend/utils.mjs +8 -4
- package/dist/es/components/tooltip/Cursor.mjs +118 -0
- package/dist/es/components/tooltip/DefaultTooltipContent.mjs +107 -0
- package/dist/es/components/tooltip/Tooltip.mjs +229 -0
- package/dist/es/components/tooltip/TooltipBoundingBox.mjs +187 -0
- package/dist/es/components/utils.mjs +26 -27
- package/dist/es/container/ClipPath.mjs +2 -2
- package/dist/es/container/Layer.mjs +2 -2
- package/dist/es/container/ResponsiveContainer.vue_vue_type_script_setup_true_lang.mjs +20 -106
- package/dist/es/container/Surface.mjs +46 -7
- package/dist/es/container/useSizeContext.mjs +12 -3
- package/dist/es/context/cartesianLabelListContext.mjs +11 -2
- package/dist/es/{cartesian/area/utils.mjs → core/area.mjs} +5 -4
- package/dist/es/core/axis/data.mjs +75 -0
- package/dist/es/core/axis/domain.mjs +63 -0
- package/dist/es/core/axis/key.mjs +13 -0
- package/dist/es/core/axis/polar.mjs +16 -0
- package/dist/es/core/axis/polarSettings.mjs +100 -0
- package/dist/es/core/axis/position.mjs +51 -0
- package/dist/es/core/axis/range.mjs +46 -0
- package/dist/es/core/axis/references.mjs +26 -0
- package/dist/es/core/axis/scale.mjs +148 -0
- package/dist/es/core/axis/settings.mjs +76 -0
- package/dist/es/core/axis/stacks.mjs +97 -0
- package/dist/es/core/axis/ticks.mjs +82 -0
- package/dist/es/{utils/isDomainSpecifiedByUser.mjs → core/axis/userDomain.mjs} +5 -4
- package/dist/es/{cartesian/bar/utils.mjs → core/bar.mjs} +19 -16
- package/dist/es/core/barSizing.mjs +108 -0
- package/dist/es/core/color.mjs +23 -0
- package/dist/es/core/coordinates.mjs +57 -0
- package/dist/es/core/data.mjs +20 -0
- package/dist/es/core/errorBar.mjs +56 -0
- package/dist/es/{cartesian/funnel/utils.mjs → core/funnel.mjs} +31 -11
- package/dist/es/core/interaction.mjs +152 -0
- package/dist/es/core/layout.mjs +91 -0
- package/dist/es/{cartesian/line/utils.mjs → core/line.mjs} +7 -6
- package/dist/es/{state/selectors/pieSelectors.mjs → core/pie.mjs} +37 -65
- package/dist/es/core/polygon.mjs +7 -0
- package/dist/es/core/radar.mjs +58 -0
- package/dist/es/core/radialBar.mjs +92 -0
- package/dist/es/core/rectangle.mjs +25 -0
- package/dist/es/core/scatter.mjs +86 -0
- package/dist/es/core/tooltip.mjs +96 -0
- package/dist/es/events/componentEvents.mjs +58 -0
- package/dist/es/events/delegateItemEvents.mjs +24 -0
- package/dist/es/events/itemEvents.mjs +34 -0
- package/dist/es/events/sync.mjs +140 -0
- package/dist/es/events/useChartCallbacks.mjs +24 -0
- package/dist/es/events/useChartInteractions.mjs +143 -0
- package/dist/es/events/useItemInteractions.mjs +58 -0
- package/dist/es/events/useItemKeyboard.mjs +45 -0
- package/dist/es/events/usePointEvents.mjs +55 -0
- package/dist/es/hooks/deferredView.mjs +19 -0
- package/dist/es/hooks/publicHooks.mjs +36 -35
- package/dist/es/hooks/useActiveTooltipDataPoints.mjs +10 -0
- package/dist/es/hooks/useChartId.mjs +8 -0
- package/dist/es/hooks/useLayerTeleport.mjs +10 -0
- package/dist/es/hooks/useResponsiveSize.mjs +72 -15
- package/dist/es/hooks/useRoundedSize.mjs +0 -3
- package/dist/es/hooks/useSeriesProps.mjs +32 -0
- package/dist/es/hooks/useSetupGraphicalItem.mjs +74 -44
- package/dist/es/hooks/useTrackedData.mjs +17 -0
- package/dist/es/index.mjs +37 -23
- package/dist/es/model/animation.mjs +11 -0
- package/dist/es/model/axis.mjs +85 -0
- package/dist/es/model/axisLayout.mjs +27 -0
- package/dist/es/model/axisScale.mjs +52 -0
- package/dist/es/model/brush.mjs +27 -0
- package/dist/es/model/chart.mjs +122 -0
- package/dist/es/model/dataRange.mjs +54 -0
- package/dist/es/model/defaults.mjs +28 -0
- package/dist/es/model/layout.mjs +33 -0
- package/dist/es/model/legend.mjs +30 -0
- package/dist/es/model/options.mjs +8 -0
- package/dist/es/model/polar.mjs +29 -0
- package/dist/es/model/polarAxis.mjs +48 -0
- package/dist/es/model/presentation.mjs +13 -0
- package/dist/es/model/registries.mjs +38 -0
- package/dist/es/model/registry.mjs +20 -0
- package/dist/es/model/runtime.mjs +156 -0
- package/dist/es/model/tooltip.mjs +383 -0
- package/dist/es/nuxt.mjs +28 -0
- package/dist/es/polar/pie/Pie.mjs +260 -112
- package/dist/es/polar/pie/type.mjs +19 -8
- package/dist/es/polar/radar/PolarAngleAxis.mjs +117 -99
- package/dist/es/polar/radar/PolarGrid.mjs +73 -50
- package/dist/es/polar/radar/PolarRadiusAxis.mjs +124 -100
- package/dist/es/polar/radar/Radar.mjs +272 -219
- package/dist/es/polar/radial-bar/RadialBar.mjs +248 -130
- package/dist/es/polar/radial-bar/type.mjs +6 -7
- package/dist/es/resolver.mjs +19 -0
- package/dist/es/shape/Cross.mjs +2 -1
- package/dist/es/shape/Curve.mjs +7 -5
- package/dist/es/shape/Dot.mjs +9 -5
- package/dist/es/shape/Polygon.mjs +4 -7
- package/dist/es/shape/Rectangle.mjs +17 -10
- package/dist/es/shape/Sector.mjs +7 -4
- package/dist/es/shape/Symbols.mjs +13 -8
- package/dist/es/shape/Trapezoid.mjs +3 -1
- package/dist/es/typed.mjs +9 -0
- package/dist/es/types/base.mjs +6 -0
- package/dist/es/utils/ReduceCSSCalc.mjs +2 -2
- package/dist/es/utils/VueUtils.mjs +89 -3
- package/dist/es/utils/attributes.mjs +18 -0
- package/dist/es/utils/attrs.mjs +38 -26
- package/dist/es/utils/cartesian.mjs +1 -21
- package/dist/es/utils/cell.mjs +13 -1
- package/dist/es/utils/chart.mjs +3 -361
- package/dist/es/utils/const.mjs +2 -25
- package/dist/es/utils/createCategoricalInverse.mjs +2 -2
- package/dist/es/utils/data-utils.mjs +2 -6
- package/dist/es/utils/data.mjs +1 -1
- package/dist/es/utils/env.mjs +10 -0
- package/dist/es/utils/events.mjs +29 -2
- package/dist/es/utils/labelColor.mjs +16 -0
- package/dist/es/utils/log.mjs +23 -5
- package/dist/es/utils/pointer.mjs +13 -0
- package/dist/es/utils/polar.mjs +7 -2
- package/dist/es/utils/scale/getNiceTickValues.mjs +8 -8
- package/dist/es/utils/scale/utils/arithmetic.mjs +0 -15
- package/dist/es/utils/scale/utils/utils.mjs +9 -44
- package/dist/es/utils/style.mjs +1 -1
- package/dist/es/utils/svg.mjs +320 -0
- package/dist/es/utils/theme.mjs +50 -0
- package/dist/es/utils/tick.mjs +4 -3
- package/dist/es/utils/validate.mjs +21 -3
- package/dist/events/componentEvents.d.ts +60 -0
- package/dist/events/delegateItemEvents.d.ts +12 -0
- package/dist/events/itemEvents.d.ts +100 -0
- package/dist/events/sync.d.ts +6 -0
- package/dist/events/useChartCallbacks.d.ts +2 -0
- package/dist/events/useChartInteractions.d.ts +8 -0
- package/dist/events/useItemInteractions.d.ts +7 -0
- package/dist/events/useItemKeyboard.d.ts +24 -0
- package/dist/events/usePointEvents.d.ts +23 -0
- package/dist/hooks/deferredView.d.ts +12 -0
- package/dist/hooks/publicHooks.d.ts +27 -29
- package/dist/hooks/useActiveTooltipDataPoints.d.ts +2 -0
- package/dist/hooks/useChartId.d.ts +2 -0
- package/dist/hooks/useLayerTeleport.d.ts +5 -0
- package/dist/hooks/useResponsiveSize.d.ts +33 -18
- package/dist/hooks/useRoundedSize.d.ts +0 -3
- package/dist/hooks/useSeriesProps.d.ts +7 -0
- package/dist/hooks/useSetupGraphicalItem.d.ts +35 -4
- package/dist/hooks/useTrackedData.d.ts +3 -0
- package/dist/index.d.ts +130 -9
- package/dist/model/animation.d.ts +7 -0
- package/dist/model/axis.d.ts +29 -0
- package/dist/model/axisLayout.d.ts +85 -0
- package/dist/model/axisScale.d.ts +41 -0
- package/dist/model/brush.d.ts +17 -0
- package/dist/model/chart.d.ts +44 -0
- package/dist/model/dataRange.d.ts +19 -0
- package/dist/model/defaults.d.ts +7 -0
- package/dist/model/layout.d.ts +38 -0
- package/dist/model/legend.d.ts +28 -0
- package/dist/model/options.d.ts +30 -0
- package/dist/model/polar.d.ts +24 -0
- package/dist/model/polarAxis.d.ts +39 -0
- package/dist/model/presentation.d.ts +19 -0
- package/dist/model/registries.d.ts +27 -0
- package/dist/model/registry.d.ts +7 -0
- package/dist/model/runtime.d.ts +76 -0
- package/dist/model/tooltip.d.ts +437 -0
- package/dist/nuxt.d.ts +7 -0
- package/dist/polar/pie/Pie.d.ts +252 -2
- package/dist/polar/pie/type.d.ts +37 -25
- package/dist/polar/radar/PolarAngleAxis.d.ts +36 -39
- package/dist/polar/radar/PolarGrid.d.ts +10 -8
- package/dist/polar/radar/PolarRadiusAxis.d.ts +30 -28
- package/dist/polar/radar/Radar.d.ts +82 -53
- package/dist/polar/radial-bar/RadialBar.d.ts +251 -2
- package/dist/polar/radial-bar/type.d.ts +26 -26
- package/dist/publicProps.d.ts +96 -0
- package/dist/resolver.d.ts +9 -0
- package/dist/shape/Cross.d.ts +2 -1
- package/dist/shape/Curve.d.ts +8 -19
- package/dist/shape/Dot.d.ts +10 -6
- package/dist/shape/Polygon.d.ts +2 -1
- package/dist/shape/Rectangle.d.ts +9 -8
- package/dist/shape/Sector.d.ts +7 -6
- package/dist/shape/Symbols.d.ts +3 -3
- package/dist/shape/Trapezoid.d.ts +5 -5
- package/dist/typed.d.ts +92 -0
- package/dist/types/area.d.ts +5 -6
- package/dist/types/axis.d.ts +9 -36
- package/dist/types/axisSettings.d.ts +20 -0
- package/dist/types/bar.d.ts +17 -7
- package/dist/types/base.d.ts +46 -0
- package/dist/types/categorical.d.ts +5 -7
- package/dist/types/chartData.d.ts +21 -0
- package/dist/types/chartLayout.d.ts +7 -0
- package/dist/{state/rootPropsSlice.d.ts → types/chartOptions.d.ts} +4 -5
- package/dist/types/common.d.ts +16 -55
- package/dist/types/event.d.ts +2 -15
- package/dist/types/funnel.d.ts +23 -0
- package/dist/types/graphical.d.ts +77 -0
- package/dist/types/index.d.ts +4 -4
- package/dist/types/legend.d.ts +17 -0
- package/dist/types/line.d.ts +6 -0
- package/dist/types/polarOptions.d.ts +8 -0
- package/dist/types/radar.d.ts +4 -4
- package/dist/types/radialBar.d.ts +15 -0
- package/dist/types/reference.d.ts +22 -0
- package/dist/types/scale.d.ts +13 -2
- package/dist/{shape/types.d.ts → types/shape.d.ts} +6 -4
- package/dist/types/tick.d.ts +18 -7
- package/dist/types/tooltip.d.ts +181 -14
- package/dist/types/typed.d.ts +16 -0
- package/dist/{cartesian/type.d.ts → types/viewBox.d.ts} +0 -2
- package/dist/utils/ReduceCSSCalc.d.ts +0 -1
- package/dist/utils/VueUtils.d.ts +6 -9
- package/dist/utils/attributes.d.ts +56 -0
- package/dist/utils/attrs.d.ts +4 -45
- package/dist/utils/cartesian.d.ts +2 -16
- package/dist/utils/cell.d.ts +7 -2
- package/dist/utils/chart.d.ts +2 -99
- package/dist/utils/const.d.ts +1 -24
- package/dist/utils/createCategoricalInverse.d.ts +2 -6
- package/dist/utils/data-utils.d.ts +0 -1
- package/dist/utils/data.d.ts +1 -2
- package/dist/utils/env.d.ts +5 -0
- package/dist/utils/events.d.ts +14 -7
- package/dist/utils/grid.d.ts +1 -28
- package/dist/utils/index.d.ts +4 -5
- package/dist/utils/isDomainSpecifiedByUser.d.ts +1 -47
- package/dist/utils/labelColor.d.ts +2 -0
- package/dist/utils/log.d.ts +2 -1
- package/dist/utils/pointer.d.ts +2 -0
- package/dist/utils/polar.d.ts +2 -4
- package/dist/utils/scale/getNiceTickValues.d.ts +2 -61
- package/dist/utils/scale/utils/arithmetic.d.ts +3 -31
- package/dist/utils/scale/utils/utils.d.ts +2 -9
- package/dist/utils/scale.d.ts +1 -1
- package/dist/utils/style.d.ts +2 -1
- package/dist/utils/svg.d.ts +4 -0
- package/dist/utils/theme.d.ts +4 -0
- package/dist/utils/tick.d.ts +3 -3
- package/dist/utils/tooltip/translate.d.ts +9 -25
- package/dist/utils/validate.d.ts +12 -4
- package/package.json +46 -29
- package/dist/animation/Animate.d.ts +0 -72
- package/dist/cartesian/area/ActivePoints.d.ts +0 -77
- package/dist/cartesian/area/ClipRect.d.ts +0 -1
- package/dist/cartesian/area/__stories__/config.d.ts +0 -31
- package/dist/cartesian/area/index.d.ts +0 -2
- package/dist/cartesian/area/utils.d.ts +0 -19
- package/dist/cartesian/axis/index.d.ts +0 -2
- package/dist/cartesian/axis/type.d.ts +0 -57
- package/dist/cartesian/bar/index.d.ts +0 -1
- package/dist/cartesian/bar/utils.d.ts +0 -31
- package/dist/cartesian/brush/hooks/useBrushSetting.d.ts +0 -6
- package/dist/cartesian/brush/index.d.ts +0 -2
- package/dist/cartesian/cartesian-axis/const.d.ts +0 -24
- package/dist/cartesian/cartesian-axis/index.d.ts +0 -1
- package/dist/cartesian/cartesian-axis/use-axis-line.d.ts +0 -7
- package/dist/cartesian/cartesian-grid/index.d.ts +0 -1
- package/dist/cartesian/error-bar/index.d.ts +0 -2
- package/dist/cartesian/funnel/index.d.ts +0 -2
- package/dist/cartesian/funnel/utils.d.ts +0 -12
- package/dist/cartesian/index.d.ts +0 -14
- package/dist/cartesian/line/ActivePoints.d.ts +0 -77
- package/dist/cartesian/line/index.d.ts +0 -3
- package/dist/cartesian/line/utils.d.ts +0 -13
- package/dist/cartesian/reference-area/index.d.ts +0 -1
- package/dist/cartesian/reference-dot/index.d.ts +0 -2
- package/dist/cartesian/reference-line/index.d.ts +0 -1
- package/dist/cartesian/scatter/index.d.ts +0 -1
- package/dist/cartesian/z-axis/index.d.ts +0 -1
- package/dist/chart/LegendPortalContext.d.ts +0 -3
- package/dist/chart/Surface.d.ts +0 -41
- package/dist/chart/TooltipPortalContext.d.ts +0 -2
- package/dist/chart/generateCategoricalChart.d.ts +0 -123
- package/dist/chart/index.d.ts +0 -12
- package/dist/chart/provideClipPathId.d.ts +0 -12
- package/dist/components/DefaultLegendContent.d.ts +0 -18
- package/dist/components/index.d.ts +0 -6
- package/dist/components/label/index.d.ts +0 -2
- package/dist/components/legend/index.d.ts +0 -2
- package/dist/container/RootSurface.d.ts +0 -17
- package/dist/container/index.d.ts +0 -1
- package/dist/context/ChartDataContextProvider.d.ts +0 -17
- package/dist/context/PanoramaContextProvider.d.ts +0 -22
- package/dist/context/accessibilityContext.d.ts +0 -1
- package/dist/context/chartLayoutContext.d.ts +0 -8
- package/dist/context/cursorLayerContext.d.ts +0 -2
- package/dist/context/graphicalLayerContext.d.ts +0 -2
- package/dist/context/labelLayerContext.d.ts +0 -2
- package/dist/context/useTooltipAxis.d.ts +0 -2
- package/dist/es/animation/Animate.mjs +0 -89
- package/dist/es/cartesian/area/ActivePoints.mjs +0 -78
- package/dist/es/cartesian/area/ClipRect.mjs +0 -125
- package/dist/es/cartesian/line/ActivePoints.mjs +0 -79
- package/dist/es/chart/LegendPortalContext.mjs +0 -5
- package/dist/es/chart/Surface.mjs +0 -5
- package/dist/es/chart/Surface.vue_vue_type_script_setup_true_lang.mjs +0 -78
- package/dist/es/chart/TooltipPortalContext.mjs +0 -5
- package/dist/es/chart/generateCategoricalChart.mjs +0 -184
- package/dist/es/chart/provideClipPathId.mjs +0 -15
- package/dist/es/components/Tooltip.mjs +0 -479
- package/dist/es/context/ChartDataContextProvider.mjs +0 -27
- package/dist/es/context/PanoramaContextProvider.mjs +0 -24
- package/dist/es/context/accessibilityContext.mjs +0 -5
- package/dist/es/context/chartLayoutContext.mjs +0 -49
- package/dist/es/context/cursorLayerContext.mjs +0 -5
- package/dist/es/context/graphicalLayerContext.mjs +0 -5
- package/dist/es/context/labelLayerContext.mjs +0 -5
- package/dist/es/context/useTooltipAxis.mjs +0 -17
- package/dist/es/events/useChartSynchronisation.mjs +0 -113
- package/dist/es/hooks/useIsAnimating.mjs +0 -28
- package/dist/es/state/ReportChartProps.mjs +0 -62
- package/dist/es/state/ReportMainChartProps.mjs +0 -46
- package/dist/es/state/ReportPolarOptions.mjs +0 -56
- package/dist/es/state/SetGraphicalItem.mjs +0 -49
- package/dist/es/state/SetLegendPayload.mjs +0 -20
- package/dist/es/state/SetTooltipEntrySettings.mjs +0 -19
- package/dist/es/state/brushSlice.mjs +0 -26
- package/dist/es/state/cartesianAxisSlice.mjs +0 -50
- package/dist/es/state/chartDataSlice.mjs +0 -33
- package/dist/es/state/externalEventsMiddleware.mjs +0 -30
- package/dist/es/state/graphicalItemsSlice.mjs +0 -47
- package/dist/es/state/hooks.mjs +0 -26
- package/dist/es/state/keyboardEventsMiddleware.mjs +0 -63
- package/dist/es/state/layoutSlice.mjs +0 -39
- package/dist/es/state/legendSlice.mjs +0 -42
- package/dist/es/state/mouseEventsMiddleware.mjs +0 -41
- package/dist/es/state/optionsSlice.mjs +0 -25
- package/dist/es/state/polarAxisSlice.mjs +0 -28
- package/dist/es/state/polarOptionsSlice.mjs +0 -13
- package/dist/es/state/reduxDevtoolsJsonStringifyReplacer.mjs +0 -8
- package/dist/es/state/referenceElementsSlice.mjs +0 -36
- package/dist/es/state/rootPropsSlice.mjs +0 -32
- package/dist/es/state/selectors/areaSelectors.mjs +0 -77
- package/dist/es/state/selectors/axisSelectors.mjs +0 -908
- package/dist/es/state/selectors/barSelectors.mjs +0 -241
- package/dist/es/state/selectors/brushSelectors.mjs +0 -18
- package/dist/es/state/selectors/combiners/combineActiveLabel.mjs +0 -9
- package/dist/es/state/selectors/combiners/combineActiveTooltipIndex.mjs +0 -43
- package/dist/es/state/selectors/combiners/combineAxisRangeWithReverse.mjs +0 -8
- package/dist/es/state/selectors/combiners/combineCoordinateForDefaultIndex.mjs +0 -21
- package/dist/es/state/selectors/combiners/combineTooltipInteractionState.mjs +0 -37
- package/dist/es/state/selectors/combiners/combineTooltipPayloadConfigurations.mjs +0 -13
- package/dist/es/state/selectors/common.mjs +0 -4
- package/dist/es/state/selectors/containerSelectors.mjs +0 -7
- package/dist/es/state/selectors/dataSelectors.mjs +0 -35
- package/dist/es/state/selectors/funnelSelectors.mjs +0 -38
- package/dist/es/state/selectors/legendSelectors.mjs +0 -10
- package/dist/es/state/selectors/lineSelectors.mjs +0 -64
- package/dist/es/state/selectors/pickAxisId.mjs +0 -4
- package/dist/es/state/selectors/pickAxisType.mjs +0 -4
- package/dist/es/state/selectors/polarAxisSelectors.mjs +0 -167
- package/dist/es/state/selectors/polarGridSelectors.mjs +0 -19
- package/dist/es/state/selectors/polarScaleSelectors.mjs +0 -55
- package/dist/es/state/selectors/polarSelectors.mjs +0 -81
- package/dist/es/state/selectors/radarSelectors.mjs +0 -133
- package/dist/es/state/selectors/radialBarSelectors.mjs +0 -259
- package/dist/es/state/selectors/rootPropsSelectors.mjs +0 -14
- package/dist/es/state/selectors/scatterSelectors.mjs +0 -134
- package/dist/es/state/selectors/selectActivePropsFromChartPointer.mjs +0 -20
- package/dist/es/state/selectors/selectAllAxes.mjs +0 -10
- package/dist/es/state/selectors/selectChartOffset.mjs +0 -72
- package/dist/es/state/selectors/selectChartOffsetInternal.mjs +0 -66
- package/dist/es/state/selectors/selectLegendArea.mjs +0 -19
- package/dist/es/state/selectors/selectTooltipEventType.mjs +0 -22
- package/dist/es/state/selectors/selectTooltipPayloadSearcher.mjs +0 -6
- package/dist/es/state/selectors/selectTooltipSettings.mjs +0 -4
- package/dist/es/state/selectors/selectTooltipState.mjs +0 -4
- package/dist/es/state/selectors/selectors.mjs +0 -104
- package/dist/es/state/selectors/tooltipSelectors.mjs +0 -269
- package/dist/es/state/selectors/touchSelectors.mjs +0 -19
- package/dist/es/state/store.mjs +0 -55
- package/dist/es/state/tooltipSlice.mjs +0 -102
- package/dist/es/state/touchEventsMiddleware.mjs +0 -44
- package/dist/es/state/utils/useReportScale.mjs +0 -19
- package/dist/es/synchronisation/syncSelectors.mjs +0 -6
- package/dist/es/synchronisation/useChartSynchronisation.mjs +0 -38
- package/dist/es/utils/Global.mjs +0 -18
- package/dist/es/utils/createContext.mjs +0 -31
- package/dist/es/utils/legend.mjs +0 -41
- package/dist/es/utils/props.mjs +0 -20
- package/dist/es/utils/resolveDefaultProps.mjs +0 -26
- package/dist/events/useChartSynchronisation.d.ts +0 -8
- package/dist/hooks/useIsAnimating.d.ts +0 -14
- package/dist/polar/index.d.ts +0 -3
- package/dist/polar/pie/index.d.ts +0 -2
- package/dist/polar/radar/index.d.ts +0 -4
- package/dist/polar/radial-bar/index.d.ts +0 -2
- package/dist/shape/index.d.ts +0 -10
- package/dist/state/ReportBar.d.ts +0 -1
- package/dist/state/ReportChartProps.d.ts +0 -88
- package/dist/state/ReportMainChartProps.d.ts +0 -37
- package/dist/state/ReportPolarOptions.d.ts +0 -59
- package/dist/state/SetGraphicalItem.d.ts +0 -9
- package/dist/state/SetLegendPayload.d.ts +0 -3
- package/dist/state/SetTooltipEntrySettings.d.ts +0 -8
- package/dist/state/brushSlice.d.ts +0 -18
- package/dist/state/cartesianAxisSlice.d.ts +0 -96
- package/dist/state/chartDataSlice.d.ts +0 -44
- package/dist/state/externalEventsMiddleware.d.ts +0 -17
- package/dist/state/graphicalItemsSlice.d.ts +0 -108
- package/dist/state/hooks.d.ts +0 -54
- package/dist/state/keyboardEventsMiddleware.d.ts +0 -3
- package/dist/state/layoutSlice.d.ts +0 -15
- package/dist/state/legendSlice.d.ts +0 -29
- package/dist/state/mouseEventsMiddleware.d.ts +0 -5
- package/dist/state/optionsSlice.d.ts +0 -27
- package/dist/state/polarAxisSlice.d.ts +0 -10
- package/dist/state/polarOptionsSlice.d.ts +0 -10
- package/dist/state/reduxDevtoolsJsonStringifyReplacer.d.ts +0 -1
- package/dist/state/referenceElementsSlice.d.ts +0 -40
- package/dist/state/selectors/areaSelectors.d.ts +0 -24
- package/dist/state/selectors/axisSelectors.d.ts +0 -1833
- package/dist/state/selectors/barSelectors.d.ts +0 -944
- package/dist/state/selectors/brushSelectors.d.ts +0 -10
- package/dist/state/selectors/combiners/combineActiveLabel.d.ts +0 -3
- package/dist/state/selectors/combiners/combineActiveTooltipIndex.d.ts +0 -5
- package/dist/state/selectors/combiners/combineAxisRangeWithReverse.d.ts +0 -3
- package/dist/state/selectors/combiners/combineCoordinateForDefaultIndex.d.ts +0 -3
- package/dist/state/selectors/combiners/combineTooltipInteractionState.d.ts +0 -3
- package/dist/state/selectors/combiners/combineTooltipPayloadConfigurations.d.ts +0 -3
- package/dist/state/selectors/common.d.ts +0 -2
- package/dist/state/selectors/containerSelectors.d.ts +0 -6
- package/dist/state/selectors/dataSelectors.d.ts +0 -23
- package/dist/state/selectors/funnelSelectors.d.ts +0 -69
- package/dist/state/selectors/legendSelectors.d.ts +0 -7
- package/dist/state/selectors/lineSelectors.d.ts +0 -123
- package/dist/state/selectors/pickAxisId.d.ts +0 -3
- package/dist/state/selectors/pickAxisType.d.ts +0 -2
- package/dist/state/selectors/polarAxisSelectors.d.ts +0 -49
- package/dist/state/selectors/polarGridSelectors.d.ts +0 -118
- package/dist/state/selectors/polarScaleSelectors.d.ts +0 -9
- package/dist/state/selectors/polarSelectors.d.ts +0 -70
- package/dist/state/selectors/radarSelectors.d.ts +0 -76
- package/dist/state/selectors/radialBarSelectors.d.ts +0 -61
- package/dist/state/selectors/rootPropsSelectors.d.ts +0 -11
- package/dist/state/selectors/scatterSelectors.d.ts +0 -21
- package/dist/state/selectors/selectActivePropsFromChartPointer.d.ts +0 -382
- package/dist/state/selectors/selectAllAxes.d.ts +0 -4
- package/dist/state/selectors/selectChartOffset.d.ts +0 -116
- package/dist/state/selectors/selectChartOffsetInternal.d.ts +0 -9
- package/dist/state/selectors/selectLegendArea.d.ts +0 -7
- package/dist/state/selectors/selectTooltipEventType.d.ts +0 -8
- package/dist/state/selectors/selectTooltipPayloadSearcher.d.ts +0 -3
- package/dist/state/selectors/selectTooltipSettings.d.ts +0 -3
- package/dist/state/selectors/selectTooltipState.d.ts +0 -3
- package/dist/state/selectors/selectors.d.ts +0 -184
- package/dist/state/selectors/tooltipSelectors.d.ts +0 -581
- package/dist/state/selectors/touchSelectors.d.ts +0 -4
- package/dist/state/store.d.ts +0 -74
- package/dist/state/tooltipSlice.d.ts +0 -204
- package/dist/state/touchEventsMiddleware.d.ts +0 -2
- package/dist/state/utils/useReportScale.d.ts +0 -1
- package/dist/synchronisation/syncSelectors.d.ts +0 -3
- package/dist/synchronisation/useChartSynchronisation.d.ts +0 -11
- package/dist/types/offset.d.ts +0 -8
- package/dist/utils/Global.d.ts +0 -9
- package/dist/utils/context.d.ts +0 -8
- package/dist/utils/createContext.d.ts +0 -8
- package/dist/utils/legend.d.ts +0 -3
- package/dist/utils/props.d.ts +0 -15
- package/dist/utils/resolveDefaultProps.d.ts +0 -52
|
@@ -1,47 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { getMaxRadius, polarToCartesian } from "
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
import { createSelector } from "@reduxjs/toolkit";
|
|
9
|
-
//#region src/state/selectors/pieSelectors.ts
|
|
10
|
-
var pickPieSettings = (_state, pieSettings) => pieSettings;
|
|
11
|
-
var EMPTY_CELLS = [];
|
|
12
|
-
function pickCells(_state, _pieSettings) {
|
|
13
|
-
return EMPTY_CELLS;
|
|
14
|
-
}
|
|
15
|
-
var selectDisplayedData = createSelector([
|
|
16
|
-
selectChartDataAndAlwaysIgnoreIndexes,
|
|
17
|
-
pickPieSettings,
|
|
18
|
-
pickCells
|
|
19
|
-
], ({ chartData }, pieSettings, cells) => {
|
|
20
|
-
let displayedData;
|
|
21
|
-
if (pieSettings.data != null && pieSettings.data.length > 0) displayedData = pieSettings.data;
|
|
22
|
-
else displayedData = chartData;
|
|
23
|
-
if (!displayedData || !displayedData.length) {}
|
|
24
|
-
if (displayedData == null) return;
|
|
25
|
-
return displayedData;
|
|
26
|
-
});
|
|
27
|
-
var selectPieLegend = createSelector([selectDisplayedData, pickPieSettings], (displayedData, pieSettings) => {
|
|
28
|
-
if (displayedData == null) return;
|
|
29
|
-
return displayedData.map((entry, i) => {
|
|
30
|
-
const name = getValueByDataKey(entry, pieSettings.nameKey, pieSettings.name);
|
|
31
|
-
let color;
|
|
32
|
-
if (typeof entry === "object" && entry != null && "fill" in entry && typeof entry.fill === "string") color = entry.fill;
|
|
33
|
-
else color = pieSettings.fill;
|
|
34
|
-
return {
|
|
35
|
-
value: name ?? String(pieSettings.dataKey ?? i),
|
|
36
|
-
color,
|
|
37
|
-
payload: entry,
|
|
38
|
-
type: pieSettings.legendType
|
|
39
|
-
};
|
|
40
|
-
});
|
|
41
|
-
});
|
|
42
|
-
var selectSynchronisedPieSettings = createSelector([selectUnfilteredPolarItems, pickPieSettings], (graphicalItems, pieSettingsFromProps) => {
|
|
43
|
-
if (graphicalItems.some((pgis) => pgis.type === "pie" && pieSettingsFromProps.dataKey === pgis.dataKey)) return pieSettingsFromProps;
|
|
44
|
-
});
|
|
1
|
+
import { toFiniteNumber } from "../utils/validate.mjs";
|
|
2
|
+
import { getPercentValue, mathSign } from "../utils/data.mjs";
|
|
3
|
+
import { getValueByDataKey } from "./data.mjs";
|
|
4
|
+
import { getTooltipNameProp } from "./tooltip.mjs";
|
|
5
|
+
import { getMaxRadius, polarToCartesian } from "../utils/polar.mjs";
|
|
6
|
+
import { entryColor } from "./color.mjs";
|
|
7
|
+
//#region src/core/pie.ts
|
|
45
8
|
function parseDeltaAngle(startAngle, endAngle) {
|
|
46
9
|
return mathSign(endAngle - startAngle) * Math.min(Math.abs(endAngle - startAngle), 360);
|
|
47
10
|
}
|
|
@@ -63,28 +26,34 @@ function parseCoordinateOfPie(pieSettings, offset, dataPoint) {
|
|
|
63
26
|
function computePieSectors({ pieSettings, displayedData, offset }) {
|
|
64
27
|
if (!displayedData || displayedData.length === 0) return;
|
|
65
28
|
const { cornerRadius, dataKey, nameKey, tooltipType } = pieSettings;
|
|
29
|
+
if (dataKey == null) return void 0;
|
|
66
30
|
const startAngle = pieSettings.startAngle ?? 0;
|
|
67
31
|
const endAngle = pieSettings.endAngle ?? 360;
|
|
68
32
|
const minAngle = Math.abs(pieSettings.minAngle ?? 0);
|
|
69
33
|
const deltaAngle = parseDeltaAngle(startAngle, endAngle);
|
|
70
34
|
const absDeltaAngle = Math.abs(deltaAngle);
|
|
71
35
|
const paddingAngle = displayedData.length <= 1 ? 0 : pieSettings.paddingAngle ?? 0;
|
|
72
|
-
const
|
|
36
|
+
const values = displayedData.map((entry) => {
|
|
37
|
+
const value = getValueByDataKey(entry, dataKey);
|
|
38
|
+
return toFiniteNumber(value) ?? 0;
|
|
39
|
+
});
|
|
40
|
+
const notZeroItemCount = values.filter((value) => value !== 0).length;
|
|
73
41
|
const totalPaddingAngle = (absDeltaAngle >= 360 ? notZeroItemCount : notZeroItemCount - 1) * paddingAngle;
|
|
74
42
|
const realTotalAngle = absDeltaAngle - notZeroItemCount * minAngle - totalPaddingAngle;
|
|
75
|
-
const sum =
|
|
76
|
-
const val = getValueByDataKey(entry, dataKey, 0);
|
|
77
|
-
return result + (isNumber(val) ? val : 0);
|
|
78
|
-
}, 0);
|
|
43
|
+
const sum = values.reduce((result, value) => result + value, 0);
|
|
79
44
|
if (sum <= 0) return;
|
|
80
45
|
let prev;
|
|
81
46
|
return displayedData.map((entry, i) => {
|
|
82
|
-
const val =
|
|
47
|
+
const val = values[i];
|
|
83
48
|
const name = getValueByDataKey(entry, nameKey, i);
|
|
84
49
|
const coordinate = parseCoordinateOfPie(pieSettings, offset, entry);
|
|
85
|
-
const percent =
|
|
50
|
+
const percent = val / sum;
|
|
86
51
|
const entryWithInfo = { ...entry };
|
|
87
|
-
const sectorColor =
|
|
52
|
+
const sectorColor = entryColor({
|
|
53
|
+
row: entry,
|
|
54
|
+
seriesFill: pieSettings.fill,
|
|
55
|
+
index: i
|
|
56
|
+
});
|
|
88
57
|
let tempStartAngle;
|
|
89
58
|
if (i) tempStartAngle = prev.endAngle + mathSign(deltaAngle) * paddingAngle * (val !== 0 ? 1 : 0);
|
|
90
59
|
else tempStartAngle = startAngle;
|
|
@@ -115,18 +84,21 @@ function computePieSectors({ pieSettings, displayedData, offset }) {
|
|
|
115
84
|
return prev;
|
|
116
85
|
});
|
|
117
86
|
}
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
87
|
+
function pieLegend(displayedData, settings, cells = []) {
|
|
88
|
+
return displayedData?.map((entry, index) => {
|
|
89
|
+
const name = getValueByDataKey(entry, settings.nameKey, settings.name);
|
|
90
|
+
return {
|
|
91
|
+
value: String(name ?? getTooltipNameProp(void 0, settings.dataKey) ?? index),
|
|
92
|
+
color: entryColor({
|
|
93
|
+
cell: cells[index],
|
|
94
|
+
row: entry,
|
|
95
|
+
seriesFill: settings.fill,
|
|
96
|
+
index
|
|
97
|
+
}),
|
|
98
|
+
payload: entry,
|
|
99
|
+
type: settings.legendType
|
|
100
|
+
};
|
|
129
101
|
});
|
|
130
|
-
}
|
|
102
|
+
}
|
|
131
103
|
//#endregion
|
|
132
|
-
export { computePieSectors,
|
|
104
|
+
export { computePieSectors, pieLegend };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
//#region src/core/polygon.ts
|
|
2
|
+
/** A closed SVG path through the points: `Mx,yLx,y…Z`. */
|
|
3
|
+
function polygonPath(points) {
|
|
4
|
+
return points.length ? `${points.map((point, i) => `${i === 0 ? "M" : "L"}${point.x},${point.y}`).join("")}Z` : "";
|
|
5
|
+
}
|
|
6
|
+
//#endregion
|
|
7
|
+
export { polygonPath };
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { toFiniteNumber } from "../utils/validate.mjs";
|
|
2
|
+
import { getValueByDataKey } from "./data.mjs";
|
|
3
|
+
import { polarToCartesian } from "../utils/polar.mjs";
|
|
4
|
+
import { polygonPath } from "./polygon.mjs";
|
|
5
|
+
import { last } from "es-toolkit/compat";
|
|
6
|
+
//#region src/core/radar.ts
|
|
7
|
+
function computeRadarPoints({ radiusAxis, angleAxis, displayedData, dataKey, bandSize }) {
|
|
8
|
+
const { cx, cy } = angleAxis;
|
|
9
|
+
let isRange = false;
|
|
10
|
+
const points = [];
|
|
11
|
+
const angleBandSize = angleAxis.type !== "number" ? bandSize ?? 0 : 0;
|
|
12
|
+
displayedData.forEach((entry, i) => {
|
|
13
|
+
const name = getValueByDataKey(entry, angleAxis.dataKey, i);
|
|
14
|
+
const value = getValueByDataKey(entry, dataKey);
|
|
15
|
+
const angle = (angleAxis.scale(name) ?? 0) + angleBandSize;
|
|
16
|
+
const pointValue = toFiniteNumber(Array.isArray(value) ? last(value) : value);
|
|
17
|
+
const radius = pointValue == null ? 0 : radiusAxis.scale(pointValue) ?? 0;
|
|
18
|
+
if (Array.isArray(value) && value.length >= 2) isRange = true;
|
|
19
|
+
points.push({
|
|
20
|
+
...polarToCartesian(cx, cy, radius, angle),
|
|
21
|
+
name,
|
|
22
|
+
value,
|
|
23
|
+
cx,
|
|
24
|
+
cy,
|
|
25
|
+
radius,
|
|
26
|
+
angle,
|
|
27
|
+
payload: entry
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
const baseLinePoints = [];
|
|
31
|
+
if (isRange) points.forEach((point) => {
|
|
32
|
+
if (Array.isArray(point.value)) {
|
|
33
|
+
const baseValue = toFiniteNumber(point.value[0]);
|
|
34
|
+
const radius = baseValue == null ? 0 : radiusAxis.scale(baseValue) ?? 0;
|
|
35
|
+
baseLinePoints.push({
|
|
36
|
+
...point,
|
|
37
|
+
radius,
|
|
38
|
+
...polarToCartesian(cx, cy, radius, point.angle)
|
|
39
|
+
});
|
|
40
|
+
} else baseLinePoints.push(point);
|
|
41
|
+
});
|
|
42
|
+
return {
|
|
43
|
+
points,
|
|
44
|
+
isRange,
|
|
45
|
+
baseLinePoints
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
function getSinglePolygonPath(points) {
|
|
49
|
+
if (!points.length) return "";
|
|
50
|
+
return polygonPath([...points, points[0]]);
|
|
51
|
+
}
|
|
52
|
+
function getRangePath(points, baseLinePoints) {
|
|
53
|
+
const outerPath = getSinglePolygonPath(points);
|
|
54
|
+
const inner = getSinglePolygonPath([...baseLinePoints].reverse());
|
|
55
|
+
return `${outerPath.endsWith("Z") ? outerPath.slice(0, -1) : outerPath}L${inner.slice(1)}`;
|
|
56
|
+
}
|
|
57
|
+
//#endregion
|
|
58
|
+
export { computeRadarPoints, getRangePath, getSinglePolygonPath };
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { toFiniteNumber } from "../utils/validate.mjs";
|
|
2
|
+
import { mathSign } from "../utils/data.mjs";
|
|
3
|
+
import { getValueByDataKey } from "./data.mjs";
|
|
4
|
+
import { getCateCoordinateOfBar, truncateByDomain } from "./coordinates.mjs";
|
|
5
|
+
//#region src/core/radialBar.ts
|
|
6
|
+
function computeRadialBarDataItems({ displayedData, stackedData, dataStartIndex, stackedDomain, dataKey, baseValue, layout, radiusAxis, radiusAxisTicks, bandSize, pos, angleAxis, minPointSize, cx, cy, angleAxisTicks, startAngle: rootStartAngle, endAngle: rootEndAngle }) {
|
|
7
|
+
const size = pos.size;
|
|
8
|
+
if (size == null) return [];
|
|
9
|
+
return (displayedData ?? []).flatMap((entry, index) => {
|
|
10
|
+
let value, innerRadius, outerRadius, startAngle, endAngle, backgroundSector;
|
|
11
|
+
if (stackedData) value = truncateByDomain(stackedData[dataStartIndex + index], stackedDomain);
|
|
12
|
+
else {
|
|
13
|
+
const rawValue = getValueByDataKey(entry, dataKey);
|
|
14
|
+
value = Array.isArray(rawValue) ? rawValue : [baseValue, rawValue];
|
|
15
|
+
}
|
|
16
|
+
const valueAxis = layout === "radial" ? angleAxis : radiusAxis;
|
|
17
|
+
if (value.some((part) => valueAxis.type === "number" ? toFiniteNumber(part) == null : typeof part === "number" && !Number.isFinite(part))) return [];
|
|
18
|
+
if (layout === "radial") {
|
|
19
|
+
startAngle = angleAxis.scale(value[0]) ?? rootStartAngle;
|
|
20
|
+
endAngle = angleAxis.scale(value[1]) ?? rootEndAngle;
|
|
21
|
+
innerRadius = getCateCoordinateOfBar({
|
|
22
|
+
axis: radiusAxis,
|
|
23
|
+
ticks: radiusAxisTicks,
|
|
24
|
+
bandSize,
|
|
25
|
+
offset: pos.offset,
|
|
26
|
+
entry,
|
|
27
|
+
index
|
|
28
|
+
});
|
|
29
|
+
if (innerRadius != null) innerRadius = innerRadius - bandSize / 2;
|
|
30
|
+
if (innerRadius != null && endAngle != null && startAngle != null) {
|
|
31
|
+
outerRadius = innerRadius + size;
|
|
32
|
+
const deltaAngle = endAngle - startAngle;
|
|
33
|
+
if (Math.abs(minPointSize) > 0 && Math.abs(deltaAngle) < Math.abs(minPointSize)) {
|
|
34
|
+
const delta = mathSign(deltaAngle || minPointSize) * (Math.abs(minPointSize) - Math.abs(deltaAngle));
|
|
35
|
+
endAngle += delta;
|
|
36
|
+
}
|
|
37
|
+
backgroundSector = { background: {
|
|
38
|
+
cx,
|
|
39
|
+
cy,
|
|
40
|
+
innerRadius,
|
|
41
|
+
outerRadius,
|
|
42
|
+
startAngle: rootStartAngle,
|
|
43
|
+
endAngle: rootEndAngle
|
|
44
|
+
} };
|
|
45
|
+
}
|
|
46
|
+
} else {
|
|
47
|
+
innerRadius = radiusAxis.scale(value[0]);
|
|
48
|
+
outerRadius = radiusAxis.scale(value[1]);
|
|
49
|
+
startAngle = getCateCoordinateOfBar({
|
|
50
|
+
axis: angleAxis,
|
|
51
|
+
ticks: angleAxisTicks,
|
|
52
|
+
bandSize,
|
|
53
|
+
offset: pos.offset,
|
|
54
|
+
entry,
|
|
55
|
+
index
|
|
56
|
+
});
|
|
57
|
+
if (innerRadius != null && outerRadius != null && startAngle != null) {
|
|
58
|
+
endAngle = startAngle + size;
|
|
59
|
+
const deltaRadius = outerRadius - innerRadius;
|
|
60
|
+
if (Math.abs(minPointSize) > 0 && Math.abs(deltaRadius) < Math.abs(minPointSize)) {
|
|
61
|
+
const delta = mathSign(deltaRadius || minPointSize) * (Math.abs(minPointSize) - Math.abs(deltaRadius));
|
|
62
|
+
outerRadius += delta;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return {
|
|
67
|
+
...Object(entry),
|
|
68
|
+
...backgroundSector,
|
|
69
|
+
payload: entry,
|
|
70
|
+
value: stackedData ? value : value[1],
|
|
71
|
+
cx,
|
|
72
|
+
cy,
|
|
73
|
+
innerRadius,
|
|
74
|
+
outerRadius,
|
|
75
|
+
startAngle,
|
|
76
|
+
endAngle
|
|
77
|
+
};
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
function radialBarLegend(data, legendType) {
|
|
81
|
+
return (data ?? []).map((row) => {
|
|
82
|
+
const entry = typeof row === "object" && row != null || typeof row === "function" ? row : {};
|
|
83
|
+
return {
|
|
84
|
+
type: legendType,
|
|
85
|
+
value: "name" in entry ? entry.name : void 0,
|
|
86
|
+
color: "fill" in entry ? entry.fill : void 0,
|
|
87
|
+
payload: row
|
|
88
|
+
};
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
//#endregion
|
|
92
|
+
export { computeRadialBarDataItems, radialBarLegend };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
//#region src/core/rectangle.ts
|
|
2
|
+
/**
|
|
3
|
+
* Normalizes the angle so that 0 <= angle < 180.
|
|
4
|
+
* @param {number} angle Angle in degrees.
|
|
5
|
+
* @return {number} the normalized angle with a value of at least 0 and never greater or equal to 180.
|
|
6
|
+
*/
|
|
7
|
+
function normalizeAngle(angle) {
|
|
8
|
+
return (angle % 180 + 180) % 180;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Calculates the width of the largest horizontal line that fits inside a rectangle that is displayed at an angle.
|
|
12
|
+
* @param {object} size Width and height of the text in a horizontal position.
|
|
13
|
+
* @param {number} size.width Horizontal text width.
|
|
14
|
+
* @param {number} size.height Horizontal text height.
|
|
15
|
+
* @param {number} angle Angle in degrees in which the text is displayed.
|
|
16
|
+
* @return {number} The width of the largest horizontal line that fits inside a rectangle that is displayed at an angle.
|
|
17
|
+
*/
|
|
18
|
+
function getAngledRectangleWidth({ width, height }, angle = 0) {
|
|
19
|
+
const angleRadians = normalizeAngle(angle) * Math.PI / 180;
|
|
20
|
+
const angleThreshold = Math.atan(height / width);
|
|
21
|
+
const angledWidth = angleRadians > angleThreshold && angleRadians < Math.PI - angleThreshold ? height / Math.sin(angleRadians) : width / Math.cos(angleRadians);
|
|
22
|
+
return Math.abs(angledWidth);
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
25
|
+
export { getAngledRectangleWidth };
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { isNullish, toFiniteNumber } from "../utils/validate.mjs";
|
|
2
|
+
import { getValueByDataKey } from "./data.mjs";
|
|
3
|
+
import { getTooltipNameProp } from "./tooltip.mjs";
|
|
4
|
+
import { implicitZAxis } from "./axis/settings.mjs";
|
|
5
|
+
import { getCateCoordinateOfLine } from "./coordinates.mjs";
|
|
6
|
+
//#region src/core/scatter.ts
|
|
7
|
+
function computeScatterPoints({ displayedData, xAxis, yAxis, zAxis, scatterSettings, xAxisTicks, yAxisTicks }) {
|
|
8
|
+
const xAxisDataKey = isNullish(xAxis.dataKey) ? scatterSettings.dataKey : xAxis.dataKey;
|
|
9
|
+
const yAxisDataKey = isNullish(yAxis.dataKey) ? scatterSettings.dataKey : yAxis.dataKey;
|
|
10
|
+
const zAxisDataKey = zAxis && zAxis.dataKey;
|
|
11
|
+
const defaultRangeZ = zAxis ? zAxis.range : implicitZAxis.range;
|
|
12
|
+
const defaultZ = defaultRangeZ && defaultRangeZ[0];
|
|
13
|
+
const xBandSize = xAxis.scale.bandwidth ? xAxis.scale.bandwidth() : 0;
|
|
14
|
+
const yBandSize = yAxis.scale.bandwidth ? yAxis.scale.bandwidth() : 0;
|
|
15
|
+
return displayedData.map((rawEntry, index) => {
|
|
16
|
+
const entry = rawEntry;
|
|
17
|
+
const x = getValueByDataKey(entry, xAxisDataKey);
|
|
18
|
+
const y = getValueByDataKey(entry, yAxisDataKey);
|
|
19
|
+
const z = !isNullish(zAxisDataKey) && getValueByDataKey(entry, zAxisDataKey) || "-";
|
|
20
|
+
const tooltipPayload = [{
|
|
21
|
+
name: isNullish(xAxis.dataKey) ? scatterSettings.name : xAxis.name || getTooltipNameProp(void 0, xAxis.dataKey),
|
|
22
|
+
unit: xAxis.unit || "",
|
|
23
|
+
value: x,
|
|
24
|
+
payload: entry,
|
|
25
|
+
dataKey: xAxisDataKey,
|
|
26
|
+
type: scatterSettings.tooltipType
|
|
27
|
+
}, {
|
|
28
|
+
name: isNullish(yAxis.dataKey) ? scatterSettings.name : yAxis.name || getTooltipNameProp(void 0, yAxis.dataKey),
|
|
29
|
+
unit: yAxis.unit || "",
|
|
30
|
+
value: y,
|
|
31
|
+
payload: entry,
|
|
32
|
+
dataKey: yAxisDataKey,
|
|
33
|
+
type: scatterSettings.tooltipType
|
|
34
|
+
}];
|
|
35
|
+
if (z !== "-" && zAxis != null) tooltipPayload.push({
|
|
36
|
+
name: zAxis.name || getTooltipNameProp(void 0, zAxis.dataKey),
|
|
37
|
+
unit: zAxis.unit || "",
|
|
38
|
+
value: z,
|
|
39
|
+
payload: entry,
|
|
40
|
+
dataKey: zAxisDataKey,
|
|
41
|
+
type: scatterSettings.tooltipType
|
|
42
|
+
});
|
|
43
|
+
const cx = getCateCoordinateOfLine({
|
|
44
|
+
axis: xAxis,
|
|
45
|
+
ticks: xAxisTicks,
|
|
46
|
+
bandSize: xBandSize,
|
|
47
|
+
entry,
|
|
48
|
+
index,
|
|
49
|
+
dataKey: xAxisDataKey
|
|
50
|
+
});
|
|
51
|
+
const cy = getCateCoordinateOfLine({
|
|
52
|
+
axis: yAxis,
|
|
53
|
+
ticks: yAxisTicks,
|
|
54
|
+
bandSize: yBandSize,
|
|
55
|
+
entry,
|
|
56
|
+
index,
|
|
57
|
+
dataKey: yAxisDataKey
|
|
58
|
+
});
|
|
59
|
+
const finiteZ = toFiniteNumber(z);
|
|
60
|
+
const size = finiteZ != null && zAxis != null ? zAxis.scale(finiteZ) : defaultZ;
|
|
61
|
+
const radius = size == null ? 0 : Math.sqrt(Math.max(size, 0) / Math.PI);
|
|
62
|
+
return {
|
|
63
|
+
...Object(entry),
|
|
64
|
+
cx: cx ?? void 0,
|
|
65
|
+
cy: cy ?? void 0,
|
|
66
|
+
x: cx == null ? void 0 : cx - radius,
|
|
67
|
+
y: cy == null ? void 0 : cy - radius,
|
|
68
|
+
width: 2 * radius,
|
|
69
|
+
height: 2 * radius,
|
|
70
|
+
size,
|
|
71
|
+
node: {
|
|
72
|
+
x,
|
|
73
|
+
y,
|
|
74
|
+
z
|
|
75
|
+
},
|
|
76
|
+
tooltipPayload,
|
|
77
|
+
tooltipPosition: cx == null || cy == null ? void 0 : {
|
|
78
|
+
x: cx,
|
|
79
|
+
y: cy
|
|
80
|
+
},
|
|
81
|
+
payload: entry
|
|
82
|
+
};
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
//#endregion
|
|
86
|
+
export { computeScatterPoints };
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { isCategoricalAxis } from "../utils/validate.mjs";
|
|
2
|
+
import { findEntryInArray, mathSign } from "../utils/data.mjs";
|
|
3
|
+
import { getValueByDataKey } from "./data.mjs";
|
|
4
|
+
//#region src/core/tooltip.ts
|
|
5
|
+
function tooltipPayload(tooltipPayloadConfigurations, activeIndex, tooltipAxis, activeLabel, tooltipPayloadSearcher, tooltipEventType, payloadKey) {
|
|
6
|
+
if (activeIndex == null) return;
|
|
7
|
+
return tooltipPayloadConfigurations.reduce((agg, { dataDefinedOnItem, settings, values, names, colors }) => {
|
|
8
|
+
const sliced = dataDefinedOnItem;
|
|
9
|
+
const finalDataKey = settings?.dataKey ?? tooltipAxis?.dataKey;
|
|
10
|
+
const finalNameKey = settings?.nameKey;
|
|
11
|
+
let tooltipPayload;
|
|
12
|
+
if (tooltipAxis?.dataKey && !tooltipAxis?.allowDuplicatedCategory && Array.isArray(sliced) && activeLabel != null && tooltipEventType === "axis") tooltipPayload = findEntryInArray(sliced, tooltipAxis.dataKey, activeLabel);
|
|
13
|
+
if (tooltipPayload == null) tooltipPayload = payloadKey === void 0 ? Array.isArray(sliced) ? sliced[activeIndex] : void 0 : tooltipPayloadSearcher?.(sliced, payloadKey, finalNameKey);
|
|
14
|
+
if (Array.isArray(tooltipPayload)) tooltipPayload.forEach((item) => {
|
|
15
|
+
const newSettings = {
|
|
16
|
+
...settings,
|
|
17
|
+
name: item.name,
|
|
18
|
+
unit: item.unit
|
|
19
|
+
};
|
|
20
|
+
agg.push(getTooltipEntry({
|
|
21
|
+
tooltipEntrySettings: newSettings,
|
|
22
|
+
dataKey: item.dataKey,
|
|
23
|
+
payload: item.payload,
|
|
24
|
+
value: getValueByDataKey(item.payload, item.dataKey),
|
|
25
|
+
name: item.name
|
|
26
|
+
}));
|
|
27
|
+
});
|
|
28
|
+
else {
|
|
29
|
+
const key = payloadKey ?? activeIndex;
|
|
30
|
+
const color = payloadKey === void 0 ? colors?.[activeIndex] : void 0;
|
|
31
|
+
agg.push(getTooltipEntry({
|
|
32
|
+
tooltipEntrySettings: color === void 0 ? settings : {
|
|
33
|
+
...settings,
|
|
34
|
+
color,
|
|
35
|
+
fill: color
|
|
36
|
+
},
|
|
37
|
+
dataKey: finalDataKey,
|
|
38
|
+
payload: tooltipPayload,
|
|
39
|
+
value: values && key in values ? values[key] ?? void 0 : getValueByDataKey(tooltipPayload, finalDataKey),
|
|
40
|
+
name: names?.[key] ?? getValueByDataKey(tooltipPayload, finalNameKey) ?? settings?.name
|
|
41
|
+
}));
|
|
42
|
+
}
|
|
43
|
+
return agg;
|
|
44
|
+
}, []);
|
|
45
|
+
}
|
|
46
|
+
function tooltipTicks(layout, axis, realScaleType, scale, range, duplicateDomain, categoricalDomain, axisType) {
|
|
47
|
+
if (!axis) return null;
|
|
48
|
+
const { type } = axis;
|
|
49
|
+
const isCategorical = isCategoricalAxis(layout, axisType);
|
|
50
|
+
if (!scale) return null;
|
|
51
|
+
const offsetForBand = realScaleType === "scaleBand" && scale.bandwidth ? scale.bandwidth() / 2 : 2;
|
|
52
|
+
let offset = type === "category" && scale.bandwidth ? scale.bandwidth() / offsetForBand : 0;
|
|
53
|
+
offset = axisType === "angleAxis" && range != null && range?.length >= 2 ? mathSign(range[0] - range[1]) * 2 * offset : offset;
|
|
54
|
+
if (isCategorical && categoricalDomain) return categoricalDomain.map((entry, index) => ({
|
|
55
|
+
coordinate: scale(entry) + offset,
|
|
56
|
+
value: entry,
|
|
57
|
+
index,
|
|
58
|
+
offset
|
|
59
|
+
}));
|
|
60
|
+
return scale.domain().map((entry, index) => ({
|
|
61
|
+
coordinate: scale(entry) + offset,
|
|
62
|
+
value: duplicateDomain ? duplicateDomain[entry] : entry,
|
|
63
|
+
index,
|
|
64
|
+
offset
|
|
65
|
+
}));
|
|
66
|
+
}
|
|
67
|
+
function getTooltipEntry({ tooltipEntrySettings, dataKey, payload, value, name }) {
|
|
68
|
+
return {
|
|
69
|
+
...tooltipEntrySettings,
|
|
70
|
+
dataKey,
|
|
71
|
+
payload,
|
|
72
|
+
value,
|
|
73
|
+
name
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
function tooltipCoordinate(type, layout, tick, size, offset, position, fallback) {
|
|
77
|
+
if (position) return position;
|
|
78
|
+
if (type === "item") return fallback;
|
|
79
|
+
if (!tick) return void 0;
|
|
80
|
+
if (fallback && (layout === "centric" || layout === "radial")) return fallback;
|
|
81
|
+
return layout === "horizontal" ? {
|
|
82
|
+
...fallback,
|
|
83
|
+
x: tick.coordinate,
|
|
84
|
+
y: fallback?.y ?? (offset.top + size.height) / 2
|
|
85
|
+
} : {
|
|
86
|
+
...fallback,
|
|
87
|
+
x: fallback?.x ?? (offset.left + size.width) / 2,
|
|
88
|
+
y: tick.coordinate
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
function getTooltipNameProp(nameFromItem, dataKey) {
|
|
92
|
+
if (nameFromItem) return String(nameFromItem);
|
|
93
|
+
if (typeof dataKey === "string") return dataKey;
|
|
94
|
+
}
|
|
95
|
+
//#endregion
|
|
96
|
+
export { getTooltipEntry, getTooltipNameProp, tooltipCoordinate, tooltipPayload, tooltipTicks };
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
//#region src/events/componentEvents.ts
|
|
2
|
+
var chartPointerEvent = (_state, _event) => true;
|
|
3
|
+
var chartEmits = {
|
|
4
|
+
click: chartPointerEvent,
|
|
5
|
+
mouseenter: chartPointerEvent,
|
|
6
|
+
mousemove: chartPointerEvent,
|
|
7
|
+
mouseleave: chartPointerEvent,
|
|
8
|
+
mousedown: chartPointerEvent,
|
|
9
|
+
mouseup: chartPointerEvent,
|
|
10
|
+
contextmenu: chartPointerEvent,
|
|
11
|
+
dblclick: chartPointerEvent,
|
|
12
|
+
touchstart: chartPointerEvent,
|
|
13
|
+
touchmove: chartPointerEvent,
|
|
14
|
+
touchend: chartPointerEvent
|
|
15
|
+
};
|
|
16
|
+
function chartListeners(emit) {
|
|
17
|
+
return {
|
|
18
|
+
onClick: (state, event) => emit("click", state, event),
|
|
19
|
+
onMouseenter: (state, event) => emit("mouseenter", state, event),
|
|
20
|
+
onMousemove: (state, event) => emit("mousemove", state, event),
|
|
21
|
+
onMouseleave: (state, event) => emit("mouseleave", state, event),
|
|
22
|
+
onMousedown: (state, event) => emit("mousedown", state, event),
|
|
23
|
+
onMouseup: (state, event) => emit("mouseup", state, event),
|
|
24
|
+
onContextmenu: (state, event) => emit("contextmenu", state, event),
|
|
25
|
+
onDblclick: (state, event) => emit("dblclick", state, event),
|
|
26
|
+
onTouchstart: (state, event) => emit("touchstart", state, event),
|
|
27
|
+
onTouchmove: (state, event) => emit("touchmove", state, event),
|
|
28
|
+
onTouchend: (state, event) => emit("touchend", state, event)
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
var cellGridEmits = {
|
|
32
|
+
"update:activeIndex": (_index) => true,
|
|
33
|
+
"cell-click": (_payload, _index, _event) => true,
|
|
34
|
+
"cell-mouseenter": (_payload, _index, _event) => true,
|
|
35
|
+
"cell-mouseleave": (_payload, _index, _event) => true,
|
|
36
|
+
"animation-start": () => true,
|
|
37
|
+
"animation-end": () => true
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Forwards the cell events of an inner cell grid once. `map` turns the inner payload into the
|
|
41
|
+
* outer one; cells it maps to `undefined` emit nothing.
|
|
42
|
+
*/
|
|
43
|
+
function cellGridListeners(emit, map = (payload) => payload) {
|
|
44
|
+
const relay = (send) => (payload, index, event) => {
|
|
45
|
+
const cell = map(payload);
|
|
46
|
+
if (cell !== void 0) send(cell, index, event);
|
|
47
|
+
};
|
|
48
|
+
return {
|
|
49
|
+
"onUpdate:activeIndex": (index) => emit("update:activeIndex", index),
|
|
50
|
+
"onCell-click": relay((cell, index, event) => emit("cell-click", cell, index, event)),
|
|
51
|
+
"onCell-mouseenter": relay((cell, index, event) => emit("cell-mouseenter", cell, index, event)),
|
|
52
|
+
"onCell-mouseleave": relay((cell, index, event) => emit("cell-mouseleave", cell, index, event)),
|
|
53
|
+
"onAnimation-start": () => emit("animation-start"),
|
|
54
|
+
"onAnimation-end": () => emit("animation-end")
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
//#endregion
|
|
58
|
+
export { cellGridEmits, cellGridListeners, chartEmits, chartListeners };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
//#region src/events/delegateItemEvents.ts
|
|
2
|
+
function itemEventIndex(event, boundary = false) {
|
|
3
|
+
const root = event.currentTarget;
|
|
4
|
+
const target = event.target;
|
|
5
|
+
if (!(root instanceof Element) || !(target instanceof Element)) return void 0;
|
|
6
|
+
const item = target.closest("[data-v-charts-item-index]");
|
|
7
|
+
if (!item || !root.contains(item) || boundary && target !== item) return void 0;
|
|
8
|
+
const index = Number(item.getAttribute("data-v-charts-item-index"));
|
|
9
|
+
return Number.isInteger(index) && index >= 0 ? index : void 0;
|
|
10
|
+
}
|
|
11
|
+
function delegateItemEvents(itemAt, events) {
|
|
12
|
+
function dispatch(name, event) {
|
|
13
|
+
const index = itemEventIndex(event, name !== "click");
|
|
14
|
+
const item = index == null ? void 0 : itemAt(index);
|
|
15
|
+
if (item !== void 0 && index !== void 0) events[name](item, index, event);
|
|
16
|
+
}
|
|
17
|
+
return {
|
|
18
|
+
onClick: (event) => dispatch("click", event),
|
|
19
|
+
onMouseenterCapture: (event) => dispatch("mouseenter", event),
|
|
20
|
+
onMouseleaveCapture: (event) => dispatch("mouseleave", event)
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
24
|
+
export { delegateItemEvents, itemEventIndex };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { inject, provide } from "vue";
|
|
2
|
+
//#region src/events/itemEvents.ts
|
|
3
|
+
function createItemEvents(extra) {
|
|
4
|
+
const itemEvent = (_entry, _index, _event) => true;
|
|
5
|
+
const emits = {
|
|
6
|
+
...extra,
|
|
7
|
+
"click": itemEvent,
|
|
8
|
+
"mouseenter": itemEvent,
|
|
9
|
+
"mouseleave": itemEvent,
|
|
10
|
+
"animation-start": () => true,
|
|
11
|
+
"animation-end": () => true
|
|
12
|
+
};
|
|
13
|
+
const key = Symbol("item events");
|
|
14
|
+
return {
|
|
15
|
+
emits,
|
|
16
|
+
provide: (emit) => provide(key, emit),
|
|
17
|
+
use: () => {
|
|
18
|
+
const emit = inject(key);
|
|
19
|
+
if (!emit) throw new Error("Item events require a graphical item owner");
|
|
20
|
+
return emit;
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
var modelEvent = { "update:activeIndex": (_index) => true };
|
|
25
|
+
var barEvents = createItemEvents(modelEvent);
|
|
26
|
+
var lineEvents = createItemEvents({});
|
|
27
|
+
var areaEvents = createItemEvents({});
|
|
28
|
+
var scatterEvents = createItemEvents({});
|
|
29
|
+
var pieEvents = createItemEvents(modelEvent);
|
|
30
|
+
var radarEvents = createItemEvents({});
|
|
31
|
+
var radialBarEvents = createItemEvents({});
|
|
32
|
+
var funnelEvents = createItemEvents({});
|
|
33
|
+
//#endregion
|
|
34
|
+
export { areaEvents, barEvents, funnelEvents, lineEvents, pieEvents, radarEvents, radialBarEvents, scatterEvents };
|