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,56 @@
|
|
|
1
|
+
import { useAppDispatch } from "./hooks.mjs";
|
|
2
|
+
import { updatePolarOptions } from "./polarOptionsSlice.mjs";
|
|
3
|
+
import { defineComponent, watch } from "vue";
|
|
4
|
+
//#region src/state/ReportPolarOptions.tsx
|
|
5
|
+
var ReportPolarOptions = /* @__PURE__ */ defineComponent({
|
|
6
|
+
name: "ReportPolarOptions",
|
|
7
|
+
props: {
|
|
8
|
+
cx: {
|
|
9
|
+
type: [Number, String],
|
|
10
|
+
default: "50%"
|
|
11
|
+
},
|
|
12
|
+
cy: {
|
|
13
|
+
type: [Number, String],
|
|
14
|
+
default: "50%"
|
|
15
|
+
},
|
|
16
|
+
startAngle: {
|
|
17
|
+
type: Number,
|
|
18
|
+
default: 90
|
|
19
|
+
},
|
|
20
|
+
endAngle: {
|
|
21
|
+
type: Number,
|
|
22
|
+
default: -270
|
|
23
|
+
},
|
|
24
|
+
innerRadius: {
|
|
25
|
+
type: [Number, String],
|
|
26
|
+
default: 0
|
|
27
|
+
},
|
|
28
|
+
outerRadius: {
|
|
29
|
+
type: [Number, String],
|
|
30
|
+
default: "80%"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
setup(props) {
|
|
34
|
+
const dispatch = useAppDispatch();
|
|
35
|
+
watch([
|
|
36
|
+
() => props.cx,
|
|
37
|
+
() => props.cy,
|
|
38
|
+
() => props.startAngle,
|
|
39
|
+
() => props.endAngle,
|
|
40
|
+
() => props.innerRadius,
|
|
41
|
+
() => props.outerRadius
|
|
42
|
+
], () => {
|
|
43
|
+
dispatch(updatePolarOptions({
|
|
44
|
+
cx: props.cx,
|
|
45
|
+
cy: props.cy,
|
|
46
|
+
startAngle: props.startAngle,
|
|
47
|
+
endAngle: props.endAngle,
|
|
48
|
+
innerRadius: props.innerRadius,
|
|
49
|
+
outerRadius: props.outerRadius
|
|
50
|
+
}));
|
|
51
|
+
}, { immediate: true });
|
|
52
|
+
return () => null;
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
//#endregion
|
|
56
|
+
export { ReportPolarOptions };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { getNormalizedStackId } from "../utils/chart.mjs";
|
|
2
|
+
import { useAppDispatch } from "./hooks.mjs";
|
|
3
|
+
import { addCartesianGraphicalItem, addPolarGraphicalItem, removeCartesianGraphicalItem, removePolarGraphicalItem, replaceCartesianGraphicalItem, replacePolarGraphicalItem } from "./graphicalItemsSlice.mjs";
|
|
4
|
+
import { onUnmounted, unref, watchEffect } from "vue";
|
|
5
|
+
//#region src/state/SetGraphicalItem.ts
|
|
6
|
+
function SetCartesianGraphicalItem(_props) {
|
|
7
|
+
const dispatch = useAppDispatch();
|
|
8
|
+
let preSetting = null;
|
|
9
|
+
watchEffect(() => {
|
|
10
|
+
const props = unref(_props);
|
|
11
|
+
const settings = {
|
|
12
|
+
...props,
|
|
13
|
+
stackId: getNormalizedStackId(props.stackId)
|
|
14
|
+
};
|
|
15
|
+
if (preSetting === null) dispatch(addCartesianGraphicalItem(settings));
|
|
16
|
+
else if (preSetting !== settings) dispatch(replaceCartesianGraphicalItem({
|
|
17
|
+
prev: preSetting,
|
|
18
|
+
next: settings
|
|
19
|
+
}));
|
|
20
|
+
preSetting = settings;
|
|
21
|
+
});
|
|
22
|
+
onUnmounted(() => {
|
|
23
|
+
if (preSetting) {
|
|
24
|
+
dispatch(removeCartesianGraphicalItem(preSetting));
|
|
25
|
+
preSetting = null;
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
function SetPolarGraphicalItem(_props) {
|
|
30
|
+
const dispatch = useAppDispatch();
|
|
31
|
+
let preSetting = null;
|
|
32
|
+
watchEffect(() => {
|
|
33
|
+
const settings = unref(_props);
|
|
34
|
+
if (preSetting === null) dispatch(addPolarGraphicalItem(settings));
|
|
35
|
+
else if (preSetting !== settings) dispatch(replacePolarGraphicalItem({
|
|
36
|
+
prev: preSetting,
|
|
37
|
+
next: settings
|
|
38
|
+
}));
|
|
39
|
+
preSetting = settings;
|
|
40
|
+
});
|
|
41
|
+
onUnmounted(() => {
|
|
42
|
+
if (preSetting) {
|
|
43
|
+
dispatch(removePolarGraphicalItem(preSetting));
|
|
44
|
+
preSetting = null;
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
//#endregion
|
|
49
|
+
export { SetCartesianGraphicalItem, SetPolarGraphicalItem };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { useIsPanorama } from "../context/PanoramaContextProvider.mjs";
|
|
2
|
+
import { useAppDispatch } from "./hooks.mjs";
|
|
3
|
+
import { addLegendPayload, removeLegendPayload } from "./legendSlice.mjs";
|
|
4
|
+
import { unref, watchEffect } from "vue";
|
|
5
|
+
//#region src/state/SetLegendPayload.ts
|
|
6
|
+
function SetLegendPayload(_legendPayload) {
|
|
7
|
+
const dispatch = useAppDispatch();
|
|
8
|
+
const isPanorama = useIsPanorama();
|
|
9
|
+
watchEffect((onCleanup) => {
|
|
10
|
+
const legendPayload = unref(_legendPayload);
|
|
11
|
+
if (isPanorama) return;
|
|
12
|
+
dispatch(addLegendPayload(legendPayload));
|
|
13
|
+
onCleanup(() => {
|
|
14
|
+
dispatch(removeLegendPayload(legendPayload));
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
export { SetLegendPayload };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { useIsPanorama } from "../context/PanoramaContextProvider.mjs";
|
|
2
|
+
import { addTooltipEntrySettings, removeTooltipEntrySettings } from "./tooltipSlice.mjs";
|
|
3
|
+
import { useAppDispatch } from "./hooks.mjs";
|
|
4
|
+
import { watchEffect } from "vue";
|
|
5
|
+
//#region src/state/SetTooltipEntrySettings.tsx
|
|
6
|
+
function SetTooltipEntrySettings({ fn, args }) {
|
|
7
|
+
const dispatch = useAppDispatch();
|
|
8
|
+
const isPanorama = useIsPanorama();
|
|
9
|
+
watchEffect((onCleanup) => {
|
|
10
|
+
if (isPanorama) return;
|
|
11
|
+
const tooltipEntrySettings = fn(args.value);
|
|
12
|
+
dispatch(addTooltipEntrySettings(tooltipEntrySettings));
|
|
13
|
+
onCleanup(() => {
|
|
14
|
+
dispatch(removeTooltipEntrySettings(tooltipEntrySettings));
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
//#endregion
|
|
19
|
+
export { SetTooltipEntrySettings };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { createSlice } from "@reduxjs/toolkit";
|
|
2
|
+
//#region src/state/brushSlice.ts
|
|
3
|
+
var initialState = {
|
|
4
|
+
x: 0,
|
|
5
|
+
y: 0,
|
|
6
|
+
width: 0,
|
|
7
|
+
height: 0,
|
|
8
|
+
padding: {
|
|
9
|
+
top: 0,
|
|
10
|
+
right: 0,
|
|
11
|
+
bottom: 0,
|
|
12
|
+
left: 0
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
var brushSlice = createSlice({
|
|
16
|
+
name: "brush",
|
|
17
|
+
initialState,
|
|
18
|
+
reducers: { setBrushSettings(_state, action) {
|
|
19
|
+
if (action.payload == null) return initialState;
|
|
20
|
+
return action.payload;
|
|
21
|
+
} }
|
|
22
|
+
});
|
|
23
|
+
var { setBrushSettings } = brushSlice.actions;
|
|
24
|
+
var brushReducer = brushSlice.reducer;
|
|
25
|
+
//#endregion
|
|
26
|
+
export { brushReducer };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { createSlice } from "@reduxjs/toolkit";
|
|
2
|
+
import { castDraft } from "immer";
|
|
3
|
+
//#region src/state/cartesianAxisSlice.ts
|
|
4
|
+
/**
|
|
5
|
+
* This is the slice where each individual Axis element pushes its own configuration.
|
|
6
|
+
* Prefer to use this one instead of axisSlice.
|
|
7
|
+
*/
|
|
8
|
+
var cartesianAxisSlice = createSlice({
|
|
9
|
+
name: "cartesianAxis",
|
|
10
|
+
initialState: {
|
|
11
|
+
xAxis: {},
|
|
12
|
+
yAxis: {},
|
|
13
|
+
zAxis: {}
|
|
14
|
+
},
|
|
15
|
+
reducers: {
|
|
16
|
+
addXAxis(state, action) {
|
|
17
|
+
state.xAxis[action.payload.id] = castDraft(action.payload);
|
|
18
|
+
},
|
|
19
|
+
removeXAxis(state, action) {
|
|
20
|
+
delete state.xAxis[action.payload.id];
|
|
21
|
+
},
|
|
22
|
+
addYAxis(state, action) {
|
|
23
|
+
state.yAxis[action.payload.id] = castDraft(action.payload);
|
|
24
|
+
},
|
|
25
|
+
removeYAxis(state, action) {
|
|
26
|
+
delete state.yAxis[action.payload.id];
|
|
27
|
+
},
|
|
28
|
+
addZAxis(state, action) {
|
|
29
|
+
state.zAxis[action.payload.id] = castDraft(action.payload);
|
|
30
|
+
},
|
|
31
|
+
removeZAxis(state, action) {
|
|
32
|
+
delete state.zAxis[action.payload.id];
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
var { addXAxis, removeXAxis, addYAxis, removeYAxis, addZAxis, removeZAxis } = cartesianAxisSlice.actions;
|
|
37
|
+
var cartesianAxisReducer = cartesianAxisSlice.reducer;
|
|
38
|
+
//#endregion
|
|
39
|
+
export { addXAxis, addYAxis, addZAxis, cartesianAxisReducer, removeXAxis, removeYAxis, removeZAxis };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { createSlice } from "@reduxjs/toolkit";
|
|
2
|
+
var chartDataSlice = createSlice({
|
|
3
|
+
name: "chartData",
|
|
4
|
+
initialState: {
|
|
5
|
+
chartData: void 0,
|
|
6
|
+
computedData: void 0,
|
|
7
|
+
dataStartIndex: 0,
|
|
8
|
+
dataEndIndex: 0
|
|
9
|
+
},
|
|
10
|
+
reducers: {
|
|
11
|
+
setChartData(state, action) {
|
|
12
|
+
state.chartData = action.payload;
|
|
13
|
+
if (action.payload == null) {
|
|
14
|
+
state.dataStartIndex = 0;
|
|
15
|
+
state.dataEndIndex = 0;
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
if (action.payload.length > 0 && state.dataEndIndex !== action.payload.length - 1) state.dataEndIndex = action.payload.length - 1;
|
|
19
|
+
},
|
|
20
|
+
setComputedData(state, action) {
|
|
21
|
+
state.computedData = action.payload;
|
|
22
|
+
},
|
|
23
|
+
setDataStartEndIndexes(state, action) {
|
|
24
|
+
const { startIndex, endIndex } = action.payload;
|
|
25
|
+
if (startIndex != null) state.dataStartIndex = startIndex;
|
|
26
|
+
if (endIndex != null) state.dataEndIndex = endIndex;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
var { setChartData, setDataStartEndIndexes, setComputedData } = chartDataSlice.actions;
|
|
31
|
+
var chartDataReducer = chartDataSlice.reducer;
|
|
32
|
+
//#endregion
|
|
33
|
+
export { chartDataReducer, setChartData, setDataStartEndIndexes };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { selectActiveLabel, selectActiveTooltipCoordinate, selectActiveTooltipDataKey, selectActiveTooltipIndex, selectIsTooltipActive } from "./selectors/tooltipSelectors.mjs";
|
|
2
|
+
import { createAction } from "@reduxjs/toolkit";
|
|
3
|
+
//#region src/state/externalEventsMiddleware.ts
|
|
4
|
+
var externalEventAction = createAction("externalEvent");
|
|
5
|
+
/**
|
|
6
|
+
* Calls external event handlers (onMouseMove, onClick, etc.) synchronously within the dispatch
|
|
7
|
+
* call stack, while the native event's `currentTarget` is still valid.
|
|
8
|
+
*
|
|
9
|
+
* Using createListenerMiddleware would defer the call to a microtask, at which point the browser
|
|
10
|
+
* has already cleared `e.currentTarget` per the DOM spec, breaking coordinate-based handlers like
|
|
11
|
+
* DraggablePie that rely on `getRelativeCoordinate(e)`.
|
|
12
|
+
*/
|
|
13
|
+
var externalEventsMiddleware = (api) => (next) => (action) => {
|
|
14
|
+
const result = next(action);
|
|
15
|
+
if (externalEventAction.match(action) && action.payload.handler != null) {
|
|
16
|
+
const state = api.getState();
|
|
17
|
+
const nextState = {
|
|
18
|
+
activeCoordinate: selectActiveTooltipCoordinate(state),
|
|
19
|
+
activeDataKey: selectActiveTooltipDataKey(state),
|
|
20
|
+
activeIndex: selectActiveTooltipIndex(state),
|
|
21
|
+
activeLabel: selectActiveLabel(state),
|
|
22
|
+
activeTooltipIndex: selectActiveTooltipIndex(state),
|
|
23
|
+
isTooltipActive: selectIsTooltipActive(state)
|
|
24
|
+
};
|
|
25
|
+
action.payload.handler(nextState, action.payload.event);
|
|
26
|
+
}
|
|
27
|
+
return result;
|
|
28
|
+
};
|
|
29
|
+
//#endregion
|
|
30
|
+
export { externalEventAction, externalEventsMiddleware };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { createSlice, current } from "@reduxjs/toolkit";
|
|
2
|
+
import { castDraft } from "immer";
|
|
3
|
+
//#region src/state/graphicalItemsSlice.ts
|
|
4
|
+
var graphicalItemsSlice = createSlice({
|
|
5
|
+
name: "graphicalItems",
|
|
6
|
+
initialState: {
|
|
7
|
+
countOfBars: 0,
|
|
8
|
+
cartesianItems: [],
|
|
9
|
+
polarItems: []
|
|
10
|
+
},
|
|
11
|
+
reducers: {
|
|
12
|
+
addBar(state) {
|
|
13
|
+
state.countOfBars += 1;
|
|
14
|
+
},
|
|
15
|
+
removeBar(state) {
|
|
16
|
+
state.countOfBars -= 1;
|
|
17
|
+
},
|
|
18
|
+
addCartesianGraphicalItem(state, action) {
|
|
19
|
+
state.cartesianItems.push(castDraft(action.payload));
|
|
20
|
+
},
|
|
21
|
+
replaceCartesianGraphicalItem(state, action) {
|
|
22
|
+
const { prev, next } = action.payload;
|
|
23
|
+
const index = current(state).cartesianItems.indexOf(castDraft(prev));
|
|
24
|
+
if (index > -1) state.cartesianItems[index] = castDraft(next);
|
|
25
|
+
},
|
|
26
|
+
removeCartesianGraphicalItem(state, action) {
|
|
27
|
+
const index = current(state).cartesianItems.indexOf(castDraft(action.payload));
|
|
28
|
+
if (index > -1) state.cartesianItems.splice(index, 1);
|
|
29
|
+
},
|
|
30
|
+
addPolarGraphicalItem(state, action) {
|
|
31
|
+
state.polarItems.push(castDraft(action.payload));
|
|
32
|
+
},
|
|
33
|
+
removePolarGraphicalItem(state, action) {
|
|
34
|
+
const index = current(state).polarItems.indexOf(castDraft(action.payload));
|
|
35
|
+
if (index > -1) state.polarItems.splice(index, 1);
|
|
36
|
+
},
|
|
37
|
+
replacePolarGraphicalItem(state, action) {
|
|
38
|
+
const { prev, next } = action.payload;
|
|
39
|
+
const index = current(state).polarItems.indexOf(castDraft(prev));
|
|
40
|
+
if (index > -1) state.polarItems[index] = castDraft(next);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
var { addBar, removeBar, addCartesianGraphicalItem, removeCartesianGraphicalItem, addPolarGraphicalItem, replaceCartesianGraphicalItem, removePolarGraphicalItem, replacePolarGraphicalItem } = graphicalItemsSlice.actions;
|
|
45
|
+
var graphicalItemsReducer = graphicalItemsSlice.reducer;
|
|
46
|
+
//#endregion
|
|
47
|
+
export { addCartesianGraphicalItem, addPolarGraphicalItem, graphicalItemsReducer, removeCartesianGraphicalItem, removePolarGraphicalItem, replaceCartesianGraphicalItem, replacePolarGraphicalItem };
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { selectChartDirection } from "./selectors/axisSelectors.mjs";
|
|
2
|
+
import { setKeyboardInteraction } from "./tooltipSlice.mjs";
|
|
3
|
+
import { combineActiveTooltipIndex } from "./selectors/combiners/combineActiveTooltipIndex.mjs";
|
|
4
|
+
import { selectTooltipAxisTicks, selectTooltipDisplayedData } from "./selectors/tooltipSelectors.mjs";
|
|
5
|
+
import { selectCoordinateForDefaultIndex } from "./selectors/selectors.mjs";
|
|
6
|
+
import { createAction, createListenerMiddleware } from "@reduxjs/toolkit";
|
|
7
|
+
//#region src/state/keyboardEventsMiddleware.ts
|
|
8
|
+
var keyDownAction = createAction("keyDown");
|
|
9
|
+
var focusAction = createAction("focus");
|
|
10
|
+
var keyboardEventsMiddleware = createListenerMiddleware();
|
|
11
|
+
keyboardEventsMiddleware.startListening({
|
|
12
|
+
actionCreator: keyDownAction,
|
|
13
|
+
effect: (action, listenerApi) => {
|
|
14
|
+
const state = listenerApi.getState();
|
|
15
|
+
if (!(state.rootProps.accessibilityLayer !== false)) return;
|
|
16
|
+
const { keyboardInteraction } = state.tooltip;
|
|
17
|
+
const key = action.payload;
|
|
18
|
+
if (key !== "ArrowRight" && key !== "ArrowLeft" && key !== "Enter") return;
|
|
19
|
+
const currentIndex = Number(combineActiveTooltipIndex(keyboardInteraction, selectTooltipDisplayedData(state)));
|
|
20
|
+
const tooltipTicks = selectTooltipAxisTicks(state);
|
|
21
|
+
if (key === "Enter") {
|
|
22
|
+
const coordinate = selectCoordinateForDefaultIndex(state, "axis", "hover", String(keyboardInteraction.index));
|
|
23
|
+
listenerApi.dispatch(setKeyboardInteraction({
|
|
24
|
+
active: !keyboardInteraction.active,
|
|
25
|
+
activeIndex: keyboardInteraction.index,
|
|
26
|
+
activeDataKey: keyboardInteraction.dataKey,
|
|
27
|
+
activeCoordinate: coordinate
|
|
28
|
+
}));
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
const directionMultiplier = selectChartDirection(state) === "left-to-right" ? 1 : -1;
|
|
32
|
+
const nextIndex = currentIndex + (key === "ArrowRight" ? 1 : -1) * directionMultiplier;
|
|
33
|
+
if (nextIndex >= tooltipTicks.length || nextIndex < 0) return;
|
|
34
|
+
const coordinate = selectCoordinateForDefaultIndex(state, "axis", "hover", String(nextIndex));
|
|
35
|
+
listenerApi.dispatch(setKeyboardInteraction({
|
|
36
|
+
active: true,
|
|
37
|
+
activeIndex: nextIndex.toString(),
|
|
38
|
+
activeDataKey: void 0,
|
|
39
|
+
activeCoordinate: coordinate
|
|
40
|
+
}));
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
keyboardEventsMiddleware.startListening({
|
|
44
|
+
actionCreator: focusAction,
|
|
45
|
+
effect: (_, listenerApi) => {
|
|
46
|
+
const state = listenerApi.getState();
|
|
47
|
+
if (!(state.rootProps.accessibilityLayer !== false)) return;
|
|
48
|
+
const { keyboardInteraction } = state.tooltip;
|
|
49
|
+
if (keyboardInteraction.active) return;
|
|
50
|
+
if (keyboardInteraction.index == null) {
|
|
51
|
+
const nextIndex = "0";
|
|
52
|
+
const coordinate = selectCoordinateForDefaultIndex(state, "axis", "hover", String(nextIndex));
|
|
53
|
+
listenerApi.dispatch(setKeyboardInteraction({
|
|
54
|
+
activeDataKey: void 0,
|
|
55
|
+
active: true,
|
|
56
|
+
activeIndex: nextIndex,
|
|
57
|
+
activeCoordinate: coordinate
|
|
58
|
+
}));
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
//#endregion
|
|
63
|
+
export { focusAction, keyDownAction, keyboardEventsMiddleware };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { createSlice } from "@reduxjs/toolkit";
|
|
2
|
+
//#region src/state/layoutSlice.ts
|
|
3
|
+
var chartLayoutSlice = createSlice({
|
|
4
|
+
name: "chartLayout",
|
|
5
|
+
initialState: {
|
|
6
|
+
layoutType: "horizontal",
|
|
7
|
+
width: 0,
|
|
8
|
+
height: 0,
|
|
9
|
+
margin: {
|
|
10
|
+
top: 5,
|
|
11
|
+
right: 5,
|
|
12
|
+
bottom: 5,
|
|
13
|
+
left: 5
|
|
14
|
+
},
|
|
15
|
+
scale: 1
|
|
16
|
+
},
|
|
17
|
+
reducers: {
|
|
18
|
+
setLayout(state, action) {
|
|
19
|
+
state.layoutType = action.payload;
|
|
20
|
+
},
|
|
21
|
+
setChartSize(state, action) {
|
|
22
|
+
state.width = action.payload.width;
|
|
23
|
+
state.height = action.payload.height;
|
|
24
|
+
},
|
|
25
|
+
setMargin(state, action) {
|
|
26
|
+
state.margin.top = action.payload.top;
|
|
27
|
+
state.margin.right = action.payload.right;
|
|
28
|
+
state.margin.bottom = action.payload.bottom;
|
|
29
|
+
state.margin.left = action.payload.left;
|
|
30
|
+
},
|
|
31
|
+
setScale(state, action) {
|
|
32
|
+
state.scale = action.payload;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
var { setMargin, setLayout, setChartSize, setScale } = chartLayoutSlice.actions;
|
|
37
|
+
var chartLayoutReducer = chartLayoutSlice.reducer;
|
|
38
|
+
//#endregion
|
|
39
|
+
export { chartLayoutReducer, setChartSize, setLayout, setMargin, setScale };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { createSlice, current } from "@reduxjs/toolkit";
|
|
2
|
+
import { castDraft } from "immer";
|
|
3
|
+
//#region src/state/legendSlice.ts
|
|
4
|
+
var legendSlice = createSlice({
|
|
5
|
+
name: "legend",
|
|
6
|
+
initialState: {
|
|
7
|
+
settings: {
|
|
8
|
+
layout: "horizontal",
|
|
9
|
+
align: "center",
|
|
10
|
+
verticalAlign: "middle"
|
|
11
|
+
},
|
|
12
|
+
size: {
|
|
13
|
+
width: 0,
|
|
14
|
+
height: 0
|
|
15
|
+
},
|
|
16
|
+
payload: []
|
|
17
|
+
},
|
|
18
|
+
reducers: {
|
|
19
|
+
setLegendSize(state, action) {
|
|
20
|
+
state.size.width = action.payload.width;
|
|
21
|
+
state.size.height = action.payload.height;
|
|
22
|
+
},
|
|
23
|
+
setLegendSettings(state, action) {
|
|
24
|
+
state.settings.align = action.payload.align;
|
|
25
|
+
state.settings.layout = action.payload.layout;
|
|
26
|
+
state.settings.verticalAlign = action.payload.verticalAlign;
|
|
27
|
+
},
|
|
28
|
+
addLegendPayload(state, action) {
|
|
29
|
+
state.payload.push(castDraft(action.payload));
|
|
30
|
+
},
|
|
31
|
+
removeLegendPayload(state, action) {
|
|
32
|
+
const index = current(state).payload.indexOf(castDraft(action.payload));
|
|
33
|
+
if (index > -1) state.payload.splice(index, 1);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
var { setLegendSize, setLegendSettings, addLegendPayload, removeLegendPayload } = legendSlice.actions;
|
|
38
|
+
var legendReducer = legendSlice.reducer;
|
|
39
|
+
//#endregion
|
|
40
|
+
export { addLegendPayload, legendReducer, removeLegendPayload, setLegendSettings, setLegendSize };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { selectTooltipEventType } from "./selectors/selectTooltipEventType.mjs";
|
|
2
|
+
import { mouseLeaveChart, setMouseClickAxisIndex, setMouseOverAxisIndex } from "./tooltipSlice.mjs";
|
|
3
|
+
import { selectActivePropsFromChartPointer } from "./selectors/selectActivePropsFromChartPointer.mjs";
|
|
4
|
+
import { createAction, createListenerMiddleware } from "@reduxjs/toolkit";
|
|
5
|
+
//#region src/state/mouseEventsMiddleware.ts
|
|
6
|
+
var mouseClickAction = createAction("mouseClick");
|
|
7
|
+
var mouseClickMiddleware = createListenerMiddleware();
|
|
8
|
+
mouseClickMiddleware.startListening({
|
|
9
|
+
actionCreator: mouseClickAction,
|
|
10
|
+
effect: (action, listenerApi) => {
|
|
11
|
+
const chartPointer = action.payload;
|
|
12
|
+
const state = listenerApi.getState();
|
|
13
|
+
if (selectTooltipEventType(state, state.tooltip.settings.shared) === "axis") {
|
|
14
|
+
const activeProps = selectActivePropsFromChartPointer(state, chartPointer);
|
|
15
|
+
if (activeProps?.activeIndex != null) listenerApi.dispatch(setMouseClickAxisIndex({
|
|
16
|
+
activeIndex: activeProps.activeIndex,
|
|
17
|
+
activeDataKey: void 0,
|
|
18
|
+
activeCoordinate: activeProps.activeCoordinate
|
|
19
|
+
}));
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
var mouseMoveAction = createAction("mouseMove");
|
|
24
|
+
var mouseMoveMiddleware = createListenerMiddleware();
|
|
25
|
+
mouseMoveMiddleware.startListening({
|
|
26
|
+
actionCreator: mouseMoveAction,
|
|
27
|
+
effect: (action, listenerApi) => {
|
|
28
|
+
const chartPointer = action.payload;
|
|
29
|
+
const state = listenerApi.getState();
|
|
30
|
+
const tooltipEventType = selectTooltipEventType(state, state.tooltip.settings.shared);
|
|
31
|
+
const activeProps = selectActivePropsFromChartPointer(state, chartPointer);
|
|
32
|
+
if (tooltipEventType === "axis") if (activeProps?.activeIndex != null) listenerApi.dispatch(setMouseOverAxisIndex({
|
|
33
|
+
activeIndex: activeProps.activeIndex,
|
|
34
|
+
activeDataKey: void 0,
|
|
35
|
+
activeCoordinate: activeProps.activeCoordinate
|
|
36
|
+
}));
|
|
37
|
+
else listenerApi.dispatch(mouseLeaveChart());
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
//#endregion
|
|
41
|
+
export { mouseClickAction, mouseClickMiddleware, mouseMoveAction, mouseMoveMiddleware };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { isNan } from "../utils/validate.mjs";
|
|
2
|
+
import { createSlice } from "@reduxjs/toolkit";
|
|
3
|
+
//#region src/state/optionsSlice.ts
|
|
4
|
+
function arrayTooltipSearcher(data, strIndex) {
|
|
5
|
+
if (!strIndex) return void 0;
|
|
6
|
+
const numIndex = Number.parseInt(strIndex, 10);
|
|
7
|
+
if (isNan(numIndex)) return;
|
|
8
|
+
return data?.[numIndex];
|
|
9
|
+
}
|
|
10
|
+
var optionsSlice = createSlice({
|
|
11
|
+
name: "options",
|
|
12
|
+
initialState: {
|
|
13
|
+
chartName: "",
|
|
14
|
+
tooltipPayloadSearcher: void 0,
|
|
15
|
+
eventEmitter: void 0,
|
|
16
|
+
defaultTooltipEventType: "axis"
|
|
17
|
+
},
|
|
18
|
+
reducers: { createEventEmitter: (state) => {
|
|
19
|
+
if (state.eventEmitter == null) state.eventEmitter = Symbol("rechartsEventEmitter");
|
|
20
|
+
} }
|
|
21
|
+
});
|
|
22
|
+
var optionsReducer = optionsSlice.reducer;
|
|
23
|
+
var { createEventEmitter } = optionsSlice.actions;
|
|
24
|
+
//#endregion
|
|
25
|
+
export { arrayTooltipSearcher, createEventEmitter, optionsReducer };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { createSlice } from "@reduxjs/toolkit";
|
|
2
|
+
import { castDraft } from "immer";
|
|
3
|
+
//#region src/state/polarAxisSlice.ts
|
|
4
|
+
var polarAxisSlice = createSlice({
|
|
5
|
+
name: "polarAxis",
|
|
6
|
+
initialState: {
|
|
7
|
+
radiusAxis: {},
|
|
8
|
+
angleAxis: {}
|
|
9
|
+
},
|
|
10
|
+
reducers: {
|
|
11
|
+
addRadiusAxis(state, action) {
|
|
12
|
+
state.radiusAxis[action.payload.id] = castDraft(action.payload);
|
|
13
|
+
},
|
|
14
|
+
removeRadiusAxis(state, action) {
|
|
15
|
+
delete state.radiusAxis[action.payload.id];
|
|
16
|
+
},
|
|
17
|
+
addAngleAxis(state, action) {
|
|
18
|
+
state.angleAxis[action.payload.id] = castDraft(action.payload);
|
|
19
|
+
},
|
|
20
|
+
removeAngleAxis(state, action) {
|
|
21
|
+
delete state.angleAxis[action.payload.id];
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
var { addRadiusAxis, removeRadiusAxis, addAngleAxis, removeAngleAxis } = polarAxisSlice.actions;
|
|
26
|
+
var polarAxisReducer = polarAxisSlice.reducer;
|
|
27
|
+
//#endregion
|
|
28
|
+
export { addAngleAxis, addRadiusAxis, polarAxisReducer, removeAngleAxis, removeRadiusAxis };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { createSlice } from "@reduxjs/toolkit";
|
|
2
|
+
//#region src/state/polarOptionsSlice.ts
|
|
3
|
+
var polarOptionsSlice = createSlice({
|
|
4
|
+
name: "polarOptions",
|
|
5
|
+
initialState: null,
|
|
6
|
+
reducers: { updatePolarOptions(_, action) {
|
|
7
|
+
return action.payload;
|
|
8
|
+
} }
|
|
9
|
+
});
|
|
10
|
+
var { updatePolarOptions } = polarOptionsSlice.actions;
|
|
11
|
+
var polarOptionsReducer = polarOptionsSlice.reducer;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { polarOptionsReducer, updatePolarOptions };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
//#region src/state/reduxDevtoolsJsonStringifyReplacer.ts
|
|
2
|
+
function reduxDevtoolsJsonStringifyReplacer(_key, value) {
|
|
3
|
+
if (value instanceof HTMLElement) return `HTMLElement <${value.tagName} class="${value.className}">`;
|
|
4
|
+
if (value === window) return "global.window";
|
|
5
|
+
return value;
|
|
6
|
+
}
|
|
7
|
+
//#endregion
|
|
8
|
+
export { reduxDevtoolsJsonStringifyReplacer };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { createSlice, current } from "@reduxjs/toolkit";
|
|
2
|
+
var referenceElementsSlice = createSlice({
|
|
3
|
+
name: "referenceElements",
|
|
4
|
+
initialState: {
|
|
5
|
+
dots: [],
|
|
6
|
+
areas: [],
|
|
7
|
+
lines: []
|
|
8
|
+
},
|
|
9
|
+
reducers: {
|
|
10
|
+
addDot: (state, action) => {
|
|
11
|
+
state.dots.push(action.payload);
|
|
12
|
+
},
|
|
13
|
+
removeDot: (state, action) => {
|
|
14
|
+
const index = current(state).dots.findIndex((dot) => dot === action.payload);
|
|
15
|
+
if (index !== -1) state.dots.splice(index, 1);
|
|
16
|
+
},
|
|
17
|
+
addArea: (state, action) => {
|
|
18
|
+
state.areas.push(action.payload);
|
|
19
|
+
},
|
|
20
|
+
removeArea: (state, action) => {
|
|
21
|
+
const index = current(state).areas.findIndex((area) => area === action.payload);
|
|
22
|
+
if (index !== -1) state.areas.splice(index, 1);
|
|
23
|
+
},
|
|
24
|
+
addLine: (state, action) => {
|
|
25
|
+
state.lines.push(action.payload);
|
|
26
|
+
},
|
|
27
|
+
removeLine: (state, action) => {
|
|
28
|
+
const index = current(state).lines.findIndex((line) => line === action.payload);
|
|
29
|
+
if (index !== -1) state.lines.splice(index, 1);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
var { addDot, removeDot, addArea, removeArea, addLine, removeLine } = referenceElementsSlice.actions;
|
|
34
|
+
var referenceElementsReducer = referenceElementsSlice.reducer;
|
|
35
|
+
//#endregion
|
|
36
|
+
export { addArea, addLine, referenceElementsReducer, removeArea, removeLine };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { createSlice } from "@reduxjs/toolkit";
|
|
2
|
+
//#region src/state/rootPropsSlice.ts
|
|
3
|
+
var initialState = {
|
|
4
|
+
accessibilityLayer: true,
|
|
5
|
+
barCategoryGap: "10%",
|
|
6
|
+
barGap: 4,
|
|
7
|
+
barSize: void 0,
|
|
8
|
+
class: void 0,
|
|
9
|
+
maxBarSize: void 0,
|
|
10
|
+
stackOffset: "none",
|
|
11
|
+
syncId: void 0,
|
|
12
|
+
syncMethod: "index"
|
|
13
|
+
};
|
|
14
|
+
var rootPropsSlice = createSlice({
|
|
15
|
+
name: "rootProps",
|
|
16
|
+
initialState,
|
|
17
|
+
reducers: { updateOptions: (state, action) => {
|
|
18
|
+
state.accessibilityLayer = action.payload.accessibilityLayer;
|
|
19
|
+
state.barCategoryGap = action.payload.barCategoryGap;
|
|
20
|
+
state.barGap = action.payload.barGap ?? initialState.barGap;
|
|
21
|
+
state.barSize = action.payload.barSize;
|
|
22
|
+
state.maxBarSize = action.payload.maxBarSize;
|
|
23
|
+
state.stackOffset = action.payload.stackOffset;
|
|
24
|
+
state.syncId = action.payload.syncId;
|
|
25
|
+
state.syncMethod = action.payload.syncMethod;
|
|
26
|
+
state.class = action.payload.class;
|
|
27
|
+
} }
|
|
28
|
+
});
|
|
29
|
+
var rootPropsReducer = rootPropsSlice.reducer;
|
|
30
|
+
var { updateOptions } = rootPropsSlice.actions;
|
|
31
|
+
//#endregion
|
|
32
|
+
export { rootPropsReducer, updateOptions };
|