@octanejs/recharts 0.1.50 → 0.1.52

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 (158) hide show
  1. package/package.json +5 -5
  2. package/src/animation/AnimationController.ts +1 -1
  3. package/src/animation/AnimationControllerImpl.ts +2 -2
  4. package/src/animation/AnimationHandle.ts +1 -1
  5. package/src/animation/CSSTransitionAnimate.tsrx +2 -8
  6. package/src/animation/matchBy.ts +1 -1
  7. package/src/cartesian/Area.tsrx +23 -19
  8. package/src/cartesian/AreaRevealShape.tsrx +2 -2
  9. package/src/cartesian/CartesianGrid.tsrx +6 -6
  10. package/src/cartesian/ErrorBar.tsrx +5 -5
  11. package/src/cartesian/Funnel.tsrx +30 -27
  12. package/src/cartesian/ReferenceLine.tsrx +10 -7
  13. package/src/cartesian/Scatter.tsrx +41 -33
  14. package/src/cartesian/ZAxis.tsrx +4 -4
  15. package/src/cartesian/getCartesianPosition.ts +2 -2
  16. package/src/cartesian/getEquidistantTicks.ts +2 -2
  17. package/src/cartesian/getTicks.ts +2 -2
  18. package/src/chart/AreaChart.tsrx +1 -1
  19. package/src/chart/ComposedChart.tsrx +1 -1
  20. package/src/chart/FunnelChart.tsrx +1 -1
  21. package/src/chart/PieChart.tsrx +1 -1
  22. package/src/chart/PolarChart.tsrx +3 -3
  23. package/src/chart/RadarChart.tsrx +1 -1
  24. package/src/chart/RadialBarChart.tsrx +1 -1
  25. package/src/chart/Sankey.tsrx +9 -9
  26. package/src/chart/ScatterChart.tsrx +1 -1
  27. package/src/chart/SunburstChart.tsrx +14 -8
  28. package/src/component/Cursor.tsrx +7 -7
  29. package/src/component/DefaultLegendContent.tsrx +5 -5
  30. package/src/component/DefaultTooltipContent.tsrx +2 -2
  31. package/src/component/Legend.tsrx +8 -8
  32. package/src/component/Tooltip.tsrx +12 -12
  33. package/src/component/TooltipBoundingBox.tsrx +2 -2
  34. package/src/context/legendPayloadContext.tsrx +1 -1
  35. package/src/context/tooltipContext.ts +2 -2
  36. package/src/context/useTooltipAxis.ts +1 -1
  37. package/src/hooks.ts +6 -6
  38. package/src/polar/Pie.tsrx +28 -28
  39. package/src/polar/PolarAngleAxis.tsrx +16 -16
  40. package/src/polar/PolarGrid.tsrx +3 -3
  41. package/src/polar/PolarRadiusAxis.tsrx +17 -17
  42. package/src/polar/Radar.tsrx +10 -10
  43. package/src/polar/RadialBar.tsrx +29 -29
  44. package/src/polar/defaultPolarAngleAxisProps.ts +1 -1
  45. package/src/polar/defaultPolarRadiusAxisProps.ts +1 -1
  46. package/src/state/ReportPolarOptions.tsrx +1 -1
  47. package/src/state/brushSlice.ts +2 -2
  48. package/src/state/cartesianAxisSlice.ts +4 -4
  49. package/src/state/chartDataSlice.ts +2 -2
  50. package/src/state/errorBarSlice.ts +4 -4
  51. package/src/state/eventSettingsSlice.ts +2 -2
  52. package/src/state/externalEventsMiddleware.ts +5 -5
  53. package/src/state/graphicalItemsSlice.ts +11 -11
  54. package/src/state/keyboardEventsMiddleware.ts +3 -3
  55. package/src/state/layoutSlice.ts +2 -2
  56. package/src/state/legendSlice.ts +3 -3
  57. package/src/state/mouseEventsMiddleware.ts +4 -4
  58. package/src/state/optionsSlice.ts +2 -2
  59. package/src/state/polarAxisSlice.ts +2 -2
  60. package/src/state/polarOptionsSlice.ts +1 -1
  61. package/src/state/referenceElementsSlice.ts +5 -5
  62. package/src/state/renderedTicksSlice.ts +4 -4
  63. package/src/state/rootPropsSlice.ts +4 -4
  64. package/src/state/selectors/areaSelectors.ts +7 -7
  65. package/src/state/selectors/axisSelectors.ts +22 -18
  66. package/src/state/selectors/barSelectors.ts +11 -11
  67. package/src/state/selectors/brushSelectors.ts +2 -2
  68. package/src/state/selectors/combiners/combineActiveLabel.ts +3 -3
  69. package/src/state/selectors/combiners/combineActiveTooltipIndex.ts +3 -3
  70. package/src/state/selectors/combiners/combineAllBarPositions.ts +3 -3
  71. package/src/state/selectors/combiners/combineAxisRangeWithReverse.ts +2 -2
  72. package/src/state/selectors/combiners/combineBarPosition.ts +3 -3
  73. package/src/state/selectors/combiners/combineBarSizeList.ts +5 -5
  74. package/src/state/selectors/combiners/combineCheckedDomain.ts +1 -1
  75. package/src/state/selectors/combiners/combineConfiguredScale.ts +4 -4
  76. package/src/state/selectors/combiners/combineCoordinateForDefaultIndex.ts +2 -2
  77. package/src/state/selectors/combiners/combineDisplayedStackedData.ts +4 -4
  78. package/src/state/selectors/combiners/combineInverseScaleFunction.ts +2 -2
  79. package/src/state/selectors/combiners/combineRealScaleType.ts +2 -2
  80. package/src/state/selectors/combiners/combineStackedData.ts +2 -2
  81. package/src/state/selectors/combiners/combineTooltipInteractionState.ts +5 -5
  82. package/src/state/selectors/combiners/combineTooltipPayload.ts +4 -4
  83. package/src/state/selectors/combiners/combineTooltipPayloadConfigurations.ts +4 -4
  84. package/src/state/selectors/containerSelectors.ts +2 -2
  85. package/src/state/selectors/dataSelectors.ts +2 -2
  86. package/src/state/selectors/funnelSelectors.ts +5 -5
  87. package/src/state/selectors/graphicalItemSelectors.ts +3 -3
  88. package/src/state/selectors/legendSelectors.ts +4 -4
  89. package/src/state/selectors/lineSelectors.ts +6 -6
  90. package/src/state/selectors/numberDomainEqualityCheck.ts +1 -1
  91. package/src/state/selectors/pickAxisId.ts +2 -2
  92. package/src/state/selectors/pickAxisType.ts +1 -1
  93. package/src/state/selectors/pieSelectors.ts +5 -5
  94. package/src/state/selectors/polarAxisSelectors.ts +6 -6
  95. package/src/state/selectors/polarGridSelectors.ts +3 -3
  96. package/src/state/selectors/polarScaleSelectors.ts +4 -4
  97. package/src/state/selectors/polarSelectors.ts +6 -6
  98. package/src/state/selectors/radarSelectors.ts +11 -11
  99. package/src/state/selectors/radialBarSelectors.ts +16 -16
  100. package/src/state/selectors/rootPropsSelectors.ts +4 -4
  101. package/src/state/selectors/scatterSelectors.ts +8 -8
  102. package/src/state/selectors/selectActivePropsFromChartPointer.ts +3 -3
  103. package/src/state/selectors/selectAllAxes.ts +2 -2
  104. package/src/state/selectors/selectChartOffset.ts +2 -2
  105. package/src/state/selectors/selectChartOffsetInternal.ts +4 -4
  106. package/src/state/selectors/selectTooltipAxisId.ts +2 -2
  107. package/src/state/selectors/selectTooltipAxisType.ts +1 -1
  108. package/src/state/selectors/selectTooltipEventType.ts +3 -3
  109. package/src/state/selectors/selectTooltipPayloadSearcher.ts +2 -2
  110. package/src/state/selectors/selectTooltipSettings.ts +2 -2
  111. package/src/state/selectors/selectTooltipState.ts +2 -2
  112. package/src/state/selectors/selectors.ts +5 -5
  113. package/src/state/selectors/tooltipSelectors.ts +16 -16
  114. package/src/state/selectors/touchSelectors.ts +4 -4
  115. package/src/state/store.ts +3 -3
  116. package/src/state/tooltipSlice.ts +5 -5
  117. package/src/state/touchEventsMiddleware.ts +4 -4
  118. package/src/state/types/AreaSettings.ts +5 -5
  119. package/src/state/types/BarSettings.ts +3 -3
  120. package/src/state/types/LineSettings.ts +3 -3
  121. package/src/state/types/PieSettings.ts +5 -5
  122. package/src/state/types/RadarSettings.ts +1 -1
  123. package/src/state/types/RadialBarSettings.ts +2 -2
  124. package/src/state/types/ScatterSettings.ts +4 -4
  125. package/src/state/types/StackedGraphicalItem.ts +3 -3
  126. package/src/state/zIndexSlice.ts +1 -1
  127. package/src/synchronisation/syncSelectors.ts +2 -2
  128. package/src/synchronisation/types.ts +2 -2
  129. package/src/util/CartesianUtils.ts +1 -1
  130. package/src/util/ChartUtils.ts +8 -8
  131. package/src/util/DOMUtils.ts +1 -1
  132. package/src/util/DataUtils.ts +1 -1
  133. package/src/util/Events.ts +3 -3
  134. package/src/util/FunnelUtils.tsrx +2 -2
  135. package/src/util/OctaneTypes.ts +7 -6
  136. package/src/util/PolarUtils.ts +1 -1
  137. package/src/util/RadialBarUtils.tsrx +2 -2
  138. package/src/util/ScatterUtils.tsrx +4 -4
  139. package/src/util/TickUtils.ts +1 -1
  140. package/src/util/axisPropsAreEqual.ts +3 -3
  141. package/src/util/cursor/getCursorPoints.ts +6 -6
  142. package/src/util/cursor/getCursorRectangle.ts +1 -1
  143. package/src/util/cursor/getRadialCursorPoints.ts +1 -1
  144. package/src/util/getActiveCoordinate.ts +2 -2
  145. package/src/util/getAxisTypeBasedOnLayout.ts +1 -1
  146. package/src/util/getRadiusAndStrokeWidthFromDot.ts +1 -1
  147. package/src/util/getRelativeCoordinate.ts +1 -1
  148. package/src/util/isDomainSpecifiedByUser.ts +1 -1
  149. package/src/util/scale/CartesianScaleHelper.ts +2 -2
  150. package/src/util/scale/CustomScaleDefinition.ts +1 -1
  151. package/src/util/scale/RechartsScale.ts +2 -2
  152. package/src/util/scale/createCategoricalInverse.ts +2 -2
  153. package/src/util/scale/getNiceTickValues.ts +2 -2
  154. package/src/util/stacks/getStackSeriesIdentifier.ts +2 -2
  155. package/src/util/stacks/stackTypes.ts +4 -4
  156. package/src/util/tooltip/translate.ts +1 -1
  157. package/src/util/types.ts +12 -12
  158. package/src/zIndex/zIndexSelectors.ts +1 -1
@@ -1,13 +1,13 @@
1
1
  // Adapted from recharts@3.9.2, commit b3451050c027a23957ffa50a2665c9119df21e47.
2
2
  import { createSelector } from 'reselect';
3
- import { RechartsRootState } from '../store';
4
- import { ActiveTooltipProps } from '../tooltipSlice';
3
+ import type { RechartsRootState } from '../store';
4
+ import type { ActiveTooltipProps } from '../tooltipSlice';
5
5
  import { selectChartLayout } from '../../context/chartLayoutContext';
6
6
  import { selectTooltipAxisRangeWithReverse, selectTooltipAxisTicks } from './tooltipSelectors';
7
7
  import { selectChartOffsetInternal } from './selectChartOffsetInternal';
8
8
  import { combineActiveProps, selectOrderedTooltipTicks } from './selectors';
9
9
  import { selectPolarViewBox } from './polarAxisSelectors';
10
- import { RelativePointer } from '../../util/types';
10
+ import type { RelativePointer } from '../../util/types';
11
11
  import { selectTooltipAxisType } from './selectTooltipAxisType';
12
12
 
13
13
  const pickChartPointer = (_state: RechartsRootState, chartPointer: RelativePointer) => chartPointer;
@@ -1,7 +1,7 @@
1
1
  // Adapted from recharts@3.9.2, commit b3451050c027a23957ffa50a2665c9119df21e47.
2
2
  import { createSelector } from 'reselect';
3
- import { RechartsRootState } from '../store';
4
- import { XAxisSettings, YAxisSettings } from '../cartesianAxisSlice';
3
+ import type { RechartsRootState } from '../store';
4
+ import type { XAxisSettings, YAxisSettings } from '../cartesianAxisSlice';
5
5
 
6
6
  export const selectAllXAxes: (state: RechartsRootState) => ReadonlyArray<XAxisSettings> =
7
7
  createSelector(
@@ -1,8 +1,8 @@
1
1
  // Adapted from recharts@3.9.2, commit b3451050c027a23957ffa50a2665c9119df21e47.
2
2
  import { createSelector } from 'reselect';
3
3
  import { selectChartOffsetInternal } from './selectChartOffsetInternal';
4
- import { ChartOffsetInternal } from '../../util/types';
5
- import { ChartOffset } from '../../types';
4
+ import type { ChartOffsetInternal } from '../../util/types';
5
+ import type { ChartOffset } from '../../types';
6
6
 
7
7
  export const selectChartOffset = createSelector(
8
8
  [selectChartOffsetInternal],
@@ -2,7 +2,7 @@
2
2
  import { createSelector } from 'reselect';
3
3
 
4
4
  import { selectLegendSettings, selectLegendSize } from './legendSelectors';
5
- import {
5
+ import type {
6
6
  CartesianViewBoxRequired,
7
7
  ChartOffsetInternal,
8
8
  Margin,
@@ -10,13 +10,13 @@ import {
10
10
  OffsetVertical,
11
11
  Size,
12
12
  } from '../../util/types';
13
- import { XAxisSettings, YAxisSettings } from '../cartesianAxisSlice';
14
- import { LegendSettings } from '../legendSlice';
13
+ import type { XAxisSettings, YAxisSettings } from '../cartesianAxisSlice';
14
+ import type { LegendSettings } from '../legendSlice';
15
15
  import { appendOffsetOfLegend } from '../../util/ChartUtils';
16
16
  import { selectChartHeight, selectChartWidth, selectMargin } from './containerSelectors';
17
17
  import { selectAllXAxes, selectAllYAxes } from './selectAllAxes';
18
18
  import { DEFAULT_Y_AXIS_WIDTH } from '../../util/Constants';
19
- import { RechartsRootState } from '../store';
19
+ import type { RechartsRootState } from '../store';
20
20
 
21
21
  export const selectBrushHeight = (state: RechartsRootState) => state.brush.height;
22
22
 
@@ -1,6 +1,6 @@
1
1
  // Adapted from recharts@3.9.2, commit b3451050c027a23957ffa50a2665c9119df21e47.
2
- import { RechartsRootState } from '../store';
3
- import { AxisId } from '../cartesianAxisSlice';
2
+ import type { RechartsRootState } from '../store';
3
+ import type { AxisId } from '../cartesianAxisSlice';
4
4
 
5
5
  export const selectTooltipAxisId = (state: RechartsRootState): AxisId =>
6
6
  state.tooltip.settings.axisId;
@@ -1,5 +1,5 @@
1
1
  // Adapted from recharts@3.9.2, commit b3451050c027a23957ffa50a2665c9119df21e47.
2
- import { RechartsRootState } from '../store';
2
+ import type { RechartsRootState } from '../store';
3
3
  import { selectChartLayout } from '../../context/chartLayoutContext';
4
4
 
5
5
  /**
@@ -1,8 +1,8 @@
1
1
  // Adapted from recharts@3.9.2, commit b3451050c027a23957ffa50a2665c9119df21e47.
2
- import { RechartsRootState } from '../store';
3
- import { TooltipEventType } from '../../util/types';
2
+ import type { RechartsRootState } from '../store';
3
+ import type { TooltipEventType } from '../../util/types';
4
4
  import { useAppSelector } from '../hooks';
5
- import { SharedTooltipSettings } from '../tooltipSlice';
5
+ import type { SharedTooltipSettings } from '../tooltipSlice';
6
6
 
7
7
  export const selectDefaultTooltipEventType = (state: RechartsRootState): TooltipEventType =>
8
8
  state.options.defaultTooltipEventType;
@@ -1,6 +1,6 @@
1
1
  // Adapted from recharts@3.9.2, commit b3451050c027a23957ffa50a2665c9119df21e47.
2
- import { RechartsRootState } from '../store';
3
- import { TooltipPayloadSearcher } from '../tooltipSlice';
2
+ import type { RechartsRootState } from '../store';
3
+ import type { TooltipPayloadSearcher } from '../tooltipSlice';
4
4
 
5
5
  export const selectTooltipPayloadSearcher = (state: RechartsRootState): TooltipPayloadSearcher =>
6
6
  state.options.tooltipPayloadSearcher;
@@ -1,6 +1,6 @@
1
1
  // Adapted from recharts@3.9.2, commit b3451050c027a23957ffa50a2665c9119df21e47.
2
- import { RechartsRootState } from '../store';
3
- import { TooltipSettingsState } from '../tooltipSlice';
2
+ import type { RechartsRootState } from '../store';
3
+ import type { TooltipSettingsState } from '../tooltipSlice';
4
4
 
5
5
  export const selectTooltipSettings = (state: RechartsRootState): TooltipSettingsState =>
6
6
  state.tooltip.settings;
@@ -1,5 +1,5 @@
1
1
  // Adapted from recharts@3.9.2, commit b3451050c027a23957ffa50a2665c9119df21e47.
2
- import { RechartsRootState } from '../store';
3
- import { TooltipState } from '../tooltipSlice';
2
+ import type { RechartsRootState } from '../store';
3
+ import type { TooltipState } from '../tooltipSlice';
4
4
 
5
5
  export const selectTooltipState = (state: RechartsRootState): TooltipState => state.tooltip;
@@ -2,8 +2,8 @@
2
2
  import { createSelector } from 'reselect';
3
3
  import { sortBy } from 'es-toolkit/compat';
4
4
  import { useAppSelector } from '../hooks';
5
- import { RechartsRootState } from '../store';
6
- import {
5
+ import type { RechartsRootState } from '../store';
6
+ import type {
7
7
  ActiveTooltipProps,
8
8
  TooltipIndex,
9
9
  TooltipInteractionState,
@@ -11,7 +11,7 @@ import {
11
11
  TooltipPayloadConfiguration,
12
12
  } from '../tooltipSlice';
13
13
  import { calculateCartesianTooltipPos, calculatePolarTooltipPos } from '../../util/ChartUtils';
14
- import {
14
+ import type {
15
15
  AxisType,
16
16
  CartesianLayout,
17
17
  ChartOffsetInternal,
@@ -24,14 +24,14 @@ import {
24
24
  TickItem,
25
25
  TooltipEventType,
26
26
  } from '../../util/types';
27
- import { TooltipTrigger } from '../../chart/types';
27
+ import type { TooltipTrigger } from '../../chart/types';
28
28
  import { selectChartDataWithIndexes } from './dataSelectors';
29
29
  import {
30
30
  selectTooltipAxisDomain,
31
31
  selectTooltipAxisTicks,
32
32
  selectTooltipDisplayedData,
33
33
  } from './tooltipSelectors';
34
- import { AxisRange, selectTooltipAxisDataKey } from './axisSelectors';
34
+ import { type AxisRange, selectTooltipAxisDataKey } from './axisSelectors';
35
35
  import { selectChartName } from './rootPropsSelectors';
36
36
  import { selectChartLayout } from '../../context/chartLayoutContext';
37
37
  import { selectChartOffsetInternal } from './selectChartOffsetInternal';
@@ -1,8 +1,8 @@
1
1
  // Adapted from recharts@3.9.2, commit b3451050c027a23957ffa50a2665c9119df21e47.
2
2
  import { createSelector } from 'reselect';
3
- import { RechartsRootState } from '../store';
3
+ import type { RechartsRootState } from '../store';
4
4
  import {
5
- AxisRange,
5
+ type AxisRange,
6
6
  combineAllAppliedValues,
7
7
  combineAreasDomain,
8
8
  combineAxisDomain,
@@ -24,7 +24,7 @@ import {
24
24
  getDomainDefinition,
25
25
  itemAxisPredicate,
26
26
  mergeDomains,
27
- RenderableAxisSettings,
27
+ type RenderableAxisSettings,
28
28
  selectAllErrorBarSettings,
29
29
  selectAxisRange,
30
30
  selectHasBar,
@@ -35,8 +35,8 @@ import {
35
35
  selectTooltipAxisDataKey,
36
36
  } from './axisSelectors';
37
37
  import { selectChartLayout } from '../../context/chartLayoutContext';
38
- import { isCategoricalAxis, StackId } from '../../util/ChartUtils';
39
- import {
38
+ import { isCategoricalAxis, type StackId } from '../../util/ChartUtils';
39
+ import type {
40
40
  AxisDomain,
41
41
  CategoricalDomain,
42
42
  CategoricalDomainItem,
@@ -48,14 +48,14 @@ import {
48
48
  TickItem,
49
49
  TooltipEventType,
50
50
  } from '../../util/types';
51
- import { AppliedChartData, ChartData } from '../chartDataSlice';
51
+ import type { AppliedChartData, ChartData } from '../chartDataSlice';
52
52
  import { selectChartDataWithIndexes, selectChartDataSliceWithIndexes } from './dataSelectors';
53
- import {
53
+ import type {
54
54
  CartesianGraphicalItemSettings,
55
55
  GraphicalItemSettings,
56
56
  PolarGraphicalItemSettings,
57
57
  } from '../graphicalItemsSlice';
58
- import {
58
+ import type {
59
59
  ReferenceAreaSettings,
60
60
  ReferenceDotSettings,
61
61
  ReferenceLineSettings,
@@ -67,7 +67,7 @@ import {
67
67
  } from './rootPropsSelectors';
68
68
  import { isNotNil, mathSign } from '../../util/DataUtils';
69
69
  import { combineAxisRangeWithReverse } from './combiners/combineAxisRangeWithReverse';
70
- import {
70
+ import type {
71
71
  TooltipIndex,
72
72
  TooltipInteractionState,
73
73
  TooltipPayload,
@@ -94,23 +94,23 @@ import { selectTooltipPayloadSearcher } from './selectTooltipPayloadSearcher';
94
94
  import { selectTooltipState } from './selectTooltipState';
95
95
 
96
96
  import { combineTooltipPayload } from './combiners/combineTooltipPayload';
97
- import { StackGroup } from '../../util/stacks/stackTypes';
97
+ import type { StackGroup } from '../../util/stacks/stackTypes';
98
98
  import { selectTooltipAxisId } from './selectTooltipAxisId';
99
- import { RenderableAxisType, selectTooltipAxisType } from './selectTooltipAxisType';
99
+ import { type RenderableAxisType, selectTooltipAxisType } from './selectTooltipAxisType';
100
100
  import {
101
101
  combineDisplayedStackedData,
102
- DisplayedStackedData,
102
+ type DisplayedStackedData,
103
103
  } from './combiners/combineDisplayedStackedData';
104
- import { DefinitelyStackedGraphicalItem, isStacked } from '../types/StackedGraphicalItem';
104
+ import { type DefinitelyStackedGraphicalItem, isStacked } from '../types/StackedGraphicalItem';
105
105
  import { numericalDomainSpecifiedWithoutRequiringData } from '../../util/isDomainSpecifiedByUser';
106
106
  import { numberDomainEqualityCheck } from './numberDomainEqualityCheck';
107
107
  import { emptyArraysAreEqualCheck } from './arrayEqualityCheck';
108
- import { ActiveLabel } from '../../synchronisation/types';
109
- import { RechartsScale, rechartsScaleFactory } from '../../util/scale/RechartsScale';
108
+ import type { ActiveLabel } from '../../synchronisation/types';
109
+ import { type RechartsScale, rechartsScaleFactory } from '../../util/scale/RechartsScale';
110
110
  import { isWellBehavedNumber } from '../../util/isWellBehavedNumber';
111
111
  import { combineRealScaleType } from './combiners/combineRealScaleType';
112
112
  import { combineConfiguredScale } from './combiners/combineConfiguredScale';
113
- import { CustomScaleDefinition } from '../../util/scale/CustomScaleDefinition';
113
+ import type { CustomScaleDefinition } from '../../util/scale/CustomScaleDefinition';
114
114
 
115
115
  export const selectTooltipAxisRealScaleType: (
116
116
  state: RechartsRootState,
@@ -1,10 +1,10 @@
1
1
  // Adapted from recharts@3.9.2, commit b3451050c027a23957ffa50a2665c9119df21e47.
2
2
  import { createSelector } from 'reselect';
3
- import { RechartsRootState } from '../store';
4
- import { TooltipIndex, TooltipPayloadConfiguration } from '../tooltipSlice';
5
- import { Coordinate } from '../../util/types';
3
+ import type { RechartsRootState } from '../store';
4
+ import type { TooltipIndex, TooltipPayloadConfiguration } from '../tooltipSlice';
5
+ import type { Coordinate } from '../../util/types';
6
6
  import { selectTooltipState } from './selectTooltipState';
7
- import { GraphicalItemId } from '../graphicalItemsSlice';
7
+ import type { GraphicalItemId } from '../graphicalItemsSlice';
8
8
 
9
9
  const selectAllTooltipPayloadConfiguration: (
10
10
  state: RechartsRootState,
@@ -1,11 +1,11 @@
1
1
  // Adapted from recharts@3.9.2, commit b3451050c027a23957ffa50a2665c9119df21e47.
2
2
  import {
3
- Action,
3
+ type Action,
4
4
  autoBatchEnhancer,
5
5
  combineReducers,
6
6
  configureStore,
7
- Dispatch,
8
- Store,
7
+ type Dispatch,
8
+ type Store,
9
9
  } from '@reduxjs/toolkit';
10
10
  import { optionsReducer } from './optionsSlice';
11
11
  import { tooltipReducer } from './tooltipSlice';
@@ -1,11 +1,11 @@
1
1
  // Adapted from recharts@3.9.2, commit b3451050c027a23957ffa50a2665c9119df21e47.
2
- import { createSlice, current, PayloadAction, prepareAutoBatched } from '@reduxjs/toolkit';
2
+ import { createSlice, current, type PayloadAction, prepareAutoBatched } from '@reduxjs/toolkit';
3
3
  import { castDraft, type Draft } from 'immer';
4
- import { TooltipTrigger } from '../chart/types';
4
+ import type { TooltipTrigger } from '../chart/types';
5
5
  import type { NameType, Payload, ValueType } from '../component/DefaultTooltipContent.tsrx';
6
- import { CartesianViewBoxRequired, Coordinate, DataKey, PolarCoordinate } from '../util/types';
7
- import { AxisId } from './cartesianAxisSlice';
8
- import { GraphicalItemId } from './graphicalItemsSlice';
6
+ import type { CartesianViewBoxRequired, Coordinate, DataKey, PolarCoordinate } from '../util/types';
7
+ import type { AxisId } from './cartesianAxisSlice';
8
+ import type { GraphicalItemId } from './graphicalItemsSlice';
9
9
 
10
10
  /**
11
11
  * One Tooltip can display multiple TooltipPayloadEntries at a time.
@@ -3,11 +3,11 @@ import type { NativeTouchEvent } from '../util/OctaneTypes';
3
3
  import {
4
4
  createAction,
5
5
  createListenerMiddleware,
6
- ListenerEffectAPI,
7
- PayloadAction,
6
+ type ListenerEffectAPI,
7
+ type PayloadAction,
8
8
  } from '@reduxjs/toolkit';
9
9
 
10
- import { AppDispatch, RechartsRootState } from './store';
10
+ import type { AppDispatch, RechartsRootState } from './store';
11
11
  import { setActiveMouseOverItemIndex, setMouseOverAxisIndex } from './tooltipSlice';
12
12
  import { selectActivePropsFromChartPointer } from './selectors/selectActivePropsFromChartPointer';
13
13
 
@@ -19,7 +19,7 @@ import {
19
19
  } from '../util/Constants';
20
20
  import { selectTooltipCoordinate } from './selectors/touchSelectors';
21
21
  import { selectAllGraphicalItemsSettings } from './selectors/tooltipSelectors';
22
- import { RelativePointer } from '../util/types';
22
+ import type { RelativePointer } from '../util/types';
23
23
  import { createEventProxy } from '../util/createEventProxy';
24
24
 
25
25
  export const touchEventAction = createAction<NativeTouchEvent<HTMLDivElement>>('touchMove');
@@ -1,9 +1,9 @@
1
1
  // Adapted from recharts@3.9.2, commit b3451050c027a23957ffa50a2665c9119df21e47.
2
- import { BaseValue } from '../../cartesian/Area.tsrx';
3
- import { DataKey } from '../../util/types';
4
- import { ChartData } from '../chartDataSlice';
5
- import { MaybeStackedGraphicalItem } from './StackedGraphicalItem';
6
- import { BaseCartesianGraphicalItemSettings } from '../graphicalItemsSlice';
2
+ import type { BaseValue } from '../../cartesian/Area.tsrx';
3
+ import type { DataKey } from '../../util/types';
4
+ import type { ChartData } from '../chartDataSlice';
5
+ import type { MaybeStackedGraphicalItem } from './StackedGraphicalItem';
6
+ import type { BaseCartesianGraphicalItemSettings } from '../graphicalItemsSlice';
7
7
 
8
8
  export type AreaSettings = BaseCartesianGraphicalItemSettings &
9
9
  MaybeStackedGraphicalItem & {
@@ -1,7 +1,7 @@
1
1
  // Adapted from recharts@3.9.2, commit b3451050c027a23957ffa50a2665c9119df21e47.
2
- import { MinPointSize } from '../../util/BarUtils.tsrx';
3
- import { MaybeStackedGraphicalItem } from './StackedGraphicalItem';
4
- import { BaseCartesianGraphicalItemSettings } from '../graphicalItemsSlice';
2
+ import type { MinPointSize } from '../../util/BarUtils.tsrx';
3
+ import type { MaybeStackedGraphicalItem } from './StackedGraphicalItem';
4
+ import type { BaseCartesianGraphicalItemSettings } from '../graphicalItemsSlice';
5
5
 
6
6
  export type BarSettings = BaseCartesianGraphicalItemSettings &
7
7
  MaybeStackedGraphicalItem & {
@@ -1,7 +1,7 @@
1
1
  // Adapted from recharts@3.9.2, commit b3451050c027a23957ffa50a2665c9119df21e47.
2
- import { ChartData } from '../chartDataSlice';
3
- import { DataKey } from '../../util/types';
4
- import { BaseCartesianGraphicalItemSettings } from '../graphicalItemsSlice';
2
+ import type { ChartData } from '../chartDataSlice';
3
+ import type { DataKey } from '../../util/types';
4
+ import type { BaseCartesianGraphicalItemSettings } from '../graphicalItemsSlice';
5
5
 
6
6
  export type LineSettings = BaseCartesianGraphicalItemSettings & {
7
7
  type: 'line';
@@ -1,11 +1,11 @@
1
1
  // Adapted from recharts@3.9.2, commit b3451050c027a23957ffa50a2665c9119df21e47.
2
2
  import type { SVGProps } from '../../util/OctaneTypes';
3
3
 
4
- import { BasePolarGraphicalItemSettings } from '../graphicalItemsSlice';
5
- import { DataKey, LegendType } from '../../util/types';
6
- import { TooltipType } from '../../component/DefaultTooltipContent.tsrx';
7
- import { SVGPropsNoEvents } from '../../util/svgPropertiesNoEvents';
8
- import { WithoutId } from '../../util/useUniqueId';
4
+ import type { BasePolarGraphicalItemSettings } from '../graphicalItemsSlice';
5
+ import type { DataKey, LegendType } from '../../util/types';
6
+ import type { TooltipType } from '../../component/DefaultTooltipContent.tsrx';
7
+ import type { SVGPropsNoEvents } from '../../util/svgPropertiesNoEvents';
8
+ import type { WithoutId } from '../../util/useUniqueId';
9
9
 
10
10
  export type PiePresentationProps = SVGPropsNoEvents<WithoutId<SVGProps<SVGPathElement>>>;
11
11
 
@@ -1,5 +1,5 @@
1
1
  // Adapted from recharts@3.9.2, commit b3451050c027a23957ffa50a2665c9119df21e47.
2
- import { BasePolarGraphicalItemSettings } from '../graphicalItemsSlice';
2
+ import type { BasePolarGraphicalItemSettings } from '../graphicalItemsSlice';
3
3
 
4
4
  export interface RadarSettings extends BasePolarGraphicalItemSettings {
5
5
  type: 'radar';
@@ -1,6 +1,6 @@
1
1
  // Adapted from recharts@3.9.2, commit b3451050c027a23957ffa50a2665c9119df21e47.
2
- import { MaybeStackedGraphicalItem } from './StackedGraphicalItem';
3
- import { BasePolarGraphicalItemSettings } from '../graphicalItemsSlice';
2
+ import type { MaybeStackedGraphicalItem } from './StackedGraphicalItem';
3
+ import type { BasePolarGraphicalItemSettings } from '../graphicalItemsSlice';
4
4
 
5
5
  export interface RadialBarSettings
6
6
  extends BasePolarGraphicalItemSettings, MaybeStackedGraphicalItem {
@@ -1,8 +1,8 @@
1
1
  // Adapted from recharts@3.9.2, commit b3451050c027a23957ffa50a2665c9119df21e47.
2
- import { ChartData } from '../chartDataSlice';
3
- import { DataKey } from '../../util/types';
4
- import { TooltipType } from '../../component/DefaultTooltipContent.tsrx';
5
- import { BaseCartesianGraphicalItemSettings } from '../graphicalItemsSlice';
2
+ import type { ChartData } from '../chartDataSlice';
3
+ import type { DataKey } from '../../util/types';
4
+ import type { TooltipType } from '../../component/DefaultTooltipContent.tsrx';
5
+ import type { BaseCartesianGraphicalItemSettings } from '../graphicalItemsSlice';
6
6
 
7
7
  export type ScatterSettings = BaseCartesianGraphicalItemSettings & {
8
8
  type: 'scatter';
@@ -1,7 +1,7 @@
1
1
  // Adapted from recharts@3.9.2, commit b3451050c027a23957ffa50a2665c9119df21e47.
2
- import { GraphicalItemSettings } from '../graphicalItemsSlice';
3
- import { NormalizedStackId } from '../../util/ChartUtils';
4
- import { DataKey } from '../../util/types';
2
+ import type { GraphicalItemSettings } from '../graphicalItemsSlice';
3
+ import type { NormalizedStackId } from '../../util/ChartUtils';
4
+ import type { DataKey } from '../../util/types';
5
5
 
6
6
  /**
7
7
  * Some graphical items allow data stacking. The stacks are optional,
@@ -3,7 +3,7 @@
3
3
  * This slice contains a registry of z-index values for various components.
4
4
  * The state is a map from z-index numbers to element references.
5
5
  */
6
- import { createSlice, PayloadAction, prepareAutoBatched } from '@reduxjs/toolkit';
6
+ import { createSlice, type PayloadAction, prepareAutoBatched } from '@reduxjs/toolkit';
7
7
  import { castDraft } from 'immer';
8
8
 
9
9
  import { DefaultZIndexes } from '../zIndex/DefaultZIndexes';
@@ -1,6 +1,6 @@
1
1
  // Adapted from recharts@3.9.2, commit b3451050c027a23957ffa50a2665c9119df21e47.
2
- import { RechartsRootState } from '../state/store';
3
- import { TooltipSyncState } from '../state/tooltipSlice';
2
+ import type { RechartsRootState } from '../state/store';
3
+ import type { TooltipSyncState } from '../state/tooltipSlice';
4
4
 
5
5
  export function selectSynchronisedTooltipState(state: RechartsRootState): TooltipSyncState {
6
6
  return state.tooltip.syncInteraction;
@@ -1,6 +1,6 @@
1
1
  // Adapted from recharts@3.9.2, commit b3451050c027a23957ffa50a2665c9119df21e47.
2
- import { Coordinate, DataKey, TickItem } from '../util/types';
3
- import { TooltipIndex } from '../state/tooltipSlice';
2
+ import type { Coordinate, DataKey, TickItem } from '../util/types';
3
+ import type { TooltipIndex } from '../state/tooltipSlice';
4
4
 
5
5
  export type ActiveLabel = string | number | undefined;
6
6
 
@@ -1,5 +1,5 @@
1
1
  // Adapted from recharts@3.9.2, commit b3451050c027a23957ffa50a2665c9119df21e47.
2
- import { Coordinate, RectangleCoordinate, RectanglePosition, Size } from './types';
2
+ import type { Coordinate, RectangleCoordinate, RectanglePosition, Size } from './types';
3
3
 
4
4
  export const rectWithPoints = (
5
5
  { x: x1, y: y1 }: Coordinate,
@@ -3,7 +3,7 @@ import { sortBy } from 'es-toolkit/compat';
3
3
  import { get } from 'es-toolkit/compat';
4
4
 
5
5
  import {
6
- Series,
6
+ type Series,
7
7
  type SeriesPoint,
8
8
  stack as shapeStack,
9
9
  stackOffsetExpand,
@@ -23,8 +23,8 @@ import {
23
23
  mathSign,
24
24
  } from './DataUtils';
25
25
 
26
- import { TooltipEntrySettings, TooltipPayloadEntry } from '../state/tooltipSlice';
27
- import {
26
+ import type { TooltipEntrySettings, TooltipPayloadEntry } from '../state/tooltipSlice';
27
+ import type {
28
28
  AxisTick,
29
29
  AxisType,
30
30
  CartesianLayout,
@@ -42,13 +42,13 @@ import {
42
42
  TickItem,
43
43
  AxisDomainTypeInput,
44
44
  } from './types';
45
- import { ValueType } from '../component/DefaultTooltipContent.tsrx';
46
- import { LegendSettings } from '../state/legendSlice';
47
- import { AxisRange, BaseAxisWithScale } from '../state/selectors/axisSelectors';
48
- import { StackGroup } from './stacks/stackTypes';
45
+ import type { ValueType } from '../component/DefaultTooltipContent.tsrx';
46
+ import type { LegendSettings } from '../state/legendSlice';
47
+ import type { AxisRange, BaseAxisWithScale } from '../state/selectors/axisSelectors';
48
+ import type { StackGroup } from './stacks/stackTypes';
49
49
  import { getSliced } from './getSliced';
50
50
  import { isWellBehavedNumber } from './isWellBehavedNumber';
51
- import { RechartsScale } from './scale/RechartsScale';
51
+ import type { RechartsScale } from './scale/RechartsScale';
52
52
 
53
53
  export function getValueByDataKey<DataPointType, DataValueType>(
54
54
  obj: DataPointType | null | undefined,
@@ -2,7 +2,7 @@
2
2
  import type { CSSProperties } from './OctaneTypes';
3
3
 
4
4
  import { Global } from './Global';
5
- import { Size } from './types';
5
+ import type { Size } from './types';
6
6
  import { LRUCache } from './LRUCache';
7
7
 
8
8
  export interface TextMeasurementConfig {
@@ -1,6 +1,6 @@
1
1
  // Adapted from recharts@3.9.2, commit b3451050c027a23957ffa50a2665c9119df21e47.
2
2
  import { get } from 'es-toolkit/compat';
3
- import { NonEmptyArray, Percent } from './types';
3
+ import type { NonEmptyArray, Percent } from './types';
4
4
  import { round } from './round';
5
5
 
6
6
  export const mathSign = (value: number) => {
@@ -1,8 +1,8 @@
1
1
  // Adapted from recharts@3.9.2, commit b3451050c027a23957ffa50a2665c9119df21e47.
2
2
  import EventEmitter from 'eventemitter3';
3
- import { PayloadAction } from '@reduxjs/toolkit';
4
- import { TooltipSyncState } from '../state/tooltipSlice';
5
- import { BrushStartEndIndex } from '../context/brushUpdateContext';
3
+ import type { PayloadAction } from '@reduxjs/toolkit';
4
+ import type { TooltipSyncState } from '../state/tooltipSlice';
5
+ import type { BrushStartEndIndex } from '../context/brushUpdateContext';
6
6
 
7
7
  const eventCenter: EventEmitter<EventTypes> = new EventEmitter();
8
8
 
@@ -1,7 +1,7 @@
1
1
  import * as React from 'octane';
2
- import { Props as FunnelProps, FunnelTrapezoidItem } from '../cartesian/Funnel.tsrx';
2
+ import type { Props as FunnelProps, FunnelTrapezoidItem } from '../cartesian/Funnel.tsrx';
3
3
  import { Trapezoid } from '../shape/Trapezoid.tsrx';
4
- import { ShapeAnimationProps } from './types';
4
+ import type { ShapeAnimationProps } from './types';
5
5
  import { Shape } from './ActiveShapeUtils.tsrx';
6
6
 
7
7
  export const defaultFunnelShape = Trapezoid;
@@ -1,14 +1,15 @@
1
1
  // DOM contracts shared by the authored Recharts port. Events are native,
2
2
  // while element props and refs follow Octane's public JSX type surface.
3
- import type { OctaneNode } from 'octane';
3
+ import type { CSSProperties, OctaneNode } from 'octane';
4
4
  import type { Octane } from 'octane/jsx-runtime';
5
5
 
6
- export type { OctaneNode } from 'octane';
6
+ export type { CSSProperties, OctaneNode } from 'octane';
7
7
  export type { OctaneElement } from 'octane/jsx-runtime';
8
- export type CSSProperties = Exclude<NonNullable<Octane.HTMLAttributes<Element>['style']>, string>;
9
- export type SVGProps<T> = Octane.SVGProps<T>;
10
- export type SVGAttributes<T> = Octane.SVGAttributes<T>;
11
- export type HTMLAttributes<T> = Octane.HTMLAttributes<T>;
8
+ // Chart layout and text measurement consume CSS values before rendering them.
9
+ type PlainStyleProps<P> = Omit<P, 'style'> & { style?: CSSProperties };
10
+ export type SVGProps<T> = PlainStyleProps<Octane.SVGProps<T>>;
11
+ export type SVGAttributes<T> = PlainStyleProps<Octane.SVGAttributes<T>>;
12
+ export type HTMLAttributes<T> = PlainStyleProps<Octane.HTMLAttributes<T>>;
12
13
  export type AriaAttributes = Pick<
13
14
  Octane.SVGAttributes<Element>,
14
15
  Extract<keyof Octane.SVGAttributes<Element>, `aria-${string}`>
@@ -1,5 +1,5 @@
1
1
  // Adapted from recharts@3.9.2, commit b3451050c027a23957ffa50a2665c9119df21e47.
2
- import {
2
+ import type {
3
3
  ChartOffsetInternal,
4
4
  RelativePointer,
5
5
  Coordinate,
@@ -1,7 +1,7 @@
1
1
  import * as React from 'octane';
2
- import { RadialBarDataItem, RadialBarProps } from '../polar/RadialBar.tsrx';
2
+ import type { RadialBarDataItem, RadialBarProps } from '../polar/RadialBar.tsrx';
3
3
  import { Sector } from '../shape/Sector.tsrx';
4
- import { ShapeAnimationProps } from './types';
4
+ import type { ShapeAnimationProps } from './types';
5
5
  import { Shape } from './ActiveShapeUtils.tsrx';
6
6
 
7
7
  export const defaultRadialBarShape = Sector;
@@ -1,10 +1,10 @@
1
1
  import * as React from 'octane';
2
- import { ActiveShape, ShapeAnimationProps, SymbolType } from './types';
3
- import { ScatterPointItem } from '../cartesian/Scatter.tsrx';
4
- import { InnerSymbolsProp, Symbols } from '../shape/Symbols.tsrx';
2
+ import type { ActiveShape, ShapeAnimationProps, SymbolType } from './types';
3
+ import type { ScatterPointItem } from '../cartesian/Scatter.tsrx';
4
+ import { type InnerSymbolsProp, Symbols } from '../shape/Symbols.tsrx';
5
5
  import { Shape } from './ActiveShapeUtils.tsrx';
6
6
  import { DATA_ITEM_GRAPHICAL_ITEM_ID_ATTRIBUTE_NAME } from './Constants';
7
- import { GraphicalItemId } from '../state/graphicalItemsSlice';
7
+ import type { GraphicalItemId } from '../state/graphicalItemsSlice';
8
8
 
9
9
  export type ScatterShapeProps =
10
10
  ScatterPointItem & ShapeAnimationProps & {
@@ -1,7 +1,7 @@
1
1
  // Adapted from recharts@3.9.2, commit b3451050c027a23957ffa50a2665c9119df21e47.
2
2
  import { getAngledRectangleWidth } from './CartesianUtils';
3
3
  import { getEveryNth } from './getEveryNth';
4
- import { Size, CartesianTickItem, CartesianViewBoxRequired } from './types';
4
+ import type { Size, CartesianTickItem, CartesianViewBoxRequired } from './types';
5
5
 
6
6
  export function getAngledTickWidth(contentSize: Size, unitSize: Size, angle: number | undefined) {
7
7
  const size = {