@easyv/charts 1.7.27 → 1.7.29
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 +2 -1
- package/lib/components/PieChart.js +2 -0
- 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/Legend.js +2 -1
- package/src/components/PieChart.js +2 -0
- 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
|
@@ -26,6 +26,7 @@ var defaultFont = {
|
|
|
26
26
|
};
|
|
27
27
|
var _default = exports["default"] = /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
28
28
|
var series = _ref.series,
|
|
29
|
+
height = _ref.height,
|
|
29
30
|
config = _ref.config,
|
|
30
31
|
_ref$config = _ref.config,
|
|
31
32
|
show = _ref$config.show,
|
|
@@ -127,7 +128,7 @@ var _default = exports["default"] = /*#__PURE__*/(0, _react.memo)(function (_ref
|
|
|
127
128
|
position: 'absolute',
|
|
128
129
|
display: 'flex'
|
|
129
130
|
}, getPosition(position, _alignment, x, y)), {}, {
|
|
130
|
-
height: loop.show ?
|
|
131
|
+
height: loop.show ? height : 'auto',
|
|
131
132
|
overflowY: loop.show ? 'scroll' : 'auto'
|
|
132
133
|
}),
|
|
133
134
|
ref: ref_container
|
|
@@ -611,6 +611,7 @@ var Component = /*#__PURE__*/(0, _react.memo)(function (_ref5) {
|
|
|
611
611
|
},
|
|
612
612
|
mousePos: mousePos
|
|
613
613
|
}), /*#__PURE__*/_react["default"].createElement(_.Legend, (0, _extends2["default"])({}, legend, {
|
|
614
|
+
height: chartHeight,
|
|
614
615
|
series: _arcs.map(function (arc) {
|
|
615
616
|
return _objectSpread(_objectSpread({}, arc), {}, {
|
|
616
617
|
percent: arc.percent.toFixed(legendPrecision)
|
|
@@ -769,6 +770,7 @@ var Component = /*#__PURE__*/(0, _react.memo)(function (_ref5) {
|
|
|
769
770
|
},
|
|
770
771
|
mousePos: mousePos
|
|
771
772
|
}), /*#__PURE__*/_react["default"].createElement(_.Legend, (0, _extends2["default"])({}, legend, {
|
|
773
|
+
height: chartHeight,
|
|
772
774
|
series: _arcs.map(function (arc) {
|
|
773
775
|
return _objectSpread(_objectSpread({}, arc), {}, {
|
|
774
776
|
percent: arc.percent.toFixed(legendPrecision)
|
|
@@ -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 = !!(
|
package/src/components/Legend.js
CHANGED
|
@@ -13,6 +13,7 @@ const defaultFont = {
|
|
|
13
13
|
export default memo(
|
|
14
14
|
({
|
|
15
15
|
series,
|
|
16
|
+
height,
|
|
16
17
|
config,
|
|
17
18
|
config: {
|
|
18
19
|
show,
|
|
@@ -105,7 +106,7 @@ export default memo(
|
|
|
105
106
|
position: 'absolute',
|
|
106
107
|
display: 'flex',
|
|
107
108
|
...getPosition(position, _alignment, x, y),
|
|
108
|
-
height: loop.show ?
|
|
109
|
+
height: loop.show ? height : 'auto',
|
|
109
110
|
overflowY: loop.show ? 'scroll' : 'auto',
|
|
110
111
|
}}
|
|
111
112
|
ref={ref_container}
|
|
@@ -628,6 +628,7 @@ const Component = memo(
|
|
|
628
628
|
)}
|
|
629
629
|
<Legend
|
|
630
630
|
{...legend}
|
|
631
|
+
height={chartHeight}
|
|
631
632
|
series={_arcs.map((arc) => ({
|
|
632
633
|
...arc,
|
|
633
634
|
percent: arc.percent.toFixed(legendPrecision),
|
|
@@ -871,6 +872,7 @@ const Component = memo(
|
|
|
871
872
|
)}
|
|
872
873
|
<Legend
|
|
873
874
|
{...legend}
|
|
875
|
+
height={chartHeight}
|
|
874
876
|
series={_arcs.map((arc) => ({
|
|
875
877
|
...arc,
|
|
876
878
|
percent: arc.percent.toFixed(legendPrecision),
|
|
@@ -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
|
);
|