@octanejs/recharts 0.1.40 → 0.1.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{LICENSE → LICENSE.recharts} +3 -2
- package/README.md +12 -0
- package/package.json +10 -9
- package/src/animation/AnimatedItems.tsrx +36 -3
- package/src/animation/AnimationController.ts +17 -65
- package/src/animation/{AnimationControllerImpl.js → AnimationControllerImpl.ts} +19 -12
- package/src/animation/{AnimationHandle.js → AnimationHandle.ts} +82 -65
- package/src/animation/CSSTransitionAnimate.tsrx +3 -2
- package/src/animation/JavascriptAnimate.tsrx +18 -2
- package/src/animation/easing.ts +235 -0
- package/src/animation/{matchBy.js → matchBy.ts} +76 -120
- package/src/animation/timeoutController.ts +71 -0
- package/src/animation/useAnimationController.ts +4 -1
- package/src/animation/useAnimationStartSnapshot.ts +3 -3
- package/src/animation/util.ts +12 -0
- package/src/cartesian/Area.tsrx +33 -31
- package/src/cartesian/AreaRevealShape.tsrx +4 -3
- package/src/cartesian/Bar.ts +1 -0
- package/src/cartesian/Bar.tsrx +293 -39
- package/src/cartesian/BarStack.tsrx +31 -9
- package/src/cartesian/CartesianAxis.tsrx +154 -22
- package/src/cartesian/CartesianGrid.tsrx +5 -6
- package/src/cartesian/ErrorBar.tsrx +9 -8
- package/src/cartesian/Funnel.tsrx +40 -37
- package/src/cartesian/GraphicalItemClipPath.tsrx +11 -4
- package/src/cartesian/Line.ts +1 -0
- package/src/cartesian/Line.tsrx +206 -28
- package/src/cartesian/LineDrawShape.tsrx +23 -10
- package/src/cartesian/ReferenceLine.tsrx +8 -8
- package/src/cartesian/Scatter.tsrx +61 -66
- package/src/cartesian/XAxis.tsrx +78 -9
- package/src/cartesian/YAxis.tsrx +85 -12
- package/src/cartesian/getCartesianPosition.ts +265 -0
- package/src/cartesian/getEquidistantTicks.ts +144 -0
- package/src/cartesian/getTicks.ts +221 -0
- package/src/chart/AreaChart.tsrx +5 -1
- package/src/chart/BarChart.tsrx +8 -2
- package/src/chart/CartesianChart.tsrx +17 -4
- package/src/chart/CategoricalChart.tsrx +4 -1
- package/src/chart/ComposedChart.tsrx +5 -1
- package/src/chart/FunnelChart.tsrx +5 -1
- package/src/chart/LineChart.tsrx +8 -2
- package/src/chart/PieChart.tsrx +6 -2
- package/src/chart/PolarChart.tsrx +5 -4
- package/src/chart/RadarChart.tsrx +6 -2
- package/src/chart/RadialBarChart.tsrx +6 -2
- package/src/chart/RechartsWrapper.tsrx +57 -21
- package/src/chart/Sankey.tsrx +89 -91
- package/src/chart/ScatterChart.tsrx +5 -1
- package/src/chart/SunburstChart.tsrx +21 -14
- package/src/chart/types.ts +0 -1
- package/src/component/ActivePoints.tsrx +30 -5
- package/src/component/Cell.ts +19 -1
- package/src/component/Cursor.tsrx +11 -10
- package/src/component/DefaultLegendContent.tsrx +15 -10
- package/src/component/DefaultTooltipContent.tsrx +11 -9
- package/src/component/Dots.tsrx +37 -6
- package/src/component/Label.tsrx +99 -19
- package/src/component/LabelList.tsrx +54 -5
- package/src/component/Legend.tsrx +9 -5
- package/src/component/ResponsiveContainer.tsrx +13 -10
- package/src/component/Text.tsrx +95 -32
- package/src/component/Tooltip.tsrx +11 -10
- package/src/component/TooltipBoundingBox.tsrx +4 -5
- package/src/component/{responsiveContainerUtils.js → responsiveContainerUtils.ts} +59 -36
- package/src/container/ClipPathProvider.tsrx +6 -2
- package/src/container/Layer.tsrx +8 -1
- package/src/container/RootSurface.tsrx +15 -4
- package/src/container/Surface.tsrx +15 -1
- package/src/context/CellsContext.ts +6 -5
- package/src/context/ErrorBarContext.tsrx +23 -4
- package/src/context/RegisterGraphicalItemId.tsrx +10 -2
- package/src/context/accessibilityContext.ts +5 -0
- package/src/context/brushUpdateContext.ts +11 -0
- package/src/context/chartDataContext.ts +5 -4
- package/src/context/chartLayoutContext.ts +22 -8
- package/src/context/legendPayloadContext.tsrx +1 -1
- package/src/context/tooltipContext.ts +83 -0
- package/src/{hooks.js → hooks.ts} +88 -66
- package/src/index.ts +37 -37
- package/src/internal.ts +4 -20
- package/src/legacy-props.ts +129 -0
- package/src/polar/Pie.tsrx +91 -69
- package/src/polar/PolarAngleAxis.tsrx +47 -47
- package/src/polar/PolarGrid.tsrx +7 -6
- package/src/polar/PolarRadiusAxis.tsrx +29 -21
- package/src/polar/Radar.tsrx +26 -19
- package/src/polar/RadialBar.tsrx +59 -42
- package/src/polar/{defaultPolarAngleAxisProps.js → defaultPolarAngleAxisProps.ts} +6 -6
- package/src/polar/{defaultPolarRadiusAxisProps.js → defaultPolarRadiusAxisProps.ts} +5 -4
- package/src/shape/Cross.tsrx +14 -2
- package/src/shape/Curve.tsrx +111 -23
- package/src/shape/Dot.tsrx +12 -1
- package/src/shape/Polygon.tsrx +28 -6
- package/src/shape/Rectangle.tsrx +30 -3
- package/src/shape/Sector.tsrx +48 -6
- package/src/shape/Symbols.tsrx +24 -6
- package/src/shape/Trapezoid.tsrx +33 -3
- package/src/state/RechartsStoreProvider.tsrx +11 -2
- package/src/state/ReportChartProps.ts +2 -2
- package/src/state/ReportMainChartProps.ts +2 -1
- package/src/state/SetGraphicalItem.ts +6 -4
- package/src/state/SetLegendPayload.ts +7 -4
- package/src/state/SetTooltipEntrySettings.ts +5 -2
- package/src/state/brushSlice.ts +40 -0
- package/src/state/cartesianAxisSlice.ts +291 -0
- package/src/state/chartDataSlice.ts +87 -0
- package/src/state/errorBarSlice.ts +78 -0
- package/src/state/eventSettingsSlice.ts +30 -0
- package/src/state/{externalEventsMiddleware.js → externalEventsMiddleware.ts} +55 -34
- package/src/state/graphicalItemsSlice.ts +180 -0
- package/src/state/{keyboardEventsMiddleware.js → keyboardEventsMiddleware.ts} +72 -57
- package/src/state/layoutSlice.ts +50 -0
- package/src/state/legendSlice.ts +109 -0
- package/src/state/{mouseEventsMiddleware.js → mouseEventsMiddleware.ts} +45 -35
- package/src/state/optionsSlice.ts +65 -0
- package/src/state/polarAxisSlice.ts +42 -0
- package/src/state/polarOptionsSlice.ts +43 -0
- package/src/state/reduxDevtoolsJsonStringifyReplacer.ts +13 -0
- package/src/state/referenceElementsSlice.ts +100 -0
- package/src/state/renderedTicksSlice.ts +60 -0
- package/src/state/rootPropsSlice.ts +72 -0
- package/src/state/selectors/areaSelectors.ts +1 -2
- package/src/state/selectors/{arrayEqualityCheck.js → arrayEqualityCheck.ts} +4 -5
- package/src/state/selectors/axisSelectors.ts +2502 -0
- package/src/state/selectors/barSelectors.ts +373 -0
- package/src/state/selectors/barStackSelectors.ts +99 -0
- package/src/state/selectors/brushSelectors.ts +28 -0
- package/src/state/selectors/combiners/combineActiveLabel.ts +16 -0
- package/src/state/selectors/combiners/{combineActiveTooltipIndex.js → combineActiveTooltipIndex.ts} +45 -23
- package/src/state/selectors/combiners/combineAllBarPositions.ts +130 -0
- package/src/state/selectors/combiners/combineAxisRangeWithReverse.ts +16 -0
- package/src/state/selectors/combiners/combineBarPosition.ts +23 -0
- package/src/state/selectors/combiners/combineBarSizeList.ts +79 -0
- package/src/state/selectors/combiners/{combineCheckedDomain.js → combineCheckedDomain.ts} +9 -6
- package/src/state/selectors/combiners/combineConfiguredScale.ts +100 -0
- package/src/state/selectors/combiners/combineCoordinateForDefaultIndex.ts +46 -0
- package/src/state/selectors/combiners/{combineDisplayedStackedData.js → combineDisplayedStackedData.ts} +23 -19
- package/src/state/selectors/combiners/combineInverseScaleFunction.ts +16 -0
- package/src/state/selectors/combiners/{combineRealScaleType.js → combineRealScaleType.ts} +16 -8
- package/src/state/selectors/combiners/combineStackedData.ts +27 -0
- package/src/state/selectors/combiners/combineTooltipInteractionState.ts +86 -0
- package/src/state/selectors/combiners/combineTooltipPayload.ts +201 -0
- package/src/state/selectors/combiners/{combineTooltipPayloadConfigurations.js → combineTooltipPayloadConfigurations.ts} +17 -18
- package/src/state/selectors/containerSelectors.ts +12 -0
- package/src/state/selectors/{dataSelectors.js → dataSelectors.ts} +43 -41
- package/src/state/selectors/funnelSelectors.ts +5 -5
- package/src/state/selectors/graphicalItemSelectors.ts +22 -0
- package/src/state/selectors/legendSelectors.ts +25 -0
- package/src/state/selectors/lineSelectors.ts +159 -0
- package/src/state/selectors/numberDomainEqualityCheck.ts +15 -0
- package/src/state/selectors/pickAxisId.ts +6 -0
- package/src/state/selectors/pickAxisType.ts +4 -0
- package/src/state/selectors/pieSelectors.ts +14 -13
- package/src/state/selectors/polarAxisSelectors.ts +223 -0
- package/src/state/selectors/polarSelectors.ts +1 -1
- package/src/state/selectors/radarSelectors.ts +1 -1
- package/src/state/selectors/radialBarSelectors.ts +17 -16
- package/src/state/selectors/rootPropsSelectors.ts +26 -0
- package/src/state/selectors/scatterSelectors.ts +11 -10
- package/src/state/selectors/{selectActivePropsFromChartPointer.js → selectActivePropsFromChartPointer.ts} +11 -4
- package/src/state/selectors/selectAllAxes.ts +20 -0
- package/src/state/selectors/selectChartOffset.ts +17 -0
- package/src/state/selectors/selectChartOffsetInternal.ts +147 -0
- package/src/state/selectors/{selectPlotArea.js → selectPlotArea.ts} +4 -3
- package/src/state/selectors/selectTooltipAxisId.ts +6 -0
- package/src/state/selectors/{selectTooltipAxisType.js → selectTooltipAxisType.ts} +10 -4
- package/src/state/selectors/selectTooltipEventType.ts +39 -0
- package/src/state/selectors/selectTooltipPayloadSearcher.ts +6 -0
- package/src/state/selectors/selectTooltipSettings.ts +6 -0
- package/src/state/selectors/selectTooltipState.ts +5 -0
- package/src/state/selectors/selectors.ts +315 -0
- package/src/state/selectors/tooltipSelectors.ts +611 -0
- package/src/state/selectors/touchSelectors.ts +52 -0
- package/src/state/{store.js → store.ts} +46 -36
- package/src/state/tooltipSlice.ts +507 -0
- package/src/state/{touchEventsMiddleware.js → touchEventsMiddleware.ts} +54 -42
- package/src/state/types/AreaSettings.ts +15 -0
- package/src/state/types/BarSettings.ts +15 -0
- package/src/state/types/LineSettings.ts +10 -0
- package/src/state/types/PieSettings.ts +32 -0
- package/src/state/types/RadarSettings.ts +6 -0
- package/src/state/types/RadialBarSettings.ts +10 -0
- package/src/state/types/ScatterSettings.ts +13 -0
- package/src/state/types/StackedGraphicalItem.ts +34 -0
- package/src/state/zIndexSlice.ts +137 -0
- package/src/synchronisation/syncSelectors.ts +7 -0
- package/src/synchronisation/types.ts +42 -0
- package/src/synchronisation/useChartSynchronisation.tsrx +26 -11
- package/src/types.ts +55 -0
- package/src/util/ActiveShapeUtils.tsrx +34 -10
- package/src/util/BarUtils.tsrx +43 -3
- package/src/util/{CartesianUtils.js → CartesianUtils.ts} +22 -39
- package/src/util/ChartUtils.ts +759 -0
- package/src/util/{Constants.js → Constants.ts} +6 -6
- package/src/util/DOMUtils.ts +135 -0
- package/src/util/{DataUtils.js → DataUtils.ts} +120 -47
- package/src/util/Events.ts +22 -0
- package/src/util/FunnelUtils.tsrx +3 -3
- package/src/util/Global.ts +13 -0
- package/src/util/IfOverflow.ts +16 -0
- package/src/util/LRUCache.ts +42 -0
- package/src/util/{LogUtils.js → LogUtils.ts} +7 -12
- package/src/util/OctaneTypes.ts +51 -0
- package/src/util/PolarUtils.ts +132 -0
- package/src/util/RadialBarUtils.tsrx +3 -3
- package/src/util/ReduceCSSCalc.ts +186 -0
- package/src/util/ScatterUtils.tsrx +9 -7
- package/src/util/{TickUtils.js → TickUtils.ts} +30 -13
- package/src/util/{YAxisUtils.js → YAxisUtils.ts} +27 -17
- package/src/util/axisPropsAreEqual.ts +49 -0
- package/src/util/createEventProxy.ts +20 -0
- package/src/util/{excludeEventProps.js → excludeEventProps.ts} +8 -6
- package/src/util/getActiveCoordinate.ts +210 -0
- package/src/util/{getAxisTypeBasedOnLayout.js → getAxisTypeBasedOnLayout.ts} +7 -3
- package/src/util/getClassNameFromUnknown.ts +7 -0
- package/src/util/{getEveryNth.js → getEveryNth.ts} +5 -6
- package/src/util/getRadiusAndStrokeWidthFromDot.ts +31 -0
- package/src/util/{getRelativeCoordinate.js → getRelativeCoordinate.ts} +26 -9
- package/src/util/getSliced.ts +14 -0
- package/src/util/{isDomainSpecifiedByUser.js → isDomainSpecifiedByUser.ts} +46 -100
- package/src/util/isWellBehavedNumber.ts +8 -0
- package/src/util/payload/getUniqPayload.ts +1 -1
- package/src/util/{propsAreEqual.js → propsAreEqual.ts} +10 -8
- package/src/util/{resolveDefaultProps.js → resolveDefaultProps.ts} +35 -57
- package/src/util/round.ts +33 -0
- package/src/util/scale/CustomScaleDefinition.ts +82 -0
- package/src/util/scale/RechartsScale.ts +131 -0
- package/src/util/scale/{createCategoricalInverse.js → createCategoricalInverse.ts} +24 -29
- package/src/util/scale/{getNiceTickValues.js → getNiceTickValues.ts} +125 -146
- package/src/util/scale/index.ts +2 -0
- package/src/util/scale/util/{arithmetic.js → arithmetic.ts} +12 -8
- package/src/util/stacks/getStackSeriesIdentifier.ts +21 -0
- package/src/util/stacks/stackTypes.ts +58 -0
- package/src/util/{svgPropertiesNoEvents.js → svgPropertiesNoEvents.ts} +52 -27
- package/src/util/tooltip/translate.ts +2 -1
- package/src/util/typedDataKey.ts +49 -0
- package/src/util/types.ts +1265 -7
- package/src/util/{useUniqueId.js → useUniqueId.ts} +9 -5
- package/src/zIndex/{DefaultZIndexes.js → DefaultZIndexes.ts} +13 -4
- package/src/zIndex/ZIndexLayer.tsrx +13 -4
- package/src/zIndex/ZIndexPortal.tsrx +14 -4
- package/src/zIndex/{getZIndexFromUnknown.js → getZIndexFromUnknown.ts} +3 -3
- package/src/zIndex/{zIndexSelectors.js → zIndexSelectors.ts} +17 -11
- package/src/animation/easing.js +0 -193
- package/src/animation/timeoutController.js +0 -49
- package/src/animation/util.js +0 -11
- package/src/cartesian/Area.tsrx.d.ts +0 -340
- package/src/cartesian/Bar.tsrx.d.ts +0 -4
- package/src/cartesian/BarStack.tsrx.d.ts +0 -6
- package/src/cartesian/CartesianAxis.tsrx.d.ts +0 -3
- package/src/cartesian/CartesianGrid.tsrx.d.ts +0 -219
- package/src/cartesian/ErrorBar.tsrx.d.ts +0 -131
- package/src/cartesian/Funnel.tsrx.d.ts +0 -274
- package/src/cartesian/Line.tsrx.d.ts +0 -4
- package/src/cartesian/LineDrawShape.tsrx.d.ts +0 -2
- package/src/cartesian/ReferenceLine.tsrx.d.ts +0 -178
- package/src/cartesian/Scatter.tsrx.d.ts +0 -351
- package/src/cartesian/XAxis.tsrx.d.ts +0 -3
- package/src/cartesian/YAxis.tsrx.d.ts +0 -3
- package/src/cartesian/ZAxis.tsrx.d.ts +0 -102
- package/src/cartesian/getCartesianPosition.js +0 -277
- package/src/cartesian/getEquidistantTicks.js +0 -133
- package/src/cartesian/getTicks.js +0 -280
- package/src/chart/AreaChart.tsrx.d.ts +0 -12
- package/src/chart/BarChart.tsrx.d.ts +0 -2
- package/src/chart/CartesianChart.tsrx.d.ts +0 -10
- package/src/chart/ComposedChart.tsrx.d.ts +0 -12
- package/src/chart/FunnelChart.tsrx.d.ts +0 -12
- package/src/chart/LineChart.tsrx.d.ts +0 -2
- package/src/chart/PieChart.tsrx.d.ts +0 -31
- package/src/chart/RadarChart.tsrx.d.ts +0 -31
- package/src/chart/RadialBarChart.tsrx.d.ts +0 -31
- package/src/chart/Sankey.tsrx.d.ts +0 -253
- package/src/chart/ScatterChart.tsrx.d.ts +0 -12
- package/src/chart/SunburstChart.tsrx.d.ts +0 -146
- package/src/component/DefaultLegendContent.tsrx.d.ts +0 -125
- package/src/component/DefaultTooltipContent.tsrx.d.ts +0 -87
- package/src/component/Label.tsrx.d.ts +0 -12
- package/src/component/LabelList.tsrx.d.ts +0 -8
- package/src/component/Legend.tsrx.d.ts +0 -88
- package/src/component/ResponsiveContainer.tsrx.d.ts +0 -81
- package/src/component/Text.tsrx.d.ts +0 -9
- package/src/component/Tooltip.tsrx.d.ts +0 -246
- package/src/container/Layer.tsrx.d.ts +0 -6
- package/src/container/Surface.tsrx.d.ts +0 -12
- package/src/context/accessibilityContext.js +0 -10
- package/src/context/tooltipContext.js +0 -55
- package/src/index.d.ts +0 -281
- package/src/polar/Pie.tsrx.d.ts +0 -436
- package/src/polar/PolarAngleAxis.tsrx.d.ts +0 -215
- package/src/polar/PolarGrid.tsrx.d.ts +0 -117
- package/src/polar/PolarRadiusAxis.tsrx.d.ts +0 -209
- package/src/polar/Radar.tsrx.d.ts +0 -215
- package/src/polar/RadialBar.tsrx.d.ts +0 -340
- package/src/shape/Cross.tsrx.d.ts +0 -12
- package/src/shape/Curve.tsrx.d.ts +0 -42
- package/src/shape/Dot.tsrx.d.ts +0 -9
- package/src/shape/Polygon.tsrx.d.ts +0 -13
- package/src/shape/Rectangle.tsrx.d.ts +0 -31
- package/src/shape/Sector.tsrx.d.ts +0 -29
- package/src/shape/Symbols.tsrx.d.ts +0 -15
- package/src/shape/Trapezoid.tsrx.d.ts +0 -29
- package/src/state/brushSlice.js +0 -36
- package/src/state/cartesianAxisSlice.js +0 -256
- package/src/state/chartDataSlice.js +0 -67
- package/src/state/errorBarSlice.js +0 -53
- package/src/state/eventSettingsSlice.js +0 -25
- package/src/state/graphicalItemsSlice.js +0 -91
- package/src/state/layoutSlice.js +0 -57
- package/src/state/legendSlice.js +0 -83
- package/src/state/optionsSlice.js +0 -45
- package/src/state/polarAxisSlice.js +0 -33
- package/src/state/polarOptionsSlice.js +0 -26
- package/src/state/reduxDevtoolsJsonStringifyReplacer.js +0 -14
- package/src/state/referenceElementsSlice.js +0 -51
- package/src/state/renderedTicksSlice.js +0 -41
- package/src/state/rootPropsSlice.js +0 -48
- package/src/state/selectors/axisSelectors.js +0 -2113
- package/src/state/selectors/barSelectors.js +0 -263
- package/src/state/selectors/barStackSelectors.js +0 -65
- package/src/state/selectors/brushSelectors.js +0 -21
- package/src/state/selectors/combiners/combineActiveLabel.js +0 -18
- package/src/state/selectors/combiners/combineAllBarPositions.js +0 -169
- package/src/state/selectors/combiners/combineAxisRangeWithReverse.js +0 -11
- package/src/state/selectors/combiners/combineBarPosition.js +0 -17
- package/src/state/selectors/combiners/combineBarSizeList.js +0 -115
- package/src/state/selectors/combiners/combineConfiguredScale.js +0 -46
- package/src/state/selectors/combiners/combineCoordinateForDefaultIndex.js +0 -48
- package/src/state/selectors/combiners/combineInverseScaleFunction.js +0 -12
- package/src/state/selectors/combiners/combineStackedData.js +0 -22
- package/src/state/selectors/combiners/combineTooltipInteractionState.js +0 -121
- package/src/state/selectors/combiners/combineTooltipPayload.js +0 -248
- package/src/state/selectors/containerSelectors.js +0 -6
- package/src/state/selectors/graphicalItemSelectors.js +0 -25
- package/src/state/selectors/legendSelectors.js +0 -18
- package/src/state/selectors/lineSelectors.js +0 -106
- package/src/state/selectors/numberDomainEqualityCheck.js +0 -11
- package/src/state/selectors/pickAxisId.js +0 -3
- package/src/state/selectors/pickAxisType.js +0 -3
- package/src/state/selectors/polarAxisSelectors.js +0 -237
- package/src/state/selectors/rootPropsSelectors.js +0 -13
- package/src/state/selectors/selectAllAxes.js +0 -15
- package/src/state/selectors/selectChartOffset.js +0 -12
- package/src/state/selectors/selectChartOffsetInternal.js +0 -174
- package/src/state/selectors/selectTooltipAxisId.js +0 -3
- package/src/state/selectors/selectTooltipEventType.js +0 -27
- package/src/state/selectors/selectTooltipPayloadSearcher.js +0 -3
- package/src/state/selectors/selectTooltipSettings.js +0 -3
- package/src/state/selectors/selectTooltipState.js +0 -3
- package/src/state/selectors/selectors.js +0 -222
- package/src/state/selectors/tooltipSelectors.js +0 -471
- package/src/state/selectors/touchSelectors.js +0 -31
- package/src/state/tooltipSlice.js +0 -237
- package/src/state/types/StackedGraphicalItem.js +0 -18
- package/src/state/zIndexSlice.js +0 -167
- package/src/synchronisation/syncSelectors.js +0 -5
- package/src/util/ChartUtils.js +0 -630
- package/src/util/DOMUtils.js +0 -180
- package/src/util/Events.js +0 -7
- package/src/util/Global.js +0 -13
- package/src/util/LRUCache.js +0 -58
- package/src/util/PolarUtils.js +0 -190
- package/src/util/ReduceCSSCalc.js +0 -260
- package/src/util/axisPropsAreEqual.js +0 -63
- package/src/util/createEventProxy.js +0 -18
- package/src/util/getActiveCoordinate.js +0 -253
- package/src/util/getClassNameFromUnknown.js +0 -8
- package/src/util/getRadiusAndStrokeWidthFromDot.js +0 -28
- package/src/util/getSliced.js +0 -11
- package/src/util/isWellBehavedNumber.js +0 -8
- package/src/util/round.js +0 -39
- package/src/util/scale/RechartsScale.js +0 -68
- package/src/util/scale/index.js +0 -3
- package/src/util/stacks/getStackSeriesIdentifier.js +0 -10
- package/src/zIndex/ZIndexLayer.tsrx.d.ts +0 -2
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import * as React from 'octane';
|
|
2
|
-
import { SVGProps } from 'octane';
|
|
3
|
-
import { AxisId } from '../state/cartesianAxisSlice';
|
|
4
|
-
import { ZIndexable } from '../zIndex/ZIndexLayer';
|
|
5
|
-
interface PolarGridProps extends ZIndexable {
|
|
6
|
-
/**
|
|
7
|
-
* The x-coordinate of center.
|
|
8
|
-
* When used inside a chart context, this prop is calculated based on the chart's dimensions,
|
|
9
|
-
* and this prop is ignored.
|
|
10
|
-
*
|
|
11
|
-
* This is only used when rendered outside a chart context.
|
|
12
|
-
*/
|
|
13
|
-
cx?: number;
|
|
14
|
-
/**
|
|
15
|
-
* The y-coordinate of center.
|
|
16
|
-
* When used inside a chart context, this prop is calculated based on the chart's dimensions,
|
|
17
|
-
* and this prop is ignored.
|
|
18
|
-
*
|
|
19
|
-
* This is only used when rendered outside a chart context.
|
|
20
|
-
*/
|
|
21
|
-
cy?: number;
|
|
22
|
-
/**
|
|
23
|
-
* The radius of the inner polar grid.
|
|
24
|
-
* When used inside a chart context, this prop is calculated based on the chart's dimensions,
|
|
25
|
-
* and this prop is ignored.
|
|
26
|
-
*
|
|
27
|
-
* This is only used when rendered outside a chart context.
|
|
28
|
-
*/
|
|
29
|
-
innerRadius?: number;
|
|
30
|
-
/**
|
|
31
|
-
* The radius of the outer polar grid.
|
|
32
|
-
* When used inside a chart context, this prop is calculated based on the chart's dimensions,
|
|
33
|
-
* and this prop is ignored.
|
|
34
|
-
*
|
|
35
|
-
* This is only used when rendered outside a chart context.
|
|
36
|
-
*/
|
|
37
|
-
outerRadius?: number;
|
|
38
|
-
/**
|
|
39
|
-
* The array of every line grid's angle.
|
|
40
|
-
*/
|
|
41
|
-
polarAngles?: ReadonlyArray<number>;
|
|
42
|
-
/**
|
|
43
|
-
* The array of every circle grid's radius.
|
|
44
|
-
*/
|
|
45
|
-
polarRadius?: ReadonlyArray<number>;
|
|
46
|
-
/**
|
|
47
|
-
* The type of polar grids.
|
|
48
|
-
* @defaultValue polygon
|
|
49
|
-
*/
|
|
50
|
-
gridType?: 'polygon' | 'circle';
|
|
51
|
-
/**
|
|
52
|
-
* @defaultValue true
|
|
53
|
-
*/
|
|
54
|
-
radialLines?: boolean;
|
|
55
|
-
/**
|
|
56
|
-
* @defaultValue 0
|
|
57
|
-
*/
|
|
58
|
-
angleAxisId?: AxisId;
|
|
59
|
-
/**
|
|
60
|
-
* @defaultValue 0
|
|
61
|
-
*/
|
|
62
|
-
radiusAxisId?: AxisId;
|
|
63
|
-
/**
|
|
64
|
-
* Z-Index of this component and its children. The higher the value,
|
|
65
|
-
* the more on top it will be rendered.
|
|
66
|
-
* Components with higher zIndex will appear in front of components with lower zIndex.
|
|
67
|
-
* If undefined or 0, the content is rendered in the default layer without portals.
|
|
68
|
-
*
|
|
69
|
-
* @since 3.4
|
|
70
|
-
* @defaultValue -100
|
|
71
|
-
* @see {@link https://recharts.github.io/en-US/guide/zIndex/ Z-Index and layers guide}
|
|
72
|
-
*/
|
|
73
|
-
zIndex?: number;
|
|
74
|
-
/**
|
|
75
|
-
* The stroke color. If "none", no line will be drawn.
|
|
76
|
-
* @defaultValue #ccc
|
|
77
|
-
*/
|
|
78
|
-
stroke?: string;
|
|
79
|
-
/**
|
|
80
|
-
* The width of the stroke.
|
|
81
|
-
* @defaultValue 1
|
|
82
|
-
*/
|
|
83
|
-
strokeWidth?: number | string;
|
|
84
|
-
/**
|
|
85
|
-
* The pattern of dashes and gaps used to paint the lines of the grid.
|
|
86
|
-
* @see {@link https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-dasharray stroke-dasharray on MDN}
|
|
87
|
-
*/
|
|
88
|
-
strokeDasharray?: string | number;
|
|
89
|
-
/**
|
|
90
|
-
* The background color used to fill the space between grid lines.
|
|
91
|
-
* @defaultValue none
|
|
92
|
-
*/
|
|
93
|
-
fill?: string;
|
|
94
|
-
/**
|
|
95
|
-
* The opacity of the background used to fill the space between grid lines.
|
|
96
|
-
*/
|
|
97
|
-
fillOpacity?: number | string;
|
|
98
|
-
}
|
|
99
|
-
export type Props = SVGProps<SVGLineElement> & PolarGridProps;
|
|
100
|
-
export declare const defaultPolarGridProps: {
|
|
101
|
-
readonly angleAxisId: 0;
|
|
102
|
-
readonly radiusAxisId: 0;
|
|
103
|
-
readonly gridType: 'polygon';
|
|
104
|
-
readonly radialLines: true;
|
|
105
|
-
readonly zIndex: -100;
|
|
106
|
-
readonly stroke: '#ccc';
|
|
107
|
-
readonly strokeWidth: 1;
|
|
108
|
-
readonly fill: 'none';
|
|
109
|
-
};
|
|
110
|
-
/**
|
|
111
|
-
* @consumes PolarViewBoxContext
|
|
112
|
-
*/
|
|
113
|
-
export declare const PolarGrid: {
|
|
114
|
-
(outsideProps: Props): React.JSX.Element | null;
|
|
115
|
-
displayName: string;
|
|
116
|
-
};
|
|
117
|
-
export {};
|
|
@@ -1,209 +0,0 @@
|
|
|
1
|
-
import * as React from 'octane';
|
|
2
|
-
import { FunctionComponent, SVGProps } from 'octane';
|
|
3
|
-
import {
|
|
4
|
-
RenderableAxisProps,
|
|
5
|
-
PresentationAttributesAdaptChildEvent,
|
|
6
|
-
AxisDomain,
|
|
7
|
-
ScaleType,
|
|
8
|
-
AxisDomainTypeInput,
|
|
9
|
-
TickProp,
|
|
10
|
-
BaseTickContentProps,
|
|
11
|
-
AxisTick,
|
|
12
|
-
} from '../util/types';
|
|
13
|
-
import { NiceTicksAlgorithm } from '../state/cartesianAxisSlice';
|
|
14
|
-
import { defaultPolarRadiusAxisProps } from './defaultPolarRadiusAxisProps';
|
|
15
|
-
import { RequiresDefaultProps } from '../util/resolveDefaultProps';
|
|
16
|
-
import { ZIndexable } from '../zIndex/ZIndexLayer';
|
|
17
|
-
import { CustomScaleDefinition } from '../util/scale/CustomScaleDefinition';
|
|
18
|
-
type TickOrientation = 'left' | 'right' | 'middle';
|
|
19
|
-
export interface PolarRadiusAxisProps<DataPointType = any, DataValueType = any>
|
|
20
|
-
extends
|
|
21
|
-
Omit<
|
|
22
|
-
RenderableAxisProps<DataPointType, DataValueType>,
|
|
23
|
-
'axisLine' | 'angle' | 'type' | 'tickSize' | 'domain' | 'scale' | 'tick'
|
|
24
|
-
>,
|
|
25
|
-
ZIndexable {
|
|
26
|
-
/**
|
|
27
|
-
* Determines how the axis line is drawn. Options:
|
|
28
|
-
* - `true`: the axis line is drawn with default props;
|
|
29
|
-
* - `false`: the axis line is not visible;
|
|
30
|
-
* - `object`: passed as props to SVG `<line>` element representing the axis line.
|
|
31
|
-
*
|
|
32
|
-
* @example <PolarRadiusAxis axisLine={false} />
|
|
33
|
-
* @example <PolarRadiusAxis axisLine={{ stroke: 'red', strokeWidth: 2 }} />
|
|
34
|
-
* @defaultValue true
|
|
35
|
-
*/
|
|
36
|
-
axisLine?: boolean | SVGProps<SVGLineElement>;
|
|
37
|
-
/**
|
|
38
|
-
* The angle of the whole axis: the line, ticks and labels, everything.
|
|
39
|
-
*
|
|
40
|
-
* This is different from other graphical elements where angle usually means
|
|
41
|
-
* the angle of text. Here, it means the angle of everything.
|
|
42
|
-
*
|
|
43
|
-
* @defaultValue 0
|
|
44
|
-
*/
|
|
45
|
-
angle?: number;
|
|
46
|
-
/**
|
|
47
|
-
* The type of axis.
|
|
48
|
-
*
|
|
49
|
-
* `category`: Treats data as distinct values.
|
|
50
|
-
* Each value is in the same distance from its neighbors, regardless of their actual numeric difference.
|
|
51
|
-
*
|
|
52
|
-
* `number`: Treats data as continuous range.
|
|
53
|
-
* Values that are numerically closer are placed closer together on the axis.
|
|
54
|
-
*
|
|
55
|
-
* `auto`: the type is inferred based on the chart layout.
|
|
56
|
-
*
|
|
57
|
-
* @defaultValue auto
|
|
58
|
-
*/
|
|
59
|
-
type?: AxisDomainTypeInput;
|
|
60
|
-
/**
|
|
61
|
-
* The orientation of axis text.
|
|
62
|
-
* @defaultValue right
|
|
63
|
-
*/
|
|
64
|
-
orientation?: TickOrientation;
|
|
65
|
-
/**
|
|
66
|
-
* Specify the domain of axis when the axis is a number axis.
|
|
67
|
-
*
|
|
68
|
-
* If undefined, then the domain is calculated based on the data and dataKeys.
|
|
69
|
-
*
|
|
70
|
-
* The length of domain should be 2, and we will validate the values in domain.
|
|
71
|
-
*
|
|
72
|
-
* Each element in the array can be a number, 'auto', 'dataMin', 'dataMax', a string like 'dataMin - 20', 'dataMax + 100',
|
|
73
|
-
* or a function that accepts a single argument and returns a number.
|
|
74
|
-
*
|
|
75
|
-
* If any element of domain is set to be 'auto', comprehensible scale ticks will be calculated, and the final domain of axis is generated by the ticks.
|
|
76
|
-
* If a function, receives '[dataMin, dataMax]', and must return a computed domain as '[min, max]'.
|
|
77
|
-
*
|
|
78
|
-
* @example <PolarRadiusAxis type="number" domain={['dataMin', 'dataMax']} />
|
|
79
|
-
* @example <PolarRadiusAxis type="number" domain={[0, 'dataMax']} />
|
|
80
|
-
* @example <PolarRadiusAxis type="number" domain={['auto', 'auto']} />
|
|
81
|
-
* @example <PolarRadiusAxis type="number" domain={[0, 'dataMax + 1000']} />
|
|
82
|
-
* @example <PolarRadiusAxis type="number" domain={['dataMin - 100', 'dataMax + 100']} />
|
|
83
|
-
* @example <PolarRadiusAxis type="number" domain={[dataMin => (0 - Math.abs(dataMin)), dataMax => (dataMax * 2)]} />
|
|
84
|
-
* @example <PolarRadiusAxis type="number" domain={([dataMin, dataMax]) => { const absMax = Math.max(Math.abs(dataMin), Math.abs(dataMax)); return [-absMax, absMax]; }} />
|
|
85
|
-
* @example <PolarRadiusAxis type="number" domain={[0, 100]} allowDataOverflow />
|
|
86
|
-
*/
|
|
87
|
-
domain?: AxisDomain;
|
|
88
|
-
/**
|
|
89
|
-
* Scale function determines how data values are mapped to visual values.
|
|
90
|
-
* In other words, decided the mapping between data domain and coordinate range.
|
|
91
|
-
*
|
|
92
|
-
* If undefined, or 'auto', the scale function is created internally according to the type of axis and data.
|
|
93
|
-
*
|
|
94
|
-
* You can define a custom scale, either as a string shortcut to a d3 scale, or as a complete scale definition object.
|
|
95
|
-
*
|
|
96
|
-
* @defaultValue auto
|
|
97
|
-
* @example <PolarRadiusAxis scale="log" />
|
|
98
|
-
* @example
|
|
99
|
-
* import { scaleLog } from 'd3-scale';
|
|
100
|
-
* const scale = scaleLog().base(Math.E);
|
|
101
|
-
* <PolarRadiusAxis scale={scale} />
|
|
102
|
-
*/
|
|
103
|
-
scale?:
|
|
104
|
-
| ScaleType
|
|
105
|
-
| CustomScaleDefinition
|
|
106
|
-
| CustomScaleDefinition<string>
|
|
107
|
-
| CustomScaleDefinition<number>
|
|
108
|
-
| CustomScaleDefinition<Date>;
|
|
109
|
-
/**
|
|
110
|
-
* The customized event handler of click on the ticks of this axis
|
|
111
|
-
*/
|
|
112
|
-
onClick?: (data: any, index: number, e: React.MouseEvent) => void;
|
|
113
|
-
/**
|
|
114
|
-
* The customized event handler of mousedown on the ticks of this axis
|
|
115
|
-
*/
|
|
116
|
-
onMouseDown?: (data: any, index: number, e: React.MouseEvent) => void;
|
|
117
|
-
/**
|
|
118
|
-
* The customized event handler of mouseup on the ticks of this axis
|
|
119
|
-
*/
|
|
120
|
-
onMouseUp?: (data: any, index: number, e: React.MouseEvent) => void;
|
|
121
|
-
/**
|
|
122
|
-
* The customized event handler of mousemove on the ticks of this axis
|
|
123
|
-
*/
|
|
124
|
-
onMouseMove?: (data: any, index: number, e: React.MouseEvent) => void;
|
|
125
|
-
/**
|
|
126
|
-
* The customized event handler of mouseover on the ticks of this axis
|
|
127
|
-
*/
|
|
128
|
-
onMouseOver?: (data: any, index: number, e: React.MouseEvent) => void;
|
|
129
|
-
/**
|
|
130
|
-
* The customized event handler of mouseout on the ticks of this axis
|
|
131
|
-
*/
|
|
132
|
-
onMouseOut?: (data: any, index: number, e: React.MouseEvent) => void;
|
|
133
|
-
/**
|
|
134
|
-
* The customized event handler of mouseenter on the ticks of this axis
|
|
135
|
-
*/
|
|
136
|
-
onMouseEnter?: (data: any, index: number, e: React.MouseEvent) => void;
|
|
137
|
-
/**
|
|
138
|
-
* The customized event handler of mouseleave on the ticks of this axis
|
|
139
|
-
*/
|
|
140
|
-
onMouseLeave?: (data: any, index: number, e: React.MouseEvent) => void;
|
|
141
|
-
/**
|
|
142
|
-
* Allow the ticks of axis to be decimals or not.
|
|
143
|
-
*
|
|
144
|
-
* @defaultValue false
|
|
145
|
-
*/
|
|
146
|
-
allowDecimals?: boolean;
|
|
147
|
-
/**
|
|
148
|
-
* Controls how Recharts calculates "nice" tick values for this axis.
|
|
149
|
-
* Options: `'none'`, `'auto'`, `'adaptive'`, `'snap125'`.
|
|
150
|
-
* See {@link NiceTicksAlgorithm} for a full description of each option.
|
|
151
|
-
*
|
|
152
|
-
* @defaultValue 'auto'
|
|
153
|
-
*/
|
|
154
|
-
niceTicks?: NiceTicksAlgorithm;
|
|
155
|
-
/**
|
|
156
|
-
* @defaultValue 0
|
|
157
|
-
*/
|
|
158
|
-
radiusAxisId?: string | number;
|
|
159
|
-
/**
|
|
160
|
-
* Defines how the individual label text is rendered.
|
|
161
|
-
* This controls the settings for individual ticks; on a typical axis, there are multiple ticks, depending on your data.
|
|
162
|
-
*
|
|
163
|
-
* If you want to customize the overall axis label, use the `label` prop instead.
|
|
164
|
-
*
|
|
165
|
-
* Options:
|
|
166
|
-
* - `false`: Do not render any tick labels.
|
|
167
|
-
* - `true`: Render tick labels with default settings.
|
|
168
|
-
* - `object`: An object of props to be merged into the internally calculated tick props.
|
|
169
|
-
* - `ReactElement`: A custom React element to be used as the tick label.
|
|
170
|
-
* - `function`: A function that returns a React element for custom rendering of tick labels.
|
|
171
|
-
*
|
|
172
|
-
* @defaultValue true
|
|
173
|
-
*/
|
|
174
|
-
tick?: TickProp<BaseTickContentProps>;
|
|
175
|
-
ticks?: ReadonlyArray<AxisTick>;
|
|
176
|
-
/**
|
|
177
|
-
* Z-Index of this component and its children. The higher the value,
|
|
178
|
-
* the more on top it will be rendered.
|
|
179
|
-
* Components with higher zIndex will appear in front of components with lower zIndex.
|
|
180
|
-
* If undefined or 0, the content is rendered in the default layer without portals.
|
|
181
|
-
*
|
|
182
|
-
* @since 3.4
|
|
183
|
-
* @defaultValue 500
|
|
184
|
-
* @see {@link https://recharts.github.io/en-US/guide/zIndex/ Z-Index and layers guide}
|
|
185
|
-
*/
|
|
186
|
-
zIndex?: number;
|
|
187
|
-
}
|
|
188
|
-
type AxisSvgProps = Omit<
|
|
189
|
-
PresentationAttributesAdaptChildEvent<any, SVGTextElement>,
|
|
190
|
-
'scale' | 'type'
|
|
191
|
-
>;
|
|
192
|
-
export type Props<DataPointType = any, DataValueType = any> = AxisSvgProps &
|
|
193
|
-
PolarRadiusAxisProps<DataPointType, DataValueType>;
|
|
194
|
-
type PropsWithDefaults<DataPointType = any, DataValueType = any> = RequiresDefaultProps<
|
|
195
|
-
Props<DataPointType, DataValueType>,
|
|
196
|
-
typeof defaultPolarRadiusAxisProps
|
|
197
|
-
>;
|
|
198
|
-
export declare const PolarRadiusAxisWrapper: FunctionComponent<PropsWithDefaults>;
|
|
199
|
-
/**
|
|
200
|
-
* @provides PolarLabelContext
|
|
201
|
-
* @consumes PolarViewBoxContext
|
|
202
|
-
*/
|
|
203
|
-
export declare function PolarRadiusAxis<DataPointType = any, DataValueType = any>(
|
|
204
|
-
outsideProps: Props<DataPointType, DataValueType>,
|
|
205
|
-
): React.JSX.Element;
|
|
206
|
-
export declare namespace PolarRadiusAxis {
|
|
207
|
-
var displayName: string;
|
|
208
|
-
}
|
|
209
|
-
export {};
|
|
@@ -1,215 +0,0 @@
|
|
|
1
|
-
import * as React from 'octane';
|
|
2
|
-
import { MouseEvent, ReactElement, SVGProps } from 'octane';
|
|
3
|
-
import { ImplicitLabelListType } from '../component/LabelList';
|
|
4
|
-
import {
|
|
5
|
-
ActiveDotType,
|
|
6
|
-
AnimationDuration,
|
|
7
|
-
DataConsumer,
|
|
8
|
-
DataKey,
|
|
9
|
-
DotType,
|
|
10
|
-
EasingInput,
|
|
11
|
-
LegendType,
|
|
12
|
-
PolarLayout,
|
|
13
|
-
TooltipType,
|
|
14
|
-
} from '../util/types';
|
|
15
|
-
import { AnimationInterpolateFn } from '../animation/AnimatedItems';
|
|
16
|
-
import { AnimationMatchByProp } from '../animation/matchBy';
|
|
17
|
-
import { RequiresDefaultProps } from '../util/resolveDefaultProps';
|
|
18
|
-
import { WithIdRequired } from '../util/useUniqueId';
|
|
19
|
-
import { ZIndexable } from '../zIndex/ZIndexLayer';
|
|
20
|
-
import { RechartsScale } from '../util/scale/RechartsScale';
|
|
21
|
-
export interface RadarPoint {
|
|
22
|
-
x: number;
|
|
23
|
-
y: number;
|
|
24
|
-
cx?: number;
|
|
25
|
-
cy?: number;
|
|
26
|
-
angle: number;
|
|
27
|
-
radius?: number;
|
|
28
|
-
value?: number;
|
|
29
|
-
payload?: any;
|
|
30
|
-
name?: string | number;
|
|
31
|
-
}
|
|
32
|
-
interface RadarProps<DataPointType = any, DataValueType = any>
|
|
33
|
-
extends ZIndexable, DataConsumer<DataPointType, DataValueType> {
|
|
34
|
-
/**
|
|
35
|
-
* @defaultValue true
|
|
36
|
-
*/
|
|
37
|
-
activeDot?: ActiveDotType;
|
|
38
|
-
/**
|
|
39
|
-
* @defaultValue 0
|
|
40
|
-
*/
|
|
41
|
-
angleAxisId?: string | number;
|
|
42
|
-
/**
|
|
43
|
-
* Specifies when the animation should begin, the unit of this option is ms.
|
|
44
|
-
* @defaultValue 0
|
|
45
|
-
*/
|
|
46
|
-
animationBegin?: number;
|
|
47
|
-
/**
|
|
48
|
-
* Specifies the duration of animation, the unit of this option is ms.
|
|
49
|
-
* @defaultValue 1500
|
|
50
|
-
*/
|
|
51
|
-
animationDuration?: AnimationDuration;
|
|
52
|
-
/**
|
|
53
|
-
* The type of easing function.
|
|
54
|
-
* @defaultValue ease
|
|
55
|
-
*/
|
|
56
|
-
animationEasing?: EasingInput;
|
|
57
|
-
/**
|
|
58
|
-
* Custom animation function for interpolating data items.
|
|
59
|
-
* When provided, this replaces the default animation interpolation.
|
|
60
|
-
*
|
|
61
|
-
* @param prevItems The items from the previous animation frame, or null on first render
|
|
62
|
-
* @param nextItems The target items to animate towards
|
|
63
|
-
* @param animationElapsedTime A normalized time value (0 = start, 1 = end)
|
|
64
|
-
* @returns The interpolated items at time animationElapsedTime
|
|
65
|
-
*
|
|
66
|
-
* @since 3.9
|
|
67
|
-
* @see {@link https://recharts.github.io/en-US/guide/animations/ Animations guide}
|
|
68
|
-
*/
|
|
69
|
-
animationInterpolateFn?: AnimationInterpolateFn<RadarPoint, PolarLayout>;
|
|
70
|
-
/**
|
|
71
|
-
* Strategy for matching previous items to next items during animation.
|
|
72
|
-
* Determines how Recharts pairs old data points with new data points
|
|
73
|
-
* to create smooth transitions.
|
|
74
|
-
*
|
|
75
|
-
* - `matchByIndex` (default): match by array position with proportional stretching
|
|
76
|
-
* - `matchAppend`: match sequentially by index and treat newly appended items as new
|
|
77
|
-
* - `matchByDataKey('someKey')`: match by a data key from the payload
|
|
78
|
-
* - Custom function `(item, index) => key`: match by the returned key
|
|
79
|
-
*
|
|
80
|
-
* @defaultValue index
|
|
81
|
-
* @see matchByIndex
|
|
82
|
-
* @see matchByDataKey
|
|
83
|
-
* @see matchAppend
|
|
84
|
-
*/
|
|
85
|
-
animationMatchBy?: AnimationMatchByProp<RadarPoint>;
|
|
86
|
-
baseLinePoints?: RadarPoint[];
|
|
87
|
-
className?: string;
|
|
88
|
-
connectNulls?: boolean;
|
|
89
|
-
/**
|
|
90
|
-
* Renders a circle element at each data point. Options:
|
|
91
|
-
*
|
|
92
|
-
* - `false`: no dots are drawn;
|
|
93
|
-
* - `true`: renders the dots with default settings;
|
|
94
|
-
* - `object`: the props of the dot. This will be merged with the internal calculated props of each dot;
|
|
95
|
-
* - `ReactElement`: the custom dot element;
|
|
96
|
-
* - `function`: a render function of the custom dot.
|
|
97
|
-
*
|
|
98
|
-
* @defaultValue false
|
|
99
|
-
*/
|
|
100
|
-
dot?: DotType;
|
|
101
|
-
/**
|
|
102
|
-
* @defaultValue false
|
|
103
|
-
*/
|
|
104
|
-
hide?: boolean;
|
|
105
|
-
/**
|
|
106
|
-
* If set false, animation of polygon will be disabled.
|
|
107
|
-
* If set "auto", the animation will be disabled in SSR and will respect the user's prefers-reduced-motion system preference for accessibility.
|
|
108
|
-
* @defaultValue auto
|
|
109
|
-
*/
|
|
110
|
-
isAnimationActive?: boolean | 'auto';
|
|
111
|
-
isRange?: boolean;
|
|
112
|
-
/**
|
|
113
|
-
* Renders one label for each point. Options:
|
|
114
|
-
* - `true`: renders default labels;
|
|
115
|
-
* - `false`: no labels are rendered;
|
|
116
|
-
* - `object`: the props of LabelList component;
|
|
117
|
-
* - `ReactElement`: a custom SVG label element, such as `<text>` or `<g>`.
|
|
118
|
-
* HTML elements such as `<div>` are not valid inside the chart SVG and may trigger React DOM warnings.
|
|
119
|
-
* - `function`: a render function of custom label.
|
|
120
|
-
*
|
|
121
|
-
* @defaultValue false
|
|
122
|
-
*/
|
|
123
|
-
label?: ImplicitLabelListType;
|
|
124
|
-
/**
|
|
125
|
-
* The type of icon in legend. If set to 'none', no legend item will be rendered.
|
|
126
|
-
* @defaultValue rect
|
|
127
|
-
*/
|
|
128
|
-
legendType?: LegendType;
|
|
129
|
-
/**
|
|
130
|
-
* The customized event handler of animation end
|
|
131
|
-
*/
|
|
132
|
-
onAnimationEnd?: () => void;
|
|
133
|
-
/**
|
|
134
|
-
* The customized event handler of animation start
|
|
135
|
-
*/
|
|
136
|
-
onAnimationStart?: () => void;
|
|
137
|
-
onMouseEnter?: (props: InternalRadarProps, e: MouseEvent<SVGPolygonElement>) => void;
|
|
138
|
-
onMouseLeave?: (props: InternalRadarProps, e: MouseEvent<SVGPolygonElement>) => void;
|
|
139
|
-
/**
|
|
140
|
-
* @defaultValue 0
|
|
141
|
-
*/
|
|
142
|
-
radiusAxisId?: string | number;
|
|
143
|
-
/**
|
|
144
|
-
* If set a ReactElement, the shape of radar can be customized.
|
|
145
|
-
* If set a function, the function will be called to render customized shape.
|
|
146
|
-
*/
|
|
147
|
-
shape?: ReactElement<SVGElement> | ((props: any) => ReactElement<SVGElement>);
|
|
148
|
-
tooltipType?: TooltipType;
|
|
149
|
-
/**
|
|
150
|
-
* @defaultValue 100
|
|
151
|
-
*/
|
|
152
|
-
zIndex?: number;
|
|
153
|
-
}
|
|
154
|
-
export type RadiusAxisForRadar = {
|
|
155
|
-
scale: RechartsScale;
|
|
156
|
-
};
|
|
157
|
-
export type AngleAxisForRadar = {
|
|
158
|
-
scale: RechartsScale;
|
|
159
|
-
type: 'number' | 'category';
|
|
160
|
-
dataKey: DataKey<any> | undefined;
|
|
161
|
-
cx: number;
|
|
162
|
-
cy: number;
|
|
163
|
-
};
|
|
164
|
-
export type Props<DataPointType = any, DataValueType = any> = Omit<
|
|
165
|
-
SVGProps<SVGGraphicsElement>,
|
|
166
|
-
'onMouseEnter' | 'onMouseLeave' | 'points' | 'ref'
|
|
167
|
-
> &
|
|
168
|
-
RadarProps<DataPointType, DataValueType>;
|
|
169
|
-
export type RadarComposedData = {
|
|
170
|
-
points: RadarPoint[];
|
|
171
|
-
baseLinePoints: RadarPoint[];
|
|
172
|
-
isRange: boolean;
|
|
173
|
-
};
|
|
174
|
-
export declare function computeRadarPoints({
|
|
175
|
-
radiusAxis,
|
|
176
|
-
angleAxis,
|
|
177
|
-
displayedData,
|
|
178
|
-
dataKey,
|
|
179
|
-
bandSize,
|
|
180
|
-
}: {
|
|
181
|
-
radiusAxis: RadiusAxisForRadar;
|
|
182
|
-
angleAxis: AngleAxisForRadar;
|
|
183
|
-
displayedData: any[];
|
|
184
|
-
dataKey: RadarProps['dataKey'];
|
|
185
|
-
bandSize: number;
|
|
186
|
-
}): RadarComposedData;
|
|
187
|
-
export declare const defaultRadarProps: {
|
|
188
|
-
readonly activeDot: true;
|
|
189
|
-
readonly angleAxisId: 0;
|
|
190
|
-
readonly animationBegin: 0;
|
|
191
|
-
readonly animationDuration: 1500;
|
|
192
|
-
readonly animationEasing: 'ease';
|
|
193
|
-
readonly animationMatchBy: 'index';
|
|
194
|
-
readonly animationInterpolateFn: AnimationInterpolateFn<RadarPoint, PolarLayout>;
|
|
195
|
-
readonly dot: false;
|
|
196
|
-
readonly hide: false;
|
|
197
|
-
readonly isAnimationActive: 'auto';
|
|
198
|
-
readonly label: false;
|
|
199
|
-
readonly legendType: 'rect';
|
|
200
|
-
readonly radiusAxisId: 0;
|
|
201
|
-
readonly zIndex: 100;
|
|
202
|
-
};
|
|
203
|
-
type PropsWithDefaults = RequiresDefaultProps<Props, typeof defaultRadarProps>;
|
|
204
|
-
export type InternalRadarProps = WithIdRequired<PropsWithDefaults> & RadarComposedData;
|
|
205
|
-
/**
|
|
206
|
-
* @consumes PolarChartContext
|
|
207
|
-
* @provides LabelListContext
|
|
208
|
-
*/
|
|
209
|
-
export declare function Radar<DataPointType = any, DataValueType = any>(
|
|
210
|
-
outsideProps: Props<DataPointType, DataValueType>,
|
|
211
|
-
): React.JSX.Element;
|
|
212
|
-
export declare namespace Radar {
|
|
213
|
-
var displayName: string;
|
|
214
|
-
}
|
|
215
|
-
export {};
|