@easyv/charts 1.7.28 → 1.7.30
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.
- package/lib/components/CartesianChart.js +4 -1
- package/lib/components/Legend.js +0 -1
- package/lib/components/PieChart.js +7 -2
- package/lib/components/Tooltip.js +2 -2
- package/package.json +2 -2
- package/src/components/CartesianChart.js +4 -1
- package/src/components/Indicator.js +0 -1
- package/src/components/PieChart.js +17 -15
- package/src/components/Tooltip.js +2 -2
|
@@ -173,6 +173,9 @@ var Chart = /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
|
173
173
|
document.removeEventListener("setCurrent_".concat(id), handleAction);
|
|
174
174
|
};
|
|
175
175
|
}, []);
|
|
176
|
+
(0, _react.useEffect)(function () {
|
|
177
|
+
setCtlTip(initCtlTip);
|
|
178
|
+
}, [JSON.stringify(axisX.ticks)]);
|
|
176
179
|
(0, _react.useEffect)(function () {
|
|
177
180
|
setCurXLabel(defaultSelected);
|
|
178
181
|
}, [defaultSelected]);
|
|
@@ -242,7 +245,7 @@ var Chart = /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
|
242
245
|
return tickName !== undefined && originData.filter(function (d) {
|
|
243
246
|
return d.x === tickName;
|
|
244
247
|
});
|
|
245
|
-
}, [tickName, originData]);
|
|
248
|
+
}, [tickName, JSON.stringify(originData)]);
|
|
246
249
|
var showTooltip = !!(tooltipData && tooltipData.length && (auto || manual));
|
|
247
250
|
var isVertical = axisX.direction === "vertical";
|
|
248
251
|
var indicatorWidth = indicator.width * (control ? axisX.controlStep : axisX.step) / 100;
|
package/lib/components/Legend.js
CHANGED
|
@@ -122,7 +122,6 @@ var _default = exports["default"] = /*#__PURE__*/(0, _react.memo)(function (_ref
|
|
|
122
122
|
d.percent = 0;
|
|
123
123
|
});
|
|
124
124
|
}
|
|
125
|
-
console.log("height", height);
|
|
126
125
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
127
126
|
className: "__easyv-legend-wrapper",
|
|
128
127
|
style: _objectSpread(_objectSpread({
|
|
@@ -760,7 +760,12 @@ var Component = /*#__PURE__*/(0, _react.memo)(function (_ref5) {
|
|
|
760
760
|
config: decorate,
|
|
761
761
|
arcs: _arcs,
|
|
762
762
|
radius: radius
|
|
763
|
-
}), tooltip && mousePos && mousePos.x != 0 && mousePos.y != 0 && tooltip.manual && /*#__PURE__*/_react["default"].createElement(
|
|
763
|
+
}), tooltip && mousePos && mousePos.x != 0 && mousePos.y != 0 && tooltip.manual && /*#__PURE__*/_react["default"].createElement("div", {
|
|
764
|
+
style: {
|
|
765
|
+
position: 'absolute',
|
|
766
|
+
zIndex: 9999
|
|
767
|
+
}
|
|
768
|
+
}, /*#__PURE__*/_react["default"].createElement(_PieTooltip.PieTooltip, {
|
|
764
769
|
series: series,
|
|
765
770
|
data: hoverData,
|
|
766
771
|
config: tooltip,
|
|
@@ -769,7 +774,7 @@ var Component = /*#__PURE__*/(0, _react.memo)(function (_ref5) {
|
|
|
769
774
|
y: maxRadius + marginTop
|
|
770
775
|
},
|
|
771
776
|
mousePos: mousePos
|
|
772
|
-
}), /*#__PURE__*/_react["default"].createElement(_.Legend, (0, _extends2["default"])({}, legend, {
|
|
777
|
+
})), /*#__PURE__*/_react["default"].createElement(_.Legend, (0, _extends2["default"])({}, legend, {
|
|
773
778
|
height: chartHeight,
|
|
774
779
|
series: _arcs.map(function (arc) {
|
|
775
780
|
return _objectSpread(_objectSpread({}, arc), {}, {
|
|
@@ -66,7 +66,7 @@ var _default = exports["default"] = /*#__PURE__*/(0, _react.memo)(function (_ref
|
|
|
66
66
|
}
|
|
67
67
|
return (0, _utils.getTranslate3d)(translate3d);
|
|
68
68
|
}, [width, height, marginLeft, marginTop, position, tipWidth, tipHeight, translateTip]);
|
|
69
|
-
return
|
|
69
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
70
70
|
className: "__easyv-tooltip",
|
|
71
71
|
style: _objectSpread({
|
|
72
72
|
pointerEvents: 'none',
|
|
@@ -154,5 +154,5 @@ var _default = exports["default"] = /*#__PURE__*/(0, _react.memo)(function (_ref
|
|
|
154
154
|
transform: (0, _utils.getTranslate3d)(suffixTranslate)
|
|
155
155
|
})
|
|
156
156
|
}, tmp.get(s))));
|
|
157
|
-
}))))
|
|
157
|
+
}))));
|
|
158
158
|
});
|
package/package.json
CHANGED
|
@@ -152,6 +152,9 @@ const Chart = memo(
|
|
|
152
152
|
document.removeEventListener(`setCurrent_${id}`,handleAction);
|
|
153
153
|
}
|
|
154
154
|
},[]);
|
|
155
|
+
useEffect(()=>{
|
|
156
|
+
setCtlTip(initCtlTip);
|
|
157
|
+
},[JSON.stringify(axisX.ticks)]);
|
|
155
158
|
useEffect(()=>{
|
|
156
159
|
setCurXLabel(defaultSelected);
|
|
157
160
|
},[defaultSelected]);
|
|
@@ -214,7 +217,7 @@ const Chart = memo(
|
|
|
214
217
|
const tooltipData = useMemo(
|
|
215
218
|
() =>
|
|
216
219
|
tickName !== undefined && originData.filter((d) => d.x === tickName),
|
|
217
|
-
[tickName, originData]
|
|
220
|
+
[tickName, JSON.stringify(originData)]
|
|
218
221
|
);
|
|
219
222
|
|
|
220
223
|
const showTooltip = !!(
|
|
@@ -855,21 +855,23 @@ const Component = memo(
|
|
|
855
855
|
/>
|
|
856
856
|
)}
|
|
857
857
|
{tooltip &&
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
858
|
+
mousePos &&
|
|
859
|
+
mousePos.x != 0 &&
|
|
860
|
+
mousePos.y != 0 &&
|
|
861
|
+
tooltip.manual && (
|
|
862
|
+
<div style={{ position: 'absolute', zIndex: 9999 }}>
|
|
863
|
+
<PieTooltip
|
|
864
|
+
series={series}
|
|
865
|
+
data={hoverData}
|
|
866
|
+
config={tooltip}
|
|
867
|
+
pieCenter={{
|
|
868
|
+
x: halfChartWidth,
|
|
869
|
+
y: maxRadius + marginTop,
|
|
870
|
+
}}
|
|
871
|
+
mousePos={mousePos}
|
|
872
|
+
/>
|
|
873
|
+
</div>
|
|
874
|
+
)}
|
|
873
875
|
<Legend
|
|
874
876
|
{...legend}
|
|
875
877
|
height={chartHeight}
|
|
@@ -63,7 +63,7 @@ export default memo(
|
|
|
63
63
|
tipHeight,
|
|
64
64
|
translateTip,
|
|
65
65
|
]);
|
|
66
|
-
return
|
|
66
|
+
return (
|
|
67
67
|
<div
|
|
68
68
|
className='__easyv-tooltip'
|
|
69
69
|
style={{
|
|
@@ -176,6 +176,6 @@ export default memo(
|
|
|
176
176
|
</div>
|
|
177
177
|
)}
|
|
178
178
|
</div>
|
|
179
|
-
)
|
|
179
|
+
);
|
|
180
180
|
}
|
|
181
181
|
);
|