@easyv/charts 1.6.21 → 1.6.22
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/Label.js +63 -60
- package/package.json +1 -1
- package/src/components/Label.js +1 -1
package/lib/components/Label.js
CHANGED
|
@@ -96,8 +96,11 @@ var _default = exports["default"] = /*#__PURE__*/(0, _react.memo)(function (_ref
|
|
|
96
96
|
label = _ref3.label;
|
|
97
97
|
var showIcon = icon && icon.show;
|
|
98
98
|
var showLabel = label && label.show;
|
|
99
|
-
var
|
|
100
|
-
|
|
99
|
+
var _ref4 = label || {},
|
|
100
|
+
_ref4$position = _ref4.position,
|
|
101
|
+
_position = _ref4$position === void 0 ? "outerStart" : _ref4$position,
|
|
102
|
+
_ref4$reverse = _ref4.reverse,
|
|
103
|
+
reverse = _ref4$reverse === void 0 ? true : _ref4$reverse;
|
|
101
104
|
if (isClipAxis) {
|
|
102
105
|
if (end > +clipValue) {
|
|
103
106
|
y1 = yScaler[1](start);
|
|
@@ -158,28 +161,28 @@ var _default = exports["default"] = /*#__PURE__*/(0, _react.memo)(function (_ref
|
|
|
158
161
|
}, attr)));
|
|
159
162
|
}));
|
|
160
163
|
});
|
|
161
|
-
var Label = function Label(
|
|
162
|
-
var x =
|
|
163
|
-
y =
|
|
164
|
-
value =
|
|
165
|
-
|
|
166
|
-
font =
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
translateX =
|
|
170
|
-
|
|
171
|
-
translateY =
|
|
172
|
-
|
|
173
|
-
content =
|
|
174
|
-
suffixFont =
|
|
175
|
-
|
|
176
|
-
suffixX =
|
|
177
|
-
suffixY =
|
|
178
|
-
|
|
179
|
-
textAnchor =
|
|
180
|
-
|
|
181
|
-
dominantBaseline =
|
|
182
|
-
reverse =
|
|
164
|
+
var Label = function Label(_ref5) {
|
|
165
|
+
var x = _ref5.x,
|
|
166
|
+
y = _ref5.y,
|
|
167
|
+
value = _ref5.value,
|
|
168
|
+
_ref5$config = _ref5.config,
|
|
169
|
+
font = _ref5$config.font,
|
|
170
|
+
_ref5$config$translat = _ref5$config.translate,
|
|
171
|
+
_ref5$config$translat2 = _ref5$config$translat.x,
|
|
172
|
+
translateX = _ref5$config$translat2 === void 0 ? 0 : _ref5$config$translat2,
|
|
173
|
+
_ref5$config$translat3 = _ref5$config$translat.y,
|
|
174
|
+
translateY = _ref5$config$translat3 === void 0 ? 0 : _ref5$config$translat3,
|
|
175
|
+
_ref5$config$suffix = _ref5$config.suffix,
|
|
176
|
+
content = _ref5$config$suffix.content,
|
|
177
|
+
suffixFont = _ref5$config$suffix.font,
|
|
178
|
+
_ref5$config$suffix$t = _ref5$config$suffix.translate,
|
|
179
|
+
suffixX = _ref5$config$suffix$t.x,
|
|
180
|
+
suffixY = _ref5$config$suffix$t.y,
|
|
181
|
+
_ref5$textAnchor = _ref5.textAnchor,
|
|
182
|
+
textAnchor = _ref5$textAnchor === void 0 ? "middle" : _ref5$textAnchor,
|
|
183
|
+
_ref5$dominantBaselin = _ref5.dominantBaseline,
|
|
184
|
+
dominantBaseline = _ref5$dominantBaselin === void 0 ? "middle" : _ref5$dominantBaselin,
|
|
185
|
+
reverse = _ref5.reverse;
|
|
183
186
|
return /*#__PURE__*/React.createElement("text", {
|
|
184
187
|
x: x,
|
|
185
188
|
y: y,
|
|
@@ -196,19 +199,19 @@ var Label = function Label(_ref4) {
|
|
|
196
199
|
style: _objectSpread({}, (0, _utils.getFontStyle)(suffixFont, "svg"))
|
|
197
200
|
}, content));
|
|
198
201
|
};
|
|
199
|
-
var Icon = function Icon(
|
|
200
|
-
var cx =
|
|
201
|
-
cy =
|
|
202
|
-
|
|
203
|
-
mode =
|
|
204
|
-
inner =
|
|
205
|
-
outer =
|
|
206
|
-
color =
|
|
207
|
-
radius =
|
|
208
|
-
image =
|
|
209
|
-
|
|
210
|
-
width =
|
|
211
|
-
height =
|
|
202
|
+
var Icon = function Icon(_ref6) {
|
|
203
|
+
var cx = _ref6.cx,
|
|
204
|
+
cy = _ref6.cy,
|
|
205
|
+
_ref6$config = _ref6.config,
|
|
206
|
+
mode = _ref6$config.mode,
|
|
207
|
+
inner = _ref6$config.inner,
|
|
208
|
+
outer = _ref6$config.outer,
|
|
209
|
+
color = _ref6$config.color,
|
|
210
|
+
radius = _ref6$config.radius,
|
|
211
|
+
image = _ref6$config.image,
|
|
212
|
+
_ref6$config$size = _ref6$config.size,
|
|
213
|
+
width = _ref6$config$size.width,
|
|
214
|
+
height = _ref6$config$size.height;
|
|
212
215
|
return mode == "single" ? /*#__PURE__*/React.createElement(Circle, {
|
|
213
216
|
cx: cx,
|
|
214
217
|
cy: cy,
|
|
@@ -228,11 +231,11 @@ var Icon = function Icon(_ref5) {
|
|
|
228
231
|
xlinkHref: window.appConfig.ASSETS_URL + image
|
|
229
232
|
}));
|
|
230
233
|
};
|
|
231
|
-
var Circle = function Circle(
|
|
232
|
-
var cx =
|
|
233
|
-
cy =
|
|
234
|
-
color =
|
|
235
|
-
radius =
|
|
234
|
+
var Circle = function Circle(_ref7) {
|
|
235
|
+
var cx = _ref7.cx,
|
|
236
|
+
cy = _ref7.cy,
|
|
237
|
+
color = _ref7.color,
|
|
238
|
+
radius = _ref7.radius;
|
|
236
239
|
return /*#__PURE__*/React.createElement("circle", {
|
|
237
240
|
cx: cx,
|
|
238
241
|
cy: cy,
|
|
@@ -241,15 +244,15 @@ var Circle = function Circle(_ref6) {
|
|
|
241
244
|
stroke: "none"
|
|
242
245
|
});
|
|
243
246
|
};
|
|
244
|
-
var getVerticalLabel = function getVerticalLabel(
|
|
245
|
-
var
|
|
246
|
-
position =
|
|
247
|
-
width =
|
|
248
|
-
y =
|
|
249
|
-
y1 =
|
|
250
|
-
y2 =
|
|
251
|
-
|
|
252
|
-
reverse =
|
|
247
|
+
var getVerticalLabel = function getVerticalLabel(_ref8) {
|
|
248
|
+
var _ref8$position = _ref8.position,
|
|
249
|
+
position = _ref8$position === void 0 ? "outerStart" : _ref8$position,
|
|
250
|
+
width = _ref8.width,
|
|
251
|
+
y = _ref8.y,
|
|
252
|
+
y1 = _ref8.y1,
|
|
253
|
+
y2 = _ref8.y2,
|
|
254
|
+
_ref8$reverse = _ref8.reverse,
|
|
255
|
+
reverse = _ref8$reverse === void 0 ? true : _ref8$reverse;
|
|
253
256
|
var needReverse = reverse && y < 0;
|
|
254
257
|
switch (position) {
|
|
255
258
|
case "start":
|
|
@@ -279,15 +282,15 @@ var getVerticalLabel = function getVerticalLabel(_ref7) {
|
|
|
279
282
|
};
|
|
280
283
|
}
|
|
281
284
|
};
|
|
282
|
-
var getHorizontalLabel = function getHorizontalLabel(
|
|
283
|
-
var
|
|
284
|
-
position =
|
|
285
|
-
height =
|
|
286
|
-
y =
|
|
287
|
-
y1 =
|
|
288
|
-
y2 =
|
|
289
|
-
|
|
290
|
-
reverse =
|
|
285
|
+
var getHorizontalLabel = function getHorizontalLabel(_ref9) {
|
|
286
|
+
var _ref9$position = _ref9.position,
|
|
287
|
+
position = _ref9$position === void 0 ? "outerStart" : _ref9$position,
|
|
288
|
+
height = _ref9.height,
|
|
289
|
+
y = _ref9.y,
|
|
290
|
+
y1 = _ref9.y1,
|
|
291
|
+
y2 = _ref9.y2,
|
|
292
|
+
_ref9$reverse = _ref9.reverse,
|
|
293
|
+
reverse = _ref9$reverse === void 0 ? true : _ref9$reverse;
|
|
291
294
|
var needReverse = reverse && y < 0;
|
|
292
295
|
switch (position) {
|
|
293
296
|
case "start":
|
package/package.json
CHANGED
package/src/components/Label.js
CHANGED
|
@@ -57,7 +57,7 @@ export default memo(
|
|
|
57
57
|
const { icon, label } = x==curXLabel?selectConfig:other;
|
|
58
58
|
const showIcon = icon && icon.show;
|
|
59
59
|
const showLabel = label && label.show;
|
|
60
|
-
const { position:_position, reverse } = label;
|
|
60
|
+
const { position:_position="outerStart", reverse=true } = label || {};
|
|
61
61
|
if (isClipAxis) {
|
|
62
62
|
if (end > +clipValue) {
|
|
63
63
|
y1 = yScaler[1](start);
|