@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.
- package/package.json +5 -5
- package/src/animation/AnimatedItems.tsrx +36 -31
- package/src/animation/CSSTransitionAnimate.tsrx +1 -2
- package/src/animation/JavascriptAnimate.tsrx +1 -2
- package/src/cartesian/Area.tsrx +414 -386
- package/src/cartesian/AreaRevealShape.tsrx +103 -84
- package/src/cartesian/Bar.tsrx +343 -317
- package/src/cartesian/BarStack.tsrx +33 -28
- package/src/cartesian/CartesianAxis.tsrx +168 -165
- package/src/cartesian/CartesianGrid.tsrx +256 -272
- package/src/cartesian/ErrorBar.tsrx +108 -104
- package/src/cartesian/Funnel.tsrx +405 -382
- package/src/cartesian/GraphicalItemClipPath.tsrx +4 -8
- package/src/cartesian/Line.tsrx +190 -177
- package/src/cartesian/LineDrawShape.tsrx +14 -15
- package/src/cartesian/ReferenceLine.tsrx +119 -105
- package/src/cartesian/Scatter.tsrx +416 -398
- package/src/cartesian/XAxis.tsrx +39 -32
- package/src/cartesian/YAxis.tsrx +47 -37
- package/src/cartesian/ZAxis.tsrx +76 -73
- package/src/chart/AreaChart.tsrx +15 -11
- package/src/chart/BarChart.tsrx +15 -11
- package/src/chart/CategoricalChart.tsrx +32 -26
- package/src/chart/ComposedChart.tsrx +15 -11
- package/src/chart/FunnelChart.tsrx +15 -11
- package/src/chart/LineChart.tsrx +15 -11
- package/src/chart/PieChart.tsrx +15 -11
- package/src/chart/PolarChart.tsrx +45 -48
- package/src/chart/RadarChart.tsrx +38 -32
- package/src/chart/RadialBarChart.tsrx +15 -11
- package/src/chart/RechartsWrapper.tsrx +214 -162
- package/src/chart/Sankey.tsrx +412 -378
- package/src/chart/ScatterChart.tsrx +15 -11
- package/src/chart/SunburstChart.tsrx +162 -155
- package/src/component/ActivePoints.tsrx +19 -13
- package/src/component/Cursor.tsrx +25 -18
- package/src/component/DefaultLegendContent.tsrx +131 -127
- package/src/component/DefaultTooltipContent.tsrx +46 -42
- package/src/component/Dots.tsrx +11 -5
- package/src/component/Label.tsrx +69 -55
- package/src/component/LabelList.tsrx +32 -27
- package/src/component/Legend.tsrx +120 -123
- package/src/component/ResponsiveContainer.tsrx +18 -11
- package/src/component/Text.tsrx +50 -43
- package/src/component/Tooltip.tsrx +234 -223
- package/src/component/TooltipBoundingBox.tsrx +34 -34
- package/src/container/ClipPathProvider.tsrx +1 -3
- package/src/container/Layer.tsrx +5 -1
- package/src/container/RootSurface.tsrx +31 -21
- package/src/container/Surface.tsrx +15 -13
- package/src/context/ErrorBarContext.tsrx +5 -5
- package/src/polar/Pie.tsrx +541 -487
- package/src/polar/PolarAngleAxis.tsrx +245 -227
- package/src/polar/PolarGrid.tsrx +139 -127
- package/src/polar/PolarRadiusAxis.tsrx +204 -185
- package/src/polar/Radar.tsrx +274 -264
- package/src/polar/RadialBar.tsrx +408 -361
- package/src/shape/Cross.tsrx +13 -7
- package/src/shape/Curve.tsrx +54 -44
- package/src/shape/Dot.tsrx +10 -8
- package/src/shape/Polygon.tsrx +38 -29
- package/src/shape/Rectangle.tsrx +73 -28
- package/src/shape/Sector.tsrx +30 -18
- package/src/shape/Symbols.tsrx +13 -11
- package/src/shape/Trapezoid.tsrx +16 -11
- package/src/state/RechartsStoreProvider.tsrx +5 -1
- package/src/synchronisation/useChartSynchronisation.tsrx +8 -7
- package/src/util/BarUtils.tsrx +43 -40
- package/src/util/FunnelUtils.tsrx +5 -5
- package/src/util/RadialBarUtils.tsrx +3 -4
- package/src/util/ScatterUtils.tsrx +13 -8
- package/src/zIndex/ZIndexLayer.tsrx +2 -2
- 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.
|
|
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.
|
|
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.
|
|
49
|
+
"octane": "^0.11.0"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@tsrx/react": "^0.
|
|
52
|
+
"@tsrx/react": "^0.4.5",
|
|
53
53
|
"esbuild": "^0.28.1",
|
|
54
|
-
"octane": "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
|
-
|
|
8
|
-
|
|
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: (
|
|
24
|
-
ItemType
|
|
25
|
-
|
|
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
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
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
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
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(() => {
|