@easyv/charts 1.3.1 → 1.3.2

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 (70) hide show
  1. package/.babelrc +8 -8
  2. package/.husky/commit-msg +3 -3
  3. package/CHANGELOG.md +18 -18
  4. package/lib/components/Axis.js +10 -10
  5. package/lib/components/Background.js +2 -2
  6. package/lib/components/Carousel.js +2 -2
  7. package/lib/components/Chart.js +2 -1
  8. package/lib/components/ConicalGradient.js +21 -21
  9. package/lib/components/Indicator.js +2 -2
  10. package/lib/components/Lighter.js +179 -179
  11. package/lib/components/LinearGradient.js +2 -2
  12. package/lib/components/Marquee.js +3 -3
  13. package/lib/components/TextOverflow.js +3 -3
  14. package/lib/css/index.module.css +41 -41
  15. package/lib/css/piechart.module.css +26 -26
  16. package/lib/element/ConicGradient.js +72 -72
  17. package/lib/hooks/useAnimateData.js +5 -5
  18. package/lib/hooks/useAxes.js +5 -5
  19. package/lib/hooks/useCarouselAxisX.js +5 -5
  20. package/lib/hooks/useExtentData.js +6 -6
  21. package/lib/hooks/useFilterData.js +5 -5
  22. package/lib/hooks/useStackData.js +5 -5
  23. package/lib/hooks/useTooltip.js +10 -10
  24. package/package.json +54 -54
  25. package/src/components/AnimateData.tsx +24 -24
  26. package/src/components/Axis.tsx +354 -354
  27. package/src/components/Background.tsx +62 -62
  28. package/src/components/Band.tsx +169 -169
  29. package/src/components/BaseLine.js +82 -82
  30. package/src/components/Brush.js +159 -159
  31. package/src/components/Carousel.tsx +144 -144
  32. package/src/components/Chart.js +99 -99
  33. package/src/components/ChartContainer.tsx +63 -63
  34. package/src/components/ConicalGradient.js +258 -258
  35. package/src/components/ExtentData.js +17 -17
  36. package/src/components/FilterData.js +23 -23
  37. package/src/components/Indicator.js +13 -13
  38. package/src/components/Label.js +225 -225
  39. package/src/components/Legend.js +158 -158
  40. package/src/components/Lighter.jsx +173 -173
  41. package/src/components/Line.js +145 -145
  42. package/src/components/LinearGradient.js +29 -29
  43. package/src/components/Mapping.js +71 -71
  44. package/src/components/Marquee.js +88 -88
  45. package/src/components/PieChart.js +1278 -1278
  46. package/src/components/StackData.js +16 -16
  47. package/src/components/StereoBar.tsx +307 -307
  48. package/src/components/TextOverflow.js +51 -51
  49. package/src/components/Tooltip.js +169 -169
  50. package/src/components/index.js +55 -55
  51. package/src/context/index.js +2 -2
  52. package/src/css/index.module.css +41 -41
  53. package/src/css/piechart.module.css +26 -26
  54. package/src/element/ConicGradient.jsx +55 -55
  55. package/src/element/Line.tsx +33 -33
  56. package/src/element/index.ts +3 -3
  57. package/src/formatter/index.js +1 -1
  58. package/src/formatter/legend.js +90 -90
  59. package/src/hooks/index.js +17 -17
  60. package/src/hooks/useAnimateData.ts +67 -67
  61. package/src/hooks/useAxes.js +144 -144
  62. package/src/hooks/useCarouselAxisX.js +163 -163
  63. package/src/hooks/useExtentData.js +89 -89
  64. package/src/hooks/useFilterData.js +72 -72
  65. package/src/hooks/useStackData.js +101 -101
  66. package/src/hooks/useTooltip.ts +96 -96
  67. package/src/index.js +6 -6
  68. package/src/types/index.d.ts +67 -67
  69. package/src/utils/index.js +738 -738
  70. package/tsconfig.json +23 -23
@@ -1,354 +1,354 @@
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
- );
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
+ );