@easyv/charts 1.0.57 → 1.0.58

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.
@@ -806,9 +806,46 @@ var Label = function Label(_ref10) {
806
806
  arcs = _ref10.arcs,
807
807
  animation = _ref10.animation;
808
808
 
809
+ // const [labels, setLabels] = useState(null);
810
+ // const [opacity, setOpacity] = useState(0);
809
811
  var _arcs = (0, _react.useMemo)(function () {
810
812
  return (0, _utils.getDataWithPercent)(arcs, precision);
811
- }, [arcs, precision]);
813
+ }, [arcs, precision]); // useEffect(() => {
814
+ // if (labels) {
815
+ // const children = [...labels.children];
816
+ // const bbox = children.reduce(
817
+ // (prev, current) => {
818
+ // const { topRight, bottomRight, bottomLeft, topLeft } = prev;
819
+ // const { x, y, height } = current.getBBox();
820
+ // current._y1 = y;
821
+ // current._y2 = y + height;
822
+ // current._delta = 0;
823
+ // if (x > 0) {
824
+ // if (y > 0) {
825
+ // bottomRight.push(current);
826
+ // } else {
827
+ // topRight.push(current);
828
+ // }
829
+ // } else {
830
+ // if (y > 0) {
831
+ // bottomLeft.push(current);
832
+ // } else {
833
+ // topLeft.push(current);
834
+ // }
835
+ // }
836
+ // return prev;
837
+ // },
838
+ // {
839
+ // topRight: [],
840
+ // bottomRight: [],
841
+ // bottomLeft: [],
842
+ // topLeft: [],
843
+ // }
844
+ // );
845
+ // console.log('bbox: ', bbox);
846
+ // }
847
+ // }, [labels]);
848
+
812
849
 
813
850
  return /*#__PURE__*/_react["default"].createElement("g", null, _arcs.map(function (_ref11, index) {
814
851
  var _ref11$series$color = _ref11.series.color,
@@ -58,9 +58,11 @@ var pieLegendFormatter = function pieLegendFormatter(_ref, _ref2) {
58
58
  }), /*#__PURE__*/React.createElement("span", {
59
59
  className: showName && showValue && showPercent ? _indexModule["default"].showAllStyle : _indexModule["default"].notShowAllStyle
60
60
  }, showName && /*#__PURE__*/React.createElement("span", {
61
- style: _objectSpread({
61
+ style: _objectSpread(_objectSpread({
62
62
  paddingLeft: 5
63
- }, (0, _utils.getFontStyle)(nameFont))
63
+ }, (0, _utils.getFontStyle)(nameFont)), {}, {
64
+ whiteSpace: "nowrap"
65
+ })
64
66
  }, displayName), showValue && /*#__PURE__*/React.createElement("span", {
65
67
  style: _objectSpread(_objectSpread({}, (0, _utils.getFontStyle)(valueFont)), {}, {
66
68
  marginLeft: valueGap,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@easyv/charts",
3
- "version": "1.0.57",
3
+ "version": "1.0.58",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
@@ -42,7 +42,7 @@ export const pieLegendFormatter = (
42
42
  }
43
43
  >
44
44
  {showName && (
45
- <span style={{ paddingLeft: 5, ...getFontStyle(nameFont) }}>
45
+ <span style={{ paddingLeft: 5, ...getFontStyle(nameFont), whiteSpace:"nowrap" }}>
46
46
  {displayName}
47
47
  </span>
48
48
  )}