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,66 @@
|
|
|
1
|
+
import { useIsPanorama } from "../context/PanoramaContextProvider.mjs";
|
|
2
|
+
import { getTooltipNameProp } from "../utils/chart.mjs";
|
|
3
|
+
import { SetCartesianGraphicalItem } from "../state/SetGraphicalItem.mjs";
|
|
4
|
+
import { SetLegendPayload } from "../state/SetLegendPayload.mjs";
|
|
5
|
+
import { SetTooltipEntrySettings } from "../state/SetTooltipEntrySettings.mjs";
|
|
6
|
+
import { computed, useAttrs } from "vue";
|
|
7
|
+
//#region src/hooks/useSetupGraphicalItem.ts
|
|
8
|
+
function getLegendItemColor(stroke, fill) {
|
|
9
|
+
return stroke && stroke !== "none" ? stroke : fill;
|
|
10
|
+
}
|
|
11
|
+
function getItemColor(type, stroke, fill) {
|
|
12
|
+
if (type === "bar") return fill;
|
|
13
|
+
return getLegendItemColor(stroke, fill);
|
|
14
|
+
}
|
|
15
|
+
function useSetupGraphicalItem(props, type, options) {
|
|
16
|
+
const attrs = useAttrs();
|
|
17
|
+
const isPanorama = useIsPanorama();
|
|
18
|
+
const legendPayload = computed(() => {
|
|
19
|
+
return [{
|
|
20
|
+
inactive: props.hide,
|
|
21
|
+
dataKey: props.dataKey,
|
|
22
|
+
type: props.legendType,
|
|
23
|
+
color: getItemColor(type, attrs.stroke ?? props.stroke, attrs.fill ?? props.fill),
|
|
24
|
+
value: getTooltipNameProp(props.name, props.dataKey),
|
|
25
|
+
payload: { ...props }
|
|
26
|
+
}];
|
|
27
|
+
});
|
|
28
|
+
SetCartesianGraphicalItem(computed(() => {
|
|
29
|
+
return {
|
|
30
|
+
...props,
|
|
31
|
+
isPanorama,
|
|
32
|
+
type,
|
|
33
|
+
errorBars: options?.errorBars?.value
|
|
34
|
+
};
|
|
35
|
+
}));
|
|
36
|
+
SetLegendPayload(legendPayload);
|
|
37
|
+
if (!options?.skipTooltip) SetTooltipEntrySettings({
|
|
38
|
+
fn: getTooltipEntrySettings,
|
|
39
|
+
args: computed(() => ({
|
|
40
|
+
...props,
|
|
41
|
+
...attrs,
|
|
42
|
+
_itemType: type
|
|
43
|
+
}))
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
function getTooltipEntrySettings(props) {
|
|
47
|
+
const { dataKey, data, stroke, fill, name, hide, unit, _itemType } = props;
|
|
48
|
+
return {
|
|
49
|
+
dataDefinedOnItem: data,
|
|
50
|
+
positions: void 0,
|
|
51
|
+
settings: {
|
|
52
|
+
stroke,
|
|
53
|
+
strokeWidth: props["stroke-width"],
|
|
54
|
+
fill,
|
|
55
|
+
dataKey,
|
|
56
|
+
nameKey: void 0,
|
|
57
|
+
name: getTooltipNameProp(name, dataKey),
|
|
58
|
+
hide,
|
|
59
|
+
type: props.tooltipType,
|
|
60
|
+
color: getItemColor(_itemType, stroke, fill),
|
|
61
|
+
unit
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
//#endregion
|
|
66
|
+
export { useSetupGraphicalItem };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Curve, CurveVueProps, getPath } from "./shape/Curve.mjs";
|
|
2
|
+
import { Dot } from "./shape/Dot.mjs";
|
|
3
|
+
import { Label } from "./components/label/Label.mjs";
|
|
4
|
+
import { LabelList } from "./components/label/LabelList.mjs";
|
|
5
|
+
import { Area } from "./cartesian/area/Area.mjs";
|
|
6
|
+
import { CartesianAxis } from "./cartesian/cartesian-axis/CartesianAxis.mjs";
|
|
7
|
+
import { XAxis } from "./cartesian/axis/XAxis.mjs";
|
|
8
|
+
import { YAxis } from "./cartesian/axis/YAxis.mjs";
|
|
9
|
+
import { Rectangle } from "./shape/Rectangle.mjs";
|
|
10
|
+
import { createErrorBarRegistry, provideErrorBarContext, provideErrorBarRegistry, useErrorBarContext, useErrorBarRegistry } from "./cartesian/error-bar/ErrorBarContext.mjs";
|
|
11
|
+
import { Cell } from "./components/Cell.mjs";
|
|
12
|
+
import { Bar } from "./cartesian/bar/Bar.mjs";
|
|
13
|
+
import { CartesianGrid } from "./cartesian/cartesian-grid/CartesianGrid.mjs";
|
|
14
|
+
import { ErrorBar, ErrorBarVueProps } from "./cartesian/error-bar/ErrorBar.mjs";
|
|
15
|
+
import { LineContextKey, provideLineContext, useLine, useLineContext } from "./cartesian/line/hooks/useLine.mjs";
|
|
16
|
+
import { Line } from "./cartesian/line/Line.mjs";
|
|
17
|
+
import { ReferenceArea } from "./cartesian/reference-area/ReferenceArea.mjs";
|
|
18
|
+
import { ReferenceLine } from "./cartesian/reference-line/ReferenceLine.mjs";
|
|
19
|
+
import { Symbols } from "./shape/Symbols.mjs";
|
|
20
|
+
import { Scatter } from "./cartesian/scatter/Scatter.mjs";
|
|
21
|
+
import { ZAxis } from "./cartesian/z-axis/ZAxis.mjs";
|
|
22
|
+
import { Trapezoid } from "./shape/Trapezoid.mjs";
|
|
23
|
+
import { FunnelVueProps } from "./cartesian/funnel/type.mjs";
|
|
24
|
+
import { Funnel } from "./cartesian/funnel/Funnel.mjs";
|
|
25
|
+
import { AreaChart } from "./chart/AreaChart.mjs";
|
|
26
|
+
import { BarChart } from "./chart/BarChart.mjs";
|
|
27
|
+
import { ComposedChart } from "./chart/ComposedChart.mjs";
|
|
28
|
+
import { LineChart } from "./chart/LineChart.mjs";
|
|
29
|
+
import { PieChart } from "./chart/PieChart.mjs";
|
|
30
|
+
import { RadarChart } from "./chart/RadarChart.mjs";
|
|
31
|
+
import { ScatterChart } from "./chart/ScatterChart.mjs";
|
|
32
|
+
import { RadialBarChart } from "./chart/RadialBarChart.mjs";
|
|
33
|
+
import { FunnelChart } from "./chart/FunnelChart.mjs";
|
|
34
|
+
import ResponsiveContainer_default from "./container/ResponsiveContainer.mjs";
|
|
35
|
+
import Legend_default from "./components/legend/Legend.mjs";
|
|
36
|
+
import { Cross } from "./shape/Cross.mjs";
|
|
37
|
+
import { Sector } from "./shape/Sector.mjs";
|
|
38
|
+
import Tooltip, { getUniqPayload } from "./components/Tooltip.mjs";
|
|
39
|
+
import { PieVueProps } from "./polar/pie/type.mjs";
|
|
40
|
+
import { Pie } from "./polar/pie/Pie.mjs";
|
|
41
|
+
import { Radar } from "./polar/radar/Radar.mjs";
|
|
42
|
+
import { PolarGrid } from "./polar/radar/PolarGrid.mjs";
|
|
43
|
+
import { PolarAngleAxis } from "./polar/radar/PolarAngleAxis.mjs";
|
|
44
|
+
import { PolarRadiusAxis } from "./polar/radar/PolarRadiusAxis.mjs";
|
|
45
|
+
import { RadialBar } from "./polar/radial-bar/RadialBar.mjs";
|
|
46
|
+
export { Area, AreaChart, Bar, BarChart, CartesianAxis, CartesianGrid, Cell, ComposedChart, Cross, Curve, CurveVueProps, Dot, ErrorBar, ErrorBarVueProps, Funnel, FunnelChart, FunnelVueProps, Label, LabelList, Legend_default as Legend, Line, LineChart, LineContextKey, Pie, PieChart, PieVueProps, PolarAngleAxis, PolarGrid, PolarRadiusAxis, Radar, RadarChart, RadialBar, RadialBarChart, Rectangle, ReferenceArea, ReferenceLine, ResponsiveContainer_default as ResponsiveContainer, Scatter, ScatterChart, Sector, Symbols, Tooltip, Trapezoid, XAxis, YAxis, ZAxis, createErrorBarRegistry, getPath, getUniqPayload, provideErrorBarContext, provideErrorBarRegistry, provideLineContext, useErrorBarContext, useErrorBarRegistry, useLine, useLineContext };
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { selectChartOffset } from "../../state/selectors/selectChartOffset.mjs";
|
|
2
|
+
import { polarToCartesian } from "../../utils/polar.mjs";
|
|
3
|
+
import { mouseLeaveItem, setActiveMouseOverItemIndex } from "../../state/tooltipSlice.mjs";
|
|
4
|
+
import { useAppDispatch, useAppSelector } from "../../state/hooks.mjs";
|
|
5
|
+
import { Layer } from "../../container/Layer.mjs";
|
|
6
|
+
import { Animate } from "../../animation/Animate.mjs";
|
|
7
|
+
import { SetPolarGraphicalItem } from "../../state/SetGraphicalItem.mjs";
|
|
8
|
+
import { SetLegendPayload } from "../../state/SetLegendPayload.mjs";
|
|
9
|
+
import { SetTooltipEntrySettings } from "../../state/SetTooltipEntrySettings.mjs";
|
|
10
|
+
import { Sector } from "../../shape/Sector.mjs";
|
|
11
|
+
import { computePieSectors, selectDisplayedData, selectPieLegend, selectSynchronisedPieSettings } from "../../state/selectors/pieSelectors.mjs";
|
|
12
|
+
import { PieVueProps } from "./type.mjs";
|
|
13
|
+
import { computed, createVNode, defineComponent, mergeProps, ref, watch } from "vue";
|
|
14
|
+
//#region src/polar/pie/Pie.tsx
|
|
15
|
+
var LABEL_OFFSET = 20;
|
|
16
|
+
var Pie = /* @__PURE__ */ defineComponent({
|
|
17
|
+
name: "Pie",
|
|
18
|
+
props: PieVueProps,
|
|
19
|
+
inheritAttrs: false,
|
|
20
|
+
slots: Object,
|
|
21
|
+
setup(props, { attrs, slots }) {
|
|
22
|
+
const dispatch = useAppDispatch();
|
|
23
|
+
const isControlled = computed(() => props.activeIndex !== -1);
|
|
24
|
+
const activeIndex = ref(props.activeIndex);
|
|
25
|
+
watch(() => props.activeIndex, (val) => {
|
|
26
|
+
activeIndex.value = val;
|
|
27
|
+
});
|
|
28
|
+
const pieSettings = computed(() => ({
|
|
29
|
+
data: props.data,
|
|
30
|
+
dataKey: props.dataKey,
|
|
31
|
+
nameKey: props.nameKey,
|
|
32
|
+
cx: props.cx,
|
|
33
|
+
cy: props.cy,
|
|
34
|
+
innerRadius: props.innerRadius,
|
|
35
|
+
outerRadius: props.outerRadius,
|
|
36
|
+
startAngle: props.startAngle,
|
|
37
|
+
endAngle: props.endAngle,
|
|
38
|
+
paddingAngle: props.paddingAngle,
|
|
39
|
+
minAngle: props.minAngle,
|
|
40
|
+
fill: props.fill,
|
|
41
|
+
legendType: props.legendType,
|
|
42
|
+
tooltipType: props.tooltipType,
|
|
43
|
+
presentationProps: {}
|
|
44
|
+
}));
|
|
45
|
+
SetPolarGraphicalItem(computed(() => ({
|
|
46
|
+
type: "pie",
|
|
47
|
+
data: props.data ?? [],
|
|
48
|
+
dataKey: props.dataKey,
|
|
49
|
+
hide: props.hide,
|
|
50
|
+
angleAxisId: 0,
|
|
51
|
+
radiusAxisId: 0
|
|
52
|
+
})));
|
|
53
|
+
const displayedData = useAppSelector((state) => selectDisplayedData(state, pieSettings.value));
|
|
54
|
+
const synchronisedSettings = useAppSelector((state) => selectSynchronisedPieSettings(state, pieSettings.value));
|
|
55
|
+
const offset = useAppSelector((state) => selectChartOffset(state));
|
|
56
|
+
const legendPayload = useAppSelector((state) => selectPieLegend(state, pieSettings.value));
|
|
57
|
+
SetLegendPayload(computed(() => legendPayload.value ?? []));
|
|
58
|
+
const sectors = computed(() => {
|
|
59
|
+
if (synchronisedSettings.value == null || displayedData.value == null) return;
|
|
60
|
+
return computePieSectors({
|
|
61
|
+
offset: offset.value,
|
|
62
|
+
pieSettings: pieSettings.value,
|
|
63
|
+
displayedData: displayedData.value
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
SetTooltipEntrySettings({
|
|
67
|
+
fn: (v) => v,
|
|
68
|
+
args: computed(() => ({
|
|
69
|
+
dataDefinedOnItem: displayedData.value ?? [],
|
|
70
|
+
positions: sectors.value?.map((s) => s.tooltipPosition),
|
|
71
|
+
settings: {
|
|
72
|
+
dataKey: props.dataKey,
|
|
73
|
+
nameKey: props.nameKey,
|
|
74
|
+
name: String(props.dataKey ?? ""),
|
|
75
|
+
hide: props.hide,
|
|
76
|
+
type: props.tooltipType,
|
|
77
|
+
color: props.fill,
|
|
78
|
+
fill: props.fill,
|
|
79
|
+
stroke: props.stroke,
|
|
80
|
+
unit: ""
|
|
81
|
+
}
|
|
82
|
+
}))
|
|
83
|
+
});
|
|
84
|
+
function handleSectorEnter(sector, index) {
|
|
85
|
+
if (!isControlled.value) activeIndex.value = index;
|
|
86
|
+
dispatch(setActiveMouseOverItemIndex({
|
|
87
|
+
activeIndex: String(index),
|
|
88
|
+
activeDataKey: props.dataKey,
|
|
89
|
+
activeCoordinate: sector.tooltipPosition
|
|
90
|
+
}));
|
|
91
|
+
}
|
|
92
|
+
function handleSectorLeave() {
|
|
93
|
+
if (!isControlled.value) activeIndex.value = -1;
|
|
94
|
+
dispatch(mouseLeaveItem());
|
|
95
|
+
}
|
|
96
|
+
function renderLabel(sector, index) {
|
|
97
|
+
const edgePoint = polarToCartesian(sector.cx, sector.cy, sector.outerRadius, sector.midAngle);
|
|
98
|
+
const pos = polarToCartesian(sector.cx, sector.cy, sector.outerRadius + LABEL_OFFSET, sector.midAngle);
|
|
99
|
+
const anchor = pos.x > sector.cx ? "start" : pos.x < sector.cx ? "end" : "middle";
|
|
100
|
+
return createVNode("g", { "key": `label-${index}` }, [createVNode("line", {
|
|
101
|
+
"x1": edgePoint.x,
|
|
102
|
+
"y1": edgePoint.y,
|
|
103
|
+
"x2": pos.x,
|
|
104
|
+
"y2": pos.y,
|
|
105
|
+
"stroke": sector.fill,
|
|
106
|
+
"fill": "none"
|
|
107
|
+
}, null), createVNode("text", {
|
|
108
|
+
"x": pos.x,
|
|
109
|
+
"y": pos.y,
|
|
110
|
+
"text-anchor": anchor,
|
|
111
|
+
"dominant-baseline": "middle",
|
|
112
|
+
"fill": sector.fill
|
|
113
|
+
}, [String(sector.value)])]);
|
|
114
|
+
}
|
|
115
|
+
return () => {
|
|
116
|
+
const sectorList = sectors.value;
|
|
117
|
+
if (!sectorList || sectorList.length === 0) return null;
|
|
118
|
+
const stroke = attrs.stroke ?? props.stroke;
|
|
119
|
+
return createVNode(Layer, { "class": ["v-charts-pie", props.className] }, { default: () => [createVNode(Animate, {
|
|
120
|
+
"isActive": props.isAnimationActive,
|
|
121
|
+
"from": 0,
|
|
122
|
+
"to": 1,
|
|
123
|
+
"transition": { duration: 1.5 }
|
|
124
|
+
}, { default: (progress) => {
|
|
125
|
+
let curAngle = sectorList[0]?.startAngle ?? 0;
|
|
126
|
+
const sectorNodes = sectorList.map((sector, i) => {
|
|
127
|
+
const paddingAngle = i > 0 ? sector.paddingAngle : 0;
|
|
128
|
+
const deltaAngle = (sector.endAngle - sector.startAngle) * progress;
|
|
129
|
+
const animatedStartAngle = curAngle + paddingAngle;
|
|
130
|
+
const animatedEndAngle = curAngle + deltaAngle + paddingAngle;
|
|
131
|
+
curAngle = animatedEndAngle;
|
|
132
|
+
const content = slots.shape ? slots.shape({
|
|
133
|
+
...sector,
|
|
134
|
+
startAngle: animatedStartAngle,
|
|
135
|
+
endAngle: animatedEndAngle,
|
|
136
|
+
stroke,
|
|
137
|
+
isActive: activeIndex.value === i
|
|
138
|
+
}) : createVNode(Sector, mergeProps(attrs, {
|
|
139
|
+
"cx": sector.cx,
|
|
140
|
+
"cy": sector.cy,
|
|
141
|
+
"innerRadius": sector.innerRadius,
|
|
142
|
+
"outerRadius": sector.outerRadius,
|
|
143
|
+
"startAngle": animatedStartAngle,
|
|
144
|
+
"endAngle": animatedEndAngle,
|
|
145
|
+
"fill": sector.fill,
|
|
146
|
+
"stroke": stroke
|
|
147
|
+
}), null);
|
|
148
|
+
return createVNode("g", {
|
|
149
|
+
"key": `sector-${i}`,
|
|
150
|
+
"onMouseenter": () => handleSectorEnter(sector, i),
|
|
151
|
+
"onMouseleave": handleSectorLeave
|
|
152
|
+
}, [content]);
|
|
153
|
+
});
|
|
154
|
+
if (progress >= 1 && props.label) sectorNodes.push(...sectorList.map(renderLabel));
|
|
155
|
+
return sectorNodes;
|
|
156
|
+
} })] });
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
//#endregion
|
|
161
|
+
export { Pie };
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
//#region src/polar/pie/type.ts
|
|
2
|
+
var PieVueProps = {
|
|
3
|
+
data: {
|
|
4
|
+
type: Array,
|
|
5
|
+
default: void 0
|
|
6
|
+
},
|
|
7
|
+
dataKey: {
|
|
8
|
+
type: [
|
|
9
|
+
String,
|
|
10
|
+
Number,
|
|
11
|
+
Function
|
|
12
|
+
],
|
|
13
|
+
required: true
|
|
14
|
+
},
|
|
15
|
+
nameKey: {
|
|
16
|
+
type: [
|
|
17
|
+
String,
|
|
18
|
+
Number,
|
|
19
|
+
Function
|
|
20
|
+
],
|
|
21
|
+
default: "name"
|
|
22
|
+
},
|
|
23
|
+
cx: {
|
|
24
|
+
type: [Number, String],
|
|
25
|
+
default: "50%"
|
|
26
|
+
},
|
|
27
|
+
cy: {
|
|
28
|
+
type: [Number, String],
|
|
29
|
+
default: "50%"
|
|
30
|
+
},
|
|
31
|
+
innerRadius: {
|
|
32
|
+
type: [Number, String],
|
|
33
|
+
default: 0
|
|
34
|
+
},
|
|
35
|
+
outerRadius: {
|
|
36
|
+
type: [
|
|
37
|
+
Number,
|
|
38
|
+
String,
|
|
39
|
+
Function
|
|
40
|
+
],
|
|
41
|
+
default: "80%"
|
|
42
|
+
},
|
|
43
|
+
startAngle: {
|
|
44
|
+
type: Number,
|
|
45
|
+
default: 0
|
|
46
|
+
},
|
|
47
|
+
endAngle: {
|
|
48
|
+
type: Number,
|
|
49
|
+
default: 360
|
|
50
|
+
},
|
|
51
|
+
paddingAngle: {
|
|
52
|
+
type: Number,
|
|
53
|
+
default: 0
|
|
54
|
+
},
|
|
55
|
+
minAngle: {
|
|
56
|
+
type: Number,
|
|
57
|
+
default: 0
|
|
58
|
+
},
|
|
59
|
+
fill: {
|
|
60
|
+
type: String,
|
|
61
|
+
default: "#808080"
|
|
62
|
+
},
|
|
63
|
+
stroke: {
|
|
64
|
+
type: String,
|
|
65
|
+
default: "#fff"
|
|
66
|
+
},
|
|
67
|
+
legendType: {
|
|
68
|
+
type: String,
|
|
69
|
+
default: "rect"
|
|
70
|
+
},
|
|
71
|
+
tooltipType: {
|
|
72
|
+
type: String,
|
|
73
|
+
default: void 0
|
|
74
|
+
},
|
|
75
|
+
hide: {
|
|
76
|
+
type: Boolean,
|
|
77
|
+
default: false
|
|
78
|
+
},
|
|
79
|
+
activeIndex: {
|
|
80
|
+
type: Number,
|
|
81
|
+
default: -1
|
|
82
|
+
},
|
|
83
|
+
isAnimationActive: {
|
|
84
|
+
type: Boolean,
|
|
85
|
+
default: true
|
|
86
|
+
},
|
|
87
|
+
label: {
|
|
88
|
+
type: Boolean,
|
|
89
|
+
default: false
|
|
90
|
+
},
|
|
91
|
+
className: {
|
|
92
|
+
type: String,
|
|
93
|
+
default: void 0
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
//#endregion
|
|
97
|
+
export { PieVueProps };
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import { RADIAN, polarToCartesian } from "../../utils/polar.mjs";
|
|
2
|
+
import { selectPolarViewBox } from "../../state/selectors/polarAxisSelectors.mjs";
|
|
3
|
+
import { useAppDispatch, useAppSelector } from "../../state/hooks.mjs";
|
|
4
|
+
import Text_default from "../../components/Text.mjs";
|
|
5
|
+
import { addAngleAxis, removeAngleAxis } from "../../state/polarAxisSlice.mjs";
|
|
6
|
+
import { selectPolarAxisTicks } from "../../state/selectors/polarScaleSelectors.mjs";
|
|
7
|
+
import { createVNode, defineComponent, onUnmounted, watchEffect } from "vue";
|
|
8
|
+
//#region src/polar/radar/PolarAngleAxis.tsx
|
|
9
|
+
var eps = 1e-5;
|
|
10
|
+
var COS_45 = Math.cos(45 * RADIAN);
|
|
11
|
+
function getTickTextAnchor(coordinate, orientation) {
|
|
12
|
+
const cos = Math.cos(-coordinate * RADIAN);
|
|
13
|
+
if (cos > eps) return orientation === "outer" ? "start" : "end";
|
|
14
|
+
if (cos < -eps) return orientation === "outer" ? "end" : "start";
|
|
15
|
+
return "middle";
|
|
16
|
+
}
|
|
17
|
+
function getTickVerticalAnchor(coordinate) {
|
|
18
|
+
const cos = Math.cos(-coordinate * RADIAN);
|
|
19
|
+
const sin = Math.sin(-coordinate * RADIAN);
|
|
20
|
+
if (Math.abs(cos) <= COS_45) return sin > 0 ? "start" : "end";
|
|
21
|
+
return "middle";
|
|
22
|
+
}
|
|
23
|
+
var PolarAngleAxis = /* @__PURE__ */ defineComponent({
|
|
24
|
+
name: "PolarAngleAxis",
|
|
25
|
+
props: {
|
|
26
|
+
angleAxisId: {
|
|
27
|
+
type: [String, Number],
|
|
28
|
+
default: 0
|
|
29
|
+
},
|
|
30
|
+
dataKey: {
|
|
31
|
+
type: [
|
|
32
|
+
String,
|
|
33
|
+
Number,
|
|
34
|
+
Function
|
|
35
|
+
],
|
|
36
|
+
default: void 0
|
|
37
|
+
},
|
|
38
|
+
tick: {
|
|
39
|
+
type: Boolean,
|
|
40
|
+
default: true
|
|
41
|
+
},
|
|
42
|
+
tickLine: {
|
|
43
|
+
type: Boolean,
|
|
44
|
+
default: true
|
|
45
|
+
},
|
|
46
|
+
tickSize: {
|
|
47
|
+
type: Number,
|
|
48
|
+
default: 8
|
|
49
|
+
},
|
|
50
|
+
axisLine: {
|
|
51
|
+
type: Boolean,
|
|
52
|
+
default: true
|
|
53
|
+
},
|
|
54
|
+
axisLineType: {
|
|
55
|
+
type: String,
|
|
56
|
+
default: "polygon"
|
|
57
|
+
},
|
|
58
|
+
orientation: {
|
|
59
|
+
type: String,
|
|
60
|
+
default: "outer"
|
|
61
|
+
},
|
|
62
|
+
tickFormatter: {
|
|
63
|
+
type: Function,
|
|
64
|
+
default: void 0
|
|
65
|
+
},
|
|
66
|
+
ticks: {
|
|
67
|
+
type: Array,
|
|
68
|
+
default: void 0
|
|
69
|
+
},
|
|
70
|
+
stroke: {
|
|
71
|
+
type: String,
|
|
72
|
+
default: void 0
|
|
73
|
+
},
|
|
74
|
+
type: {
|
|
75
|
+
type: String,
|
|
76
|
+
default: "category"
|
|
77
|
+
},
|
|
78
|
+
domain: {
|
|
79
|
+
type: Array,
|
|
80
|
+
default: void 0
|
|
81
|
+
},
|
|
82
|
+
tickCount: {
|
|
83
|
+
type: Number,
|
|
84
|
+
default: void 0
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
slots: Object,
|
|
88
|
+
setup(props, { slots }) {
|
|
89
|
+
const dispatch = useAppDispatch();
|
|
90
|
+
let prevSettings = null;
|
|
91
|
+
watchEffect(() => {
|
|
92
|
+
const settings = {
|
|
93
|
+
id: props.angleAxisId,
|
|
94
|
+
type: props.type,
|
|
95
|
+
dataKey: props.dataKey,
|
|
96
|
+
scale: "auto",
|
|
97
|
+
allowDuplicatedCategory: true,
|
|
98
|
+
allowDataOverflow: false,
|
|
99
|
+
reversed: false,
|
|
100
|
+
includeHidden: false,
|
|
101
|
+
domain: props.domain,
|
|
102
|
+
unit: void 0,
|
|
103
|
+
name: void 0,
|
|
104
|
+
allowDecimals: false,
|
|
105
|
+
tickCount: props.tickCount,
|
|
106
|
+
ticks: props.ticks,
|
|
107
|
+
tick: props.tick
|
|
108
|
+
};
|
|
109
|
+
dispatch(addAngleAxis(settings));
|
|
110
|
+
prevSettings = settings;
|
|
111
|
+
});
|
|
112
|
+
onUnmounted(() => {
|
|
113
|
+
if (prevSettings) {
|
|
114
|
+
dispatch(removeAngleAxis(prevSettings));
|
|
115
|
+
prevSettings = null;
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
const polarViewBox = useAppSelector((state) => selectPolarViewBox(state));
|
|
119
|
+
const ticks = useAppSelector((state) => selectPolarAxisTicks(state, "angleAxis", props.angleAxisId, false));
|
|
120
|
+
return () => {
|
|
121
|
+
const viewBox = polarViewBox.value;
|
|
122
|
+
const tickItems = ticks.value;
|
|
123
|
+
if (viewBox == null || tickItems == null || tickItems.length === 0) return null;
|
|
124
|
+
const { cx, cy, outerRadius: radius, startAngle: vbStart, endAngle: vbEnd } = viewBox;
|
|
125
|
+
const { orientation, tickSize, axisLine, axisLineType, tickLine, tick, tickFormatter, stroke } = props;
|
|
126
|
+
const filteredTicks = Math.abs((vbEnd ?? 0) - (vbStart ?? 0)) === 360 && tickItems.length > 1 && Math.abs(tickItems[tickItems.length - 1].coordinate - tickItems[0].coordinate) % 360 === 0 ? tickItems.slice(0, -1) : tickItems;
|
|
127
|
+
return createVNode("g", { "class": "v-charts-polar-angle-axis" }, [axisLine && (axisLineType === "circle" ? createVNode("circle", {
|
|
128
|
+
"cx": cx,
|
|
129
|
+
"cy": cy,
|
|
130
|
+
"r": radius,
|
|
131
|
+
"fill": "none",
|
|
132
|
+
"stroke": stroke
|
|
133
|
+
}, null) : createVNode("polygon", {
|
|
134
|
+
"points": filteredTicks.map((t) => {
|
|
135
|
+
const p = polarToCartesian(cx, cy, radius, t.coordinate);
|
|
136
|
+
return `${p.x},${p.y}`;
|
|
137
|
+
}).join(" "),
|
|
138
|
+
"fill": "none",
|
|
139
|
+
"stroke": stroke
|
|
140
|
+
}, null)), createVNode("g", { "class": "v-charts-polar-angle-axis-ticks" }, [filteredTicks.map((entry, i) => {
|
|
141
|
+
const p1 = polarToCartesian(cx, cy, radius, entry.coordinate);
|
|
142
|
+
const p2 = polarToCartesian(cx, cy, radius + (orientation === "inner" ? -1 : 1) * tickSize, entry.coordinate);
|
|
143
|
+
const textAnchor = getTickTextAnchor(entry.coordinate, orientation);
|
|
144
|
+
const verticalAnchor = getTickVerticalAnchor(entry.coordinate);
|
|
145
|
+
const value = tickFormatter ? tickFormatter(entry.value, i) : entry.value;
|
|
146
|
+
return createVNode("g", {
|
|
147
|
+
"key": `tick-${entry.coordinate}`,
|
|
148
|
+
"class": "v-charts-polar-angle-axis-tick"
|
|
149
|
+
}, [tickLine && createVNode("line", {
|
|
150
|
+
"class": "v-charts-polar-angle-axis-tick-line",
|
|
151
|
+
"x1": p1.x,
|
|
152
|
+
"y1": p1.y,
|
|
153
|
+
"x2": p2.x,
|
|
154
|
+
"y2": p2.y,
|
|
155
|
+
"stroke": stroke,
|
|
156
|
+
"fill": "none"
|
|
157
|
+
}, null), tick && (slots.tick ? slots.tick({
|
|
158
|
+
x: p2.x,
|
|
159
|
+
y: p2.y,
|
|
160
|
+
value,
|
|
161
|
+
index: i,
|
|
162
|
+
textAnchor,
|
|
163
|
+
payload: entry,
|
|
164
|
+
cx,
|
|
165
|
+
cy
|
|
166
|
+
}) : createVNode(Text_default, {
|
|
167
|
+
"class": "v-charts-polar-angle-axis-tick-value",
|
|
168
|
+
"x": p2.x,
|
|
169
|
+
"y": p2.y,
|
|
170
|
+
"textAnchor": textAnchor,
|
|
171
|
+
"verticalAnchor": verticalAnchor,
|
|
172
|
+
"fill": stroke,
|
|
173
|
+
"value": String(value)
|
|
174
|
+
}, null))]);
|
|
175
|
+
})])]);
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
//#endregion
|
|
180
|
+
export { PolarAngleAxis };
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { polarToCartesian } from "../../utils/polar.mjs";
|
|
2
|
+
import { selectPolarViewBox } from "../../state/selectors/polarAxisSelectors.mjs";
|
|
3
|
+
import { useAppSelector } from "../../state/hooks.mjs";
|
|
4
|
+
import { selectPolarGridAngles, selectPolarGridRadii } from "../../state/selectors/polarGridSelectors.mjs";
|
|
5
|
+
import { computed, createVNode, defineComponent } from "vue";
|
|
6
|
+
//#region src/polar/radar/PolarGrid.tsx
|
|
7
|
+
function getPolygonPath(radius, cx, cy, polarAngles) {
|
|
8
|
+
let path = "";
|
|
9
|
+
polarAngles.forEach((angle, i) => {
|
|
10
|
+
const point = polarToCartesian(cx, cy, radius, angle);
|
|
11
|
+
path += i === 0 ? `M ${point.x},${point.y}` : `L ${point.x},${point.y}`;
|
|
12
|
+
});
|
|
13
|
+
return `${path}Z`;
|
|
14
|
+
}
|
|
15
|
+
var PolarGrid = /* @__PURE__ */ defineComponent({
|
|
16
|
+
name: "PolarGrid",
|
|
17
|
+
props: {
|
|
18
|
+
angleAxisId: {
|
|
19
|
+
type: [String, Number],
|
|
20
|
+
default: 0
|
|
21
|
+
},
|
|
22
|
+
radiusAxisId: {
|
|
23
|
+
type: [String, Number],
|
|
24
|
+
default: 0
|
|
25
|
+
},
|
|
26
|
+
gridType: {
|
|
27
|
+
type: String,
|
|
28
|
+
default: "polygon"
|
|
29
|
+
},
|
|
30
|
+
radialLines: {
|
|
31
|
+
type: Boolean,
|
|
32
|
+
default: true
|
|
33
|
+
},
|
|
34
|
+
stroke: {
|
|
35
|
+
type: String,
|
|
36
|
+
default: "#ccc"
|
|
37
|
+
},
|
|
38
|
+
fill: {
|
|
39
|
+
type: String,
|
|
40
|
+
default: "none"
|
|
41
|
+
},
|
|
42
|
+
polarRadius: {
|
|
43
|
+
type: Array,
|
|
44
|
+
default: void 0
|
|
45
|
+
},
|
|
46
|
+
strokeWidth: {
|
|
47
|
+
type: Number,
|
|
48
|
+
default: void 0
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
inheritAttrs: false,
|
|
52
|
+
setup(props, { attrs }) {
|
|
53
|
+
const polarViewBox = useAppSelector((state) => selectPolarViewBox(state));
|
|
54
|
+
const polarAngles = useAppSelector((state) => selectPolarGridAngles(state, props.angleAxisId));
|
|
55
|
+
const polarRadiiFromRedux = useAppSelector((state) => selectPolarGridRadii(state, props.radiusAxisId));
|
|
56
|
+
const polarRadii = computed(() => {
|
|
57
|
+
if (Array.isArray(props.polarRadius)) return props.polarRadius;
|
|
58
|
+
return polarRadiiFromRedux.value;
|
|
59
|
+
});
|
|
60
|
+
return () => {
|
|
61
|
+
const viewBox = polarViewBox.value;
|
|
62
|
+
const angles = polarAngles.value;
|
|
63
|
+
const radii = polarRadii.value;
|
|
64
|
+
if (viewBox == null || angles == null || radii == null || viewBox.outerRadius <= 0) return null;
|
|
65
|
+
const { cx, cy, innerRadius } = viewBox;
|
|
66
|
+
const { stroke, gridType, fill, strokeWidth } = props;
|
|
67
|
+
const shapeClass = attrs.class;
|
|
68
|
+
const renderBackground = fill && fill !== "none";
|
|
69
|
+
return createVNode("g", { "class": "v-charts-polar-grid" }, [createVNode("g", { "class": "v-charts-polar-grid-concentric" }, [renderBackground && (gridType === "circle" ? createVNode("circle", {
|
|
70
|
+
"class": ["v-charts-polar-grid-concentric-circle", shapeClass],
|
|
71
|
+
"cx": cx,
|
|
72
|
+
"cy": cy,
|
|
73
|
+
"r": Math.max(...radii),
|
|
74
|
+
"stroke": stroke,
|
|
75
|
+
"fill": fill,
|
|
76
|
+
"stroke-width": strokeWidth
|
|
77
|
+
}, null) : createVNode("path", {
|
|
78
|
+
"class": ["v-charts-polar-grid-concentric-polygon", shapeClass],
|
|
79
|
+
"d": getPolygonPath(Math.max(...radii), cx, cy, angles),
|
|
80
|
+
"stroke": stroke,
|
|
81
|
+
"fill": fill,
|
|
82
|
+
"stroke-width": strokeWidth
|
|
83
|
+
}, null)), radii.map((radius, i) => gridType === "circle" ? createVNode("circle", {
|
|
84
|
+
"key": `circle-${i}`,
|
|
85
|
+
"class": ["v-charts-polar-grid-concentric-circle", shapeClass],
|
|
86
|
+
"cx": cx,
|
|
87
|
+
"cy": cy,
|
|
88
|
+
"r": radius,
|
|
89
|
+
"stroke": stroke,
|
|
90
|
+
"fill": "none",
|
|
91
|
+
"stroke-width": strokeWidth
|
|
92
|
+
}, null) : createVNode("path", {
|
|
93
|
+
"key": `polygon-${i}`,
|
|
94
|
+
"class": ["v-charts-polar-grid-concentric-polygon", shapeClass],
|
|
95
|
+
"d": getPolygonPath(radius, cx, cy, angles),
|
|
96
|
+
"stroke": stroke,
|
|
97
|
+
"fill": "none",
|
|
98
|
+
"stroke-width": strokeWidth
|
|
99
|
+
}, null))]), props.radialLines && angles.length > 0 && createVNode("g", { "class": "v-charts-polar-grid-angle" }, [angles.map((angle) => {
|
|
100
|
+
const start = polarToCartesian(cx, cy, innerRadius, angle);
|
|
101
|
+
const end = polarToCartesian(cx, cy, viewBox.outerRadius, angle);
|
|
102
|
+
return createVNode("line", {
|
|
103
|
+
"key": `line-${angle}`,
|
|
104
|
+
"x1": start.x,
|
|
105
|
+
"y1": start.y,
|
|
106
|
+
"x2": end.x,
|
|
107
|
+
"y2": end.y,
|
|
108
|
+
"stroke": stroke
|
|
109
|
+
}, null);
|
|
110
|
+
})])]);
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
//#endregion
|
|
115
|
+
export { PolarGrid };
|