@easyv/charts 1.8.25 → 1.8.27
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/Band.js +3 -3
- package/lib/components/CartesianChart.js +2 -1
- package/lib/components/Label.js +10 -7
- package/lib/components/Line.js +9 -4
- package/package.json +1 -1
- package/src/components/Band.tsx +3 -3
- package/src/components/CartesianChart.js +1 -0
- package/src/components/Label.js +5 -3
- package/src/components/Line.js +4 -1
package/lib/components/Band.js
CHANGED
|
@@ -243,10 +243,10 @@ var _default = exports["default"] = /*#__PURE__*/(0, _react.memo)(function (_ref
|
|
|
243
243
|
}
|
|
244
244
|
}, bgAttr, {
|
|
245
245
|
onClick: function onClick(e) {
|
|
246
|
-
return triggerEvents(e, "setCurrent");
|
|
246
|
+
return triggerEvents ? triggerEvents(e, "setCurrent") : "";
|
|
247
247
|
},
|
|
248
248
|
onMouseMove: function onMouseMove(e) {
|
|
249
|
-
return triggerEvents(e, "mouseenter");
|
|
249
|
+
return triggerEvents ? triggerEvents(e, "mouseenter") : "";
|
|
250
250
|
},
|
|
251
251
|
onMouseEnter: function onMouseEnter() {
|
|
252
252
|
if (isControlChart) {
|
|
@@ -269,7 +269,7 @@ var _default = exports["default"] = /*#__PURE__*/(0, _react.memo)(function (_ref
|
|
|
269
269
|
}
|
|
270
270
|
},
|
|
271
271
|
onMouseLeave: function onMouseLeave(e) {
|
|
272
|
-
triggerEvents(e, "mouseleave");
|
|
272
|
+
triggerEvents ? triggerEvents(e, "mouseleave") : "";
|
|
273
273
|
if (isControlChart && !auto) {
|
|
274
274
|
setCtlTip(function (pre) {
|
|
275
275
|
return {
|
|
@@ -638,7 +638,8 @@ var Chart = /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
|
638
638
|
bandLength: bandLength,
|
|
639
639
|
xAxis: axisX,
|
|
640
640
|
yAxis: yAxis,
|
|
641
|
-
triggerEvents: onInteraction
|
|
641
|
+
triggerEvents: onInteraction,
|
|
642
|
+
isControlChart: !!control
|
|
642
643
|
}));
|
|
643
644
|
}), /*#__PURE__*/_react["default"].createElement("g", null, control && zIndex != "bottom" && ctlIndicatorList.map(function (item, index) {
|
|
644
645
|
var x = axisX.scaler(item.tick);
|
package/lib/components/Label.js
CHANGED
|
@@ -65,14 +65,19 @@ var _default = exports["default"] = /*#__PURE__*/(0, _react.memo)(function (_ref
|
|
|
65
65
|
bandLength = _ref$bandLength === void 0 ? 0 : _ref$bandLength,
|
|
66
66
|
data = _ref.data,
|
|
67
67
|
_ref$xAxis = _ref.xAxis,
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
normalScaler = _ref$xAxis.scaler,
|
|
69
|
+
normalStep = _ref$xAxis.step,
|
|
70
70
|
direction = _ref$xAxis.direction,
|
|
71
|
+
controlStep = _ref$xAxis.controlStep,
|
|
72
|
+
controlDragScaler = _ref$xAxis.controlDragScaler,
|
|
71
73
|
_ref$yAxis = _ref.yAxis,
|
|
72
74
|
yScaler = _ref$yAxis.scaler,
|
|
73
75
|
isClipAxis = _ref$yAxis.isClipAxis,
|
|
74
76
|
clipValue = _ref$yAxis.clipValue,
|
|
75
|
-
triggerEvents = _ref.triggerEvents
|
|
77
|
+
triggerEvents = _ref.triggerEvents,
|
|
78
|
+
isControlChart = _ref.isControlChart;
|
|
79
|
+
var step = isControlChart ? controlStep : normalStep;
|
|
80
|
+
var xScaler = isControlChart ? controlDragScaler : normalScaler;
|
|
76
81
|
var selectConfig = other;
|
|
77
82
|
if (selectStyle) {
|
|
78
83
|
var show = selectStyle.show,
|
|
@@ -186,12 +191,10 @@ var _default = exports["default"] = /*#__PURE__*/(0, _react.memo)(function (_ref
|
|
|
186
191
|
return triggerEvents(e, "setCurrent");
|
|
187
192
|
},
|
|
188
193
|
onMouseMove: function onMouseMove(e) {
|
|
189
|
-
|
|
190
|
-
triggerEvents(e, "mouseenter");
|
|
194
|
+
return triggerEvents(e, "mouseenter");
|
|
191
195
|
},
|
|
192
196
|
onMouseLeave: function onMouseLeave(e) {
|
|
193
|
-
|
|
194
|
-
triggerEvents(e, "mouseleave");
|
|
197
|
+
return triggerEvents(e, "mouseleave");
|
|
195
198
|
},
|
|
196
199
|
style: {
|
|
197
200
|
cursor: "pointer"
|
package/lib/components/Line.js
CHANGED
|
@@ -47,7 +47,8 @@ var Area = function Area(_ref) {
|
|
|
47
47
|
curve = _ref$config.curve,
|
|
48
48
|
tension = _ref$config.tension,
|
|
49
49
|
xScaler = _ref.xScaler,
|
|
50
|
-
yScaler = _ref.yScaler
|
|
50
|
+
yScaler = _ref.yScaler,
|
|
51
|
+
Areaopacity = _ref.opacity;
|
|
51
52
|
var _yScaler$range = yScaler.range(),
|
|
52
53
|
_yScaler$range2 = (0, _slicedToArray2["default"])(_yScaler$range, 1),
|
|
53
54
|
height = _yScaler$range2[0];
|
|
@@ -72,7 +73,8 @@ var Area = function Area(_ref) {
|
|
|
72
73
|
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("path", {
|
|
73
74
|
d: areaGen(data),
|
|
74
75
|
style: {
|
|
75
|
-
pointerEvents: "none"
|
|
76
|
+
pointerEvents: "none",
|
|
77
|
+
opacity: Areaopacity
|
|
76
78
|
},
|
|
77
79
|
stroke: "none",
|
|
78
80
|
fill: 'url(#' + id + ')'
|
|
@@ -94,7 +96,9 @@ var Area = function Area(_ref) {
|
|
|
94
96
|
};
|
|
95
97
|
var _default = exports["default"] = /*#__PURE__*/(0, _react.memo)(function (_ref5) {
|
|
96
98
|
var type = _ref5.type,
|
|
97
|
-
_ref5$config
|
|
99
|
+
_ref5$config = _ref5.config,
|
|
100
|
+
areaColor = _ref5$config.areaColor,
|
|
101
|
+
_ref5$config$line = _ref5$config.line,
|
|
98
102
|
lineType = _ref5$config$line.type,
|
|
99
103
|
lineWidth = _ref5$config$line.lineWidth,
|
|
100
104
|
curve = _ref5$config$line.curve,
|
|
@@ -169,7 +173,8 @@ var _default = exports["default"] = /*#__PURE__*/(0, _react.memo)(function (_ref
|
|
|
169
173
|
tension: tension
|
|
170
174
|
}),
|
|
171
175
|
xScaler: xScaler,
|
|
172
|
-
yScaler: yScaler
|
|
176
|
+
yScaler: yScaler,
|
|
177
|
+
opacity: areaColor ? areaColor.linear.opacity : 1
|
|
173
178
|
}), showLighter && /*#__PURE__*/_react["default"].createElement(_.Lighter, {
|
|
174
179
|
path: path,
|
|
175
180
|
config: lighter
|
package/package.json
CHANGED
package/src/components/Band.tsx
CHANGED
|
@@ -232,8 +232,8 @@ export default memo(
|
|
|
232
232
|
cursor: "pointer",
|
|
233
233
|
}}
|
|
234
234
|
{...bgAttr}
|
|
235
|
-
onClick={(e) => triggerEvents(e, "setCurrent")}
|
|
236
|
-
onMouseMove={(e) => triggerEvents(e, "mouseenter")}
|
|
235
|
+
onClick={(e) => triggerEvents?triggerEvents(e, "setCurrent"):""}
|
|
236
|
+
onMouseMove={(e) => triggerEvents?triggerEvents(e, "mouseenter"):""}
|
|
237
237
|
onMouseEnter={() => {
|
|
238
238
|
if (isControlChart) {
|
|
239
239
|
setCtlTip((pre: any) => ({
|
|
@@ -251,7 +251,7 @@ export default memo(
|
|
|
251
251
|
}
|
|
252
252
|
}}
|
|
253
253
|
onMouseLeave={(e) => {
|
|
254
|
-
triggerEvents(e, "mouseleave");
|
|
254
|
+
triggerEvents?triggerEvents(e, "mouseleave"):"";
|
|
255
255
|
if (isControlChart && !auto) {
|
|
256
256
|
setCtlTip((pre: any) => ({
|
|
257
257
|
show: false,
|
package/src/components/Label.js
CHANGED
|
@@ -45,10 +45,13 @@ export default memo(
|
|
|
45
45
|
selectStyle,
|
|
46
46
|
bandLength = 0,
|
|
47
47
|
data,
|
|
48
|
-
xAxis: { scaler:
|
|
48
|
+
xAxis: { scaler: normalScaler, step:normalStep, direction,controlStep,controlDragScaler },
|
|
49
49
|
yAxis: { scaler: yScaler, isClipAxis, clipValue },
|
|
50
50
|
triggerEvents,
|
|
51
|
+
isControlChart
|
|
51
52
|
}) => {
|
|
53
|
+
const step = isControlChart ? controlStep : normalStep;
|
|
54
|
+
const xScaler = isControlChart ? controlDragScaler : normalScaler;
|
|
52
55
|
let selectConfig = other;
|
|
53
56
|
if (selectStyle) {
|
|
54
57
|
const { show, showType, icon, numlabel: label } = selectStyle;
|
|
@@ -117,8 +120,7 @@ export default memo(
|
|
|
117
120
|
}
|
|
118
121
|
|
|
119
122
|
// const y2 = yScaler(isVertical ? start : end);
|
|
120
|
-
const positionX =
|
|
121
|
-
xScaler(x) - step / 2 + seriesStart + index * seriesStep;
|
|
123
|
+
const positionX =xScaler(x)- step / 2+seriesStart+ index * seriesStep;
|
|
122
124
|
|
|
123
125
|
if (isNaN(positionX)) return null;
|
|
124
126
|
const position = isXRepeat
|
package/src/components/Line.js
CHANGED
|
@@ -34,6 +34,7 @@ const Area = ({
|
|
|
34
34
|
},
|
|
35
35
|
xScaler,
|
|
36
36
|
yScaler,
|
|
37
|
+
opacity:Areaopacity
|
|
37
38
|
}) => {
|
|
38
39
|
const [height] = yScaler.range();
|
|
39
40
|
const area = useMemo(() => getColorList(fill), [fill]);
|
|
@@ -51,7 +52,7 @@ const Area = ({
|
|
|
51
52
|
|
|
52
53
|
return (
|
|
53
54
|
<>
|
|
54
|
-
<path d={areaGen(data)} style={{pointerEvents:"none"}} stroke='none' fill={'url(#' + id + ')'} />
|
|
55
|
+
<path d={areaGen(data)} style={{pointerEvents:"none",opacity:Areaopacity}} stroke='none' fill={'url(#' + id + ')'} />
|
|
55
56
|
<defs>
|
|
56
57
|
{type && type == 'pattern' ? (
|
|
57
58
|
<pattern id={id} patternUnits="userSpaceOnUse" width={patternW} height={patternH}>
|
|
@@ -69,6 +70,7 @@ export default memo(
|
|
|
69
70
|
({
|
|
70
71
|
type,
|
|
71
72
|
config: {
|
|
73
|
+
areaColor,
|
|
72
74
|
line: {
|
|
73
75
|
type: lineType,
|
|
74
76
|
lineWidth,
|
|
@@ -144,6 +146,7 @@ export default memo(
|
|
|
144
146
|
config={{ ...area, curve, tension }}
|
|
145
147
|
xScaler={xScaler}
|
|
146
148
|
yScaler={yScaler}
|
|
149
|
+
opacity={areaColor?areaColor.linear.opacity:1}
|
|
147
150
|
/>
|
|
148
151
|
)}
|
|
149
152
|
{showLighter && <Lighter path={path} config={lighter} />}
|