@easyv/charts 1.10.7 → 1.10.8
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.
|
@@ -607,7 +607,7 @@ var Chart = /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
|
607
607
|
}, /*#__PURE__*/_react["default"].createElement("rect", {
|
|
608
608
|
x: clipX,
|
|
609
609
|
y: -marginTop,
|
|
610
|
-
width:
|
|
610
|
+
width: bodyWidth,
|
|
611
611
|
height: yLineRange + marginTop,
|
|
612
612
|
fill: "transparent"
|
|
613
613
|
}))), /*#__PURE__*/_react["default"].createElement("g", {
|
package/lib/components/Legend.js
CHANGED
|
@@ -289,28 +289,28 @@ var getPosition = function getPosition(position, alignment) {
|
|
|
289
289
|
switch (position) {
|
|
290
290
|
case "top":
|
|
291
291
|
return {
|
|
292
|
-
left: alignment == "left" ?
|
|
293
|
-
right: alignment == "right" ?
|
|
292
|
+
left: alignment == "left" ? 0 : alignment == "center" ? "50%" : "",
|
|
293
|
+
right: alignment == "right" ? 0 : "",
|
|
294
294
|
top: 5,
|
|
295
295
|
transform: "translate3d(calc(".concat(alignment == "center" ? "-50%" : "0px", " + ").concat(x, "px), ").concat(y, "px, 0px)")
|
|
296
296
|
};
|
|
297
297
|
case "right":
|
|
298
298
|
return {
|
|
299
299
|
top: "50%",
|
|
300
|
-
right:
|
|
300
|
+
right: 0,
|
|
301
301
|
transform: "translate3d(".concat(x, "px, calc(-50% + ").concat(y, "px), 0px)")
|
|
302
302
|
};
|
|
303
303
|
case "left":
|
|
304
304
|
return {
|
|
305
305
|
top: "50%",
|
|
306
|
-
left:
|
|
306
|
+
left: 0,
|
|
307
307
|
transform: "translate3d(".concat(x, "px, calc(-50% + ").concat(y, "px), 0px)")
|
|
308
308
|
};
|
|
309
309
|
default:
|
|
310
310
|
// bottom
|
|
311
311
|
return {
|
|
312
|
-
left: alignment == "left" ?
|
|
313
|
-
right: alignment == "right" ?
|
|
312
|
+
left: alignment == "left" ? 0 : alignment == "center" ? "50%" : "",
|
|
313
|
+
right: alignment == "right" ? 0 : "",
|
|
314
314
|
bottom: 5,
|
|
315
315
|
transform: "translate3d(calc(".concat(alignment == "center" ? "-50%" : "0px", " + ").concat(x, "px), ").concat(y, "px, 0px)")
|
|
316
316
|
};
|
package/package.json
CHANGED
package/src/components/Legend.js
CHANGED
|
@@ -94,7 +94,7 @@ export default memo(
|
|
|
94
94
|
filterData && interactive && filterData(fieldName || name);
|
|
95
95
|
pieClick && pieClick(e);
|
|
96
96
|
},
|
|
97
|
-
[interactive, filterData, pieClick]
|
|
97
|
+
[interactive, filterData, pieClick],
|
|
98
98
|
);
|
|
99
99
|
|
|
100
100
|
if (judge == 0) {
|
|
@@ -123,10 +123,10 @@ export default memo(
|
|
|
123
123
|
getCanvasTextWidth(
|
|
124
124
|
getValueStr(item),
|
|
125
125
|
valueFont.letterSpacing || 0,
|
|
126
|
-
`${valueFont.fontSize || 12}px ${valueFont.fontFamily || "Arial"}
|
|
127
|
-
)
|
|
128
|
-
)
|
|
129
|
-
)
|
|
126
|
+
`${valueFont.fontSize || 12}px ${valueFont.fontFamily || "Arial"}`,
|
|
127
|
+
),
|
|
128
|
+
),
|
|
129
|
+
),
|
|
130
130
|
);
|
|
131
131
|
const percentMaxWidth = Math.max(
|
|
132
132
|
..._series.map((item) => {
|
|
@@ -139,10 +139,10 @@ export default memo(
|
|
|
139
139
|
percentFont.letterSpacing || 0,
|
|
140
140
|
`${percentFont.fontSize || 12}px ${
|
|
141
141
|
percentFont.fontFamily || "Arial"
|
|
142
|
-
}
|
|
143
|
-
)
|
|
142
|
+
}`,
|
|
143
|
+
),
|
|
144
144
|
);
|
|
145
|
-
})
|
|
145
|
+
}),
|
|
146
146
|
);
|
|
147
147
|
const nameMaxWidth = config.name?.maxWidth || 80;
|
|
148
148
|
|
|
@@ -157,10 +157,10 @@ export default memo(
|
|
|
157
157
|
? "flex-start"
|
|
158
158
|
: "flex-end"
|
|
159
159
|
: alignment.split(" ")[0] == "left"
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
160
|
+
? "flex-start"
|
|
161
|
+
: alignment.split(" ")[0] == "center"
|
|
162
|
+
? "center"
|
|
163
|
+
: "flex-end",
|
|
164
164
|
flexDirection: "column",
|
|
165
165
|
position: "absolute",
|
|
166
166
|
...getPosition(position, _alignment, x, y),
|
|
@@ -179,10 +179,10 @@ export default memo(
|
|
|
179
179
|
? "flex-start"
|
|
180
180
|
: "flex-end"
|
|
181
181
|
: alignment.split(" ")[0] == "left"
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
182
|
+
? "flex-start"
|
|
183
|
+
: alignment.split(" ")[0] == "center"
|
|
184
|
+
? "center"
|
|
185
|
+
: "flex-end",
|
|
186
186
|
flexDirection: "column",
|
|
187
187
|
position: "absolute",
|
|
188
188
|
...getPosition(position, _alignment, x, y),
|
|
@@ -280,8 +280,8 @@ export default memo(
|
|
|
280
280
|
alignment.split(" ")[0] == "left"
|
|
281
281
|
? "flex-start"
|
|
282
282
|
: alignment.split(" ")[0] == "center"
|
|
283
|
-
|
|
284
|
-
|
|
283
|
+
? "center"
|
|
284
|
+
: "flex-end",
|
|
285
285
|
marginBottom: "0px",
|
|
286
286
|
gap: `${gridRowGap}px ${gridColumnGap}px`,
|
|
287
287
|
marginBottom: gridRowGap + "px",
|
|
@@ -337,7 +337,7 @@ export default memo(
|
|
|
337
337
|
name.substring(0, 5)
|
|
338
338
|
: "",
|
|
339
339
|
font.letterSpacing,
|
|
340
|
-
`${font.fontSize}px ${font.fontFamily}
|
|
340
|
+
`${font.fontSize}px ${font.fontFamily}`,
|
|
341
341
|
),
|
|
342
342
|
}}
|
|
343
343
|
speed={speed}
|
|
@@ -349,19 +349,19 @@ export default memo(
|
|
|
349
349
|
}
|
|
350
350
|
})}
|
|
351
351
|
</ul>
|
|
352
|
-
)
|
|
352
|
+
),
|
|
353
353
|
)}
|
|
354
354
|
</div>
|
|
355
355
|
);
|
|
356
|
-
}
|
|
356
|
+
},
|
|
357
357
|
);
|
|
358
358
|
|
|
359
359
|
const getPosition = (position, alignment, x = 0, y = 0) => {
|
|
360
360
|
switch (position) {
|
|
361
361
|
case "top":
|
|
362
362
|
return {
|
|
363
|
-
left: alignment == "left" ?
|
|
364
|
-
right: alignment == "right" ?
|
|
363
|
+
left: alignment == "left" ? 0 : alignment == "center" ? "50%" : "",
|
|
364
|
+
right: alignment == "right" ? 0 : "",
|
|
365
365
|
top: 5,
|
|
366
366
|
transform: `translate3d(calc(${
|
|
367
367
|
alignment == "center" ? "-50%" : "0px"
|
|
@@ -370,19 +370,19 @@ const getPosition = (position, alignment, x = 0, y = 0) => {
|
|
|
370
370
|
case "right":
|
|
371
371
|
return {
|
|
372
372
|
top: "50%",
|
|
373
|
-
right:
|
|
373
|
+
right: 0,
|
|
374
374
|
transform: `translate3d(${x}px, calc(-50% + ${y}px), 0px)`,
|
|
375
375
|
};
|
|
376
376
|
case "left":
|
|
377
377
|
return {
|
|
378
378
|
top: "50%",
|
|
379
|
-
left:
|
|
379
|
+
left: 0,
|
|
380
380
|
transform: `translate3d(${x}px, calc(-50% + ${y}px), 0px)`,
|
|
381
381
|
};
|
|
382
382
|
default: // bottom
|
|
383
383
|
return {
|
|
384
|
-
left: alignment == "left" ?
|
|
385
|
-
right: alignment == "right" ?
|
|
384
|
+
left: alignment == "left" ? 0 : alignment == "center" ? "50%" : "",
|
|
385
|
+
right: alignment == "right" ? 0 : "",
|
|
386
386
|
bottom: 5,
|
|
387
387
|
transform: `translate3d(calc(${
|
|
388
388
|
alignment == "center" ? "-50%" : "0px"
|