vccs 0.0.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/animation/Animate.d.ts +72 -0
- package/dist/cartesian/GraphicalItemClipPath.d.ts +31 -0
- package/dist/cartesian/area/ActivePoints.d.ts +77 -0
- package/dist/cartesian/area/Area.d.ts +17 -0
- package/dist/cartesian/area/ClipRect.d.ts +1 -0
- package/dist/cartesian/area/RenderArea.d.ts +16 -0
- package/dist/cartesian/area/__stories__/config.d.ts +31 -0
- package/dist/cartesian/area/hooks/useArea.d.ts +27 -0
- package/dist/cartesian/area/index.d.ts +2 -0
- package/dist/cartesian/area/type.d.ts +173 -0
- package/dist/cartesian/area/utils.d.ts +19 -0
- package/dist/cartesian/axis/XAxis.d.ts +189 -0
- package/dist/cartesian/axis/YAxis.d.ts +192 -0
- package/dist/cartesian/axis/index.d.ts +2 -0
- package/dist/cartesian/axis/type.d.ts +57 -0
- package/dist/cartesian/bar/Bar.d.ts +2 -0
- package/dist/cartesian/bar/components/BarBackground.d.ts +1 -0
- package/dist/cartesian/bar/components/BarRectangles.d.ts +1 -0
- package/dist/cartesian/bar/hooks/useBar.d.ts +23 -0
- package/dist/cartesian/bar/index.d.ts +1 -0
- package/dist/cartesian/bar/type.d.ts +166 -0
- package/dist/cartesian/bar/utils.d.ts +31 -0
- package/dist/cartesian/brush/Brush.d.ts +2 -0
- package/dist/cartesian/brush/components/Background.d.ts +15 -0
- package/dist/cartesian/brush/components/BrushText.d.ts +27 -0
- package/dist/cartesian/brush/components/Panorama.d.ts +65 -0
- package/dist/cartesian/brush/components/Slide.d.ts +20 -0
- package/dist/cartesian/brush/components/Traveller.d.ts +13 -0
- package/dist/cartesian/brush/components/TravellerLayer.d.ts +22 -0
- package/dist/cartesian/brush/hooks/useBrushHandlers.d.ts +25 -0
- package/dist/cartesian/brush/hooks/useBrushSetting.d.ts +6 -0
- package/dist/cartesian/brush/hooks/useBrushState.d.ts +29 -0
- package/dist/cartesian/brush/index.d.ts +2 -0
- package/dist/cartesian/brush/type.d.ts +103 -0
- package/dist/cartesian/brush/utils.d.ts +15 -0
- package/dist/cartesian/cartesian-axis/CartesianAxis.d.ts +209 -0
- package/dist/cartesian/cartesian-axis/const.d.ts +24 -0
- package/dist/cartesian/cartesian-axis/index.d.ts +1 -0
- package/dist/cartesian/cartesian-axis/use-axis-line.d.ts +7 -0
- package/dist/cartesian/cartesian-grid/Background.d.ts +18 -0
- package/dist/cartesian/cartesian-grid/CartesianGrid.d.ts +75 -0
- package/dist/cartesian/cartesian-grid/HorizontalGridLines.d.ts +37 -0
- package/dist/cartesian/cartesian-grid/HorizontalStripes.d.ts +20 -0
- package/dist/cartesian/cartesian-grid/VerticalGridLines.d.ts +26 -0
- package/dist/cartesian/cartesian-grid/VerticalStripes.d.ts +20 -0
- package/dist/cartesian/cartesian-grid/const.d.ts +6 -0
- package/dist/cartesian/cartesian-grid/index.d.ts +1 -0
- package/dist/cartesian/cartesian-grid/type.d.ts +145 -0
- package/dist/cartesian/cartesian-grid/utils.d.ts +5 -0
- package/dist/cartesian/error-bar/ErrorBar.d.ts +68 -0
- package/dist/cartesian/error-bar/ErrorBarContext.d.ts +27 -0
- package/dist/cartesian/error-bar/index.d.ts +2 -0
- package/dist/cartesian/funnel/Funnel.d.ts +2 -0
- package/dist/cartesian/funnel/index.d.ts +2 -0
- package/dist/cartesian/funnel/type.d.ts +106 -0
- package/dist/cartesian/funnel/utils.d.ts +12 -0
- package/dist/cartesian/index.d.ts +12 -0
- package/dist/cartesian/line/ActivePoints.d.ts +77 -0
- package/dist/cartesian/line/Line.d.ts +87 -0
- package/dist/cartesian/line/StaticLine.d.ts +16 -0
- package/dist/cartesian/line/hooks/useLine.d.ts +28 -0
- package/dist/cartesian/line/index.d.ts +3 -0
- package/dist/cartesian/line/type.d.ts +180 -0
- package/dist/cartesian/line/utils.d.ts +13 -0
- package/dist/cartesian/reference-area/ReferenceArea.d.ts +191 -0
- package/dist/cartesian/reference-area/index.d.ts +1 -0
- package/dist/cartesian/reference-line/ReferenceLine.d.ts +139 -0
- package/dist/cartesian/reference-line/index.d.ts +1 -0
- package/dist/cartesian/scatter/Scatter.d.ts +165 -0
- package/dist/cartesian/scatter/hooks/useScatter.d.ts +18 -0
- package/dist/cartesian/scatter/index.d.ts +1 -0
- package/dist/cartesian/type.d.ts +21 -0
- package/dist/cartesian/useNeedsClip.d.ts +6 -0
- package/dist/cartesian/utils/get-ticks.d.ts +16 -0
- package/dist/cartesian/z-axis/ZAxis.d.ts +81 -0
- package/dist/cartesian/z-axis/index.d.ts +1 -0
- package/dist/chart/AreaChart.d.ts +1 -0
- package/dist/chart/BarChart.d.ts +1 -0
- package/dist/chart/ComposedChart.d.ts +1 -0
- package/dist/chart/FunnelChart.d.ts +1 -0
- package/dist/chart/LegendPortalContext.d.ts +3 -0
- package/dist/chart/LineChart.d.ts +1 -0
- package/dist/chart/PieChart.d.ts +1 -0
- package/dist/chart/RadarChart.d.ts +1 -0
- package/dist/chart/RadialBarChart.d.ts +1 -0
- package/dist/chart/RechartsWrapper.d.ts +99 -0
- package/dist/chart/ScatterChart.d.ts +1 -0
- package/dist/chart/Surface.d.ts +40 -0
- package/dist/chart/TooltipPortalContext.d.ts +2 -0
- package/dist/chart/const.d.ts +6 -0
- package/dist/chart/generateCategoricalChart.d.ts +118 -0
- package/dist/chart/index.d.ts +9 -0
- package/dist/chart/provideClipPathId.d.ts +12 -0
- package/dist/components/Cell.d.ts +18 -0
- package/dist/components/DefaultLegendContent.d.ts +18 -0
- package/dist/components/Text.d.ts +149 -0
- package/dist/components/Tooltip.d.ts +250 -0
- package/dist/components/index.d.ts +4 -0
- package/dist/components/label/Label.d.ts +81 -0
- package/dist/components/label/LabelList.d.ts +63 -0
- package/dist/components/label/index.d.ts +2 -0
- package/dist/components/label/types.d.ts +88 -0
- package/dist/components/label/utils.d.ts +24 -0
- package/dist/components/legend/Legend.d.ts +4 -0
- package/dist/components/legend/LegendSymbol.d.ts +27 -0
- package/dist/components/legend/hooks/useLegend.d.ts +19 -0
- package/dist/components/legend/hooks/useLegendContent.d.ts +36 -0
- package/dist/components/legend/index.d.ts +2 -0
- package/dist/components/legend/type.d.ts +54 -0
- package/dist/components/legend/utils.d.ts +18 -0
- package/dist/components/types.d.ts +9 -0
- package/dist/components/utils.d.ts +4 -0
- package/dist/container/ClipPath.d.ts +12 -0
- package/dist/container/Layer.d.ts +2 -0
- package/dist/container/ResponsiveContainer.d.ts +50 -0
- package/dist/container/RootSurface.d.ts +17 -0
- package/dist/container/Surface.d.ts +25 -0
- package/dist/container/index.d.ts +1 -0
- package/dist/container/useSizeContext.d.ts +11 -0
- package/dist/context/ChartDataContextProvider.d.ts +17 -0
- package/dist/context/PanoramaContextProvider.d.ts +22 -0
- package/dist/context/accessibilityContext.d.ts +1 -0
- package/dist/context/cartesianLabelListContext.d.ts +3 -0
- package/dist/context/chartLayoutContext.d.ts +8 -0
- package/dist/context/cursorLayerContext.d.ts +2 -0
- package/dist/context/graphicalLayerContext.d.ts +2 -0
- package/dist/context/labelLayerContext.d.ts +2 -0
- package/dist/context/polarLabelViewBoxContext.d.ts +4 -0
- package/dist/context/useTooltipAxis.d.ts +2 -0
- package/dist/es/animation/Animate.mjs +89 -0
- package/dist/es/cartesian/GraphicalItemClipPath.mjs +37 -0
- package/dist/es/cartesian/area/ActivePoints.mjs +78 -0
- package/dist/es/cartesian/area/Area.mjs +52 -0
- package/dist/es/cartesian/area/ClipRect.mjs +125 -0
- package/dist/es/cartesian/area/RenderArea.mjs +185 -0
- package/dist/es/cartesian/area/hooks/useArea.mjs +81 -0
- package/dist/es/cartesian/area/type.mjs +136 -0
- package/dist/es/cartesian/area/utils.mjs +79 -0
- package/dist/es/cartesian/axis/XAxis.mjs +203 -0
- package/dist/es/cartesian/axis/YAxis.mjs +192 -0
- package/dist/es/cartesian/bar/Bar.mjs +111 -0
- package/dist/es/cartesian/bar/components/BarBackground.mjs +32 -0
- package/dist/es/cartesian/bar/components/BarRectangles.mjs +143 -0
- package/dist/es/cartesian/bar/hooks/useBar.mjs +53 -0
- package/dist/es/cartesian/bar/type.mjs +131 -0
- package/dist/es/cartesian/bar/utils.mjs +111 -0
- package/dist/es/cartesian/cartesian-axis/CartesianAxis.mjs +296 -0
- package/dist/es/cartesian/cartesian-grid/Background.mjs +33 -0
- package/dist/es/cartesian/cartesian-grid/CartesianGrid.mjs +174 -0
- package/dist/es/cartesian/cartesian-grid/HorizontalGridLines.mjs +50 -0
- package/dist/es/cartesian/cartesian-grid/HorizontalStripes.mjs +43 -0
- package/dist/es/cartesian/cartesian-grid/VerticalGridLines.mjs +45 -0
- package/dist/es/cartesian/cartesian-grid/VerticalStripes.mjs +43 -0
- package/dist/es/cartesian/cartesian-grid/const.mjs +336 -0
- package/dist/es/cartesian/cartesian-grid/utils.mjs +22 -0
- package/dist/es/cartesian/error-bar/ErrorBar.mjs +143 -0
- package/dist/es/cartesian/error-bar/ErrorBarContext.mjs +20 -0
- package/dist/es/cartesian/funnel/Funnel.mjs +177 -0
- package/dist/es/cartesian/funnel/type.mjs +80 -0
- package/dist/es/cartesian/funnel/utils.mjs +102 -0
- package/dist/es/cartesian/line/ActivePoints.mjs +79 -0
- package/dist/es/cartesian/line/Line.mjs +50 -0
- package/dist/es/cartesian/line/StaticLine.mjs +217 -0
- package/dist/es/cartesian/line/hooks/useLine.mjs +69 -0
- package/dist/es/cartesian/line/type.mjs +112 -0
- package/dist/es/cartesian/line/utils.mjs +34 -0
- package/dist/es/cartesian/reference-area/ReferenceArea.mjs +163 -0
- package/dist/es/cartesian/reference-line/ReferenceLine.mjs +165 -0
- package/dist/es/cartesian/scatter/Scatter.mjs +280 -0
- package/dist/es/cartesian/scatter/hooks/useScatter.mjs +23 -0
- package/dist/es/cartesian/useNeedsClip.mjs +23 -0
- package/dist/es/cartesian/utils/get-ticks.mjs +118 -0
- package/dist/es/cartesian/z-axis/ZAxis.mjs +72 -0
- package/dist/es/chart/AreaChart.mjs +9 -0
- package/dist/es/chart/BarChart.mjs +10 -0
- package/dist/es/chart/ComposedChart.mjs +10 -0
- package/dist/es/chart/FunnelChart.mjs +11 -0
- package/dist/es/chart/LegendPortalContext.mjs +5 -0
- package/dist/es/chart/LineChart.mjs +10 -0
- package/dist/es/chart/PieChart.mjs +16 -0
- package/dist/es/chart/RadarChart.mjs +16 -0
- package/dist/es/chart/RadialBarChart.mjs +16 -0
- package/dist/es/chart/RechartsWrapper.mjs +160 -0
- package/dist/es/chart/ScatterChart.mjs +10 -0
- package/dist/es/chart/Surface.mjs +5 -0
- package/dist/es/chart/Surface.vue_vue_type_script_setup_true_lang.mjs +72 -0
- package/dist/es/chart/TooltipPortalContext.mjs +5 -0
- package/dist/es/chart/const.mjs +7 -0
- package/dist/es/chart/generateCategoricalChart.mjs +175 -0
- package/dist/es/chart/provideClipPathId.mjs +15 -0
- package/dist/es/components/Cell.mjs +23 -0
- package/dist/es/components/Text.mjs +5 -0
- package/dist/es/components/Text.vue_vue_type_script_setup_true_lang.mjs +191 -0
- package/dist/es/components/Tooltip.mjs +463 -0
- package/dist/es/components/label/Label.mjs +40 -0
- package/dist/es/components/label/LabelList.mjs +55 -0
- package/dist/es/components/label/types.mjs +38 -0
- package/dist/es/components/label/utils.mjs +265 -0
- package/dist/es/components/legend/Legend.mjs +93 -0
- package/dist/es/components/legend/LegendSymbol.mjs +62 -0
- package/dist/es/components/legend/hooks/useLegend.mjs +72 -0
- package/dist/es/components/legend/hooks/useLegendContent.mjs +68 -0
- package/dist/es/components/legend/type.mjs +41 -0
- package/dist/es/components/legend/utils.mjs +25 -0
- package/dist/es/components/utils.mjs +44 -0
- package/dist/es/container/ClipPath.mjs +25 -0
- package/dist/es/container/Layer.mjs +14 -0
- package/dist/es/container/ResponsiveContainer.mjs +5 -0
- package/dist/es/container/ResponsiveContainer.vue_vue_type_script_setup_true_lang.mjs +144 -0
- package/dist/es/container/Surface.mjs +62 -0
- package/dist/es/container/useSizeContext.mjs +5 -0
- package/dist/es/context/ChartDataContextProvider.mjs +27 -0
- package/dist/es/context/PanoramaContextProvider.mjs +24 -0
- package/dist/es/context/accessibilityContext.mjs +5 -0
- package/dist/es/context/cartesianLabelListContext.mjs +5 -0
- package/dist/es/context/chartLayoutContext.mjs +49 -0
- package/dist/es/context/cursorLayerContext.mjs +5 -0
- package/dist/es/context/graphicalLayerContext.mjs +5 -0
- package/dist/es/context/labelLayerContext.mjs +5 -0
- package/dist/es/context/polarLabelViewBoxContext.mjs +8 -0
- package/dist/es/context/useTooltipAxis.mjs +17 -0
- package/dist/es/events/useChartSynchronisation.mjs +113 -0
- package/dist/es/hooks/useIsAnimating.mjs +28 -0
- package/dist/es/hooks/useSetupGraphicalItem.mjs +66 -0
- package/dist/es/index.mjs +46 -0
- package/dist/es/polar/pie/Pie.mjs +161 -0
- package/dist/es/polar/pie/type.mjs +97 -0
- package/dist/es/polar/radar/PolarAngleAxis.mjs +180 -0
- package/dist/es/polar/radar/PolarGrid.mjs +115 -0
- package/dist/es/polar/radar/PolarRadiusAxis.mjs +162 -0
- package/dist/es/polar/radar/Radar.mjs +284 -0
- package/dist/es/polar/radial-bar/RadialBar.mjs +197 -0
- package/dist/es/polar/radial-bar/type.mjs +97 -0
- package/dist/es/shape/Cross.mjs +16 -0
- package/dist/es/shape/Curve.mjs +86 -0
- package/dist/es/shape/Dot.mjs +24 -0
- package/dist/es/shape/Rectangle.mjs +83 -0
- package/dist/es/shape/Sector.mjs +156 -0
- package/dist/es/shape/Symbols.mjs +52 -0
- package/dist/es/shape/Trapezoid.mjs +52 -0
- package/dist/es/state/ReportChartProps.mjs +64 -0
- package/dist/es/state/ReportMainChartProps.mjs +46 -0
- package/dist/es/state/ReportPolarOptions.mjs +56 -0
- package/dist/es/state/SetGraphicalItem.mjs +49 -0
- package/dist/es/state/SetLegendPayload.mjs +20 -0
- package/dist/es/state/SetTooltipEntrySettings.mjs +19 -0
- package/dist/es/state/brushSlice.mjs +26 -0
- package/dist/es/state/cartesianAxisSlice.mjs +39 -0
- package/dist/es/state/chartDataSlice.mjs +33 -0
- package/dist/es/state/externalEventsMiddleware.mjs +30 -0
- package/dist/es/state/graphicalItemsSlice.mjs +47 -0
- package/dist/es/state/hooks.mjs +6 -0
- package/dist/es/state/keyboardEventsMiddleware.mjs +63 -0
- package/dist/es/state/layoutSlice.mjs +39 -0
- package/dist/es/state/legendSlice.mjs +40 -0
- package/dist/es/state/mouseEventsMiddleware.mjs +41 -0
- package/dist/es/state/optionsSlice.mjs +25 -0
- package/dist/es/state/polarAxisSlice.mjs +28 -0
- package/dist/es/state/polarOptionsSlice.mjs +13 -0
- package/dist/es/state/reduxDevtoolsJsonStringifyReplacer.mjs +8 -0
- package/dist/es/state/referenceElementsSlice.mjs +36 -0
- package/dist/es/state/rootPropsSlice.mjs +32 -0
- package/dist/es/state/selectors/areaSelectors.mjs +77 -0
- package/dist/es/state/selectors/axisSelectors.mjs +879 -0
- package/dist/es/state/selectors/barSelectors.mjs +241 -0
- package/dist/es/state/selectors/brushSelectors.mjs +18 -0
- package/dist/es/state/selectors/combiners/combineActiveLabel.mjs +9 -0
- package/dist/es/state/selectors/combiners/combineActiveTooltipIndex.mjs +43 -0
- package/dist/es/state/selectors/combiners/combineAxisRangeWithReverse.mjs +8 -0
- package/dist/es/state/selectors/combiners/combineCoordinateForDefaultIndex.mjs +21 -0
- package/dist/es/state/selectors/combiners/combineTooltipInteractionState.mjs +37 -0
- package/dist/es/state/selectors/combiners/combineTooltipPayloadConfigurations.mjs +13 -0
- package/dist/es/state/selectors/common.mjs +4 -0
- package/dist/es/state/selectors/containerSelectors.mjs +7 -0
- package/dist/es/state/selectors/dataSelectors.mjs +35 -0
- package/dist/es/state/selectors/funnelSelectors.mjs +38 -0
- package/dist/es/state/selectors/legendSelectors.mjs +10 -0
- package/dist/es/state/selectors/lineSelectors.mjs +64 -0
- package/dist/es/state/selectors/pickAxisId.mjs +4 -0
- package/dist/es/state/selectors/pickAxisType.mjs +4 -0
- package/dist/es/state/selectors/pieSelectors.mjs +132 -0
- package/dist/es/state/selectors/polarAxisSelectors.mjs +167 -0
- package/dist/es/state/selectors/polarGridSelectors.mjs +19 -0
- package/dist/es/state/selectors/polarScaleSelectors.mjs +55 -0
- package/dist/es/state/selectors/polarSelectors.mjs +81 -0
- package/dist/es/state/selectors/radarSelectors.mjs +133 -0
- package/dist/es/state/selectors/radialBarSelectors.mjs +259 -0
- package/dist/es/state/selectors/rootPropsSelectors.mjs +14 -0
- package/dist/es/state/selectors/scatterSelectors.mjs +134 -0
- package/dist/es/state/selectors/selectActivePropsFromChartPointer.mjs +20 -0
- package/dist/es/state/selectors/selectAllAxes.mjs +10 -0
- package/dist/es/state/selectors/selectChartOffset.mjs +69 -0
- package/dist/es/state/selectors/selectChartOffsetInternal.mjs +66 -0
- package/dist/es/state/selectors/selectTooltipEventType.mjs +22 -0
- package/dist/es/state/selectors/selectTooltipPayloadSearcher.mjs +6 -0
- package/dist/es/state/selectors/selectTooltipSettings.mjs +4 -0
- package/dist/es/state/selectors/selectTooltipState.mjs +4 -0
- package/dist/es/state/selectors/selectors.mjs +104 -0
- package/dist/es/state/selectors/tooltipSelectors.mjs +269 -0
- package/dist/es/state/selectors/touchSelectors.mjs +19 -0
- package/dist/es/state/store.mjs +55 -0
- package/dist/es/state/tooltipSlice.mjs +102 -0
- package/dist/es/state/touchEventsMiddleware.mjs +44 -0
- package/dist/es/state/utils/useReportScale.mjs +19 -0
- package/dist/es/synchronisation/syncSelectors.mjs +6 -0
- package/dist/es/synchronisation/useChartSynchronisation.mjs +38 -0
- package/dist/es/types/event.mjs +166 -0
- package/dist/es/utils/ReduceCSSCalc.mjs +114 -0
- package/dist/es/utils/VueUtils.mjs +39 -0
- package/dist/es/utils/attrs.mjs +69 -0
- package/dist/es/utils/cartesian.mjs +54 -0
- package/dist/es/utils/chart.mjs +366 -0
- package/dist/es/utils/const.mjs +32 -0
- package/dist/es/utils/createContext.mjs +31 -0
- package/dist/es/utils/data-utils.mjs +13 -0
- package/dist/es/utils/data.mjs +41 -0
- package/dist/es/utils/events.mjs +7 -0
- package/dist/es/utils/getLinearRegression.mjs +34 -0
- package/dist/es/utils/grid.mjs +23 -0
- package/dist/es/utils/isDomainSpecifiedByUser.mjs +116 -0
- package/dist/es/utils/legend.mjs +19 -0
- package/dist/es/utils/log.mjs +14 -0
- package/dist/es/utils/payload/getUniqPayload.mjs +9 -0
- package/dist/es/utils/polar.mjs +59 -0
- package/dist/es/utils/props.mjs +20 -0
- package/dist/es/utils/resolveDefaultProps.mjs +26 -0
- package/dist/es/utils/scale/getNiceTickValues.mjs +137 -0
- package/dist/es/utils/scale/utils/arithmetic.mjs +54 -0
- package/dist/es/utils/scale/utils/utils.mjs +53 -0
- package/dist/es/utils/style.mjs +30 -0
- package/dist/es/utils/tick.mjs +42 -0
- package/dist/es/utils/tooltip/translate.mjs +73 -0
- package/dist/es/utils/validate.mjs +42 -0
- package/dist/events/useChartSynchronisation.d.ts +8 -0
- package/dist/hooks/useIsAnimating.d.ts +14 -0
- package/dist/hooks/useSetupGraphicalItem.d.ts +7 -0
- package/dist/index.d.ts +6 -0
- package/dist/polar/index.d.ts +3 -0
- package/dist/polar/pie/Pie.d.ts +2 -0
- package/dist/polar/pie/index.d.ts +2 -0
- package/dist/polar/pie/type.d.ts +88 -0
- package/dist/polar/radar/PolarAngleAxis.d.ts +145 -0
- package/dist/polar/radar/PolarGrid.d.ts +77 -0
- package/dist/polar/radar/PolarRadiusAxis.d.ts +125 -0
- package/dist/polar/radar/Radar.d.ts +160 -0
- package/dist/polar/radar/index.d.ts +4 -0
- package/dist/polar/radial-bar/RadialBar.d.ts +2 -0
- package/dist/polar/radial-bar/index.d.ts +2 -0
- package/dist/polar/radial-bar/type.d.ts +96 -0
- package/dist/shape/Cross.d.ts +10 -0
- package/dist/shape/Curve.d.ts +42 -0
- package/dist/shape/Dot.d.ts +18 -0
- package/dist/shape/Rectangle.d.ts +33 -0
- package/dist/shape/Sector.d.ts +48 -0
- package/dist/shape/Symbols.d.ts +15 -0
- package/dist/shape/Trapezoid.d.ts +31 -0
- package/dist/shape/index.d.ts +9 -0
- package/dist/shape/types.d.ts +20 -0
- package/dist/state/ReportBar.d.ts +1 -0
- package/dist/state/ReportChartProps.d.ts +88 -0
- package/dist/state/ReportMainChartProps.d.ts +37 -0
- package/dist/state/ReportPolarOptions.d.ts +59 -0
- package/dist/state/SetGraphicalItem.d.ts +9 -0
- package/dist/state/SetLegendPayload.d.ts +3 -0
- package/dist/state/SetTooltipEntrySettings.d.ts +8 -0
- package/dist/state/brushSlice.d.ts +18 -0
- package/dist/state/cartesianAxisSlice.d.ts +88 -0
- package/dist/state/chartDataSlice.d.ts +44 -0
- package/dist/state/externalEventsMiddleware.d.ts +17 -0
- package/dist/state/graphicalItemsSlice.d.ts +108 -0
- package/dist/state/hooks.d.ts +54 -0
- package/dist/state/keyboardEventsMiddleware.d.ts +3 -0
- package/dist/state/layoutSlice.d.ts +15 -0
- package/dist/state/legendSlice.d.ts +26 -0
- package/dist/state/mouseEventsMiddleware.d.ts +5 -0
- package/dist/state/optionsSlice.d.ts +27 -0
- package/dist/state/polarAxisSlice.d.ts +10 -0
- package/dist/state/polarOptionsSlice.d.ts +10 -0
- package/dist/state/reduxDevtoolsJsonStringifyReplacer.d.ts +1 -0
- package/dist/state/referenceElementsSlice.d.ts +40 -0
- package/dist/state/rootPropsSlice.d.ts +26 -0
- package/dist/state/selectors/areaSelectors.d.ts +24 -0
- package/dist/state/selectors/axisSelectors.d.ts +1828 -0
- package/dist/state/selectors/barSelectors.d.ts +944 -0
- package/dist/state/selectors/brushSelectors.d.ts +10 -0
- package/dist/state/selectors/combiners/combineActiveLabel.d.ts +3 -0
- package/dist/state/selectors/combiners/combineActiveTooltipIndex.d.ts +5 -0
- package/dist/state/selectors/combiners/combineAxisRangeWithReverse.d.ts +3 -0
- package/dist/state/selectors/combiners/combineCoordinateForDefaultIndex.d.ts +3 -0
- package/dist/state/selectors/combiners/combineTooltipInteractionState.d.ts +3 -0
- package/dist/state/selectors/combiners/combineTooltipPayloadConfigurations.d.ts +3 -0
- package/dist/state/selectors/common.d.ts +2 -0
- package/dist/state/selectors/containerSelectors.d.ts +6 -0
- package/dist/state/selectors/dataSelectors.d.ts +23 -0
- package/dist/state/selectors/funnelSelectors.d.ts +69 -0
- package/dist/state/selectors/legendSelectors.d.ts +7 -0
- package/dist/state/selectors/lineSelectors.d.ts +123 -0
- package/dist/state/selectors/pickAxisId.d.ts +3 -0
- package/dist/state/selectors/pickAxisType.d.ts +2 -0
- package/dist/state/selectors/pieSelectors.d.ts +55 -0
- package/dist/state/selectors/polarAxisSelectors.d.ts +49 -0
- package/dist/state/selectors/polarGridSelectors.d.ts +118 -0
- package/dist/state/selectors/polarScaleSelectors.d.ts +9 -0
- package/dist/state/selectors/polarSelectors.d.ts +70 -0
- package/dist/state/selectors/radarSelectors.d.ts +76 -0
- package/dist/state/selectors/radialBarSelectors.d.ts +61 -0
- package/dist/state/selectors/rootPropsSelectors.d.ts +11 -0
- package/dist/state/selectors/scatterSelectors.d.ts +21 -0
- package/dist/state/selectors/selectActivePropsFromChartPointer.d.ts +382 -0
- package/dist/state/selectors/selectAllAxes.d.ts +4 -0
- package/dist/state/selectors/selectChartOffset.d.ts +116 -0
- package/dist/state/selectors/selectChartOffsetInternal.d.ts +9 -0
- package/dist/state/selectors/selectTooltipEventType.d.ts +8 -0
- package/dist/state/selectors/selectTooltipPayloadSearcher.d.ts +3 -0
- package/dist/state/selectors/selectTooltipSettings.d.ts +3 -0
- package/dist/state/selectors/selectTooltipState.d.ts +3 -0
- package/dist/state/selectors/selectors.d.ts +184 -0
- package/dist/state/selectors/tooltipSelectors.d.ts +581 -0
- package/dist/state/selectors/touchSelectors.d.ts +4 -0
- package/dist/state/store.d.ts +74 -0
- package/dist/state/tooltipSlice.d.ts +204 -0
- package/dist/state/touchEventsMiddleware.d.ts +2 -0
- package/dist/state/utils/useReportScale.d.ts +1 -0
- package/dist/synchronisation/syncSelectors.d.ts +3 -0
- package/dist/synchronisation/useChartSynchronisation.d.ts +11 -0
- package/dist/types/area.d.ts +8 -0
- package/dist/types/axis.d.ts +127 -0
- package/dist/types/bar.d.ts +51 -0
- package/dist/types/categorical.d.ts +36 -0
- package/dist/types/common.d.ts +129 -0
- package/dist/types/event.d.ts +16 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/legend.d.ts +1 -0
- package/dist/types/offset.d.ts +8 -0
- package/dist/types/radar.d.ts +28 -0
- package/dist/types/scale.d.ts +11 -0
- package/dist/types/tick.d.ts +55 -0
- package/dist/types/tooltip.d.ts +33 -0
- package/dist/utils/ReduceCSSCalc.d.ts +2 -0
- package/dist/utils/VueUtils.d.ts +11 -0
- package/dist/utils/attrs.d.ts +46 -0
- package/dist/utils/cartesian.d.ts +20 -0
- package/dist/utils/chart.d.ts +99 -0
- package/dist/utils/const.d.ts +30 -0
- package/dist/utils/context.d.ts +8 -0
- package/dist/utils/createContext.d.ts +8 -0
- package/dist/utils/data-utils.d.ts +4 -0
- package/dist/utils/data.d.ts +13 -0
- package/dist/utils/events.d.ts +12 -0
- package/dist/utils/getLinearRegression.d.ts +15 -0
- package/dist/utils/getRelativeCoordinate.d.ts +11 -0
- package/dist/utils/grid.d.ts +37 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/isDomainSpecifiedByUser.d.ts +47 -0
- package/dist/utils/legend.d.ts +3 -0
- package/dist/utils/log.d.ts +1 -0
- package/dist/utils/payload/getUniqPayload.d.ts +4 -0
- package/dist/utils/polar.d.ts +21 -0
- package/dist/utils/props.d.ts +15 -0
- package/dist/utils/resolveDefaultProps.d.ts +52 -0
- package/dist/utils/scale/getNiceTickValues.d.ts +61 -0
- package/dist/utils/scale/utils/arithmetic.d.ts +50 -0
- package/dist/utils/scale/utils/utils.d.ts +9 -0
- package/dist/utils/style.d.ts +12 -0
- package/dist/utils/tick.d.ts +19 -0
- package/dist/utils/tooltip/translate.d.ts +47 -0
- package/dist/utils/types.d.ts +14 -0
- package/dist/utils/validate.d.ts +25 -0
- package/package.json +27 -10
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { isNumber } from "../../utils/validate.mjs";
|
|
2
|
+
//#region src/components/legend/utils.ts
|
|
3
|
+
function getDefaultPosition(style, props, margin, chartWidth, chartHeight, box) {
|
|
4
|
+
const { layout, align, verticalAlign } = props;
|
|
5
|
+
let hPos = {};
|
|
6
|
+
let vPos = {};
|
|
7
|
+
if (!style || (style.left === void 0 || style.left === null) && (style.right === void 0 || style.right === null)) if (align === "center" && layout === "vertical") hPos = { left: `${((chartWidth || 0) - box.width) / 2}px` };
|
|
8
|
+
else hPos = align === "right" ? { right: `${margin?.right || 0}px` } : { left: `${margin?.left || 0}px` };
|
|
9
|
+
if (!style || (style.top === void 0 || style.top === null) && (style.bottom === void 0 || style.bottom === null)) if (verticalAlign === "middle") vPos = { top: `${((chartHeight || 0) - box.height) / 2}px` };
|
|
10
|
+
else vPos = verticalAlign === "bottom" ? { bottom: `${margin?.bottom || 0}px` } : { top: `${margin?.top || 0}px` };
|
|
11
|
+
return {
|
|
12
|
+
...hPos,
|
|
13
|
+
...vPos
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
function getWidthOrHeight(layout, height, width, maxWidth) {
|
|
17
|
+
if (layout === "vertical" && isNumber(height)) return { height };
|
|
18
|
+
if (layout === "horizontal") return { width: width || maxWidth };
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
function defaultUniqBy(entry) {
|
|
22
|
+
return entry.value;
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
25
|
+
export { defaultUniqBy, getDefaultPosition, getWidthOrHeight };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { polarToCartesian } from "../utils/polar.mjs";
|
|
2
|
+
//#region src/components/utils.ts
|
|
3
|
+
function getRadialCursorPoints(activeCoordinate) {
|
|
4
|
+
const { cx, cy, radius, startAngle, endAngle } = activeCoordinate;
|
|
5
|
+
return {
|
|
6
|
+
points: [polarToCartesian(cx, cy, radius, startAngle), polarToCartesian(cx, cy, radius, endAngle)],
|
|
7
|
+
cx,
|
|
8
|
+
cy,
|
|
9
|
+
radius,
|
|
10
|
+
startAngle,
|
|
11
|
+
endAngle
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
function getCursorPoints(layout, activeCoordinate, offset) {
|
|
15
|
+
let x1, y1, x2, y2;
|
|
16
|
+
if (layout === "horizontal") {
|
|
17
|
+
x1 = activeCoordinate.x;
|
|
18
|
+
x2 = x1;
|
|
19
|
+
y1 = offset.top;
|
|
20
|
+
y2 = offset.top + offset.height;
|
|
21
|
+
} else if (layout === "vertical") {
|
|
22
|
+
y1 = activeCoordinate.y;
|
|
23
|
+
y2 = y1;
|
|
24
|
+
x1 = offset.left;
|
|
25
|
+
x2 = offset.left + offset.width;
|
|
26
|
+
} else if (activeCoordinate.cx != null && activeCoordinate.cy != null) if (layout === "centric") {
|
|
27
|
+
const { cx, cy, innerRadius, outerRadius, angle } = activeCoordinate;
|
|
28
|
+
const innerPoint = polarToCartesian(cx, cy, innerRadius, angle);
|
|
29
|
+
const outerPoint = polarToCartesian(cx, cy, outerRadius, angle);
|
|
30
|
+
x1 = innerPoint.x;
|
|
31
|
+
y1 = innerPoint.y;
|
|
32
|
+
x2 = outerPoint.x;
|
|
33
|
+
y2 = outerPoint.y;
|
|
34
|
+
} else return getRadialCursorPoints(activeCoordinate);
|
|
35
|
+
return [{
|
|
36
|
+
x: x1,
|
|
37
|
+
y: y1
|
|
38
|
+
}, {
|
|
39
|
+
x: x2,
|
|
40
|
+
y: y2
|
|
41
|
+
}];
|
|
42
|
+
}
|
|
43
|
+
//#endregion
|
|
44
|
+
export { getCursorPoints };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { useOffset } from "../context/chartLayoutContext.mjs";
|
|
2
|
+
import { createVNode, defineComponent } from "vue";
|
|
3
|
+
//#region src/container/ClipPath.tsx
|
|
4
|
+
var ClipPath_default = /* @__PURE__ */ defineComponent({
|
|
5
|
+
name: "ClipPath",
|
|
6
|
+
props: { clipPathId: {
|
|
7
|
+
type: String,
|
|
8
|
+
required: true
|
|
9
|
+
} },
|
|
10
|
+
setup(props) {
|
|
11
|
+
const offset = useOffset();
|
|
12
|
+
return () => {
|
|
13
|
+
if (!offset.value) return null;
|
|
14
|
+
const { left, top, height, width } = offset.value;
|
|
15
|
+
return createVNode("defs", null, [createVNode("clipPath", { "id": props.clipPathId }, [createVNode("rect", {
|
|
16
|
+
"x": left,
|
|
17
|
+
"y": top,
|
|
18
|
+
"height": height,
|
|
19
|
+
"width": width
|
|
20
|
+
}, null)])]);
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
//#endregion
|
|
25
|
+
export { ClipPath_default as default };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { filterProps } from "../utils/VueUtils.mjs";
|
|
2
|
+
import { createVNode, defineComponent, mergeProps } from "vue";
|
|
3
|
+
//#region src/container/Layer.tsx
|
|
4
|
+
var Layer = /* @__PURE__ */ defineComponent({
|
|
5
|
+
name: "VChartsLayer",
|
|
6
|
+
inheritAttrs: false,
|
|
7
|
+
setup(_, { attrs, slots }) {
|
|
8
|
+
return () => {
|
|
9
|
+
return createVNode("g", mergeProps(attrs, filterProps(attrs, true), { "class": "v-charts-layer" }), [slots.default?.()]);
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
//#endregion
|
|
14
|
+
export { Layer };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import ResponsiveContainer_vue_vue_type_script_setup_true_lang_default from "./ResponsiveContainer.vue_vue_type_script_setup_true_lang.mjs";
|
|
2
|
+
//#region src/container/ResponsiveContainer.vue
|
|
3
|
+
var ResponsiveContainer_default = ResponsiveContainer_vue_vue_type_script_setup_true_lang_default;
|
|
4
|
+
//#endregion
|
|
5
|
+
export { ResponsiveContainer_default as default };
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { isPercent } from "../utils/validate.mjs";
|
|
2
|
+
import { normalizeStyle as normalizeStyle$1 } from "../utils/style.mjs";
|
|
3
|
+
import { provideSizeContext } from "./useSizeContext.mjs";
|
|
4
|
+
import { Fragment, cloneVNode, computed, createBlock, createElementBlock, defineComponent, normalizeClass, normalizeStyle, onMounted, onUnmounted, openBlock, ref, resolveDynamicComponent, toRef, useSlots } from "vue";
|
|
5
|
+
import { useThrottleFn } from "@vueuse/core";
|
|
6
|
+
//#region src/container/ResponsiveContainer.vue?vue&type=script&setup=true&lang.ts
|
|
7
|
+
var _hoisted_1 = ["id"];
|
|
8
|
+
var ResponsiveContainer_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
9
|
+
name: "ResponsiveContainer",
|
|
10
|
+
inheritAttrs: false,
|
|
11
|
+
__name: "ResponsiveContainer",
|
|
12
|
+
props: {
|
|
13
|
+
aspect: {},
|
|
14
|
+
width: { default: "100%" },
|
|
15
|
+
height: { default: "100%" },
|
|
16
|
+
minWidth: { default: 0 },
|
|
17
|
+
minHeight: {},
|
|
18
|
+
initialDimension: { default: () => ({
|
|
19
|
+
width: -1,
|
|
20
|
+
height: -1
|
|
21
|
+
}) },
|
|
22
|
+
maxHeight: {},
|
|
23
|
+
debounce: { default: 0 },
|
|
24
|
+
id: {},
|
|
25
|
+
class: {},
|
|
26
|
+
style: {},
|
|
27
|
+
onResize: {}
|
|
28
|
+
},
|
|
29
|
+
setup(__props) {
|
|
30
|
+
const props = __props;
|
|
31
|
+
const slots = useSlots();
|
|
32
|
+
const debounce = toRef(props, "debounce");
|
|
33
|
+
const sizes = ref({
|
|
34
|
+
width: props.initialDimension.width,
|
|
35
|
+
height: props.initialDimension.height
|
|
36
|
+
});
|
|
37
|
+
const calculatedWidth = computed(() => {
|
|
38
|
+
return isPercent(props.width) ? sizes.value.width : props.width;
|
|
39
|
+
});
|
|
40
|
+
const calculatedHeight = computed(() => {
|
|
41
|
+
let height = isPercent(props.height) ? sizes.value.height : props.height;
|
|
42
|
+
if (props.aspect && props.aspect > 0) {
|
|
43
|
+
if (props.width && (props.height == null || props.height === "auto")) height = calculatedWidth.value / props.aspect;
|
|
44
|
+
else if (props.height && (props.width == null || props.width === "auto")) {}
|
|
45
|
+
}
|
|
46
|
+
return height;
|
|
47
|
+
});
|
|
48
|
+
const finalCalculatedWidth = computed(() => {
|
|
49
|
+
let width = calculatedWidth.value;
|
|
50
|
+
if (props.aspect && props.aspect > 0) {
|
|
51
|
+
if (props.height && (props.width == null || props.width === "auto")) width = calculatedHeight.value * props.aspect;
|
|
52
|
+
}
|
|
53
|
+
return width;
|
|
54
|
+
});
|
|
55
|
+
provideSizeContext({
|
|
56
|
+
sizes,
|
|
57
|
+
calculatedWidth: finalCalculatedWidth,
|
|
58
|
+
calculatedHeight
|
|
59
|
+
});
|
|
60
|
+
function setContainerSize(width, height) {
|
|
61
|
+
const roundedWidth = Math.round(width);
|
|
62
|
+
const roundedHeight = Math.round(height);
|
|
63
|
+
const { width: containerWidth, height: containerHeight } = sizes.value;
|
|
64
|
+
if (containerWidth === roundedWidth && containerHeight === roundedHeight) return;
|
|
65
|
+
sizes.value = {
|
|
66
|
+
width: roundedWidth,
|
|
67
|
+
height: roundedHeight
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
const handleResize = useThrottleFn((entries) => {
|
|
71
|
+
const { width: containerWidth, height: containerHeight } = entries[0].contentRect;
|
|
72
|
+
setContainerSize(containerWidth, containerHeight);
|
|
73
|
+
props.onResize?.(containerWidth, containerHeight);
|
|
74
|
+
}, debounce, true, false);
|
|
75
|
+
const containerRef = ref();
|
|
76
|
+
let observer = null;
|
|
77
|
+
onMounted(() => {
|
|
78
|
+
observer = new ResizeObserver(handleResize);
|
|
79
|
+
const { width: containerWidth, height: containerHeight } = containerRef.value.getBoundingClientRect() ?? {
|
|
80
|
+
width: 0,
|
|
81
|
+
height: 0
|
|
82
|
+
};
|
|
83
|
+
setContainerSize(containerWidth, containerHeight);
|
|
84
|
+
observer.observe(containerRef.value);
|
|
85
|
+
});
|
|
86
|
+
onUnmounted(() => {
|
|
87
|
+
observer?.disconnect();
|
|
88
|
+
});
|
|
89
|
+
const isReady = computed(() => {
|
|
90
|
+
const { width: containerWidth, height: containerHeight } = sizes.value;
|
|
91
|
+
return containerWidth >= 0 && containerHeight >= 0;
|
|
92
|
+
});
|
|
93
|
+
function flattenSlotChildren(vnodes) {
|
|
94
|
+
const result = [];
|
|
95
|
+
for (const vnode of vnodes) if (vnode.type === Fragment && Array.isArray(vnode.children)) result.push(...flattenSlotChildren(vnode.children));
|
|
96
|
+
else result.push(vnode);
|
|
97
|
+
return result;
|
|
98
|
+
}
|
|
99
|
+
function renderChildren() {
|
|
100
|
+
if (!isReady.value) return;
|
|
101
|
+
const calculatedWidthValue = finalCalculatedWidth.value;
|
|
102
|
+
const calculatedHeightValue = calculatedHeight.value;
|
|
103
|
+
const rawChildren = slots.default?.();
|
|
104
|
+
if (!rawChildren) return void 0;
|
|
105
|
+
return flattenSlotChildren(rawChildren).map((child, index) => {
|
|
106
|
+
return cloneVNode(child, {
|
|
107
|
+
width: calculatedWidthValue,
|
|
108
|
+
height: calculatedHeightValue,
|
|
109
|
+
key: child.key || `responsive-child-${index}`,
|
|
110
|
+
style: {
|
|
111
|
+
...normalizeStyle$1({
|
|
112
|
+
maxHeight: sizes.value.height,
|
|
113
|
+
maxWidth: sizes.value.width
|
|
114
|
+
}),
|
|
115
|
+
height: "100%",
|
|
116
|
+
width: "100%",
|
|
117
|
+
...child.props?.style
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
const containerStyle = computed(() => ({
|
|
123
|
+
...props.style,
|
|
124
|
+
...normalizeStyle$1({
|
|
125
|
+
width: props.width,
|
|
126
|
+
height: props.height,
|
|
127
|
+
minWidth: props.minWidth,
|
|
128
|
+
minHeight: props.minHeight,
|
|
129
|
+
maxHeight: props.maxHeight
|
|
130
|
+
})
|
|
131
|
+
}));
|
|
132
|
+
return (_ctx, _cache) => {
|
|
133
|
+
return openBlock(), createElementBlock("div", {
|
|
134
|
+
id: _ctx.id ? `${_ctx.id}` : void 0,
|
|
135
|
+
ref_key: "containerRef",
|
|
136
|
+
ref: containerRef,
|
|
137
|
+
class: normalizeClass(["vcharts-responsive-container", [props.class]]),
|
|
138
|
+
style: normalizeStyle(containerStyle.value)
|
|
139
|
+
}, [(openBlock(), createBlock(resolveDynamicComponent(() => renderChildren())))], 14, _hoisted_1);
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
//#endregion
|
|
144
|
+
export { ResponsiveContainer_vue_vue_type_script_setup_true_lang_default as default };
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { createVNode, defineComponent, mergeProps } from "vue";
|
|
2
|
+
//#region src/container/Surface.tsx
|
|
3
|
+
/**
|
|
4
|
+
* @fileOverview Surface component for SVG rendering
|
|
5
|
+
*/
|
|
6
|
+
var Surface = /* @__PURE__ */ defineComponent({
|
|
7
|
+
name: "Surface",
|
|
8
|
+
props: {
|
|
9
|
+
width: {
|
|
10
|
+
type: Number,
|
|
11
|
+
required: true
|
|
12
|
+
},
|
|
13
|
+
height: {
|
|
14
|
+
type: Number,
|
|
15
|
+
required: true
|
|
16
|
+
},
|
|
17
|
+
viewBox: {
|
|
18
|
+
type: Object,
|
|
19
|
+
default: void 0
|
|
20
|
+
},
|
|
21
|
+
class: {
|
|
22
|
+
type: String,
|
|
23
|
+
default: void 0
|
|
24
|
+
},
|
|
25
|
+
style: {
|
|
26
|
+
type: Object,
|
|
27
|
+
default: void 0
|
|
28
|
+
},
|
|
29
|
+
title: {
|
|
30
|
+
type: String,
|
|
31
|
+
default: void 0
|
|
32
|
+
},
|
|
33
|
+
desc: {
|
|
34
|
+
type: String,
|
|
35
|
+
default: void 0
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
setup(props, { slots, attrs }) {
|
|
39
|
+
return () => {
|
|
40
|
+
const { width, height, viewBox, class: className, style, title, desc, ...rest } = props;
|
|
41
|
+
const svgView = viewBox || {
|
|
42
|
+
width,
|
|
43
|
+
height,
|
|
44
|
+
x: 0,
|
|
45
|
+
y: 0
|
|
46
|
+
};
|
|
47
|
+
return createVNode("svg", mergeProps({
|
|
48
|
+
"class": ["vcharts-surface", className],
|
|
49
|
+
"width": width,
|
|
50
|
+
"height": height,
|
|
51
|
+
"style": style,
|
|
52
|
+
"viewBox": `${svgView.x} ${svgView.y} ${svgView.width} ${svgView.height}`
|
|
53
|
+
}, rest, attrs), [
|
|
54
|
+
title && createVNode("title", null, [title]),
|
|
55
|
+
desc && createVNode("desc", null, [desc]),
|
|
56
|
+
slots.default?.()
|
|
57
|
+
]);
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
//#endregion
|
|
62
|
+
export { Surface as default };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { useAppDispatch } from "../state/hooks.mjs";
|
|
2
|
+
import { setChartData } from "../state/chartDataSlice.mjs";
|
|
3
|
+
import { defineComponent, onUnmounted, watch } from "vue";
|
|
4
|
+
//#region src/context/ChartDataContextProvider.ts
|
|
5
|
+
/**
|
|
6
|
+
* ChartDataContextProvider for Vue
|
|
7
|
+
* Sets chartData in store on mount/update, clears on unmount. Renders nothing.
|
|
8
|
+
*/
|
|
9
|
+
var ChartDataContextProvider = defineComponent({
|
|
10
|
+
name: "ChartDataContextProvider",
|
|
11
|
+
props: { chartData: {
|
|
12
|
+
type: Array,
|
|
13
|
+
required: true
|
|
14
|
+
} },
|
|
15
|
+
setup(props) {
|
|
16
|
+
const dispatch = useAppDispatch();
|
|
17
|
+
watch(() => props.chartData, (val) => {
|
|
18
|
+
dispatch(setChartData(Array.from(val)));
|
|
19
|
+
}, { immediate: true });
|
|
20
|
+
onUnmounted(() => {
|
|
21
|
+
dispatch(setChartData(void 0));
|
|
22
|
+
});
|
|
23
|
+
return () => null;
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
//#endregion
|
|
27
|
+
export { ChartDataContextProvider };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { createContext } from "../utils/createContext.mjs";
|
|
2
|
+
import { defineComponent } from "vue";
|
|
3
|
+
//#region src/context/PanoramaContextProvider.ts
|
|
4
|
+
var [injectPanorama, providePanoramaContext] = createContext("PanoramaContext");
|
|
5
|
+
/**
|
|
6
|
+
* useIsPanorama composable
|
|
7
|
+
* Returns the injected isPanorama value (default: false)
|
|
8
|
+
*/
|
|
9
|
+
function useIsPanorama() {
|
|
10
|
+
return injectPanorama(false);
|
|
11
|
+
}
|
|
12
|
+
defineComponent({
|
|
13
|
+
name: "PanoramaContextProvider",
|
|
14
|
+
props: { isPanorama: {
|
|
15
|
+
type: Boolean,
|
|
16
|
+
required: true
|
|
17
|
+
} },
|
|
18
|
+
setup(props, { slots }) {
|
|
19
|
+
providePanoramaContext(true);
|
|
20
|
+
return () => slots.default?.();
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
//#endregion
|
|
24
|
+
export { useIsPanorama };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { createContext } from "../utils/createContext.mjs";
|
|
2
|
+
//#region src/context/cartesianLabelListContext.ts
|
|
3
|
+
var [useCartesianLabelListData, provideCartesianLabelListData] = createContext("CartesianLabelListContext");
|
|
4
|
+
//#endregion
|
|
5
|
+
export { provideCartesianLabelListData, useCartesianLabelListData };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { useIsPanorama } from "./PanoramaContextProvider.mjs";
|
|
2
|
+
import { selectChartHeight, selectChartWidth } from "../state/selectors/containerSelectors.mjs";
|
|
3
|
+
import { selectChartOffset, selectChartViewBox } from "../state/selectors/selectChartOffset.mjs";
|
|
4
|
+
import { selectBrushDimensions, selectBrushSettings } from "../state/selectors/brushSelectors.mjs";
|
|
5
|
+
import { selectChartLayout } from "../state/selectors/common.mjs";
|
|
6
|
+
import { useAppSelector } from "../state/hooks.mjs";
|
|
7
|
+
import { selectChartOffsetInternal } from "../state/selectors/selectChartOffsetInternal.mjs";
|
|
8
|
+
import { computed } from "vue";
|
|
9
|
+
//#region src/context/chartLayoutContext.tsx
|
|
10
|
+
function useOffset() {
|
|
11
|
+
return useAppSelector(selectChartOffset);
|
|
12
|
+
}
|
|
13
|
+
var useChartLayout = () => useAppSelector(selectChartLayout);
|
|
14
|
+
function useViewBox() {
|
|
15
|
+
const panorama = useIsPanorama();
|
|
16
|
+
const rootViewBox = useAppSelector(selectChartViewBox);
|
|
17
|
+
const brushDimensions = useAppSelector(selectBrushDimensions);
|
|
18
|
+
const brushPadding = useAppSelector(selectBrushSettings);
|
|
19
|
+
return computed(() => {
|
|
20
|
+
if (!panorama || !brushDimensions.value || !brushPadding.value) return rootViewBox.value;
|
|
21
|
+
const padding = brushPadding.value.padding;
|
|
22
|
+
return {
|
|
23
|
+
width: brushDimensions.value.width - padding.left - padding.right,
|
|
24
|
+
height: brushDimensions.value.height - padding.top - padding.bottom,
|
|
25
|
+
x: padding.left,
|
|
26
|
+
y: padding.top
|
|
27
|
+
};
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
function useChartWidth() {
|
|
31
|
+
return useAppSelector(selectChartWidth);
|
|
32
|
+
}
|
|
33
|
+
function useChartHeight() {
|
|
34
|
+
return useAppSelector(selectChartHeight);
|
|
35
|
+
}
|
|
36
|
+
function useOffsetInternal() {
|
|
37
|
+
return useAppSelector(selectChartOffsetInternal);
|
|
38
|
+
}
|
|
39
|
+
var manyComponentsThrowErrorsIfMarginIsUndefined = {
|
|
40
|
+
top: 0,
|
|
41
|
+
right: 0,
|
|
42
|
+
bottom: 0,
|
|
43
|
+
left: 0
|
|
44
|
+
};
|
|
45
|
+
function useMargin() {
|
|
46
|
+
return useAppSelector((state) => state.layout.margin ?? manyComponentsThrowErrorsIfMarginIsUndefined);
|
|
47
|
+
}
|
|
48
|
+
//#endregion
|
|
49
|
+
export { useChartHeight, useChartLayout, useChartWidth, useMargin, useOffset, useOffsetInternal, useViewBox };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { createContext } from "../utils/createContext.mjs";
|
|
2
|
+
//#region src/context/graphicalLayerContext.ts
|
|
3
|
+
var [useGraphicalLayerRef, provideGraphicalLayerRef] = createContext("GraphicalLayerContext");
|
|
4
|
+
//#endregion
|
|
5
|
+
export { provideGraphicalLayerRef, useGraphicalLayerRef };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { computed, inject } from "vue";
|
|
2
|
+
//#region src/context/polarLabelViewBoxContext.ts
|
|
3
|
+
var POLAR_LABEL_VIEW_BOX_KEY = Symbol("polar-label-view-box");
|
|
4
|
+
function usePolarLabelViewBox() {
|
|
5
|
+
return inject(POLAR_LABEL_VIEW_BOX_KEY, computed(() => void 0));
|
|
6
|
+
}
|
|
7
|
+
//#endregion
|
|
8
|
+
export { POLAR_LABEL_VIEW_BOX_KEY, usePolarLabelViewBox };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { getBandSizeOfAxis } from "../utils/chart.mjs";
|
|
2
|
+
import { selectTooltipAxis, selectTooltipAxisScale, selectTooltipAxisTicks } from "../state/selectors/tooltipSelectors.mjs";
|
|
3
|
+
import { useAppSelector } from "../state/hooks.mjs";
|
|
4
|
+
import { computed } from "vue";
|
|
5
|
+
//#region src/context/useTooltipAxis.ts
|
|
6
|
+
var useTooltipAxis = () => useAppSelector(selectTooltipAxis);
|
|
7
|
+
function useTooltipAxisBandSize() {
|
|
8
|
+
const tooltipAxis = useTooltipAxis();
|
|
9
|
+
const tooltipTicks = useAppSelector(selectTooltipAxisTicks);
|
|
10
|
+
const tooltipAxisScale = useAppSelector(selectTooltipAxisScale);
|
|
11
|
+
return computed(() => getBandSizeOfAxis({
|
|
12
|
+
...tooltipAxis.value,
|
|
13
|
+
scale: tooltipAxisScale.value
|
|
14
|
+
}, tooltipTicks.value));
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
export { useTooltipAxisBandSize };
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { selectEventEmitter, selectSyncId, selectSyncMethod } from "../state/selectors/rootPropsSelectors.mjs";
|
|
2
|
+
import { setSyncInteraction } from "../state/tooltipSlice.mjs";
|
|
3
|
+
import { selectTooltipAxisTicks } from "../state/selectors/tooltipSelectors.mjs";
|
|
4
|
+
import { useAppDispatch, useAppSelector } from "../state/hooks.mjs";
|
|
5
|
+
import { useChartLayout, useViewBox } from "../context/chartLayoutContext.mjs";
|
|
6
|
+
import { createEventEmitter } from "../state/optionsSlice.mjs";
|
|
7
|
+
import { setDataStartEndIndexes } from "../state/chartDataSlice.mjs";
|
|
8
|
+
import { BRUSH_SYNC_EVENT, TOOLTIP_SYNC_EVENT, eventCenter } from "../utils/events.mjs";
|
|
9
|
+
import { onMounted, watch } from "vue";
|
|
10
|
+
//#region src/events/useChartSynchronisation.tsx
|
|
11
|
+
function useTooltipSyncEventsListener() {
|
|
12
|
+
const mySyncId = useAppSelector(selectSyncId);
|
|
13
|
+
const myEventEmitter = useAppSelector(selectEventEmitter);
|
|
14
|
+
const dispatch = useAppDispatch();
|
|
15
|
+
const syncMethod = useAppSelector(selectSyncMethod);
|
|
16
|
+
const tooltipTicks = useAppSelector(selectTooltipAxisTicks);
|
|
17
|
+
const layout = useChartLayout();
|
|
18
|
+
const viewBox = useViewBox();
|
|
19
|
+
watch([
|
|
20
|
+
useAppSelector((state) => state.rootProps.class),
|
|
21
|
+
myEventEmitter,
|
|
22
|
+
mySyncId,
|
|
23
|
+
syncMethod,
|
|
24
|
+
tooltipTicks,
|
|
25
|
+
layout,
|
|
26
|
+
viewBox
|
|
27
|
+
], (v, o, onCleanup) => {
|
|
28
|
+
if (mySyncId.value == null) return;
|
|
29
|
+
const listener = (incomingSyncId, action, emitter) => {
|
|
30
|
+
if (myEventEmitter.value === emitter) return;
|
|
31
|
+
if (mySyncId.value !== incomingSyncId) return;
|
|
32
|
+
if (syncMethod.value === "index") {
|
|
33
|
+
dispatch(action);
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
if (tooltipTicks.value == null) return;
|
|
37
|
+
let activeTick;
|
|
38
|
+
if (typeof syncMethod.value === "function") {
|
|
39
|
+
const syncMethodParam = {
|
|
40
|
+
activeTooltipIndex: action.payload.index == null ? void 0 : Number(action.payload.index),
|
|
41
|
+
isTooltipActive: action.payload.active,
|
|
42
|
+
activeIndex: action.payload.index == null ? void 0 : Number(action.payload.index),
|
|
43
|
+
activeLabel: action.payload.label,
|
|
44
|
+
activeDataKey: action.payload.dataKey,
|
|
45
|
+
activeCoordinate: action.payload.coordinate
|
|
46
|
+
};
|
|
47
|
+
const activeTooltipIndex = syncMethod.value(tooltipTicks.value, syncMethodParam);
|
|
48
|
+
activeTick = tooltipTicks.value[activeTooltipIndex];
|
|
49
|
+
} else if (syncMethod.value === "value") activeTick = tooltipTicks.value.find((tick) => String(tick.value) === action.payload.label);
|
|
50
|
+
if (activeTick == null || action.payload.active === false) {
|
|
51
|
+
dispatch(setSyncInteraction({
|
|
52
|
+
active: false,
|
|
53
|
+
coordinate: void 0,
|
|
54
|
+
dataKey: void 0,
|
|
55
|
+
index: null,
|
|
56
|
+
label: void 0
|
|
57
|
+
}));
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
const { x, y } = action.payload.coordinate;
|
|
61
|
+
const validateChartX = Math.min(x, viewBox.value?.x + viewBox.value?.width);
|
|
62
|
+
const validateChartY = Math.min(y, viewBox.value?.y + viewBox.value?.height);
|
|
63
|
+
const activeCoordinate = {
|
|
64
|
+
x: layout.value === "horizontal" ? activeTick.coordinate : validateChartX,
|
|
65
|
+
y: layout.value === "horizontal" ? validateChartY : activeTick.coordinate
|
|
66
|
+
};
|
|
67
|
+
dispatch(setSyncInteraction({
|
|
68
|
+
active: action.payload.active,
|
|
69
|
+
coordinate: activeCoordinate,
|
|
70
|
+
dataKey: action.payload.dataKey,
|
|
71
|
+
index: String(activeTick.index),
|
|
72
|
+
label: action.payload.label
|
|
73
|
+
}));
|
|
74
|
+
};
|
|
75
|
+
eventCenter.on(TOOLTIP_SYNC_EVENT, listener);
|
|
76
|
+
onCleanup(() => {
|
|
77
|
+
eventCenter.off(TOOLTIP_SYNC_EVENT, listener);
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
function useBrushSyncEventsListener() {
|
|
82
|
+
const mySyncId = useAppSelector(selectSyncId);
|
|
83
|
+
const myEventEmitter = useAppSelector(selectEventEmitter);
|
|
84
|
+
const dispatch = useAppDispatch();
|
|
85
|
+
watch([mySyncId, myEventEmitter], (v, o, onCleanup) => {
|
|
86
|
+
if (mySyncId == null) return;
|
|
87
|
+
const listener = (incomingSyncId, action, emitter) => {
|
|
88
|
+
if (myEventEmitter.value === emitter) return;
|
|
89
|
+
if (mySyncId.value === incomingSyncId) dispatch(setDataStartEndIndexes(action));
|
|
90
|
+
};
|
|
91
|
+
eventCenter.on(BRUSH_SYNC_EVENT, listener);
|
|
92
|
+
onCleanup(() => {
|
|
93
|
+
eventCenter.off(BRUSH_SYNC_EVENT, listener);
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Will receive synchronisation events from other charts.
|
|
99
|
+
*
|
|
100
|
+
* Reads syncMethod from state and decides how to synchronise the tooltip based on that.
|
|
101
|
+
*
|
|
102
|
+
* @returns void
|
|
103
|
+
*/
|
|
104
|
+
function useSynchronisedEventsFromOtherCharts() {
|
|
105
|
+
const dispatch = useAppDispatch();
|
|
106
|
+
onMounted(() => {
|
|
107
|
+
dispatch(createEventEmitter());
|
|
108
|
+
});
|
|
109
|
+
useTooltipSyncEventsListener();
|
|
110
|
+
useBrushSyncEventsListener();
|
|
111
|
+
}
|
|
112
|
+
//#endregion
|
|
113
|
+
export { useSynchronisedEventsFromOtherCharts };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { computed, ref, watch } from "vue";
|
|
2
|
+
//#region src/hooks/useIsAnimating.ts
|
|
3
|
+
/**
|
|
4
|
+
* Tracks whether a component is currently animating.
|
|
5
|
+
*
|
|
6
|
+
* When `isAnimationActive` is `false`, always returns `false` regardless of
|
|
7
|
+
* internal state — this ensures `isAnimationActive={false}` immediately
|
|
8
|
+
* disables all animation-gated rendering (e.g. deferred LabelList).
|
|
9
|
+
*
|
|
10
|
+
* When `isAnimationActive` is `true`, starts as `true` and can be set to
|
|
11
|
+
* `false` via the returned ref (typically on animation end).
|
|
12
|
+
*
|
|
13
|
+
* Re-entering `isAnimationActive=true` resets internal state to `true`.
|
|
14
|
+
*/
|
|
15
|
+
function useIsAnimating(isAnimationActive) {
|
|
16
|
+
const internal = ref(isAnimationActive());
|
|
17
|
+
watch(isAnimationActive, (active) => {
|
|
18
|
+
if (active) internal.value = true;
|
|
19
|
+
});
|
|
20
|
+
return computed({
|
|
21
|
+
get: () => isAnimationActive() && internal.value,
|
|
22
|
+
set: (val) => {
|
|
23
|
+
internal.value = val;
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
//#endregion
|
|
28
|
+
export { useIsAnimating };
|