@octanejs/recharts 0.1.51 → 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 (157) hide show
  1. package/package.json +2 -2
  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 +1 -1
  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/PolarUtils.ts +1 -1
  136. package/src/util/RadialBarUtils.tsrx +2 -2
  137. package/src/util/ScatterUtils.tsrx +4 -4
  138. package/src/util/TickUtils.ts +1 -1
  139. package/src/util/axisPropsAreEqual.ts +3 -3
  140. package/src/util/cursor/getCursorPoints.ts +6 -6
  141. package/src/util/cursor/getCursorRectangle.ts +1 -1
  142. package/src/util/cursor/getRadialCursorPoints.ts +1 -1
  143. package/src/util/getActiveCoordinate.ts +2 -2
  144. package/src/util/getAxisTypeBasedOnLayout.ts +1 -1
  145. package/src/util/getRadiusAndStrokeWidthFromDot.ts +1 -1
  146. package/src/util/getRelativeCoordinate.ts +1 -1
  147. package/src/util/isDomainSpecifiedByUser.ts +1 -1
  148. package/src/util/scale/CartesianScaleHelper.ts +2 -2
  149. package/src/util/scale/CustomScaleDefinition.ts +1 -1
  150. package/src/util/scale/RechartsScale.ts +2 -2
  151. package/src/util/scale/createCategoricalInverse.ts +2 -2
  152. package/src/util/scale/getNiceTickValues.ts +2 -2
  153. package/src/util/stacks/getStackSeriesIdentifier.ts +2 -2
  154. package/src/util/stacks/stackTypes.ts +4 -4
  155. package/src/util/tooltip/translate.ts +1 -1
  156. package/src/util/types.ts +12 -12
  157. package/src/zIndex/zIndexSelectors.ts +1 -1
@@ -13,24 +13,24 @@ import * as React from 'octane';
13
13
  import { useRef } from 'octane';
14
14
  import { clsx } from 'clsx';
15
15
 
16
- import { Series } from 'victory-vendor/d3-shape';
16
+ import type { Series } from 'victory-vendor/d3-shape';
17
17
  import {
18
18
  defaultRadialBarShape,
19
19
  parseCornerRadius,
20
20
  RadialBarSector,
21
- RadialBarSectorProps,
21
+ type RadialBarSectorProps,
22
22
  } from '../util/RadialBarUtils.tsrx';
23
23
  import { defaultSectorProps, type Props as SectorProps } from '../shape/Sector.tsrx';
24
24
  import { Layer } from '../container/Layer.tsrx';
25
25
  import {
26
- ImplicitLabelListType,
26
+ type ImplicitLabelListType,
27
27
  LabelListFromLabelProp,
28
28
  PolarLabelListContextProvider,
29
- PolarLabelListEntry,
29
+ type PolarLabelListEntry,
30
30
  } from '../component/LabelList.tsrx';
31
31
  import { interpolate, mathSign, noop } from '../util/DataUtils';
32
32
  import {
33
- BarPositionPosition,
33
+ type BarPositionPosition,
34
34
  getCateCoordinateOfBar,
35
35
  getNormalizedStackId,
36
36
  getTooltipNameProp,
@@ -38,32 +38,32 @@ import {
38
38
  truncateByDomain,
39
39
  } from '../util/ChartUtils';
40
40
  import {
41
- ActiveShape,
41
+ type ActiveShape,
42
42
  adaptEventsOfChild,
43
- AnimationDuration,
44
- EasingInput,
45
- DataConsumer,
46
- DataKey,
47
- GeometrySector,
48
- LayoutType,
49
- LegendType,
50
- PresentationAttributesAdaptChildEvent,
51
- ShapeAnimationProps,
52
- TickItem,
53
- TooltipType,
54
- PolarLayout,
43
+ type AnimationDuration,
44
+ type EasingInput,
45
+ type DataConsumer,
46
+ type DataKey,
47
+ type GeometrySector,
48
+ type LayoutType,
49
+ type LegendType,
50
+ type PresentationAttributesAdaptChildEvent,
51
+ type ShapeAnimationProps,
52
+ type TickItem,
53
+ type TooltipType,
54
+ type PolarLayout,
55
55
  } from '../util/types';
56
56
  import {
57
- TooltipTriggerInfo,
57
+ type TooltipTriggerInfo,
58
58
  useMouseClickItemDispatch,
59
59
  useMouseEnterItemDispatch,
60
60
  useMouseLeaveItemDispatch,
61
61
  } from '../context/tooltipContext';
62
- import { TooltipPayloadConfiguration } from '../state/tooltipSlice';
62
+ import type { TooltipPayloadConfiguration } from '../state/tooltipSlice';
63
63
  import { SetTooltipEntrySettings } from '../state/SetTooltipEntrySettings';
64
- import { Formatter } from '../component/DefaultTooltipContent.tsrx';
65
- import { BaseAxisWithScale } from '../state/selectors/axisSelectors';
66
- import { ChartData } from '../state/chartDataSlice';
64
+ import type { Formatter } from '../component/DefaultTooltipContent.tsrx';
65
+ import type { BaseAxisWithScale } from '../state/selectors/axisSelectors';
66
+ import type { ChartData } from '../state/chartDataSlice';
67
67
  import {
68
68
  selectRadialBarLegendPayload,
69
69
  selectRadialBarSectors,
@@ -73,11 +73,11 @@ import { selectActiveTooltipIndex } from '../state/selectors/tooltipSelectors';
73
73
  import { SetPolarLegendPayload } from '../state/SetLegendPayload';
74
74
  import {
75
75
  AnimatedItems,
76
- AnimationInterpolateFn,
76
+ type AnimationInterpolateFn,
77
77
  useAnimationCallbacks,
78
78
  } from '../animation/AnimatedItems.tsrx';
79
- import { AnimationMatchByProp, matchAppend } from '../animation/matchBy';
80
- import { AxisId } from '../state/cartesianAxisSlice';
79
+ import { type AnimationMatchByProp, matchAppend } from '../animation/matchBy';
80
+ import type { AxisId } from '../state/cartesianAxisSlice';
81
81
  import { RegisterGraphicalItemId } from '../context/RegisterGraphicalItemId.tsrx';
82
82
  import type { RadialBarSettings } from '../state/types/RadialBarSettings';
83
83
  import { SetPolarGraphicalItem } from '../state/SetGraphicalItem';
@@ -85,9 +85,9 @@ import {
85
85
  svgPropertiesNoEvents,
86
86
  svgPropertiesNoEventsFromUnknown,
87
87
  } from '../util/svgPropertiesNoEvents';
88
- import { RequiresDefaultProps, resolveDefaultProps } from '../util/resolveDefaultProps';
89
- import { WithIdRequired } from '../util/useUniqueId';
90
- import { ZIndexable, ZIndexLayer } from '../zIndex/ZIndexLayer.tsrx';
88
+ import { type RequiresDefaultProps, resolveDefaultProps } from '../util/resolveDefaultProps';
89
+ import type { WithIdRequired } from '../util/useUniqueId';
90
+ import { type ZIndexable, ZIndexLayer } from '../zIndex/ZIndexLayer.tsrx';
91
91
  import { DefaultZIndexes } from '../zIndex/DefaultZIndexes';
92
92
  import { getZIndexFromUnknown } from '../zIndex/getZIndexFromUnknown';
93
93
  import { usePolarChartLayout } from '../context/chartLayoutContext';
@@ -1,5 +1,5 @@
1
1
  // Adapted from recharts@3.9.2, commit b3451050c027a23957ffa50a2665c9119df21e47.
2
- import { Props } from './PolarAngleAxis.tsrx';
2
+ import type { Props } from './PolarAngleAxis.tsrx';
3
3
  import { DefaultZIndexes } from '../zIndex/DefaultZIndexes';
4
4
 
5
5
  export const defaultPolarAngleAxisProps = {
@@ -1,5 +1,5 @@
1
1
  // Adapted from recharts@3.9.2, commit b3451050c027a23957ffa50a2665c9119df21e47.
2
- import { Props } from './PolarRadiusAxis.tsrx';
2
+ import type { Props } from './PolarRadiusAxis.tsrx';
3
3
  import { DefaultZIndexes } from '../zIndex/DefaultZIndexes';
4
4
 
5
5
  export const defaultPolarRadiusAxisProps = {
@@ -1,6 +1,6 @@
1
1
  import { useEffect } from 'octane';
2
2
  import { useAppDispatch } from './hooks';
3
- import { PolarChartOptions, updatePolarOptions } from './polarOptionsSlice';
3
+ import { type PolarChartOptions, updatePolarOptions } from './polarOptionsSlice';
4
4
 
5
5
  export function ReportPolarOptions(props: PolarChartOptions): null {
6
6
  const dispatch = useAppDispatch();
@@ -1,6 +1,6 @@
1
1
  // Adapted from recharts@3.9.2, commit b3451050c027a23957ffa50a2665c9119df21e47.
2
- import { createSlice, PayloadAction } from '@reduxjs/toolkit';
3
- import { Padding } from '../util/types';
2
+ import { createSlice, type PayloadAction } from '@reduxjs/toolkit';
3
+ import type { Padding } from '../util/types';
4
4
 
5
5
  /**
6
6
  * From all Brush properties, only height has a default value and will always be defined.
@@ -1,7 +1,7 @@
1
1
  // Adapted from recharts@3.9.2, commit b3451050c027a23957ffa50a2665c9119df21e47.
2
- import { createSlice, PayloadAction, prepareAutoBatched } from '@reduxjs/toolkit';
2
+ import { createSlice, type PayloadAction, prepareAutoBatched } from '@reduxjs/toolkit';
3
3
  import { castDraft, type Draft } from 'immer';
4
- import {
4
+ import type {
5
5
  AxisDomain,
6
6
  AxisInterval,
7
7
  AxisTick,
@@ -10,9 +10,9 @@ import {
10
10
  ScaleType,
11
11
  TickProp,
12
12
  } from '../util/types';
13
- import { TickFormatter } from '../cartesian/CartesianAxis.tsrx';
13
+ import type { TickFormatter } from '../cartesian/CartesianAxis.tsrx';
14
14
  import type { AxisRange } from './selectors/axisSelectors';
15
- import { CustomScaleDefinition } from '../util/scale/CustomScaleDefinition';
15
+ import type { CustomScaleDefinition } from '../util/scale/CustomScaleDefinition';
16
16
 
17
17
  /**
18
18
  * @inline
@@ -1,7 +1,7 @@
1
1
  // Adapted from recharts@3.9.2, commit b3451050c027a23957ffa50a2665c9119df21e47.
2
- import { PayloadAction, createSlice } from '@reduxjs/toolkit';
2
+ import { type PayloadAction, createSlice } from '@reduxjs/toolkit';
3
3
  import { castDraft } from 'immer';
4
- import { BrushStartEndIndex } from '../context/brushUpdateContext';
4
+ import type { BrushStartEndIndex } from '../context/brushUpdateContext';
5
5
 
6
6
  /**
7
7
  * This is the data that's coming through main chart `data` prop
@@ -1,8 +1,8 @@
1
1
  // Adapted from recharts@3.9.2, commit b3451050c027a23957ffa50a2665c9119df21e47.
2
- import { createSlice, PayloadAction } from '@reduxjs/toolkit';
3
- import { ErrorBarDirection } from '../cartesian/ErrorBar.tsrx';
4
- import { DataKey } from '../util/types';
5
- import { GraphicalItemId } from './graphicalItemsSlice';
2
+ import { createSlice, type PayloadAction } from '@reduxjs/toolkit';
3
+ import type { ErrorBarDirection } from '../cartesian/ErrorBar.tsrx';
4
+ import type { DataKey } from '../util/types';
5
+ import type { GraphicalItemId } from './graphicalItemsSlice';
6
6
 
7
7
  /**
8
8
  * ErrorBars have lot more settings but all the others are scoped to the component itself.
@@ -1,7 +1,7 @@
1
1
  // Adapted from recharts@3.9.2, commit b3451050c027a23957ffa50a2665c9119df21e47.
2
- import { createSlice, PayloadAction } from '@reduxjs/toolkit';
2
+ import { createSlice, type PayloadAction } from '@reduxjs/toolkit';
3
3
  import { castDraft } from 'immer';
4
- import { EventThrottlingProps } from '../util/types';
4
+ import type { EventThrottlingProps } from '../util/types';
5
5
 
6
6
  export type EventSettingsState = Required<EventThrottlingProps>;
7
7
 
@@ -3,12 +3,12 @@ import type { NativeEvent } 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 { CategoricalChartFunc } from '../chart/types';
11
- import { MouseHandlerDataParam } from '../synchronisation/types';
10
+ import type { CategoricalChartFunc } from '../chart/types';
11
+ import type { MouseHandlerDataParam } from '../synchronisation/types';
12
12
  import {
13
13
  selectActiveLabel,
14
14
  selectActiveTooltipCoordinate,
@@ -16,7 +16,7 @@ import {
16
16
  selectActiveTooltipIndex,
17
17
  selectIsTooltipActive,
18
18
  } from './selectors/tooltipSelectors';
19
- import { AppDispatch, RechartsRootState } from './store';
19
+ import type { AppDispatch, RechartsRootState } from './store';
20
20
  import { createEventProxy } from '../util/createEventProxy';
21
21
 
22
22
  type ExternalEventActionPayload<E = NativeEvent> = {
@@ -1,16 +1,16 @@
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 { ChartData } from './chartDataSlice';
5
- import { AxisId } from './cartesianAxisSlice';
6
- import { DataKey } from '../util/types';
7
- import { LineSettings } from './types/LineSettings';
8
- import { ScatterSettings } from './types/ScatterSettings';
9
- import { AreaSettings } from './types/AreaSettings';
10
- import { BarSettings } from './types/BarSettings';
11
- import { RadialBarSettings } from './types/RadialBarSettings';
12
- import { PieSettings } from './types/PieSettings';
13
- import { RadarSettings } from './types/RadarSettings';
4
+ import type { ChartData } from './chartDataSlice';
5
+ import type { AxisId } from './cartesianAxisSlice';
6
+ import type { DataKey } from '../util/types';
7
+ import type { LineSettings } from './types/LineSettings';
8
+ import type { ScatterSettings } from './types/ScatterSettings';
9
+ import type { AreaSettings } from './types/AreaSettings';
10
+ import type { BarSettings } from './types/BarSettings';
11
+ import type { RadialBarSettings } from './types/RadialBarSettings';
12
+ import type { PieSettings } from './types/PieSettings';
13
+ import type { RadarSettings } from './types/RadarSettings';
14
14
 
15
15
  /**
16
16
  * Unique ID of the graphical item.
@@ -1,7 +1,7 @@
1
1
  // Adapted from recharts@3.9.2, commit b3451050c027a23957ffa50a2665c9119df21e47.
2
- import { createAction, createListenerMiddleware, ListenerEffectAPI } from '@reduxjs/toolkit';
3
- import { setKeyboardInteraction, TooltipInteractionState } from './tooltipSlice';
4
- import { AppDispatch, RechartsRootState } from './store';
2
+ import { createAction, createListenerMiddleware, type ListenerEffectAPI } from '@reduxjs/toolkit';
3
+ import { setKeyboardInteraction, type TooltipInteractionState } from './tooltipSlice';
4
+ import type { AppDispatch, RechartsRootState } from './store';
5
5
  import {
6
6
  selectTooltipAxisDomain,
7
7
  selectTooltipAxisTicks,
@@ -1,6 +1,6 @@
1
1
  // Adapted from recharts@3.9.2, commit b3451050c027a23957ffa50a2665c9119df21e47.
2
- import { createSlice, PayloadAction } from '@reduxjs/toolkit';
3
- import { LayoutType, Margin, Size } from '../util/types';
2
+ import { createSlice, type PayloadAction } from '@reduxjs/toolkit';
3
+ import type { LayoutType, Margin, Size } from '../util/types';
4
4
 
5
5
  type ChartLayoutState = {
6
6
  layoutType: LayoutType;
@@ -1,8 +1,8 @@
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 } from 'immer';
4
- import { LayoutType, Size } from '../util/types';
5
- import {
4
+ import type { LayoutType, Size } from '../util/types';
5
+ import type {
6
6
  HorizontalAlignmentType,
7
7
  LegendPayload,
8
8
  VerticalAlignmentType,
@@ -2,16 +2,16 @@
2
2
  import {
3
3
  createAction,
4
4
  createListenerMiddleware,
5
- ListenerEffectAPI,
6
- PayloadAction,
5
+ type ListenerEffectAPI,
6
+ type PayloadAction,
7
7
  } from '@reduxjs/toolkit';
8
- import { AppDispatch, RechartsRootState } from './store';
8
+ import type { AppDispatch, RechartsRootState } from './store';
9
9
  import { mouseLeaveChart, setMouseClickAxisIndex, setMouseOverAxisIndex } from './tooltipSlice';
10
10
  import { selectActivePropsFromChartPointer } from './selectors/selectActivePropsFromChartPointer';
11
11
  import { selectTooltipEventType } from './selectors/selectTooltipEventType';
12
12
 
13
13
  import { getRelativeCoordinate } from '../util/getRelativeCoordinate';
14
- import { RelativePointer, HTMLMousePointer } from '../util/types';
14
+ import type { RelativePointer, HTMLMousePointer } from '../util/types';
15
15
 
16
16
  export const mouseClickAction = createAction<HTMLMousePointer>('mouseClick');
17
17
 
@@ -1,7 +1,7 @@
1
1
  // Adapted from recharts@3.9.2, commit b3451050c027a23957ffa50a2665c9119df21e47.
2
2
  import { createSlice } from '@reduxjs/toolkit';
3
- import { TooltipEventType } from '../util/types';
4
- import { TooltipIndex, TooltipPayloadSearcher } from './tooltipSlice';
3
+ import type { TooltipEventType } from '../util/types';
4
+ import type { TooltipIndex, TooltipPayloadSearcher } from './tooltipSlice';
5
5
  import { isNan } from '../util/DataUtils';
6
6
 
7
7
  /**
@@ -1,7 +1,7 @@
1
1
  // Adapted from recharts@3.9.2, commit b3451050c027a23957ffa50a2665c9119df21e47.
2
- import { createSlice, PayloadAction } from '@reduxjs/toolkit';
2
+ import { createSlice, type PayloadAction } from '@reduxjs/toolkit';
3
3
  import { castDraft } from 'immer';
4
- import { AxisId, BaseCartesianAxis, TicksSettings } from './cartesianAxisSlice';
4
+ import type { AxisId, BaseCartesianAxis, TicksSettings } from './cartesianAxisSlice';
5
5
 
6
6
  export type RadiusAxisSettings = BaseCartesianAxis & TicksSettings;
7
7
 
@@ -1,5 +1,5 @@
1
1
  // Adapted from recharts@3.9.2, commit b3451050c027a23957ffa50a2665c9119df21e47.
2
- import { createSlice, PayloadAction } from '@reduxjs/toolkit';
2
+ import { createSlice, type PayloadAction } from '@reduxjs/toolkit';
3
3
 
4
4
  export type PolarChartOptions = {
5
5
  cx: number | string;
@@ -1,9 +1,9 @@
1
1
  // Adapted from recharts@3.9.2, commit b3451050c027a23957ffa50a2665c9119df21e47.
2
- import { createSlice, current, PayloadAction } from '@reduxjs/toolkit';
3
- import { castDraft, WritableDraft } from 'immer';
4
- import { AxisId } from './cartesianAxisSlice';
5
- import { IfOverflow } from '../util/IfOverflow';
6
- import { ReferenceLineSegment } from '../cartesian/ReferenceLine.tsrx';
2
+ import { createSlice, current, type PayloadAction } from '@reduxjs/toolkit';
3
+ import { castDraft, type WritableDraft } from 'immer';
4
+ import type { AxisId } from './cartesianAxisSlice';
5
+ import type { IfOverflow } from '../util/IfOverflow';
6
+ import type { ReferenceLineSegment } from '../cartesian/ReferenceLine.tsrx';
7
7
 
8
8
  export type ReferenceElementSettings = {
9
9
  yAxisId: AxisId;
@@ -8,10 +8,10 @@
8
8
  *
9
9
  * This renderedTickSlice stores those actually rendered ticks so that we can return them from a hook later.
10
10
  */
11
- import { createSlice, PayloadAction } from '@reduxjs/toolkit';
12
- import { castDraft, WritableDraft } from 'immer';
13
- import { TickItem } from '../util/types';
14
- import { AxisId } from './cartesianAxisSlice';
11
+ import { createSlice, type PayloadAction } from '@reduxjs/toolkit';
12
+ import { castDraft, type WritableDraft } from 'immer';
13
+ import type { TickItem } from '../util/types';
14
+ import type { AxisId } from './cartesianAxisSlice';
15
15
 
16
16
  type RenderedTicksAxisState = {
17
17
  [axisId: AxisId]: ReadonlyArray<TickItem>;
@@ -1,8 +1,8 @@
1
1
  // Adapted from recharts@3.9.2, commit b3451050c027a23957ffa50a2665c9119df21e47.
2
- import { createSlice, PayloadAction } from '@reduxjs/toolkit';
3
- import { StackOffsetType } from '../util/types';
4
- import { SyncMethod } from '../synchronisation/types';
5
- import { BaseValue } from '../cartesian/Area.tsrx';
2
+ import { createSlice, type PayloadAction } from '@reduxjs/toolkit';
3
+ import type { StackOffsetType } from '../util/types';
4
+ import type { SyncMethod } from '../synchronisation/types';
5
+ import type { BaseValue } from '../cartesian/Area.tsrx';
6
6
 
7
7
  /**
8
8
  * These are chart options that users can choose - which means they can also
@@ -1,6 +1,6 @@
1
1
  import { createSelector } from 'reselect';
2
- import { SeriesPoint } from 'victory-vendor/d3-shape';
3
- import { NullableCoordinate } from '../../util/types';
2
+ import type { SeriesPoint } from 'victory-vendor/d3-shape';
3
+ import type { NullableCoordinate } from '../../util/types';
4
4
  import { computeArea } from '../../cartesian/Area.tsrx';
5
5
  import {
6
6
  selectAxisWithScale,
@@ -8,12 +8,12 @@ import {
8
8
  selectTicksOfGraphicalItem,
9
9
  selectUnfilteredCartesianItems,
10
10
  } from './axisSelectors';
11
- import { RechartsRootState } from '../store';
12
- import { AxisId } from '../cartesianAxisSlice';
11
+ import type { RechartsRootState } from '../store';
12
+ import type { AxisId } from '../cartesianAxisSlice';
13
13
  import { selectChartLayout } from '../../context/chartLayoutContext';
14
14
  import { selectChartDataWithIndexesIfNotInPanoramaPosition3 } from './dataSelectors';
15
- import { getBandSizeOfAxis, isCategoricalAxis, StackId } from '../../util/ChartUtils';
16
- import { ChartData } from '../chartDataSlice';
15
+ import { getBandSizeOfAxis, isCategoricalAxis, type StackId } from '../../util/ChartUtils';
16
+ import type { ChartData } from '../chartDataSlice';
17
17
  import { getStackSeriesIdentifier } from '../../util/stacks/getStackSeriesIdentifier';
18
18
  import type {
19
19
  StackDataPoint,
@@ -22,7 +22,7 @@ import type {
22
22
  StackSeriesIdentifier,
23
23
  } from '../../util/stacks/stackTypes';
24
24
  import type { AreaSettings } from '../types/AreaSettings';
25
- import { GraphicalItemId } from '../graphicalItemsSlice';
25
+ import type { GraphicalItemId } from '../graphicalItemsSlice';
26
26
  import { selectChartBaseValue } from './rootPropsSelectors';
27
27
  import {
28
28
  selectXAxisIdFromGraphicalItemId,
@@ -7,9 +7,9 @@ import {
7
7
  getStackedData,
8
8
  getValueByDataKey,
9
9
  isCategoricalAxis,
10
- StackId,
10
+ type StackId,
11
11
  } from '../../util/ChartUtils';
12
- import {
12
+ import type {
13
13
  AxisDomain,
14
14
  AxisTick,
15
15
  AxisType,
@@ -26,7 +26,7 @@ import {
26
26
  StackOffsetType,
27
27
  TickItem,
28
28
  } from '../../util/types';
29
- import {
29
+ import type {
30
30
  AxisId,
31
31
  BaseCartesianAxis,
32
32
  CartesianAxisSettings,
@@ -36,7 +36,7 @@ import {
36
36
  YAxisSettings,
37
37
  ZAxisSettings,
38
38
  } from '../cartesianAxisSlice';
39
- import { RechartsRootState } from '../store';
39
+ import type { RechartsRootState } from '../store';
40
40
  import {
41
41
  selectChartDataWithIndexes,
42
42
  selectChartDataWithIndexesIfNotInPanoramaPosition4,
@@ -47,7 +47,7 @@ import {
47
47
  numericalDomainSpecifiedWithoutRequiringData,
48
48
  parseNumericalUserDomain,
49
49
  } from '../../util/isDomainSpecifiedByUser';
50
- import { AppliedChartData, ChartData, ChartDataState } from '../chartDataSlice';
50
+ import type { AppliedChartData, ChartData, ChartDataState } from '../chartDataSlice';
51
51
  import {
52
52
  getPercentValue,
53
53
  hasDuplicate,
@@ -56,7 +56,7 @@ import {
56
56
  isNumOrStr,
57
57
  mathSign,
58
58
  } from '../../util/DataUtils';
59
- import {
59
+ import type {
60
60
  BaseCartesianGraphicalItemSettings,
61
61
  BasePolarGraphicalItemSettings,
62
62
  CartesianGraphicalItemSettings,
@@ -64,7 +64,7 @@ import {
64
64
  } from '../graphicalItemsSlice';
65
65
  import { isWellBehavedNumber } from '../../util/isWellBehavedNumber';
66
66
  import { getNiceTickValues, getTickValuesFixedDomain } from '../../util/scale';
67
- import {
67
+ import type {
68
68
  ReferenceAreaSettings,
69
69
  ReferenceDotSettings,
70
70
  ReferenceElementSettings,
@@ -73,8 +73,8 @@ import {
73
73
  import { selectChartHeight, selectChartWidth } from './containerSelectors';
74
74
  import { selectAllXAxes, selectAllYAxes } from './selectAllAxes';
75
75
  import { selectChartOffsetInternal } from './selectChartOffsetInternal';
76
- import { AxisPropsForCartesianGridTicksGeneration } from '../../cartesian/CartesianGrid.tsrx';
77
- import { BrushDimensions, selectBrushDimensions, selectBrushSettings } from './brushSelectors';
76
+ import type { AxisPropsForCartesianGridTicksGeneration } from '../../cartesian/CartesianGrid.tsrx';
77
+ import { type BrushDimensions, selectBrushDimensions, selectBrushSettings } from './brushSelectors';
78
78
  import {
79
79
  selectBarCategoryGap,
80
80
  selectChartName,
@@ -87,29 +87,33 @@ import {
87
87
  selectRadiusAxis,
88
88
  selectRadiusAxisRange,
89
89
  } from './polarAxisSelectors';
90
- import { AngleAxisSettings, RadiusAxisSettings } from '../polarAxisSlice';
90
+ import type { AngleAxisSettings, RadiusAxisSettings } from '../polarAxisSlice';
91
91
  import { pickAxisType } from './pickAxisType';
92
92
  import { pickAxisId } from './pickAxisId';
93
93
  import { combineAxisRangeWithReverse } from './combiners/combineAxisRangeWithReverse';
94
94
  import { DEFAULT_Y_AXIS_WIDTH } from '../../util/Constants';
95
95
  import { getStackSeriesIdentifier } from '../../util/stacks/getStackSeriesIdentifier';
96
- import { AllStackGroups, StackGroup } from '../../util/stacks/stackTypes';
96
+ import type { AllStackGroups, StackGroup } from '../../util/stacks/stackTypes';
97
97
  import {
98
98
  combineDisplayedStackedData,
99
- DisplayedStackedData,
99
+ type DisplayedStackedData,
100
100
  } from './combiners/combineDisplayedStackedData';
101
- import { DefinitelyStackedGraphicalItem, isStacked } from '../types/StackedGraphicalItem';
102
- import { ErrorBarsSettings, ErrorBarsState } from '../errorBarSlice';
101
+ import { type DefinitelyStackedGraphicalItem, isStacked } from '../types/StackedGraphicalItem';
102
+ import type { ErrorBarsSettings, ErrorBarsState } from '../errorBarSlice';
103
103
  import { numberDomainEqualityCheck } from './numberDomainEqualityCheck';
104
104
  import { emptyArraysAreEqualCheck } from './arrayEqualityCheck';
105
- import { AllAxisTypes, RenderableAxisType, selectTooltipAxisType } from './selectTooltipAxisType';
105
+ import {
106
+ type AllAxisTypes,
107
+ type RenderableAxisType,
108
+ selectTooltipAxisType,
109
+ } from './selectTooltipAxisType';
106
110
  import { selectTooltipAxisId } from './selectTooltipAxisId';
107
- import { RechartsScale, rechartsScaleFactory } from '../../util/scale/RechartsScale';
111
+ import { type RechartsScale, rechartsScaleFactory } from '../../util/scale/RechartsScale';
108
112
  import { combineCheckedDomain } from './combiners/combineCheckedDomain';
109
- import { CustomScaleDefinition } from '../../util/scale/CustomScaleDefinition';
113
+ import type { CustomScaleDefinition } from '../../util/scale/CustomScaleDefinition';
110
114
  import { combineConfiguredScale } from './combiners/combineConfiguredScale';
111
115
  import { combineRealScaleType } from './combiners/combineRealScaleType';
112
- import { InverseScaleFunction } from '../../hooks';
116
+ import type { InverseScaleFunction } from '../../hooks';
113
117
  import { createCategoricalInverse } from '../../util/scale/createCategoricalInverse';
114
118
  import { combineInverseScaleFunction } from './combiners/combineInverseScaleFunction';
115
119
 
@@ -2,10 +2,10 @@
2
2
  import type { RegisteredCell } from '../../context/CellsContext';
3
3
  import { createSelector } from 'reselect';
4
4
 
5
- import { Series } from 'victory-vendor/d3-shape';
6
- import { RechartsRootState } from '../store';
5
+ import type { Series } from 'victory-vendor/d3-shape';
6
+ import type { RechartsRootState } from '../store';
7
7
  import {
8
- BaseAxisWithScale,
8
+ type BaseAxisWithScale,
9
9
  selectAxisWithScale,
10
10
  selectCartesianAxisSize,
11
11
  selectStackGroups,
@@ -13,17 +13,17 @@ import {
13
13
  selectUnfilteredCartesianItems,
14
14
  } from './axisSelectors';
15
15
  import { isNullish } from '../../util/DataUtils';
16
- import { BarPositionPosition, getBandSizeOfAxis, StackId } from '../../util/ChartUtils';
17
- import {
16
+ import { type BarPositionPosition, getBandSizeOfAxis, type StackId } from '../../util/ChartUtils';
17
+ import type {
18
18
  CartesianViewBoxRequired,
19
19
  ChartOffsetInternal,
20
20
  DataKey,
21
21
  LayoutType,
22
22
  TickItem,
23
23
  } from '../../util/types';
24
- import { BarRectangleItem, computeBarRectangles } from '../../cartesian/Bar.tsrx';
24
+ import { type BarRectangleItem, computeBarRectangles } from '../../cartesian/Bar.tsrx';
25
25
  import { selectChartLayout } from '../../context/chartLayoutContext';
26
- import { ChartData } from '../chartDataSlice';
26
+ import type { ChartData } from '../chartDataSlice';
27
27
  import { selectChartDataWithIndexesIfNotInPanoramaPosition3 } from './dataSelectors';
28
28
  import { selectAxisViewBox, selectChartOffsetInternal } from './selectChartOffsetInternal';
29
29
  import {
@@ -32,14 +32,14 @@ import {
32
32
  selectRootBarSize,
33
33
  selectRootMaxBarSize,
34
34
  } from './rootPropsSelectors';
35
- import {
35
+ import type {
36
36
  AllStackGroups,
37
37
  StackDataPoint,
38
38
  StackSeriesIdentifier,
39
39
  } from '../../util/stacks/stackTypes';
40
- import { BarSettings } from '../types/BarSettings';
41
- import { GraphicalItemId } from '../graphicalItemsSlice';
42
- import { BarCategory, combineBarSizeList } from './combiners/combineBarSizeList';
40
+ import type { BarSettings } from '../types/BarSettings';
41
+ import type { GraphicalItemId } from '../graphicalItemsSlice';
42
+ import { type BarCategory, combineBarSizeList } from './combiners/combineBarSizeList';
43
43
  import { combineAllBarPositions } from './combiners/combineAllBarPositions';
44
44
  import { combineStackedData } from './combiners/combineStackedData';
45
45
  import {
@@ -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';
3
+ import type { RechartsRootState } from '../store';
4
4
  import { selectChartOffsetInternal } from './selectChartOffsetInternal';
5
5
  import { selectMargin } from './containerSelectors';
6
6
  import { isNumber } from '../../util/DataUtils';
7
- import { BrushSettings } from '../brushSlice';
7
+ import type { BrushSettings } from '../brushSlice';
8
8
 
9
9
  export const selectBrushSettings = (state: RechartsRootState): BrushSettings => state.brush;
10
10
 
@@ -1,8 +1,8 @@
1
1
  // Adapted from recharts@3.9.2, commit b3451050c027a23957ffa50a2665c9119df21e47.
2
- import { TickItem } from '../../../util/types';
3
- import { TooltipIndex } from '../../tooltipSlice';
2
+ import type { TickItem } from '../../../util/types';
3
+ import type { TooltipIndex } from '../../tooltipSlice';
4
4
  import { isNan } from '../../../util/DataUtils';
5
- import { ActiveLabel } from '../../../synchronisation/types';
5
+ import type { ActiveLabel } from '../../../synchronisation/types';
6
6
 
7
7
  export const combineActiveLabel = (
8
8
  tooltipTicks: ReadonlyArray<TickItem> | undefined,
@@ -1,8 +1,8 @@
1
1
  // Adapted from recharts@3.9.2, commit b3451050c027a23957ffa50a2665c9119df21e47.
2
- import { TooltipIndex, TooltipInteractionState } from '../../tooltipSlice';
3
- import { ChartData } from '../../chartDataSlice';
2
+ import type { TooltipIndex, TooltipInteractionState } from '../../tooltipSlice';
3
+ import type { ChartData } from '../../chartDataSlice';
4
4
  import { isWellBehavedNumber } from '../../../util/isWellBehavedNumber';
5
- import { DataKey, CategoricalDomain, NumberDomain } from '../../../util/types';
5
+ import type { DataKey, CategoricalDomain, NumberDomain } from '../../../util/types';
6
6
  import { getValueByDataKey } from '../../../util/ChartUtils';
7
7
  import { isWellFormedNumberDomain } from '../../../util/isDomainSpecifiedByUser';
8
8