@octanejs/recharts 0.1.62 → 0.1.64
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
|
@@ -58,9 +58,11 @@ export function useBarStackClipPathUrl(index: number) {
|
|
|
58
58
|
return 'url(#' + getClipPathId(stackId, index) + ')';
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
export function BarStackClipLayer(
|
|
62
|
-
|
|
63
|
-
|
|
61
|
+
export function BarStackClipLayer(
|
|
62
|
+
props: LayerProps & {
|
|
63
|
+
index: number;
|
|
64
|
+
},
|
|
65
|
+
) {
|
|
64
66
|
const { index, ...rest } = props;
|
|
65
67
|
const clipPathUrl = useBarStackClipPathUrl(index);
|
|
66
68
|
return <Layer className="recharts-bar-stack-layer" clipPath={clipPathUrl} {...rest} />;
|
|
@@ -70,42 +72,45 @@ export function BarStackClipLayer(props: LayerProps & {
|
|
|
70
72
|
* Renders one clipPath per stack rectangle so the whole stack gets rounded
|
|
71
73
|
* corners.
|
|
72
74
|
*/
|
|
73
|
-
function BarStackClipPath(props: {
|
|
74
|
-
stackId: NormalizedStackId;
|
|
75
|
-
radius: RectRadius;
|
|
76
|
-
}) {
|
|
75
|
+
function BarStackClipPath(props: { stackId: NormalizedStackId; radius: RectRadius }) {
|
|
77
76
|
const { stackId, radius } = props;
|
|
78
77
|
const isPanorama = useIsPanorama();
|
|
79
78
|
const positions = useAppSelector((state) => selectStackRects(state, stackId, isPanorama));
|
|
80
79
|
if (positions == null || positions.length === 0) {
|
|
81
80
|
return null;
|
|
82
81
|
}
|
|
83
|
-
return
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
82
|
+
return (
|
|
83
|
+
<defs>
|
|
84
|
+
{positions.map((pos, index) => {
|
|
85
|
+
if (pos == null) {
|
|
86
|
+
return null;
|
|
87
|
+
}
|
|
88
|
+
const clipPathId = getClipPathId(stackId, index);
|
|
89
|
+
return (
|
|
90
|
+
<clipPath key={clipPathId} id={clipPathId}>
|
|
91
|
+
<Rectangle
|
|
92
|
+
isAnimationActive={false}
|
|
93
|
+
isUpdateAnimationActive={false}
|
|
94
|
+
x={pos.x}
|
|
95
|
+
y={pos.y}
|
|
96
|
+
width={pos.width}
|
|
97
|
+
height={pos.height}
|
|
98
|
+
radius={radius}
|
|
99
|
+
/>
|
|
100
|
+
</clipPath>
|
|
101
|
+
);
|
|
102
|
+
})}
|
|
103
|
+
</defs>
|
|
104
|
+
);
|
|
100
105
|
}
|
|
101
106
|
|
|
102
107
|
function BarStackImpl(props: BarStackProps) @{
|
|
103
108
|
const resolvedStackId = useUniqueId('recharts-bar-stack', getNormalizedStackId(props.stackId));
|
|
104
109
|
const { children, radius } = resolveDefaultProps(props, defaultBarStackProps);
|
|
105
|
-
const context: BarStackSettings = useMemo(
|
|
106
|
-
resolvedStackId,
|
|
107
|
-
radius,
|
|
108
|
-
|
|
110
|
+
const context: BarStackSettings = useMemo(
|
|
111
|
+
() => ({ stackId: resolvedStackId, radius }),
|
|
112
|
+
[resolvedStackId, radius],
|
|
113
|
+
);
|
|
109
114
|
<BarStackContext value={context}>
|
|
110
115
|
<BarStackClipPath stackId={resolvedStackId} radius={radius} />
|
|
111
116
|
{children}
|
|
@@ -56,11 +56,11 @@ export interface CartesianAxisProps extends ZIndexable {
|
|
|
56
56
|
export interface CartesianAxisRef {
|
|
57
57
|
getCalculatedWidth(): number;
|
|
58
58
|
}
|
|
59
|
-
export type Props =
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
59
|
+
export type Props = Omit<
|
|
60
|
+
PresentationAttributesAdaptChildEvent<any, SVGElement>,
|
|
61
|
+
'viewBox' | 'scale' | 'ref'
|
|
62
|
+
> &
|
|
63
|
+
CartesianAxisProps;
|
|
64
64
|
type InternalProps = RequiresDefaultProps<Props, typeof defaultCartesianAxisProps>;
|
|
65
65
|
type TicksProps = {
|
|
66
66
|
ref?: Ref<SVGGElement>;
|
|
@@ -162,7 +162,10 @@ function AxisLine(axisLineProps: {
|
|
|
162
162
|
}
|
|
163
163
|
let props = { ...otherSvgProps, ...svgPropertiesNoEvents(axisLine), fill: 'none' };
|
|
164
164
|
if (orientation === 'top' || orientation === 'bottom') {
|
|
165
|
-
const needHeight = +(
|
|
165
|
+
const needHeight = +(
|
|
166
|
+
(orientation === 'top' && !mirror) ||
|
|
167
|
+
(orientation === 'bottom' && mirror)
|
|
168
|
+
);
|
|
166
169
|
props = {
|
|
167
170
|
...props,
|
|
168
171
|
x1: x,
|
|
@@ -171,7 +174,7 @@ function AxisLine(axisLineProps: {
|
|
|
171
174
|
y2: y + needHeight * height,
|
|
172
175
|
};
|
|
173
176
|
} else {
|
|
174
|
-
const needWidth = +(orientation === 'left' && !mirror || orientation === 'right' && mirror);
|
|
177
|
+
const needWidth = +((orientation === 'left' && !mirror) || (orientation === 'right' && mirror));
|
|
175
178
|
props = {
|
|
176
179
|
...props,
|
|
177
180
|
x1: x + needWidth * width,
|
|
@@ -180,10 +183,9 @@ function AxisLine(axisLineProps: {
|
|
|
180
183
|
y2: y + height,
|
|
181
184
|
};
|
|
182
185
|
}
|
|
183
|
-
return
|
|
184
|
-
{...props}
|
|
185
|
-
|
|
186
|
-
/>;
|
|
186
|
+
return (
|
|
187
|
+
<line {...props} className={clsx('recharts-cartesian-axis-line', get(axisLine, 'className'))} />
|
|
188
|
+
);
|
|
187
189
|
}
|
|
188
190
|
|
|
189
191
|
/**
|
|
@@ -264,11 +266,7 @@ function getTickVerticalAnchor(orientation: Orientation, mirror: boolean) {
|
|
|
264
266
|
}
|
|
265
267
|
}
|
|
266
268
|
|
|
267
|
-
function TickItem(props: {
|
|
268
|
-
option: Props['tick'];
|
|
269
|
-
tickProps: TextProps;
|
|
270
|
-
value: string;
|
|
271
|
-
}) {
|
|
269
|
+
function TickItem(props: { option: Props['tick']; tickProps: TextProps; value: string }) {
|
|
272
270
|
const { option, tickProps, value } = props;
|
|
273
271
|
let tickItem;
|
|
274
272
|
const combinedClassName = clsx(tickProps.className, 'recharts-cartesian-axis-tick-value');
|
|
@@ -281,7 +279,11 @@ function TickItem(props: {
|
|
|
281
279
|
if (typeof option !== 'boolean') {
|
|
282
280
|
className = clsx(className, getClassNameFromUnknown(option));
|
|
283
281
|
}
|
|
284
|
-
tickItem =
|
|
282
|
+
tickItem = (
|
|
283
|
+
<Text {...tickProps} className={className}>
|
|
284
|
+
{value}
|
|
285
|
+
</Text>
|
|
286
|
+
);
|
|
285
287
|
}
|
|
286
288
|
return tickItem;
|
|
287
289
|
}
|
|
@@ -298,14 +300,12 @@ function RenderedTicksReporter(props: {
|
|
|
298
300
|
return noop;
|
|
299
301
|
}
|
|
300
302
|
// Filter out irrelevant internal properties before exposing externally
|
|
301
|
-
const tickItems = ticks.map(
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
}),
|
|
308
|
-
);
|
|
303
|
+
const tickItems = ticks.map((tick) => ({
|
|
304
|
+
value: tick.value,
|
|
305
|
+
coordinate: tick.coordinate,
|
|
306
|
+
offset: tick.offset,
|
|
307
|
+
index: tick.index,
|
|
308
|
+
}));
|
|
309
309
|
dispatch(setRenderedTicks({ ticks: tickItems, axisId, axisType }));
|
|
310
310
|
return () => {
|
|
311
311
|
dispatch(removeRenderedTicks({ axisId, axisType }));
|
|
@@ -344,10 +344,9 @@ function Ticks(props: TicksProps) {
|
|
|
344
344
|
const axisProps = svgPropertiesNoEvents(getTicksConfig);
|
|
345
345
|
const customTickProps = svgPropertiesNoEventsFromUnknown(tick);
|
|
346
346
|
// Use user-provided textAnchor if available, otherwise calculate from orientation/mirror
|
|
347
|
-
const textAnchor: TextAnchor =
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
: getTickTextAnchor(orientation, mirror);
|
|
347
|
+
const textAnchor: TextAnchor = isValidTextAnchor(axisProps.textAnchor)
|
|
348
|
+
? axisProps.textAnchor
|
|
349
|
+
: getTickTextAnchor(orientation, mirror);
|
|
351
350
|
const verticalAnchor: TextVerticalAnchor = getTickVerticalAnchor(orientation, mirror);
|
|
352
351
|
let tickLinePropsObject: SVGProps<SVGLineElement> = {};
|
|
353
352
|
if (typeof tickLine === 'object') {
|
|
@@ -358,24 +357,25 @@ function Ticks(props: TicksProps) {
|
|
|
358
357
|
fill: 'none',
|
|
359
358
|
...tickLinePropsObject,
|
|
360
359
|
};
|
|
361
|
-
const tickLineCoords = finalTicks.map(
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
}),
|
|
366
|
-
);
|
|
360
|
+
const tickLineCoords = finalTicks.map((entry: CartesianTickItem) => ({
|
|
361
|
+
entry,
|
|
362
|
+
...getTickLineCoord(entry, x, y, width, height, orientation, tickSize, mirror, tickMargin),
|
|
363
|
+
}));
|
|
367
364
|
const tickLines = tickLineCoords.map(({ entry, line: lineCoord }) => {
|
|
368
|
-
return
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
365
|
+
return (
|
|
366
|
+
<Layer
|
|
367
|
+
className="recharts-cartesian-axis-tick"
|
|
368
|
+
key={'tick-' + entry.value + '-' + entry.coordinate + '-' + entry.tickCoord}
|
|
369
|
+
>
|
|
370
|
+
{tickLine && (
|
|
371
|
+
<line
|
|
372
|
+
{...tickLineProps}
|
|
373
|
+
{...lineCoord}
|
|
374
|
+
className={clsx('recharts-cartesian-axis-tick-line', get(tickLine, 'className'))}
|
|
375
|
+
/>
|
|
376
|
+
)}
|
|
377
|
+
</Layer>
|
|
378
|
+
);
|
|
379
379
|
});
|
|
380
380
|
const tickLabels = tickLineCoords.map(({ entry, tick: tickCoord }, i) => {
|
|
381
381
|
const tickProps = {
|
|
@@ -394,143 +394,146 @@ function Ticks(props: TicksProps) {
|
|
|
394
394
|
angle: tickTextProps?.angle ?? axisProps.angle ?? 0,
|
|
395
395
|
};
|
|
396
396
|
const finalTickProps: BaseTickContentProps = { ...tickProps, ...customTickProps };
|
|
397
|
-
return
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
397
|
+
return (
|
|
398
|
+
<Layer
|
|
399
|
+
className="recharts-cartesian-axis-tick-label"
|
|
400
|
+
key={'tick-label-' + entry.value + '-' + entry.coordinate + '-' + entry.tickCoord}
|
|
401
|
+
{...adaptEventsOfChild(events, entry, i)}
|
|
402
|
+
>
|
|
403
|
+
{tick && (
|
|
404
|
+
<TickItem
|
|
405
|
+
option={tick}
|
|
406
|
+
tickProps={finalTickProps}
|
|
407
|
+
value={
|
|
408
|
+
String(
|
|
409
|
+
typeof tickFormatter === 'function' ? tickFormatter(entry.value, i) : entry.value,
|
|
410
|
+
) + (unit || '')
|
|
411
|
+
}
|
|
412
|
+
/>
|
|
413
|
+
)}
|
|
414
|
+
</Layer>
|
|
415
|
+
);
|
|
412
416
|
});
|
|
413
|
-
return
|
|
414
|
-
<
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
<
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
417
|
+
return (
|
|
418
|
+
<g className={'recharts-cartesian-axis-ticks recharts-' + axisType + '-ticks'}>
|
|
419
|
+
<RenderedTicksReporter ticks={finalTicks} axisId={axisId} axisType={axisType} />
|
|
420
|
+
{tickLabels.length > 0 && (
|
|
421
|
+
<ZIndexLayer zIndex={DefaultZIndexes.label}>
|
|
422
|
+
<g
|
|
423
|
+
className={'recharts-cartesian-axis-tick-labels recharts-' + axisType + '-tick-labels'}
|
|
424
|
+
ref={ref}
|
|
425
|
+
>
|
|
426
|
+
{tickLabels}
|
|
427
|
+
</g>
|
|
428
|
+
</ZIndexLayer>
|
|
429
|
+
)}
|
|
430
|
+
{tickLines.length > 0 && (
|
|
431
|
+
<g className={'recharts-cartesian-axis-tick-lines recharts-' + axisType + '-tick-lines'}>
|
|
432
|
+
{tickLines}
|
|
433
|
+
</g>
|
|
434
|
+
)}
|
|
435
|
+
</g>
|
|
436
|
+
);
|
|
427
437
|
}
|
|
428
438
|
|
|
429
439
|
function CartesianAxisComponent(props: InternalProps) {
|
|
430
440
|
// This ref receives the imperative axis handle, never an SVG line or tick.
|
|
431
441
|
const { ref, ...propsWithoutRef } = props;
|
|
432
|
-
const {
|
|
433
|
-
|
|
434
|
-
width,
|
|
435
|
-
height,
|
|
436
|
-
className,
|
|
437
|
-
hide,
|
|
438
|
-
ticks,
|
|
439
|
-
axisType,
|
|
440
|
-
axisId,
|
|
441
|
-
...rest
|
|
442
|
-
} = propsWithoutRef;
|
|
442
|
+
const { axisLine, width, height, className, hide, ticks, axisType, axisId, ...rest } =
|
|
443
|
+
propsWithoutRef;
|
|
443
444
|
const [fontSize, setFontSize] = useState('');
|
|
444
445
|
const [letterSpacing, setLetterSpacing] = useState('');
|
|
445
446
|
const tickRefs = useRef<HTMLCollectionOf<Element> | null>(null);
|
|
446
|
-
useImperativeHandle(
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
setLetterSpacing(calculatedLetterSpacing);
|
|
447
|
+
useImperativeHandle(ref, () => ({
|
|
448
|
+
getCalculatedWidth: () => {
|
|
449
|
+
return getCalculatedYAxisWidth({
|
|
450
|
+
ticks: tickRefs.current,
|
|
451
|
+
label: props.labelRef?.current,
|
|
452
|
+
labelGapWithTick: 5,
|
|
453
|
+
tickSize: props.tickSize,
|
|
454
|
+
tickMargin: props.tickMargin,
|
|
455
|
+
});
|
|
456
|
+
},
|
|
457
|
+
}));
|
|
458
|
+
const layerRef = useCallback(
|
|
459
|
+
(el: SVGElement | null) => {
|
|
460
|
+
if (el) {
|
|
461
|
+
const tickNodes = el.getElementsByClassName('recharts-cartesian-axis-tick-value');
|
|
462
|
+
tickRefs.current = tickNodes;
|
|
463
|
+
const tick: Element | undefined = tickNodes[0];
|
|
464
|
+
if (tick) {
|
|
465
|
+
const computedStyle = window.getComputedStyle(tick);
|
|
466
|
+
const calculatedFontSize = computedStyle.fontSize;
|
|
467
|
+
const calculatedLetterSpacing = computedStyle.letterSpacing;
|
|
468
|
+
if (calculatedFontSize !== fontSize || calculatedLetterSpacing !== letterSpacing) {
|
|
469
|
+
setFontSize(calculatedFontSize);
|
|
470
|
+
setLetterSpacing(calculatedLetterSpacing);
|
|
471
|
+
}
|
|
472
472
|
}
|
|
473
473
|
}
|
|
474
|
-
}
|
|
475
|
-
|
|
474
|
+
},
|
|
475
|
+
[fontSize, letterSpacing],
|
|
476
|
+
);
|
|
476
477
|
if (hide) {
|
|
477
478
|
return null;
|
|
478
479
|
}
|
|
479
480
|
// CartesianAxis allows width or height to be undefined (unlike
|
|
480
481
|
// validateWidthHeight).
|
|
481
|
-
if (width != null && width <= 0 || height != null && height <= 0) {
|
|
482
|
+
if ((width != null && width <= 0) || (height != null && height <= 0)) {
|
|
482
483
|
return null;
|
|
483
484
|
}
|
|
484
|
-
return
|
|
485
|
-
<
|
|
486
|
-
<
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
485
|
+
return (
|
|
486
|
+
<ZIndexLayer zIndex={props.zIndex}>
|
|
487
|
+
<Layer className={clsx('recharts-cartesian-axis', className)}>
|
|
488
|
+
<AxisLine
|
|
489
|
+
x={props.x}
|
|
490
|
+
y={props.y}
|
|
491
|
+
width={width}
|
|
492
|
+
height={height}
|
|
493
|
+
orientation={props.orientation}
|
|
494
|
+
mirror={props.mirror}
|
|
495
|
+
axisLine={axisLine}
|
|
496
|
+
otherSvgProps={svgPropertiesNoEvents(propsWithoutRef)}
|
|
497
|
+
/>
|
|
498
|
+
<Ticks
|
|
499
|
+
ref={layerRef}
|
|
500
|
+
axisType={axisType}
|
|
501
|
+
events={rest}
|
|
502
|
+
fontSize={fontSize}
|
|
503
|
+
getTicksConfig={propsWithoutRef}
|
|
504
|
+
height={props.height}
|
|
505
|
+
letterSpacing={letterSpacing}
|
|
506
|
+
mirror={props.mirror}
|
|
507
|
+
orientation={props.orientation}
|
|
508
|
+
padding={props.padding}
|
|
509
|
+
stroke={props.stroke}
|
|
510
|
+
tick={props.tick}
|
|
511
|
+
tickFormatter={props.tickFormatter}
|
|
512
|
+
tickLine={props.tickLine}
|
|
513
|
+
tickMargin={props.tickMargin}
|
|
514
|
+
tickSize={props.tickSize}
|
|
515
|
+
tickTextProps={props.tickTextProps}
|
|
516
|
+
ticks={ticks}
|
|
517
|
+
unit={props.unit}
|
|
518
|
+
width={props.width}
|
|
519
|
+
x={props.x}
|
|
520
|
+
y={props.y}
|
|
521
|
+
axisId={axisId}
|
|
522
|
+
/>
|
|
523
|
+
<CartesianLabelContextProvider
|
|
524
|
+
x={props.x}
|
|
525
|
+
y={props.y}
|
|
526
|
+
width={props.width}
|
|
527
|
+
height={props.height}
|
|
528
|
+
lowerWidth={props.width}
|
|
529
|
+
upperWidth={props.width}
|
|
530
|
+
>
|
|
531
|
+
<CartesianLabelFromLabelProp label={props.label} labelRef={props.labelRef} />
|
|
532
|
+
{props.children}
|
|
533
|
+
</CartesianLabelContextProvider>
|
|
534
|
+
</Layer>
|
|
535
|
+
</ZIndexLayer>
|
|
536
|
+
);
|
|
534
537
|
}
|
|
535
538
|
|
|
536
539
|
/**
|