@easyv/charts 1.0.74 → 1.0.75

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.
@@ -625,7 +625,8 @@ var Component = /*#__PURE__*/(0, _react.memo)(function (_ref5) {
625
625
  textAnchor: "middle",
626
626
  style: _objectSpread(_objectSpread({}, categoryTextStyle), {}, {
627
627
  fontWeight: categoryTextStyle.bold ? "bold" : "normal",
628
- fontStyle: categoryTextStyle.italic ? "italic" : "normal"
628
+ fontStyle: categoryTextStyle.italic ? "italic" : "normal",
629
+ pointerEvents: "none"
629
630
  }),
630
631
  fill: categoryTextStyle.color
631
632
  }, /*#__PURE__*/_react["default"].createElement("textPath", {
@@ -647,6 +648,8 @@ var Component = /*#__PURE__*/(0, _react.memo)(function (_ref5) {
647
648
  }
648
649
  }, /*#__PURE__*/_react["default"].createElement(Current, {
649
650
  config: current,
651
+ width: width,
652
+ height: height,
650
653
  data: _arcs,
651
654
  currentIndex: +currentIndex
652
655
  })))), decorate && /*#__PURE__*/_react["default"].createElement(_.ConicalGradient, {
@@ -691,6 +694,8 @@ var Current = function Current(_ref9) {
691
694
  _ref9$config$value$su2 = _ref9$config$value$su.translate,
692
695
  translateSuffixX = _ref9$config$value$su2.x,
693
696
  translateSuffixY = _ref9$config$value$su2.y,
697
+ width = _ref9.width,
698
+ height = _ref9.height,
694
699
  data = _ref9.data,
695
700
  currentIndex = _ref9.currentIndex;
696
701
 
@@ -720,20 +725,21 @@ var Current = function Current(_ref9) {
720
725
  nameList.push(nameTemp);
721
726
  var foreignStyle = {
722
727
  //foreignObject标签样式,
723
- width: "100%",
724
- height: "100%",
725
- transform: "translate(-50%,-50%)"
728
+ width: width,
729
+ height: height,
730
+ transform: "translate(-".concat(width / 2, "px,-").concat(height / 2, "px)"),
731
+ pointerEvents: "none"
726
732
  },
727
733
  boxStyle = {
728
734
  //弹性盒子样式,用于当前值的上下居中对齐等
729
- width: "100%",
730
- height: '100%',
735
+ width: width,
736
+ height: height,
731
737
  display: "flex",
732
738
  flexDirection: "column",
733
739
  justifyContent: "center",
734
740
  alignItems: "center"
735
741
  };
736
- return show && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("foreignObject", {
742
+ return show && /*#__PURE__*/_react["default"].createElement("foreignObject", {
737
743
  style: foreignStyle
738
744
  }, /*#__PURE__*/_react["default"].createElement("div", {
739
745
  style: boxStyle
@@ -767,7 +773,7 @@ var Current = function Current(_ref9) {
767
773
  }, (0, _utils.getFontStyle)(percentFont)), {}, {
768
774
  margin: gap / 2 + "px 0"
769
775
  })
770
- }, percent + '%'))));
776
+ }, percent + '%')));
771
777
  };
772
778
 
773
779
  var Label = function Label(_ref10) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@easyv/charts",
3
- "version": "1.0.74",
3
+ "version": "1.0.75",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
@@ -25,7 +25,7 @@
25
25
  "load-styles": "^2.0.0"
26
26
  },
27
27
  "dependencies": {
28
- "@easyv/utils": "^0.0.26",
28
+ "@easyv/utils": "^0.0.33",
29
29
  "d3v7": "npm:d3@^7.0.0",
30
30
  "popmotion": "^9.3.6",
31
31
  "react": "^17.0.2",
@@ -572,7 +572,8 @@ const Component = memo(
572
572
  style={{
573
573
  ...categoryTextStyle,
574
574
  fontWeight:categoryTextStyle.bold?"bold":"normal",
575
- fontStyle:categoryTextStyle.italic?"italic":"normal"
575
+ fontStyle:categoryTextStyle.italic?"italic":"normal",
576
+ pointerEvents:"none"
576
577
  }}
577
578
  fill={categoryTextStyle.color}
578
579
  >
@@ -599,9 +600,11 @@ const Component = memo(
599
600
  )}
600
601
  {label && <Label config={label} arcs={_arcs} />}
601
602
  {current && (
602
- <g fillOpacity={y} style={{transform:"rotate("+(-rotate_)+"deg)"}}>
603
+ <g fillOpacity={y} style={{ transform:"rotate("+(-rotate_)+"deg)" }}>
603
604
  <Current
604
605
  config={current}
606
+ width={width}
607
+ height={height}
605
608
  data={_arcs}
606
609
  currentIndex={+currentIndex}
607
610
  />
@@ -649,6 +652,8 @@ const Current = ({
649
652
  },
650
653
  },
651
654
  },
655
+ width,
656
+ height,
652
657
  data,
653
658
  currentIndex,
654
659
  }) => {
@@ -671,13 +676,14 @@ const Current = ({
671
676
  }
672
677
  nameList.push(nameTemp)
673
678
  let foreignStyle={ //foreignObject标签样式,
674
- width:"100%",
675
- height:"100%",
676
- transform:"translate(-50%,-50%)",
679
+ width,
680
+ height,
681
+ transform:`translate(-${width/2}px,-${height/2}px)`,
682
+ pointerEvents:"none"
677
683
  },
678
684
  boxStyle={ //弹性盒子样式,用于当前值的上下居中对齐等
679
- width:"100%",
680
- height:'100%',
685
+ width,
686
+ height,
681
687
  display:"flex",
682
688
  flexDirection:"column",
683
689
  justifyContent:"center",
@@ -686,59 +692,57 @@ const Current = ({
686
692
 
687
693
  return (
688
694
  show && (
689
- <>
690
- <foreignObject style={foreignStyle}>
691
- <div style={boxStyle}>
692
- { //类目名称
693
- showName && <div
694
- style={{
695
- ...getFontStyle(nameFont),
696
- margin:gap/2+"px 0",
697
- display:"flex",
698
- flexDirection:"column",
699
- alignItems:"center"
700
- }}>
701
- {
702
- nameList.map((d,i)=>{
703
- return <span key={i}>{d}</span>
704
- })
705
- }
706
- </div>
707
- }
708
- { //真实值
709
- showValue && <span
710
- style={{
711
- ...getFontStyle(valueFont),
712
- transform:"translate("+translateValueX+"px,"+translateValueY+"px)",
713
- margin:gap/2+"px 0"
714
- }}>
715
- {value}
716
- {showSuffix && text && (
717
- <span
718
- style={{
719
- transform:"translate("+translateSuffixX+"px,"+translateSuffixY+"px)",
720
- fontSize:fontSize
721
- }}
722
- >
723
- {text}
724
- </span>
725
- )}
726
- </span>
727
- }
728
- { //百分比值
729
- showPercent && <span
730
- style={{
731
- transform:"translate("+translatePercentX+"px,"+translatePercentY+"px)",
732
- ...getFontStyle(percentFont),
733
- margin:gap/2+"px 0"
734
- }}
735
- >
736
- {percent + '%'}
737
- </span>
738
- }
739
- </div>
740
- </foreignObject>
741
- </>
695
+ <foreignObject style={foreignStyle}>
696
+ <div style={boxStyle}>
697
+ { //类目名称
698
+ showName && <div
699
+ style={{
700
+ ...getFontStyle(nameFont),
701
+ margin:gap/2+"px 0",
702
+ display:"flex",
703
+ flexDirection:"column",
704
+ alignItems:"center"
705
+ }}>
706
+ {
707
+ nameList.map((d,i)=>{
708
+ return <span key={i}>{d}</span>
709
+ })
710
+ }
711
+ </div>
712
+ }
713
+ { //真实值
714
+ showValue && <span
715
+ style={{
716
+ ...getFontStyle(valueFont),
717
+ transform:"translate("+translateValueX+"px,"+translateValueY+"px)",
718
+ margin:gap/2+"px 0"
719
+ }}>
720
+ {value}
721
+ {showSuffix && text && (
722
+ <span
723
+ style={{
724
+ transform:"translate("+translateSuffixX+"px,"+translateSuffixY+"px)",
725
+ fontSize:fontSize
726
+ }}
727
+ >
728
+ {text}
729
+ </span>
730
+ )}
731
+ </span>
732
+ }
733
+ { //百分比值
734
+ showPercent && <span
735
+ style={{
736
+ transform:"translate("+translatePercentX+"px,"+translatePercentY+"px)",
737
+ ...getFontStyle(percentFont),
738
+ margin:gap/2+"px 0"
739
+ }}
740
+ >
741
+ {percent + '%'}
742
+ </span>
743
+ }
744
+ </div>
745
+ </foreignObject>
742
746
  )
743
747
  );
744
748
  };