@easyv/charts 1.10.11 → 1.10.12

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.
@@ -281,6 +281,7 @@ var Label = function Label(_ref5) {
281
281
  position: "relative",
282
282
  // 替换 absolute
283
283
  cursor: "pointer",
284
+ display: !adaptive ? "inline-block" : "block",
284
285
  transform: "translate(".concat(x + (isIOS ? iosX : 0), "px, ").concat(y + (isIOS ? iosY : 0), "px)") // 用 transform 定位
285
286
  })
286
287
  }, !adaptive ? /*#__PURE__*/_react["default"].createElement(_TextOverflow["default"], {
@@ -43,7 +43,7 @@ var _default = exports["default"] = /*#__PURE__*/(0, _react.memo)(/*#__PURE__*/(
43
43
  onMouseMove: onMouseMove,
44
44
  ref: ref,
45
45
  style: _objectSpread({
46
- overflow: "hidden",
46
+ overflow: "visible",
47
47
  position: "absolute",
48
48
  width: width,
49
49
  height: height
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@easyv/charts",
3
- "version": "1.10.11",
3
+ "version": "1.10.12",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
@@ -32,7 +32,7 @@ const getCanvasContext = (): CanvasRenderingContext2D => {
32
32
  export const calculateTextWidth = (
33
33
  text: string,
34
34
  fontConfig: any,
35
- isVertical: any
35
+ isVertical: any,
36
36
  ): number => {
37
37
  if (!text) return 0;
38
38
  const ctx = getCanvasContext();
@@ -82,14 +82,14 @@ const defaultOrientation = "bottom";
82
82
  const defaultTickSize = 6;
83
83
  const defaultFormatter: (
84
84
  d: string,
85
- { suffix }: { suffix: string }
85
+ { suffix }: { suffix: string },
86
86
  ) => string = (d, { suffix }) => d + suffix;
87
87
 
88
88
  const getAxesPath: (
89
89
  orientation: Orientation,
90
90
  { width, height }: Context,
91
91
  cHeight: number,
92
- cPercent: number
92
+ cPercent: number,
93
93
  ) => string = (orientation, { width, height }, cHeight, cPercent) => {
94
94
  switch (orientation) {
95
95
  case "top":
@@ -112,7 +112,7 @@ const getAxesPath: (
112
112
  */
113
113
  const getLayout: (
114
114
  orientation: Orientation,
115
- rotate: number
115
+ rotate: number,
116
116
  ) => {
117
117
  transform: string;
118
118
  directionX: number;
@@ -253,7 +253,7 @@ function maxLabelFT(
253
253
  config: any,
254
254
  formatter: any,
255
255
  font: any,
256
- isVertical: any
256
+ isVertical: any,
257
257
  ) {
258
258
  let max = 0;
259
259
  data.length
@@ -265,7 +265,7 @@ function maxLabelFT(
265
265
  format: { type: config.format, showType: config.showType },
266
266
  }),
267
267
  font,
268
- isVertical
268
+ isVertical,
269
269
  ) > max
270
270
  )
271
271
  max = calculateTextWidth(
@@ -274,14 +274,14 @@ function maxLabelFT(
274
274
  format: { type: config.format, showType: config.showType },
275
275
  }),
276
276
  font,
277
- isVertical
277
+ isVertical,
278
278
  );
279
279
  })
280
280
  : "";
281
281
  return max;
282
282
  }
283
283
  const Label: (
284
- props: LabelType
284
+ props: LabelType,
285
285
  ) => ReactComponentElement<ComponentType> | null = ({
286
286
  className,
287
287
  orientation = defaultOrientation,
@@ -311,7 +311,7 @@ const Label: (
311
311
  });
312
312
  const { transform, directionX, directionY } = getLayout(
313
313
  orientation,
314
- adaptive ? 0 : rotate
314
+ adaptive ? 0 : rotate,
315
315
  );
316
316
  const isVertical = orientation == "left" || orientation == "right";
317
317
 
@@ -339,6 +339,7 @@ const Label: (
339
339
  ...getFontStyle(font),
340
340
  position: "relative", // 替换 absolute
341
341
  cursor: "pointer",
342
+ display: !adaptive ? "inline-block" : "block",
342
343
  transform: `translate(${x + (isIOS ? iosX : 0)}px, ${
343
344
  y + (isIOS ? iosY : 0)
344
345
  }px)`, // 用 transform 定位
@@ -358,8 +359,8 @@ const Label: (
358
359
  textAlign == "left"
359
360
  ? "flex-start"
360
361
  : textAlign == "right"
361
- ? "flex-end"
362
- : "center",
362
+ ? "flex-end"
363
+ : "center",
363
364
  }}
364
365
  ></TextOverflow>
365
366
  ) : (
@@ -409,7 +410,7 @@ export default memo(
409
410
  rawTicks,
410
411
  paddingOuter,
411
412
  }: any,
412
- ref
413
+ ref,
413
414
  ) => {
414
415
  const { width, height, isIOS } = useContext(chartContext);
415
416
  const { cHeight, isC, cPercent } = controlInfo;
@@ -426,13 +427,13 @@ export default memo(
426
427
  label,
427
428
  formatter,
428
429
  label.font,
429
- isVertical
430
+ isVertical,
430
431
  );
431
432
  }
432
433
  }
433
434
  const LabelNum = !isVertical
434
435
  ? Math.floor(
435
- ((width / (isC ? cPercent : 1)) * (1 - paddingOuter)) / LabelWidth
436
+ ((width / (isC ? cPercent : 1)) * (1 - paddingOuter)) / LabelWidth,
436
437
  )
437
438
  : Math.floor(height / LabelWidth);
438
439
 
@@ -445,7 +446,7 @@ export default memo(
445
446
  ? Math.ceil(allTicks.length / 2)
446
447
  : LabelNum
447
448
  : allTicks.length,
448
- label.showLast
449
+ label.showLast,
449
450
  );
450
451
  if (!(on && ticks.length > 0)) return null;
451
452
 
@@ -453,7 +454,7 @@ export default memo(
453
454
  function getEvenlySpacedElements(
454
455
  arr: any[],
455
456
  expectCount: number,
456
- acc: boolean = false
457
+ acc: boolean = false,
457
458
  ): any[] {
458
459
  if (!arr.length || expectCount <= 0) return [];
459
460
  if (expectCount >= arr.length) return [...arr];
@@ -732,6 +733,6 @@ export default memo(
732
733
  </svg>
733
734
  </g>
734
735
  );
735
- }
736
- )
736
+ },
737
+ ),
737
738
  );
@@ -54,7 +54,7 @@ export default memo(
54
54
  onMouseMove={onMouseMove}
55
55
  ref={ref}
56
56
  style={{
57
- overflow: "hidden",
57
+ overflow: "visible",
58
58
  position: "absolute",
59
59
  width,
60
60
  height,