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
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { useTooltipSource } from "../model/tooltip.mjs";
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
//#region src/hooks/useActiveTooltipDataPoints.ts
|
|
4
|
+
/** Currently displayed data points, deduplicated across series. Requires a tooltip source. */
|
|
5
|
+
function useActiveTooltipDataPoints() {
|
|
6
|
+
const source = useTooltipSource();
|
|
7
|
+
return computed(() => Array.from(new Set(source.payload.value.map((entry) => entry.payload).filter((entry) => entry != null))));
|
|
8
|
+
}
|
|
9
|
+
//#endregion
|
|
10
|
+
export { useActiveTooltipDataPoints };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { useId } from "vue";
|
|
2
|
+
//#region src/hooks/useChartId.ts
|
|
3
|
+
/** SSR-stable DOM id for `url(#...)` references. Call during setup. */
|
|
4
|
+
function useChartId(prefix) {
|
|
5
|
+
return `${prefix}-${useId().replace(/[^\w-]/g, "_")}`;
|
|
6
|
+
}
|
|
7
|
+
//#endregion
|
|
8
|
+
export { useChartId };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Teleport, h } from "vue";
|
|
2
|
+
import { useMounted } from "@vueuse/core";
|
|
3
|
+
//#region src/hooks/useLayerTeleport.ts
|
|
4
|
+
/** Keep the first render inline so hydration reproduces the server's SVG tree. */
|
|
5
|
+
function useLayerTeleport() {
|
|
6
|
+
const mounted = useMounted();
|
|
7
|
+
return (content, target) => mounted.value && target?.value ? h(Teleport, { to: target.value }, content) : content;
|
|
8
|
+
}
|
|
9
|
+
//#endregion
|
|
10
|
+
export { useLayerTeleport };
|
|
@@ -1,27 +1,84 @@
|
|
|
1
1
|
import { validateWidthHeight } from "../utils/validate.mjs";
|
|
2
|
+
import { provideChartSize } from "../model/runtime.mjs";
|
|
2
3
|
import { useRoundedSize } from "./useRoundedSize.mjs";
|
|
3
|
-
import {
|
|
4
|
+
import { useInitialDimension } from "../container/useSizeContext.mjs";
|
|
5
|
+
import { computed, ref } from "vue";
|
|
4
6
|
//#region src/hooks/useResponsiveSize.ts
|
|
7
|
+
var chartSizeProps = {
|
|
8
|
+
width: { type: Number },
|
|
9
|
+
height: { type: Number },
|
|
10
|
+
aspect: { type: Number },
|
|
11
|
+
initialDimension: { type: Object }
|
|
12
|
+
};
|
|
5
13
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* Render gating (`return null` when the size is invalid) stays with the
|
|
10
|
-
* caller — the rules differ between the compact and normal branches.
|
|
14
|
+
* Resolves the chart size per dimension: a finite nonnegative `width` or `height` prop is fixed, a missing or invalid
|
|
15
|
+
* one follows the measured box. The server and the first client render share the same initial
|
|
16
|
+
* geometry, so hydration matches; measurement happens after mount.
|
|
11
17
|
*/
|
|
12
18
|
function useResponsiveSize(props) {
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
19
|
+
const inheritedInitial = useInitialDimension(null);
|
|
20
|
+
const { size, setSize } = useRoundedSize();
|
|
21
|
+
const measured = ref(false);
|
|
22
|
+
const shown = ref(false);
|
|
23
|
+
const fixedWidth = computed(() => typeof props.width === "number" && Number.isFinite(props.width) && props.width >= 0 ? props.width : void 0);
|
|
24
|
+
const fixedHeight = computed(() => typeof props.height === "number" && Number.isFinite(props.height) && props.height >= 0 ? props.height : void 0);
|
|
25
|
+
const isResponsive = computed(() => fixedWidth.value === void 0 || fixedHeight.value === void 0);
|
|
26
|
+
const initial = computed(() => {
|
|
27
|
+
const base = props.initialDimension ?? inheritedInitial?.value;
|
|
28
|
+
const width = fixedWidth.value ?? base?.width ?? 640;
|
|
29
|
+
return {
|
|
30
|
+
width,
|
|
31
|
+
height: fixedHeight.value ?? base?.height ?? (props.aspect && props.aspect > 0 ? width / props.aspect : 360)
|
|
32
|
+
};
|
|
33
|
+
});
|
|
34
|
+
const effectiveWidth = computed(() => fixedWidth.value ?? (measured.value ? size.value.width : initial.value.width));
|
|
35
|
+
const effectiveHeight = computed(() => fixedHeight.value ?? (measured.value ? size.value.height : initial.value.height));
|
|
36
|
+
const hasValidSize = computed(() => validateWidthHeight({
|
|
37
|
+
width: effectiveWidth.value,
|
|
38
|
+
height: effectiveHeight.value
|
|
39
|
+
}));
|
|
40
|
+
provideChartSize(() => !isResponsive.value || measured.value ? `${effectiveWidth.value}x${effectiveHeight.value}` : null);
|
|
41
|
+
/**
|
|
42
|
+
* Style of the measured box: fixed dimensions in px, the others fill the parent or follow
|
|
43
|
+
* `aspect`. A responsive chart stays invisible until it has measured itself: the server's
|
|
44
|
+
* guess at its size would show as a squashed or stretched chart, so it appears at its real
|
|
45
|
+
* size and plays its entrance there. The box keeps its place in the layout meanwhile.
|
|
46
|
+
*/
|
|
47
|
+
const boxStyle = computed(() => ({
|
|
48
|
+
position: "relative",
|
|
49
|
+
cursor: "default",
|
|
50
|
+
...isResponsive.value && !shown.value ? {
|
|
51
|
+
visibility: "hidden",
|
|
52
|
+
overflow: "hidden"
|
|
53
|
+
} : {},
|
|
54
|
+
width: fixedWidth.value === void 0 ? "100%" : `${fixedWidth.value}px`,
|
|
55
|
+
height: fixedHeight.value === void 0 ? props.aspect ? "auto" : "100%" : `${fixedHeight.value}px`,
|
|
56
|
+
aspectRatio: fixedHeight.value === void 0 ? props.aspect : void 0
|
|
57
|
+
}));
|
|
58
|
+
function handleResize(width, height) {
|
|
59
|
+
const next = {
|
|
60
|
+
width: fixedWidth.value ?? width,
|
|
61
|
+
height: fixedHeight.value ?? height
|
|
62
|
+
};
|
|
63
|
+
if (!isResponsive.value || !validateWidthHeight(next)) return;
|
|
64
|
+
setSize(next.width, next.height);
|
|
65
|
+
if (!measured.value) {
|
|
66
|
+
measured.value = true;
|
|
67
|
+
if (typeof requestAnimationFrame === "function") requestAnimationFrame(() => {
|
|
68
|
+
shown.value = true;
|
|
69
|
+
});
|
|
70
|
+
else shown.value = true;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
16
73
|
return {
|
|
17
74
|
effectiveWidth,
|
|
18
75
|
effectiveHeight,
|
|
19
|
-
hasValidSize
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
76
|
+
hasValidSize,
|
|
77
|
+
handleResize,
|
|
78
|
+
isResponsive,
|
|
79
|
+
measured,
|
|
80
|
+
boxStyle
|
|
24
81
|
};
|
|
25
82
|
}
|
|
26
83
|
//#endregion
|
|
27
|
-
export { useResponsiveSize };
|
|
84
|
+
export { chartSizeProps, useResponsiveSize };
|
|
@@ -4,9 +4,6 @@ import { ref } from "vue";
|
|
|
4
4
|
* Shared size-state core: a size ref plus a setter that rounds to
|
|
5
5
|
* integers and ignores no-change updates.
|
|
6
6
|
*
|
|
7
|
-
* Adapters: `useResponsiveSize` (chart sizing) and `ResponsiveContainer`.
|
|
8
|
-
* ResponsiveContainer is planned for removal (see ADR-0001); when it goes,
|
|
9
|
-
* this module stays behind as the chart's size-state implementation.
|
|
10
7
|
*/
|
|
11
8
|
function useRoundedSize(initial = {
|
|
12
9
|
width: 0,
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { useChartAnimation } from "../model/animation.mjs";
|
|
2
|
+
import { useChart } from "../model/chart.mjs";
|
|
3
|
+
import { seriesColor } from "../utils/theme.mjs";
|
|
4
|
+
import { computed } from "vue";
|
|
5
|
+
//#region src/hooks/useSeriesProps.ts
|
|
6
|
+
var seriesIds = /* @__PURE__ */ new WeakMap();
|
|
7
|
+
function getSeriesId(props) {
|
|
8
|
+
return seriesIds.get(props);
|
|
9
|
+
}
|
|
10
|
+
/** Share effective settings between series rendering and registration. */
|
|
11
|
+
function useSeriesProps(props, colors = []) {
|
|
12
|
+
const chart = useChart();
|
|
13
|
+
const legend = chart.legend;
|
|
14
|
+
const id = Symbol("series-color");
|
|
15
|
+
const color = computed(() => {
|
|
16
|
+
const items = chart.items.cartesian.entries.value.length ? chart.items.cartesian.entries.value : chart.items.polar.entries.value.filter((item) => item.type === "radar");
|
|
17
|
+
return seriesColor(items.findIndex((item) => item.seriesId === id));
|
|
18
|
+
});
|
|
19
|
+
const animation = useChartAnimation();
|
|
20
|
+
const hide = computed(() => props.hide || props.dataKey !== void 0 && legend.state.value.hidden.has(String(props.dataKey)));
|
|
21
|
+
const resolved = new Proxy(props, { get(target, key, receiver) {
|
|
22
|
+
if ((key === "fill" || key === "stroke") && colors.includes(key)) return Reflect.get(target, key, receiver) ?? color.value;
|
|
23
|
+
if (key === "hide") return hide.value;
|
|
24
|
+
if (key === "isAnimationActive") return props.isAnimationActive ?? animation.isAnimationActive ?? true;
|
|
25
|
+
if (key === "transition") return props.transition ?? animation.transition;
|
|
26
|
+
return Reflect.get(target, key, receiver);
|
|
27
|
+
} });
|
|
28
|
+
if (colors.length) seriesIds.set(resolved, id);
|
|
29
|
+
return resolved;
|
|
30
|
+
}
|
|
31
|
+
//#endregion
|
|
32
|
+
export { getSeriesId, useSeriesProps };
|
|
@@ -1,66 +1,96 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { getTooltipNameProp } from "../core/tooltip.mjs";
|
|
2
|
+
import { provideTooltipEntry } from "../model/tooltip.mjs";
|
|
3
|
+
import { useTrackedData } from "./useTrackedData.mjs";
|
|
4
|
+
import { useChart } from "../model/chart.mjs";
|
|
5
|
+
import { getSeriesId } from "./useSeriesProps.mjs";
|
|
6
|
+
import { getNormalizedStackId } from "../core/coordinates.mjs";
|
|
7
|
+
import { mainColor } from "../core/color.mjs";
|
|
8
|
+
import { computed } from "vue";
|
|
7
9
|
//#region src/hooks/useSetupGraphicalItem.ts
|
|
8
|
-
function getLegendItemColor(stroke, fill) {
|
|
9
|
-
return stroke && stroke !== "none" ? stroke : fill;
|
|
10
|
-
}
|
|
11
|
-
function getItemColor(type, stroke, fill) {
|
|
12
|
-
if (type === "bar") return fill;
|
|
13
|
-
return getLegendItemColor(stroke, fill);
|
|
14
|
-
}
|
|
15
10
|
function useSetupGraphicalItem(props, type, options) {
|
|
16
|
-
const
|
|
17
|
-
const isPanorama = useIsPanorama();
|
|
11
|
+
const data = useTrackedData(() => props.data);
|
|
18
12
|
const legendPayload = computed(() => {
|
|
19
13
|
return [{
|
|
20
14
|
inactive: props.hide,
|
|
21
15
|
dataKey: props.dataKey,
|
|
22
16
|
type: props.legendType,
|
|
23
|
-
color:
|
|
17
|
+
color: mainColor(type, props),
|
|
24
18
|
value: getTooltipNameProp(props.name, props.dataKey),
|
|
25
|
-
payload: {
|
|
19
|
+
payload: {
|
|
20
|
+
...props,
|
|
21
|
+
data: data.value
|
|
22
|
+
}
|
|
26
23
|
}];
|
|
27
24
|
});
|
|
28
|
-
|
|
25
|
+
const settings = computed(() => {
|
|
29
26
|
return {
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
seriesId: getSeriesId(props),
|
|
28
|
+
data: data.value,
|
|
29
|
+
dataKey: props.dataKey,
|
|
30
|
+
stackId: getNormalizedStackId(props.stackId),
|
|
31
|
+
hide: props.hide ?? false,
|
|
32
|
+
xAxisId: props.xAxisId ?? 0,
|
|
33
|
+
yAxisId: props.yAxisId ?? 0,
|
|
34
|
+
zAxisId: props.zAxisId,
|
|
35
|
+
barSize: props.barSize,
|
|
36
|
+
minPointSize: props.minPointSize,
|
|
32
37
|
type,
|
|
33
38
|
errorBars: options?.errorBars?.value
|
|
34
39
|
};
|
|
35
|
-
}));
|
|
36
|
-
SetLegendPayload(legendPayload);
|
|
37
|
-
if (!options?.skipTooltip) SetTooltipEntrySettings({
|
|
38
|
-
fn: getTooltipEntrySettings,
|
|
39
|
-
args: computed(() => ({
|
|
40
|
-
...props,
|
|
41
|
-
...attrs,
|
|
42
|
-
_itemType: type
|
|
43
|
-
}))
|
|
44
40
|
});
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
41
|
+
useChart().items.cartesian.register(settings);
|
|
42
|
+
useChart().legend.entries.register(legendPayload);
|
|
43
|
+
if (!options?.skipTooltip) useSetupTooltipEntry(props, type, data);
|
|
48
44
|
return {
|
|
49
|
-
|
|
50
|
-
|
|
45
|
+
data,
|
|
46
|
+
settings
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Registers a polar series (Pie, Radar, RadialBar, Funnel) and its legend items. The hook owns
|
|
51
|
+
* the shared fields: the series type, its dataKey, and `hide`, which also marks the legend
|
|
52
|
+
* items inactive. `settings` adds the series' own fields (axis ids, bar sizing, data).
|
|
53
|
+
*/
|
|
54
|
+
function useSetupPolarItem(props, type, options) {
|
|
55
|
+
const chart = useChart();
|
|
56
|
+
chart.items.polar.register(computed(() => ({
|
|
57
|
+
data: void 0,
|
|
58
|
+
stackId: void 0,
|
|
59
|
+
barSize: void 0,
|
|
60
|
+
angleAxisId: 0,
|
|
61
|
+
radiusAxisId: 0,
|
|
62
|
+
...options.settings?.(),
|
|
63
|
+
type,
|
|
64
|
+
dataKey: props.dataKey,
|
|
65
|
+
hide: props.hide
|
|
66
|
+
})));
|
|
67
|
+
chart.legend.entries.register(computed(() => options.legend().map((entry) => ({
|
|
68
|
+
...entry,
|
|
69
|
+
dataKey: props.dataKey,
|
|
70
|
+
inactive: props.hide
|
|
71
|
+
}))));
|
|
72
|
+
}
|
|
73
|
+
function useSetupTooltipEntry(props, type, data, positions, model) {
|
|
74
|
+
const entry = computed(() => ({
|
|
75
|
+
dataDefinedOnItem: data.value,
|
|
76
|
+
positions: positions?.(),
|
|
77
|
+
model,
|
|
51
78
|
settings: {
|
|
52
|
-
stroke,
|
|
53
|
-
strokeWidth: props
|
|
54
|
-
fill,
|
|
55
|
-
dataKey,
|
|
79
|
+
stroke: props.stroke,
|
|
80
|
+
strokeWidth: props.strokeWidth,
|
|
81
|
+
fill: props.fill,
|
|
82
|
+
dataKey: props.dataKey,
|
|
56
83
|
nameKey: void 0,
|
|
57
|
-
name: getTooltipNameProp(name, dataKey),
|
|
58
|
-
hide,
|
|
84
|
+
name: getTooltipNameProp(props.name, props.dataKey),
|
|
85
|
+
hide: props.hide,
|
|
59
86
|
type: props.tooltipType,
|
|
60
|
-
color:
|
|
61
|
-
unit
|
|
87
|
+
color: mainColor(type, props),
|
|
88
|
+
unit: props.unit
|
|
62
89
|
}
|
|
63
|
-
};
|
|
90
|
+
}));
|
|
91
|
+
useChart().tooltip.entries.register(entry);
|
|
92
|
+
provideTooltipEntry(entry);
|
|
93
|
+
return entry;
|
|
64
94
|
}
|
|
65
95
|
//#endregion
|
|
66
|
-
export { useSetupGraphicalItem };
|
|
96
|
+
export { useSetupGraphicalItem, useSetupPolarItem, useSetupTooltipEntry };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { computed, shallowRef, toRaw, watch } from "vue";
|
|
2
|
+
//#region src/hooks/useTrackedData.ts
|
|
3
|
+
/** Track each data owner once, including values consumed only by raw calculations. */
|
|
4
|
+
function useTrackedData(source) {
|
|
5
|
+
const revision = shallowRef(0);
|
|
6
|
+
watch(source, () => revision.value++, {
|
|
7
|
+
deep: true,
|
|
8
|
+
flush: "sync"
|
|
9
|
+
});
|
|
10
|
+
return computed(() => {
|
|
11
|
+
revision.value;
|
|
12
|
+
const data = source();
|
|
13
|
+
return data === void 0 ? void 0 : toRaw(data).map((item) => toRaw(item));
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
export { useTrackedData };
|
package/dist/es/index.mjs
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Curve
|
|
3
|
-
import { useActiveTooltipDataPoints } from "./state/hooks.mjs";
|
|
4
|
-
import { useChartHeight, useChartWidth, useMargin, useOffset } from "./context/chartLayoutContext.mjs";
|
|
1
|
+
import { chartThemeTokens } from "./utils/theme.mjs";
|
|
2
|
+
import { Curve } from "./shape/Curve.mjs";
|
|
5
3
|
import { Dot } from "./shape/Dot.mjs";
|
|
6
4
|
import Text_default from "./components/Text.mjs";
|
|
7
|
-
import {
|
|
5
|
+
import { forwardsSvgAttributes } from "./utils/attributes.mjs";
|
|
8
6
|
import { LabelList } from "./components/label/LabelList.mjs";
|
|
9
7
|
import { Area } from "./cartesian/area/Area.mjs";
|
|
8
|
+
import { Label } from "./components/label/Label.mjs";
|
|
10
9
|
import { CartesianAxis } from "./cartesian/cartesian-axis/CartesianAxis.mjs";
|
|
11
10
|
import { XAxis } from "./cartesian/axis/XAxis.mjs";
|
|
12
11
|
import { YAxis } from "./cartesian/axis/YAxis.mjs";
|
|
13
12
|
import { Rectangle } from "./shape/Rectangle.mjs";
|
|
14
|
-
import { createErrorBarRegistry, provideErrorBarContext, provideErrorBarRegistry, useErrorBarContext, useErrorBarRegistry } from "./cartesian/error-bar/ErrorBarContext.mjs";
|
|
15
13
|
import { Cell } from "./components/Cell.mjs";
|
|
16
14
|
import { Bar } from "./cartesian/bar/Bar.mjs";
|
|
15
|
+
import { Brush } from "./cartesian/brush/Brush.mjs";
|
|
17
16
|
import { CartesianGrid } from "./cartesian/cartesian-grid/CartesianGrid.mjs";
|
|
18
|
-
import { ErrorBar
|
|
19
|
-
import {
|
|
17
|
+
import { ErrorBar } from "./cartesian/error-bar/ErrorBar.mjs";
|
|
18
|
+
import { Trapezoid } from "./shape/Trapezoid.mjs";
|
|
19
|
+
import { Funnel } from "./cartesian/funnel/Funnel.mjs";
|
|
20
20
|
import { Line } from "./cartesian/line/Line.mjs";
|
|
21
21
|
import { ReferenceArea } from "./cartesian/reference-area/ReferenceArea.mjs";
|
|
22
22
|
import { ReferenceDot } from "./cartesian/reference-dot/ReferenceDot.mjs";
|
|
@@ -24,34 +24,48 @@ import { ReferenceLine } from "./cartesian/reference-line/ReferenceLine.mjs";
|
|
|
24
24
|
import { Symbols } from "./shape/Symbols.mjs";
|
|
25
25
|
import { Scatter } from "./cartesian/scatter/Scatter.mjs";
|
|
26
26
|
import { ZAxis } from "./cartesian/z-axis/ZAxis.mjs";
|
|
27
|
-
import { Trapezoid } from "./shape/Trapezoid.mjs";
|
|
28
|
-
import { FunnelVueProps } from "./cartesian/funnel/type.mjs";
|
|
29
|
-
import { Funnel } from "./cartesian/funnel/Funnel.mjs";
|
|
30
27
|
import { AreaChart } from "./chart/AreaChart.mjs";
|
|
31
28
|
import { BarChart } from "./chart/BarChart.mjs";
|
|
29
|
+
import { BarList } from "./chart/BarList.mjs";
|
|
30
|
+
import { CalendarHeatmap } from "./chart/CalendarHeatmap.mjs";
|
|
31
|
+
import { Heatmap } from "./chart/Heatmap.mjs";
|
|
32
|
+
import { CohortChart } from "./chart/CohortChart.mjs";
|
|
32
33
|
import { ComposedChart } from "./chart/ComposedChart.mjs";
|
|
34
|
+
import { FunnelChart } from "./chart/FunnelChart.mjs";
|
|
35
|
+
import { JourneySankey } from "./chart/JourneySankey.mjs";
|
|
33
36
|
import { LineChart } from "./chart/LineChart.mjs";
|
|
34
37
|
import { PieChart } from "./chart/PieChart.mjs";
|
|
35
38
|
import { RadarChart } from "./chart/RadarChart.mjs";
|
|
36
|
-
import { ScatterChart } from "./chart/ScatterChart.mjs";
|
|
37
39
|
import { RadialBarChart } from "./chart/RadialBarChart.mjs";
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
40
|
+
import { Sankey } from "./chart/Sankey.mjs";
|
|
41
|
+
import { ScatterChart } from "./chart/ScatterChart.mjs";
|
|
42
|
+
import { Sparkline } from "./chart/Sparkline.mjs";
|
|
41
43
|
import { Sector } from "./shape/Sector.mjs";
|
|
42
|
-
import { SunburstChart
|
|
44
|
+
import { SunburstChart } from "./chart/SunburstChart.mjs";
|
|
45
|
+
import { Tracker } from "./chart/Tracker.mjs";
|
|
46
|
+
import { Treemap } from "./chart/Treemap.mjs";
|
|
43
47
|
import ResponsiveContainer_default from "./container/ResponsiveContainer.mjs";
|
|
44
48
|
import { Customized } from "./components/Customized.mjs";
|
|
45
|
-
import
|
|
49
|
+
import Legend from "./components/legend/Legend.mjs";
|
|
46
50
|
import { Cross } from "./shape/Cross.mjs";
|
|
47
|
-
import
|
|
48
|
-
import { PieVueProps } from "./polar/pie/type.mjs";
|
|
51
|
+
import { Tooltip } from "./components/tooltip/Tooltip.mjs";
|
|
49
52
|
import { Pie } from "./polar/pie/Pie.mjs";
|
|
50
|
-
import { Radar } from "./polar/radar/Radar.mjs";
|
|
51
|
-
import { PolarGrid } from "./polar/radar/PolarGrid.mjs";
|
|
52
53
|
import { PolarAngleAxis } from "./polar/radar/PolarAngleAxis.mjs";
|
|
54
|
+
import { PolarGrid } from "./polar/radar/PolarGrid.mjs";
|
|
53
55
|
import { PolarRadiusAxis } from "./polar/radar/PolarRadiusAxis.mjs";
|
|
56
|
+
import { Radar } from "./polar/radar/Radar.mjs";
|
|
54
57
|
import { RadialBar } from "./polar/radial-bar/RadialBar.mjs";
|
|
55
58
|
import { Polygon } from "./shape/Polygon.mjs";
|
|
56
|
-
import { useActiveTooltipCoordinate, useActiveTooltipLabel, useCartesianScale, useIsTooltipActive, usePlotArea, useXAxisDomain, useXAxisInverseDataSnapScale, useXAxisInverseScale, useXAxisInverseTickSnapScale, useXAxisScale, useXAxisTicks, useYAxisDomain, useYAxisInverseDataSnapScale, useYAxisInverseScale, useYAxisInverseTickSnapScale, useYAxisScale, useYAxisTicks } from "./hooks/publicHooks.mjs";
|
|
57
|
-
|
|
59
|
+
import { useActiveTooltipCoordinate, useActiveTooltipLabel, useCartesianScale, useChartHeight, useChartWidth, useIsTooltipActive, useMargin, usePlotArea, useXAxisDomain, useXAxisInverseDataSnapScale, useXAxisInverseScale, useXAxisInverseTickSnapScale, useXAxisScale, useXAxisTicks, useYAxisDomain, useYAxisInverseDataSnapScale, useYAxisInverseScale, useYAxisInverseTickSnapScale, useYAxisScale, useYAxisTicks } from "./hooks/publicHooks.mjs";
|
|
60
|
+
import { useActiveTooltipDataPoints } from "./hooks/useActiveTooltipDataPoints.mjs";
|
|
61
|
+
import { defineChartComponents } from "./typed.mjs";
|
|
62
|
+
//#region src/index.ts
|
|
63
|
+
/**
|
|
64
|
+
* @deprecated Charts are responsive by default: remove the wrapper and set `width`, `height`
|
|
65
|
+
* or `aspect` on the chart. Removed in 2.0 (see internals/migrations.md).
|
|
66
|
+
*/
|
|
67
|
+
var ResponsiveContainer = ResponsiveContainer_default;
|
|
68
|
+
/** SVG text with wrapping and scaling; forwards SVG attributes such as `font-size`. */
|
|
69
|
+
var Text = /* @__PURE__ */ forwardsSvgAttributes(Text_default);
|
|
70
|
+
//#endregion
|
|
71
|
+
export { Area, AreaChart, Bar, BarChart, BarList, Brush, CalendarHeatmap, CartesianAxis, CartesianGrid, Cell, CohortChart, ComposedChart, Cross, Curve, Customized, Dot, ErrorBar, Funnel, FunnelChart, Heatmap, JourneySankey, Label, LabelList, Legend, Line, LineChart, Pie, PieChart, PolarAngleAxis, PolarGrid, PolarRadiusAxis, Polygon, Radar, RadarChart, RadialBar, RadialBarChart, Rectangle, ReferenceArea, ReferenceDot, ReferenceLine, ResponsiveContainer, Sankey, Scatter, ScatterChart, Sector, Sparkline, SunburstChart, Symbols, Text, Tooltip, Tracker, Trapezoid, Treemap, XAxis, YAxis, ZAxis, chartThemeTokens, defineChartComponents, useActiveTooltipCoordinate, useActiveTooltipDataPoints, useActiveTooltipLabel, useCartesianScale, useChartHeight, useChartWidth, useIsTooltipActive, useMargin, usePlotArea, useXAxisDomain, useXAxisInverseDataSnapScale, useXAxisInverseScale, useXAxisInverseTickSnapScale, useXAxisScale, useXAxisTicks, useYAxisDomain, useYAxisInverseDataSnapScale, useYAxisInverseScale, useYAxisInverseTickSnapScale, useYAxisScale, useYAxisTicks };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { inject, provide } from "vue";
|
|
2
|
+
//#region src/model/animation.ts
|
|
3
|
+
var chartAnimationKey = Symbol("vccs-chart-animation");
|
|
4
|
+
function provideChartAnimation(props) {
|
|
5
|
+
provide(chartAnimationKey, props);
|
|
6
|
+
}
|
|
7
|
+
function useChartAnimation() {
|
|
8
|
+
return inject(chartAnimationKey, {});
|
|
9
|
+
}
|
|
10
|
+
//#endregion
|
|
11
|
+
export { provideChartAnimation, useChartAnimation };
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { axisKey } from "../core/axis/key.mjs";
|
|
2
|
+
import { appliedValues, filterGraphicalNotStackedItems, graphicalItemsData, graphicalItemsSettings, itemAxisPredicate, numericalValuesWithErrors } from "../core/axis/data.mjs";
|
|
3
|
+
import { axisDomain, getDomainDefinition, mergeDomains, numericalDomain } from "../core/axis/domain.mjs";
|
|
4
|
+
import { createAxisLayout } from "./axisLayout.mjs";
|
|
5
|
+
import { calculatedPadding, smallestDistance, xAxisRange, yAxisRange } from "../core/axis/range.mjs";
|
|
6
|
+
import { createAxisScale } from "./axisScale.mjs";
|
|
7
|
+
import { stackDomain, stackGroups } from "../core/axis/stacks.mjs";
|
|
8
|
+
import { createPolarAxis } from "./polarAxis.mjs";
|
|
9
|
+
import { areasDomain, dotsDomain, filterReferenceElements, linesDomain } from "../core/axis/references.mjs";
|
|
10
|
+
import { implicitXAxis, implicitYAxis, implicitZAxis } from "../core/axis/settings.mjs";
|
|
11
|
+
import { computed, onScopeDispose } from "vue";
|
|
12
|
+
//#region src/model/axis.ts
|
|
13
|
+
function createAxis(sources, type, id, registry, implicit, readRange) {
|
|
14
|
+
const settings = computed(() => registry.byId.value.get(axisKey(id)) ?? implicit);
|
|
15
|
+
const items = computed(() => graphicalItemsSettings(sources.items.cartesian.entries.value, settings.value, itemAxisPredicate(type, id)));
|
|
16
|
+
const unstacked = computed(() => filterGraphicalNotStackedItems(items.value));
|
|
17
|
+
const dataWithIndexes = sources.dataRange.state;
|
|
18
|
+
const graphicalData = computed(() => graphicalItemsData(items.value));
|
|
19
|
+
const displayedData = computed(() => sources.dataRange.displayedData({ data: graphicalData.value }) ?? []);
|
|
20
|
+
const appliedValues$1 = computed(() => appliedValues(displayedData.value, settings.value, items.value));
|
|
21
|
+
const domainDefinition = computed(() => getDomainDefinition(settings.value));
|
|
22
|
+
const stackGroups$1 = computed(() => stackGroups(displayedData.value, items.value, sources.stackOffset(), sources.reverseStackOrder()));
|
|
23
|
+
const stackDomain$1 = computed(() => stackDomain(stackGroups$1.value, dataWithIndexes.value, type));
|
|
24
|
+
const numericalValues = computed(() => numericalValuesWithErrors(displayedData.value, settings.value, unstacked.value, type));
|
|
25
|
+
const dots = computed(() => filterReferenceElements(sources.references.dots.entries.value, type, id));
|
|
26
|
+
const lines = computed(() => filterReferenceElements(sources.references.lines.entries.value, type, id));
|
|
27
|
+
const areas = computed(() => filterReferenceElements(sources.references.areas.entries.value, type, id));
|
|
28
|
+
const referencesDomain = computed(() => mergeDomains(dotsDomain(dots.value, type), areasDomain(areas.value, type), linesDomain(lines.value, type)));
|
|
29
|
+
const numericalDomain$1 = computed(() => numericalDomain(settings.value, domainDefinition.value, stackDomain$1.value, numericalValues.value, referencesDomain.value));
|
|
30
|
+
const domain = computed(() => axisDomain(settings.value, sources.layout(), displayedData.value, appliedValues$1.value, sources.stackOffset(), type, numericalDomain$1.value));
|
|
31
|
+
const range = computed(() => readRange(settings.value, appliedValues$1.value));
|
|
32
|
+
return {
|
|
33
|
+
...createAxisScale(sources, type, settings, domain, appliedValues$1, range),
|
|
34
|
+
settings,
|
|
35
|
+
displayedData,
|
|
36
|
+
stackGroups: stackGroups$1,
|
|
37
|
+
domain
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
function keyed(scope, build) {
|
|
41
|
+
const cache = /* @__PURE__ */ new Map();
|
|
42
|
+
onScopeDispose(() => cache.clear());
|
|
43
|
+
return (id) => {
|
|
44
|
+
const existing = cache.get(axisKey(id));
|
|
45
|
+
if (existing !== void 0) return existing;
|
|
46
|
+
const model = scope.run(() => build(id));
|
|
47
|
+
if (model === void 0) throw new Error("vccs: cannot read an axis after its chart is disposed.");
|
|
48
|
+
cache.set(axisKey(id), model);
|
|
49
|
+
return model;
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
function createAxes(scope, sources) {
|
|
53
|
+
const lookup = {
|
|
54
|
+
xAxis: keyed(scope, (id) => {
|
|
55
|
+
const model = createAxis(sources, "xAxis", id, sources.axes.xAxis, implicitXAxis, (axis, values) => {
|
|
56
|
+
const offset = sources.offset();
|
|
57
|
+
const calculated = typeof axis.padding === "string" ? calculatedPadding(smallestDistance(values, axis), sources.layout(), sources.barCategoryGap(), offset, axis.padding) : 0;
|
|
58
|
+
return xAxisRange(offset, axis.padding, calculated);
|
|
59
|
+
});
|
|
60
|
+
return {
|
|
61
|
+
...model,
|
|
62
|
+
...createAxisLayout(sources, model, "xAxis", id)
|
|
63
|
+
};
|
|
64
|
+
}),
|
|
65
|
+
yAxis: keyed(scope, (id) => {
|
|
66
|
+
const model = createAxis(sources, "yAxis", id, sources.axes.yAxis, implicitYAxis, (axis, values) => {
|
|
67
|
+
const offset = sources.offset();
|
|
68
|
+
const calculated = typeof axis.padding === "string" ? calculatedPadding(smallestDistance(values, axis), sources.layout(), sources.barCategoryGap(), offset, axis.padding) : 0;
|
|
69
|
+
return yAxisRange(offset, sources.layout(), axis.padding, calculated);
|
|
70
|
+
});
|
|
71
|
+
return {
|
|
72
|
+
...model,
|
|
73
|
+
...createAxisLayout(sources, model, "yAxis", id)
|
|
74
|
+
};
|
|
75
|
+
}),
|
|
76
|
+
zAxis: keyed(scope, (id) => createAxis(sources, "zAxis", id, sources.axes.zAxis, implicitZAxis, (axis) => axis.range)),
|
|
77
|
+
angleAxis: keyed(scope, (id) => createPolarAxis(sources, "angleAxis", id)),
|
|
78
|
+
radiusAxis: keyed(scope, (id) => createPolarAxis(sources, "radiusAxis", id))
|
|
79
|
+
};
|
|
80
|
+
return function axis(type, id) {
|
|
81
|
+
return lookup[type](id);
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
//#endregion
|
|
85
|
+
export { createAxes };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { gridAxis, xAxisPosition, yAxisPosition } from "../core/axis/position.mjs";
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
//#region src/model/axisLayout.ts
|
|
4
|
+
function createAxisLayout(sources, axis, type, id) {
|
|
5
|
+
return {
|
|
6
|
+
size: computed(() => {
|
|
7
|
+
const settings = axis.settings.value;
|
|
8
|
+
const offset = sources.offset();
|
|
9
|
+
if ("height" in settings) return {
|
|
10
|
+
width: offset.width,
|
|
11
|
+
height: settings.height
|
|
12
|
+
};
|
|
13
|
+
return {
|
|
14
|
+
width: typeof settings.width === "number" ? settings.width : 60,
|
|
15
|
+
height: offset.height
|
|
16
|
+
};
|
|
17
|
+
}),
|
|
18
|
+
position: computed(() => {
|
|
19
|
+
const settings = axis.settings.value;
|
|
20
|
+
if ("height" in settings) return xAxisPosition(sources.axes.xAxis.entries.value, settings, sources.offset(), sources.size().height, id);
|
|
21
|
+
return yAxisPosition(sources.axes.yAxis.entries.value, settings, sources.offset(), sources.size().width, id);
|
|
22
|
+
}),
|
|
23
|
+
grid: computed(() => gridAxis(axis.settings.value, sources.layout(), type, axis.categoricalDomain.value, axis.duplicateDomain.value, axis.niceTicks.value, axis.range.value, axis.realScaleType.value, axis.scale.value))
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
export { createAxisLayout };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { axisDomainWithNiceTicks, categoricalDomain, duplicateDomain, getBandSizeOfAxis, graphicalItemTicks, inverseTickScale, niceTicks, realScaleType, scaleFunction, sortBy } from "../core/axis/scale.mjs";
|
|
2
|
+
import { tooltipTicks } from "../core/tooltip.mjs";
|
|
3
|
+
import { axisTicks } from "../core/axis/ticks.mjs";
|
|
4
|
+
import { axisRangeWithReverse } from "../core/axis/range.mjs";
|
|
5
|
+
import { createCategoricalInverse, inverseScaleFunction } from "../utils/createCategoricalInverse.mjs";
|
|
6
|
+
import { computed } from "vue";
|
|
7
|
+
//#region src/model/axisScale.ts
|
|
8
|
+
function createAxisScale(sources, type, settings, domain, appliedValues, range) {
|
|
9
|
+
const realScaleType$1 = computed(() => realScaleType(settings.value, sources.hasBar(), sources.categoryScale()));
|
|
10
|
+
const tickSettings = computed(() => ({
|
|
11
|
+
...settings.value,
|
|
12
|
+
tickCount: settings.value.tickCount,
|
|
13
|
+
ticks: settings.value.ticks,
|
|
14
|
+
allowDecimals: settings.value.allowDecimals === true
|
|
15
|
+
}));
|
|
16
|
+
const niceTicks$1 = computed(() => niceTicks(domain.value, tickSettings.value, realScaleType$1.value));
|
|
17
|
+
const niceDomain = computed(() => type === "zAxis" ? domain.value : axisDomainWithNiceTicks(settings.value, domain.value, niceTicks$1.value, type));
|
|
18
|
+
const reversedRange = computed(() => axisRangeWithReverse(settings.value, range.value));
|
|
19
|
+
const scale = computed(() => scaleFunction(settings.value, realScaleType$1.value, niceDomain.value, reversedRange.value));
|
|
20
|
+
const duplicateDomain$1 = computed(() => duplicateDomain(sources.layout(), appliedValues.value, settings.value, type));
|
|
21
|
+
const categoricalDomain$1 = computed(() => type === "zAxis" ? void 0 : categoricalDomain(sources.layout(), appliedValues.value, tickSettings.value, type));
|
|
22
|
+
const ticks = computed(() => axisTicks(sources.layout(), tickSettings.value, realScaleType$1.value, scale.value, niceTicks$1.value, range.value, duplicateDomain$1.value, categoricalDomain$1.value, type));
|
|
23
|
+
const graphicalTicks = computed(() => type === "zAxis" ? null : graphicalItemTicks(sources.layout(), tickSettings.value, scale.value, range.value, duplicateDomain$1.value, categoricalDomain$1.value, type));
|
|
24
|
+
const tooltipTicks$1 = computed(() => type === "zAxis" ? null : tooltipTicks(sources.layout(), settings.value, realScaleType$1.value, scale.value, range.value, duplicateDomain$1.value, categoricalDomain$1.value, type));
|
|
25
|
+
const withScale = computed(() => scale.value ? {
|
|
26
|
+
...settings.value,
|
|
27
|
+
scale: scale.value
|
|
28
|
+
} : void 0);
|
|
29
|
+
const bandSize = computed(() => getBandSizeOfAxis(withScale.value, graphicalTicks.value ?? void 0));
|
|
30
|
+
const barBandSize = computed(() => getBandSizeOfAxis(withScale.value, graphicalTicks.value ?? void 0, true));
|
|
31
|
+
const sortedValues = computed(() => appliedValues.value.map((item) => item.value).sort(sortBy));
|
|
32
|
+
return {
|
|
33
|
+
realScaleType: realScaleType$1,
|
|
34
|
+
niceTicks: niceTicks$1,
|
|
35
|
+
range,
|
|
36
|
+
reversedRange,
|
|
37
|
+
scale,
|
|
38
|
+
duplicateDomain: duplicateDomain$1,
|
|
39
|
+
categoricalDomain: categoricalDomain$1,
|
|
40
|
+
ticks,
|
|
41
|
+
graphicalTicks,
|
|
42
|
+
tooltipTicks: tooltipTicks$1,
|
|
43
|
+
withScale,
|
|
44
|
+
bandSize,
|
|
45
|
+
barBandSize,
|
|
46
|
+
inverseScale: computed(() => inverseScaleFunction(scale.value)),
|
|
47
|
+
inverseDataScale: computed(() => createCategoricalInverse(scale.value, sortedValues.value)),
|
|
48
|
+
inverseTickScale: computed(() => inverseTickScale(ticks.value))
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
//#endregion
|
|
52
|
+
export { createAxisScale };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { createRegistry } from "./registry.mjs";
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
//#region src/model/brush.ts
|
|
4
|
+
function createChartBrush() {
|
|
5
|
+
const settings = createRegistry();
|
|
6
|
+
const registered = computed(() => settings.entries.value.at(-1));
|
|
7
|
+
return {
|
|
8
|
+
state: computed(() => registered.value ?? {
|
|
9
|
+
x: 0,
|
|
10
|
+
y: 0,
|
|
11
|
+
width: 0,
|
|
12
|
+
height: 0,
|
|
13
|
+
padding: {
|
|
14
|
+
top: 0,
|
|
15
|
+
right: 0,
|
|
16
|
+
bottom: 0,
|
|
17
|
+
left: 0
|
|
18
|
+
},
|
|
19
|
+
range: null,
|
|
20
|
+
onRangeChange: void 0
|
|
21
|
+
}),
|
|
22
|
+
range: computed(() => registered.value?.range),
|
|
23
|
+
register: settings.register
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
export { createChartBrush };
|