@octanejs/recharts 0.1.61 → 0.1.63

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 (73) hide show
  1. package/package.json +5 -5
  2. package/src/animation/AnimatedItems.tsrx +36 -31
  3. package/src/animation/CSSTransitionAnimate.tsrx +1 -2
  4. package/src/animation/JavascriptAnimate.tsrx +1 -2
  5. package/src/cartesian/Area.tsrx +414 -386
  6. package/src/cartesian/AreaRevealShape.tsrx +103 -84
  7. package/src/cartesian/Bar.tsrx +343 -317
  8. package/src/cartesian/BarStack.tsrx +33 -28
  9. package/src/cartesian/CartesianAxis.tsrx +168 -165
  10. package/src/cartesian/CartesianGrid.tsrx +256 -272
  11. package/src/cartesian/ErrorBar.tsrx +108 -104
  12. package/src/cartesian/Funnel.tsrx +405 -382
  13. package/src/cartesian/GraphicalItemClipPath.tsrx +4 -8
  14. package/src/cartesian/Line.tsrx +190 -177
  15. package/src/cartesian/LineDrawShape.tsrx +14 -15
  16. package/src/cartesian/ReferenceLine.tsrx +119 -105
  17. package/src/cartesian/Scatter.tsrx +416 -398
  18. package/src/cartesian/XAxis.tsrx +39 -32
  19. package/src/cartesian/YAxis.tsrx +47 -37
  20. package/src/cartesian/ZAxis.tsrx +76 -73
  21. package/src/chart/AreaChart.tsrx +15 -11
  22. package/src/chart/BarChart.tsrx +15 -11
  23. package/src/chart/CategoricalChart.tsrx +32 -26
  24. package/src/chart/ComposedChart.tsrx +15 -11
  25. package/src/chart/FunnelChart.tsrx +15 -11
  26. package/src/chart/LineChart.tsrx +15 -11
  27. package/src/chart/PieChart.tsrx +15 -11
  28. package/src/chart/PolarChart.tsrx +45 -48
  29. package/src/chart/RadarChart.tsrx +38 -32
  30. package/src/chart/RadialBarChart.tsrx +15 -11
  31. package/src/chart/RechartsWrapper.tsrx +214 -162
  32. package/src/chart/Sankey.tsrx +412 -378
  33. package/src/chart/ScatterChart.tsrx +15 -11
  34. package/src/chart/SunburstChart.tsrx +162 -155
  35. package/src/component/ActivePoints.tsrx +19 -13
  36. package/src/component/Cursor.tsrx +25 -18
  37. package/src/component/DefaultLegendContent.tsrx +131 -127
  38. package/src/component/DefaultTooltipContent.tsrx +46 -42
  39. package/src/component/Dots.tsrx +11 -5
  40. package/src/component/Label.tsrx +69 -55
  41. package/src/component/LabelList.tsrx +32 -27
  42. package/src/component/Legend.tsrx +120 -123
  43. package/src/component/ResponsiveContainer.tsrx +18 -11
  44. package/src/component/Text.tsrx +50 -43
  45. package/src/component/Tooltip.tsrx +234 -223
  46. package/src/component/TooltipBoundingBox.tsrx +34 -34
  47. package/src/container/ClipPathProvider.tsrx +1 -3
  48. package/src/container/Layer.tsrx +5 -1
  49. package/src/container/RootSurface.tsrx +31 -21
  50. package/src/container/Surface.tsrx +15 -13
  51. package/src/context/ErrorBarContext.tsrx +5 -5
  52. package/src/polar/Pie.tsrx +541 -487
  53. package/src/polar/PolarAngleAxis.tsrx +245 -227
  54. package/src/polar/PolarGrid.tsrx +139 -127
  55. package/src/polar/PolarRadiusAxis.tsrx +204 -185
  56. package/src/polar/Radar.tsrx +274 -264
  57. package/src/polar/RadialBar.tsrx +408 -361
  58. package/src/shape/Cross.tsrx +13 -7
  59. package/src/shape/Curve.tsrx +54 -44
  60. package/src/shape/Dot.tsrx +10 -8
  61. package/src/shape/Polygon.tsrx +38 -29
  62. package/src/shape/Rectangle.tsrx +73 -28
  63. package/src/shape/Sector.tsrx +30 -18
  64. package/src/shape/Symbols.tsrx +13 -11
  65. package/src/shape/Trapezoid.tsrx +16 -11
  66. package/src/state/RechartsStoreProvider.tsrx +5 -1
  67. package/src/synchronisation/useChartSynchronisation.tsrx +8 -7
  68. package/src/util/BarUtils.tsrx +43 -40
  69. package/src/util/FunnelUtils.tsrx +5 -5
  70. package/src/util/RadialBarUtils.tsrx +3 -4
  71. package/src/util/ScatterUtils.tsrx +13 -8
  72. package/src/zIndex/ZIndexLayer.tsrx +2 -2
  73. package/src/zIndex/ZIndexPortal.tsrx +2 -8
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@octanejs/recharts",
3
- "version": "0.1.61",
3
+ "version": "0.1.63",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "engines": {
@@ -34,7 +34,7 @@
34
34
  }
35
35
  },
36
36
  "dependencies": {
37
- "@octanejs/redux": "0.1.58",
37
+ "@octanejs/redux": "0.1.60",
38
38
  "@reduxjs/toolkit": "~2.10.1",
39
39
  "clsx": "^2.1.1",
40
40
  "decimal.js-light": "^2.5.1",
@@ -46,12 +46,12 @@
46
46
  "victory-vendor": "^37.3.6"
47
47
  },
48
48
  "peerDependencies": {
49
- "octane": "^0.10.0"
49
+ "octane": "^0.11.0"
50
50
  },
51
51
  "devDependencies": {
52
- "@tsrx/react": "^0.3.7",
52
+ "@tsrx/react": "^0.4.5",
53
53
  "esbuild": "^0.28.1",
54
- "octane": "0.10.0",
54
+ "octane": "0.11.0",
55
55
  "react": "19.2.7",
56
56
  "react-dom": "19.2.7",
57
57
  "recharts": "3.9.2",
@@ -3,9 +3,11 @@ import type { EasingInput } from './easing';
3
3
  import type { AnimationItem, AnimationMatchByProp } from './matchBy';
4
4
  import type { CartesianLayout, PolarLayout } from '../util/types';
5
5
 
6
- export type AnimationInterpolateFn<ItemType, LayoutType extends CartesianLayout | PolarLayout> =
7
- (items: | ReadonlyArray<AnimationItem<ItemType>>
8
- | null, animationElapsedTime: number, layout: LayoutType) => ReadonlyArray<ItemType>;
6
+ export type AnimationInterpolateFn<ItemType, LayoutType extends CartesianLayout | PolarLayout> = (
7
+ items: ReadonlyArray<AnimationItem<ItemType>> | null,
8
+ animationElapsedTime: number,
9
+ layout: LayoutType,
10
+ ) => ReadonlyArray<ItemType>;
9
11
  export type AnimatedItemsProps<ItemType, LayoutType extends CartesianLayout | PolarLayout> = {
10
12
  animationInput: unknown;
11
13
  animationIdPrefix: string;
@@ -20,9 +22,11 @@ export type AnimatedItemsProps<ItemType, LayoutType extends CartesianLayout | Po
20
22
  animationInterpolateFn: AnimationInterpolateFn<ItemType, LayoutType>;
21
23
  animationMatchBy?: AnimationMatchByProp<ItemType>;
22
24
  shouldUpdatePreviousRef?: (animationElapsedTime: number) => boolean;
23
- children: (items: ReadonlyArray<
24
- ItemType
25
- >, animationElapsedTime: number, isEntrance: boolean) => OctaneNode;
25
+ children: (
26
+ items: ReadonlyArray<ItemType>,
27
+ animationElapsedTime: number,
28
+ isEntrance: boolean,
29
+ ) => OctaneNode;
26
30
  layout: LayoutType;
27
31
  };
28
32
  // Port of animation/AnimatedItems.tsx — the reusable enter/update/exit
@@ -85,31 +89,32 @@ export function AnimatedItems<ItemType, LayoutType extends CartesianLayout | Pol
85
89
  items,
86
90
  animationMatchBy ?? matchByIndex,
87
91
  );
88
- return <JavascriptAnimate
89
- animationId={animationId}
90
- begin={animationBegin}
91
- duration={animationDuration}
92
- isActive={isAnimationActive}
93
- easing={animationEasing}
94
- onAnimationEnd={onAnimationEnd}
95
- onAnimationStart={onAnimationStart}
96
- key={animationId}
97
- >
98
- {(animationElapsedTime) => {
99
- const isEntrance = rawPrevItems == null;
100
- const stepData =
101
- items == null
102
- ? items
103
- : animationInterpolateFn(animationItems, animationElapsedTime, layout);
104
- const canUpdate =
105
- shouldUpdatePreviousRef
92
+ return (
93
+ <JavascriptAnimate
94
+ animationId={animationId}
95
+ begin={animationBegin}
96
+ duration={animationDuration}
97
+ isActive={isAnimationActive}
98
+ easing={animationEasing}
99
+ onAnimationEnd={onAnimationEnd}
100
+ onAnimationStart={onAnimationStart}
101
+ key={animationId}
102
+ >
103
+ {(animationElapsedTime) => {
104
+ const isEntrance = rawPrevItems == null;
105
+ const stepData =
106
+ items == null
107
+ ? items
108
+ : animationInterpolateFn(animationItems, animationElapsedTime, layout);
109
+ const canUpdate = shouldUpdatePreviousRef
106
110
  ? shouldUpdatePreviousRef(animationElapsedTime)
107
111
  : animationElapsedTime > 0;
108
- animationStartItems.syncStepValue(stepData, animationElapsedTime, canUpdate);
109
- if (stepData == null) {
110
- return null;
111
- }
112
- return children(stepData, animationElapsedTime, isEntrance);
113
- }}
114
- </JavascriptAnimate>;
112
+ animationStartItems.syncStepValue(stepData, animationElapsedTime, canUpdate);
113
+ if (stepData == null) {
114
+ return null;
115
+ }
116
+ return children(stepData, animationElapsedTime, isEntrance);
117
+ }}
118
+ </JavascriptAnimate>
119
+ );
115
120
  }
@@ -64,8 +64,7 @@ export function CSSTransitionAnimate(outsideProps: CSSTransitionAnimateProps) {
64
64
 
65
65
  const prefersReducedMotion = usePrefersReducedMotion();
66
66
 
67
- const isActive =
68
- isActiveProp === 'auto' ? !Global.isSsr && !prefersReducedMotion : isActiveProp;
67
+ const isActive = isActiveProp === 'auto' ? !Global.isSsr && !prefersReducedMotion : isActiveProp;
69
68
 
70
69
  const animationController = useAnimationController(props.animationController);
71
70
  const [style, setStyle] = useState<string | number>(() => {
@@ -56,8 +56,7 @@ export function JavascriptAnimate(outsideProps: JavascriptAnimateProps) {
56
56
  children,
57
57
  } = props;
58
58
  const prefersReducedMotion = usePrefersReducedMotion();
59
- const isActive =
60
- isActiveProp === 'auto' ? !Global.isSsr && !prefersReducedMotion : isActiveProp;
59
+ const isActive = isActiveProp === 'auto' ? !Global.isSsr && !prefersReducedMotion : isActiveProp;
61
60
  const animationController = useAnimationController(props.animationController);
62
61
  const [style, setStyle] = useState(isActive ? from : to);
63
62
  useEffect(() => {