@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
|
@@ -34,12 +34,14 @@ function HorizontalClipRect({ alpha, baseLine, points, strokeWidth }: ClipRectPr
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
if (isNumber(maxY)) {
|
|
37
|
-
return
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
37
|
+
return (
|
|
38
|
+
<rect
|
|
39
|
+
x={startX < endX ? startX : startX - width}
|
|
40
|
+
y={0}
|
|
41
|
+
width={width}
|
|
42
|
+
height={Math.floor(maxY + (strokeWidth ? parseInt(`${strokeWidth}`, 10) : 1))}
|
|
43
|
+
/>
|
|
44
|
+
);
|
|
43
45
|
}
|
|
44
46
|
|
|
45
47
|
return null;
|
|
@@ -61,39 +63,51 @@ function VerticalClipRect({ alpha, baseLine, points, strokeWidth }: ClipRectProp
|
|
|
61
63
|
}
|
|
62
64
|
|
|
63
65
|
if (isNumber(maxX)) {
|
|
64
|
-
return
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
66
|
+
return (
|
|
67
|
+
<rect
|
|
68
|
+
x={0}
|
|
69
|
+
y={startY < endY ? startY : startY - height}
|
|
70
|
+
width={maxX + (strokeWidth ? parseInt(`${strokeWidth}`, 10) : 1)}
|
|
71
|
+
height={Math.floor(height)}
|
|
72
|
+
/>
|
|
73
|
+
);
|
|
70
74
|
}
|
|
71
75
|
|
|
72
76
|
return null;
|
|
73
77
|
}
|
|
74
78
|
|
|
75
|
-
function RevealClipRect({
|
|
79
|
+
function RevealClipRect({
|
|
80
|
+
alpha,
|
|
81
|
+
layout,
|
|
82
|
+
points,
|
|
83
|
+
baseLine,
|
|
84
|
+
strokeWidth,
|
|
85
|
+
}: ClipRectProps & {
|
|
76
86
|
layout: CartesianLayout;
|
|
77
87
|
}) {
|
|
78
88
|
if (layout === 'vertical') {
|
|
79
|
-
return
|
|
89
|
+
return (
|
|
90
|
+
<VerticalClipRect
|
|
91
|
+
alpha={alpha}
|
|
92
|
+
points={points}
|
|
93
|
+
baseLine={baseLine}
|
|
94
|
+
strokeWidth={strokeWidth}
|
|
95
|
+
/>
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
return (
|
|
100
|
+
<HorizontalClipRect
|
|
80
101
|
alpha={alpha}
|
|
81
102
|
points={points}
|
|
82
103
|
baseLine={baseLine}
|
|
83
104
|
strokeWidth={strokeWidth}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
return <HorizontalClipRect
|
|
88
|
-
alpha={alpha}
|
|
89
|
-
points={points}
|
|
90
|
-
baseLine={baseLine}
|
|
91
|
-
strokeWidth={strokeWidth}
|
|
92
|
-
/>;
|
|
105
|
+
/>
|
|
106
|
+
);
|
|
93
107
|
}
|
|
94
108
|
|
|
95
|
-
export type AreaRevealShapeProps =
|
|
96
|
-
|
|
109
|
+
export type AreaRevealShapeProps = CurveProps &
|
|
110
|
+
ShapeAnimationProps & { layout?: LayoutType; isRange?: boolean };
|
|
97
111
|
|
|
98
112
|
/**
|
|
99
113
|
* The default shape for Area that reveals the chart with a left-to-right (or top-to-bottom)
|
|
@@ -129,74 +143,79 @@ export function AreaRevealShape(props: AreaRevealShapeProps): OctaneElement | nu
|
|
|
129
143
|
connectNulls,
|
|
130
144
|
...restProps
|
|
131
145
|
} = props;
|
|
132
|
-
const layout: CartesianLayout =
|
|
133
|
-
layoutProp === 'vertical' ? 'vertical' : 'horizontal';
|
|
146
|
+
const layout: CartesianLayout = layoutProp === 'vertical' ? 'vertical' : 'horizontal';
|
|
134
147
|
const finalConnectNulls = connectNulls ?? false;
|
|
135
148
|
const clipId = useId();
|
|
136
149
|
|
|
137
150
|
const { id, baseLine, ...propsWithoutIdBaseline } = restProps;
|
|
138
151
|
const strokeSvgProps = svgPropertiesNoEvents(propsWithoutIdBaseline);
|
|
139
152
|
|
|
140
|
-
const fillCurve =
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
153
|
+
const fillCurve = (
|
|
154
|
+
<Curve
|
|
155
|
+
{...restProps}
|
|
156
|
+
id={id}
|
|
157
|
+
baseLine={baseLine}
|
|
158
|
+
connectNulls={finalConnectNulls}
|
|
159
|
+
stroke="none"
|
|
160
|
+
className="recharts-area-area"
|
|
161
|
+
layout={layout}
|
|
162
|
+
/>
|
|
163
|
+
);
|
|
164
|
+
|
|
165
|
+
const strokeCurve = stroke !== 'none' && (
|
|
166
|
+
<Curve
|
|
167
|
+
{...strokeSvgProps}
|
|
168
|
+
className="recharts-area-curve"
|
|
169
|
+
layout={layout}
|
|
170
|
+
type={restProps.type}
|
|
171
|
+
connectNulls={finalConnectNulls}
|
|
172
|
+
fill="none"
|
|
173
|
+
stroke={stroke}
|
|
174
|
+
points={restProps.points}
|
|
175
|
+
/>
|
|
176
|
+
);
|
|
177
|
+
|
|
178
|
+
const baselineCurve = stroke !== 'none' && isRange && Array.isArray(baseLine) && (
|
|
179
|
+
<Curve
|
|
180
|
+
{...strokeSvgProps}
|
|
181
|
+
className="recharts-area-curve"
|
|
182
|
+
layout={layout}
|
|
183
|
+
type={restProps.type}
|
|
184
|
+
connectNulls={finalConnectNulls}
|
|
185
|
+
fill="none"
|
|
186
|
+
stroke={stroke}
|
|
187
|
+
points={baseLine}
|
|
188
|
+
/>
|
|
189
|
+
);
|
|
175
190
|
|
|
176
191
|
if (isEntrance && (isAnimating || animationElapsedTime < 1)) {
|
|
177
|
-
return
|
|
178
|
-
<
|
|
179
|
-
<
|
|
180
|
-
<
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
{
|
|
191
|
-
|
|
192
|
-
|
|
192
|
+
return (
|
|
193
|
+
<Layer>
|
|
194
|
+
<defs>
|
|
195
|
+
<clipPath id={clipId}>
|
|
196
|
+
<RevealClipRect
|
|
197
|
+
alpha={animationElapsedTime}
|
|
198
|
+
points={restProps.points ?? []}
|
|
199
|
+
baseLine={baseLine}
|
|
200
|
+
layout={layout}
|
|
201
|
+
strokeWidth={restProps.strokeWidth}
|
|
202
|
+
/>
|
|
203
|
+
</clipPath>
|
|
204
|
+
</defs>
|
|
205
|
+
<Layer clipPath={`url(#${clipId})`}>
|
|
206
|
+
{fillCurve}
|
|
207
|
+
{strokeCurve}
|
|
208
|
+
{baselineCurve}
|
|
209
|
+
</Layer>
|
|
193
210
|
</Layer>
|
|
194
|
-
|
|
211
|
+
);
|
|
195
212
|
}
|
|
196
213
|
|
|
197
|
-
return
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
214
|
+
return (
|
|
215
|
+
<>
|
|
216
|
+
{fillCurve}
|
|
217
|
+
{strokeCurve}
|
|
218
|
+
{baselineCurve}
|
|
219
|
+
</>
|
|
220
|
+
);
|
|
202
221
|
}
|