@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,7 +1,7 @@
1
1
  import type { Ref } from '../util/OctaneTypes.ts';
2
2
 
3
3
  import { arrayTooltipSearcher } from '../state/optionsSlice';
4
- import { PolarChartProps, TooltipEventType } from '../util/types';
4
+ import type { PolarChartProps, TooltipEventType } from '../util/types';
5
5
  import { resolveDefaultProps } from '../util/resolveDefaultProps';
6
6
  import { defaultPolarChartProps, PolarChart } from './PolarChart.tsrx';
7
7
 
@@ -12,9 +12,9 @@ import sumBy from 'es-toolkit/compat/sumBy';
12
12
  import get from 'es-toolkit/compat/get';
13
13
  import { Surface } from '../container/Surface.tsrx';
14
14
  import { Layer } from '../container/Layer.tsrx';
15
- import { Props as RectangleProps, Rectangle } from '../shape/Rectangle.tsrx';
15
+ import { type Props as RectangleProps, Rectangle } from '../shape/Rectangle.tsrx';
16
16
  import { getValueByDataKey } from '../util/ChartUtils';
17
- import {
17
+ import type {
18
18
  Coordinate,
19
19
  DataKey,
20
20
  EventThrottlingProps,
@@ -37,24 +37,24 @@ import {
37
37
  mouseLeaveItem,
38
38
  setActiveClickItemIndex,
39
39
  setActiveMouseOverItemIndex,
40
- TooltipIndex,
41
- TooltipPayloadConfiguration,
42
- TooltipPayloadSearcher,
40
+ type TooltipIndex,
41
+ type TooltipPayloadConfiguration,
42
+ type TooltipPayloadSearcher,
43
43
  } from '../state/tooltipSlice';
44
44
  import { SetTooltipEntrySettings } from '../state/SetTooltipEntrySettings';
45
- import { ChartOptions } from '../state/optionsSlice';
45
+ import type { ChartOptions } from '../state/optionsSlice';
46
46
  import { ReportEventSettings } from '../state/ReportEventSettings';
47
47
  import { SetComputedData } from '../context/chartDataContext';
48
48
  import {
49
49
  svgPropertiesNoEvents,
50
50
  svgPropertiesNoEventsFromUnknown,
51
51
  } from '../util/svgPropertiesNoEvents';
52
- import { RequiresDefaultProps, resolveDefaultProps } from '../util/resolveDefaultProps';
52
+ import { type RequiresDefaultProps, resolveDefaultProps } from '../util/resolveDefaultProps';
53
53
  import { isPositiveNumber } from '../util/isWellBehavedNumber';
54
54
  import { isNotNil, noop } from '../util/DataUtils';
55
- import { WithIdRequired } from '../util/useUniqueId';
55
+ import type { WithIdRequired } from '../util/useUniqueId';
56
56
  import { RegisterGraphicalItemId } from '../context/RegisterGraphicalItemId.tsrx';
57
- import { GraphicalItemId } from '../state/graphicalItemsSlice';
57
+ import type { GraphicalItemId } from '../state/graphicalItemsSlice';
58
58
  import { initialEventSettingsState } from '../state/eventSettingsSlice';
59
59
 
60
60
  const interpolationGenerator = (a: number, b: number) => {
@@ -2,7 +2,7 @@ import type { Ref } from '../util/OctaneTypes.ts';
2
2
 
3
3
  import { arrayTooltipSearcher } from '../state/optionsSlice';
4
4
  import { CartesianChart } from './CartesianChart.tsrx';
5
- import { CartesianChartProps, TooltipEventType } from '../util/types';
5
+ import type { CartesianChartProps, TooltipEventType } from '../util/types';
6
6
 
7
7
  const allowedTooltipTypes: ReadonlyArray<TooltipEventType> = ['item'];
8
8
 
@@ -7,7 +7,7 @@ import get from 'es-toolkit/compat/get';
7
7
  import { Surface } from '../container/Surface.tsrx';
8
8
  import { Layer } from '../container/Layer.tsrx';
9
9
  import { Sector } from '../shape/Sector.tsrx';
10
- import { Text, Props as TextProps } from '../component/Text.tsrx';
10
+ import { Text, type Props as TextProps } from '../component/Text.tsrx';
11
11
  import { polarToCartesian } from '../util/PolarUtils';
12
12
  import {
13
13
  ReportChartMargin,
@@ -21,19 +21,25 @@ import {
21
21
  mouseLeaveItem,
22
22
  setActiveClickItemIndex,
23
23
  setActiveMouseOverItemIndex,
24
- TooltipIndex,
25
- TooltipPayloadConfiguration,
26
- TooltipPayloadSearcher,
24
+ type TooltipIndex,
25
+ type TooltipPayloadConfiguration,
26
+ type TooltipPayloadSearcher,
27
27
  } from '../state/tooltipSlice';
28
28
  import { SetTooltipEntrySettings } from '../state/SetTooltipEntrySettings';
29
29
  import { RechartsStoreProvider } from '../state/RechartsStoreProvider.tsrx';
30
30
  import { ReportEventSettings } from '../state/ReportEventSettings';
31
- import { ChartCoordinate, DataKey, EventThrottlingProps, Margin, Percent } from '../util/types';
31
+ import type {
32
+ ChartCoordinate,
33
+ DataKey,
34
+ EventThrottlingProps,
35
+ Margin,
36
+ Percent,
37
+ } from '../util/types';
32
38
  import { useAppDispatch } from '../state/hooks';
33
- import { RechartsRootState } from '../state/store';
39
+ import type { RechartsRootState } from '../state/store';
34
40
  import { RegisterGraphicalItemId } from '../context/RegisterGraphicalItemId.tsrx';
35
- import { WithIdRequired } from '../util/useUniqueId';
36
- import { RequiresDefaultProps, resolveDefaultProps } from '../util/resolveDefaultProps';
41
+ import type { WithIdRequired } from '../util/useUniqueId';
42
+ import { type RequiresDefaultProps, resolveDefaultProps } from '../util/resolveDefaultProps';
37
43
  import { initialEventSettingsState } from '../state/eventSettingsSlice';
38
44
 
39
45
  export interface SunburstData {
@@ -3,12 +3,12 @@ import * as React from 'octane';
3
3
  import { cloneElement, createElement, isValidElement } from 'octane';
4
4
  import { clsx } from 'clsx';
5
5
  import {
6
- ChartOffsetInternal,
7
- Coordinate,
6
+ type ChartOffsetInternal,
7
+ type Coordinate,
8
8
  isPolarCoordinate,
9
- LayoutType,
10
- PolarCoordinate,
11
- TooltipEventType,
9
+ type LayoutType,
10
+ type PolarCoordinate,
11
+ type TooltipEventType,
12
12
  } from '../util/types';
13
13
  import { Curve } from '../shape/Curve.tsrx';
14
14
  import { Cross } from '../shape/Cross.tsrx';
@@ -20,9 +20,9 @@ import { getCursorPoints } from '../util/cursor/getCursorPoints';
20
20
  import { useChartLayout, useOffsetInternal } from '../context/chartLayoutContext';
21
21
  import { useTooltipAxisBandSize } from '../context/useTooltipAxis';
22
22
  import { useChartName } from '../state/selectors/selectors';
23
- import { TooltipIndex, TooltipPayload } from '../state/tooltipSlice';
23
+ import type { TooltipIndex, TooltipPayload } from '../state/tooltipSlice';
24
24
  import { svgPropertiesNoEventsFromUnknown } from '../util/svgPropertiesNoEvents';
25
- import { ZIndexable, ZIndexLayer } from '../zIndex/ZIndexLayer.tsrx';
25
+ import { type ZIndexable, ZIndexLayer } from '../zIndex/ZIndexLayer.tsrx';
26
26
  import { DefaultZIndexes } from '../zIndex/DefaultZIndexes';
27
27
 
28
28
  /**
@@ -10,13 +10,13 @@ import { clsx } from 'clsx';
10
10
  import { Surface } from '../container/Surface.tsrx';
11
11
  import { Symbols } from '../shape/Symbols.tsrx';
12
12
  import {
13
- DataKey,
14
- LegendType,
13
+ type DataKey,
14
+ type LegendType,
15
15
  adaptEventsOfChild,
16
- PresentationAttributesAdaptChildEvent,
17
- CartesianLayout,
16
+ type PresentationAttributesAdaptChildEvent,
17
+ type CartesianLayout,
18
18
  } from '../util/types';
19
- import { RequiresDefaultProps, resolveDefaultProps } from '../util/resolveDefaultProps';
19
+ import { type RequiresDefaultProps, resolveDefaultProps } from '../util/resolveDefaultProps';
20
20
 
21
21
  const SIZE = 32;
22
22
  export type ContentType = OctaneElement | ((props: Props) => OctaneNode);
@@ -8,8 +8,8 @@ import * as React from 'octane';
8
8
  import sortBy from 'es-toolkit/compat/sortBy';
9
9
  import { clsx } from 'clsx';
10
10
  import { isNullish, isNumOrStr } from '../util/DataUtils';
11
- import { DataKey } from '../util/types';
12
- import { TooltipPayload, TooltipPayloadEntry } from '../state/tooltipSlice';
11
+ import type { DataKey } from '../util/types';
12
+ import type { TooltipPayload, TooltipPayloadEntry } from '../state/tooltipSlice';
13
13
 
14
14
  function defaultFormatter(value: ValueType | undefined): OctaneNode {
15
15
  return Array.isArray(value) && isNumOrStr(value[0]) && isNumOrStr(value[1])
@@ -4,19 +4,19 @@ import { useLayoutEffect } from 'octane';
4
4
  import { createPortal } from 'octane';
5
5
  import { useLegendPortal } from '../context/legendPortalContext';
6
6
  import {
7
- ContentType,
7
+ type ContentType,
8
8
  DefaultLegendContent,
9
- LegendPayload,
10
- Props as DefaultLegendContentProps,
11
- VerticalAlignmentType,
9
+ type LegendPayload,
10
+ type Props as DefaultLegendContentProps,
11
+ type VerticalAlignmentType,
12
12
  } from './DefaultLegendContent.tsrx';
13
13
 
14
- import { LayoutType, Margin, Size } from '../util/types';
15
- import { getUniqPayload, UniqueOption } from '../util/payload/getUniqPayload';
14
+ import type { LayoutType, Margin, Size } from '../util/types';
15
+ import { getUniqPayload, type UniqueOption } from '../util/payload/getUniqPayload';
16
16
  import { useLegendPayload } from '../context/legendPayloadContext.tsrx';
17
- import { ElementOffset, useElementOffset } from '../util/useElementOffset';
17
+ import { type ElementOffset, useElementOffset } from '../util/useElementOffset';
18
18
  import { useChartHeight, useChartWidth, useMargin } from '../context/chartLayoutContext';
19
- import { LegendSettings, setLegendSettings, setLegendSize } from '../state/legendSlice';
19
+ import { type LegendSettings, setLegendSettings, setLegendSize } from '../state/legendSlice';
20
20
  import { useAppDispatch } from '../state/hooks';
21
21
  import { resolveDefaultProps } from '../util/resolveDefaultProps';
22
22
  import { propsAreEqual } from '../util/propsAreEqual';
@@ -4,20 +4,20 @@ import { useEffect } from 'octane';
4
4
  import { createPortal } from 'octane';
5
5
  import {
6
6
  DefaultTooltipContent,
7
- NameType,
8
- Payload,
9
- Props as DefaultTooltipContentProps,
10
- TooltipItemSorter,
11
- ValueType,
7
+ type NameType,
8
+ type Payload,
9
+ type Props as DefaultTooltipContentProps,
10
+ type TooltipItemSorter,
11
+ type ValueType,
12
12
  } from './DefaultTooltipContent.tsrx';
13
13
  import { TooltipBoundingBox } from './TooltipBoundingBox.tsrx';
14
14
 
15
- import { getUniqPayload, UniqueOption } from '../util/payload/getUniqPayload';
16
- import { AllowInDimension, AnimationDuration, EasingInput, Coordinate } from '../util/types';
15
+ import { getUniqPayload, type UniqueOption } from '../util/payload/getUniqPayload';
16
+ import type { AllowInDimension, AnimationDuration, EasingInput, Coordinate } from '../util/types';
17
17
  import { useViewBox } from '../context/chartLayoutContext';
18
18
  import { useAccessibilityLayer } from '../context/accessibilityContext';
19
19
  import { useElementOffset } from '../util/useElementOffset';
20
- import { Cursor, CursorDefinition } from './Cursor.tsrx';
20
+ import { Cursor, type CursorDefinition } from './Cursor.tsrx';
21
21
  import {
22
22
  selectActiveCoordinate,
23
23
  selectActiveLabel,
@@ -29,11 +29,11 @@ import type { TooltipTrigger } from '../chart/types';
29
29
  import { useAppDispatch, useAppSelector } from '../state/hooks';
30
30
  import {
31
31
  setTooltipSettingsState,
32
- TooltipIndex,
33
- TooltipPayload,
34
- TooltipPayloadEntry,
32
+ type TooltipIndex,
33
+ type TooltipPayload,
34
+ type TooltipPayloadEntry,
35
35
  } from '../state/tooltipSlice';
36
- import { AxisId } from '../state/cartesianAxisSlice';
36
+ import type { AxisId } from '../state/cartesianAxisSlice';
37
37
  import { useTooltipChartSynchronisation } from '../synchronisation/useChartSynchronisation.tsrx';
38
38
  import { useTooltipEventType } from '../state/selectors/selectTooltipEventType';
39
39
  import { resolveDefaultProps } from '../util/resolveDefaultProps';
@@ -1,7 +1,7 @@
1
1
  import type { CSSProperties, OctaneNode } from '../util/OctaneTypes.ts';
2
2
  import * as React from 'octane';
3
3
 
4
- import {
4
+ import type {
5
5
  AllowInDimension,
6
6
  AnimationDuration,
7
7
  EasingInput,
@@ -9,7 +9,7 @@ import {
9
9
  Coordinate,
10
10
  PolarCoordinate,
11
11
  } from '../util/types';
12
- import { ElementOffset, SetElementOffset } from '../util/useElementOffset';
12
+ import type { ElementOffset, SetElementOffset } from '../util/useElementOffset';
13
13
  import { getTooltipTranslate } from '../util/tooltip/translate';
14
14
  import { usePrefersReducedMotion } from '../util/usePrefersReducedMotion';
15
15
 
@@ -1,4 +1,4 @@
1
- import { LegendPayload } from '../component/DefaultLegendContent.tsrx';
1
+ import type { LegendPayload } from '../component/DefaultLegendContent.tsrx';
2
2
  import { useAppSelector } from '../state/hooks';
3
3
  import { selectLegendPayload } from '../state/selectors/legendSelectors';
4
4
 
@@ -1,13 +1,13 @@
1
1
  // Adapted from recharts@3.9.2, commit b3451050c027a23957ffa50a2665c9119df21e47.
2
2
  import type { NativeMouseEvent } from '../util/OctaneTypes';
3
3
 
4
- import { Coordinate, DataKey } from '../util/types';
4
+ import type { Coordinate, DataKey } from '../util/types';
5
5
  import { useAppDispatch } from '../state/hooks';
6
6
  import {
7
7
  mouseLeaveItem,
8
8
  setActiveClickItemIndex,
9
9
  setActiveMouseOverItemIndex,
10
- TooltipPayload,
10
+ type TooltipPayload,
11
11
  } from '../state/tooltipSlice';
12
12
 
13
13
  /**
@@ -1,6 +1,6 @@
1
1
  import { useAppSelector } from '../state/hooks';
2
2
  import { getBandSizeOfAxis } from '../util/ChartUtils';
3
- import { RenderableAxisSettings, selectTooltipAxis } from '../state/selectors/axisSelectors';
3
+ import { type RenderableAxisSettings, selectTooltipAxis } from '../state/selectors/axisSelectors';
4
4
  import {
5
5
  selectTooltipAxisScale,
6
6
  selectTooltipAxisTicks,
package/src/hooks.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  // Adapted from recharts@3.9.2, commit b3451050c027a23957ffa50a2665c9119df21e47.
2
- import { AxisId, defaultAxisId } from './state/cartesianAxisSlice';
2
+ import { type AxisId, defaultAxisId } from './state/cartesianAxisSlice';
3
3
  import {
4
- BaseAxisWithScale,
4
+ type BaseAxisWithScale,
5
5
  selectAxisDomain,
6
6
  selectAxisInverseScale,
7
7
  selectAxisInverseDataSnapScale,
@@ -18,12 +18,12 @@ import {
18
18
  selectActiveTooltipDataPoints,
19
19
  selectIsTooltipActive,
20
20
  } from './state/selectors/tooltipSelectors';
21
- import { ChartOffset, PlotArea } from './types';
21
+ import type { ChartOffset, PlotArea } from './types';
22
22
  import { selectChartOffset } from './state/selectors/selectChartOffset';
23
23
  import { selectPlotArea } from './state/selectors/selectPlotArea';
24
- import { CategoricalDomain, Coordinate, NumberDomain, TickItem } from './util/types';
25
- import { ActiveLabel } from './synchronisation/types';
26
- import { BandPosition } from './util/scale/RechartsScale';
24
+ import type { CategoricalDomain, Coordinate, NumberDomain, TickItem } from './util/types';
25
+ import type { ActiveLabel } from './synchronisation/types';
26
+ import type { BandPosition } from './util/scale/RechartsScale';
27
27
 
28
28
  export const useXAxis = (xAxisId: AxisId): BaseAxisWithScale | undefined => {
29
29
  const isPanorama = useIsPanorama();
@@ -16,39 +16,39 @@ import { clsx } from 'clsx';
16
16
  import { selectPieLegend, selectPieSectors } from '../state/selectors/pieSelectors';
17
17
  import { useAppSelector } from '../state/hooks';
18
18
  import { Layer } from '../container/Layer.tsrx';
19
- import { Curve, Props as CurveProps } from '../shape/Curve.tsrx';
19
+ import { Curve, type Props as CurveProps } from '../shape/Curve.tsrx';
20
20
  import { Sector } from '../shape/Sector.tsrx';
21
21
  import { Text, type RenderableText, type TextAnchor } from '../component/Text.tsrx';
22
22
  import { getMaxRadius, polarToCartesian } from '../util/PolarUtils';
23
23
  import { getPercentValue, interpolate, isNumber, mathSign } from '../util/DataUtils';
24
24
  import { getTooltipNameProp, getValueByDataKey } from '../util/ChartUtils';
25
25
  import {
26
- ActiveShape,
26
+ type ActiveShape,
27
27
  adaptEventsOfChild,
28
- AnimationDuration,
29
- ChartOffsetInternal,
30
- Coordinate,
31
- DataConsumer,
32
- DataKey,
33
- DataProvider,
34
- EasingInput,
35
- GeometrySector,
36
- LegendType,
37
- PolarLayout,
38
- PresentationAttributesAdaptChildEvent,
39
- ShapeAnimationProps,
40
- TooltipType,
28
+ type AnimationDuration,
29
+ type ChartOffsetInternal,
30
+ type Coordinate,
31
+ type DataConsumer,
32
+ type DataKey,
33
+ type DataProvider,
34
+ type EasingInput,
35
+ type GeometrySector,
36
+ type LegendType,
37
+ type PolarLayout,
38
+ type PresentationAttributesAdaptChildEvent,
39
+ type ShapeAnimationProps,
40
+ type TooltipType,
41
41
  } from '../util/types';
42
42
  import { Shape } from '../util/ActiveShapeUtils.tsrx';
43
43
  import {
44
- TooltipTriggerInfo,
44
+ type TooltipTriggerInfo,
45
45
  useMouseClickItemDispatch,
46
46
  useMouseEnterItemDispatch,
47
47
  useMouseLeaveItemDispatch,
48
48
  } from '../context/tooltipContext';
49
- import { TooltipPayload, TooltipPayloadConfiguration } from '../state/tooltipSlice';
49
+ import type { TooltipPayload, TooltipPayloadConfiguration } from '../state/tooltipSlice';
50
50
  import { SetTooltipEntrySettings } from '../state/SetTooltipEntrySettings';
51
- import { Formatter } from '../component/DefaultTooltipContent.tsrx';
51
+ import type { Formatter } from '../component/DefaultTooltipContent.tsrx';
52
52
  import {
53
53
  selectActiveTooltipDataKey,
54
54
  selectActiveTooltipGraphicalItemId,
@@ -61,31 +61,31 @@ import {
61
61
  } from '../util/Constants';
62
62
  import {
63
63
  AnimatedItems,
64
- AnimationInterpolateFn,
64
+ type AnimationInterpolateFn,
65
65
  useAnimationCallbacks,
66
66
  } from '../animation/AnimatedItems.tsrx';
67
- import { AnimationMatchByProp, matchAppend } from '../animation/matchBy';
68
- import { RequiresDefaultProps, resolveDefaultProps } from '../util/resolveDefaultProps';
67
+ import { type AnimationMatchByProp, matchAppend } from '../animation/matchBy';
68
+ import { type RequiresDefaultProps, resolveDefaultProps } from '../util/resolveDefaultProps';
69
69
  import { RegisterGraphicalItemId } from '../context/RegisterGraphicalItemId.tsrx';
70
70
  import { SetPolarGraphicalItem } from '../state/SetGraphicalItem';
71
71
  import type { PiePresentationProps, PieSettings } from '../state/types/PieSettings';
72
72
  import {
73
73
  svgPropertiesNoEvents,
74
74
  svgPropertiesNoEventsFromUnknown,
75
- SVGPropsNoEvents,
75
+ type SVGPropsNoEvents,
76
76
  } from '../util/svgPropertiesNoEvents';
77
77
  import {
78
78
  LabelListFromLabelProp,
79
79
  PolarLabelListContextProvider,
80
- PolarLabelListEntry,
81
- Props as LabelListProps,
80
+ type PolarLabelListEntry,
81
+ type Props as LabelListProps,
82
82
  } from '../component/LabelList.tsrx';
83
- import { GraphicalItemId } from '../state/graphicalItemsSlice';
84
- import { ZIndexable, ZIndexLayer } from '../zIndex/ZIndexLayer.tsrx';
83
+ import type { GraphicalItemId } from '../state/graphicalItemsSlice';
84
+ import { type ZIndexable, ZIndexLayer } from '../zIndex/ZIndexLayer.tsrx';
85
85
  import { DefaultZIndexes } from '../zIndex/DefaultZIndexes';
86
- import { ChartData } from '../state/chartDataSlice';
86
+ import type { ChartData } from '../state/chartDataSlice';
87
87
  import { getClassNameFromUnknown } from '../util/getClassNameFromUnknown';
88
- import { WithIdRequired } from '../util/useUniqueId';
88
+ import type { WithIdRequired } from '../util/useUniqueId';
89
89
  import { usePolarChartLayout } from '../context/chartLayoutContext';
90
90
  import { CellsContext, useCellRegistry } from '../context/CellsContext';
91
91
 
@@ -12,23 +12,23 @@ import { clsx } from 'clsx';
12
12
  import { Layer } from '../container/Layer.tsrx';
13
13
  import { Dot } from '../shape/Dot.tsrx';
14
14
  import { Polygon } from '../shape/Polygon.tsrx';
15
- import { Text, TextAnchor, TextVerticalAnchor } from '../component/Text.tsrx';
15
+ import { Text, type TextAnchor, type TextVerticalAnchor } from '../component/Text.tsrx';
16
16
  import {
17
17
  adaptEventsOfChild,
18
- AxisDomain,
19
- AxisTick,
20
- AxisDomainTypeInput,
21
- PolarTickContentProps,
22
- EvaluatedAxisDomainType,
23
- PresentationAttributesAdaptChildEvent,
24
- RenderableAxisProps,
25
- ScaleType,
26
- TickItem,
27
- TickProp,
18
+ type AxisDomain,
19
+ type AxisTick,
20
+ type AxisDomainTypeInput,
21
+ type PolarTickContentProps,
22
+ type EvaluatedAxisDomainType,
23
+ type PresentationAttributesAdaptChildEvent,
24
+ type RenderableAxisProps,
25
+ type ScaleType,
26
+ type TickItem,
27
+ type TickProp,
28
28
  } from '../util/types';
29
29
  import { degreeToRadian, polarToCartesian } from '../util/PolarUtils';
30
- import { addAngleAxis, AngleAxisSettings, removeAngleAxis } from '../state/polarAxisSlice';
31
- import { NiceTicksAlgorithm } from '../state/cartesianAxisSlice';
30
+ import { addAngleAxis, type AngleAxisSettings, removeAngleAxis } from '../state/polarAxisSlice';
31
+ import type { NiceTicksAlgorithm } from '../state/cartesianAxisSlice';
32
32
  import { useAppDispatch, useAppSelector } from '../state/hooks';
33
33
  import {
34
34
  selectPolarAngleAxisTicks,
@@ -41,9 +41,9 @@ import {
41
41
  svgPropertiesNoEvents,
42
42
  svgPropertiesNoEventsFromUnknown,
43
43
  } from '../util/svgPropertiesNoEvents';
44
- import { RequiresDefaultProps, resolveDefaultProps } from '../util/resolveDefaultProps';
45
- import { ZIndexable, ZIndexLayer } from '../zIndex/ZIndexLayer.tsrx';
46
- import { RechartsScale } from '../util/scale/RechartsScale';
44
+ import { type RequiresDefaultProps, resolveDefaultProps } from '../util/resolveDefaultProps';
45
+ import { type ZIndexable, ZIndexLayer } from '../zIndex/ZIndexLayer.tsrx';
46
+ import type { RechartsScale } from '../util/scale/RechartsScale';
47
47
  import type { CustomScaleDefinition } from '../util/scale/CustomScaleDefinition';
48
48
  import { usePolarChartLayout } from '../context/chartLayoutContext';
49
49
  import { noop } from '../util/DataUtils';
@@ -3,13 +3,13 @@ import { clsx } from 'clsx';
3
3
  import * as React from 'octane';
4
4
 
5
5
  import { polarToCartesian } from '../util/PolarUtils';
6
- import { AxisId } from '../state/cartesianAxisSlice';
6
+ import type { AxisId } from '../state/cartesianAxisSlice';
7
7
  import { useAppSelector } from '../state/hooks';
8
8
  import { selectPolarGridAngles, selectPolarGridRadii } from '../state/selectors/polarGridSelectors';
9
9
  import { selectPolarViewBox } from '../state/selectors/polarAxisSelectors';
10
- import { PolarViewBoxRequired } from '../util/types';
10
+ import type { PolarViewBoxRequired } from '../util/types';
11
11
  import { svgPropertiesNoEvents } from '../util/svgPropertiesNoEvents';
12
- import { ZIndexable, ZIndexLayer } from '../zIndex/ZIndexLayer.tsrx';
12
+ import { type ZIndexable, ZIndexLayer } from '../zIndex/ZIndexLayer.tsrx';
13
13
  import { DefaultZIndexes } from '../zIndex/DefaultZIndexes';
14
14
  import { resolveDefaultProps } from '../util/resolveDefaultProps';
15
15
 
@@ -17,21 +17,21 @@ import { Layer } from '../container/Layer.tsrx';
17
17
  import { polarToCartesian } from '../util/PolarUtils';
18
18
  import {
19
19
  adaptEventsOfChild,
20
- RenderableAxisProps,
21
- Coordinate,
22
- PolarViewBoxRequired,
23
- PresentationAttributesAdaptChildEvent,
24
- TickItem,
25
- AxisDomain,
26
- ScaleType,
27
- AxisDomainTypeInput,
28
- EvaluatedAxisDomainType,
29
- TickProp,
30
- PolarTickContentProps,
31
- AxisTick,
20
+ type RenderableAxisProps,
21
+ type Coordinate,
22
+ type PolarViewBoxRequired,
23
+ type PresentationAttributesAdaptChildEvent,
24
+ type TickItem,
25
+ type AxisDomain,
26
+ type ScaleType,
27
+ type AxisDomainTypeInput,
28
+ type EvaluatedAxisDomainType,
29
+ type TickProp,
30
+ type PolarTickContentProps,
31
+ type AxisTick,
32
32
  } from '../util/types';
33
- import { addRadiusAxis, RadiusAxisSettings, removeRadiusAxis } from '../state/polarAxisSlice';
34
- import { NiceTicksAlgorithm } from '../state/cartesianAxisSlice';
33
+ import { addRadiusAxis, type RadiusAxisSettings, removeRadiusAxis } from '../state/polarAxisSlice';
34
+ import type { NiceTicksAlgorithm } from '../state/cartesianAxisSlice';
35
35
  import { useAppDispatch, useAppSelector } from '../state/hooks';
36
36
  import { selectPolarAxisScale, selectPolarAxisTicks } from '../state/selectors/polarScaleSelectors';
37
37
  import { selectPolarViewBox } from '../state/selectors/polarAxisSelectors';
@@ -40,9 +40,9 @@ import {
40
40
  svgPropertiesNoEvents,
41
41
  svgPropertiesNoEventsFromUnknown,
42
42
  } from '../util/svgPropertiesNoEvents';
43
- import { RequiresDefaultProps, resolveDefaultProps } from '../util/resolveDefaultProps';
44
- import { ZIndexable, ZIndexLayer } from '../zIndex/ZIndexLayer.tsrx';
45
- import { RechartsScale } from '../util/scale/RechartsScale';
43
+ import { type RequiresDefaultProps, resolveDefaultProps } from '../util/resolveDefaultProps';
44
+ import { type ZIndexable, ZIndexLayer } from '../zIndex/ZIndexLayer.tsrx';
45
+ import type { RechartsScale } from '../util/scale/RechartsScale';
46
46
  import type { CustomScaleDefinition } from '../util/scale/CustomScaleDefinition';
47
47
  import { usePolarChartLayout } from '../context/chartLayoutContext';
48
48
  import { noop } from '../util/DataUtils';
@@ -17,12 +17,12 @@ import { Polygon } from '../shape/Polygon.tsrx';
17
17
  import { Layer } from '../container/Layer.tsrx';
18
18
  import {
19
19
  CartesianLabelListContextProvider,
20
- CartesianLabelListEntry,
21
- ImplicitLabelListType,
20
+ type CartesianLabelListEntry,
21
+ type ImplicitLabelListType,
22
22
  LabelListFromLabelProp,
23
23
  } from '../component/LabelList.tsrx';
24
24
  import { Dots } from '../component/Dots.tsrx';
25
- import {
25
+ import type {
26
26
  ActiveDotType,
27
27
  AnimationDuration,
28
28
  DataConsumer,
@@ -36,7 +36,7 @@ import {
36
36
  } from '../util/types';
37
37
  import type { LegendPayload } from '../component/DefaultLegendContent.tsrx';
38
38
  import { ActivePoints } from '../component/ActivePoints.tsrx';
39
- import { TooltipPayloadConfiguration } from '../state/tooltipSlice';
39
+ import type { TooltipPayloadConfiguration } from '../state/tooltipSlice';
40
40
  import { SetTooltipEntrySettings } from '../state/SetTooltipEntrySettings';
41
41
  import { selectRadarPoints } from '../state/selectors/radarSelectors';
42
42
  import { useAppSelector } from '../state/hooks';
@@ -47,17 +47,17 @@ import { SetPolarGraphicalItem } from '../state/SetGraphicalItem';
47
47
  import { svgPropertiesNoEvents } from '../util/svgPropertiesNoEvents';
48
48
  import {
49
49
  AnimatedItems,
50
- AnimationInterpolateFn,
50
+ type AnimationInterpolateFn,
51
51
  useAnimationCallbacks,
52
52
  } from '../animation/AnimatedItems.tsrx';
53
- import { AnimationMatchByProp, matchAnimationItems, matchByIndex } from '../animation/matchBy';
53
+ import { type AnimationMatchByProp, matchAnimationItems, matchByIndex } from '../animation/matchBy';
54
54
  import { useAnimationStartSnapshot } from '../animation/useAnimationStartSnapshot';
55
55
  import { svgPropertiesAndEvents } from '../util/svgPropertiesAndEvents';
56
- import { RequiresDefaultProps, resolveDefaultProps } from '../util/resolveDefaultProps';
57
- import { WithIdRequired } from '../util/useUniqueId';
58
- import { ZIndexable, ZIndexLayer } from '../zIndex/ZIndexLayer.tsrx';
56
+ import { type RequiresDefaultProps, resolveDefaultProps } from '../util/resolveDefaultProps';
57
+ import type { WithIdRequired } from '../util/useUniqueId';
58
+ import { type ZIndexable, ZIndexLayer } from '../zIndex/ZIndexLayer.tsrx';
59
59
  import { DefaultZIndexes } from '../zIndex/DefaultZIndexes';
60
- import { RechartsScale } from '../util/scale/RechartsScale';
60
+ import type { RechartsScale } from '../util/scale/RechartsScale';
61
61
  import { usePolarChartLayout } from '../context/chartLayoutContext';
62
62
 
63
63
  export interface RadarPoint {