recharts-pdf 3.11.3 → 3.11.5
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/es6/animation/AnimatedItems.js +117 -0
- package/es6/animation/AnimationController.js +1 -0
- package/es6/animation/AnimationControllerImpl.js +29 -0
- package/es6/animation/AnimationHandle.js +269 -0
- package/es6/animation/CSSTransitionAnimate.js +100 -0
- package/es6/animation/JavascriptAnimate.js +71 -0
- package/es6/animation/easing.js +177 -0
- package/es6/animation/matchBy.js +230 -0
- package/es6/animation/timeoutController.js +49 -0
- package/es6/animation/useAnimationController.js +30 -0
- package/es6/animation/useAnimationStartSnapshot.js +90 -0
- package/es6/animation/useZoomAwareAnimation.js +133 -0
- package/es6/animation/util.js +6 -0
- package/es6/cartesian/Area.js +818 -0
- package/es6/cartesian/AreaRevealShape.js +186 -0
- package/es6/cartesian/Bar.js +975 -0
- package/es6/cartesian/BarStack.js +145 -0
- package/es6/cartesian/Brush.js +953 -0
- package/es6/cartesian/CartesianAxis.js +558 -0
- package/es6/cartesian/CartesianGrid.js +481 -0
- package/es6/cartesian/ErrorBar.js +284 -0
- package/es6/cartesian/Funnel.js +653 -0
- package/es6/cartesian/GraphicalItemClipPath.js +80 -0
- package/es6/cartesian/Line.js +694 -0
- package/es6/cartesian/LineDrawShape.js +210 -0
- package/es6/cartesian/ReferenceArea.js +216 -0
- package/es6/cartesian/ReferenceDot.js +196 -0
- package/es6/cartesian/ReferenceLine.js +262 -0
- package/es6/cartesian/Scatter.js +853 -0
- package/es6/cartesian/XAxis.js +230 -0
- package/es6/cartesian/YAxis.js +234 -0
- package/es6/cartesian/ZAxis.js +67 -0
- package/es6/cartesian/cartesianPositionToCSSTranslate.js +33 -0
- package/es6/cartesian/cartesianViewBoxToTrapezoid.js +13 -0
- package/es6/cartesian/getCartesianPosition.js +224 -0
- package/es6/cartesian/getEquidistantTicks.js +172 -0
- package/es6/cartesian/getTicks.js +172 -0
- package/es6/cartesian/useAnimatedLineLength.js +54 -0
- package/es6/cartesian/zoomedLineLength.js +150 -0
- package/es6/chart/AreaChart.js +22 -0
- package/es6/chart/BarChart.js +22 -0
- package/es6/chart/CartesianChart.js +92 -0
- package/es6/chart/CategoricalChart.js +61 -0
- package/es6/chart/ComposedChart.js +22 -0
- package/es6/chart/FunnelChart.js +22 -0
- package/es6/chart/LineChart.js +22 -0
- package/es6/chart/PieChart.js +34 -0
- package/es6/chart/PolarChart.js +113 -0
- package/es6/chart/RadarChart.js +33 -0
- package/es6/chart/RadialBarChart.js +34 -0
- package/es6/chart/RechartsWrapper.js +381 -0
- package/es6/chart/Sankey.js +1454 -0
- package/es6/chart/ScatterChart.js +22 -0
- package/es6/chart/StaticCartesianChart.js +208 -0
- package/es6/chart/SunburstChart.js +623 -0
- package/es6/chart/Treemap.js +1300 -0
- package/es6/chart/types.js +1 -0
- package/es6/chart/zoom/SelectionOverlay.js +56 -0
- package/es6/chart/zoom/ZoomAndPan.js +177 -0
- package/es6/chart/zoom/ZoomGestureApi.js +46 -0
- package/es6/chart/zoom/ZoomStateSync.js +177 -0
- package/es6/chart/zoom/doubleClickGesture.js +20 -0
- package/es6/chart/zoom/keyboardGesture.js +121 -0
- package/es6/chart/zoom/pointerGesture.js +214 -0
- package/es6/chart/zoom/touchGesture.js +478 -0
- package/es6/chart/zoom/useZoomApi.js +259 -0
- package/es6/chart/zoom/wheelGesture.js +92 -0
- package/es6/component/ActivePoints.js +105 -0
- package/es6/component/Cell.js +20 -0
- package/es6/component/Cursor.js +167 -0
- package/es6/component/Customized.js +43 -0
- package/es6/component/DefaultLegendContent.js +354 -0
- package/es6/component/DefaultTooltipContent.js +179 -0
- package/es6/component/Dots.js +107 -0
- package/es6/component/Label.js +460 -0
- package/es6/component/LabelList.js +244 -0
- package/es6/component/Legend.js +303 -0
- package/es6/component/ResponsiveContainer.js +193 -0
- package/es6/component/Text.js +703 -0
- package/es6/component/Tooltip.js +210 -0
- package/es6/component/TooltipBoundingBox.js +125 -0
- package/es6/component/responsiveContainerUtils.js +109 -0
- package/es6/container/ClipPathProvider.js +49 -0
- package/es6/container/Layer.js +32 -0
- package/es6/container/RootSurface.js +105 -0
- package/es6/container/Surface.js +47 -0
- package/es6/context/ErrorBarContext.js +65 -0
- package/es6/context/PDFContext.js +5 -0
- package/es6/context/PanoramaContext.js +10 -0
- package/es6/context/RegisterGraphicalItemId.js +16 -0
- package/es6/context/accessibilityContext.js +5 -0
- package/es6/context/brushUpdateContext.js +2 -0
- package/es6/context/chartDataContext.js +73 -0
- package/es6/context/chartLayoutContext.js +235 -0
- package/es6/context/legendPayloadContext.js +10 -0
- package/es6/context/legendPortalContext.js +3 -0
- package/es6/context/tooltipContext.js +39 -0
- package/es6/context/tooltipPortalContext.js +3 -0
- package/es6/context/useTooltipAxis.js +21 -0
- package/es6/fill/RechartsFill.js +197 -0
- package/es6/fill/fillDefinitions.js +473 -0
- package/es6/fill/symbolPath.js +85 -0
- package/es6/hooks.js +668 -0
- package/es6/index.js +83 -0
- package/es6/polar/Pie.js +931 -0
- package/es6/polar/PolarAngleAxis.js +279 -0
- package/es6/polar/PolarGrid.js +224 -0
- package/es6/polar/PolarRadiusAxis.js +236 -0
- package/es6/polar/Radar.js +533 -0
- package/es6/polar/RadialBar.js +639 -0
- package/es6/polar/defaultPolarAngleAxisProps.js +25 -0
- package/es6/polar/defaultPolarRadiusAxisProps.js +21 -0
- package/es6/polar/isOutsidePolarPosition.js +16 -0
- package/es6/shape/Cross.js +70 -0
- package/es6/shape/Curve.js +178 -0
- package/es6/shape/Dot.js +56 -0
- package/es6/shape/DotSymbol.js +107 -0
- package/es6/shape/Polygon.js +126 -0
- package/es6/shape/Rectangle.js +263 -0
- package/es6/shape/Sector.js +251 -0
- package/es6/shape/Symbols.js +184 -0
- package/es6/shape/Trapezoid.js +163 -0
- package/es6/state/RechartsReduxContext.js +17 -0
- package/es6/state/RechartsStoreProvider.js +46 -0
- package/es6/state/ReportChartProps.js +10 -0
- package/es6/state/ReportEventSettings.js +12 -0
- package/es6/state/ReportMainChartProps.js +38 -0
- package/es6/state/ReportPolarOptions.js +10 -0
- package/es6/state/SetGraphicalItem.js +66 -0
- package/es6/state/SetLegendPayload.js +63 -0
- package/es6/state/SetTooltipEntrySettings.js +34 -0
- package/es6/state/brushSlice.js +34 -0
- package/es6/state/cartesianAxisSlice.js +229 -0
- package/es6/state/chartDataSlice.js +97 -0
- package/es6/state/errorBarSlice.js +47 -0
- package/es6/state/eventSettingsSlice.js +23 -0
- package/es6/state/externalEventsMiddleware.js +128 -0
- package/es6/state/graphicalItemsSlice.js +82 -0
- package/es6/state/hooks.js +57 -0
- package/es6/state/keyboardEventsMiddleware.js +219 -0
- package/es6/state/keyboardTooltipVisibility.js +49 -0
- package/es6/state/layoutSlice.js +43 -0
- package/es6/state/legendSlice.js +79 -0
- package/es6/state/mouseEventsMiddleware.js +140 -0
- package/es6/state/optionsSlice.js +43 -0
- package/es6/state/polarAxisSlice.js +31 -0
- package/es6/state/polarOptionsSlice.js +24 -0
- package/es6/state/reduxDevtoolsJsonStringifyReplacer.js +12 -0
- package/es6/state/referenceElementsSlice.js +49 -0
- package/es6/state/renderedTicksSlice.js +43 -0
- package/es6/state/rootPropsSlice.js +43 -0
- package/es6/state/selectors/areaSelectors.js +117 -0
- package/es6/state/selectors/arrayEqualityCheck.js +30 -0
- package/es6/state/selectors/axisSelectors.js +1558 -0
- package/es6/state/selectors/barSelectors.js +223 -0
- package/es6/state/selectors/barStackSelectors.js +93 -0
- package/es6/state/selectors/brushSelectors.js +11 -0
- package/es6/state/selectors/combiners/combineActiveLabel.js +9 -0
- package/es6/state/selectors/combiners/combineActiveTooltipIndex.js +70 -0
- package/es6/state/selectors/combiners/combineAllBarPositions.js +85 -0
- package/es6/state/selectors/combiners/combineAxisRangeWithReverse.js +9 -0
- package/es6/state/selectors/combiners/combineBarPosition.js +10 -0
- package/es6/state/selectors/combiners/combineBarSizeList.js +52 -0
- package/es6/state/selectors/combiners/combineCheckedDomain.js +43 -0
- package/es6/state/selectors/combiners/combineConfiguredScale.js +44 -0
- package/es6/state/selectors/combiners/combineCoordinateForDefaultIndex.js +83 -0
- package/es6/state/selectors/combiners/combineDisplayedStackedData.js +44 -0
- package/es6/state/selectors/combiners/combineInverseScaleFunction.js +10 -0
- package/es6/state/selectors/combiners/combinePlaceTooltipIndex.js +83 -0
- package/es6/state/selectors/combiners/combineRealScaleType.js +28 -0
- package/es6/state/selectors/combiners/combineStackedData.js +20 -0
- package/es6/state/selectors/combiners/combineTooltipInteractionState.js +85 -0
- package/es6/state/selectors/combiners/combineTooltipPayload.js +187 -0
- package/es6/state/selectors/combiners/combineTooltipPayloadConfigurations.js +45 -0
- package/es6/state/selectors/containerSelectors.js +4 -0
- package/es6/state/selectors/dataSelectors.js +78 -0
- package/es6/state/selectors/effectiveDataKeySelectors.js +97 -0
- package/es6/state/selectors/funnelSelectors.js +81 -0
- package/es6/state/selectors/graphicalItemSelectors.js +11 -0
- package/es6/state/selectors/legendSelectors.js +10 -0
- package/es6/state/selectors/lineSelectors.js +59 -0
- package/es6/state/selectors/numberDomainEqualityCheck.js +9 -0
- package/es6/state/selectors/pickAxisId.js +1 -0
- package/es6/state/selectors/pickAxisType.js +1 -0
- package/es6/state/selectors/pieSelectors.js +71 -0
- package/es6/state/selectors/polarAxisSelectors.js +130 -0
- package/es6/state/selectors/polarGridSelectors.js +17 -0
- package/es6/state/selectors/polarScaleSelectors.js +62 -0
- package/es6/state/selectors/polarSelectors.js +63 -0
- package/es6/state/selectors/radarSelectors.js +92 -0
- package/es6/state/selectors/radialBarSelectors.js +169 -0
- package/es6/state/selectors/rootPropsSelectors.js +11 -0
- package/es6/state/selectors/scatterSelectors.js +50 -0
- package/es6/state/selectors/selectActivePropsFromChartPointer.js +9 -0
- package/es6/state/selectors/selectAllAxes.js +7 -0
- package/es6/state/selectors/selectChartOffset.js +10 -0
- package/es6/state/selectors/selectChartOffsetInternal.js +94 -0
- package/es6/state/selectors/selectLegendArea.js +10 -0
- package/es6/state/selectors/selectPlotArea.js +14 -0
- package/es6/state/selectors/selectTooltipAxisId.js +1 -0
- package/es6/state/selectors/selectTooltipAxisType.js +23 -0
- package/es6/state/selectors/selectTooltipEventType.js +21 -0
- package/es6/state/selectors/selectTooltipPayloadSearcher.js +1 -0
- package/es6/state/selectors/selectTooltipSettings.js +1 -0
- package/es6/state/selectors/selectTooltipState.js +1 -0
- package/es6/state/selectors/selectors.js +101 -0
- package/es6/state/selectors/tooltipSelectors.js +256 -0
- package/es6/state/selectors/touchSelectors.js +19 -0
- package/es6/state/selectors/zoomProjectionSelectors.js +27 -0
- package/es6/state/selectors/zoomSelectors.js +30 -0
- package/es6/state/store.js +105 -0
- package/es6/state/tooltipSlice.js +224 -0
- package/es6/state/touchEventsMiddleware.js +164 -0
- package/es6/state/types/AreaSettings.js +1 -0
- package/es6/state/types/BarSettings.js +1 -0
- package/es6/state/types/LineSettings.js +1 -0
- package/es6/state/types/PieSettings.js +1 -0
- package/es6/state/types/RadarSettings.js +1 -0
- package/es6/state/types/RadialBarSettings.js +1 -0
- package/es6/state/types/ScatterSettings.js +1 -0
- package/es6/state/types/StackedGraphicalItem.js +17 -0
- package/es6/state/zIndexSlice.js +108 -0
- package/es6/state/zoomSettingsSlice.js +46 -0
- package/es6/state/zoomSlice.js +84 -0
- package/es6/synchronisation/syncSelectors.js +3 -0
- package/es6/synchronisation/types.js +1 -0
- package/es6/synchronisation/useChartSynchronisation.js +368 -0
- package/es6/theme/RechartsTheme.js +1 -0
- package/es6/theme/RechartsThemeContext.js +25 -0
- package/es6/theme/activeStyles.js +105 -0
- package/es6/theme/autoTheme.js +150 -0
- package/es6/theme/cssStylesToSvgStyles.js +18 -0
- package/es6/theme/darkTheme.js +140 -0
- package/es6/theme/dataEntryStyles.js +248 -0
- package/es6/theme/emptyTheme.js +14 -0
- package/es6/theme/graphicalItemIdentity.js +30 -0
- package/es6/theme/labelTheme.js +253 -0
- package/es6/theme/lightTheme.js +142 -0
- package/es6/theme/pageBackground.js +21 -0
- package/es6/theme/themeFill.js +95 -0
- package/es6/theme/useBackwardsCompatibleTheme.js +48 -0
- package/es6/theme/useGraphicalItemIdentity.js +67 -0
- package/es6/types.js +1 -0
- package/es6/util/ActiveShapeUtils.js +90 -0
- package/es6/util/BarUtils.js +43 -0
- package/es6/util/CartesianUtils.js +58 -0
- package/es6/util/ChartUtils.js +587 -0
- package/es6/util/Constants.js +16 -0
- package/es6/util/CssPrefixUtils.js +17 -0
- package/es6/util/DOMUtils.js +127 -0
- package/es6/util/DataUtils.js +189 -0
- package/es6/util/Events.js +5 -0
- package/es6/util/FunnelUtils.js +16 -0
- package/es6/util/Global.js +9 -0
- package/es6/util/IfOverflow.js +1 -0
- package/es6/util/LRUCache.js +43 -0
- package/es6/util/LogUtils.js +20 -0
- package/es6/util/PolarUtils.js +126 -0
- package/es6/util/RadialBarUtils.js +27 -0
- package/es6/util/ReactUtils.js +85 -0
- package/es6/util/ReduceCSSCalc.js +192 -0
- package/es6/util/ScatterUtils.js +34 -0
- package/es6/util/TickUtils.js +38 -0
- package/es6/util/XAxisUtils.js +41 -0
- package/es6/util/YAxisUtils.js +41 -0
- package/es6/util/axisPropsAreEqual.js +41 -0
- package/es6/util/clsx.js +55 -0
- package/es6/util/createCartesianCharts.js +127 -0
- package/es6/util/createEventProxy.js +16 -0
- package/es6/util/createPolarCharts.js +111 -0
- package/es6/util/cursor/getCursorPoints.js +43 -0
- package/es6/util/cursor/getCursorRectangle.js +9 -0
- package/es6/util/cursor/getRadialCursorPoints.js +23 -0
- package/es6/util/excludeEventProps.js +8 -0
- package/es6/util/getActiveCoordinate.js +156 -0
- package/es6/util/getAxisTypeBasedOnLayout.js +15 -0
- package/es6/util/getClassNameFromUnknown.js +6 -0
- package/es6/util/getEveryNth.js +27 -0
- package/es6/util/getRadiusAndStrokeWidthFromDot.js +26 -0
- package/es6/util/getRelativeCoordinate.js +95 -0
- package/es6/util/getSliced.js +6 -0
- package/es6/util/isDomainSpecifiedByUser.js +189 -0
- package/es6/util/isWellBehavedNumber.js +6 -0
- package/es6/util/payload/getUniqPayload.js +20 -0
- package/es6/util/propsAreEqual.js +142 -0
- package/es6/util/resolveDefaultProps.js +103 -0
- package/es6/util/round.js +32 -0
- package/es6/util/scale/CartesianScaleHelper.js +58 -0
- package/es6/util/scale/CustomScaleDefinition.js +1 -0
- package/es6/util/scale/RechartsScale.js +67 -0
- package/es6/util/scale/createCategoricalInverse.js +91 -0
- package/es6/util/scale/getNiceTickValues.js +291 -0
- package/es6/util/scale/index.js +1 -0
- package/es6/util/scale/util/arithmetic.js +61 -0
- package/es6/util/stacks/getStackSeriesIdentifier.js +8 -0
- package/es6/util/stacks/stackTypes.js +1 -0
- package/es6/util/svgPropertiesAndEvents.js +50 -0
- package/es6/util/svgPropertiesNoEvents.js +74 -0
- package/es6/util/tooltip/translate.js +132 -0
- package/es6/util/typedDataKey.js +1 -0
- package/es6/util/types.js +409 -0
- package/es6/util/useAnimationId.js +27 -0
- package/es6/util/useCells.js +51 -0
- package/es6/util/useEffectiveDataKey.js +26 -0
- package/es6/util/useElementOffset.js +1 -0
- package/es6/util/useElementSize.js +188 -0
- package/es6/util/useId.js +28 -0
- package/es6/util/usePrefersReducedMotion.js +43 -0
- package/es6/util/useReportScale.js +28 -0
- package/es6/util/useUniqueId.js +32 -0
- package/es6/util/zoom/ZoomOptions.js +49 -0
- package/es6/util/zoom/projection.js +144 -0
- package/es6/util/zoom/transform.js +93 -0
- package/es6/util/zoom/viewport.js +218 -0
- package/es6/util/zoom/viewportWindow.js +163 -0
- package/es6/util/zoom/zoomActions.js +123 -0
- package/es6/zIndex/DefaultZIndexes.js +87 -0
- package/es6/zIndex/StaticZIndexLayers.js +48 -0
- package/es6/zIndex/ZIndexLayer.js +143 -0
- package/es6/zIndex/ZIndexPortal.js +61 -0
- package/es6/zIndex/getZIndexFromUnknown.js +7 -0
- package/es6/zIndex/labelBackgroundZIndex.js +50 -0
- package/es6/zIndex/zIndexSelectors.js +32 -0
- package/lib/animation/AnimatedItems.js +125 -0
- package/lib/animation/AnimationController.js +1 -0
- package/lib/animation/AnimationControllerImpl.js +36 -0
- package/lib/animation/AnimationHandle.js +276 -0
- package/lib/animation/CSSTransitionAnimate.js +107 -0
- package/lib/animation/JavascriptAnimate.js +77 -0
- package/lib/animation/easing.js +184 -0
- package/lib/animation/matchBy.js +238 -0
- package/lib/animation/timeoutController.js +56 -0
- package/lib/animation/useAnimationController.js +37 -0
- package/lib/animation/useAnimationStartSnapshot.js +96 -0
- package/lib/animation/useZoomAwareAnimation.js +140 -0
- package/lib/animation/util.js +14 -0
- package/lib/cartesian/Area.js +827 -0
- package/lib/cartesian/AreaRevealShape.js +192 -0
- package/lib/cartesian/Bar.js +984 -0
- package/lib/cartesian/BarStack.js +155 -0
- package/lib/cartesian/Brush.js +961 -0
- package/lib/cartesian/CartesianAxis.js +565 -0
- package/lib/cartesian/CartesianGrid.js +488 -0
- package/lib/cartesian/ErrorBar.js +291 -0
- package/lib/cartesian/Funnel.js +663 -0
- package/lib/cartesian/GraphicalItemClipPath.js +89 -0
- package/lib/cartesian/Line.js +702 -0
- package/lib/cartesian/LineDrawShape.js +217 -0
- package/lib/cartesian/ReferenceArea.js +223 -0
- package/lib/cartesian/ReferenceDot.js +203 -0
- package/lib/cartesian/ReferenceLine.js +269 -0
- package/lib/cartesian/Scatter.js +862 -0
- package/lib/cartesian/XAxis.js +238 -0
- package/lib/cartesian/YAxis.js +242 -0
- package/lib/cartesian/ZAxis.js +75 -0
- package/lib/cartesian/cartesianPositionToCSSTranslate.js +39 -0
- package/lib/cartesian/cartesianViewBoxToTrapezoid.js +19 -0
- package/lib/cartesian/getCartesianPosition.js +231 -0
- package/lib/cartesian/getEquidistantTicks.js +179 -0
- package/lib/cartesian/getTicks.js +178 -0
- package/lib/cartesian/useAnimatedLineLength.js +59 -0
- package/lib/cartesian/zoomedLineLength.js +156 -0
- package/lib/chart/AreaChart.js +29 -0
- package/lib/chart/BarChart.js +29 -0
- package/lib/chart/CartesianChart.js +99 -0
- package/lib/chart/CategoricalChart.js +68 -0
- package/lib/chart/ComposedChart.js +29 -0
- package/lib/chart/FunnelChart.js +29 -0
- package/lib/chart/LineChart.js +29 -0
- package/lib/chart/PieChart.js +41 -0
- package/lib/chart/PolarChart.js +120 -0
- package/lib/chart/RadarChart.js +40 -0
- package/lib/chart/RadialBarChart.js +41 -0
- package/lib/chart/RechartsWrapper.js +388 -0
- package/lib/chart/Sankey.js +1465 -0
- package/lib/chart/ScatterChart.js +29 -0
- package/lib/chart/StaticCartesianChart.js +215 -0
- package/lib/chart/SunburstChart.js +632 -0
- package/lib/chart/Treemap.js +1311 -0
- package/lib/chart/types.js +1 -0
- package/lib/chart/zoom/SelectionOverlay.js +63 -0
- package/lib/chart/zoom/ZoomAndPan.js +184 -0
- package/lib/chart/zoom/ZoomGestureApi.js +54 -0
- package/lib/chart/zoom/ZoomStateSync.js +183 -0
- package/lib/chart/zoom/doubleClickGesture.js +27 -0
- package/lib/chart/zoom/keyboardGesture.js +130 -0
- package/lib/chart/zoom/pointerGesture.js +220 -0
- package/lib/chart/zoom/touchGesture.js +485 -0
- package/lib/chart/zoom/useZoomApi.js +266 -0
- package/lib/chart/zoom/wheelGesture.js +99 -0
- package/lib/component/ActivePoints.js +112 -0
- package/lib/component/Cell.js +27 -0
- package/lib/component/Cursor.js +174 -0
- package/lib/component/Customized.js +49 -0
- package/lib/component/DefaultLegendContent.js +362 -0
- package/lib/component/DefaultTooltipContent.js +186 -0
- package/lib/component/Dots.js +114 -0
- package/lib/component/Label.js +476 -0
- package/lib/component/LabelList.js +254 -0
- package/lib/component/Legend.js +310 -0
- package/lib/component/ResponsiveContainer.js +200 -0
- package/lib/component/Text.js +718 -0
- package/lib/component/Tooltip.js +217 -0
- package/lib/component/TooltipBoundingBox.js +132 -0
- package/lib/component/responsiveContainerUtils.js +119 -0
- package/lib/container/ClipPathProvider.js +58 -0
- package/lib/container/Layer.js +38 -0
- package/lib/container/RootSurface.js +112 -0
- package/lib/container/Surface.js +53 -0
- package/lib/context/ErrorBarContext.js +75 -0
- package/lib/context/PDFContext.js +12 -0
- package/lib/context/PanoramaContext.js +19 -0
- package/lib/context/RegisterGraphicalItemId.js +25 -0
- package/lib/context/accessibilityContext.js +12 -0
- package/lib/context/brushUpdateContext.js +8 -0
- package/lib/context/chartDataContext.js +83 -0
- package/lib/context/chartLayoutContext.js +254 -0
- package/lib/context/legendPayloadContext.js +15 -0
- package/lib/context/legendPortalContext.js +10 -0
- package/lib/context/tooltipContext.js +47 -0
- package/lib/context/tooltipPortalContext.js +10 -0
- package/lib/context/useTooltipAxis.js +29 -0
- package/lib/fill/RechartsFill.js +202 -0
- package/lib/fill/fillDefinitions.js +497 -0
- package/lib/fill/symbolPath.js +91 -0
- package/lib/hooks.js +683 -0
- package/lib/index.js +760 -0
- package/lib/polar/Pie.js +940 -0
- package/lib/polar/PolarAngleAxis.js +288 -0
- package/lib/polar/PolarGrid.js +231 -0
- package/lib/polar/PolarRadiusAxis.js +245 -0
- package/lib/polar/Radar.js +542 -0
- package/lib/polar/RadialBar.js +649 -0
- package/lib/polar/defaultPolarAngleAxisProps.js +31 -0
- package/lib/polar/defaultPolarRadiusAxisProps.js +27 -0
- package/lib/polar/isOutsidePolarPosition.js +22 -0
- package/lib/shape/Cross.js +77 -0
- package/lib/shape/Curve.js +186 -0
- package/lib/shape/Dot.js +63 -0
- package/lib/shape/DotSymbol.js +117 -0
- package/lib/shape/Polygon.js +134 -0
- package/lib/shape/Rectangle.js +270 -0
- package/lib/shape/Sector.js +259 -0
- package/lib/shape/Symbols.js +192 -0
- package/lib/shape/Trapezoid.js +171 -0
- package/lib/state/RechartsReduxContext.js +22 -0
- package/lib/state/RechartsStoreProvider.js +53 -0
- package/lib/state/ReportChartProps.js +16 -0
- package/lib/state/ReportEventSettings.js +18 -0
- package/lib/state/ReportMainChartProps.js +43 -0
- package/lib/state/ReportPolarOptions.js +16 -0
- package/lib/state/SetGraphicalItem.js +72 -0
- package/lib/state/SetLegendPayload.js +70 -0
- package/lib/state/SetTooltipEntrySettings.js +40 -0
- package/lib/state/brushSlice.js +38 -0
- package/lib/state/cartesianAxisSlice.js +233 -0
- package/lib/state/chartDataSlice.js +103 -0
- package/lib/state/errorBarSlice.js +51 -0
- package/lib/state/eventSettingsSlice.js +28 -0
- package/lib/state/externalEventsMiddleware.js +135 -0
- package/lib/state/graphicalItemsSlice.js +86 -0
- package/lib/state/hooks.js +66 -0
- package/lib/state/keyboardEventsMiddleware.js +225 -0
- package/lib/state/keyboardTooltipVisibility.js +57 -0
- package/lib/state/layoutSlice.js +48 -0
- package/lib/state/legendSlice.js +83 -0
- package/lib/state/mouseEventsMiddleware.js +147 -0
- package/lib/state/optionsSlice.js +48 -0
- package/lib/state/polarAxisSlice.js +36 -0
- package/lib/state/polarOptionsSlice.js +29 -0
- package/lib/state/reduxDevtoolsJsonStringifyReplacer.js +18 -0
- package/lib/state/referenceElementsSlice.js +54 -0
- package/lib/state/renderedTicksSlice.js +49 -0
- package/lib/state/rootPropsSlice.js +47 -0
- package/lib/state/selectors/areaSelectors.js +122 -0
- package/lib/state/selectors/arrayEqualityCheck.js +37 -0
- package/lib/state/selectors/axisSelectors.js +1614 -0
- package/lib/state/selectors/barSelectors.js +232 -0
- package/lib/state/selectors/barStackSelectors.js +102 -0
- package/lib/state/selectors/brushSelectors.js +18 -0
- package/lib/state/selectors/combiners/combineActiveLabel.js +16 -0
- package/lib/state/selectors/combiners/combineActiveTooltipIndex.js +77 -0
- package/lib/state/selectors/combiners/combineAllBarPositions.js +92 -0
- package/lib/state/selectors/combiners/combineAxisRangeWithReverse.js +16 -0
- package/lib/state/selectors/combiners/combineBarPosition.js +17 -0
- package/lib/state/selectors/combiners/combineBarSizeList.js +59 -0
- package/lib/state/selectors/combiners/combineCheckedDomain.js +49 -0
- package/lib/state/selectors/combiners/combineConfiguredScale.js +52 -0
- package/lib/state/selectors/combiners/combineCoordinateForDefaultIndex.js +90 -0
- package/lib/state/selectors/combiners/combineDisplayedStackedData.js +49 -0
- package/lib/state/selectors/combiners/combineInverseScaleFunction.js +16 -0
- package/lib/state/selectors/combiners/combinePlaceTooltipIndex.js +90 -0
- package/lib/state/selectors/combiners/combineRealScaleType.js +36 -0
- package/lib/state/selectors/combiners/combineStackedData.js +27 -0
- package/lib/state/selectors/combiners/combineTooltipInteractionState.js +92 -0
- package/lib/state/selectors/combiners/combineTooltipPayload.js +194 -0
- package/lib/state/selectors/combiners/combineTooltipPayloadConfigurations.js +52 -0
- package/lib/state/selectors/containerSelectors.js +14 -0
- package/lib/state/selectors/dataSelectors.js +87 -0
- package/lib/state/selectors/effectiveDataKeySelectors.js +106 -0
- package/lib/state/selectors/funnelSelectors.js +87 -0
- package/lib/state/selectors/graphicalItemSelectors.js +19 -0
- package/lib/state/selectors/legendSelectors.js +19 -0
- package/lib/state/selectors/lineSelectors.js +65 -0
- package/lib/state/selectors/numberDomainEqualityCheck.js +16 -0
- package/lib/state/selectors/pickAxisId.js +8 -0
- package/lib/state/selectors/pickAxisType.js +8 -0
- package/lib/state/selectors/pieSelectors.js +77 -0
- package/lib/state/selectors/polarAxisSelectors.js +137 -0
- package/lib/state/selectors/polarGridSelectors.js +23 -0
- package/lib/state/selectors/polarScaleSelectors.js +69 -0
- package/lib/state/selectors/polarSelectors.js +70 -0
- package/lib/state/selectors/radarSelectors.js +98 -0
- package/lib/state/selectors/radialBarSelectors.js +177 -0
- package/lib/state/selectors/rootPropsSelectors.js +28 -0
- package/lib/state/selectors/scatterSelectors.js +56 -0
- package/lib/state/selectors/selectActivePropsFromChartPointer.js +15 -0
- package/lib/state/selectors/selectAllAxes.js +13 -0
- package/lib/state/selectors/selectChartOffset.js +16 -0
- package/lib/state/selectors/selectChartOffsetInternal.js +106 -0
- package/lib/state/selectors/selectLegendArea.js +16 -0
- package/lib/state/selectors/selectPlotArea.js +20 -0
- package/lib/state/selectors/selectTooltipAxisId.js +8 -0
- package/lib/state/selectors/selectTooltipAxisType.js +29 -0
- package/lib/state/selectors/selectTooltipEventType.js +33 -0
- package/lib/state/selectors/selectTooltipPayloadSearcher.js +8 -0
- package/lib/state/selectors/selectTooltipSettings.js +8 -0
- package/lib/state/selectors/selectTooltipState.js +8 -0
- package/lib/state/selectors/selectors.js +111 -0
- package/lib/state/selectors/tooltipSelectors.js +268 -0
- package/lib/state/selectors/touchSelectors.js +25 -0
- package/lib/state/selectors/zoomProjectionSelectors.js +33 -0
- package/lib/state/selectors/zoomSelectors.js +42 -0
- package/lib/state/store.js +111 -0
- package/lib/state/tooltipSlice.js +228 -0
- package/lib/state/touchEventsMiddleware.js +171 -0
- package/lib/state/types/AreaSettings.js +1 -0
- package/lib/state/types/BarSettings.js +1 -0
- package/lib/state/types/LineSettings.js +1 -0
- package/lib/state/types/PieSettings.js +1 -0
- package/lib/state/types/RadarSettings.js +1 -0
- package/lib/state/types/RadialBarSettings.js +1 -0
- package/lib/state/types/ScatterSettings.js +1 -0
- package/lib/state/types/StackedGraphicalItem.js +24 -0
- package/lib/state/zIndexSlice.js +112 -0
- package/lib/state/zoomSettingsSlice.js +50 -0
- package/lib/state/zoomSlice.js +88 -0
- package/lib/synchronisation/syncSelectors.js +9 -0
- package/lib/synchronisation/types.js +1 -0
- package/lib/synchronisation/useChartSynchronisation.js +375 -0
- package/lib/theme/RechartsTheme.js +1 -0
- package/lib/theme/RechartsThemeContext.js +32 -0
- package/lib/theme/activeStyles.js +110 -0
- package/lib/theme/autoTheme.js +156 -0
- package/lib/theme/cssStylesToSvgStyles.js +24 -0
- package/lib/theme/darkTheme.js +146 -0
- package/lib/theme/dataEntryStyles.js +261 -0
- package/lib/theme/emptyTheme.js +20 -0
- package/lib/theme/graphicalItemIdentity.js +36 -0
- package/lib/theme/labelTheme.js +268 -0
- package/lib/theme/lightTheme.js +148 -0
- package/lib/theme/pageBackground.js +27 -0
- package/lib/theme/themeFill.js +103 -0
- package/lib/theme/useBackwardsCompatibleTheme.js +54 -0
- package/lib/theme/useGraphicalItemIdentity.js +74 -0
- package/lib/types.js +1 -0
- package/lib/util/ActiveShapeUtils.js +97 -0
- package/lib/util/BarUtils.js +52 -0
- package/lib/util/CartesianUtils.js +68 -0
- package/lib/util/ChartUtils.js +614 -0
- package/lib/util/Constants.js +22 -0
- package/lib/util/CssPrefixUtils.js +24 -0
- package/lib/util/DOMUtils.js +137 -0
- package/lib/util/DataUtils.js +212 -0
- package/lib/util/Events.js +11 -0
- package/lib/util/FunnelUtils.js +24 -0
- package/lib/util/Global.js +15 -0
- package/lib/util/IfOverflow.js +1 -0
- package/lib/util/LRUCache.js +50 -0
- package/lib/util/LogUtils.js +26 -0
- package/lib/util/PolarUtils.js +136 -0
- package/lib/util/RadialBarUtils.js +36 -0
- package/lib/util/ReactUtils.js +97 -0
- package/lib/util/ReduceCSSCalc.js +198 -0
- package/lib/util/ScatterUtils.js +40 -0
- package/lib/util/TickUtils.js +47 -0
- package/lib/util/XAxisUtils.js +48 -0
- package/lib/util/YAxisUtils.js +48 -0
- package/lib/util/axisPropsAreEqual.js +47 -0
- package/lib/util/clsx.js +61 -0
- package/lib/util/createCartesianCharts.js +134 -0
- package/lib/util/createEventProxy.js +22 -0
- package/lib/util/createPolarCharts.js +118 -0
- package/lib/util/cursor/getCursorPoints.js +49 -0
- package/lib/util/cursor/getCursorRectangle.js +15 -0
- package/lib/util/cursor/getRadialCursorPoints.js +29 -0
- package/lib/util/excludeEventProps.js +14 -0
- package/lib/util/getActiveCoordinate.js +166 -0
- package/lib/util/getAxisTypeBasedOnLayout.js +20 -0
- package/lib/util/getClassNameFromUnknown.js +12 -0
- package/lib/util/getEveryNth.js +33 -0
- package/lib/util/getRadiusAndStrokeWidthFromDot.js +32 -0
- package/lib/util/getRelativeCoordinate.js +101 -0
- package/lib/util/getSliced.js +12 -0
- package/lib/util/isDomainSpecifiedByUser.js +198 -0
- package/lib/util/isWellBehavedNumber.js +13 -0
- package/lib/util/payload/getUniqPayload.js +26 -0
- package/lib/util/propsAreEqual.js +153 -0
- package/lib/util/resolveDefaultProps.js +110 -0
- package/lib/util/round.js +39 -0
- package/lib/util/scale/CartesianScaleHelper.js +65 -0
- package/lib/util/scale/CustomScaleDefinition.js +1 -0
- package/lib/util/scale/RechartsScale.js +73 -0
- package/lib/util/scale/createCategoricalInverse.js +97 -0
- package/lib/util/scale/getNiceTickValues.js +300 -0
- package/lib/util/scale/index.js +18 -0
- package/lib/util/scale/util/arithmetic.js +68 -0
- package/lib/util/stacks/getStackSeriesIdentifier.js +14 -0
- package/lib/util/stacks/stackTypes.js +1 -0
- package/lib/util/svgPropertiesAndEvents.js +57 -0
- package/lib/util/svgPropertiesNoEvents.js +83 -0
- package/lib/util/tooltip/translate.js +141 -0
- package/lib/util/typedDataKey.js +1 -0
- package/lib/util/types.js +416 -0
- package/lib/util/useAnimationId.js +32 -0
- package/lib/util/useCells.js +56 -0
- package/lib/util/useEffectiveDataKey.js +32 -0
- package/lib/util/useElementOffset.js +1 -0
- package/lib/util/useElementSize.js +195 -0
- package/lib/util/useId.js +35 -0
- package/lib/util/usePrefersReducedMotion.js +48 -0
- package/lib/util/useReportScale.js +34 -0
- package/lib/util/useUniqueId.js +37 -0
- package/lib/util/zoom/ZoomOptions.js +57 -0
- package/lib/util/zoom/projection.js +157 -0
- package/lib/util/zoom/transform.js +104 -0
- package/lib/util/zoom/viewport.js +233 -0
- package/lib/util/zoom/viewportWindow.js +176 -0
- package/lib/util/zoom/zoomActions.js +134 -0
- package/lib/zIndex/DefaultZIndexes.js +93 -0
- package/lib/zIndex/StaticZIndexLayers.js +56 -0
- package/lib/zIndex/ZIndexLayer.js +149 -0
- package/lib/zIndex/ZIndexPortal.js +68 -0
- package/lib/zIndex/getZIndexFromUnknown.js +13 -0
- package/lib/zIndex/labelBackgroundZIndex.js +58 -0
- package/lib/zIndex/zIndexSelectors.js +37 -0
- package/package.json +2 -1
- package/types/animation/AnimatedItems.d.ts +105 -0
- package/types/animation/AnimationController.d.ts +29 -0
- package/types/animation/AnimationControllerImpl.d.ts +9 -0
- package/types/animation/AnimationHandle.d.ts +180 -0
- package/types/animation/CSSTransitionAnimate.d.ts +22 -0
- package/types/animation/JavascriptAnimate.d.ts +17 -0
- package/types/animation/easing.d.ts +41 -0
- package/types/animation/matchBy.d.ts +113 -0
- package/types/animation/timeoutController.d.ts +49 -0
- package/types/animation/useAnimationController.d.ts +24 -0
- package/types/animation/useAnimationStartSnapshot.d.ts +56 -0
- package/types/animation/useZoomAwareAnimation.d.ts +63 -0
- package/types/animation/util.d.ts +2 -0
- package/types/cartesian/Area.d.ts +327 -0
- package/types/cartesian/AreaRevealShape.d.ts +35 -0
- package/types/cartesian/Bar.d.ts +406 -0
- package/types/cartesian/BarStack.d.ts +69 -0
- package/types/cartesian/Brush.d.ts +174 -0
- package/types/cartesian/CartesianAxis.d.ts +108 -0
- package/types/cartesian/CartesianGrid.d.ts +218 -0
- package/types/cartesian/ErrorBar.d.ts +126 -0
- package/types/cartesian/Funnel.d.ts +250 -0
- package/types/cartesian/GraphicalItemClipPath.d.ts +28 -0
- package/types/cartesian/Line.d.ts +329 -0
- package/types/cartesian/LineDrawShape.d.ts +50 -0
- package/types/cartesian/ReferenceArea.d.ts +144 -0
- package/types/cartesian/ReferenceDot.d.ts +152 -0
- package/types/cartesian/ReferenceLine.d.ts +160 -0
- package/types/cartesian/Scatter.d.ts +357 -0
- package/types/cartesian/XAxis.d.ts +202 -0
- package/types/cartesian/YAxis.d.ts +213 -0
- package/types/cartesian/ZAxis.d.ts +91 -0
- package/types/cartesian/cartesianPositionToCSSTranslate.d.ts +15 -0
- package/types/cartesian/cartesianViewBoxToTrapezoid.d.ts +3 -0
- package/types/cartesian/getCartesianPosition.d.ts +60 -0
- package/types/cartesian/getEquidistantTicks.d.ts +10 -0
- package/types/cartesian/getTicks.d.ts +15 -0
- package/types/cartesian/useAnimatedLineLength.d.ts +23 -0
- package/types/cartesian/zoomedLineLength.d.ts +38 -0
- package/types/chart/AreaChart.d.ts +11 -0
- package/types/chart/BarChart.d.ts +11 -0
- package/types/chart/CartesianChart.d.ts +29 -0
- package/types/chart/CategoricalChart.d.ts +3 -0
- package/types/chart/ComposedChart.d.ts +11 -0
- package/types/chart/FunnelChart.d.ts +11 -0
- package/types/chart/LineChart.d.ts +11 -0
- package/types/chart/PieChart.d.ts +30 -0
- package/types/chart/PolarChart.d.ts +53 -0
- package/types/chart/RadarChart.d.ts +30 -0
- package/types/chart/RadialBarChart.d.ts +30 -0
- package/types/chart/RechartsWrapper.d.ts +27 -0
- package/types/chart/Sankey.d.ts +289 -0
- package/types/chart/ScatterChart.d.ts +11 -0
- package/types/chart/StaticCartesianChart.d.ts +7 -0
- package/types/chart/SunburstChart.d.ts +185 -0
- package/types/chart/Treemap.d.ts +219 -0
- package/types/chart/types.d.ts +53 -0
- package/types/chart/zoom/SelectionOverlay.d.ts +18 -0
- package/types/chart/zoom/ZoomAndPan.d.ts +119 -0
- package/types/chart/zoom/ZoomGestureApi.d.ts +96 -0
- package/types/chart/zoom/ZoomStateSync.d.ts +25 -0
- package/types/chart/zoom/doubleClickGesture.d.ts +11 -0
- package/types/chart/zoom/keyboardGesture.d.ts +50 -0
- package/types/chart/zoom/pointerGesture.d.ts +27 -0
- package/types/chart/zoom/touchGesture.d.ts +40 -0
- package/types/chart/zoom/useZoomApi.d.ts +18 -0
- package/types/chart/zoom/wheelGesture.d.ts +18 -0
- package/types/component/ActivePoints.d.ts +30 -0
- package/types/component/Cell.d.ts +29 -0
- package/types/component/Cursor.d.ts +27 -0
- package/types/component/Customized.d.ts +34 -0
- package/types/component/DefaultLegendContent.d.ts +189 -0
- package/types/component/DefaultTooltipContent.d.ts +72 -0
- package/types/component/Dots.d.ts +50 -0
- package/types/component/Label.d.ts +203 -0
- package/types/component/LabelList.d.ts +244 -0
- package/types/component/Legend.d.ts +121 -0
- package/types/component/ResponsiveContainer.d.ts +83 -0
- package/types/component/Text.d.ts +262 -0
- package/types/component/Tooltip.d.ts +251 -0
- package/types/component/TooltipBoundingBox.d.ts +26 -0
- package/types/component/responsiveContainerUtils.d.ts +47 -0
- package/types/container/ClipPathProvider.d.ts +16 -0
- package/types/container/Layer.d.ts +21 -0
- package/types/container/RootSurface.d.ts +10 -0
- package/types/container/Surface.d.ts +27 -0
- package/types/context/ErrorBarContext.d.ts +25 -0
- package/types/context/PDFContext.d.ts +2 -0
- package/types/context/PanoramaContext.d.ts +6 -0
- package/types/context/RegisterGraphicalItemId.d.ts +13 -0
- package/types/context/accessibilityContext.d.ts +1 -0
- package/types/context/brushUpdateContext.d.ts +6 -0
- package/types/context/chartDataContext.d.ts +34 -0
- package/types/context/chartLayoutContext.d.ts +126 -0
- package/types/context/legendPayloadContext.d.ts +6 -0
- package/types/context/legendPortalContext.d.ts +2 -0
- package/types/context/tooltipContext.d.ts +15 -0
- package/types/context/tooltipPortalContext.d.ts +2 -0
- package/types/context/useTooltipAxis.d.ts +3 -0
- package/types/fill/RechartsFill.d.ts +286 -0
- package/types/fill/fillDefinitions.d.ts +183 -0
- package/types/fill/symbolPath.d.ts +9 -0
- package/types/hooks.d.ts +458 -0
- package/types/index.d.ts +169 -0
- package/types/polar/Pie.d.ts +398 -0
- package/types/polar/PolarAngleAxis.d.ts +190 -0
- package/types/polar/PolarGrid.d.ts +128 -0
- package/types/polar/PolarRadiusAxis.d.ts +191 -0
- package/types/polar/Radar.d.ts +256 -0
- package/types/polar/RadialBar.d.ts +301 -0
- package/types/polar/defaultPolarAngleAxisProps.d.ts +23 -0
- package/types/polar/defaultPolarRadiusAxisProps.d.ts +20 -0
- package/types/polar/isOutsidePolarPosition.d.ts +13 -0
- package/types/shape/Cross.d.ts +52 -0
- package/types/shape/Curve.d.ts +130 -0
- package/types/shape/Dot.d.ts +45 -0
- package/types/shape/DotSymbol.d.ts +50 -0
- package/types/shape/Polygon.d.ts +87 -0
- package/types/shape/Rectangle.d.ts +138 -0
- package/types/shape/Sector.d.ts +126 -0
- package/types/shape/Symbols.d.ts +48 -0
- package/types/shape/Trapezoid.d.ts +104 -0
- package/types/state/RechartsReduxContext.d.ts +17 -0
- package/types/state/RechartsStoreProvider.d.ts +12 -0
- package/types/state/ReportChartProps.d.ts +2 -0
- package/types/state/ReportEventSettings.d.ts +2 -0
- package/types/state/ReportMainChartProps.d.ts +13 -0
- package/types/state/ReportPolarOptions.d.ts +2 -0
- package/types/state/SetGraphicalItem.d.ts +3 -0
- package/types/state/SetLegendPayload.d.ts +7 -0
- package/types/state/SetTooltipEntrySettings.d.ts +4 -0
- package/types/state/brushSlice.d.ts +18 -0
- package/types/state/cartesianAxisSlice.d.ts +184 -0
- package/types/state/chartDataSlice.d.ts +55 -0
- package/types/state/errorBarSlice.d.ts +34 -0
- package/types/state/eventSettingsSlice.d.ts +6 -0
- package/types/state/externalEventsMiddleware.d.ts +20 -0
- package/types/state/graphicalItemsSlice.d.ts +84 -0
- package/types/state/hooks.d.ts +27 -0
- package/types/state/keyboardEventsMiddleware.d.ts +6 -0
- package/types/state/keyboardTooltipVisibility.d.ts +21 -0
- package/types/state/layoutSlice.d.ts +16 -0
- package/types/state/legendSlice.d.ts +38 -0
- package/types/state/mouseEventsMiddleware.d.ts +15 -0
- package/types/state/optionsSlice.d.ts +28 -0
- package/types/state/polarAxisSlice.d.ts +11 -0
- package/types/state/polarOptionsSlice.d.ts +13 -0
- package/types/state/reduxDevtoolsJsonStringifyReplacer.d.ts +1 -0
- package/types/state/referenceElementsSlice.d.ts +42 -0
- package/types/state/renderedTicksSlice.d.ts +41 -0
- package/types/state/rootPropsSlice.d.ts +35 -0
- package/types/state/selectors/areaSelectors.d.ts +20 -0
- package/types/state/selectors/arrayEqualityCheck.d.ts +13 -0
- package/types/state/selectors/axisSelectors.d.ts +284 -0
- package/types/state/selectors/barSelectors.d.ts +52 -0
- package/types/state/selectors/barStackSelectors.d.ts +31 -0
- package/types/state/selectors/brushSelectors.d.ts +10 -0
- package/types/state/selectors/combiners/combineActiveLabel.d.ts +4 -0
- package/types/state/selectors/combiners/combineActiveTooltipIndex.d.ts +4 -0
- package/types/state/selectors/combiners/combineAllBarPositions.d.ts +2 -0
- package/types/state/selectors/combiners/combineAxisRangeWithReverse.d.ts +3 -0
- package/types/state/selectors/combiners/combineBarPosition.d.ts +4 -0
- package/types/state/selectors/combiners/combineBarSizeList.d.ts +21 -0
- package/types/state/selectors/combiners/combineCheckedDomain.d.ts +5 -0
- package/types/state/selectors/combiners/combineConfiguredScale.d.ts +16 -0
- package/types/state/selectors/combiners/combineCoordinateForDefaultIndex.d.ts +3 -0
- package/types/state/selectors/combiners/combineDisplayedStackedData.d.ts +17 -0
- package/types/state/selectors/combiners/combineInverseScaleFunction.d.ts +3 -0
- package/types/state/selectors/combiners/combinePlaceTooltipIndex.d.ts +28 -0
- package/types/state/selectors/combiners/combineRealScaleType.d.ts +3 -0
- package/types/state/selectors/combiners/combineStackedData.d.ts +3 -0
- package/types/state/selectors/combiners/combineTooltipInteractionState.d.ts +5 -0
- package/types/state/selectors/combiners/combineTooltipPayload.d.ts +5 -0
- package/types/state/selectors/combiners/combineTooltipPayloadConfigurations.d.ts +4 -0
- package/types/state/selectors/containerSelectors.d.ts +6 -0
- package/types/state/selectors/dataSelectors.d.ts +42 -0
- package/types/state/selectors/effectiveDataKeySelectors.d.ts +55 -0
- package/types/state/selectors/funnelSelectors.d.ts +35 -0
- package/types/state/selectors/graphicalItemSelectors.d.ts +6 -0
- package/types/state/selectors/legendSelectors.d.ts +7 -0
- package/types/state/selectors/lineSelectors.d.ts +5 -0
- package/types/state/selectors/numberDomainEqualityCheck.d.ts +2 -0
- package/types/state/selectors/pickAxisId.d.ts +3 -0
- package/types/state/selectors/pickAxisType.d.ts +2 -0
- package/types/state/selectors/pieSelectors.d.ts +9 -0
- package/types/state/selectors/polarAxisSelectors.d.ts +22 -0
- package/types/state/selectors/polarGridSelectors.d.ts +6 -0
- package/types/state/selectors/polarScaleSelectors.d.ts +10 -0
- package/types/state/selectors/polarSelectors.d.ts +42 -0
- package/types/state/selectors/radarSelectors.d.ts +9 -0
- package/types/state/selectors/radialBarSelectors.d.ts +22 -0
- package/types/state/selectors/rootPropsSelectors.d.ts +15 -0
- package/types/state/selectors/scatterSelectors.d.ts +7 -0
- package/types/state/selectors/selectActivePropsFromChartPointer.d.ts +4 -0
- package/types/state/selectors/selectAllAxes.d.ts +4 -0
- package/types/state/selectors/selectChartOffset.d.ts +23 -0
- package/types/state/selectors/selectChartOffsetInternal.d.ts +56 -0
- package/types/state/selectors/selectLegendArea.d.ts +3 -0
- package/types/state/selectors/selectPlotArea.d.ts +61 -0
- package/types/state/selectors/selectTooltipAxisId.d.ts +3 -0
- package/types/state/selectors/selectTooltipAxisType.d.ts +10 -0
- package/types/state/selectors/selectTooltipEventType.d.ts +8 -0
- package/types/state/selectors/selectTooltipPayloadSearcher.d.ts +3 -0
- package/types/state/selectors/selectTooltipSettings.d.ts +3 -0
- package/types/state/selectors/selectTooltipState.d.ts +3 -0
- package/types/state/selectors/selectors.d.ts +40 -0
- package/types/state/selectors/tooltipSelectors.d.ts +92 -0
- package/types/state/selectors/touchSelectors.d.ts +5 -0
- package/types/state/selectors/zoomProjectionSelectors.d.ts +12 -0
- package/types/state/selectors/zoomSelectors.d.ts +28 -0
- package/types/state/store.d.ts +41 -0
- package/types/state/tooltipSlice.d.ts +330 -0
- package/types/state/touchEventsMiddleware.d.ts +15 -0
- package/types/state/types/AreaSettings.d.ts +12 -0
- package/types/state/types/BarSettings.d.ts +17 -0
- package/types/state/types/LineSettings.d.ts +8 -0
- package/types/state/types/PieSettings.d.ts +26 -0
- package/types/state/types/RadarSettings.d.ts +4 -0
- package/types/state/types/RadialBarSettings.d.ts +8 -0
- package/types/state/types/ScatterSettings.d.ts +11 -0
- package/types/state/types/StackedGraphicalItem.d.ts +29 -0
- package/types/state/zIndexSlice.d.ts +50 -0
- package/types/state/zoomSettingsSlice.d.ts +23 -0
- package/types/state/zoomSlice.d.ts +38 -0
- package/types/synchronisation/syncSelectors.d.ts +3 -0
- package/types/synchronisation/types.d.ts +42 -0
- package/types/synchronisation/useChartSynchronisation.d.ts +39 -0
- package/types/theme/RechartsTheme.d.ts +293 -0
- package/types/theme/RechartsThemeContext.d.ts +22 -0
- package/types/theme/activeStyles.d.ts +55 -0
- package/types/theme/autoTheme.d.ts +48 -0
- package/types/theme/cssStylesToSvgStyles.d.ts +7 -0
- package/types/theme/darkTheme.d.ts +38 -0
- package/types/theme/dataEntryStyles.d.ts +114 -0
- package/types/theme/emptyTheme.d.ts +13 -0
- package/types/theme/graphicalItemIdentity.d.ts +25 -0
- package/types/theme/labelTheme.d.ts +139 -0
- package/types/theme/lightTheme.d.ts +40 -0
- package/types/theme/pageBackground.d.ts +12 -0
- package/types/theme/themeFill.d.ts +43 -0
- package/types/theme/useBackwardsCompatibleTheme.d.ts +15 -0
- package/types/theme/useGraphicalItemIdentity.d.ts +29 -0
- package/types/types.d.ts +55 -0
- package/types/util/ActiveShapeUtils.d.ts +56 -0
- package/types/util/BarUtils.d.ts +24 -0
- package/types/util/CartesianUtils.d.ts +18 -0
- package/types/util/ChartUtils.d.ts +152 -0
- package/types/util/Constants.d.ts +14 -0
- package/types/util/CssPrefixUtils.d.ts +1 -0
- package/types/util/DOMUtils.d.ts +33 -0
- package/types/util/DataUtils.d.ts +96 -0
- package/types/util/Events.d.ts +12 -0
- package/types/util/FunnelUtils.d.ts +9 -0
- package/types/util/Global.d.ts +7 -0
- package/types/util/IfOverflow.d.ts +17 -0
- package/types/util/LRUCache.d.ts +12 -0
- package/types/util/LogUtils.d.ts +1 -0
- package/types/util/PolarUtils.d.ts +7 -0
- package/types/util/RadialBarUtils.d.ts +17 -0
- package/types/util/ReactUtils.d.ts +30 -0
- package/types/util/ReduceCSSCalc.d.ts +2 -0
- package/types/util/ScatterUtils.d.ts +17 -0
- package/types/util/TickUtils.d.ts +8 -0
- package/types/util/XAxisUtils.d.ts +19 -0
- package/types/util/YAxisUtils.d.ts +19 -0
- package/types/util/axisPropsAreEqual.d.ts +10 -0
- package/types/util/clsx.d.ts +26 -0
- package/types/util/createCartesianCharts.d.ts +111 -0
- package/types/util/createEventProxy.d.ts +2 -0
- package/types/util/createPolarCharts.d.ts +98 -0
- package/types/util/cursor/getCursorPoints.d.ts +3 -0
- package/types/util/cursor/getCursorRectangle.d.ts +8 -0
- package/types/util/cursor/getRadialCursorPoints.d.ts +15 -0
- package/types/util/excludeEventProps.d.ts +4 -0
- package/types/util/getActiveCoordinate.d.ts +26 -0
- package/types/util/getAxisTypeBasedOnLayout.d.ts +6 -0
- package/types/util/getClassNameFromUnknown.d.ts +1 -0
- package/types/util/getEveryNth.d.ts +12 -0
- package/types/util/getRadiusAndStrokeWidthFromDot.d.ts +5 -0
- package/types/util/getRelativeCoordinate.d.ts +57 -0
- package/types/util/getSliced.d.ts +1 -0
- package/types/util/isDomainSpecifiedByUser.d.ts +47 -0
- package/types/util/isWellBehavedNumber.d.ts +2 -0
- package/types/util/payload/getUniqPayload.d.ts +12 -0
- package/types/util/propsAreEqual.d.ts +23 -0
- package/types/util/resolveDefaultProps.d.ts +59 -0
- package/types/util/round.d.ts +7 -0
- package/types/util/scale/CartesianScaleHelper.d.ts +43 -0
- package/types/util/scale/CustomScaleDefinition.d.ts +72 -0
- package/types/util/scale/RechartsScale.d.ts +75 -0
- package/types/util/scale/createCategoricalInverse.d.ts +18 -0
- package/types/util/scale/getNiceTickValues.d.ts +88 -0
- package/types/util/scale/index.d.ts +1 -0
- package/types/util/scale/util/arithmetic.d.ts +27 -0
- package/types/util/stacks/getStackSeriesIdentifier.d.ts +5 -0
- package/types/util/stacks/stackTypes.d.ts +42 -0
- package/types/util/svgPropertiesAndEvents.d.ts +28 -0
- package/types/util/svgPropertiesNoEvents.d.ts +34 -0
- package/types/util/tooltip/translate.d.ts +41 -0
- package/types/util/typedDataKey.d.ts +16 -0
- package/types/util/types.d.ts +1605 -0
- package/types/util/useAnimationId.d.ts +15 -0
- package/types/util/useCells.d.ts +20 -0
- package/types/util/useEffectiveDataKey.d.ts +12 -0
- package/types/util/useElementOffset.d.ts +24 -0
- package/types/util/useElementSize.d.ts +85 -0
- package/types/util/useId.d.ts +8 -0
- package/types/util/usePrefersReducedMotion.d.ts +6 -0
- package/types/util/useReportScale.d.ts +1 -0
- package/types/util/useUniqueId.d.ts +19 -0
- package/types/util/zoom/ZoomOptions.d.ts +30 -0
- package/types/util/zoom/projection.d.ts +39 -0
- package/types/util/zoom/transform.d.ts +27 -0
- package/types/util/zoom/viewport.d.ts +120 -0
- package/types/util/zoom/viewportWindow.d.ts +36 -0
- package/types/util/zoom/zoomActions.d.ts +52 -0
- package/types/zIndex/DefaultZIndexes.d.ts +82 -0
- package/types/zIndex/StaticZIndexLayers.d.ts +9 -0
- package/types/zIndex/ZIndexLayer.d.ts +49 -0
- package/types/zIndex/ZIndexPortal.d.ts +5 -0
- package/types/zIndex/getZIndexFromUnknown.d.ts +1 -0
- package/types/zIndex/labelBackgroundZIndex.d.ts +17 -0
- package/types/zIndex/zIndexSelectors.d.ts +41 -0
- package/umd/Recharts.js +3 -0
- package/umd/Recharts.js.LICENSE.txt +44 -0
- package/umd/Recharts.js.map +1 -0
- package/umd/report.html +95 -0
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
2
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
4
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
5
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
7
|
+
import * as React from 'react';
|
|
8
|
+
import { useCallback, useState } from 'react';
|
|
9
|
+
import { JavascriptAnimate } from './JavascriptAnimate';
|
|
10
|
+
import { useAnimationId } from '../util/useAnimationId';
|
|
11
|
+
import { matchAnimationItems, matchByIndex } from './matchBy';
|
|
12
|
+
import { useAnimationStartSnapshot } from './useAnimationStartSnapshot';
|
|
13
|
+
/**
|
|
14
|
+
* Hook that tracks animation state and provides callbacks for animation start/end.
|
|
15
|
+
*
|
|
16
|
+
* @param onAnimationStart optional callback to call when animation starts
|
|
17
|
+
* @param onAnimationEnd optional callback to call when animation ends
|
|
18
|
+
*/
|
|
19
|
+
export function useAnimationCallbacks(onAnimationStart, onAnimationEnd) {
|
|
20
|
+
var _useState = useState(false),
|
|
21
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
22
|
+
isAnimating = _useState2[0],
|
|
23
|
+
setIsAnimating = _useState2[1];
|
|
24
|
+
var handleAnimationStart = useCallback(() => {
|
|
25
|
+
if (typeof onAnimationStart === 'function') {
|
|
26
|
+
onAnimationStart();
|
|
27
|
+
}
|
|
28
|
+
setIsAnimating(true);
|
|
29
|
+
}, [onAnimationStart]);
|
|
30
|
+
var handleAnimationEnd = useCallback(() => {
|
|
31
|
+
if (typeof onAnimationEnd === 'function') {
|
|
32
|
+
onAnimationEnd();
|
|
33
|
+
}
|
|
34
|
+
setIsAnimating(false);
|
|
35
|
+
}, [onAnimationEnd]);
|
|
36
|
+
return {
|
|
37
|
+
isAnimating,
|
|
38
|
+
handleAnimationStart,
|
|
39
|
+
handleAnimationEnd
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* A function that interpolates animation items at a given time.
|
|
45
|
+
* This function receives an array of changes, and must "unwrap" them
|
|
46
|
+
* and interpolate appropriate values and return the result which Recharts will then render.
|
|
47
|
+
*
|
|
48
|
+
* @see {@link https://recharts.github.io/en-US/guide/animations/ Animations guide}
|
|
49
|
+
*
|
|
50
|
+
* @param items The tagged animation items describing what changed, or `null` on the very first render
|
|
51
|
+
* (entrance animation). Each item is self-describing:
|
|
52
|
+
* - `{ status: 'matched', prev, next }` — interpolate between `prev` and `next`
|
|
53
|
+
* - `{ status: 'added', next }` — animate in from a computed entry position
|
|
54
|
+
* - `{ status: 'removed', prev }` — animate out to a computed exit position
|
|
55
|
+
*
|
|
56
|
+
* At `animationElapsedTime = 1`, removed items should be excluded from the result.
|
|
57
|
+
*
|
|
58
|
+
* @param animationElapsedTime A normalized time value (0 = start, 1 = end)
|
|
59
|
+
* @param layout of the chart, useful for deciding the direction of animation
|
|
60
|
+
* @returns The interpolated items at time animationElapsedTime
|
|
61
|
+
*
|
|
62
|
+
* @since 3.9
|
|
63
|
+
* @public
|
|
64
|
+
*/
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* A reusable animation wrapper for array-based chart data.
|
|
68
|
+
*
|
|
69
|
+
* Encapsulates the common animation pattern shared by Bar, Scatter, Funnel, Pie,
|
|
70
|
+
* Radar, RadialBar, Area, and Line:
|
|
71
|
+
* 1. Track previous items in a ref
|
|
72
|
+
* 2. Wrap in JavascriptAnimate
|
|
73
|
+
* 3. Update ref when animationElapsedTime > 0
|
|
74
|
+
*
|
|
75
|
+
* @since 3.9
|
|
76
|
+
*/
|
|
77
|
+
export function AnimatedItems(props) {
|
|
78
|
+
var _animationStartItems$;
|
|
79
|
+
var animationInput = props.animationInput,
|
|
80
|
+
animationIdPrefix = props.animationIdPrefix,
|
|
81
|
+
items = props.items,
|
|
82
|
+
previousItemsRef = props.previousItemsRef,
|
|
83
|
+
isAnimationActive = props.isAnimationActive,
|
|
84
|
+
animationBegin = props.animationBegin,
|
|
85
|
+
animationDuration = props.animationDuration,
|
|
86
|
+
animationEasing = props.animationEasing,
|
|
87
|
+
onAnimationStart = props.onAnimationStart,
|
|
88
|
+
onAnimationEnd = props.onAnimationEnd,
|
|
89
|
+
animationInterpolateFn = props.animationInterpolateFn,
|
|
90
|
+
animationMatchBy = props.animationMatchBy,
|
|
91
|
+
shouldUpdatePreviousRef = props.shouldUpdatePreviousRef,
|
|
92
|
+
children = props.children,
|
|
93
|
+
layout = props.layout;
|
|
94
|
+
var animationId = useAnimationId(animationInput, animationIdPrefix);
|
|
95
|
+
var animationStartItems = useAnimationStartSnapshot(animationId, previousItemsRef);
|
|
96
|
+
var rawPrevItems = (_animationStartItems$ = animationStartItems.startValue) !== null && _animationStartItems$ !== void 0 ? _animationStartItems$ : null;
|
|
97
|
+
var animationItems = matchAnimationItems(rawPrevItems, items, animationMatchBy !== null && animationMatchBy !== void 0 ? animationMatchBy : matchByIndex);
|
|
98
|
+
return /*#__PURE__*/React.createElement(JavascriptAnimate, {
|
|
99
|
+
animationId: animationId,
|
|
100
|
+
begin: animationBegin,
|
|
101
|
+
duration: animationDuration,
|
|
102
|
+
isActive: isAnimationActive,
|
|
103
|
+
easing: animationEasing,
|
|
104
|
+
onAnimationEnd: onAnimationEnd,
|
|
105
|
+
onAnimationStart: onAnimationStart,
|
|
106
|
+
key: animationId
|
|
107
|
+
}, animationElapsedTime => {
|
|
108
|
+
var isEntrance = rawPrevItems == null;
|
|
109
|
+
var stepData = items == null ? items : animationInterpolateFn(animationItems, animationElapsedTime, layout);
|
|
110
|
+
var canUpdate = shouldUpdatePreviousRef ? shouldUpdatePreviousRef(animationElapsedTime) : animationElapsedTime > 0;
|
|
111
|
+
animationStartItems.syncStepValue(stepData, animationElapsedTime, canUpdate);
|
|
112
|
+
if (stepData == null) {
|
|
113
|
+
return null;
|
|
114
|
+
}
|
|
115
|
+
return children(stepData, animationElapsedTime, isEntrance);
|
|
116
|
+
});
|
|
117
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* JavaScript animations require trigger and repaint as soon as possible,
|
|
3
|
+
* so this class uses the timeoutController to trigger updates as quickly as the controller allows.
|
|
4
|
+
*
|
|
5
|
+
* JavaScript animation progress is represented as a stream of values. The exact type depends on the animationHandle type.
|
|
6
|
+
* Each individual consumer is then responsible for mapping those values onto a React component.
|
|
7
|
+
*/
|
|
8
|
+
export var animationControllerImpl = (timeoutController, animationHandle, listener) => {
|
|
9
|
+
var cancellable;
|
|
10
|
+
var nextUpdate = now => {
|
|
11
|
+
var timeRemaining = animationHandle.tick(now);
|
|
12
|
+
if (animationHandle.getState() === 'active') {
|
|
13
|
+
listener(animationHandle.getInterpolated());
|
|
14
|
+
if (animationHandle.getProgress() === 1) {
|
|
15
|
+
animationHandle.complete();
|
|
16
|
+
cancellable = undefined;
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
cancellable = timeoutController.setTimeout(nextUpdate, timeRemaining);
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
cancellable = timeoutController.setTimeout(nextUpdate, timeRemaining);
|
|
23
|
+
};
|
|
24
|
+
cancellable = timeoutController.setTimeout(nextUpdate, 0);
|
|
25
|
+
return () => {
|
|
26
|
+
var _cancellable;
|
|
27
|
+
return (_cancellable = cancellable) === null || _cancellable === void 0 ? void 0 : _cancellable();
|
|
28
|
+
};
|
|
29
|
+
};
|
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
2
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
3
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
4
|
+
/* eslint-disable max-classes-per-file */
|
|
5
|
+
import { interpolate } from '../util/DataUtils';
|
|
6
|
+
var INIT = 'init';
|
|
7
|
+
var PENDING = 'pending';
|
|
8
|
+
var ACTIVE = 'active';
|
|
9
|
+
var COMPLETED = 'completed';
|
|
10
|
+
function duration(time) {
|
|
11
|
+
return Math.max(0, time);
|
|
12
|
+
}
|
|
13
|
+
class RechartsAnimation {
|
|
14
|
+
/**
|
|
15
|
+
* Returns the absolute time after the animationBegin delay has been completed,
|
|
16
|
+
* and when the animationDuration started ticking.
|
|
17
|
+
*/
|
|
18
|
+
getAnimationStartedTime() {
|
|
19
|
+
return this.animationStartedTime;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Returns the absolute time of when the animation began - now it will wait for {animationBegin} ms before the transition starts
|
|
24
|
+
*/
|
|
25
|
+
getBeginStartedTime() {
|
|
26
|
+
return this.beginStartedTime;
|
|
27
|
+
}
|
|
28
|
+
constructor(param) {
|
|
29
|
+
var _param$onAnimationSta;
|
|
30
|
+
_defineProperty(this, "state", INIT);
|
|
31
|
+
this.animationId = param.animationId;
|
|
32
|
+
this.onAnimationEnd = param.onAnimationEnd;
|
|
33
|
+
this.animationDuration = duration(param.animationDuration);
|
|
34
|
+
this.animationBegin = duration(param.animationBegin);
|
|
35
|
+
this.progress = 0;
|
|
36
|
+
this.from = param.from;
|
|
37
|
+
this.to = param.to;
|
|
38
|
+
this.easing = param.easing;
|
|
39
|
+
// Mimic what the previous animationManager was doing - call onAnimationStart immediately and synchronously
|
|
40
|
+
(_param$onAnimationSta = param.onAnimationStart) === null || _param$onAnimationSta === void 0 || _param$onAnimationSta.call(param);
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Returns the state machine current state
|
|
44
|
+
* - `init`: animation had just been created. It immediately calls `onAnimationStart`
|
|
45
|
+
* - `pending`: animation is now paused for `animationBegin` milliseconds until the transition begins
|
|
46
|
+
* - `active`: animation is transitioning items on screen
|
|
47
|
+
* - `completed`: animation has completed its transition and executed `onAnimationEnd`.
|
|
48
|
+
* This state is final and the animation is no longer allowed to transition to other states.
|
|
49
|
+
*/
|
|
50
|
+
getState() {
|
|
51
|
+
return this.state;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Returns the easing input or function
|
|
56
|
+
*/
|
|
57
|
+
getEasing() {
|
|
58
|
+
return this.easing;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Returns the configuration - the duration of the transition.
|
|
63
|
+
* Does not change in time, does not change when state changes, this is a static value.
|
|
64
|
+
*/
|
|
65
|
+
getAnimationDuration() {
|
|
66
|
+
return this.animationDuration;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Sets the current time of the animation. The animation sets its internal state and progress accordingly.
|
|
71
|
+
* This is current, absolute time; not additive!
|
|
72
|
+
* This allows you to essentially "travel back in time" based on the value you pass in here.
|
|
73
|
+
*
|
|
74
|
+
* Returns the (relative) time remaining until the current activity is over.
|
|
75
|
+
* Meaning: if the state is in a middle of a delay, returns the time left until the delay is finished.
|
|
76
|
+
* If the state is in the middle of a transition, returns time left until that transition is complete.
|
|
77
|
+
* This is useful because it's the same number you can take and put into setTimeout(fn, X)
|
|
78
|
+
* as that's how much time we need to wait until the next state transition happens.
|
|
79
|
+
*/
|
|
80
|
+
tick(now) {
|
|
81
|
+
if (this.getState() === INIT) {
|
|
82
|
+
this.state = PENDING;
|
|
83
|
+
this.beginStartedTime = now;
|
|
84
|
+
return this.animationBegin;
|
|
85
|
+
}
|
|
86
|
+
if (this.getState() === PENDING) {
|
|
87
|
+
if (this.beginStartedTime == null) {
|
|
88
|
+
throw new Error();
|
|
89
|
+
}
|
|
90
|
+
var _timeElapsed = now - this.beginStartedTime;
|
|
91
|
+
if (_timeElapsed >= this.animationBegin) {
|
|
92
|
+
this.state = ACTIVE;
|
|
93
|
+
this.animationStartedTime = now;
|
|
94
|
+
// The state flipped just now so the elapsed time is zero
|
|
95
|
+
return this.nextAnimationUpdate(0);
|
|
96
|
+
}
|
|
97
|
+
return duration(this.animationBegin - _timeElapsed);
|
|
98
|
+
}
|
|
99
|
+
if (this.getState() === ACTIVE) {
|
|
100
|
+
if (this.animationStartedTime == null) {
|
|
101
|
+
throw new Error();
|
|
102
|
+
}
|
|
103
|
+
var _timeElapsed2 = now - this.animationStartedTime;
|
|
104
|
+
this.setProgress(_timeElapsed2 / this.animationDuration);
|
|
105
|
+
return this.nextAnimationUpdate(_timeElapsed2);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// state === COMPLETED, nothing interesting is going to happen
|
|
109
|
+
return 0;
|
|
110
|
+
}
|
|
111
|
+
setProgress(newProgress) {
|
|
112
|
+
this.progress = Math.min(1, Math.max(0, newProgress));
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Returns an abstract "progress" which is number between 0 and 1 which shows the distance of transition.
|
|
117
|
+
* This progress depends on the animation state:
|
|
118
|
+
* - `init`: 0
|
|
119
|
+
* - `pending`: 0
|
|
120
|
+
* - `active`: transitioning between [0, 1] based on the time elapsed
|
|
121
|
+
* - `completed`: 1
|
|
122
|
+
*
|
|
123
|
+
* The progress is hard-capped to be between 0 and 1 (inclusive) to avoid overshooting caused by coarse timers.
|
|
124
|
+
* For this reason, the easing function must be applied _after_ this animation state,
|
|
125
|
+
* so that one has a chance to construct dynamic "overshoot" animations.
|
|
126
|
+
*
|
|
127
|
+
* The progress is linear with time.
|
|
128
|
+
* If you wish for easing, use `getInterpolated()` instead.
|
|
129
|
+
*/
|
|
130
|
+
getProgress() {
|
|
131
|
+
return this.progress;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Completes the animation. Completed animation:
|
|
136
|
+
* - cannot be manipulated anymore
|
|
137
|
+
* - its progress is set to 1
|
|
138
|
+
* - tick function doesn't do anything
|
|
139
|
+
* - getState() always returns 'completed'
|
|
140
|
+
*/
|
|
141
|
+
complete() {
|
|
142
|
+
this.progress = 1;
|
|
143
|
+
if (this.state === 'active') {
|
|
144
|
+
var _this$onAnimationEnd;
|
|
145
|
+
// Do not call callbacks if the animation was interrupted before it even started!
|
|
146
|
+
(_this$onAnimationEnd = this.onAnimationEnd) === null || _this$onAnimationEnd === void 0 || _this$onAnimationEnd.call(this);
|
|
147
|
+
}
|
|
148
|
+
this.state = COMPLETED;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Returns the starting value of the animation.
|
|
153
|
+
* Does not include progress, easing, interpolation, none of that - just the static starting value
|
|
154
|
+
*/
|
|
155
|
+
getFrom() {
|
|
156
|
+
return this.from;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Returns the end value of the animation.
|
|
161
|
+
* Does not include progress, easing, interpolation, none of that - just the static end value
|
|
162
|
+
*/
|
|
163
|
+
getTo() {
|
|
164
|
+
return this.to;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Unique identifier of an animation
|
|
169
|
+
*/
|
|
170
|
+
getAnimationId() {
|
|
171
|
+
return this.animationId;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Returns the configuration - the duration of delay in between animation initialization, and transition.
|
|
176
|
+
* Does not change in time, does not change when state changes, this is a static value.
|
|
177
|
+
*/
|
|
178
|
+
getAnimationBegin() {
|
|
179
|
+
return this.animationBegin;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Returns value of the transition at the current time.
|
|
184
|
+
* The exact details differ based on the animation type
|
|
185
|
+
*/
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* Returns the duration of time of when the controller should ask for the next update
|
|
189
|
+
*/
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* Animation handle representing a Javascript-based animation.
|
|
194
|
+
* This animation requires one render cycle for each frame, and it calls setTimeout as quickly as possible
|
|
195
|
+
*
|
|
196
|
+
* @since 3.9
|
|
197
|
+
* @public
|
|
198
|
+
*/
|
|
199
|
+
export class JavascriptAnimation extends RechartsAnimation {
|
|
200
|
+
// eslint-disable-next-line class-methods-use-this
|
|
201
|
+
nextAnimationUpdate() {
|
|
202
|
+
/*
|
|
203
|
+
* JavaScript-based animations have to update as soon as possible,
|
|
204
|
+
* so we return 0 here to indicate that the next update should be scheduled immediately
|
|
205
|
+
* and it should trigger render on every occasion.
|
|
206
|
+
*/
|
|
207
|
+
return 0;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* Returns value of the animation after its easing function had been applied.
|
|
212
|
+
* This value, unlike getProgress(), can escape the [0..1] range
|
|
213
|
+
* because this is entirely within the easing function control. Spring typically does this.
|
|
214
|
+
*/
|
|
215
|
+
getInterpolated() {
|
|
216
|
+
return this.easing(interpolate(this.getFrom(), this.getTo(), this.getProgress()));
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* Animation handle representing a CSS transition.
|
|
222
|
+
* This animation requires only one render, and the actual transition is then handled by the browser.
|
|
223
|
+
*
|
|
224
|
+
* @since 3.9
|
|
225
|
+
* @public
|
|
226
|
+
*/
|
|
227
|
+
export class CSSTransitionAnimation extends RechartsAnimation {
|
|
228
|
+
nextAnimationUpdate(timeElapsed) {
|
|
229
|
+
/**
|
|
230
|
+
* CSS transitions do not need DOM updates past the initial render
|
|
231
|
+
* so here we just instruct the controller to wait until the animation duration is over.
|
|
232
|
+
*/
|
|
233
|
+
return duration(this.animationDuration - timeElapsed);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* Returns the final value of the animation (the `to`).
|
|
238
|
+
*
|
|
239
|
+
* CSS transitions leave both interpolation and easing to the browser,
|
|
240
|
+
* so all we need to do here is return the final state
|
|
241
|
+
* and let browser handle the rest.
|
|
242
|
+
*/
|
|
243
|
+
getInterpolated() {
|
|
244
|
+
return this.getTo();
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* Recharts animation state machine.
|
|
250
|
+
*
|
|
251
|
+
* Possible transitions are:
|
|
252
|
+
* - `init`: starting state - `onAnimationStart` executes
|
|
253
|
+
* - `init` to `pending` - `animationBegin` duration begins
|
|
254
|
+
* - `pending` to `active` - `animationDuration` duration begins, timer ticks decide the progress
|
|
255
|
+
* - `active` to `completed` - `onAnimationEnd` executes
|
|
256
|
+
*
|
|
257
|
+
* The state always moves in this direction, cannot move backwards.
|
|
258
|
+
*
|
|
259
|
+
* The animation queue is static and consists of four elements:
|
|
260
|
+
* - `onAnimationStart`: function that is called when the animation is created
|
|
261
|
+
* - `animationBegin`: delay between `onAnimationStart` and the transition
|
|
262
|
+
* - the transition itself, takes `animationDuration` ms to finish
|
|
263
|
+
* - `onAnimationEnd`: function that is called when the animation is moving from `active` to `completed`
|
|
264
|
+
*
|
|
265
|
+
* @see {@link https://recharts.github.io/en-US/guide/animations/ Animation guide}
|
|
266
|
+
*
|
|
267
|
+
* @since 3.9
|
|
268
|
+
* @public
|
|
269
|
+
*/
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
2
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
4
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
5
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
7
|
+
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
8
|
+
import { noop } from '../util/DataUtils';
|
|
9
|
+
import { resolveDefaultProps } from '../util/resolveDefaultProps';
|
|
10
|
+
import { useAnimationController } from './useAnimationController';
|
|
11
|
+
import { getTransitionVal } from './util';
|
|
12
|
+
import { Global } from '../util/Global';
|
|
13
|
+
import { usePrefersReducedMotion } from '../util/usePrefersReducedMotion';
|
|
14
|
+
import { CSSTransitionAnimation } from './AnimationHandle';
|
|
15
|
+
import { RequestAnimationFrameTimeoutController } from './timeoutController';
|
|
16
|
+
var defaultProps = {
|
|
17
|
+
begin: 0,
|
|
18
|
+
duration: 1000,
|
|
19
|
+
easing: 'ease',
|
|
20
|
+
isActive: true,
|
|
21
|
+
canBegin: true,
|
|
22
|
+
onAnimationEnd: () => {},
|
|
23
|
+
onAnimationStart: () => {}
|
|
24
|
+
};
|
|
25
|
+
export function extractCssEasing(easingInput) {
|
|
26
|
+
if (easingInput === 'spring' || typeof easingInput !== 'string') {
|
|
27
|
+
return undefined;
|
|
28
|
+
}
|
|
29
|
+
return easingInput;
|
|
30
|
+
}
|
|
31
|
+
export function CSSTransitionAnimate(outsideProps) {
|
|
32
|
+
var props = resolveDefaultProps(outsideProps, defaultProps);
|
|
33
|
+
var animationId = props.animationId,
|
|
34
|
+
from = props.from,
|
|
35
|
+
to = props.to,
|
|
36
|
+
attributeName = props.attributeName,
|
|
37
|
+
isActiveProp = props.isActive,
|
|
38
|
+
canBegin = props.canBegin,
|
|
39
|
+
duration = props.duration,
|
|
40
|
+
easing = props.easing,
|
|
41
|
+
begin = props.begin,
|
|
42
|
+
onAnimationEnd = props.onAnimationEnd,
|
|
43
|
+
onAnimationStartFromProps = props.onAnimationStart,
|
|
44
|
+
children = props.children;
|
|
45
|
+
var prefersReducedMotion = usePrefersReducedMotion();
|
|
46
|
+
var isActive = isActiveProp === 'auto' ? !Global.isSsr && !prefersReducedMotion : isActiveProp;
|
|
47
|
+
var animationController = useAnimationController(props.animationController);
|
|
48
|
+
var _useState = useState(() => {
|
|
49
|
+
if (!isActive) {
|
|
50
|
+
return to;
|
|
51
|
+
}
|
|
52
|
+
return from;
|
|
53
|
+
}),
|
|
54
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
55
|
+
style = _useState2[0],
|
|
56
|
+
setStyle = _useState2[1];
|
|
57
|
+
var initialized = useRef(false);
|
|
58
|
+
var onAnimationStart = useCallback(() => {
|
|
59
|
+
setStyle(from);
|
|
60
|
+
onAnimationStartFromProps();
|
|
61
|
+
}, [from, onAnimationStartFromProps]);
|
|
62
|
+
useEffect(() => {
|
|
63
|
+
if (!isActive || !canBegin) {
|
|
64
|
+
return noop;
|
|
65
|
+
}
|
|
66
|
+
initialized.current = true;
|
|
67
|
+
var timeoutController = new RequestAnimationFrameTimeoutController();
|
|
68
|
+
var animation = new CSSTransitionAnimation({
|
|
69
|
+
animationId: animationId + attributeName,
|
|
70
|
+
easing,
|
|
71
|
+
animationDuration: duration,
|
|
72
|
+
animationBegin: begin,
|
|
73
|
+
onAnimationStart,
|
|
74
|
+
onAnimationEnd,
|
|
75
|
+
from,
|
|
76
|
+
to
|
|
77
|
+
});
|
|
78
|
+
return animationController(timeoutController, animation, setStyle);
|
|
79
|
+
}, [isActive, canBegin, duration, easing, begin, onAnimationStart, onAnimationEnd, animationController, to, from, animationId, attributeName]);
|
|
80
|
+
if (!isActive) {
|
|
81
|
+
return children({
|
|
82
|
+
[attributeName]: to
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
if (!canBegin) {
|
|
86
|
+
return children({
|
|
87
|
+
[attributeName]: from
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
if (initialized.current) {
|
|
91
|
+
var transition = getTransitionVal([attributeName], duration, easing);
|
|
92
|
+
return children({
|
|
93
|
+
transition,
|
|
94
|
+
[attributeName]: style
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
return children({
|
|
98
|
+
[attributeName]: from
|
|
99
|
+
});
|
|
100
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
2
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
4
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
5
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
7
|
+
import { useEffect, useState } from 'react';
|
|
8
|
+
import { useIsPDF } from '../context/PDFContext';
|
|
9
|
+
import { noop } from '../util/DataUtils';
|
|
10
|
+
import { resolveDefaultProps } from '../util/resolveDefaultProps';
|
|
11
|
+
import { createEasingFunction } from './easing';
|
|
12
|
+
import { useAnimationController } from './useAnimationController';
|
|
13
|
+
import { Global } from '../util/Global';
|
|
14
|
+
import { usePrefersReducedMotion } from '../util/usePrefersReducedMotion';
|
|
15
|
+
import { JavascriptAnimation } from './AnimationHandle';
|
|
16
|
+
import { RequestAnimationFrameTimeoutController } from './timeoutController';
|
|
17
|
+
var defaultJavascriptAnimateProps = {
|
|
18
|
+
begin: 0,
|
|
19
|
+
duration: 1000,
|
|
20
|
+
easing: 'ease',
|
|
21
|
+
isActive: true,
|
|
22
|
+
canBegin: true,
|
|
23
|
+
onAnimationEnd: () => {},
|
|
24
|
+
onAnimationStart: () => {}
|
|
25
|
+
};
|
|
26
|
+
var from = 0;
|
|
27
|
+
var to = 1;
|
|
28
|
+
export function JavascriptAnimate(outsideProps) {
|
|
29
|
+
var props = resolveDefaultProps(outsideProps, defaultJavascriptAnimateProps);
|
|
30
|
+
var animationId = props.animationId,
|
|
31
|
+
isActiveProp = props.isActive,
|
|
32
|
+
canBegin = props.canBegin,
|
|
33
|
+
duration = props.duration,
|
|
34
|
+
easing = props.easing,
|
|
35
|
+
begin = props.begin,
|
|
36
|
+
onAnimationEnd = props.onAnimationEnd,
|
|
37
|
+
onAnimationStart = props.onAnimationStart,
|
|
38
|
+
children = props.children;
|
|
39
|
+
var prefersReducedMotion = usePrefersReducedMotion();
|
|
40
|
+
var isPDF = useIsPDF();
|
|
41
|
+
var isActive = !isPDF && (isActiveProp === 'auto' ? !Global.isSsr && !prefersReducedMotion : isActiveProp);
|
|
42
|
+
var animationController = useAnimationController(props.animationController);
|
|
43
|
+
var _useState = useState(isActive ? from : to),
|
|
44
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
45
|
+
style = _useState2[0],
|
|
46
|
+
setStyle = _useState2[1];
|
|
47
|
+
useEffect(() => {
|
|
48
|
+
if (!isActive) {
|
|
49
|
+
setStyle(to);
|
|
50
|
+
}
|
|
51
|
+
}, [isActive]);
|
|
52
|
+
useEffect(() => {
|
|
53
|
+
var easingFunction = createEasingFunction(easing);
|
|
54
|
+
if (!isActive || !canBegin || easingFunction == null) {
|
|
55
|
+
return noop;
|
|
56
|
+
}
|
|
57
|
+
var timeoutController = new RequestAnimationFrameTimeoutController();
|
|
58
|
+
var animation = new JavascriptAnimation({
|
|
59
|
+
animationId,
|
|
60
|
+
easing: easingFunction,
|
|
61
|
+
animationDuration: duration,
|
|
62
|
+
animationBegin: begin,
|
|
63
|
+
onAnimationStart,
|
|
64
|
+
onAnimationEnd,
|
|
65
|
+
from,
|
|
66
|
+
to
|
|
67
|
+
});
|
|
68
|
+
return animationController(timeoutController, animation, setStyle);
|
|
69
|
+
}, [animationController, animationId, isActive, canBegin, duration, easing, begin, onAnimationStart, onAnimationEnd]);
|
|
70
|
+
return children(Number(style));
|
|
71
|
+
}
|