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.
Files changed (974) hide show
  1. package/es6/animation/AnimatedItems.js +117 -0
  2. package/es6/animation/AnimationController.js +1 -0
  3. package/es6/animation/AnimationControllerImpl.js +29 -0
  4. package/es6/animation/AnimationHandle.js +269 -0
  5. package/es6/animation/CSSTransitionAnimate.js +100 -0
  6. package/es6/animation/JavascriptAnimate.js +71 -0
  7. package/es6/animation/easing.js +177 -0
  8. package/es6/animation/matchBy.js +230 -0
  9. package/es6/animation/timeoutController.js +49 -0
  10. package/es6/animation/useAnimationController.js +30 -0
  11. package/es6/animation/useAnimationStartSnapshot.js +90 -0
  12. package/es6/animation/useZoomAwareAnimation.js +133 -0
  13. package/es6/animation/util.js +6 -0
  14. package/es6/cartesian/Area.js +818 -0
  15. package/es6/cartesian/AreaRevealShape.js +186 -0
  16. package/es6/cartesian/Bar.js +975 -0
  17. package/es6/cartesian/BarStack.js +145 -0
  18. package/es6/cartesian/Brush.js +953 -0
  19. package/es6/cartesian/CartesianAxis.js +558 -0
  20. package/es6/cartesian/CartesianGrid.js +481 -0
  21. package/es6/cartesian/ErrorBar.js +284 -0
  22. package/es6/cartesian/Funnel.js +653 -0
  23. package/es6/cartesian/GraphicalItemClipPath.js +80 -0
  24. package/es6/cartesian/Line.js +694 -0
  25. package/es6/cartesian/LineDrawShape.js +210 -0
  26. package/es6/cartesian/ReferenceArea.js +216 -0
  27. package/es6/cartesian/ReferenceDot.js +196 -0
  28. package/es6/cartesian/ReferenceLine.js +262 -0
  29. package/es6/cartesian/Scatter.js +853 -0
  30. package/es6/cartesian/XAxis.js +230 -0
  31. package/es6/cartesian/YAxis.js +234 -0
  32. package/es6/cartesian/ZAxis.js +67 -0
  33. package/es6/cartesian/cartesianPositionToCSSTranslate.js +33 -0
  34. package/es6/cartesian/cartesianViewBoxToTrapezoid.js +13 -0
  35. package/es6/cartesian/getCartesianPosition.js +224 -0
  36. package/es6/cartesian/getEquidistantTicks.js +172 -0
  37. package/es6/cartesian/getTicks.js +172 -0
  38. package/es6/cartesian/useAnimatedLineLength.js +54 -0
  39. package/es6/cartesian/zoomedLineLength.js +150 -0
  40. package/es6/chart/AreaChart.js +22 -0
  41. package/es6/chart/BarChart.js +22 -0
  42. package/es6/chart/CartesianChart.js +92 -0
  43. package/es6/chart/CategoricalChart.js +61 -0
  44. package/es6/chart/ComposedChart.js +22 -0
  45. package/es6/chart/FunnelChart.js +22 -0
  46. package/es6/chart/LineChart.js +22 -0
  47. package/es6/chart/PieChart.js +34 -0
  48. package/es6/chart/PolarChart.js +113 -0
  49. package/es6/chart/RadarChart.js +33 -0
  50. package/es6/chart/RadialBarChart.js +34 -0
  51. package/es6/chart/RechartsWrapper.js +381 -0
  52. package/es6/chart/Sankey.js +1454 -0
  53. package/es6/chart/ScatterChart.js +22 -0
  54. package/es6/chart/StaticCartesianChart.js +208 -0
  55. package/es6/chart/SunburstChart.js +623 -0
  56. package/es6/chart/Treemap.js +1300 -0
  57. package/es6/chart/types.js +1 -0
  58. package/es6/chart/zoom/SelectionOverlay.js +56 -0
  59. package/es6/chart/zoom/ZoomAndPan.js +177 -0
  60. package/es6/chart/zoom/ZoomGestureApi.js +46 -0
  61. package/es6/chart/zoom/ZoomStateSync.js +177 -0
  62. package/es6/chart/zoom/doubleClickGesture.js +20 -0
  63. package/es6/chart/zoom/keyboardGesture.js +121 -0
  64. package/es6/chart/zoom/pointerGesture.js +214 -0
  65. package/es6/chart/zoom/touchGesture.js +478 -0
  66. package/es6/chart/zoom/useZoomApi.js +259 -0
  67. package/es6/chart/zoom/wheelGesture.js +92 -0
  68. package/es6/component/ActivePoints.js +105 -0
  69. package/es6/component/Cell.js +20 -0
  70. package/es6/component/Cursor.js +167 -0
  71. package/es6/component/Customized.js +43 -0
  72. package/es6/component/DefaultLegendContent.js +354 -0
  73. package/es6/component/DefaultTooltipContent.js +179 -0
  74. package/es6/component/Dots.js +107 -0
  75. package/es6/component/Label.js +460 -0
  76. package/es6/component/LabelList.js +244 -0
  77. package/es6/component/Legend.js +303 -0
  78. package/es6/component/ResponsiveContainer.js +193 -0
  79. package/es6/component/Text.js +703 -0
  80. package/es6/component/Tooltip.js +210 -0
  81. package/es6/component/TooltipBoundingBox.js +125 -0
  82. package/es6/component/responsiveContainerUtils.js +109 -0
  83. package/es6/container/ClipPathProvider.js +49 -0
  84. package/es6/container/Layer.js +32 -0
  85. package/es6/container/RootSurface.js +105 -0
  86. package/es6/container/Surface.js +47 -0
  87. package/es6/context/ErrorBarContext.js +65 -0
  88. package/es6/context/PDFContext.js +5 -0
  89. package/es6/context/PanoramaContext.js +10 -0
  90. package/es6/context/RegisterGraphicalItemId.js +16 -0
  91. package/es6/context/accessibilityContext.js +5 -0
  92. package/es6/context/brushUpdateContext.js +2 -0
  93. package/es6/context/chartDataContext.js +73 -0
  94. package/es6/context/chartLayoutContext.js +235 -0
  95. package/es6/context/legendPayloadContext.js +10 -0
  96. package/es6/context/legendPortalContext.js +3 -0
  97. package/es6/context/tooltipContext.js +39 -0
  98. package/es6/context/tooltipPortalContext.js +3 -0
  99. package/es6/context/useTooltipAxis.js +21 -0
  100. package/es6/fill/RechartsFill.js +197 -0
  101. package/es6/fill/fillDefinitions.js +473 -0
  102. package/es6/fill/symbolPath.js +85 -0
  103. package/es6/hooks.js +668 -0
  104. package/es6/index.js +83 -0
  105. package/es6/polar/Pie.js +931 -0
  106. package/es6/polar/PolarAngleAxis.js +279 -0
  107. package/es6/polar/PolarGrid.js +224 -0
  108. package/es6/polar/PolarRadiusAxis.js +236 -0
  109. package/es6/polar/Radar.js +533 -0
  110. package/es6/polar/RadialBar.js +639 -0
  111. package/es6/polar/defaultPolarAngleAxisProps.js +25 -0
  112. package/es6/polar/defaultPolarRadiusAxisProps.js +21 -0
  113. package/es6/polar/isOutsidePolarPosition.js +16 -0
  114. package/es6/shape/Cross.js +70 -0
  115. package/es6/shape/Curve.js +178 -0
  116. package/es6/shape/Dot.js +56 -0
  117. package/es6/shape/DotSymbol.js +107 -0
  118. package/es6/shape/Polygon.js +126 -0
  119. package/es6/shape/Rectangle.js +263 -0
  120. package/es6/shape/Sector.js +251 -0
  121. package/es6/shape/Symbols.js +184 -0
  122. package/es6/shape/Trapezoid.js +163 -0
  123. package/es6/state/RechartsReduxContext.js +17 -0
  124. package/es6/state/RechartsStoreProvider.js +46 -0
  125. package/es6/state/ReportChartProps.js +10 -0
  126. package/es6/state/ReportEventSettings.js +12 -0
  127. package/es6/state/ReportMainChartProps.js +38 -0
  128. package/es6/state/ReportPolarOptions.js +10 -0
  129. package/es6/state/SetGraphicalItem.js +66 -0
  130. package/es6/state/SetLegendPayload.js +63 -0
  131. package/es6/state/SetTooltipEntrySettings.js +34 -0
  132. package/es6/state/brushSlice.js +34 -0
  133. package/es6/state/cartesianAxisSlice.js +229 -0
  134. package/es6/state/chartDataSlice.js +97 -0
  135. package/es6/state/errorBarSlice.js +47 -0
  136. package/es6/state/eventSettingsSlice.js +23 -0
  137. package/es6/state/externalEventsMiddleware.js +128 -0
  138. package/es6/state/graphicalItemsSlice.js +82 -0
  139. package/es6/state/hooks.js +57 -0
  140. package/es6/state/keyboardEventsMiddleware.js +219 -0
  141. package/es6/state/keyboardTooltipVisibility.js +49 -0
  142. package/es6/state/layoutSlice.js +43 -0
  143. package/es6/state/legendSlice.js +79 -0
  144. package/es6/state/mouseEventsMiddleware.js +140 -0
  145. package/es6/state/optionsSlice.js +43 -0
  146. package/es6/state/polarAxisSlice.js +31 -0
  147. package/es6/state/polarOptionsSlice.js +24 -0
  148. package/es6/state/reduxDevtoolsJsonStringifyReplacer.js +12 -0
  149. package/es6/state/referenceElementsSlice.js +49 -0
  150. package/es6/state/renderedTicksSlice.js +43 -0
  151. package/es6/state/rootPropsSlice.js +43 -0
  152. package/es6/state/selectors/areaSelectors.js +117 -0
  153. package/es6/state/selectors/arrayEqualityCheck.js +30 -0
  154. package/es6/state/selectors/axisSelectors.js +1558 -0
  155. package/es6/state/selectors/barSelectors.js +223 -0
  156. package/es6/state/selectors/barStackSelectors.js +93 -0
  157. package/es6/state/selectors/brushSelectors.js +11 -0
  158. package/es6/state/selectors/combiners/combineActiveLabel.js +9 -0
  159. package/es6/state/selectors/combiners/combineActiveTooltipIndex.js +70 -0
  160. package/es6/state/selectors/combiners/combineAllBarPositions.js +85 -0
  161. package/es6/state/selectors/combiners/combineAxisRangeWithReverse.js +9 -0
  162. package/es6/state/selectors/combiners/combineBarPosition.js +10 -0
  163. package/es6/state/selectors/combiners/combineBarSizeList.js +52 -0
  164. package/es6/state/selectors/combiners/combineCheckedDomain.js +43 -0
  165. package/es6/state/selectors/combiners/combineConfiguredScale.js +44 -0
  166. package/es6/state/selectors/combiners/combineCoordinateForDefaultIndex.js +83 -0
  167. package/es6/state/selectors/combiners/combineDisplayedStackedData.js +44 -0
  168. package/es6/state/selectors/combiners/combineInverseScaleFunction.js +10 -0
  169. package/es6/state/selectors/combiners/combinePlaceTooltipIndex.js +83 -0
  170. package/es6/state/selectors/combiners/combineRealScaleType.js +28 -0
  171. package/es6/state/selectors/combiners/combineStackedData.js +20 -0
  172. package/es6/state/selectors/combiners/combineTooltipInteractionState.js +85 -0
  173. package/es6/state/selectors/combiners/combineTooltipPayload.js +187 -0
  174. package/es6/state/selectors/combiners/combineTooltipPayloadConfigurations.js +45 -0
  175. package/es6/state/selectors/containerSelectors.js +4 -0
  176. package/es6/state/selectors/dataSelectors.js +78 -0
  177. package/es6/state/selectors/effectiveDataKeySelectors.js +97 -0
  178. package/es6/state/selectors/funnelSelectors.js +81 -0
  179. package/es6/state/selectors/graphicalItemSelectors.js +11 -0
  180. package/es6/state/selectors/legendSelectors.js +10 -0
  181. package/es6/state/selectors/lineSelectors.js +59 -0
  182. package/es6/state/selectors/numberDomainEqualityCheck.js +9 -0
  183. package/es6/state/selectors/pickAxisId.js +1 -0
  184. package/es6/state/selectors/pickAxisType.js +1 -0
  185. package/es6/state/selectors/pieSelectors.js +71 -0
  186. package/es6/state/selectors/polarAxisSelectors.js +130 -0
  187. package/es6/state/selectors/polarGridSelectors.js +17 -0
  188. package/es6/state/selectors/polarScaleSelectors.js +62 -0
  189. package/es6/state/selectors/polarSelectors.js +63 -0
  190. package/es6/state/selectors/radarSelectors.js +92 -0
  191. package/es6/state/selectors/radialBarSelectors.js +169 -0
  192. package/es6/state/selectors/rootPropsSelectors.js +11 -0
  193. package/es6/state/selectors/scatterSelectors.js +50 -0
  194. package/es6/state/selectors/selectActivePropsFromChartPointer.js +9 -0
  195. package/es6/state/selectors/selectAllAxes.js +7 -0
  196. package/es6/state/selectors/selectChartOffset.js +10 -0
  197. package/es6/state/selectors/selectChartOffsetInternal.js +94 -0
  198. package/es6/state/selectors/selectLegendArea.js +10 -0
  199. package/es6/state/selectors/selectPlotArea.js +14 -0
  200. package/es6/state/selectors/selectTooltipAxisId.js +1 -0
  201. package/es6/state/selectors/selectTooltipAxisType.js +23 -0
  202. package/es6/state/selectors/selectTooltipEventType.js +21 -0
  203. package/es6/state/selectors/selectTooltipPayloadSearcher.js +1 -0
  204. package/es6/state/selectors/selectTooltipSettings.js +1 -0
  205. package/es6/state/selectors/selectTooltipState.js +1 -0
  206. package/es6/state/selectors/selectors.js +101 -0
  207. package/es6/state/selectors/tooltipSelectors.js +256 -0
  208. package/es6/state/selectors/touchSelectors.js +19 -0
  209. package/es6/state/selectors/zoomProjectionSelectors.js +27 -0
  210. package/es6/state/selectors/zoomSelectors.js +30 -0
  211. package/es6/state/store.js +105 -0
  212. package/es6/state/tooltipSlice.js +224 -0
  213. package/es6/state/touchEventsMiddleware.js +164 -0
  214. package/es6/state/types/AreaSettings.js +1 -0
  215. package/es6/state/types/BarSettings.js +1 -0
  216. package/es6/state/types/LineSettings.js +1 -0
  217. package/es6/state/types/PieSettings.js +1 -0
  218. package/es6/state/types/RadarSettings.js +1 -0
  219. package/es6/state/types/RadialBarSettings.js +1 -0
  220. package/es6/state/types/ScatterSettings.js +1 -0
  221. package/es6/state/types/StackedGraphicalItem.js +17 -0
  222. package/es6/state/zIndexSlice.js +108 -0
  223. package/es6/state/zoomSettingsSlice.js +46 -0
  224. package/es6/state/zoomSlice.js +84 -0
  225. package/es6/synchronisation/syncSelectors.js +3 -0
  226. package/es6/synchronisation/types.js +1 -0
  227. package/es6/synchronisation/useChartSynchronisation.js +368 -0
  228. package/es6/theme/RechartsTheme.js +1 -0
  229. package/es6/theme/RechartsThemeContext.js +25 -0
  230. package/es6/theme/activeStyles.js +105 -0
  231. package/es6/theme/autoTheme.js +150 -0
  232. package/es6/theme/cssStylesToSvgStyles.js +18 -0
  233. package/es6/theme/darkTheme.js +140 -0
  234. package/es6/theme/dataEntryStyles.js +248 -0
  235. package/es6/theme/emptyTheme.js +14 -0
  236. package/es6/theme/graphicalItemIdentity.js +30 -0
  237. package/es6/theme/labelTheme.js +253 -0
  238. package/es6/theme/lightTheme.js +142 -0
  239. package/es6/theme/pageBackground.js +21 -0
  240. package/es6/theme/themeFill.js +95 -0
  241. package/es6/theme/useBackwardsCompatibleTheme.js +48 -0
  242. package/es6/theme/useGraphicalItemIdentity.js +67 -0
  243. package/es6/types.js +1 -0
  244. package/es6/util/ActiveShapeUtils.js +90 -0
  245. package/es6/util/BarUtils.js +43 -0
  246. package/es6/util/CartesianUtils.js +58 -0
  247. package/es6/util/ChartUtils.js +587 -0
  248. package/es6/util/Constants.js +16 -0
  249. package/es6/util/CssPrefixUtils.js +17 -0
  250. package/es6/util/DOMUtils.js +127 -0
  251. package/es6/util/DataUtils.js +189 -0
  252. package/es6/util/Events.js +5 -0
  253. package/es6/util/FunnelUtils.js +16 -0
  254. package/es6/util/Global.js +9 -0
  255. package/es6/util/IfOverflow.js +1 -0
  256. package/es6/util/LRUCache.js +43 -0
  257. package/es6/util/LogUtils.js +20 -0
  258. package/es6/util/PolarUtils.js +126 -0
  259. package/es6/util/RadialBarUtils.js +27 -0
  260. package/es6/util/ReactUtils.js +85 -0
  261. package/es6/util/ReduceCSSCalc.js +192 -0
  262. package/es6/util/ScatterUtils.js +34 -0
  263. package/es6/util/TickUtils.js +38 -0
  264. package/es6/util/XAxisUtils.js +41 -0
  265. package/es6/util/YAxisUtils.js +41 -0
  266. package/es6/util/axisPropsAreEqual.js +41 -0
  267. package/es6/util/clsx.js +55 -0
  268. package/es6/util/createCartesianCharts.js +127 -0
  269. package/es6/util/createEventProxy.js +16 -0
  270. package/es6/util/createPolarCharts.js +111 -0
  271. package/es6/util/cursor/getCursorPoints.js +43 -0
  272. package/es6/util/cursor/getCursorRectangle.js +9 -0
  273. package/es6/util/cursor/getRadialCursorPoints.js +23 -0
  274. package/es6/util/excludeEventProps.js +8 -0
  275. package/es6/util/getActiveCoordinate.js +156 -0
  276. package/es6/util/getAxisTypeBasedOnLayout.js +15 -0
  277. package/es6/util/getClassNameFromUnknown.js +6 -0
  278. package/es6/util/getEveryNth.js +27 -0
  279. package/es6/util/getRadiusAndStrokeWidthFromDot.js +26 -0
  280. package/es6/util/getRelativeCoordinate.js +95 -0
  281. package/es6/util/getSliced.js +6 -0
  282. package/es6/util/isDomainSpecifiedByUser.js +189 -0
  283. package/es6/util/isWellBehavedNumber.js +6 -0
  284. package/es6/util/payload/getUniqPayload.js +20 -0
  285. package/es6/util/propsAreEqual.js +142 -0
  286. package/es6/util/resolveDefaultProps.js +103 -0
  287. package/es6/util/round.js +32 -0
  288. package/es6/util/scale/CartesianScaleHelper.js +58 -0
  289. package/es6/util/scale/CustomScaleDefinition.js +1 -0
  290. package/es6/util/scale/RechartsScale.js +67 -0
  291. package/es6/util/scale/createCategoricalInverse.js +91 -0
  292. package/es6/util/scale/getNiceTickValues.js +291 -0
  293. package/es6/util/scale/index.js +1 -0
  294. package/es6/util/scale/util/arithmetic.js +61 -0
  295. package/es6/util/stacks/getStackSeriesIdentifier.js +8 -0
  296. package/es6/util/stacks/stackTypes.js +1 -0
  297. package/es6/util/svgPropertiesAndEvents.js +50 -0
  298. package/es6/util/svgPropertiesNoEvents.js +74 -0
  299. package/es6/util/tooltip/translate.js +132 -0
  300. package/es6/util/typedDataKey.js +1 -0
  301. package/es6/util/types.js +409 -0
  302. package/es6/util/useAnimationId.js +27 -0
  303. package/es6/util/useCells.js +51 -0
  304. package/es6/util/useEffectiveDataKey.js +26 -0
  305. package/es6/util/useElementOffset.js +1 -0
  306. package/es6/util/useElementSize.js +188 -0
  307. package/es6/util/useId.js +28 -0
  308. package/es6/util/usePrefersReducedMotion.js +43 -0
  309. package/es6/util/useReportScale.js +28 -0
  310. package/es6/util/useUniqueId.js +32 -0
  311. package/es6/util/zoom/ZoomOptions.js +49 -0
  312. package/es6/util/zoom/projection.js +144 -0
  313. package/es6/util/zoom/transform.js +93 -0
  314. package/es6/util/zoom/viewport.js +218 -0
  315. package/es6/util/zoom/viewportWindow.js +163 -0
  316. package/es6/util/zoom/zoomActions.js +123 -0
  317. package/es6/zIndex/DefaultZIndexes.js +87 -0
  318. package/es6/zIndex/StaticZIndexLayers.js +48 -0
  319. package/es6/zIndex/ZIndexLayer.js +143 -0
  320. package/es6/zIndex/ZIndexPortal.js +61 -0
  321. package/es6/zIndex/getZIndexFromUnknown.js +7 -0
  322. package/es6/zIndex/labelBackgroundZIndex.js +50 -0
  323. package/es6/zIndex/zIndexSelectors.js +32 -0
  324. package/lib/animation/AnimatedItems.js +125 -0
  325. package/lib/animation/AnimationController.js +1 -0
  326. package/lib/animation/AnimationControllerImpl.js +36 -0
  327. package/lib/animation/AnimationHandle.js +276 -0
  328. package/lib/animation/CSSTransitionAnimate.js +107 -0
  329. package/lib/animation/JavascriptAnimate.js +77 -0
  330. package/lib/animation/easing.js +184 -0
  331. package/lib/animation/matchBy.js +238 -0
  332. package/lib/animation/timeoutController.js +56 -0
  333. package/lib/animation/useAnimationController.js +37 -0
  334. package/lib/animation/useAnimationStartSnapshot.js +96 -0
  335. package/lib/animation/useZoomAwareAnimation.js +140 -0
  336. package/lib/animation/util.js +14 -0
  337. package/lib/cartesian/Area.js +827 -0
  338. package/lib/cartesian/AreaRevealShape.js +192 -0
  339. package/lib/cartesian/Bar.js +984 -0
  340. package/lib/cartesian/BarStack.js +155 -0
  341. package/lib/cartesian/Brush.js +961 -0
  342. package/lib/cartesian/CartesianAxis.js +565 -0
  343. package/lib/cartesian/CartesianGrid.js +488 -0
  344. package/lib/cartesian/ErrorBar.js +291 -0
  345. package/lib/cartesian/Funnel.js +663 -0
  346. package/lib/cartesian/GraphicalItemClipPath.js +89 -0
  347. package/lib/cartesian/Line.js +702 -0
  348. package/lib/cartesian/LineDrawShape.js +217 -0
  349. package/lib/cartesian/ReferenceArea.js +223 -0
  350. package/lib/cartesian/ReferenceDot.js +203 -0
  351. package/lib/cartesian/ReferenceLine.js +269 -0
  352. package/lib/cartesian/Scatter.js +862 -0
  353. package/lib/cartesian/XAxis.js +238 -0
  354. package/lib/cartesian/YAxis.js +242 -0
  355. package/lib/cartesian/ZAxis.js +75 -0
  356. package/lib/cartesian/cartesianPositionToCSSTranslate.js +39 -0
  357. package/lib/cartesian/cartesianViewBoxToTrapezoid.js +19 -0
  358. package/lib/cartesian/getCartesianPosition.js +231 -0
  359. package/lib/cartesian/getEquidistantTicks.js +179 -0
  360. package/lib/cartesian/getTicks.js +178 -0
  361. package/lib/cartesian/useAnimatedLineLength.js +59 -0
  362. package/lib/cartesian/zoomedLineLength.js +156 -0
  363. package/lib/chart/AreaChart.js +29 -0
  364. package/lib/chart/BarChart.js +29 -0
  365. package/lib/chart/CartesianChart.js +99 -0
  366. package/lib/chart/CategoricalChart.js +68 -0
  367. package/lib/chart/ComposedChart.js +29 -0
  368. package/lib/chart/FunnelChart.js +29 -0
  369. package/lib/chart/LineChart.js +29 -0
  370. package/lib/chart/PieChart.js +41 -0
  371. package/lib/chart/PolarChart.js +120 -0
  372. package/lib/chart/RadarChart.js +40 -0
  373. package/lib/chart/RadialBarChart.js +41 -0
  374. package/lib/chart/RechartsWrapper.js +388 -0
  375. package/lib/chart/Sankey.js +1465 -0
  376. package/lib/chart/ScatterChart.js +29 -0
  377. package/lib/chart/StaticCartesianChart.js +215 -0
  378. package/lib/chart/SunburstChart.js +632 -0
  379. package/lib/chart/Treemap.js +1311 -0
  380. package/lib/chart/types.js +1 -0
  381. package/lib/chart/zoom/SelectionOverlay.js +63 -0
  382. package/lib/chart/zoom/ZoomAndPan.js +184 -0
  383. package/lib/chart/zoom/ZoomGestureApi.js +54 -0
  384. package/lib/chart/zoom/ZoomStateSync.js +183 -0
  385. package/lib/chart/zoom/doubleClickGesture.js +27 -0
  386. package/lib/chart/zoom/keyboardGesture.js +130 -0
  387. package/lib/chart/zoom/pointerGesture.js +220 -0
  388. package/lib/chart/zoom/touchGesture.js +485 -0
  389. package/lib/chart/zoom/useZoomApi.js +266 -0
  390. package/lib/chart/zoom/wheelGesture.js +99 -0
  391. package/lib/component/ActivePoints.js +112 -0
  392. package/lib/component/Cell.js +27 -0
  393. package/lib/component/Cursor.js +174 -0
  394. package/lib/component/Customized.js +49 -0
  395. package/lib/component/DefaultLegendContent.js +362 -0
  396. package/lib/component/DefaultTooltipContent.js +186 -0
  397. package/lib/component/Dots.js +114 -0
  398. package/lib/component/Label.js +476 -0
  399. package/lib/component/LabelList.js +254 -0
  400. package/lib/component/Legend.js +310 -0
  401. package/lib/component/ResponsiveContainer.js +200 -0
  402. package/lib/component/Text.js +718 -0
  403. package/lib/component/Tooltip.js +217 -0
  404. package/lib/component/TooltipBoundingBox.js +132 -0
  405. package/lib/component/responsiveContainerUtils.js +119 -0
  406. package/lib/container/ClipPathProvider.js +58 -0
  407. package/lib/container/Layer.js +38 -0
  408. package/lib/container/RootSurface.js +112 -0
  409. package/lib/container/Surface.js +53 -0
  410. package/lib/context/ErrorBarContext.js +75 -0
  411. package/lib/context/PDFContext.js +12 -0
  412. package/lib/context/PanoramaContext.js +19 -0
  413. package/lib/context/RegisterGraphicalItemId.js +25 -0
  414. package/lib/context/accessibilityContext.js +12 -0
  415. package/lib/context/brushUpdateContext.js +8 -0
  416. package/lib/context/chartDataContext.js +83 -0
  417. package/lib/context/chartLayoutContext.js +254 -0
  418. package/lib/context/legendPayloadContext.js +15 -0
  419. package/lib/context/legendPortalContext.js +10 -0
  420. package/lib/context/tooltipContext.js +47 -0
  421. package/lib/context/tooltipPortalContext.js +10 -0
  422. package/lib/context/useTooltipAxis.js +29 -0
  423. package/lib/fill/RechartsFill.js +202 -0
  424. package/lib/fill/fillDefinitions.js +497 -0
  425. package/lib/fill/symbolPath.js +91 -0
  426. package/lib/hooks.js +683 -0
  427. package/lib/index.js +760 -0
  428. package/lib/polar/Pie.js +940 -0
  429. package/lib/polar/PolarAngleAxis.js +288 -0
  430. package/lib/polar/PolarGrid.js +231 -0
  431. package/lib/polar/PolarRadiusAxis.js +245 -0
  432. package/lib/polar/Radar.js +542 -0
  433. package/lib/polar/RadialBar.js +649 -0
  434. package/lib/polar/defaultPolarAngleAxisProps.js +31 -0
  435. package/lib/polar/defaultPolarRadiusAxisProps.js +27 -0
  436. package/lib/polar/isOutsidePolarPosition.js +22 -0
  437. package/lib/shape/Cross.js +77 -0
  438. package/lib/shape/Curve.js +186 -0
  439. package/lib/shape/Dot.js +63 -0
  440. package/lib/shape/DotSymbol.js +117 -0
  441. package/lib/shape/Polygon.js +134 -0
  442. package/lib/shape/Rectangle.js +270 -0
  443. package/lib/shape/Sector.js +259 -0
  444. package/lib/shape/Symbols.js +192 -0
  445. package/lib/shape/Trapezoid.js +171 -0
  446. package/lib/state/RechartsReduxContext.js +22 -0
  447. package/lib/state/RechartsStoreProvider.js +53 -0
  448. package/lib/state/ReportChartProps.js +16 -0
  449. package/lib/state/ReportEventSettings.js +18 -0
  450. package/lib/state/ReportMainChartProps.js +43 -0
  451. package/lib/state/ReportPolarOptions.js +16 -0
  452. package/lib/state/SetGraphicalItem.js +72 -0
  453. package/lib/state/SetLegendPayload.js +70 -0
  454. package/lib/state/SetTooltipEntrySettings.js +40 -0
  455. package/lib/state/brushSlice.js +38 -0
  456. package/lib/state/cartesianAxisSlice.js +233 -0
  457. package/lib/state/chartDataSlice.js +103 -0
  458. package/lib/state/errorBarSlice.js +51 -0
  459. package/lib/state/eventSettingsSlice.js +28 -0
  460. package/lib/state/externalEventsMiddleware.js +135 -0
  461. package/lib/state/graphicalItemsSlice.js +86 -0
  462. package/lib/state/hooks.js +66 -0
  463. package/lib/state/keyboardEventsMiddleware.js +225 -0
  464. package/lib/state/keyboardTooltipVisibility.js +57 -0
  465. package/lib/state/layoutSlice.js +48 -0
  466. package/lib/state/legendSlice.js +83 -0
  467. package/lib/state/mouseEventsMiddleware.js +147 -0
  468. package/lib/state/optionsSlice.js +48 -0
  469. package/lib/state/polarAxisSlice.js +36 -0
  470. package/lib/state/polarOptionsSlice.js +29 -0
  471. package/lib/state/reduxDevtoolsJsonStringifyReplacer.js +18 -0
  472. package/lib/state/referenceElementsSlice.js +54 -0
  473. package/lib/state/renderedTicksSlice.js +49 -0
  474. package/lib/state/rootPropsSlice.js +47 -0
  475. package/lib/state/selectors/areaSelectors.js +122 -0
  476. package/lib/state/selectors/arrayEqualityCheck.js +37 -0
  477. package/lib/state/selectors/axisSelectors.js +1614 -0
  478. package/lib/state/selectors/barSelectors.js +232 -0
  479. package/lib/state/selectors/barStackSelectors.js +102 -0
  480. package/lib/state/selectors/brushSelectors.js +18 -0
  481. package/lib/state/selectors/combiners/combineActiveLabel.js +16 -0
  482. package/lib/state/selectors/combiners/combineActiveTooltipIndex.js +77 -0
  483. package/lib/state/selectors/combiners/combineAllBarPositions.js +92 -0
  484. package/lib/state/selectors/combiners/combineAxisRangeWithReverse.js +16 -0
  485. package/lib/state/selectors/combiners/combineBarPosition.js +17 -0
  486. package/lib/state/selectors/combiners/combineBarSizeList.js +59 -0
  487. package/lib/state/selectors/combiners/combineCheckedDomain.js +49 -0
  488. package/lib/state/selectors/combiners/combineConfiguredScale.js +52 -0
  489. package/lib/state/selectors/combiners/combineCoordinateForDefaultIndex.js +90 -0
  490. package/lib/state/selectors/combiners/combineDisplayedStackedData.js +49 -0
  491. package/lib/state/selectors/combiners/combineInverseScaleFunction.js +16 -0
  492. package/lib/state/selectors/combiners/combinePlaceTooltipIndex.js +90 -0
  493. package/lib/state/selectors/combiners/combineRealScaleType.js +36 -0
  494. package/lib/state/selectors/combiners/combineStackedData.js +27 -0
  495. package/lib/state/selectors/combiners/combineTooltipInteractionState.js +92 -0
  496. package/lib/state/selectors/combiners/combineTooltipPayload.js +194 -0
  497. package/lib/state/selectors/combiners/combineTooltipPayloadConfigurations.js +52 -0
  498. package/lib/state/selectors/containerSelectors.js +14 -0
  499. package/lib/state/selectors/dataSelectors.js +87 -0
  500. package/lib/state/selectors/effectiveDataKeySelectors.js +106 -0
  501. package/lib/state/selectors/funnelSelectors.js +87 -0
  502. package/lib/state/selectors/graphicalItemSelectors.js +19 -0
  503. package/lib/state/selectors/legendSelectors.js +19 -0
  504. package/lib/state/selectors/lineSelectors.js +65 -0
  505. package/lib/state/selectors/numberDomainEqualityCheck.js +16 -0
  506. package/lib/state/selectors/pickAxisId.js +8 -0
  507. package/lib/state/selectors/pickAxisType.js +8 -0
  508. package/lib/state/selectors/pieSelectors.js +77 -0
  509. package/lib/state/selectors/polarAxisSelectors.js +137 -0
  510. package/lib/state/selectors/polarGridSelectors.js +23 -0
  511. package/lib/state/selectors/polarScaleSelectors.js +69 -0
  512. package/lib/state/selectors/polarSelectors.js +70 -0
  513. package/lib/state/selectors/radarSelectors.js +98 -0
  514. package/lib/state/selectors/radialBarSelectors.js +177 -0
  515. package/lib/state/selectors/rootPropsSelectors.js +28 -0
  516. package/lib/state/selectors/scatterSelectors.js +56 -0
  517. package/lib/state/selectors/selectActivePropsFromChartPointer.js +15 -0
  518. package/lib/state/selectors/selectAllAxes.js +13 -0
  519. package/lib/state/selectors/selectChartOffset.js +16 -0
  520. package/lib/state/selectors/selectChartOffsetInternal.js +106 -0
  521. package/lib/state/selectors/selectLegendArea.js +16 -0
  522. package/lib/state/selectors/selectPlotArea.js +20 -0
  523. package/lib/state/selectors/selectTooltipAxisId.js +8 -0
  524. package/lib/state/selectors/selectTooltipAxisType.js +29 -0
  525. package/lib/state/selectors/selectTooltipEventType.js +33 -0
  526. package/lib/state/selectors/selectTooltipPayloadSearcher.js +8 -0
  527. package/lib/state/selectors/selectTooltipSettings.js +8 -0
  528. package/lib/state/selectors/selectTooltipState.js +8 -0
  529. package/lib/state/selectors/selectors.js +111 -0
  530. package/lib/state/selectors/tooltipSelectors.js +268 -0
  531. package/lib/state/selectors/touchSelectors.js +25 -0
  532. package/lib/state/selectors/zoomProjectionSelectors.js +33 -0
  533. package/lib/state/selectors/zoomSelectors.js +42 -0
  534. package/lib/state/store.js +111 -0
  535. package/lib/state/tooltipSlice.js +228 -0
  536. package/lib/state/touchEventsMiddleware.js +171 -0
  537. package/lib/state/types/AreaSettings.js +1 -0
  538. package/lib/state/types/BarSettings.js +1 -0
  539. package/lib/state/types/LineSettings.js +1 -0
  540. package/lib/state/types/PieSettings.js +1 -0
  541. package/lib/state/types/RadarSettings.js +1 -0
  542. package/lib/state/types/RadialBarSettings.js +1 -0
  543. package/lib/state/types/ScatterSettings.js +1 -0
  544. package/lib/state/types/StackedGraphicalItem.js +24 -0
  545. package/lib/state/zIndexSlice.js +112 -0
  546. package/lib/state/zoomSettingsSlice.js +50 -0
  547. package/lib/state/zoomSlice.js +88 -0
  548. package/lib/synchronisation/syncSelectors.js +9 -0
  549. package/lib/synchronisation/types.js +1 -0
  550. package/lib/synchronisation/useChartSynchronisation.js +375 -0
  551. package/lib/theme/RechartsTheme.js +1 -0
  552. package/lib/theme/RechartsThemeContext.js +32 -0
  553. package/lib/theme/activeStyles.js +110 -0
  554. package/lib/theme/autoTheme.js +156 -0
  555. package/lib/theme/cssStylesToSvgStyles.js +24 -0
  556. package/lib/theme/darkTheme.js +146 -0
  557. package/lib/theme/dataEntryStyles.js +261 -0
  558. package/lib/theme/emptyTheme.js +20 -0
  559. package/lib/theme/graphicalItemIdentity.js +36 -0
  560. package/lib/theme/labelTheme.js +268 -0
  561. package/lib/theme/lightTheme.js +148 -0
  562. package/lib/theme/pageBackground.js +27 -0
  563. package/lib/theme/themeFill.js +103 -0
  564. package/lib/theme/useBackwardsCompatibleTheme.js +54 -0
  565. package/lib/theme/useGraphicalItemIdentity.js +74 -0
  566. package/lib/types.js +1 -0
  567. package/lib/util/ActiveShapeUtils.js +97 -0
  568. package/lib/util/BarUtils.js +52 -0
  569. package/lib/util/CartesianUtils.js +68 -0
  570. package/lib/util/ChartUtils.js +614 -0
  571. package/lib/util/Constants.js +22 -0
  572. package/lib/util/CssPrefixUtils.js +24 -0
  573. package/lib/util/DOMUtils.js +137 -0
  574. package/lib/util/DataUtils.js +212 -0
  575. package/lib/util/Events.js +11 -0
  576. package/lib/util/FunnelUtils.js +24 -0
  577. package/lib/util/Global.js +15 -0
  578. package/lib/util/IfOverflow.js +1 -0
  579. package/lib/util/LRUCache.js +50 -0
  580. package/lib/util/LogUtils.js +26 -0
  581. package/lib/util/PolarUtils.js +136 -0
  582. package/lib/util/RadialBarUtils.js +36 -0
  583. package/lib/util/ReactUtils.js +97 -0
  584. package/lib/util/ReduceCSSCalc.js +198 -0
  585. package/lib/util/ScatterUtils.js +40 -0
  586. package/lib/util/TickUtils.js +47 -0
  587. package/lib/util/XAxisUtils.js +48 -0
  588. package/lib/util/YAxisUtils.js +48 -0
  589. package/lib/util/axisPropsAreEqual.js +47 -0
  590. package/lib/util/clsx.js +61 -0
  591. package/lib/util/createCartesianCharts.js +134 -0
  592. package/lib/util/createEventProxy.js +22 -0
  593. package/lib/util/createPolarCharts.js +118 -0
  594. package/lib/util/cursor/getCursorPoints.js +49 -0
  595. package/lib/util/cursor/getCursorRectangle.js +15 -0
  596. package/lib/util/cursor/getRadialCursorPoints.js +29 -0
  597. package/lib/util/excludeEventProps.js +14 -0
  598. package/lib/util/getActiveCoordinate.js +166 -0
  599. package/lib/util/getAxisTypeBasedOnLayout.js +20 -0
  600. package/lib/util/getClassNameFromUnknown.js +12 -0
  601. package/lib/util/getEveryNth.js +33 -0
  602. package/lib/util/getRadiusAndStrokeWidthFromDot.js +32 -0
  603. package/lib/util/getRelativeCoordinate.js +101 -0
  604. package/lib/util/getSliced.js +12 -0
  605. package/lib/util/isDomainSpecifiedByUser.js +198 -0
  606. package/lib/util/isWellBehavedNumber.js +13 -0
  607. package/lib/util/payload/getUniqPayload.js +26 -0
  608. package/lib/util/propsAreEqual.js +153 -0
  609. package/lib/util/resolveDefaultProps.js +110 -0
  610. package/lib/util/round.js +39 -0
  611. package/lib/util/scale/CartesianScaleHelper.js +65 -0
  612. package/lib/util/scale/CustomScaleDefinition.js +1 -0
  613. package/lib/util/scale/RechartsScale.js +73 -0
  614. package/lib/util/scale/createCategoricalInverse.js +97 -0
  615. package/lib/util/scale/getNiceTickValues.js +300 -0
  616. package/lib/util/scale/index.js +18 -0
  617. package/lib/util/scale/util/arithmetic.js +68 -0
  618. package/lib/util/stacks/getStackSeriesIdentifier.js +14 -0
  619. package/lib/util/stacks/stackTypes.js +1 -0
  620. package/lib/util/svgPropertiesAndEvents.js +57 -0
  621. package/lib/util/svgPropertiesNoEvents.js +83 -0
  622. package/lib/util/tooltip/translate.js +141 -0
  623. package/lib/util/typedDataKey.js +1 -0
  624. package/lib/util/types.js +416 -0
  625. package/lib/util/useAnimationId.js +32 -0
  626. package/lib/util/useCells.js +56 -0
  627. package/lib/util/useEffectiveDataKey.js +32 -0
  628. package/lib/util/useElementOffset.js +1 -0
  629. package/lib/util/useElementSize.js +195 -0
  630. package/lib/util/useId.js +35 -0
  631. package/lib/util/usePrefersReducedMotion.js +48 -0
  632. package/lib/util/useReportScale.js +34 -0
  633. package/lib/util/useUniqueId.js +37 -0
  634. package/lib/util/zoom/ZoomOptions.js +57 -0
  635. package/lib/util/zoom/projection.js +157 -0
  636. package/lib/util/zoom/transform.js +104 -0
  637. package/lib/util/zoom/viewport.js +233 -0
  638. package/lib/util/zoom/viewportWindow.js +176 -0
  639. package/lib/util/zoom/zoomActions.js +134 -0
  640. package/lib/zIndex/DefaultZIndexes.js +93 -0
  641. package/lib/zIndex/StaticZIndexLayers.js +56 -0
  642. package/lib/zIndex/ZIndexLayer.js +149 -0
  643. package/lib/zIndex/ZIndexPortal.js +68 -0
  644. package/lib/zIndex/getZIndexFromUnknown.js +13 -0
  645. package/lib/zIndex/labelBackgroundZIndex.js +58 -0
  646. package/lib/zIndex/zIndexSelectors.js +37 -0
  647. package/package.json +2 -1
  648. package/types/animation/AnimatedItems.d.ts +105 -0
  649. package/types/animation/AnimationController.d.ts +29 -0
  650. package/types/animation/AnimationControllerImpl.d.ts +9 -0
  651. package/types/animation/AnimationHandle.d.ts +180 -0
  652. package/types/animation/CSSTransitionAnimate.d.ts +22 -0
  653. package/types/animation/JavascriptAnimate.d.ts +17 -0
  654. package/types/animation/easing.d.ts +41 -0
  655. package/types/animation/matchBy.d.ts +113 -0
  656. package/types/animation/timeoutController.d.ts +49 -0
  657. package/types/animation/useAnimationController.d.ts +24 -0
  658. package/types/animation/useAnimationStartSnapshot.d.ts +56 -0
  659. package/types/animation/useZoomAwareAnimation.d.ts +63 -0
  660. package/types/animation/util.d.ts +2 -0
  661. package/types/cartesian/Area.d.ts +327 -0
  662. package/types/cartesian/AreaRevealShape.d.ts +35 -0
  663. package/types/cartesian/Bar.d.ts +406 -0
  664. package/types/cartesian/BarStack.d.ts +69 -0
  665. package/types/cartesian/Brush.d.ts +174 -0
  666. package/types/cartesian/CartesianAxis.d.ts +108 -0
  667. package/types/cartesian/CartesianGrid.d.ts +218 -0
  668. package/types/cartesian/ErrorBar.d.ts +126 -0
  669. package/types/cartesian/Funnel.d.ts +250 -0
  670. package/types/cartesian/GraphicalItemClipPath.d.ts +28 -0
  671. package/types/cartesian/Line.d.ts +329 -0
  672. package/types/cartesian/LineDrawShape.d.ts +50 -0
  673. package/types/cartesian/ReferenceArea.d.ts +144 -0
  674. package/types/cartesian/ReferenceDot.d.ts +152 -0
  675. package/types/cartesian/ReferenceLine.d.ts +160 -0
  676. package/types/cartesian/Scatter.d.ts +357 -0
  677. package/types/cartesian/XAxis.d.ts +202 -0
  678. package/types/cartesian/YAxis.d.ts +213 -0
  679. package/types/cartesian/ZAxis.d.ts +91 -0
  680. package/types/cartesian/cartesianPositionToCSSTranslate.d.ts +15 -0
  681. package/types/cartesian/cartesianViewBoxToTrapezoid.d.ts +3 -0
  682. package/types/cartesian/getCartesianPosition.d.ts +60 -0
  683. package/types/cartesian/getEquidistantTicks.d.ts +10 -0
  684. package/types/cartesian/getTicks.d.ts +15 -0
  685. package/types/cartesian/useAnimatedLineLength.d.ts +23 -0
  686. package/types/cartesian/zoomedLineLength.d.ts +38 -0
  687. package/types/chart/AreaChart.d.ts +11 -0
  688. package/types/chart/BarChart.d.ts +11 -0
  689. package/types/chart/CartesianChart.d.ts +29 -0
  690. package/types/chart/CategoricalChart.d.ts +3 -0
  691. package/types/chart/ComposedChart.d.ts +11 -0
  692. package/types/chart/FunnelChart.d.ts +11 -0
  693. package/types/chart/LineChart.d.ts +11 -0
  694. package/types/chart/PieChart.d.ts +30 -0
  695. package/types/chart/PolarChart.d.ts +53 -0
  696. package/types/chart/RadarChart.d.ts +30 -0
  697. package/types/chart/RadialBarChart.d.ts +30 -0
  698. package/types/chart/RechartsWrapper.d.ts +27 -0
  699. package/types/chart/Sankey.d.ts +289 -0
  700. package/types/chart/ScatterChart.d.ts +11 -0
  701. package/types/chart/StaticCartesianChart.d.ts +7 -0
  702. package/types/chart/SunburstChart.d.ts +185 -0
  703. package/types/chart/Treemap.d.ts +219 -0
  704. package/types/chart/types.d.ts +53 -0
  705. package/types/chart/zoom/SelectionOverlay.d.ts +18 -0
  706. package/types/chart/zoom/ZoomAndPan.d.ts +119 -0
  707. package/types/chart/zoom/ZoomGestureApi.d.ts +96 -0
  708. package/types/chart/zoom/ZoomStateSync.d.ts +25 -0
  709. package/types/chart/zoom/doubleClickGesture.d.ts +11 -0
  710. package/types/chart/zoom/keyboardGesture.d.ts +50 -0
  711. package/types/chart/zoom/pointerGesture.d.ts +27 -0
  712. package/types/chart/zoom/touchGesture.d.ts +40 -0
  713. package/types/chart/zoom/useZoomApi.d.ts +18 -0
  714. package/types/chart/zoom/wheelGesture.d.ts +18 -0
  715. package/types/component/ActivePoints.d.ts +30 -0
  716. package/types/component/Cell.d.ts +29 -0
  717. package/types/component/Cursor.d.ts +27 -0
  718. package/types/component/Customized.d.ts +34 -0
  719. package/types/component/DefaultLegendContent.d.ts +189 -0
  720. package/types/component/DefaultTooltipContent.d.ts +72 -0
  721. package/types/component/Dots.d.ts +50 -0
  722. package/types/component/Label.d.ts +203 -0
  723. package/types/component/LabelList.d.ts +244 -0
  724. package/types/component/Legend.d.ts +121 -0
  725. package/types/component/ResponsiveContainer.d.ts +83 -0
  726. package/types/component/Text.d.ts +262 -0
  727. package/types/component/Tooltip.d.ts +251 -0
  728. package/types/component/TooltipBoundingBox.d.ts +26 -0
  729. package/types/component/responsiveContainerUtils.d.ts +47 -0
  730. package/types/container/ClipPathProvider.d.ts +16 -0
  731. package/types/container/Layer.d.ts +21 -0
  732. package/types/container/RootSurface.d.ts +10 -0
  733. package/types/container/Surface.d.ts +27 -0
  734. package/types/context/ErrorBarContext.d.ts +25 -0
  735. package/types/context/PDFContext.d.ts +2 -0
  736. package/types/context/PanoramaContext.d.ts +6 -0
  737. package/types/context/RegisterGraphicalItemId.d.ts +13 -0
  738. package/types/context/accessibilityContext.d.ts +1 -0
  739. package/types/context/brushUpdateContext.d.ts +6 -0
  740. package/types/context/chartDataContext.d.ts +34 -0
  741. package/types/context/chartLayoutContext.d.ts +126 -0
  742. package/types/context/legendPayloadContext.d.ts +6 -0
  743. package/types/context/legendPortalContext.d.ts +2 -0
  744. package/types/context/tooltipContext.d.ts +15 -0
  745. package/types/context/tooltipPortalContext.d.ts +2 -0
  746. package/types/context/useTooltipAxis.d.ts +3 -0
  747. package/types/fill/RechartsFill.d.ts +286 -0
  748. package/types/fill/fillDefinitions.d.ts +183 -0
  749. package/types/fill/symbolPath.d.ts +9 -0
  750. package/types/hooks.d.ts +458 -0
  751. package/types/index.d.ts +169 -0
  752. package/types/polar/Pie.d.ts +398 -0
  753. package/types/polar/PolarAngleAxis.d.ts +190 -0
  754. package/types/polar/PolarGrid.d.ts +128 -0
  755. package/types/polar/PolarRadiusAxis.d.ts +191 -0
  756. package/types/polar/Radar.d.ts +256 -0
  757. package/types/polar/RadialBar.d.ts +301 -0
  758. package/types/polar/defaultPolarAngleAxisProps.d.ts +23 -0
  759. package/types/polar/defaultPolarRadiusAxisProps.d.ts +20 -0
  760. package/types/polar/isOutsidePolarPosition.d.ts +13 -0
  761. package/types/shape/Cross.d.ts +52 -0
  762. package/types/shape/Curve.d.ts +130 -0
  763. package/types/shape/Dot.d.ts +45 -0
  764. package/types/shape/DotSymbol.d.ts +50 -0
  765. package/types/shape/Polygon.d.ts +87 -0
  766. package/types/shape/Rectangle.d.ts +138 -0
  767. package/types/shape/Sector.d.ts +126 -0
  768. package/types/shape/Symbols.d.ts +48 -0
  769. package/types/shape/Trapezoid.d.ts +104 -0
  770. package/types/state/RechartsReduxContext.d.ts +17 -0
  771. package/types/state/RechartsStoreProvider.d.ts +12 -0
  772. package/types/state/ReportChartProps.d.ts +2 -0
  773. package/types/state/ReportEventSettings.d.ts +2 -0
  774. package/types/state/ReportMainChartProps.d.ts +13 -0
  775. package/types/state/ReportPolarOptions.d.ts +2 -0
  776. package/types/state/SetGraphicalItem.d.ts +3 -0
  777. package/types/state/SetLegendPayload.d.ts +7 -0
  778. package/types/state/SetTooltipEntrySettings.d.ts +4 -0
  779. package/types/state/brushSlice.d.ts +18 -0
  780. package/types/state/cartesianAxisSlice.d.ts +184 -0
  781. package/types/state/chartDataSlice.d.ts +55 -0
  782. package/types/state/errorBarSlice.d.ts +34 -0
  783. package/types/state/eventSettingsSlice.d.ts +6 -0
  784. package/types/state/externalEventsMiddleware.d.ts +20 -0
  785. package/types/state/graphicalItemsSlice.d.ts +84 -0
  786. package/types/state/hooks.d.ts +27 -0
  787. package/types/state/keyboardEventsMiddleware.d.ts +6 -0
  788. package/types/state/keyboardTooltipVisibility.d.ts +21 -0
  789. package/types/state/layoutSlice.d.ts +16 -0
  790. package/types/state/legendSlice.d.ts +38 -0
  791. package/types/state/mouseEventsMiddleware.d.ts +15 -0
  792. package/types/state/optionsSlice.d.ts +28 -0
  793. package/types/state/polarAxisSlice.d.ts +11 -0
  794. package/types/state/polarOptionsSlice.d.ts +13 -0
  795. package/types/state/reduxDevtoolsJsonStringifyReplacer.d.ts +1 -0
  796. package/types/state/referenceElementsSlice.d.ts +42 -0
  797. package/types/state/renderedTicksSlice.d.ts +41 -0
  798. package/types/state/rootPropsSlice.d.ts +35 -0
  799. package/types/state/selectors/areaSelectors.d.ts +20 -0
  800. package/types/state/selectors/arrayEqualityCheck.d.ts +13 -0
  801. package/types/state/selectors/axisSelectors.d.ts +284 -0
  802. package/types/state/selectors/barSelectors.d.ts +52 -0
  803. package/types/state/selectors/barStackSelectors.d.ts +31 -0
  804. package/types/state/selectors/brushSelectors.d.ts +10 -0
  805. package/types/state/selectors/combiners/combineActiveLabel.d.ts +4 -0
  806. package/types/state/selectors/combiners/combineActiveTooltipIndex.d.ts +4 -0
  807. package/types/state/selectors/combiners/combineAllBarPositions.d.ts +2 -0
  808. package/types/state/selectors/combiners/combineAxisRangeWithReverse.d.ts +3 -0
  809. package/types/state/selectors/combiners/combineBarPosition.d.ts +4 -0
  810. package/types/state/selectors/combiners/combineBarSizeList.d.ts +21 -0
  811. package/types/state/selectors/combiners/combineCheckedDomain.d.ts +5 -0
  812. package/types/state/selectors/combiners/combineConfiguredScale.d.ts +16 -0
  813. package/types/state/selectors/combiners/combineCoordinateForDefaultIndex.d.ts +3 -0
  814. package/types/state/selectors/combiners/combineDisplayedStackedData.d.ts +17 -0
  815. package/types/state/selectors/combiners/combineInverseScaleFunction.d.ts +3 -0
  816. package/types/state/selectors/combiners/combinePlaceTooltipIndex.d.ts +28 -0
  817. package/types/state/selectors/combiners/combineRealScaleType.d.ts +3 -0
  818. package/types/state/selectors/combiners/combineStackedData.d.ts +3 -0
  819. package/types/state/selectors/combiners/combineTooltipInteractionState.d.ts +5 -0
  820. package/types/state/selectors/combiners/combineTooltipPayload.d.ts +5 -0
  821. package/types/state/selectors/combiners/combineTooltipPayloadConfigurations.d.ts +4 -0
  822. package/types/state/selectors/containerSelectors.d.ts +6 -0
  823. package/types/state/selectors/dataSelectors.d.ts +42 -0
  824. package/types/state/selectors/effectiveDataKeySelectors.d.ts +55 -0
  825. package/types/state/selectors/funnelSelectors.d.ts +35 -0
  826. package/types/state/selectors/graphicalItemSelectors.d.ts +6 -0
  827. package/types/state/selectors/legendSelectors.d.ts +7 -0
  828. package/types/state/selectors/lineSelectors.d.ts +5 -0
  829. package/types/state/selectors/numberDomainEqualityCheck.d.ts +2 -0
  830. package/types/state/selectors/pickAxisId.d.ts +3 -0
  831. package/types/state/selectors/pickAxisType.d.ts +2 -0
  832. package/types/state/selectors/pieSelectors.d.ts +9 -0
  833. package/types/state/selectors/polarAxisSelectors.d.ts +22 -0
  834. package/types/state/selectors/polarGridSelectors.d.ts +6 -0
  835. package/types/state/selectors/polarScaleSelectors.d.ts +10 -0
  836. package/types/state/selectors/polarSelectors.d.ts +42 -0
  837. package/types/state/selectors/radarSelectors.d.ts +9 -0
  838. package/types/state/selectors/radialBarSelectors.d.ts +22 -0
  839. package/types/state/selectors/rootPropsSelectors.d.ts +15 -0
  840. package/types/state/selectors/scatterSelectors.d.ts +7 -0
  841. package/types/state/selectors/selectActivePropsFromChartPointer.d.ts +4 -0
  842. package/types/state/selectors/selectAllAxes.d.ts +4 -0
  843. package/types/state/selectors/selectChartOffset.d.ts +23 -0
  844. package/types/state/selectors/selectChartOffsetInternal.d.ts +56 -0
  845. package/types/state/selectors/selectLegendArea.d.ts +3 -0
  846. package/types/state/selectors/selectPlotArea.d.ts +61 -0
  847. package/types/state/selectors/selectTooltipAxisId.d.ts +3 -0
  848. package/types/state/selectors/selectTooltipAxisType.d.ts +10 -0
  849. package/types/state/selectors/selectTooltipEventType.d.ts +8 -0
  850. package/types/state/selectors/selectTooltipPayloadSearcher.d.ts +3 -0
  851. package/types/state/selectors/selectTooltipSettings.d.ts +3 -0
  852. package/types/state/selectors/selectTooltipState.d.ts +3 -0
  853. package/types/state/selectors/selectors.d.ts +40 -0
  854. package/types/state/selectors/tooltipSelectors.d.ts +92 -0
  855. package/types/state/selectors/touchSelectors.d.ts +5 -0
  856. package/types/state/selectors/zoomProjectionSelectors.d.ts +12 -0
  857. package/types/state/selectors/zoomSelectors.d.ts +28 -0
  858. package/types/state/store.d.ts +41 -0
  859. package/types/state/tooltipSlice.d.ts +330 -0
  860. package/types/state/touchEventsMiddleware.d.ts +15 -0
  861. package/types/state/types/AreaSettings.d.ts +12 -0
  862. package/types/state/types/BarSettings.d.ts +17 -0
  863. package/types/state/types/LineSettings.d.ts +8 -0
  864. package/types/state/types/PieSettings.d.ts +26 -0
  865. package/types/state/types/RadarSettings.d.ts +4 -0
  866. package/types/state/types/RadialBarSettings.d.ts +8 -0
  867. package/types/state/types/ScatterSettings.d.ts +11 -0
  868. package/types/state/types/StackedGraphicalItem.d.ts +29 -0
  869. package/types/state/zIndexSlice.d.ts +50 -0
  870. package/types/state/zoomSettingsSlice.d.ts +23 -0
  871. package/types/state/zoomSlice.d.ts +38 -0
  872. package/types/synchronisation/syncSelectors.d.ts +3 -0
  873. package/types/synchronisation/types.d.ts +42 -0
  874. package/types/synchronisation/useChartSynchronisation.d.ts +39 -0
  875. package/types/theme/RechartsTheme.d.ts +293 -0
  876. package/types/theme/RechartsThemeContext.d.ts +22 -0
  877. package/types/theme/activeStyles.d.ts +55 -0
  878. package/types/theme/autoTheme.d.ts +48 -0
  879. package/types/theme/cssStylesToSvgStyles.d.ts +7 -0
  880. package/types/theme/darkTheme.d.ts +38 -0
  881. package/types/theme/dataEntryStyles.d.ts +114 -0
  882. package/types/theme/emptyTheme.d.ts +13 -0
  883. package/types/theme/graphicalItemIdentity.d.ts +25 -0
  884. package/types/theme/labelTheme.d.ts +139 -0
  885. package/types/theme/lightTheme.d.ts +40 -0
  886. package/types/theme/pageBackground.d.ts +12 -0
  887. package/types/theme/themeFill.d.ts +43 -0
  888. package/types/theme/useBackwardsCompatibleTheme.d.ts +15 -0
  889. package/types/theme/useGraphicalItemIdentity.d.ts +29 -0
  890. package/types/types.d.ts +55 -0
  891. package/types/util/ActiveShapeUtils.d.ts +56 -0
  892. package/types/util/BarUtils.d.ts +24 -0
  893. package/types/util/CartesianUtils.d.ts +18 -0
  894. package/types/util/ChartUtils.d.ts +152 -0
  895. package/types/util/Constants.d.ts +14 -0
  896. package/types/util/CssPrefixUtils.d.ts +1 -0
  897. package/types/util/DOMUtils.d.ts +33 -0
  898. package/types/util/DataUtils.d.ts +96 -0
  899. package/types/util/Events.d.ts +12 -0
  900. package/types/util/FunnelUtils.d.ts +9 -0
  901. package/types/util/Global.d.ts +7 -0
  902. package/types/util/IfOverflow.d.ts +17 -0
  903. package/types/util/LRUCache.d.ts +12 -0
  904. package/types/util/LogUtils.d.ts +1 -0
  905. package/types/util/PolarUtils.d.ts +7 -0
  906. package/types/util/RadialBarUtils.d.ts +17 -0
  907. package/types/util/ReactUtils.d.ts +30 -0
  908. package/types/util/ReduceCSSCalc.d.ts +2 -0
  909. package/types/util/ScatterUtils.d.ts +17 -0
  910. package/types/util/TickUtils.d.ts +8 -0
  911. package/types/util/XAxisUtils.d.ts +19 -0
  912. package/types/util/YAxisUtils.d.ts +19 -0
  913. package/types/util/axisPropsAreEqual.d.ts +10 -0
  914. package/types/util/clsx.d.ts +26 -0
  915. package/types/util/createCartesianCharts.d.ts +111 -0
  916. package/types/util/createEventProxy.d.ts +2 -0
  917. package/types/util/createPolarCharts.d.ts +98 -0
  918. package/types/util/cursor/getCursorPoints.d.ts +3 -0
  919. package/types/util/cursor/getCursorRectangle.d.ts +8 -0
  920. package/types/util/cursor/getRadialCursorPoints.d.ts +15 -0
  921. package/types/util/excludeEventProps.d.ts +4 -0
  922. package/types/util/getActiveCoordinate.d.ts +26 -0
  923. package/types/util/getAxisTypeBasedOnLayout.d.ts +6 -0
  924. package/types/util/getClassNameFromUnknown.d.ts +1 -0
  925. package/types/util/getEveryNth.d.ts +12 -0
  926. package/types/util/getRadiusAndStrokeWidthFromDot.d.ts +5 -0
  927. package/types/util/getRelativeCoordinate.d.ts +57 -0
  928. package/types/util/getSliced.d.ts +1 -0
  929. package/types/util/isDomainSpecifiedByUser.d.ts +47 -0
  930. package/types/util/isWellBehavedNumber.d.ts +2 -0
  931. package/types/util/payload/getUniqPayload.d.ts +12 -0
  932. package/types/util/propsAreEqual.d.ts +23 -0
  933. package/types/util/resolveDefaultProps.d.ts +59 -0
  934. package/types/util/round.d.ts +7 -0
  935. package/types/util/scale/CartesianScaleHelper.d.ts +43 -0
  936. package/types/util/scale/CustomScaleDefinition.d.ts +72 -0
  937. package/types/util/scale/RechartsScale.d.ts +75 -0
  938. package/types/util/scale/createCategoricalInverse.d.ts +18 -0
  939. package/types/util/scale/getNiceTickValues.d.ts +88 -0
  940. package/types/util/scale/index.d.ts +1 -0
  941. package/types/util/scale/util/arithmetic.d.ts +27 -0
  942. package/types/util/stacks/getStackSeriesIdentifier.d.ts +5 -0
  943. package/types/util/stacks/stackTypes.d.ts +42 -0
  944. package/types/util/svgPropertiesAndEvents.d.ts +28 -0
  945. package/types/util/svgPropertiesNoEvents.d.ts +34 -0
  946. package/types/util/tooltip/translate.d.ts +41 -0
  947. package/types/util/typedDataKey.d.ts +16 -0
  948. package/types/util/types.d.ts +1605 -0
  949. package/types/util/useAnimationId.d.ts +15 -0
  950. package/types/util/useCells.d.ts +20 -0
  951. package/types/util/useEffectiveDataKey.d.ts +12 -0
  952. package/types/util/useElementOffset.d.ts +24 -0
  953. package/types/util/useElementSize.d.ts +85 -0
  954. package/types/util/useId.d.ts +8 -0
  955. package/types/util/usePrefersReducedMotion.d.ts +6 -0
  956. package/types/util/useReportScale.d.ts +1 -0
  957. package/types/util/useUniqueId.d.ts +19 -0
  958. package/types/util/zoom/ZoomOptions.d.ts +30 -0
  959. package/types/util/zoom/projection.d.ts +39 -0
  960. package/types/util/zoom/transform.d.ts +27 -0
  961. package/types/util/zoom/viewport.d.ts +120 -0
  962. package/types/util/zoom/viewportWindow.d.ts +36 -0
  963. package/types/util/zoom/zoomActions.d.ts +52 -0
  964. package/types/zIndex/DefaultZIndexes.d.ts +82 -0
  965. package/types/zIndex/StaticZIndexLayers.d.ts +9 -0
  966. package/types/zIndex/ZIndexLayer.d.ts +49 -0
  967. package/types/zIndex/ZIndexPortal.d.ts +5 -0
  968. package/types/zIndex/getZIndexFromUnknown.d.ts +1 -0
  969. package/types/zIndex/labelBackgroundZIndex.d.ts +17 -0
  970. package/types/zIndex/zIndexSelectors.d.ts +41 -0
  971. package/umd/Recharts.js +3 -0
  972. package/umd/Recharts.js.LICENSE.txt +44 -0
  973. package/umd/Recharts.js.map +1 -0
  974. 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
+ }