@easyv/charts 1.0.74 → 1.1.1

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 (74) hide show
  1. package/.babelrc +8 -8
  2. package/.husky/commit-msg +4 -0
  3. package/CHANGELOG.md +18 -0
  4. package/commitlint.config.js +1 -0
  5. package/lib/components/AnimateData.js +2 -2
  6. package/lib/components/Axis.js +36 -17
  7. package/lib/components/Background.js +2 -2
  8. package/lib/components/Band.js +4 -1
  9. package/lib/components/Carousel.js +2 -2
  10. package/lib/components/CartesianChart.js +8 -2
  11. package/lib/components/Chart.js +2 -2
  12. package/lib/components/ConicalGradient.js +21 -21
  13. package/lib/components/Indicator.js +2 -2
  14. package/lib/components/Lighter.js +180 -0
  15. package/lib/components/LinearGradient.js +2 -2
  16. package/lib/components/PieChart.js +14 -8
  17. package/lib/components/Tooltip.js +30 -12
  18. package/lib/components/index.js +8 -0
  19. package/lib/css/index.module.css +41 -41
  20. package/lib/css/piechart.module.css +26 -26
  21. package/lib/element/ConicGradient.js +73 -0
  22. package/lib/hooks/useAnimateData.js +5 -5
  23. package/lib/hooks/useAxes.js +5 -5
  24. package/lib/hooks/useCarouselAxisX.js +5 -5
  25. package/lib/hooks/useExtentData.js +6 -6
  26. package/lib/hooks/useFilterData.js +5 -5
  27. package/lib/hooks/useStackData.js +5 -5
  28. package/lib/hooks/useTooltip.js +10 -10
  29. package/lib/utils/index.js +1 -1
  30. package/package.json +52 -34
  31. package/src/components/AnimateData.tsx +24 -24
  32. package/src/components/Axis.tsx +354 -336
  33. package/src/components/Background.tsx +45 -45
  34. package/src/components/Band.tsx +173 -171
  35. package/src/components/Brush.js +159 -159
  36. package/src/components/Carousel.tsx +144 -144
  37. package/src/components/CartesianChart.js +7 -1
  38. package/src/components/Chart.js +99 -99
  39. package/src/components/ChartContainer.tsx +63 -63
  40. package/src/components/ConicalGradient.js +258 -258
  41. package/src/components/ExtentData.js +17 -17
  42. package/src/components/FilterData.js +23 -23
  43. package/src/components/Indicator.js +13 -13
  44. package/src/components/Label.js +206 -206
  45. package/src/components/Legend.js +158 -158
  46. package/src/components/Lighter.jsx +173 -162
  47. package/src/components/Line.js +144 -144
  48. package/src/components/LinearGradient.js +29 -29
  49. package/src/components/Mapping.js +71 -71
  50. package/src/components/PieChart.js +1097 -1093
  51. package/src/components/StackData.js +20 -20
  52. package/src/components/StereoBar.tsx +298 -298
  53. package/src/components/Tooltip.js +168 -133
  54. package/src/components/index.js +51 -49
  55. package/src/context/index.js +2 -2
  56. package/src/css/index.module.css +41 -41
  57. package/src/css/piechart.module.css +26 -26
  58. package/src/element/ConicGradient.jsx +55 -55
  59. package/src/element/Line.tsx +33 -33
  60. package/src/element/index.ts +3 -3
  61. package/src/formatter/index.js +1 -1
  62. package/src/formatter/legend.js +90 -90
  63. package/src/hooks/index.js +17 -17
  64. package/src/hooks/useAnimateData.ts +62 -62
  65. package/src/hooks/useAxes.js +144 -144
  66. package/src/hooks/useCarouselAxisX.js +163 -163
  67. package/src/hooks/useExtentData.js +88 -88
  68. package/src/hooks/useFilterData.js +72 -72
  69. package/src/hooks/useStackData.js +100 -100
  70. package/src/hooks/useTooltip.ts +96 -96
  71. package/src/index.js +6 -6
  72. package/src/types/index.d.ts +62 -59
  73. package/src/utils/index.js +696 -692
  74. package/tsconfig.json +22 -22
@@ -1,336 +1,354 @@
1
- /**
2
- * x, y, z轴
3
- */
4
- import React, {
5
- ComponentType,
6
- memo,
7
- ReactComponentElement,
8
- useContext,
9
- } from 'react';
10
- import { getTickCoord, getGridCoord } from '../utils';
11
- import { chartContext } from '../context';
12
- import { Line } from '../element';
13
-
14
- const defaultAlign: Align = {
15
- textAnchor: 'middle',
16
- dominantBaseline: 'middle',
17
- };
18
- const defaultOrientation = 'bottom';
19
- const defaultTickSize = 6;
20
- const defaultFormatter: (d: string, { suffix }: { suffix: string }) => string =
21
- (d, { suffix }) => d + suffix;
22
-
23
- const getAxesPath: (
24
- orientation: Orientation,
25
- { width, height }: Context
26
- ) => string = (orientation, { width, height }) => {
27
- switch (orientation) {
28
- case 'top':
29
- case 'bottom':
30
- return 'M-0.5, 0H' + width;
31
- case 'left':
32
- case 'right':
33
- return 'M0, -0.5V' + (height + 0.5);
34
- }
35
- };
36
- /**
37
- * 根据坐标轴位置来确定轴标签的垂直对齐方式,水平对齐方式,以及轴标签位于坐标轴的哪个方向
38
- * @param orientation 坐标轴位置
39
- * @param rotate 旋转角度
40
- * @returns {
41
- * dominantBaseline,
42
- * textAnchor,
43
- * directionX,
44
- * directionY
45
- * }
46
- */
47
- const getLayout: (
48
- orientation: Orientation,
49
- rotate: number
50
- ) => {
51
- dominantBaseline: string;
52
- textAnchor: string;
53
- directionX: number;
54
- directionY: number;
55
- } = (orientation, rotate) => {
56
- switch (orientation) {
57
- case 'top':
58
- return {
59
- dominantBaseline: 'text-after-edge',
60
- textAnchor: rotate ? 'end' : 'middle',
61
- directionX: 1,
62
- directionY: -1,
63
- };
64
- case 'bottom':
65
- return {
66
- dominantBaseline: 'text-before-edge',
67
- textAnchor: rotate ? 'start' : 'middle',
68
- directionX: 1,
69
- directionY: 1,
70
- };
71
- case 'left':
72
- return {
73
- dominantBaseline: 'middle',
74
- textAnchor: 'end',
75
- directionX: -1,
76
- directionY: 1,
77
- };
78
- case 'right':
79
- return {
80
- dominantBaseline: 'middle',
81
- textAnchor: 'start',
82
- directionX: 1,
83
- directionY: 1,
84
- };
85
- }
86
- };
87
- const AxisLine: ({
88
- orientation: Orientation,
89
- config: ChartLine,
90
- }: any) => ReactComponentElement<ComponentType> | null = ({
91
- orientation = defaultOrientation,
92
- config: { show, color, lineWidth },
93
- }) => {
94
- if (!show) return null;
95
- const context: Context = useContext(chartContext);
96
- return (
97
- <path
98
- d={getAxesPath(orientation, context)}
99
- stroke={color}
100
- strokeWidth={lineWidth}
101
- />
102
- );
103
- };
104
-
105
- const Unit: ({
106
- config: {
107
- show: boolean,
108
- text: string,
109
- font: Font,
110
- translate: Translate,
111
- align: Align,
112
- },
113
- }: any) => ReactComponentElement<ComponentType> | null = ({
114
- config: {
115
- show,
116
- text,
117
- font: { bold, color, fontFamily, fontSize, italic, letterSpacing },
118
- translate: { x: translateX, y: translateY },
119
- align: { textAnchor } = defaultAlign,
120
- },
121
- }) => {
122
- if (!show) return null;
123
- return (
124
- <text
125
- className='__easyv-unit'
126
- transform={'translate(' + translateX + ', ' + translateY + ')'}
127
- fontFamily={fontFamily}
128
- fontSize={fontSize}
129
- fill={color}
130
- fontWeight={bold ? 'bold' : 'normal'}
131
- fontStyle={italic ? 'italic' : 'normal'}
132
- letterSpacing={letterSpacing}
133
- textAnchor={textAnchor}
134
- >
135
- {text}
136
- </text>
137
- );
138
- };
139
-
140
- type LabelType = {
141
- className: string;
142
- orientation: Orientation;
143
- label: string;
144
- coordinate: number;
145
- formatter: Function;
146
- tickSize: number;
147
- rotate: number;
148
- config: { show: boolean; translate: Translate; font: Font };
149
- };
150
-
151
- const Label: (props: LabelType) => ReactComponentElement<ComponentType> | null =
152
- ({
153
- className,
154
- orientation = defaultOrientation,
155
- label,
156
- coordinate,
157
- formatter = defaultFormatter,
158
- tickSize,
159
- rotate = 0,
160
- config,
161
- config: {
162
- show,
163
- translate: { x: translateX, y: translateY },
164
- font: { fontFamily, fontSize, color, bold, italic, letterSpacing },
165
- },
166
- }) => {
167
- if (!show) return null;
168
- const _label = formatter(label, config);
169
- const { dominantBaseline, textAnchor, directionX, directionY } = getLayout(
170
- orientation,
171
- rotate
172
- );
173
- const isVertical = orientation == 'left' || orientation == 'right';
174
-
175
- const x =
176
- (isVertical ? tickSize * directionX : coordinate) +
177
- translateX * directionX;
178
- const y =
179
- (isVertical ? coordinate : tickSize * directionY) +
180
- translateY * directionY;
181
-
182
- const translateText = 'translate(' + x + ', ' + y + ')';
183
-
184
- return (
185
- <text
186
- className={className}
187
- style={{
188
- whiteSpace:"pre"
189
- }}
190
- dominantBaseline={dominantBaseline}
191
- textAnchor={textAnchor}
192
- fontFamily={fontFamily}
193
- fontSize={fontSize}
194
- fill={color}
195
- fontWeight={bold ? 'bold' : 'normal'}
196
- fontStyle={italic ? 'italic' : 'normal'}
197
- letterSpacing={letterSpacing}
198
- dx='0'
199
- dy='0'
200
- transform={
201
- Array.isArray(_label)
202
- ? rotate !== 0
203
- ? isVertical
204
- ? translateText + 'rotate(' + rotate + ')'
205
- : 'rotate(' + rotate + ', ' + x + ', ' + y + ')'
206
- : isVertical
207
- ? translateText
208
- : 'translate(' + translateX + ', ' + translateY + ')'
209
- : translateText + 'rotate(' + rotate + ')'
210
- }
211
- >
212
- {!!Array.isArray(_label)
213
- ? _label.map((item, index) => (
214
- <tspan key={index} x={x} dy='1em'>
215
- {item}
216
- </tspan>
217
- ))
218
- : _label}
219
- </text>
220
- );
221
- };
222
-
223
- export default memo(
224
- ({
225
- orientation,
226
- scaler,
227
- tickSize = defaultTickSize,
228
- ticks,
229
- formatter,
230
- rotate,
231
- config: { on, label, axisLine, tickLine, gridLine, unit },
232
- positions,
233
- }: any) => {
234
- if (!(on && ticks.length > 0)) return null;
235
- const { width, height } = useContext(chartContext);
236
- const x = orientation == 'right' ? width : 0;
237
- const y = orientation == 'bottom' ? height : 0;
238
-
239
- return (
240
- <>
241
- {axisLine && tickLine && (
242
- <>
243
- {axisLine &&
244
- (positions && positions.length ? (
245
- positions.map(({ x, y }: any, index: number) => (
246
- <g key={index} transform={'translate(' + x + ', ' + y + ')'}>
247
- <AxisLine orientation={orientation} config={axisLine} />
248
- {tickLine &&
249
- ticks.map((tick: string, index: number) => {
250
- const coordinate = scaler(tick);
251
- if (isNaN(coordinate)) return null;
252
- const _tickSize = tickLine.tickSize || tickSize;
253
- return (
254
- <Line
255
- className='__easyv-tickLine'
256
- key={index}
257
- config={tickLine}
258
- {...getTickCoord({
259
- orientation,
260
- coordinate,
261
- tickSize: _tickSize,
262
- })}
263
- />
264
- );
265
- })}
266
- </g>
267
- ))
268
- ) : (
269
- <g transform={'translate(' + x + ', ' + y + ')'}>
270
- <AxisLine orientation={orientation} config={axisLine} />
271
- {tickLine &&
272
- ticks.map((tick: string, index: number) => {
273
- const coordinate = scaler(tick);
274
- if (isNaN(coordinate)) return null;
275
- const _tickSize = tickLine.tickSize || tickSize;
276
- return (
277
- <Line
278
- className='__easyv-tickLine'
279
- key={index}
280
- config={tickLine}
281
- {...getTickCoord({
282
- orientation,
283
- coordinate,
284
- tickSize: _tickSize,
285
- })}
286
- />
287
- );
288
- })}
289
- </g>
290
- ))}
291
- </>
292
- )}
293
- <g transform={'translate(' + x + ', ' + y + ')'}>
294
- {label &&
295
- gridLine &&
296
- ticks.map((tick: string, index: number) => {
297
- const coordinate = scaler(tick);
298
- if (isNaN(coordinate)) return null;
299
- const _tickSize = tickLine.tickSize || tickSize;
300
- return (
301
- <g key={index}>
302
- {label && (
303
- <Label
304
- className='__easyv-label'
305
- orientation={orientation}
306
- coordinate={coordinate}
307
- config={label}
308
- label={tick}
309
- tickSize={_tickSize}
310
- formatter={formatter}
311
- rotate={rotate}
312
- />
313
- )}
314
- {gridLine && (
315
- <Line
316
- className='__easyv-gridLine'
317
- config={gridLine}
318
- {...getGridCoord({
319
- orientation,
320
- coordinate,
321
- end:
322
- orientation == 'left' || orientation == 'right'
323
- ? width
324
- : height,
325
- })}
326
- />
327
- )}
328
- </g>
329
- );
330
- })}
331
- {unit && <Unit config={unit} />}
332
- </g>
333
- </>
334
- );
335
- }
336
- );
1
+ /**
2
+ * x, y, z轴
3
+ */
4
+ import React, {
5
+ ComponentType,
6
+ memo,
7
+ ReactComponentElement,
8
+ useContext,
9
+ CSSProperties,
10
+ MouseEventHandler,
11
+ } from 'react';
12
+ import { getTickCoord, getGridCoord } from '../utils';
13
+ import { chartContext } from '../context';
14
+ import { Line } from '../element';
15
+ const defaultEvent = () => {};
16
+ const defaultAlign: Align = {
17
+ textAnchor: 'middle',
18
+ dominantBaseline: 'middle',
19
+ };
20
+ const defaultOrientation = 'bottom';
21
+ const defaultTickSize = 6;
22
+ const defaultFormatter: (
23
+ d: string,
24
+ { suffix }: { suffix: string }
25
+ ) => string = (d, { suffix }) => d + suffix;
26
+
27
+ const getAxesPath: (
28
+ orientation: Orientation,
29
+ { width, height }: Context
30
+ ) => string = (orientation, { width, height }) => {
31
+ switch (orientation) {
32
+ case 'top':
33
+ case 'bottom':
34
+ return 'M-0.5, 0H' + width;
35
+ case 'left':
36
+ case 'right':
37
+ return 'M0, -0.5V' + (height + 0.5);
38
+ }
39
+ };
40
+ /**
41
+ * 根据坐标轴位置来确定轴标签的垂直对齐方式,水平对齐方式,以及轴标签位于坐标轴的哪个方向
42
+ * @param orientation 坐标轴位置
43
+ * @param rotate 旋转角度
44
+ * @returns {
45
+ * dominantBaseline,
46
+ * textAnchor,
47
+ * directionX,
48
+ * directionY
49
+ * }
50
+ */
51
+ const getLayout: (
52
+ orientation: Orientation,
53
+ rotate: number
54
+ ) => {
55
+ dominantBaseline: string;
56
+ textAnchor: string;
57
+ directionX: number;
58
+ directionY: number;
59
+ } = (orientation, rotate) => {
60
+ switch (orientation) {
61
+ case 'top':
62
+ return {
63
+ dominantBaseline: 'text-after-edge',
64
+ textAnchor: rotate ? 'end' : 'middle',
65
+ directionX: 1,
66
+ directionY: -1,
67
+ };
68
+ case 'bottom':
69
+ return {
70
+ dominantBaseline: 'text-before-edge',
71
+ textAnchor: rotate ? 'start' : 'middle',
72
+ directionX: 1,
73
+ directionY: 1,
74
+ };
75
+ case 'left':
76
+ return {
77
+ dominantBaseline: 'middle',
78
+ textAnchor: 'end',
79
+ directionX: -1,
80
+ directionY: 1,
81
+ };
82
+ case 'right':
83
+ return {
84
+ dominantBaseline: 'middle',
85
+ textAnchor: 'start',
86
+ directionX: 1,
87
+ directionY: 1,
88
+ };
89
+ }
90
+ };
91
+ const AxisLine: ({
92
+ orientation: Orientation,
93
+ config: ChartLine,
94
+ }: any) => ReactComponentElement<ComponentType> | null = ({
95
+ orientation = defaultOrientation,
96
+ config: { show, color, lineWidth },
97
+ }) => {
98
+ if (!show) return null;
99
+ const context: Context = useContext(chartContext);
100
+ return (
101
+ <path
102
+ d={getAxesPath(orientation, context)}
103
+ stroke={color}
104
+ strokeWidth={lineWidth}
105
+ />
106
+ );
107
+ };
108
+
109
+ const Unit: ({
110
+ config: {
111
+ show: boolean,
112
+ text: string,
113
+ font: Font,
114
+ translate: Translate,
115
+ align: Align,
116
+ },
117
+ }: any) => ReactComponentElement<ComponentType> | null = ({
118
+ config: {
119
+ show,
120
+ text,
121
+ font: { bold, color, fontFamily, fontSize, italic, letterSpacing },
122
+ translate: { x: translateX, y: translateY },
123
+ align: { textAnchor } = defaultAlign,
124
+ },
125
+ }) => {
126
+ if (!show) return null;
127
+ return (
128
+ <text
129
+ className='__easyv-unit'
130
+ transform={'translate(' + translateX + ', ' + translateY + ')'}
131
+ fontFamily={fontFamily}
132
+ fontSize={fontSize}
133
+ fill={color}
134
+ fontWeight={bold ? 'bold' : 'normal'}
135
+ fontStyle={italic ? 'italic' : 'normal'}
136
+ letterSpacing={letterSpacing}
137
+ textAnchor={textAnchor}
138
+ >
139
+ {text}
140
+ </text>
141
+ );
142
+ };
143
+
144
+ type LabelType = {
145
+ className: string;
146
+ orientation: Orientation;
147
+ label: string;
148
+ coordinate: number;
149
+ formatter: Function;
150
+ tickSize: number;
151
+ rotate: number;
152
+ onClick?: MouseEventHandler;
153
+ config: {
154
+ show: boolean;
155
+ translate: Translate;
156
+ font: Font;
157
+ style: CSSProperties | Function;
158
+ };
159
+ };
160
+
161
+ const Label: (
162
+ props: LabelType
163
+ ) => ReactComponentElement<ComponentType> | null = ({
164
+ className,
165
+ orientation = defaultOrientation,
166
+ label,
167
+ coordinate,
168
+ formatter = defaultFormatter,
169
+ tickSize,
170
+ rotate = 0,
171
+ config,
172
+ onClick = defaultEvent,
173
+ config: {
174
+ show,
175
+ style,
176
+ translate: { x: translateX, y: translateY },
177
+ font: { fontFamily, fontSize, color, bold, italic, letterSpacing },
178
+ },
179
+ }) => {
180
+ if (!show) return null;
181
+ const _label = formatter(label, config);
182
+ const { dominantBaseline, textAnchor, directionX, directionY } = getLayout(
183
+ orientation,
184
+ rotate
185
+ );
186
+ const isVertical = orientation == 'left' || orientation == 'right';
187
+
188
+ const x =
189
+ (isVertical ? tickSize * directionX : coordinate) + translateX * directionX;
190
+ const y =
191
+ (isVertical ? coordinate : tickSize * directionY) + translateY * directionY;
192
+
193
+ const translateText = 'translate(' + x + ', ' + y + ')';
194
+
195
+ const _style = style && (typeof style == 'object' ? style : style(_label));
196
+
197
+ return (
198
+ <text
199
+ className={className}
200
+ style={{
201
+ ..._style,
202
+ whiteSpace: 'pre',
203
+ }}
204
+ onClick={onClick}
205
+ data-data={JSON.stringify({ x: label })}
206
+ dominantBaseline={dominantBaseline}
207
+ textAnchor={textAnchor}
208
+ fontFamily={fontFamily}
209
+ fontSize={fontSize}
210
+ fill={color}
211
+ fontWeight={bold ? 'bold' : 'normal'}
212
+ fontStyle={italic ? 'italic' : 'normal'}
213
+ letterSpacing={letterSpacing}
214
+ dx='0'
215
+ dy='0'
216
+ transform={
217
+ Array.isArray(_label)
218
+ ? rotate !== 0
219
+ ? isVertical
220
+ ? translateText + 'rotate(' + rotate + ')'
221
+ : 'rotate(' + rotate + ', ' + x + ', ' + y + ')'
222
+ : isVertical
223
+ ? translateText
224
+ : 'translate(' + translateX + ', ' + translateY + ')'
225
+ : translateText + 'rotate(' + rotate + ')'
226
+ }
227
+ >
228
+ {!!Array.isArray(_label)
229
+ ? _label.map((item, index) => (
230
+ <tspan key={index} x={x} dy='1em'>
231
+ {item}
232
+ </tspan>
233
+ ))
234
+ : _label}
235
+ </text>
236
+ );
237
+ };
238
+
239
+ export default memo(
240
+ ({
241
+ orientation,
242
+ scaler,
243
+ tickSize = defaultTickSize,
244
+ ticks,
245
+ formatter,
246
+ rotate,
247
+ triggerClick,
248
+ config: { on, label, axisLine, tickLine, gridLine, unit },
249
+ positions,
250
+ }: any) => {
251
+ if (!(on && ticks.length > 0)) return null;
252
+ const { width, height } = useContext(chartContext);
253
+ const x = orientation == 'right' ? width : 0;
254
+ const y = orientation == 'bottom' ? height : 0;
255
+
256
+ return (
257
+ <>
258
+ {axisLine && tickLine && (
259
+ <>
260
+ {axisLine &&
261
+ (positions && positions.length ? (
262
+ positions.map(({ x, y }: any, index: number) => (
263
+ <g key={index} transform={'translate(' + x + ', ' + y + ')'}>
264
+ <AxisLine orientation={orientation} config={axisLine} />
265
+ {tickLine &&
266
+ ticks.map((tick: string, index: number) => {
267
+ const coordinate = scaler(tick);
268
+ if (isNaN(coordinate)) return null;
269
+ const _tickSize = tickLine.tickSize || tickSize;
270
+ return (
271
+ <Line
272
+ className='__easyv-tickLine'
273
+ key={index}
274
+ config={tickLine}
275
+ {...getTickCoord({
276
+ orientation,
277
+ coordinate,
278
+ tickSize: _tickSize,
279
+ })}
280
+ />
281
+ );
282
+ })}
283
+ </g>
284
+ ))
285
+ ) : (
286
+ <g transform={'translate(' + x + ', ' + y + ')'}>
287
+ <AxisLine orientation={orientation} config={axisLine} />
288
+ {tickLine &&
289
+ ticks.map((tick: string, index: number) => {
290
+ const coordinate = scaler(tick);
291
+ if (isNaN(coordinate)) return null;
292
+ const _tickSize = tickLine.tickSize || tickSize;
293
+ return (
294
+ <Line
295
+ className='__easyv-tickLine'
296
+ key={index}
297
+ config={tickLine}
298
+ {...getTickCoord({
299
+ orientation,
300
+ coordinate,
301
+ tickSize: _tickSize,
302
+ })}
303
+ />
304
+ );
305
+ })}
306
+ </g>
307
+ ))}
308
+ </>
309
+ )}
310
+ <g transform={'translate(' + x + ', ' + y + ')'}>
311
+ {label &&
312
+ gridLine &&
313
+ ticks.map((tick: string, index: number) => {
314
+ const coordinate = scaler(tick);
315
+ if (isNaN(coordinate)) return null;
316
+ const _tickSize = tickLine.tickSize || tickSize;
317
+ return (
318
+ <g key={index}>
319
+ {label && (
320
+ <Label
321
+ className='__easyv-label'
322
+ orientation={orientation}
323
+ coordinate={coordinate}
324
+ config={label}
325
+ label={tick}
326
+ tickSize={_tickSize}
327
+ formatter={formatter}
328
+ rotate={rotate}
329
+ onClick={triggerClick}
330
+ />
331
+ )}
332
+ {gridLine && (
333
+ <Line
334
+ className='__easyv-gridLine'
335
+ config={gridLine}
336
+ {...getGridCoord({
337
+ orientation,
338
+ coordinate,
339
+ end:
340
+ orientation == 'left' || orientation == 'right'
341
+ ? width
342
+ : height,
343
+ })}
344
+ />
345
+ )}
346
+ </g>
347
+ );
348
+ })}
349
+ {unit && <Unit config={unit} />}
350
+ </g>
351
+ </>
352
+ );
353
+ }
354
+ );