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,55 @@
|
|
|
1
|
+
import { CartesianViewBox } from '../cartesian/type';
|
|
2
|
+
import { AxisType, CartesianAxisSettings, XAxisOrientation, YAxisOrientation } from './axis';
|
|
3
|
+
import { TickItem } from './common';
|
|
4
|
+
import { RechartsScale } from './scale';
|
|
5
|
+
import { SVGAttributes, VNode } from 'vue';
|
|
6
|
+
/**
|
|
7
|
+
* Ticks can be any type when the axis is the type of category.
|
|
8
|
+
*
|
|
9
|
+
* Ticks must be numbers when the axis is the type of number.
|
|
10
|
+
*/
|
|
11
|
+
export type AxisTick = number | string;
|
|
12
|
+
export type TicksSettings = {
|
|
13
|
+
allowDecimals: boolean;
|
|
14
|
+
tickCount?: number;
|
|
15
|
+
/**
|
|
16
|
+
* Ticks can be any type when the axis is the type of category
|
|
17
|
+
* Ticks must be numbers when the axis is the type of number
|
|
18
|
+
*/
|
|
19
|
+
ticks: ReadonlyArray<AxisTick> | undefined;
|
|
20
|
+
tick: SVGAttributes | ((props: any) => VNode) | boolean;
|
|
21
|
+
};
|
|
22
|
+
export type TickFormatter = (value: any, index: number) => string;
|
|
23
|
+
export type AxisPropsNeededForTicksGenerator = {
|
|
24
|
+
axisType?: AxisType;
|
|
25
|
+
categoricalDomain?: ReadonlyArray<unknown>;
|
|
26
|
+
duplicateDomain?: ReadonlyArray<unknown>;
|
|
27
|
+
isCategorical?: boolean;
|
|
28
|
+
niceTicks?: ReadonlyArray<AxisTick>;
|
|
29
|
+
/**
|
|
30
|
+
* The range appears to be only used in Angle Axis - needs further investigation
|
|
31
|
+
*/
|
|
32
|
+
range?: ReadonlyArray<number>;
|
|
33
|
+
realScaleType?: 'scaleBand' | string;
|
|
34
|
+
scale: RechartsScale;
|
|
35
|
+
tickCount?: number;
|
|
36
|
+
ticks?: ReadonlyArray<AxisTick>;
|
|
37
|
+
type?: 'number' | 'category';
|
|
38
|
+
};
|
|
39
|
+
export interface CartesianTickItem extends TickItem {
|
|
40
|
+
tickCoord?: number;
|
|
41
|
+
tickSize?: number;
|
|
42
|
+
isShow?: boolean;
|
|
43
|
+
}
|
|
44
|
+
export type GetTicksInput = {
|
|
45
|
+
angle: number;
|
|
46
|
+
interval: CartesianAxisSettings['interval'];
|
|
47
|
+
minTickGap: number;
|
|
48
|
+
orientation: XAxisOrientation | YAxisOrientation;
|
|
49
|
+
tick: CartesianAxisSettings['tick'];
|
|
50
|
+
tickFormatter: CartesianAxisSettings['tickFormatter'];
|
|
51
|
+
ticks: ReadonlyArray<CartesianTickItem>;
|
|
52
|
+
unit: CartesianAxisSettings['unit'];
|
|
53
|
+
viewBox: CartesianViewBox;
|
|
54
|
+
};
|
|
55
|
+
export type StackId = string | number;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { DataKey } from './common';
|
|
2
|
+
/**
|
|
3
|
+
* null means no active index
|
|
4
|
+
* string means: whichever index from the chart data it is.
|
|
5
|
+
* Different charts have different requirements on data shapes,
|
|
6
|
+
* and are also responsible for providing a function that will accept this index
|
|
7
|
+
* and return data.
|
|
8
|
+
*/
|
|
9
|
+
export type TooltipIndex = string | null;
|
|
10
|
+
export type TooltipEventType = 'axis' | 'item';
|
|
11
|
+
export type TooltipTrigger = 'hover' | 'click';
|
|
12
|
+
export type TooltipType = 'none';
|
|
13
|
+
export type ValueType = number | string | Array<number | string>;
|
|
14
|
+
export type NameType = number | string;
|
|
15
|
+
export type Formatter<TValue extends ValueType, TName extends NameType> = (value: TValue, name: TName, item: Payload<TValue, TName>, index: number, payload: ReadonlyArray<Payload<TValue, TName>>) => any;
|
|
16
|
+
export interface Payload<TValue extends ValueType, TName extends NameType> {
|
|
17
|
+
type?: TooltipType;
|
|
18
|
+
color?: string;
|
|
19
|
+
name?: TName;
|
|
20
|
+
value?: TValue;
|
|
21
|
+
unit?: string;
|
|
22
|
+
fill?: string;
|
|
23
|
+
dataKey?: DataKey<any>;
|
|
24
|
+
nameKey?: DataKey<any>;
|
|
25
|
+
payload?: any;
|
|
26
|
+
chartType?: string;
|
|
27
|
+
stroke?: string;
|
|
28
|
+
strokeDasharray?: string | number;
|
|
29
|
+
strokeWidth?: number | string;
|
|
30
|
+
className?: string;
|
|
31
|
+
hide?: boolean;
|
|
32
|
+
formatter?: Formatter<TValue, TName>;
|
|
33
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FilteredSvgElementType } from '../cartesian/cartesian-grid/const';
|
|
2
|
+
/**
|
|
3
|
+
* Checks if the property is valid to spread onto an SVG element or onto a specific component
|
|
4
|
+
* @param {unknown} property property value currently being compared
|
|
5
|
+
* @param {string} key property key currently being compared
|
|
6
|
+
* @param {boolean} includeEvents if events are included in spreadable props
|
|
7
|
+
* @param {boolean} svgElementType checks against map of SVG element types to attributes
|
|
8
|
+
* @returns {boolean} is prop valid
|
|
9
|
+
*/
|
|
10
|
+
export declare function isValidSpreadableProp(property: unknown, key: string, includeEvents?: boolean, svgElementType?: FilteredSvgElementType): boolean;
|
|
11
|
+
export declare function filterProps(props: Record<string, any> | boolean | unknown, includeEvents: boolean, svgElementType?: FilteredSvgElementType): Record<string, any>;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Size } from '../types';
|
|
2
|
+
import { CSSProperties } from 'vue';
|
|
3
|
+
export declare function getStringSize(text: string | number, style?: CSSProperties): Size;
|
|
4
|
+
export type RequiredKeys<T> = {
|
|
5
|
+
[K in keyof T]-?: object extends Pick<T, K> ? never : K;
|
|
6
|
+
}[keyof T];
|
|
7
|
+
export type OptionalKeys<T> = {
|
|
8
|
+
[K in keyof T]-?: object extends Pick<T, K> ? K : never;
|
|
9
|
+
}[keyof T];
|
|
10
|
+
export type DisallowExtraKeys<T, D> = {
|
|
11
|
+
[K in keyof D]: K extends keyof T ? D[K] : never;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* This type will take a source type `T` and a default type `D` and will return a new type
|
|
15
|
+
* where all properties that are optional in `T` but required in `D` are made required in the result.
|
|
16
|
+
* Properties that are required in `T` and optional in `D` will remain required.
|
|
17
|
+
* Properties that are optional in both `T` and `D` will remain optional.
|
|
18
|
+
*
|
|
19
|
+
* This is useful for creating a type that represents the resolved props of a component with default props.
|
|
20
|
+
*/
|
|
21
|
+
export type RequiresDefaultProps<T, D extends Partial<T>> = Pick<T, RequiredKeys<T>> & Required<Pick<T, Extract<OptionalKeys<T>, RequiredKeys<D>>>> & Pick<T, Exclude<OptionalKeys<T>, keyof D>>;
|
|
22
|
+
/**
|
|
23
|
+
* This function mimics the behavior of the `defaultProps` static property in React.
|
|
24
|
+
* Functional components do not have a defaultProps property, so this function is useful to resolve default props.
|
|
25
|
+
*
|
|
26
|
+
* The common recommendation is to use ES6 destructuring with default values in the function signature,
|
|
27
|
+
* but you need to be careful there and make sure you destructure all the individual properties
|
|
28
|
+
* and not the whole object. See the test file for example.
|
|
29
|
+
*
|
|
30
|
+
* And because destructuring all properties one by one is a faff, and it's easy to miss one property,
|
|
31
|
+
* this function exists.
|
|
32
|
+
*
|
|
33
|
+
* @param realProps - the props object passed to the component by the user
|
|
34
|
+
* @param defaultProps - the default props object defined in the component by Recharts
|
|
35
|
+
* @returns - the props object with all the default props resolved. All `undefined` values are replaced with the default value.
|
|
36
|
+
*/
|
|
37
|
+
export declare function resolveDefaultProps<T, D extends Partial<T>>(realProps: T, defaultProps: D & DisallowExtraKeys<T, D>): RequiresDefaultProps<T, D>;
|
|
38
|
+
/**
|
|
39
|
+
* merge props and attrs
|
|
40
|
+
* @param props - props
|
|
41
|
+
* @param attrs - attrs
|
|
42
|
+
* @returns merged props
|
|
43
|
+
*/
|
|
44
|
+
export declare function mergePropAttrs<T extends object>(props: T, attrs: any): T & {
|
|
45
|
+
toObject: () => T;
|
|
46
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Sign } from '../cartesian/type';
|
|
2
|
+
import { Size } from '../types';
|
|
3
|
+
import { CartesianTickItem } from '../types/tick';
|
|
4
|
+
/**
|
|
5
|
+
* Normalizes the angle so that 0 <= angle < 180.
|
|
6
|
+
* @param {number} angle Angle in degrees.
|
|
7
|
+
* @return {number} the normalized angle with a value of at least 0 and never greater or equal to 180.
|
|
8
|
+
*/
|
|
9
|
+
export declare function normalizeAngle(angle: number): number;
|
|
10
|
+
/**
|
|
11
|
+
* Calculates the width of the largest horizontal line that fits inside a rectangle that is displayed at an angle.
|
|
12
|
+
* @param {object} size Width and height of the text in a horizontal position.
|
|
13
|
+
* @param {number} angle Angle in degrees in which the text is displayed.
|
|
14
|
+
* @return {number} The width of the largest horizontal line that fits inside a rectangle that is displayed at an angle.
|
|
15
|
+
*/
|
|
16
|
+
export declare function getAngledRectangleWidth({ width, height }: Size, angle?: number | undefined): number;
|
|
17
|
+
export declare function getEquidistantTicks(sign: Sign, boundaries: {
|
|
18
|
+
start: number;
|
|
19
|
+
end: number;
|
|
20
|
+
}, getTickSize: (tick: CartesianTickItem, index: number) => number, ticks: ReadonlyArray<CartesianTickItem>, minTickGap: number): ReadonlyArray<CartesianTickItem>;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { BaseAxisProps } from '../cartesian/axis/type';
|
|
2
|
+
import { PolarViewBoxRequired } from '../cartesian/type';
|
|
3
|
+
import { NormalizedStackId } from '../shape';
|
|
4
|
+
import { BaseAxisWithScale, StackGroup } from '../state/selectors/axisSelectors';
|
|
5
|
+
import { TooltipEntrySettings, TooltipPayloadEntry } from '../state/tooltipSlice';
|
|
6
|
+
import { ChartCoordinate, ChartOffsetRequired, ChartPointer, Coordinate, DataKey, LayoutType, StackOffsetType, TickItem, ValueType } from '../types';
|
|
7
|
+
import { AxisRange, AxisType, NumberDomain } from '../types/axis';
|
|
8
|
+
import { AxisPropsNeededForTicksGenerator, StackId } from '../types/tick';
|
|
9
|
+
import { Series, SeriesPoint } from 'victory-vendor/d3-shape';
|
|
10
|
+
/**
|
|
11
|
+
* Get the ticks of an axis
|
|
12
|
+
* @param {object} axis The configuration of an axis
|
|
13
|
+
* @param {boolean} isGrid Whether or not are the ticks in grid
|
|
14
|
+
* @param {boolean} isAll Return the ticks of all the points or not
|
|
15
|
+
* @return {Array} Ticks
|
|
16
|
+
*/
|
|
17
|
+
export declare function getTicksOfAxis(axis: null | AxisPropsNeededForTicksGenerator, isGrid?: boolean, isAll?: boolean): ReadonlyArray<TickItem> | null;
|
|
18
|
+
export declare function getValueByDataKey<T>(obj: T, dataKey: DataKey<T>, defaultValue?: any): any;
|
|
19
|
+
export declare const MIN_VALUE_REG: RegExp;
|
|
20
|
+
export declare const MAX_VALUE_REG: RegExp;
|
|
21
|
+
/**
|
|
22
|
+
* Calculate the size between two category
|
|
23
|
+
* @param {object} axis The options of axis
|
|
24
|
+
* @param {Array} ticks The ticks of axis
|
|
25
|
+
* @param {boolean} isBar if items in axis are bars
|
|
26
|
+
* @return {number} Size
|
|
27
|
+
*/
|
|
28
|
+
export declare function getBandSizeOfAxis(axis?: BaseAxisWithScale, ticks?: ReadonlyArray<TickItem>, isBar?: boolean): number | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* Both value and domain are tuples of two numbers
|
|
31
|
+
* - but the type stays as array of numbers until we have better support in rest of the app
|
|
32
|
+
* @param value input that will be truncated
|
|
33
|
+
* @param domain boundaries
|
|
34
|
+
* @returns tuple of two numbers
|
|
35
|
+
*/
|
|
36
|
+
export declare function truncateByDomain(value: SeriesPoint<Record<number, number>>, domain: ReadonlyArray<number>): [number, number] | SeriesPoint<Record<number, number>>;
|
|
37
|
+
export declare function getNormalizedStackId(publicStackId: StackId | undefined): NormalizedStackId | undefined;
|
|
38
|
+
export declare function getCateCoordinateOfLine<T extends Record<string, unknown>>({ axis, ticks, bandSize, entry, index, dataKey, }: {
|
|
39
|
+
axis: {
|
|
40
|
+
dataKey?: DataKey<T>;
|
|
41
|
+
allowDuplicatedCategory?: boolean;
|
|
42
|
+
type?: BaseAxisProps['type'];
|
|
43
|
+
scale: (v: number) => number;
|
|
44
|
+
};
|
|
45
|
+
ticks: Array<TickItem>;
|
|
46
|
+
bandSize: number;
|
|
47
|
+
entry: T;
|
|
48
|
+
index: number;
|
|
49
|
+
dataKey?: DataKey<T>;
|
|
50
|
+
}): number | null;
|
|
51
|
+
export declare function getChartPointer(event: PointerEvent | MouseEvent): ChartPointer | undefined;
|
|
52
|
+
export declare function getTooltipEntry({ tooltipEntrySettings, dataKey, payload, value, name, }: {
|
|
53
|
+
tooltipEntrySettings: TooltipEntrySettings;
|
|
54
|
+
dataKey: DataKey<any>;
|
|
55
|
+
payload: any;
|
|
56
|
+
value: ValueType;
|
|
57
|
+
name: string | undefined;
|
|
58
|
+
}): TooltipPayloadEntry;
|
|
59
|
+
export type RangeObj = {
|
|
60
|
+
x?: number;
|
|
61
|
+
y?: number;
|
|
62
|
+
cx?: number;
|
|
63
|
+
cy?: number;
|
|
64
|
+
angle?: number;
|
|
65
|
+
radius?: number;
|
|
66
|
+
};
|
|
67
|
+
export declare function calculateTooltipPos(rangeObj: RangeObj, layout: LayoutType): number | undefined;
|
|
68
|
+
export declare function inRangeOfSector({ x, y }: Coordinate, viewBox: PolarViewBoxRequired): RangeObj | null;
|
|
69
|
+
export declare function inRange(x: number, y: number, layout: LayoutType, polarViewBox: PolarViewBoxRequired | undefined, offset: ChartOffsetRequired): RangeObj | null;
|
|
70
|
+
export declare function calculateActiveTickIndex(coordinate: number, ticks: ReadonlyArray<TickItem>, unsortedTicks: ReadonlyArray<TickItem>, axisType: AxisType | undefined, range: AxisRange | undefined): number;
|
|
71
|
+
export declare function getActiveCoordinate(layout: LayoutType, tooltipTicks: readonly TickItem[], activeIndex: number, rangeObj: RangeObj): ChartCoordinate;
|
|
72
|
+
export declare function getDomainOfStackGroups(stackGroups: Record<StackId, StackGroup> | undefined, startIndex: number, endIndex: number): NumberDomain | undefined;
|
|
73
|
+
export declare function checkDomainOfScale(scale: any): void;
|
|
74
|
+
export declare function getTooltipNameProp(nameFromItem: string | number | undefined | unknown, dataKey: DataKey<any> | undefined): string | undefined;
|
|
75
|
+
export declare function isClipDot(dot: any): boolean;
|
|
76
|
+
type OffsetAccessor = (series: Array<Series<Record<string, unknown>, string>>, order: number[]) => void;
|
|
77
|
+
export declare const offsetSign: OffsetAccessor;
|
|
78
|
+
/**
|
|
79
|
+
* Replaces all negative values with zero when stacking data.
|
|
80
|
+
*
|
|
81
|
+
* If all values in the series are positive then this behaves the same as 'none' stacker.
|
|
82
|
+
*
|
|
83
|
+
* @param {Array} series from d3-shape Stack
|
|
84
|
+
* @return {Array} series with applied offset
|
|
85
|
+
*/
|
|
86
|
+
export declare const offsetPositive: OffsetAccessor;
|
|
87
|
+
export declare function getStackedData(data: ReadonlyArray<Record<string, unknown>>, dataKeys: ReadonlyArray<DataKey<any>>, offsetType: StackOffsetType): ReadonlyArray<Series<Record<string, unknown>, DataKey<any>>>;
|
|
88
|
+
export declare function getBaseValueOfBar({ numericAxis }: {
|
|
89
|
+
numericAxis: BaseAxisWithScale;
|
|
90
|
+
}): number | unknown;
|
|
91
|
+
export declare function getCateCoordinateOfBar({ axis, ticks, offset, bandSize, entry, index, }: {
|
|
92
|
+
axis: BaseAxisWithScale;
|
|
93
|
+
ticks: ReadonlyArray<TickItem>;
|
|
94
|
+
offset: number;
|
|
95
|
+
bandSize: number;
|
|
96
|
+
entry: any;
|
|
97
|
+
index: number;
|
|
98
|
+
}): number | null;
|
|
99
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* We use this attribute to identify which element is the one that the user is touching.
|
|
3
|
+
* The index is the position of the element in the data array.
|
|
4
|
+
* This can be either a number (for array-based charts) or a string (for the charts that have a matrix-shaped data).
|
|
5
|
+
*/
|
|
6
|
+
export declare const DATA_ITEM_INDEX_ATTRIBUTE_NAME = "data-recharts-item-index";
|
|
7
|
+
/**
|
|
8
|
+
* We use this attribute to identify which element is the one that the user is touching.
|
|
9
|
+
* DataKey works here as a kind of identifier for the element. It's not a perfect identifier for ~two~ three reasons:
|
|
10
|
+
*
|
|
11
|
+
* 1. There can be two different elements with the same dataKey; we won't know which is it
|
|
12
|
+
* 2. DataKey can be a function, and that serialized will be a `[Function: anonymous]` string
|
|
13
|
+
* which means we will be able to identify that it was a function but can't tell which one.
|
|
14
|
+
* This will lead to some weird bugs. A proper fix would be to either:
|
|
15
|
+
* a) use a unique identifier for each element (passed from props, or generated)
|
|
16
|
+
* b) figure out how to compare the dataKey or graphical item by object reference
|
|
17
|
+
*
|
|
18
|
+
* a) is a fuss because we don't have the unique identifier in props,
|
|
19
|
+
* and b) is possible most of the time except for touchMove events which work differently from mouseEnter/mouseLeave:
|
|
20
|
+
* - while mouseEnter is fired for the element that the mouse is over,
|
|
21
|
+
* touchMove is fired for the element where user has started touching. As the finger moves,
|
|
22
|
+
* we can identify the element that the user is touching by using the elementFromPoint method,
|
|
23
|
+
* but it keeps calling the handler on the element where touchStart was fired.
|
|
24
|
+
*
|
|
25
|
+
* Okay and now I discovered a third reason: the dataKey can be undefined and that's still fine
|
|
26
|
+
* because if dataKey is undefined then graphical elements assume the dataKey of the axes.
|
|
27
|
+
* Which makes it a convenient way of using recharts to render a chart but horrible identifier.
|
|
28
|
+
*/
|
|
29
|
+
export declare const DATA_ITEM_DATAKEY_ATTRIBUTE_NAME = "data-recharts-item-data-key";
|
|
30
|
+
export declare const DEFAULT_Y_AXIS_WIDTH = 60;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param providerComponentName - The name(s) of the component(s) providing the context.
|
|
3
|
+
*
|
|
4
|
+
* There are situations where context can come from multiple components. In such cases, you might need to give an array of component names to provide your context, instead of just a single string.
|
|
5
|
+
*
|
|
6
|
+
* @param contextName The description for injection key symbol.
|
|
7
|
+
*/
|
|
8
|
+
export declare function createContext<ContextValue>(providerComponentName: string | string[], contextName?: string): readonly [<T extends ContextValue | null | undefined = ContextValue>(fallback?: T) => T extends null ? ContextValue | null : ContextValue, (contextValue: ContextValue) => ContextValue];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param providerComponentName - The name(s) of the component(s) providing the context.
|
|
3
|
+
*
|
|
4
|
+
* There are situations where context can come from multiple components. In such cases, you might need to give an array of component names to provide your context, instead of just a single string.
|
|
5
|
+
*
|
|
6
|
+
* @param contextName The description for injection key symbol.
|
|
7
|
+
*/
|
|
8
|
+
export declare function createContext<ContextValue>(contextName?: string): readonly [<T extends ContextValue | null | undefined = ContextValue>(fallback?: T) => T extends null ? ContextValue | null : ContextValue, (contextValue: ContextValue) => ContextValue];
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare function uniqueId(prefix?: string): string;
|
|
2
|
+
export declare function interpolate(start: unknown, end: number, t: number): number;
|
|
3
|
+
export declare function interpolate(start: unknown, end: null, t: number): null;
|
|
4
|
+
export declare function interpolate(start: unknown, end: number | null, t: number): number | null;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare function mathSign(value: number): 0 | 1 | -1;
|
|
2
|
+
export declare function hasDuplicate(ary: ReadonlyArray<unknown>): boolean;
|
|
3
|
+
/**
|
|
4
|
+
* Get percent value of a total value
|
|
5
|
+
* @param {number|string} percent A percent
|
|
6
|
+
* @param {number} totalValue Total value
|
|
7
|
+
* @param {number} defaultValue The value returned when percent is undefined or invalid
|
|
8
|
+
* @param {boolean} validate If set to be true, the result will be validated
|
|
9
|
+
* @return {number} value
|
|
10
|
+
*/
|
|
11
|
+
export declare function getPercentValue(percent: number | string, totalValue: number, defaultValue?: number, validate?: boolean): number;
|
|
12
|
+
export declare function findEntryInArray<T>(ary: ReadonlyArray<T>, specifiedKey: number | string | ((entry: T) => unknown), specifiedValue: unknown): T;
|
|
13
|
+
export declare function interpolateNumber(numberA: number | undefined, numberB: number | undefined, t: number): number;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { default as EventEmitter } from 'eventemitter3';
|
|
2
|
+
import { PayloadAction } from '@reduxjs/toolkit';
|
|
3
|
+
import { TooltipSyncState } from '../state/tooltipSlice';
|
|
4
|
+
import { BrushStartEndIndex } from '../state/chartDataSlice';
|
|
5
|
+
declare const eventCenter: EventEmitter<EventTypes>;
|
|
6
|
+
export { eventCenter };
|
|
7
|
+
export declare const TOOLTIP_SYNC_EVENT = "recharts.syncEvent.tooltip";
|
|
8
|
+
export declare const BRUSH_SYNC_EVENT = "recharts.syncEvent.brush";
|
|
9
|
+
interface EventTypes {
|
|
10
|
+
[TOOLTIP_SYNC_EVENT]: (syncId: number | string, data: PayloadAction<TooltipSyncState>, emitter: symbol) => void;
|
|
11
|
+
[BRUSH_SYNC_EVENT]: (syncId: number | string, data: BrushStartEndIndex, emitter: symbol) => void;
|
|
12
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface LinearRegressionResult {
|
|
2
|
+
xmin: number;
|
|
3
|
+
xmax: number;
|
|
4
|
+
a: number;
|
|
5
|
+
b: number;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* The least square linear regression
|
|
9
|
+
* @param data The array of points
|
|
10
|
+
* @returns The domain of x, and the parameter of linear function y = ax + b
|
|
11
|
+
*/
|
|
12
|
+
export declare function getLinearRegression(data: ReadonlyArray<{
|
|
13
|
+
cx?: number;
|
|
14
|
+
cy?: number;
|
|
15
|
+
}>): LinearRegressionResult;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type RelativePointer = {
|
|
2
|
+
relativeX: number;
|
|
3
|
+
relativeY: number;
|
|
4
|
+
};
|
|
5
|
+
type MousePointer = {
|
|
6
|
+
clientX: number;
|
|
7
|
+
clientY: number;
|
|
8
|
+
currentTarget: Element | HTMLElement;
|
|
9
|
+
};
|
|
10
|
+
export declare function getRelativeCoordinate(event: MousePointer): RelativePointer;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { AxisPropsForCartesianGridTicksGeneration } from '../cartesian/cartesian-grid/type';
|
|
2
|
+
import { ChartOffset, TickItem } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Calculate the Coordinates of grid
|
|
5
|
+
* @param {Array} ticks The ticks in axis
|
|
6
|
+
* @param {number} minValue The minimum value of axis
|
|
7
|
+
* @param {number} maxValue The maximum value of axis
|
|
8
|
+
* @param {boolean} syncWithTicks Synchronize grid lines with ticks or not
|
|
9
|
+
* @return {Array} Coordinates
|
|
10
|
+
*/
|
|
11
|
+
export declare function getCoordinatesOfGrid(ticks: ReadonlyArray<TickItem>, minValue: number, maxValue: number, syncWithTicks: boolean): number[];
|
|
12
|
+
export type HorizontalCoordinatesGenerator = (props: {
|
|
13
|
+
yAxis: AxisPropsForCartesianGridTicksGeneration;
|
|
14
|
+
width: number;
|
|
15
|
+
height: number;
|
|
16
|
+
offset: ChartOffset;
|
|
17
|
+
}, syncWithTicks: boolean) => number[];
|
|
18
|
+
export declare const defaultHorizontalCoordinatesGenerator: HorizontalCoordinatesGenerator;
|
|
19
|
+
export type VerticalCoordinatesGenerator = (props: {
|
|
20
|
+
xAxis: AxisPropsForCartesianGridTicksGeneration;
|
|
21
|
+
width: number;
|
|
22
|
+
height: number;
|
|
23
|
+
offset: ChartOffset;
|
|
24
|
+
}, syncWithTicks: boolean) => number[];
|
|
25
|
+
export declare const defaultVerticalCoordinatesGenerator: VerticalCoordinatesGenerator;
|
|
26
|
+
export declare function calculateHorizontalPoints(yAxis: AxisPropsForCartesianGridTicksGeneration, width: number, height: number, offset: ChartOffset, syncWithTicks: boolean, customPoints?: number[], horizontalValues?: number[] | string[], horizontalCoordinatesGenerator?: (props: {
|
|
27
|
+
yAxis: AxisPropsForCartesianGridTicksGeneration;
|
|
28
|
+
width: number;
|
|
29
|
+
height: number;
|
|
30
|
+
offset: ChartOffset;
|
|
31
|
+
}, syncWithTicks: boolean) => number[]): number[];
|
|
32
|
+
export declare function calculateVerticalPoints(xAxis: AxisPropsForCartesianGridTicksGeneration, width: number, height: number, offset: ChartOffset, syncWithTicks: boolean, customPoints?: number[], verticalValues?: number[] | string[], verticalCoordinatesGenerator?: (props: {
|
|
33
|
+
xAxis: AxisPropsForCartesianGridTicksGeneration;
|
|
34
|
+
width: number;
|
|
35
|
+
height: number;
|
|
36
|
+
offset: ChartOffset;
|
|
37
|
+
}, syncWithTicks: boolean) => number[]): number[];
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { AxisDomain, NumberDomain } from '../types/axis';
|
|
2
|
+
export declare function isWellFormedNumberDomain(v: unknown): v is NumberDomain;
|
|
3
|
+
export declare function extendDomain(providedDomain: NumberDomain, boundaryDomain: NumberDomain, allowDataOverflow: boolean): NumberDomain;
|
|
4
|
+
/**
|
|
5
|
+
* So Recharts allows users to provide their own domains,
|
|
6
|
+
* but it also places some expectations on what the domain is.
|
|
7
|
+
* We can improve on the typescript typing, but we also need a runtime test
|
|
8
|
+
to observe that the user-provided domain is well-formed,
|
|
9
|
+
* that is: an array with exactly two numbers.
|
|
10
|
+
*
|
|
11
|
+
* This function does not accept data as an argument.
|
|
12
|
+
* This is to enable a performance optimization - if the domain is there,
|
|
13
|
+
* and we know what it is without traversing all the data,
|
|
14
|
+
* then we don't have to traverse all the data!
|
|
15
|
+
*
|
|
16
|
+
* If the user-provided domain is not well-formed,
|
|
17
|
+
* this function will return undefined - in which case we should traverse the data to calculate the real domain.
|
|
18
|
+
*
|
|
19
|
+
* This function is for parsing the numerical domain only.
|
|
20
|
+
*
|
|
21
|
+
* @param userDomain external prop, user provided, before validation. Can have various shapes: array, function, special magical strings inside too.
|
|
22
|
+
* @param allowDataOverflow boolean, provided by users. If true then the data domain wins
|
|
23
|
+
*
|
|
24
|
+
* @return [min, max] domain if it's well-formed; undefined if the domain is invalid
|
|
25
|
+
*/
|
|
26
|
+
export declare function numericalDomainSpecifiedWithoutRequiringData(userDomain: AxisDomain | undefined, allowDataOverflow: boolean): NumberDomain;
|
|
27
|
+
/**
|
|
28
|
+
* So Recharts allows users to provide their own domains,
|
|
29
|
+
* but it also places some expectations on what the domain is.
|
|
30
|
+
* We can improve on the typescript typing, but we also need a runtime test
|
|
31
|
+
* to observe that the user-provided domain is well-formed,
|
|
32
|
+
* that is: an array with exactly two numbers.
|
|
33
|
+
* If the user-provided domain is not well-formed,
|
|
34
|
+
* this function will return undefined - in which case we should traverse the data to calculate the real domain.
|
|
35
|
+
*
|
|
36
|
+
* This function is for parsing the numerical domain only.
|
|
37
|
+
*
|
|
38
|
+
* You are probably thinking, why does domain need tick count?
|
|
39
|
+
* Well it adjusts the domain based on where the "nice ticks" land, and nice ticks depend on the tick count.
|
|
40
|
+
*
|
|
41
|
+
* @param userDomain external prop, user provided, before validation. Can have various shapes: array, function, special magical strings inside too.
|
|
42
|
+
* @param dataDomain calculated from data. Can be undefined, as an option for performance optimization
|
|
43
|
+
* @param allowDataOverflow provided by users. If true then the data domain wins
|
|
44
|
+
*
|
|
45
|
+
* @return [min, max] domain if it's well-formed; undefined if the domain is invalid
|
|
46
|
+
*/
|
|
47
|
+
export declare function parseNumericalUserDomain(userDomain: AxisDomain | undefined, dataDomain: NumberDomain | undefined, allowDataOverflow: boolean): NumberDomain | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function warn(condition: boolean, format: string, ...args: any[]): void;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { PolarViewBoxRequired } from '../cartesian/type';
|
|
2
|
+
import { ChartOffset, Coordinate } from '../types';
|
|
3
|
+
export declare const RADIAN: number;
|
|
4
|
+
export declare const radianToDegree: (angleInRadian: number) => number;
|
|
5
|
+
export declare function distanceBetweenPoints(point: Coordinate, anotherPoint: Coordinate): number;
|
|
6
|
+
export declare function formatAngleOfSector({ startAngle, endAngle }: PolarViewBoxRequired): {
|
|
7
|
+
startAngle: number;
|
|
8
|
+
endAngle: number;
|
|
9
|
+
};
|
|
10
|
+
export declare function getAngleOfPoint({ x, y }: Coordinate, { cx, cy }: PolarViewBoxRequired): {
|
|
11
|
+
radius: number;
|
|
12
|
+
angle: number;
|
|
13
|
+
angleInRadian?: undefined;
|
|
14
|
+
} | {
|
|
15
|
+
radius: number;
|
|
16
|
+
angle: number;
|
|
17
|
+
angleInRadian: number;
|
|
18
|
+
};
|
|
19
|
+
export declare function reverseFormatAngleOfSector(angle: number, { startAngle, endAngle }: PolarViewBoxRequired): number;
|
|
20
|
+
export declare function polarToCartesian(cx: number, cy: number, radius: number, angle: number): Coordinate;
|
|
21
|
+
export declare function getMaxRadius(width: number, height: number, offset?: Partial<ChartOffset>): number;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ComponentObjectPropsOptions } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* 将 defaultProps 的属性值作为 props 的 default 属性
|
|
4
|
+
* @param props - Vue 组件的 props 定义对象
|
|
5
|
+
* @param defaultProps - 默认值对象
|
|
6
|
+
* @returns 新的 Vue 组件 props 对象
|
|
7
|
+
*/
|
|
8
|
+
export declare function applyDefaultProps<T extends ComponentObjectPropsOptions>(props: T, defaultProps: Partial<Record<keyof T, any>>): T;
|
|
9
|
+
/**
|
|
10
|
+
* 创建带有默认值的 props 对象
|
|
11
|
+
* @param baseProps - 基础 props 定义
|
|
12
|
+
* @param defaultProps - 默认值配置
|
|
13
|
+
* @returns 合并后的 props 对象
|
|
14
|
+
*/
|
|
15
|
+
export declare function createPropsWithDefaults<T extends ComponentObjectPropsOptions>(baseProps: T, defaultProps: Partial<Record<keyof T, any>>): T;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This function mimics the behavior of the `defaultProps` static property in React.
|
|
3
|
+
* Functional components do not have a defaultProps property, so this function is useful to resolve default props.
|
|
4
|
+
*
|
|
5
|
+
* The common recommendation is to use ES6 destructuring with default values in the function signature,
|
|
6
|
+
* but you need to be careful there and make sure you destructure all the individual properties
|
|
7
|
+
* and not the whole object. See the test file for example.
|
|
8
|
+
*
|
|
9
|
+
* And because destructuring all properties one by one is a faff, and it's easy to miss one property,
|
|
10
|
+
* this function exists.
|
|
11
|
+
*
|
|
12
|
+
* @param realProps - the props object passed to the component by the user
|
|
13
|
+
* @param defaultProps - the default props object defined in the component by Recharts
|
|
14
|
+
* @returns - the props object with all the default props resolved. All `undefined` values are replaced with the default value.
|
|
15
|
+
*/
|
|
16
|
+
export declare function resolveDefaultProps<T, D extends Partial<T>>(realProps: T, defaultProps: D & DisallowExtraKeys<T, D>): RequiresDefaultProps<T, D>;
|
|
17
|
+
/**
|
|
18
|
+
* Helper type to extract the keys of T that are required.
|
|
19
|
+
* It iterates through each key K in T. If Pick<T, K> cannot be assigned an empty object {},
|
|
20
|
+
* it means K is required, so we keep K; otherwise, we discard it (never).
|
|
21
|
+
* [keyof T] at the end creates a union of the kept keys.
|
|
22
|
+
*/
|
|
23
|
+
export type RequiredKeys<T> = {
|
|
24
|
+
[K in keyof T]-?: object extends Pick<T, K> ? never : K;
|
|
25
|
+
}[keyof T];
|
|
26
|
+
/**
|
|
27
|
+
* Helper type to extract the keys of T that are optional.
|
|
28
|
+
* It iterates through each key K in T. If Pick<T, K> can be assigned an empty object {},
|
|
29
|
+
* it means K is optional (or potentially missing), so we keep K; otherwise, we discard it (never).
|
|
30
|
+
* [keyof T] at the end creates a union of the kept keys.
|
|
31
|
+
*/
|
|
32
|
+
export type OptionalKeys<T> = {
|
|
33
|
+
[K in keyof T]-?: object extends Pick<T, K> ? K : never;
|
|
34
|
+
}[keyof T];
|
|
35
|
+
/**
|
|
36
|
+
* Helper type to ensure keys of D exist in T.
|
|
37
|
+
* For each key K in D, if K is also a key of T, keep the type D[K].
|
|
38
|
+
* If K is NOT a key of T, map it to type `never`.
|
|
39
|
+
* An object cannot have a property of type `never`, effectively disallowing extra keys.
|
|
40
|
+
*/
|
|
41
|
+
export type DisallowExtraKeys<T, D> = {
|
|
42
|
+
[K in keyof D]: K extends keyof T ? D[K] : never;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* This type will take a source type `T` and a default type `D` and will return a new type
|
|
46
|
+
* where all properties that are optional in `T` but required in `D` are made required in the result.
|
|
47
|
+
* Properties that are required in `T` and optional in `D` will remain required.
|
|
48
|
+
* Properties that are optional in both `T` and `D` will remain optional.
|
|
49
|
+
*
|
|
50
|
+
* This is useful for creating a type that represents the resolved props of a component with default props.
|
|
51
|
+
*/
|
|
52
|
+
export type RequiresDefaultProps<T, D extends Partial<T>> = Pick<T, RequiredKeys<T>> & Required<Pick<T, Extract<OptionalKeys<T>, RequiredKeys<D>>>> & Pick<T, Exclude<OptionalKeys<T>, keyof D>>;
|