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,162 @@
|
|
|
1
|
+
import { isCategoricalAxis } from "../../utils/validate.mjs";
|
|
2
|
+
import { polarToCartesian } from "../../utils/polar.mjs";
|
|
3
|
+
import { selectPolarViewBox } from "../../state/selectors/polarAxisSelectors.mjs";
|
|
4
|
+
import { useAppDispatch, useAppSelector } from "../../state/hooks.mjs";
|
|
5
|
+
import { useChartLayout } from "../../context/chartLayoutContext.mjs";
|
|
6
|
+
import { POLAR_LABEL_VIEW_BOX_KEY } from "../../context/polarLabelViewBoxContext.mjs";
|
|
7
|
+
import Text_default from "../../components/Text.mjs";
|
|
8
|
+
import { addRadiusAxis, removeRadiusAxis } from "../../state/polarAxisSlice.mjs";
|
|
9
|
+
import { selectPolarAxisTicks } from "../../state/selectors/polarScaleSelectors.mjs";
|
|
10
|
+
import { computed, createVNode, defineComponent, onUnmounted, provide, watchEffect } from "vue";
|
|
11
|
+
//#region src/polar/radar/PolarRadiusAxis.tsx
|
|
12
|
+
/**
|
|
13
|
+
* Resolve 'auto' type based on chart layout, matching Recharts behavior.
|
|
14
|
+
* In a radial layout, radiusAxis is categorical; in centric, it's numerical.
|
|
15
|
+
*/
|
|
16
|
+
function resolveAxisType(type, layout, axisType) {
|
|
17
|
+
if (type !== "auto") return type;
|
|
18
|
+
return isCategoricalAxis(layout, axisType) ? "category" : "number";
|
|
19
|
+
}
|
|
20
|
+
var PolarRadiusAxis = /* @__PURE__ */ defineComponent({
|
|
21
|
+
name: "PolarRadiusAxis",
|
|
22
|
+
props: {
|
|
23
|
+
radiusAxisId: {
|
|
24
|
+
type: [String, Number],
|
|
25
|
+
default: 0
|
|
26
|
+
},
|
|
27
|
+
dataKey: {
|
|
28
|
+
type: [
|
|
29
|
+
String,
|
|
30
|
+
Number,
|
|
31
|
+
Function
|
|
32
|
+
],
|
|
33
|
+
default: void 0
|
|
34
|
+
},
|
|
35
|
+
angle: {
|
|
36
|
+
type: Number,
|
|
37
|
+
default: 0
|
|
38
|
+
},
|
|
39
|
+
tick: {
|
|
40
|
+
type: Boolean,
|
|
41
|
+
default: true
|
|
42
|
+
},
|
|
43
|
+
axisLine: {
|
|
44
|
+
type: Boolean,
|
|
45
|
+
default: true
|
|
46
|
+
},
|
|
47
|
+
orientation: {
|
|
48
|
+
type: String,
|
|
49
|
+
default: "right"
|
|
50
|
+
},
|
|
51
|
+
tickFormatter: {
|
|
52
|
+
type: Function,
|
|
53
|
+
default: void 0
|
|
54
|
+
},
|
|
55
|
+
ticks: {
|
|
56
|
+
type: Array,
|
|
57
|
+
default: void 0
|
|
58
|
+
},
|
|
59
|
+
tickCount: {
|
|
60
|
+
type: Number,
|
|
61
|
+
default: 5
|
|
62
|
+
},
|
|
63
|
+
domain: {
|
|
64
|
+
type: Array,
|
|
65
|
+
default: void 0
|
|
66
|
+
},
|
|
67
|
+
type: {
|
|
68
|
+
type: String,
|
|
69
|
+
default: "auto"
|
|
70
|
+
},
|
|
71
|
+
stroke: {
|
|
72
|
+
type: String,
|
|
73
|
+
default: "#ccc"
|
|
74
|
+
},
|
|
75
|
+
allowDecimals: {
|
|
76
|
+
type: Boolean,
|
|
77
|
+
default: false
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
setup(props, { slots }) {
|
|
81
|
+
const dispatch = useAppDispatch();
|
|
82
|
+
const layout = useChartLayout();
|
|
83
|
+
let prevSettings = null;
|
|
84
|
+
watchEffect(() => {
|
|
85
|
+
const resolvedType = resolveAxisType(props.type, layout.value, "radiusAxis");
|
|
86
|
+
const settings = {
|
|
87
|
+
id: props.radiusAxisId,
|
|
88
|
+
type: resolvedType,
|
|
89
|
+
dataKey: props.dataKey,
|
|
90
|
+
scale: "auto",
|
|
91
|
+
allowDuplicatedCategory: true,
|
|
92
|
+
allowDataOverflow: props.domain != null,
|
|
93
|
+
reversed: false,
|
|
94
|
+
includeHidden: false,
|
|
95
|
+
domain: props.domain ?? [0, "auto"],
|
|
96
|
+
unit: void 0,
|
|
97
|
+
name: void 0,
|
|
98
|
+
allowDecimals: props.allowDecimals,
|
|
99
|
+
tickCount: props.tickCount,
|
|
100
|
+
ticks: props.ticks,
|
|
101
|
+
tick: props.tick
|
|
102
|
+
};
|
|
103
|
+
dispatch(addRadiusAxis(settings));
|
|
104
|
+
prevSettings = settings;
|
|
105
|
+
});
|
|
106
|
+
onUnmounted(() => {
|
|
107
|
+
if (prevSettings) {
|
|
108
|
+
dispatch(removeRadiusAxis(prevSettings));
|
|
109
|
+
prevSettings = null;
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
const polarViewBox = useAppSelector((state) => selectPolarViewBox(state));
|
|
113
|
+
const ticks = useAppSelector((state) => selectPolarAxisTicks(state, "radiusAxis", props.radiusAxisId, false));
|
|
114
|
+
provide(POLAR_LABEL_VIEW_BOX_KEY, computed(() => polarViewBox.value));
|
|
115
|
+
return () => {
|
|
116
|
+
const viewBox = polarViewBox.value;
|
|
117
|
+
const tickItems = ticks.value;
|
|
118
|
+
const hasChildren = !!slots.default;
|
|
119
|
+
const showTicks = props.tick && tickItems != null && tickItems.length > 0;
|
|
120
|
+
if (viewBox == null || !showTicks && !props.axisLine && !hasChildren) return null;
|
|
121
|
+
const { cx, cy } = viewBox;
|
|
122
|
+
const { angle, orientation, axisLine, tickFormatter, stroke } = props;
|
|
123
|
+
const textAnchor = orientation === "left" ? "end" : orientation === "right" ? "start" : "middle";
|
|
124
|
+
return createVNode("g", { "class": "v-charts-polar-radius-axis" }, [
|
|
125
|
+
axisLine && showTicks && (() => {
|
|
126
|
+
const coords = tickItems.map((t) => t.coordinate);
|
|
127
|
+
const minR = Math.min(...coords);
|
|
128
|
+
const maxR = Math.max(...coords);
|
|
129
|
+
const p0 = polarToCartesian(cx, cy, minR, angle);
|
|
130
|
+
const p1 = polarToCartesian(cx, cy, maxR, angle);
|
|
131
|
+
return createVNode("line", {
|
|
132
|
+
"class": "v-charts-polar-radius-axis-line",
|
|
133
|
+
"x1": p0.x,
|
|
134
|
+
"y1": p0.y,
|
|
135
|
+
"x2": p1.x,
|
|
136
|
+
"y2": p1.y,
|
|
137
|
+
"stroke": stroke,
|
|
138
|
+
"fill": "none"
|
|
139
|
+
}, null);
|
|
140
|
+
})(),
|
|
141
|
+
showTicks && createVNode("g", { "class": "v-charts-polar-radius-axis-ticks" }, [tickItems.map((entry, i) => {
|
|
142
|
+
const coord = polarToCartesian(cx, cy, entry.coordinate, angle);
|
|
143
|
+
const value = tickFormatter ? tickFormatter(entry.value, i) : entry.value;
|
|
144
|
+
return createVNode(Text_default, {
|
|
145
|
+
"key": `tick-${entry.coordinate}`,
|
|
146
|
+
"class": "v-charts-polar-radius-axis-tick-value",
|
|
147
|
+
"x": coord.x,
|
|
148
|
+
"y": coord.y,
|
|
149
|
+
"textAnchor": textAnchor,
|
|
150
|
+
"verticalAnchor": "middle",
|
|
151
|
+
"fill": stroke,
|
|
152
|
+
"angle": 90 - angle,
|
|
153
|
+
"value": String(value)
|
|
154
|
+
}, null);
|
|
155
|
+
})]),
|
|
156
|
+
slots.default?.()
|
|
157
|
+
]);
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
//#endregion
|
|
162
|
+
export { PolarRadiusAxis };
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
import { interpolate } from "../../utils/data-utils.mjs";
|
|
2
|
+
import { useIsPanorama } from "../../context/PanoramaContextProvider.mjs";
|
|
3
|
+
import { useAppSelector } from "../../state/hooks.mjs";
|
|
4
|
+
import { useIsAnimating } from "../../hooks/useIsAnimating.mjs";
|
|
5
|
+
import { Layer } from "../../container/Layer.mjs";
|
|
6
|
+
import { Dot } from "../../shape/Dot.mjs";
|
|
7
|
+
import { provideCartesianLabelListData } from "../../context/cartesianLabelListContext.mjs";
|
|
8
|
+
import { LabelList } from "../../components/label/LabelList.mjs";
|
|
9
|
+
import { Animate } from "../../animation/Animate.mjs";
|
|
10
|
+
import { SetPolarGraphicalItem } from "../../state/SetGraphicalItem.mjs";
|
|
11
|
+
import { SetLegendPayload } from "../../state/SetLegendPayload.mjs";
|
|
12
|
+
import { SetTooltipEntrySettings } from "../../state/SetTooltipEntrySettings.mjs";
|
|
13
|
+
import { useGraphicalLayerRef } from "../../context/graphicalLayerContext.mjs";
|
|
14
|
+
import { ActivePoints } from "../../cartesian/line/ActivePoints.mjs";
|
|
15
|
+
import { selectRadarPoints } from "../../state/selectors/radarSelectors.mjs";
|
|
16
|
+
import { Fragment, Teleport, computed, createVNode, defineComponent, isVNode, mergeProps } from "vue";
|
|
17
|
+
//#region src/polar/radar/Radar.tsx
|
|
18
|
+
function _isSlot(s) {
|
|
19
|
+
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
|
20
|
+
}
|
|
21
|
+
function getLegendItemColor(stroke, fill) {
|
|
22
|
+
return stroke && stroke !== "none" ? stroke : fill;
|
|
23
|
+
}
|
|
24
|
+
function getSinglePolygonPath(points) {
|
|
25
|
+
if (!points.length) return "";
|
|
26
|
+
return `${[...points, points[0]].map((p, i) => `${i === 0 ? "M" : "L"}${p.x},${p.y}`).join("")}Z`;
|
|
27
|
+
}
|
|
28
|
+
function getRangePath(points, baseLinePoints) {
|
|
29
|
+
const outerPath = getSinglePolygonPath(points);
|
|
30
|
+
const inner = getSinglePolygonPath([...baseLinePoints].reverse());
|
|
31
|
+
return `${outerPath.endsWith("Z") ? outerPath.slice(0, -1) : outerPath}L${inner.slice(1)}`;
|
|
32
|
+
}
|
|
33
|
+
function interpolatePolarPoint(prevPoints, prevPointsDiffFactor, t, entry, index) {
|
|
34
|
+
const prev = prevPoints && prevPoints[Math.floor(index * prevPointsDiffFactor)];
|
|
35
|
+
if (prev) return {
|
|
36
|
+
...entry,
|
|
37
|
+
x: interpolate(prev.x, entry.x, t),
|
|
38
|
+
y: interpolate(prev.y, entry.y, t)
|
|
39
|
+
};
|
|
40
|
+
return {
|
|
41
|
+
...entry,
|
|
42
|
+
x: interpolate(entry.cx ?? 0, entry.x, t),
|
|
43
|
+
y: interpolate(entry.cy ?? 0, entry.y, t)
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
var Radar = /* @__PURE__ */ defineComponent({
|
|
47
|
+
name: "Radar",
|
|
48
|
+
inheritAttrs: false,
|
|
49
|
+
props: {
|
|
50
|
+
dataKey: {
|
|
51
|
+
type: [
|
|
52
|
+
String,
|
|
53
|
+
Number,
|
|
54
|
+
Function
|
|
55
|
+
],
|
|
56
|
+
required: true
|
|
57
|
+
},
|
|
58
|
+
name: {
|
|
59
|
+
type: String,
|
|
60
|
+
default: void 0
|
|
61
|
+
},
|
|
62
|
+
angleAxisId: {
|
|
63
|
+
type: [String, Number],
|
|
64
|
+
default: 0
|
|
65
|
+
},
|
|
66
|
+
radiusAxisId: {
|
|
67
|
+
type: [String, Number],
|
|
68
|
+
default: 0
|
|
69
|
+
},
|
|
70
|
+
fill: {
|
|
71
|
+
type: String,
|
|
72
|
+
default: "#808080"
|
|
73
|
+
},
|
|
74
|
+
stroke: {
|
|
75
|
+
type: String,
|
|
76
|
+
default: void 0
|
|
77
|
+
},
|
|
78
|
+
fillOpacity: {
|
|
79
|
+
type: Number,
|
|
80
|
+
default: .6
|
|
81
|
+
},
|
|
82
|
+
strokeWidth: {
|
|
83
|
+
type: Number,
|
|
84
|
+
default: void 0
|
|
85
|
+
},
|
|
86
|
+
strokeDasharray: {
|
|
87
|
+
type: String,
|
|
88
|
+
default: void 0
|
|
89
|
+
},
|
|
90
|
+
dot: {
|
|
91
|
+
type: [Boolean, Object],
|
|
92
|
+
default: false
|
|
93
|
+
},
|
|
94
|
+
hide: {
|
|
95
|
+
type: Boolean,
|
|
96
|
+
default: false
|
|
97
|
+
},
|
|
98
|
+
legendType: {
|
|
99
|
+
type: String,
|
|
100
|
+
default: "rect"
|
|
101
|
+
},
|
|
102
|
+
tooltipType: {
|
|
103
|
+
type: String,
|
|
104
|
+
default: void 0
|
|
105
|
+
},
|
|
106
|
+
connectNulls: {
|
|
107
|
+
type: Boolean,
|
|
108
|
+
default: false
|
|
109
|
+
},
|
|
110
|
+
label: {
|
|
111
|
+
type: [Boolean, Object],
|
|
112
|
+
default: false
|
|
113
|
+
},
|
|
114
|
+
isAnimationActive: {
|
|
115
|
+
type: Boolean,
|
|
116
|
+
default: true
|
|
117
|
+
},
|
|
118
|
+
activeDot: {
|
|
119
|
+
type: [Object, Boolean],
|
|
120
|
+
default: true
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
setup(props) {
|
|
124
|
+
const isPanorama = useIsPanorama();
|
|
125
|
+
SetPolarGraphicalItem(computed(() => ({
|
|
126
|
+
type: "radar",
|
|
127
|
+
data: void 0,
|
|
128
|
+
dataKey: props.dataKey,
|
|
129
|
+
hide: props.hide,
|
|
130
|
+
angleAxisId: props.angleAxisId,
|
|
131
|
+
radiusAxisId: props.radiusAxisId
|
|
132
|
+
})));
|
|
133
|
+
SetLegendPayload(computed(() => [{
|
|
134
|
+
dataKey: props.dataKey,
|
|
135
|
+
type: props.legendType,
|
|
136
|
+
color: getLegendItemColor(props.stroke, props.fill),
|
|
137
|
+
value: props.name ?? String(props.dataKey ?? ""),
|
|
138
|
+
payload: { ...props },
|
|
139
|
+
inactive: props.hide
|
|
140
|
+
}]));
|
|
141
|
+
SetTooltipEntrySettings({
|
|
142
|
+
fn: (v) => v,
|
|
143
|
+
args: computed(() => ({
|
|
144
|
+
dataDefinedOnItem: void 0,
|
|
145
|
+
positions: void 0,
|
|
146
|
+
settings: {
|
|
147
|
+
dataKey: props.dataKey,
|
|
148
|
+
nameKey: void 0,
|
|
149
|
+
name: props.name ?? String(props.dataKey ?? ""),
|
|
150
|
+
hide: props.hide,
|
|
151
|
+
type: props.tooltipType,
|
|
152
|
+
color: getLegendItemColor(props.stroke, props.fill),
|
|
153
|
+
fill: props.fill,
|
|
154
|
+
stroke: props.stroke,
|
|
155
|
+
unit: ""
|
|
156
|
+
}
|
|
157
|
+
}))
|
|
158
|
+
});
|
|
159
|
+
const radarPoints = useAppSelector((state) => selectRadarPoints(state, props.radiusAxisId, props.angleAxisId, isPanorama, props.dataKey));
|
|
160
|
+
const graphicalLayerRef = useGraphicalLayerRef();
|
|
161
|
+
const isAnimating = useIsAnimating(() => props.isAnimationActive);
|
|
162
|
+
provideCartesianLabelListData(computed(() => {
|
|
163
|
+
if (props.isAnimationActive && isAnimating.value) return void 0;
|
|
164
|
+
const data = radarPoints.value;
|
|
165
|
+
if (!data) return void 0;
|
|
166
|
+
return data.points.map((point) => ({
|
|
167
|
+
x: point.x,
|
|
168
|
+
y: point.y,
|
|
169
|
+
width: 0,
|
|
170
|
+
height: 0,
|
|
171
|
+
value: point.value ?? "",
|
|
172
|
+
payload: point.payload
|
|
173
|
+
}));
|
|
174
|
+
}));
|
|
175
|
+
let prevPoints = null;
|
|
176
|
+
let prevBaseLinePoints = null;
|
|
177
|
+
let animationId = 0;
|
|
178
|
+
let lastData = void 0;
|
|
179
|
+
const renderPolygon = (points, baseLinePoints, isRange) => {
|
|
180
|
+
const stroke = props.stroke ?? props.fill;
|
|
181
|
+
const hasStroke = stroke && stroke !== "none";
|
|
182
|
+
let pathD;
|
|
183
|
+
if (isRange && baseLinePoints.length > 0) pathD = getRangePath(points, baseLinePoints);
|
|
184
|
+
else pathD = getSinglePolygonPath(points);
|
|
185
|
+
const isClosed = pathD.endsWith("Z");
|
|
186
|
+
return createVNode(Layer, { "class": "v-charts-radar" }, { default: () => [createVNode("g", { "class": "v-charts-radar-polygon" }, [isRange && baseLinePoints.length > 0 ? createVNode("g", null, [
|
|
187
|
+
createVNode("path", {
|
|
188
|
+
"d": pathD,
|
|
189
|
+
"fill": isClosed ? props.fill : "none",
|
|
190
|
+
"fill-opacity": props.fillOpacity,
|
|
191
|
+
"stroke": "none",
|
|
192
|
+
"stroke-dasharray": props.strokeDasharray
|
|
193
|
+
}, null),
|
|
194
|
+
hasStroke && createVNode("path", {
|
|
195
|
+
"d": getSinglePolygonPath(points),
|
|
196
|
+
"fill": "none",
|
|
197
|
+
"stroke": stroke,
|
|
198
|
+
"stroke-width": props.strokeWidth,
|
|
199
|
+
"stroke-dasharray": props.strokeDasharray
|
|
200
|
+
}, null),
|
|
201
|
+
hasStroke && createVNode("path", {
|
|
202
|
+
"d": getSinglePolygonPath(baseLinePoints),
|
|
203
|
+
"fill": "none",
|
|
204
|
+
"stroke": stroke,
|
|
205
|
+
"stroke-width": props.strokeWidth,
|
|
206
|
+
"stroke-dasharray": props.strokeDasharray
|
|
207
|
+
}, null)
|
|
208
|
+
]) : createVNode("path", {
|
|
209
|
+
"d": pathD,
|
|
210
|
+
"fill": isClosed ? props.fill : "none",
|
|
211
|
+
"fill-opacity": props.fillOpacity,
|
|
212
|
+
"stroke": stroke,
|
|
213
|
+
"stroke-width": props.strokeWidth,
|
|
214
|
+
"stroke-dasharray": props.strokeDasharray
|
|
215
|
+
}, null)]), props.dot && createVNode("g", { "class": "v-charts-radar-dots" }, [points.map((point, i) => {
|
|
216
|
+
const dotProps = typeof props.dot === "object" ? props.dot : {};
|
|
217
|
+
return createVNode(Dot, mergeProps({
|
|
218
|
+
"key": `dot-${i}`,
|
|
219
|
+
"cx": point.x,
|
|
220
|
+
"cy": point.y,
|
|
221
|
+
"r": 3,
|
|
222
|
+
"fill": props.fill,
|
|
223
|
+
"stroke": stroke
|
|
224
|
+
}, dotProps), null);
|
|
225
|
+
})])] });
|
|
226
|
+
};
|
|
227
|
+
return () => {
|
|
228
|
+
if (props.hide) return null;
|
|
229
|
+
const data = radarPoints.value;
|
|
230
|
+
if (data == null || data.points.length === 0) return null;
|
|
231
|
+
const { points, baseLinePoints, isRange } = data;
|
|
232
|
+
const mainColor = getLegendItemColor(props.stroke, props.fill) ?? props.fill;
|
|
233
|
+
const activePointsEl = createVNode(ActivePoints, {
|
|
234
|
+
"points": points,
|
|
235
|
+
"mainColor": mainColor,
|
|
236
|
+
"itemDataKey": props.dataKey,
|
|
237
|
+
"activeDot": props.activeDot
|
|
238
|
+
}, null);
|
|
239
|
+
const activePoints = graphicalLayerRef?.value ? createVNode(Teleport, { "to": graphicalLayerRef.value }, _isSlot(activePointsEl) ? activePointsEl : { default: () => [activePointsEl] }) : activePointsEl;
|
|
240
|
+
const labelEl = !isAnimating.value && props.label ? createVNode(LabelList, typeof props.label === "object" ? props.label : {}, null) : null;
|
|
241
|
+
if (!props.isAnimationActive) {
|
|
242
|
+
prevPoints = points;
|
|
243
|
+
prevBaseLinePoints = baseLinePoints;
|
|
244
|
+
return createVNode(Fragment, null, [
|
|
245
|
+
renderPolygon(points, baseLinePoints, isRange),
|
|
246
|
+
labelEl,
|
|
247
|
+
activePoints
|
|
248
|
+
]);
|
|
249
|
+
}
|
|
250
|
+
const prevPts = prevPoints;
|
|
251
|
+
const prevBasePts = prevBaseLinePoints;
|
|
252
|
+
const prevPointsDiffFactor = prevPts ? prevPts.length / points.length : 1;
|
|
253
|
+
const prevBaseDiffFactor = prevBasePts ? prevBasePts.length / baseLinePoints.length : 1;
|
|
254
|
+
if (data !== lastData) {
|
|
255
|
+
animationId++;
|
|
256
|
+
lastData = data;
|
|
257
|
+
}
|
|
258
|
+
return createVNode(Fragment, null, [
|
|
259
|
+
createVNode(Animate, {
|
|
260
|
+
"key": animationId,
|
|
261
|
+
"isActive": true,
|
|
262
|
+
"onAnimationStart": () => {
|
|
263
|
+
isAnimating.value = true;
|
|
264
|
+
},
|
|
265
|
+
"onAnimationEnd": () => {
|
|
266
|
+
isAnimating.value = false;
|
|
267
|
+
}
|
|
268
|
+
}, { default: (t) => {
|
|
269
|
+
const stepPoints = t === 1 ? points : points.map((entry, i) => interpolatePolarPoint(prevPts, prevPointsDiffFactor, t, entry, i));
|
|
270
|
+
const stepBaseLine = t === 1 ? baseLinePoints : baseLinePoints.map((entry, i) => interpolatePolarPoint(prevBasePts, prevBaseDiffFactor, t, entry, i));
|
|
271
|
+
if (t > 0) {
|
|
272
|
+
prevPoints = stepPoints;
|
|
273
|
+
prevBaseLinePoints = stepBaseLine;
|
|
274
|
+
}
|
|
275
|
+
return renderPolygon(stepPoints, stepBaseLine, isRange);
|
|
276
|
+
} }),
|
|
277
|
+
labelEl,
|
|
278
|
+
activePoints
|
|
279
|
+
]);
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
});
|
|
283
|
+
//#endregion
|
|
284
|
+
export { Radar };
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import { interpolate } from "../../utils/data-utils.mjs";
|
|
2
|
+
import { mouseLeaveItem, setActiveMouseOverItemIndex } from "../../state/tooltipSlice.mjs";
|
|
3
|
+
import { useAppDispatch, useAppSelector } from "../../state/hooks.mjs";
|
|
4
|
+
import { useIsAnimating } from "../../hooks/useIsAnimating.mjs";
|
|
5
|
+
import { Layer } from "../../container/Layer.mjs";
|
|
6
|
+
import { provideCartesianLabelListData } from "../../context/cartesianLabelListContext.mjs";
|
|
7
|
+
import { LabelList } from "../../components/label/LabelList.mjs";
|
|
8
|
+
import { Animate } from "../../animation/Animate.mjs";
|
|
9
|
+
import { SetPolarGraphicalItem } from "../../state/SetGraphicalItem.mjs";
|
|
10
|
+
import { SetLegendPayload } from "../../state/SetLegendPayload.mjs";
|
|
11
|
+
import { SetTooltipEntrySettings } from "../../state/SetTooltipEntrySettings.mjs";
|
|
12
|
+
import { Sector } from "../../shape/Sector.mjs";
|
|
13
|
+
import { selectRadialBarLegendPayload, selectRadialBarSectors } from "../../state/selectors/radialBarSelectors.mjs";
|
|
14
|
+
import { RadialBarVueProps } from "./type.mjs";
|
|
15
|
+
import { Fragment, computed, createVNode, defineComponent, mergeProps } from "vue";
|
|
16
|
+
//#region src/polar/radial-bar/RadialBar.tsx
|
|
17
|
+
function getLegendItemColor(stroke, fill) {
|
|
18
|
+
return fill;
|
|
19
|
+
}
|
|
20
|
+
var RadialBar = /* @__PURE__ */ defineComponent({
|
|
21
|
+
name: "RadialBar",
|
|
22
|
+
props: RadialBarVueProps,
|
|
23
|
+
inheritAttrs: false,
|
|
24
|
+
setup(props, { slots }) {
|
|
25
|
+
const dispatch = useAppDispatch();
|
|
26
|
+
const radialBarSettings = computed(() => ({
|
|
27
|
+
dataKey: props.dataKey,
|
|
28
|
+
minPointSize: props.minPointSize,
|
|
29
|
+
stackId: props.stackId,
|
|
30
|
+
maxBarSize: props.maxBarSize,
|
|
31
|
+
barSize: props.barSize
|
|
32
|
+
}));
|
|
33
|
+
SetPolarGraphicalItem(computed(() => ({
|
|
34
|
+
type: "radialBar",
|
|
35
|
+
data: void 0,
|
|
36
|
+
dataKey: props.dataKey,
|
|
37
|
+
hide: props.hide,
|
|
38
|
+
angleAxisId: props.angleAxisId,
|
|
39
|
+
radiusAxisId: props.radiusAxisId,
|
|
40
|
+
barSize: props.barSize,
|
|
41
|
+
stackId: props.stackId,
|
|
42
|
+
minPointSize: props.minPointSize,
|
|
43
|
+
maxBarSize: props.maxBarSize
|
|
44
|
+
})));
|
|
45
|
+
const legendPayload = useAppSelector((state) => selectRadialBarLegendPayload(state, props.legendType));
|
|
46
|
+
SetLegendPayload(computed(() => legendPayload.value ?? []));
|
|
47
|
+
const sectors = useAppSelector((state) => selectRadialBarSectors(state, props.radiusAxisId, props.angleAxisId, radialBarSettings.value));
|
|
48
|
+
SetTooltipEntrySettings({
|
|
49
|
+
fn: (v) => v,
|
|
50
|
+
args: computed(() => ({
|
|
51
|
+
dataDefinedOnItem: void 0,
|
|
52
|
+
positions: void 0,
|
|
53
|
+
settings: {
|
|
54
|
+
dataKey: props.dataKey,
|
|
55
|
+
nameKey: void 0,
|
|
56
|
+
name: props.name ?? String(props.dataKey ?? ""),
|
|
57
|
+
hide: props.hide,
|
|
58
|
+
type: props.tooltipType,
|
|
59
|
+
color: getLegendItemColor(props.stroke, props.fill),
|
|
60
|
+
fill: props.fill,
|
|
61
|
+
stroke: props.stroke,
|
|
62
|
+
unit: ""
|
|
63
|
+
}
|
|
64
|
+
}))
|
|
65
|
+
});
|
|
66
|
+
const isAnimating = useIsAnimating(() => props.isAnimationActive);
|
|
67
|
+
provideCartesianLabelListData(computed(() => {
|
|
68
|
+
if (props.isAnimationActive && isAnimating.value) return void 0;
|
|
69
|
+
const data = sectors.value;
|
|
70
|
+
if (!data) return void 0;
|
|
71
|
+
const defaultFill = props.fill;
|
|
72
|
+
return data.map((sector) => ({
|
|
73
|
+
value: sector.value ?? "",
|
|
74
|
+
payload: sector.payload,
|
|
75
|
+
parentViewBox: void 0,
|
|
76
|
+
fill: sector.fill ?? defaultFill,
|
|
77
|
+
cx: sector.cx,
|
|
78
|
+
cy: sector.cy,
|
|
79
|
+
innerRadius: sector.innerRadius,
|
|
80
|
+
outerRadius: sector.outerRadius,
|
|
81
|
+
startAngle: sector.startAngle,
|
|
82
|
+
endAngle: sector.endAngle,
|
|
83
|
+
clockWise: false
|
|
84
|
+
}));
|
|
85
|
+
}));
|
|
86
|
+
let prevSectors = null;
|
|
87
|
+
let animationId = 0;
|
|
88
|
+
let lastSectors;
|
|
89
|
+
const renderSectors = (sectorData) => {
|
|
90
|
+
const defaultFill = props.fill;
|
|
91
|
+
const defaultStroke = props.stroke;
|
|
92
|
+
const showBackground = !!props.background;
|
|
93
|
+
const backgroundProps = typeof props.background === "object" ? props.background : {};
|
|
94
|
+
return createVNode(Layer, { "class": "v-charts-radial-bar" }, { default: () => [showBackground && sectorData.map((sector, i) => {
|
|
95
|
+
if (!sector.background) return null;
|
|
96
|
+
const bg = sector.background;
|
|
97
|
+
return createVNode(Sector, mergeProps({
|
|
98
|
+
"key": `bg-${i}`,
|
|
99
|
+
"cx": bg.cx,
|
|
100
|
+
"cy": bg.cy,
|
|
101
|
+
"innerRadius": bg.innerRadius,
|
|
102
|
+
"outerRadius": bg.outerRadius,
|
|
103
|
+
"startAngle": bg.startAngle,
|
|
104
|
+
"endAngle": bg.endAngle,
|
|
105
|
+
"cornerRadius": props.cornerRadius,
|
|
106
|
+
"forceCornerRadius": props.forceCornerRadius,
|
|
107
|
+
"cornerIsExternal": props.cornerIsExternal,
|
|
108
|
+
"fill": "#eee",
|
|
109
|
+
"fill-opacity": .5
|
|
110
|
+
}, backgroundProps), null);
|
|
111
|
+
}), sectorData.map((sector, i) => {
|
|
112
|
+
if (sector.innerRadius == null || sector.outerRadius == null || sector.startAngle == null || sector.endAngle == null) return null;
|
|
113
|
+
const sectorFill = sector.fill ?? defaultFill;
|
|
114
|
+
const onMouseenter = () => {
|
|
115
|
+
dispatch(setActiveMouseOverItemIndex({
|
|
116
|
+
activeIndex: String(i),
|
|
117
|
+
activeDataKey: props.dataKey
|
|
118
|
+
}));
|
|
119
|
+
};
|
|
120
|
+
const onMouseleave = () => {
|
|
121
|
+
dispatch(mouseLeaveItem());
|
|
122
|
+
};
|
|
123
|
+
return createVNode(Sector, {
|
|
124
|
+
"key": `sector-${i}`,
|
|
125
|
+
"cx": sector.cx,
|
|
126
|
+
"cy": sector.cy,
|
|
127
|
+
"innerRadius": sector.innerRadius,
|
|
128
|
+
"outerRadius": sector.outerRadius,
|
|
129
|
+
"startAngle": sector.startAngle,
|
|
130
|
+
"endAngle": sector.endAngle,
|
|
131
|
+
"cornerRadius": props.cornerRadius,
|
|
132
|
+
"forceCornerRadius": props.forceCornerRadius,
|
|
133
|
+
"cornerIsExternal": props.cornerIsExternal,
|
|
134
|
+
"fill": sectorFill,
|
|
135
|
+
"fill-opacity": props.fillOpacity,
|
|
136
|
+
"stroke": defaultStroke ?? sectorFill,
|
|
137
|
+
"stroke-width": props.strokeWidth,
|
|
138
|
+
"stroke-dasharray": props.strokeDasharray,
|
|
139
|
+
"onMouseenter": onMouseenter,
|
|
140
|
+
"onMouseleave": onMouseleave
|
|
141
|
+
}, null);
|
|
142
|
+
})] });
|
|
143
|
+
};
|
|
144
|
+
return () => {
|
|
145
|
+
if (props.hide) return null;
|
|
146
|
+
const data = sectors.value;
|
|
147
|
+
if (data == null || data.length === 0) return null;
|
|
148
|
+
const sectorData = data;
|
|
149
|
+
const labelEl = !isAnimating.value && props.label ? createVNode(LabelList, typeof props.label === "object" ? props.label : {}, null) : null;
|
|
150
|
+
const slotChildren = !isAnimating.value ? slots.default?.() : null;
|
|
151
|
+
if (!props.isAnimationActive) {
|
|
152
|
+
prevSectors = sectorData;
|
|
153
|
+
return createVNode(Fragment, null, [
|
|
154
|
+
renderSectors(sectorData),
|
|
155
|
+
labelEl,
|
|
156
|
+
slotChildren
|
|
157
|
+
]);
|
|
158
|
+
}
|
|
159
|
+
const prevSects = prevSectors;
|
|
160
|
+
if (data !== lastSectors) {
|
|
161
|
+
animationId++;
|
|
162
|
+
lastSectors = data;
|
|
163
|
+
}
|
|
164
|
+
return createVNode(Fragment, null, [
|
|
165
|
+
createVNode(Animate, {
|
|
166
|
+
"key": animationId,
|
|
167
|
+
"isActive": true,
|
|
168
|
+
"onAnimationStart": () => {
|
|
169
|
+
isAnimating.value = true;
|
|
170
|
+
},
|
|
171
|
+
"onAnimationEnd": () => {
|
|
172
|
+
isAnimating.value = false;
|
|
173
|
+
}
|
|
174
|
+
}, { default: (t) => {
|
|
175
|
+
const stepSectors = t === 1 ? sectorData : sectorData.map((sector, i) => {
|
|
176
|
+
const prev = prevSects && prevSects[i];
|
|
177
|
+
if (!prev) return {
|
|
178
|
+
...sector,
|
|
179
|
+
endAngle: interpolate(sector.startAngle ?? 0, sector.endAngle, t)
|
|
180
|
+
};
|
|
181
|
+
return {
|
|
182
|
+
...sector,
|
|
183
|
+
startAngle: prev.startAngle != null && sector.startAngle != null ? interpolate(prev.startAngle, sector.startAngle, t) : sector.startAngle,
|
|
184
|
+
endAngle: interpolate(prev.endAngle ?? 0, sector.endAngle, t)
|
|
185
|
+
};
|
|
186
|
+
});
|
|
187
|
+
if (t > 0) prevSectors = stepSectors;
|
|
188
|
+
return renderSectors(stepSectors);
|
|
189
|
+
} }),
|
|
190
|
+
labelEl,
|
|
191
|
+
slotChildren
|
|
192
|
+
]);
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
});
|
|
196
|
+
//#endregion
|
|
197
|
+
export { RadialBar };
|