@easyv/charts 1.4.36 → 1.4.37
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/hooks/useAxes.js +4 -3
- package/package.json +1 -1
- package/src/hooks/useAxes.js +5 -5
package/lib/hooks/useAxes.js
CHANGED
|
@@ -102,6 +102,7 @@ var _default = function _default(_ref) {
|
|
|
102
102
|
var xAxisPositions = [];
|
|
103
103
|
axes.forEach(function (item) {
|
|
104
104
|
var _item$config$label = item.config.label,
|
|
105
|
+
extent = _item$config$label.extent,
|
|
105
106
|
_item$config$label$sh = _item$config$label.showLast,
|
|
106
107
|
showLast = _item$config$label$sh === void 0 ? false : _item$config$label$sh,
|
|
107
108
|
_item$config$label$de = _item$config$label.decimal,
|
|
@@ -316,15 +317,15 @@ var _default = function _default(_ref) {
|
|
|
316
317
|
|
|
317
318
|
var range = _direction === "horizontal" ? [_start, _end] : _direction === "vertical" ? [_end, _start] : [0, 0];
|
|
318
319
|
var newDomain = domain;
|
|
320
|
+
var fixedDomain = extent && extent.min != "" && extent.max != ""; //判断配置项中是否强制了最大最小值,如果已经被强制了,就不计算newDomain
|
|
319
321
|
|
|
320
|
-
if (type !== "ordinal" && !isNaN(domain[1]) && !auto) {
|
|
322
|
+
if (type !== "ordinal" && !isNaN(domain[1]) && !auto && !fixedDomain) {
|
|
321
323
|
newDomain = getNewDomain(domain, mode, _step);
|
|
322
324
|
}
|
|
323
325
|
|
|
324
326
|
var scaler = scales[type]().domain(newDomain).range(range);
|
|
325
327
|
scaler.type = type;
|
|
326
|
-
if (type !== "ordinal") scaler.clamp(true);
|
|
327
|
-
|
|
328
|
+
if (type !== "ordinal") scaler.clamp(true);
|
|
328
329
|
var allTicks = ticks ? ticks : scaler.ticks ? scaler.ticks(tickCount) : scaler.domain();
|
|
329
330
|
var _ticks = allTicks;
|
|
330
331
|
|
package/package.json
CHANGED
package/src/hooks/useAxes.js
CHANGED
|
@@ -72,7 +72,7 @@ export default ({
|
|
|
72
72
|
axes.forEach((item) => {
|
|
73
73
|
const {
|
|
74
74
|
config: {
|
|
75
|
-
label: { showLast = false, decimal = 0 },
|
|
75
|
+
label: { extent, showLast = false, decimal = 0 },
|
|
76
76
|
},
|
|
77
77
|
type,
|
|
78
78
|
orientation,
|
|
@@ -96,7 +96,6 @@ export default ({
|
|
|
96
96
|
clipPosition
|
|
97
97
|
} = item;
|
|
98
98
|
//如果是断轴类型,输出一套完全不同的values
|
|
99
|
-
|
|
100
99
|
/**
|
|
101
100
|
* 获取轴的:朝向direction,起点位置start,终点位置end
|
|
102
101
|
* @param {*} orientation
|
|
@@ -331,13 +330,15 @@ export default ({
|
|
|
331
330
|
? [end, start]
|
|
332
331
|
: [0, 0];
|
|
333
332
|
let newDomain = domain;
|
|
334
|
-
|
|
333
|
+
const fixedDomain = extent && extent.min!="" && extent.max!=""; //判断配置项中是否强制了最大最小值,如果已经被强制了,就不计算newDomain
|
|
334
|
+
if (type !== "ordinal" && !isNaN(domain[1]) && !auto && !fixedDomain) {
|
|
335
335
|
newDomain = getNewDomain(domain, mode, _step);
|
|
336
336
|
}
|
|
337
337
|
let scaler = scales[type]().domain(newDomain).range(range);
|
|
338
338
|
|
|
339
339
|
scaler.type = type;
|
|
340
|
-
if (type !== "ordinal") scaler.clamp(true);
|
|
340
|
+
if (type !== "ordinal") scaler.clamp(true);
|
|
341
|
+
|
|
341
342
|
const allTicks = ticks
|
|
342
343
|
? ticks
|
|
343
344
|
: scaler.ticks
|
|
@@ -417,7 +418,6 @@ export default ({
|
|
|
417
418
|
});
|
|
418
419
|
}
|
|
419
420
|
});
|
|
420
|
-
|
|
421
421
|
tmp.get("x") && (tmp.get("x").positions = xAxisPositions);
|
|
422
422
|
return tmp;
|
|
423
423
|
}, [axes]);
|