tvcharts 0.5.74 → 0.5.75
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/dist/echarts.js +297 -154
- package/dist/echarts.js.map +3 -3
- package/lib/chart/helper/Symbol.js +1 -0
- package/lib/component/axis/CartesianAxisView.js +11 -6
- package/lib/component/axisPointer/axisTrigger.js +5 -1
- package/lib/component/dataZoom/helper.js +2 -2
- package/lib/component/marker/MarkLabelModal.js +1 -2
- package/lib/component/marker/MarkLabelView.js +51 -15
- package/lib/coord/Axis.js +2 -1
- package/lib/coord/axisCommonTypes.js +2 -1
- package/lib/coord/axisDefault.js +3 -1
- package/lib/coord/axisHelper.js +19 -0
- package/lib/scale/Log.js +29 -25
- package/lib/scale/Percentage.js +215 -0
- package/lib/scale/Scale.js +3 -0
- package/package.json +1 -1
- package/types/dist/echarts.d.ts +14 -2
- package/types/dist/shared.d.ts +14 -2
- package/types/src/component/marker/MarkLabelModal.d.ts +2 -1
- package/types/src/coord/Axis.d.ts +1 -0
- package/types/src/coord/axisCommonTypes.d.ts +5 -0
- package/types/src/coord/axisDefault.d.ts +1 -0
- package/types/src/scale/Log.d.ts +1 -5
- package/types/src/scale/Percentage.d.ts +53 -0
- package/types/src/scale/Scale.d.ts +5 -1
- package/types/src/util/types.d.ts +1 -0
package/dist/echarts.js
CHANGED
|
@@ -745,14 +745,14 @@ function concatArray(a, b) {
|
|
|
745
745
|
}
|
|
746
746
|
return newArray;
|
|
747
747
|
}
|
|
748
|
-
function createObject(
|
|
748
|
+
function createObject(proto3, properties) {
|
|
749
749
|
let obj;
|
|
750
750
|
if (Object.create) {
|
|
751
|
-
obj = Object.create(
|
|
751
|
+
obj = Object.create(proto3);
|
|
752
752
|
} else {
|
|
753
753
|
const StyleCtor = function() {
|
|
754
754
|
};
|
|
755
|
-
StyleCtor.prototype =
|
|
755
|
+
StyleCtor.prototype = proto3;
|
|
756
756
|
obj = new StyleCtor();
|
|
757
757
|
}
|
|
758
758
|
if (properties) {
|
|
@@ -5498,9 +5498,9 @@ var Transformable2 = class {
|
|
|
5498
5498
|
};
|
|
5499
5499
|
var Transformable = Transformable2;
|
|
5500
5500
|
Transformable.initDefaultProps = function() {
|
|
5501
|
-
const
|
|
5502
|
-
|
|
5503
|
-
|
|
5501
|
+
const proto3 = Transformable2.prototype;
|
|
5502
|
+
proto3.scaleX = proto3.scaleY = proto3.globalScaleRatio = 1;
|
|
5503
|
+
proto3.x = proto3.y = proto3.originX = proto3.originY = proto3.skewX = proto3.skewY = proto3.rotation = proto3.anchorX = proto3.anchorY = 0;
|
|
5504
5504
|
}();
|
|
5505
5505
|
var TRANSFORMABLE_PROPS = [
|
|
5506
5506
|
"x",
|
|
@@ -7943,11 +7943,11 @@ function isExtendedClass(clz) {
|
|
|
7943
7943
|
}
|
|
7944
7944
|
function enableClassExtend(rootClz, mandatoryMethods) {
|
|
7945
7945
|
rootClz.$constructor = rootClz;
|
|
7946
|
-
rootClz.extend = function(
|
|
7946
|
+
rootClz.extend = function(proto3) {
|
|
7947
7947
|
if (true) {
|
|
7948
7948
|
each(mandatoryMethods, function(method) {
|
|
7949
|
-
if (!
|
|
7950
|
-
console.warn("Method `" + method + "` should be implemented" + (
|
|
7949
|
+
if (!proto3[method]) {
|
|
7950
|
+
console.warn("Method `" + method + "` should be implemented" + (proto3.type ? " in " + proto3.type : "") + ".");
|
|
7951
7951
|
}
|
|
7952
7952
|
});
|
|
7953
7953
|
}
|
|
@@ -7961,11 +7961,11 @@ function enableClassExtend(rootClz, mandatoryMethods) {
|
|
|
7961
7961
|
};
|
|
7962
7962
|
} else {
|
|
7963
7963
|
ExtendedClass = function() {
|
|
7964
|
-
(
|
|
7964
|
+
(proto3.$constructor || superClass).apply(this, arguments);
|
|
7965
7965
|
};
|
|
7966
7966
|
inherits(ExtendedClass, this);
|
|
7967
7967
|
}
|
|
7968
|
-
extend(ExtendedClass.prototype,
|
|
7968
|
+
extend(ExtendedClass.prototype, proto3);
|
|
7969
7969
|
ExtendedClass[IS_EXTENDED_CLASS] = true;
|
|
7970
7970
|
ExtendedClass.extend = this.extend;
|
|
7971
7971
|
ExtendedClass.superCall = superCall;
|
|
@@ -9701,12 +9701,12 @@ var PathProxy2 = class {
|
|
|
9701
9701
|
var PathProxy = PathProxy2;
|
|
9702
9702
|
PathProxy.CMD = CMD;
|
|
9703
9703
|
PathProxy.initDefaultProps = function() {
|
|
9704
|
-
const
|
|
9705
|
-
|
|
9706
|
-
|
|
9707
|
-
|
|
9708
|
-
|
|
9709
|
-
|
|
9704
|
+
const proto3 = PathProxy2.prototype;
|
|
9705
|
+
proto3._saveData = true;
|
|
9706
|
+
proto3._ux = 0;
|
|
9707
|
+
proto3._uy = 0;
|
|
9708
|
+
proto3._pendingPtDist = 0;
|
|
9709
|
+
proto3._version = 0;
|
|
9710
9710
|
}();
|
|
9711
9711
|
var PathProxy_default = PathProxy;
|
|
9712
9712
|
|
|
@@ -15489,13 +15489,13 @@ var ComponentModel2 = class extends Model_default {
|
|
|
15489
15489
|
};
|
|
15490
15490
|
var ComponentModel = ComponentModel2;
|
|
15491
15491
|
ComponentModel.protoInitialize = function() {
|
|
15492
|
-
const
|
|
15493
|
-
|
|
15494
|
-
|
|
15495
|
-
|
|
15496
|
-
|
|
15497
|
-
|
|
15498
|
-
|
|
15492
|
+
const proto3 = ComponentModel2.prototype;
|
|
15493
|
+
proto3.type = "component";
|
|
15494
|
+
proto3.id = "";
|
|
15495
|
+
proto3.name = "";
|
|
15496
|
+
proto3.mainType = "";
|
|
15497
|
+
proto3.subType = "";
|
|
15498
|
+
proto3.componentIndex = 0;
|
|
15499
15499
|
}();
|
|
15500
15500
|
mountExtend(ComponentModel, Model_default);
|
|
15501
15501
|
enableClassManagement(ComponentModel);
|
|
@@ -15891,9 +15891,9 @@ function getNearestPalette(palettes, requestColorNum) {
|
|
|
15891
15891
|
}
|
|
15892
15892
|
return palettes[paletteNum - 1];
|
|
15893
15893
|
}
|
|
15894
|
-
function getFromPalette(that,
|
|
15894
|
+
function getFromPalette(that, inner24, defaultPalette, layeredPalette, name, scope, requestNum) {
|
|
15895
15895
|
scope = scope || that;
|
|
15896
|
-
const scopeFields =
|
|
15896
|
+
const scopeFields = inner24(scope);
|
|
15897
15897
|
const paletteIdx = scopeFields.paletteIdx || 0;
|
|
15898
15898
|
const paletteNameMap = scopeFields.paletteNameMap = scopeFields.paletteNameMap || {};
|
|
15899
15899
|
if (paletteNameMap.hasOwnProperty(name)) {
|
|
@@ -15911,9 +15911,9 @@ function getFromPalette(that, inner25, defaultPalette, layeredPalette, name, sco
|
|
|
15911
15911
|
scopeFields.paletteIdx = (paletteIdx + 1) % palette.length;
|
|
15912
15912
|
return pickedPaletteItem;
|
|
15913
15913
|
}
|
|
15914
|
-
function clearPalette(that,
|
|
15915
|
-
|
|
15916
|
-
|
|
15914
|
+
function clearPalette(that, inner24) {
|
|
15915
|
+
inner24(that).paletteIdx = 0;
|
|
15916
|
+
inner24(that).paletteNameMap = {};
|
|
15917
15917
|
}
|
|
15918
15918
|
|
|
15919
15919
|
// src/model/Global.ts
|
|
@@ -17483,9 +17483,9 @@ var DefaultDataProvider2 = class {
|
|
|
17483
17483
|
};
|
|
17484
17484
|
var DefaultDataProvider = DefaultDataProvider2;
|
|
17485
17485
|
DefaultDataProvider.protoInitialize = function() {
|
|
17486
|
-
const
|
|
17487
|
-
|
|
17488
|
-
|
|
17486
|
+
const proto3 = DefaultDataProvider2.prototype;
|
|
17487
|
+
proto3.pure = false;
|
|
17488
|
+
proto3.persistent = true;
|
|
17489
17489
|
}();
|
|
17490
17490
|
DefaultDataProvider.internalField = function() {
|
|
17491
17491
|
mountMethods = function(provider, data, source) {
|
|
@@ -19930,14 +19930,14 @@ var SeriesModel2 = class extends Component_default {
|
|
|
19930
19930
|
var SeriesModel = SeriesModel2;
|
|
19931
19931
|
SERIES_UNIVERSAL_TRANSITION_PROP;
|
|
19932
19932
|
SeriesModel.protoInitialize = function() {
|
|
19933
|
-
const
|
|
19934
|
-
|
|
19935
|
-
|
|
19936
|
-
|
|
19937
|
-
|
|
19938
|
-
|
|
19939
|
-
|
|
19940
|
-
|
|
19933
|
+
const proto3 = SeriesModel2.prototype;
|
|
19934
|
+
proto3.type = "series.__base__";
|
|
19935
|
+
proto3.seriesIndex = 0;
|
|
19936
|
+
proto3.ignoreStyleOnData = false;
|
|
19937
|
+
proto3.hasSymbolVisual = false;
|
|
19938
|
+
proto3.defaultSymbol = "circle";
|
|
19939
|
+
proto3.visualStyleAccessPath = "itemStyle";
|
|
19940
|
+
proto3.visualDrawType = "fill";
|
|
19941
19941
|
}();
|
|
19942
19942
|
mixin(SeriesModel, DataFormatMixin);
|
|
19943
19943
|
mixin(SeriesModel, PaletteMixin);
|
|
@@ -20032,9 +20032,9 @@ var Component_default2 = ComponentView;
|
|
|
20032
20032
|
|
|
20033
20033
|
// src/chart/helper/createRenderPlanner.ts
|
|
20034
20034
|
function createRenderPlanner() {
|
|
20035
|
-
const
|
|
20035
|
+
const inner24 = makeInner();
|
|
20036
20036
|
return function(seriesModel) {
|
|
20037
|
-
const fields =
|
|
20037
|
+
const fields = inner24(seriesModel);
|
|
20038
20038
|
const pipelineContext = seriesModel.pipelineContext;
|
|
20039
20039
|
const originalLarge = !!fields.large;
|
|
20040
20040
|
const originalProgressive = !!fields.progressiveRender;
|
|
@@ -20107,8 +20107,8 @@ var ChartView2 = class {
|
|
|
20107
20107
|
};
|
|
20108
20108
|
var ChartView = ChartView2;
|
|
20109
20109
|
ChartView.protoInitialize = function() {
|
|
20110
|
-
const
|
|
20111
|
-
|
|
20110
|
+
const proto3 = ChartView2.prototype;
|
|
20111
|
+
proto3.type = "chart";
|
|
20112
20112
|
}();
|
|
20113
20113
|
function elSetState(el, state, highlightDigit) {
|
|
20114
20114
|
if (el && isHighDownDispatcher(el)) {
|
|
@@ -26010,6 +26010,9 @@ var Scale = class {
|
|
|
26010
26010
|
setBlank(isBlank) {
|
|
26011
26011
|
this._isBlank = isBlank;
|
|
26012
26012
|
}
|
|
26013
|
+
getIsBaseTick(val) {
|
|
26014
|
+
return false;
|
|
26015
|
+
}
|
|
26013
26016
|
};
|
|
26014
26017
|
enableClassManagement(Scale);
|
|
26015
26018
|
var Scale_default = Scale;
|
|
@@ -27298,8 +27301,6 @@ var Time_default = TimeScale;
|
|
|
27298
27301
|
var scaleProto = Scale_default.prototype;
|
|
27299
27302
|
var intervalScaleProto = Interval_default.prototype;
|
|
27300
27303
|
var roundingErrorFix = round;
|
|
27301
|
-
var mathFloor = Math.floor;
|
|
27302
|
-
var mathCeil = Math.ceil;
|
|
27303
27304
|
var mathPow2 = Math.pow;
|
|
27304
27305
|
var mathLog = Math.log;
|
|
27305
27306
|
var LogScale = class extends Scale_default {
|
|
@@ -27352,28 +27353,6 @@ var LogScale = class extends Scale_default {
|
|
|
27352
27353
|
unionExtentFromData(data, dim) {
|
|
27353
27354
|
this.unionExtent(data.getApproximateExtent(dim));
|
|
27354
27355
|
}
|
|
27355
|
-
calcNiceTicks(approxTickNum) {
|
|
27356
|
-
approxTickNum = approxTickNum || 10;
|
|
27357
|
-
const extent3 = this._extent;
|
|
27358
|
-
const span = extent3[1] - extent3[0];
|
|
27359
|
-
if (span === Infinity || span <= 0) {
|
|
27360
|
-
return;
|
|
27361
|
-
}
|
|
27362
|
-
let interval = quantity(span);
|
|
27363
|
-
const err = approxTickNum / span * interval;
|
|
27364
|
-
if (err <= 0.5) {
|
|
27365
|
-
interval *= 10;
|
|
27366
|
-
}
|
|
27367
|
-
while (!isNaN(interval) && Math.abs(interval) < 1 && Math.abs(interval) > 0) {
|
|
27368
|
-
interval *= 10;
|
|
27369
|
-
}
|
|
27370
|
-
const niceExtent = [
|
|
27371
|
-
round(mathCeil(extent3[0] / interval) * interval),
|
|
27372
|
-
round(mathFloor(extent3[1] / interval) * interval)
|
|
27373
|
-
];
|
|
27374
|
-
this._interval = interval;
|
|
27375
|
-
this._niceExtent = niceExtent;
|
|
27376
|
-
}
|
|
27377
27356
|
calcNiceExtent(opt) {
|
|
27378
27357
|
intervalScaleProto.calcNiceExtent.call(this, opt);
|
|
27379
27358
|
this._fixMin = opt.fixMin;
|
|
@@ -27399,12 +27378,123 @@ LogScale.type = "log";
|
|
|
27399
27378
|
var proto = LogScale.prototype;
|
|
27400
27379
|
proto.getMinorTicks = intervalScaleProto.getMinorTicks;
|
|
27401
27380
|
proto.getLabel = intervalScaleProto.getLabel;
|
|
27381
|
+
proto.calcNiceTicks = intervalScaleProto.calcNiceTicks;
|
|
27402
27382
|
function fixRoundingError(val, originalVal) {
|
|
27403
27383
|
return roundingErrorFix(val, getPrecision(originalVal));
|
|
27404
27384
|
}
|
|
27405
27385
|
Scale_default.registerClass(LogScale);
|
|
27406
27386
|
var Log_default = LogScale;
|
|
27407
27387
|
|
|
27388
|
+
// src/scale/Percentage.ts
|
|
27389
|
+
var scaleProto2 = Scale_default.prototype;
|
|
27390
|
+
var intervalScaleProto2 = Interval_default.prototype;
|
|
27391
|
+
var roundingErrorFix2 = round;
|
|
27392
|
+
var PercentageScale = class extends Scale_default {
|
|
27393
|
+
constructor(setting) {
|
|
27394
|
+
super(setting);
|
|
27395
|
+
this.type = "percentage";
|
|
27396
|
+
this._originalScale = new Interval_default();
|
|
27397
|
+
this._interval = 0;
|
|
27398
|
+
this._baseDim = this.getSetting("baseDim") || "close";
|
|
27399
|
+
}
|
|
27400
|
+
getTicks(expandToNicedExtent) {
|
|
27401
|
+
const originalScale = this._originalScale;
|
|
27402
|
+
const extent3 = this._extent;
|
|
27403
|
+
const originalExtent = originalScale.getExtent();
|
|
27404
|
+
const ticks = intervalScaleProto2.getTicks.call(this, expandToNicedExtent);
|
|
27405
|
+
const labels = map(ticks, function(tick) {
|
|
27406
|
+
const val = tick.value;
|
|
27407
|
+
let powVal = round(this.restorePercentageValue(val));
|
|
27408
|
+
powVal = val === extent3[0] && this._fixMin ? fixRoundingError2(powVal, originalExtent[0]) : powVal;
|
|
27409
|
+
powVal = val === extent3[1] && this._fixMax ? fixRoundingError2(powVal, originalExtent[1]) : powVal;
|
|
27410
|
+
return {
|
|
27411
|
+
value: powVal
|
|
27412
|
+
};
|
|
27413
|
+
}, this);
|
|
27414
|
+
return labels;
|
|
27415
|
+
}
|
|
27416
|
+
getFormattedLabel(tick, idx) {
|
|
27417
|
+
const {value} = tick;
|
|
27418
|
+
const percent = this.parsePercentageValue(value);
|
|
27419
|
+
return percent.toFixed(2) + "%";
|
|
27420
|
+
}
|
|
27421
|
+
setExtent(start2, end2) {
|
|
27422
|
+
start2 = this.parsePercentageValue(start2);
|
|
27423
|
+
end2 = this.parsePercentageValue(end2);
|
|
27424
|
+
intervalScaleProto2.setExtent.call(this, start2, end2);
|
|
27425
|
+
}
|
|
27426
|
+
parsePercentageValue(value) {
|
|
27427
|
+
return (value - this._fromValue) / this._fromValue * 100;
|
|
27428
|
+
}
|
|
27429
|
+
restorePercentageValue(value) {
|
|
27430
|
+
return value / 100 * this._fromValue + this._fromValue;
|
|
27431
|
+
}
|
|
27432
|
+
getExtent() {
|
|
27433
|
+
const extent3 = scaleProto2.getExtent.call(this);
|
|
27434
|
+
extent3[0] = this.restorePercentageValue(extent3[0]);
|
|
27435
|
+
extent3[1] = this.restorePercentageValue(extent3[1]);
|
|
27436
|
+
const originalScale = this._originalScale;
|
|
27437
|
+
const originalExtent = originalScale.getExtent();
|
|
27438
|
+
this._fixMin && (extent3[0] = fixRoundingError2(extent3[0], originalExtent[0]));
|
|
27439
|
+
this._fixMax && (extent3[1] = fixRoundingError2(extent3[1], originalExtent[1]));
|
|
27440
|
+
return extent3;
|
|
27441
|
+
}
|
|
27442
|
+
unionExtent(extent3) {
|
|
27443
|
+
this._originalScale.unionExtent(extent3);
|
|
27444
|
+
extent3[0] = this.parsePercentageValue(extent3[0]);
|
|
27445
|
+
extent3[1] = this.parsePercentageValue(extent3[1]);
|
|
27446
|
+
scaleProto2.unionExtent.call(this, extent3);
|
|
27447
|
+
}
|
|
27448
|
+
unionExtentFromData(data, dim) {
|
|
27449
|
+
if (dim === this._baseDim || !this._fromValue) {
|
|
27450
|
+
this._fromValue = data.get(this._baseDim, 0);
|
|
27451
|
+
}
|
|
27452
|
+
this.unionExtent(data.getApproximateExtent(dim));
|
|
27453
|
+
}
|
|
27454
|
+
calcNiceExtent(opt) {
|
|
27455
|
+
intervalScaleProto2.calcNiceExtent.call(this, opt);
|
|
27456
|
+
this._fixMin = opt.fixMin;
|
|
27457
|
+
this._fixMax = opt.fixMax;
|
|
27458
|
+
}
|
|
27459
|
+
parse(val) {
|
|
27460
|
+
return val;
|
|
27461
|
+
}
|
|
27462
|
+
contain(val) {
|
|
27463
|
+
const originalScale = this._originalScale;
|
|
27464
|
+
const originalExtent = originalScale.getExtent();
|
|
27465
|
+
return contain2(val, originalExtent);
|
|
27466
|
+
}
|
|
27467
|
+
normalize(val) {
|
|
27468
|
+
const originalScale = this._originalScale;
|
|
27469
|
+
const originalExtent = originalScale.getExtent();
|
|
27470
|
+
return normalize2(val, originalExtent);
|
|
27471
|
+
}
|
|
27472
|
+
scale(val) {
|
|
27473
|
+
const originalScale = this._originalScale;
|
|
27474
|
+
const originalExtent = originalScale.getExtent();
|
|
27475
|
+
return scale3(val, originalExtent);
|
|
27476
|
+
}
|
|
27477
|
+
getLabel(data) {
|
|
27478
|
+
if (Number.isNaN(data.value)) {
|
|
27479
|
+
return "";
|
|
27480
|
+
}
|
|
27481
|
+
return this.getFormattedLabel(data);
|
|
27482
|
+
}
|
|
27483
|
+
getIsBaseTick(val) {
|
|
27484
|
+
const value = this.parsePercentageValue(val);
|
|
27485
|
+
return Object.is(value, 0);
|
|
27486
|
+
}
|
|
27487
|
+
};
|
|
27488
|
+
PercentageScale.type = "percentage";
|
|
27489
|
+
var proto2 = PercentageScale.prototype;
|
|
27490
|
+
proto2.getMinorTicks = intervalScaleProto2.getMinorTicks;
|
|
27491
|
+
proto2.calcNiceTicks = intervalScaleProto2.calcNiceTicks;
|
|
27492
|
+
function fixRoundingError2(val, originalVal) {
|
|
27493
|
+
return roundingErrorFix2(val, getPrecision(originalVal));
|
|
27494
|
+
}
|
|
27495
|
+
Scale_default.registerClass(PercentageScale);
|
|
27496
|
+
var Percentage_default = PercentageScale;
|
|
27497
|
+
|
|
27408
27498
|
// src/coord/scaleRawExtentInfo.ts
|
|
27409
27499
|
var ScaleRawExtentInfo = class {
|
|
27410
27500
|
constructor(scale4, model, originalExtent) {
|
|
@@ -27591,13 +27681,20 @@ function niceScaleExtent(scale4, inModel) {
|
|
|
27591
27681
|
const model = inModel;
|
|
27592
27682
|
const extentInfo = getScaleExtent(scale4, model);
|
|
27593
27683
|
const extent3 = extentInfo.extent;
|
|
27594
|
-
|
|
27684
|
+
let splitNumber = model.get("splitNumber");
|
|
27685
|
+
const splitDistance = model.get("splitDistance");
|
|
27595
27686
|
if (scale4 instanceof Log_default) {
|
|
27596
27687
|
scale4.base = model.get("logBase");
|
|
27597
27688
|
}
|
|
27598
27689
|
const scaleType = scale4.type;
|
|
27599
27690
|
const interval = model.get("interval");
|
|
27600
27691
|
const isIntervalOrTime = scaleType === "interval" || scaleType === "time";
|
|
27692
|
+
if (splitDistance) {
|
|
27693
|
+
const axis = model.axis;
|
|
27694
|
+
const rect = axis.grid.getRect();
|
|
27695
|
+
const length2 = axis.dim === "y" ? rect.height : rect.width;
|
|
27696
|
+
splitNumber = Math.ceil(length2 / splitDistance);
|
|
27697
|
+
}
|
|
27601
27698
|
scale4.setExtent(extent3[0], extent3[1]);
|
|
27602
27699
|
scale4.calcNiceExtent({
|
|
27603
27700
|
splitNumber,
|
|
@@ -27624,6 +27721,10 @@ function createScaleByModel(model, axisType) {
|
|
|
27624
27721
|
locale: model.ecModel.getLocaleModel(),
|
|
27625
27722
|
useUTC: model.ecModel.get("useUTC")
|
|
27626
27723
|
});
|
|
27724
|
+
case "percentage":
|
|
27725
|
+
return new Percentage_default({
|
|
27726
|
+
baseDim: model.get("baseDim")
|
|
27727
|
+
});
|
|
27627
27728
|
default:
|
|
27628
27729
|
return new (Scale_default.getClass(axisType) || Interval_default)();
|
|
27629
27730
|
}
|
|
@@ -27644,6 +27745,12 @@ function makeLabelFormatter(axis) {
|
|
|
27644
27745
|
return axis.scale.getFormattedLabel(tick, idx, tpl);
|
|
27645
27746
|
};
|
|
27646
27747
|
}(labelFormatter);
|
|
27748
|
+
} else if (axis.scale.type === "percentage") {
|
|
27749
|
+
return function(tpl) {
|
|
27750
|
+
return function(tick, idx) {
|
|
27751
|
+
return axis.scale.getFormattedLabel(tick, idx);
|
|
27752
|
+
};
|
|
27753
|
+
}(labelFormatter);
|
|
27647
27754
|
} else if (isString(labelFormatter)) {
|
|
27648
27755
|
return function(tpl) {
|
|
27649
27756
|
return function(tick) {
|
|
@@ -28617,7 +28724,8 @@ var Axis = class {
|
|
|
28617
28724
|
const ticksCoords = map(ticks, function(tickVal) {
|
|
28618
28725
|
return {
|
|
28619
28726
|
coord: this.dataToCoord(this.scale.type === "ordinal" ? this.scale.getRawOrdinalNumber(tickVal) : tickVal),
|
|
28620
|
-
tickValue: tickVal
|
|
28727
|
+
tickValue: tickVal,
|
|
28728
|
+
isBaseTick: this.scale.getIsBaseTick(tickVal)
|
|
28621
28729
|
};
|
|
28622
28730
|
}, this);
|
|
28623
28731
|
const alignWithLabel = tickModel.get("alignWithLabel");
|
|
@@ -28719,23 +28827,23 @@ function fixOnBandTicksCoords(axis, ticksCoords, alignWithLabel, clamp2) {
|
|
|
28719
28827
|
var Axis_default = Axis;
|
|
28720
28828
|
|
|
28721
28829
|
// src/export/api.ts
|
|
28722
|
-
function extendComponentModel(
|
|
28723
|
-
const Model2 = Component_default.extend(
|
|
28830
|
+
function extendComponentModel(proto3) {
|
|
28831
|
+
const Model2 = Component_default.extend(proto3);
|
|
28724
28832
|
Component_default.registerClass(Model2);
|
|
28725
28833
|
return Model2;
|
|
28726
28834
|
}
|
|
28727
|
-
function extendComponentView(
|
|
28728
|
-
const View2 = Component_default2.extend(
|
|
28835
|
+
function extendComponentView(proto3) {
|
|
28836
|
+
const View2 = Component_default2.extend(proto3);
|
|
28729
28837
|
Component_default2.registerClass(View2);
|
|
28730
28838
|
return View2;
|
|
28731
28839
|
}
|
|
28732
|
-
function extendSeriesModel(
|
|
28733
|
-
const Model2 = Series_default.extend(
|
|
28840
|
+
function extendSeriesModel(proto3) {
|
|
28841
|
+
const Model2 = Series_default.extend(proto3);
|
|
28734
28842
|
Series_default.registerClass(Model2);
|
|
28735
28843
|
return Model2;
|
|
28736
28844
|
}
|
|
28737
|
-
function extendChartView(
|
|
28738
|
-
const View2 = Chart_default.extend(
|
|
28845
|
+
function extendChartView(proto3) {
|
|
28846
|
+
const View2 = Chart_default.extend(proto3);
|
|
28739
28847
|
Chart_default.registerClass(View2);
|
|
28740
28848
|
return View2;
|
|
28741
28849
|
}
|
|
@@ -33975,9 +34083,9 @@ var LineView = class extends Chart_default {
|
|
|
33975
34083
|
});
|
|
33976
34084
|
}
|
|
33977
34085
|
if (valueAnimation) {
|
|
33978
|
-
const
|
|
33979
|
-
if (typeof
|
|
33980
|
-
|
|
34086
|
+
const inner24 = labelInner(endLabel);
|
|
34087
|
+
if (typeof inner24.setLabelText === "function") {
|
|
34088
|
+
inner24.setLabelText(value);
|
|
33981
34089
|
}
|
|
33982
34090
|
}
|
|
33983
34091
|
}
|
|
@@ -36823,15 +36931,17 @@ var timeAxis = merge({
|
|
|
36823
36931
|
var logAxis = defaults({
|
|
36824
36932
|
logBase: 10
|
|
36825
36933
|
}, valueAxis);
|
|
36934
|
+
var percentageAxis = defaults({}, valueAxis);
|
|
36826
36935
|
var axisDefault_default = {
|
|
36827
36936
|
category: categoryAxis,
|
|
36828
36937
|
value: valueAxis,
|
|
36829
36938
|
time: timeAxis,
|
|
36830
|
-
log: logAxis
|
|
36939
|
+
log: logAxis,
|
|
36940
|
+
percentage: percentageAxis
|
|
36831
36941
|
};
|
|
36832
36942
|
|
|
36833
36943
|
// src/coord/axisCommonTypes.ts
|
|
36834
|
-
var AXIS_TYPES = {value: 1, category: 1, time: 1, log: 1};
|
|
36944
|
+
var AXIS_TYPES = {value: 1, category: 1, time: 1, log: 1, percentage: 1};
|
|
36835
36945
|
|
|
36836
36946
|
// src/coord/axisModelCreator.ts
|
|
36837
36947
|
function axisModelCreator(registers, axisName, BaseAxisModelClass, extraDefaultOption) {
|
|
@@ -37110,11 +37220,11 @@ function findAxisModels(seriesModel) {
|
|
|
37110
37220
|
// src/coord/axisAlignTicks.ts
|
|
37111
37221
|
var mathLog2 = Math.log;
|
|
37112
37222
|
function alignScaleTicks(scale4, axisModel, alignToScale) {
|
|
37113
|
-
const
|
|
37114
|
-
const alignToTicks =
|
|
37115
|
-
const alignToNicedTicks =
|
|
37223
|
+
const intervalScaleProto3 = Interval_default.prototype;
|
|
37224
|
+
const alignToTicks = intervalScaleProto3.getTicks.call(alignToScale);
|
|
37225
|
+
const alignToNicedTicks = intervalScaleProto3.getTicks.call(alignToScale, true);
|
|
37116
37226
|
const alignToSplitNumber = alignToTicks.length - 1;
|
|
37117
|
-
const alignToInterval =
|
|
37227
|
+
const alignToInterval = intervalScaleProto3.getInterval.call(alignToScale);
|
|
37118
37228
|
const scaleExtent = getScaleExtent(scale4, axisModel);
|
|
37119
37229
|
let rawExtent = scaleExtent.extent;
|
|
37120
37230
|
const isMinFixed = scaleExtent.fixMin;
|
|
@@ -37129,14 +37239,14 @@ function alignScaleTicks(scale4, axisModel, alignToScale) {
|
|
|
37129
37239
|
fixMin: isMinFixed,
|
|
37130
37240
|
fixMax: isMaxFixed
|
|
37131
37241
|
});
|
|
37132
|
-
const extent3 =
|
|
37242
|
+
const extent3 = intervalScaleProto3.getExtent.call(scale4);
|
|
37133
37243
|
if (isMinFixed) {
|
|
37134
37244
|
rawExtent[0] = extent3[0];
|
|
37135
37245
|
}
|
|
37136
37246
|
if (isMaxFixed) {
|
|
37137
37247
|
rawExtent[1] = extent3[1];
|
|
37138
37248
|
}
|
|
37139
|
-
let interval =
|
|
37249
|
+
let interval = intervalScaleProto3.getInterval.call(scale4);
|
|
37140
37250
|
let min3 = rawExtent[0];
|
|
37141
37251
|
let max3 = rawExtent[1];
|
|
37142
37252
|
if (isMinFixed && isMaxFixed) {
|
|
@@ -37171,13 +37281,13 @@ function alignScaleTicks(scale4, axisModel, alignToScale) {
|
|
|
37171
37281
|
}
|
|
37172
37282
|
const t0 = (alignToTicks[0].value - alignToNicedTicks[0].value) / alignToInterval;
|
|
37173
37283
|
const t1 = (alignToTicks[alignToSplitNumber].value - alignToNicedTicks[alignToSplitNumber].value) / alignToInterval;
|
|
37174
|
-
|
|
37175
|
-
|
|
37284
|
+
intervalScaleProto3.setExtent.call(scale4, min3 + interval * t0, max3 + interval * t1);
|
|
37285
|
+
intervalScaleProto3.setInterval.call(scale4, interval);
|
|
37176
37286
|
if (t0 || t1) {
|
|
37177
|
-
|
|
37287
|
+
intervalScaleProto3.setNiceExtent.call(scale4, min3 + interval, max3 - interval);
|
|
37178
37288
|
}
|
|
37179
37289
|
if (true) {
|
|
37180
|
-
const ticks =
|
|
37290
|
+
const ticks = intervalScaleProto3.getTicks.call(scale4);
|
|
37181
37291
|
if (ticks[1] && (!isValueNice(interval) || getPrecisionSafe(ticks[1].value) > getPrecisionSafe(interval))) {
|
|
37182
37292
|
warn(`The ticks may be not readable when set min: ${axisModel.get("min")}, max: ${axisModel.get("max")} and alignTicks: true`);
|
|
37183
37293
|
}
|
|
@@ -38420,6 +38530,7 @@ var axisElementBuilders = {
|
|
|
38420
38530
|
}
|
|
38421
38531
|
const splitLineModel = axisModel.getModel("splitLine");
|
|
38422
38532
|
const lineStyleModel = splitLineModel.getModel("lineStyle");
|
|
38533
|
+
const baseTickLineStyleModel = splitLineModel.getModel("baseTickLineStyle");
|
|
38423
38534
|
let lineColors = lineStyleModel.get("color");
|
|
38424
38535
|
lineColors = isArray(lineColors) ? lineColors : [lineColors];
|
|
38425
38536
|
const gridRect = gridModel.coordinateSystem.getRect();
|
|
@@ -38430,9 +38541,11 @@ var axisElementBuilders = {
|
|
|
38430
38541
|
});
|
|
38431
38542
|
const p1 = [];
|
|
38432
38543
|
const p2 = [];
|
|
38544
|
+
const baseTickLineStyle = baseTickLineStyleModel.getLineStyle();
|
|
38433
38545
|
const lineStyle = lineStyleModel.getLineStyle();
|
|
38434
38546
|
for (let i = 0; i < ticksCoords.length; i++) {
|
|
38435
|
-
const
|
|
38547
|
+
const tick = ticksCoords[i];
|
|
38548
|
+
const tickCoord = axis.toGlobalCoord(tick.coord);
|
|
38436
38549
|
if (isHorizontal) {
|
|
38437
38550
|
p1[0] = tickCoord;
|
|
38438
38551
|
p1[1] = gridRect.y;
|
|
@@ -38445,9 +38558,13 @@ var axisElementBuilders = {
|
|
|
38445
38558
|
p2[1] = tickCoord;
|
|
38446
38559
|
}
|
|
38447
38560
|
const colorIndex = lineCount++ % lineColors.length;
|
|
38448
|
-
const tickValue =
|
|
38561
|
+
const tickValue = tick.tickValue;
|
|
38562
|
+
const isBaseTick = tick.isBaseTick;
|
|
38563
|
+
const style = defaults({
|
|
38564
|
+
stroke: lineColors[colorIndex]
|
|
38565
|
+
}, lineStyle);
|
|
38449
38566
|
const line2 = new Line_default({
|
|
38450
|
-
anid: tickValue != null ? "line_" +
|
|
38567
|
+
anid: tickValue != null ? "line_" + tick.tickValue : null,
|
|
38451
38568
|
autoBatch: true,
|
|
38452
38569
|
shape: {
|
|
38453
38570
|
x1: p1[0],
|
|
@@ -38455,9 +38572,7 @@ var axisElementBuilders = {
|
|
|
38455
38572
|
x2: p2[0],
|
|
38456
38573
|
y2: p2[1]
|
|
38457
38574
|
},
|
|
38458
|
-
style:
|
|
38459
|
-
stroke: lineColors[colorIndex]
|
|
38460
|
-
}, lineStyle),
|
|
38575
|
+
style: isBaseTick ? Object.assign(style, baseTickLineStyle) : style,
|
|
38461
38576
|
silent: true
|
|
38462
38577
|
});
|
|
38463
38578
|
subPixelOptimizeLine2(line2.shape, lineStyle.lineWidth);
|
|
@@ -49096,8 +49211,8 @@ function restrict(value, extend2) {
|
|
|
49096
49211
|
var each6 = each;
|
|
49097
49212
|
var mathMin9 = Math.min;
|
|
49098
49213
|
var mathMax9 = Math.max;
|
|
49099
|
-
var
|
|
49100
|
-
var
|
|
49214
|
+
var mathFloor = Math.floor;
|
|
49215
|
+
var mathCeil = Math.ceil;
|
|
49101
49216
|
var round6 = round;
|
|
49102
49217
|
var PI9 = Math.PI;
|
|
49103
49218
|
var Parallel = class {
|
|
@@ -49179,7 +49294,7 @@ var Parallel = class {
|
|
|
49179
49294
|
let winSize;
|
|
49180
49295
|
if (!axisExpandWindow) {
|
|
49181
49296
|
winSize = restrict2(axisExpandWidth * (axisExpandCount - 1), layoutExtent);
|
|
49182
|
-
const axisExpandCenter = parallelModel.get("axisExpandCenter") ||
|
|
49297
|
+
const axisExpandCenter = parallelModel.get("axisExpandCenter") || mathFloor(axisCount / 2);
|
|
49183
49298
|
axisExpandWindow = [axisExpandWidth * axisExpandCenter - winSize / 2];
|
|
49184
49299
|
axisExpandWindow[1] = axisExpandWindow[0] + winSize;
|
|
49185
49300
|
} else {
|
|
@@ -49189,8 +49304,8 @@ var Parallel = class {
|
|
|
49189
49304
|
let axisCollapseWidth = (layoutLength - winSize) / (axisCount - axisExpandCount);
|
|
49190
49305
|
axisCollapseWidth < 3 && (axisCollapseWidth = 0);
|
|
49191
49306
|
const winInnerIndices = [
|
|
49192
|
-
|
|
49193
|
-
|
|
49307
|
+
mathFloor(round6(axisExpandWindow[0] / axisExpandWidth, 1)) + 1,
|
|
49308
|
+
mathCeil(round6(axisExpandWindow[1] / axisExpandWidth, 1)) - 1
|
|
49194
49309
|
];
|
|
49195
49310
|
const axisExpandWindow0Pos = axisCollapseWidth / axisExpandWidth * axisExpandWindow[0];
|
|
49196
49311
|
return {
|
|
@@ -57655,7 +57770,10 @@ function axisTrigger(payload, ecModel, api2) {
|
|
|
57655
57770
|
});
|
|
57656
57771
|
updateModelActually(showValueMap, axesInfo, outputPayload);
|
|
57657
57772
|
dispatchTooltipActually(dataByCoordSys, point, payload, dispatchAction3);
|
|
57658
|
-
|
|
57773
|
+
const highlightDisabled = ecModel.get("highlightDisabled");
|
|
57774
|
+
if (!highlightDisabled) {
|
|
57775
|
+
dispatchHighDownActually(axesInfo, dispatchAction3, api2);
|
|
57776
|
+
}
|
|
57659
57777
|
return outputPayload;
|
|
57660
57778
|
}
|
|
57661
57779
|
function processOnAxis(axisInfo, newValue, updaters, noSnap, outputFinder) {
|
|
@@ -60592,8 +60710,8 @@ function collectReferCoordSysModelInfo(dataZoomModel) {
|
|
|
60592
60710
|
return coordSysInfoWrap;
|
|
60593
60711
|
}
|
|
60594
60712
|
function barSpaceLimit(barSpace, maxWidth = 200) {
|
|
60595
|
-
if (barSpace < 1) {
|
|
60596
|
-
return 1;
|
|
60713
|
+
if (barSpace < 1.25) {
|
|
60714
|
+
return 1.25;
|
|
60597
60715
|
} else if (barSpace > maxWidth) {
|
|
60598
60716
|
return maxWidth;
|
|
60599
60717
|
}
|
|
@@ -66579,7 +66697,6 @@ function install43(registers) {
|
|
|
66579
66697
|
}
|
|
66580
66698
|
|
|
66581
66699
|
// src/component/marker/MarkLabelModal.ts
|
|
66582
|
-
var inner21 = makeInner();
|
|
66583
66700
|
var defaultDataOption = {
|
|
66584
66701
|
textStyle: {
|
|
66585
66702
|
padding: [4, 6, 2, 8],
|
|
@@ -66651,6 +66768,18 @@ var MarkLabelModal_default = MarkLabelModal;
|
|
|
66651
66768
|
|
|
66652
66769
|
// src/component/marker/MarkLabelView.ts
|
|
66653
66770
|
var markerTypeCalculator2 = {
|
|
66771
|
+
dataMin: (item, seriesModel) => {
|
|
66772
|
+
const seriesData = seriesModel.getData();
|
|
66773
|
+
return {
|
|
66774
|
+
value: seriesData.getDataExtent(item.valueDim)[0]
|
|
66775
|
+
};
|
|
66776
|
+
},
|
|
66777
|
+
dataMax: (item, seriesModel) => {
|
|
66778
|
+
const seriesData = seriesModel.getData();
|
|
66779
|
+
return {
|
|
66780
|
+
value: seriesData.getDataExtent(item.valueDim)[1]
|
|
66781
|
+
};
|
|
66782
|
+
},
|
|
66654
66783
|
min: (item, seriesModel) => {
|
|
66655
66784
|
const seriesData = seriesModel.getData();
|
|
66656
66785
|
return {
|
|
@@ -66693,7 +66822,7 @@ var markerTypeCalculator2 = {
|
|
|
66693
66822
|
};
|
|
66694
66823
|
}
|
|
66695
66824
|
};
|
|
66696
|
-
var
|
|
66825
|
+
var inner21 = makeInner();
|
|
66697
66826
|
var MarkLabelView2 = class extends Component_default2 {
|
|
66698
66827
|
constructor() {
|
|
66699
66828
|
super(...arguments);
|
|
@@ -66747,7 +66876,7 @@ var MarkLabelView2 = class extends Component_default2 {
|
|
|
66747
66876
|
}
|
|
66748
66877
|
return;
|
|
66749
66878
|
}
|
|
66750
|
-
item.
|
|
66879
|
+
item.text = ["last"].includes(item.type) ? yAxisModel.scale.getLabel({value}, {precision: item.precision}) : value.toFixed(item.precision);
|
|
66751
66880
|
const y = yAxisModel.toGlobalCoord(yAxisModel.dataToCoord(value));
|
|
66752
66881
|
if (el) {
|
|
66753
66882
|
updateLabel({
|
|
@@ -66773,8 +66902,8 @@ var MarkLabelView2 = class extends Component_default2 {
|
|
|
66773
66902
|
markerGroupMap.set(item.name, el);
|
|
66774
66903
|
this.group.add(el);
|
|
66775
66904
|
}
|
|
66776
|
-
|
|
66777
|
-
|
|
66905
|
+
inner21(el).yAxisIndex = yAxisModel.index;
|
|
66906
|
+
inner21(el).isSort = true;
|
|
66778
66907
|
});
|
|
66779
66908
|
});
|
|
66780
66909
|
}
|
|
@@ -66818,19 +66947,26 @@ var MarkLabelView2 = class extends Component_default2 {
|
|
|
66818
66947
|
if (!label.children) {
|
|
66819
66948
|
return;
|
|
66820
66949
|
}
|
|
66821
|
-
each(label.children, (
|
|
66950
|
+
each(label.children, (item) => {
|
|
66951
|
+
const option = item;
|
|
66822
66952
|
let el = graphicLabelElMap.get(option.id);
|
|
66823
66953
|
const y = yAxisModel.toGlobalCoord(yAxisModel.dataToCoord(option.y)) - 9;
|
|
66954
|
+
const style = option.style;
|
|
66955
|
+
if (yAxisModel.scale.type === "percentage") {
|
|
66956
|
+
const formatLabel2 = yAxisModel.scale.getLabel({value: +option.style.text});
|
|
66957
|
+
option.style = Object.assign({}, option.style, {text: formatLabel2});
|
|
66958
|
+
}
|
|
66824
66959
|
if (el) {
|
|
66825
66960
|
updateText({el, gridRect, position: position2, option, ecModel, y});
|
|
66826
66961
|
} else {
|
|
66827
66962
|
el = createText({gridRect, position: position2, option, ecModel, y});
|
|
66828
66963
|
graphLabelGroup.add(el);
|
|
66829
66964
|
graphicLabelElMap.set(option.id, el);
|
|
66830
|
-
|
|
66965
|
+
inner21(el).yAxisIndex = yAxisModel.index;
|
|
66831
66966
|
}
|
|
66832
|
-
|
|
66833
|
-
|
|
66967
|
+
inner21(el).originalValue = option.y;
|
|
66968
|
+
inner21(el).isSort = true;
|
|
66969
|
+
inner21(el).style = style;
|
|
66834
66970
|
});
|
|
66835
66971
|
});
|
|
66836
66972
|
});
|
|
@@ -66839,14 +66975,19 @@ var MarkLabelView2 = class extends Component_default2 {
|
|
|
66839
66975
|
const graphicLabelElMap = this._graphicLabelElMap;
|
|
66840
66976
|
const yAxisModels = ecModel.queryComponents({mainType: "yAxis"});
|
|
66841
66977
|
graphicLabelElMap.each((el) => {
|
|
66842
|
-
const yAxisModel = yAxisModels[
|
|
66978
|
+
const yAxisModel = yAxisModels[inner21(el).yAxisIndex].axis;
|
|
66843
66979
|
if (!yAxisModel) {
|
|
66844
66980
|
return;
|
|
66845
66981
|
}
|
|
66846
66982
|
const gridRect = yAxisModel.grid.getRect();
|
|
66847
66983
|
const position2 = yAxisModel.position;
|
|
66848
|
-
const y = yAxisModel.toGlobalCoord(yAxisModel.dataToCoord(
|
|
66849
|
-
|
|
66984
|
+
const y = yAxisModel.toGlobalCoord(yAxisModel.dataToCoord(inner21(el).originalValue)) - 9;
|
|
66985
|
+
let style = inner21(el).style;
|
|
66986
|
+
if (yAxisModel.scale.type === "percentage") {
|
|
66987
|
+
const formatLabel2 = yAxisModel.scale.getLabel({value: +style.text});
|
|
66988
|
+
style = Object.assign({}, style, {text: formatLabel2});
|
|
66989
|
+
}
|
|
66990
|
+
updateText({el, gridRect, position: position2, option: {style}, ecModel, y});
|
|
66850
66991
|
});
|
|
66851
66992
|
}
|
|
66852
66993
|
removeGraphicLabels(labelOption) {
|
|
@@ -66864,8 +67005,8 @@ var MarkLabelView2 = class extends Component_default2 {
|
|
|
66864
67005
|
avoidOverlap() {
|
|
66865
67006
|
const labelsByYAxisId = {};
|
|
66866
67007
|
this.markerGroupMap.each((item) => {
|
|
66867
|
-
const yAxisId =
|
|
66868
|
-
const isSort =
|
|
67008
|
+
const yAxisId = inner21(item).yAxisIndex;
|
|
67009
|
+
const isSort = inner21(item).isSort;
|
|
66869
67010
|
if (item.ignore || !isSort) {
|
|
66870
67011
|
return;
|
|
66871
67012
|
}
|
|
@@ -66874,8 +67015,8 @@ var MarkLabelView2 = class extends Component_default2 {
|
|
|
66874
67015
|
labelsByYAxisId[yAxisId] = labels;
|
|
66875
67016
|
});
|
|
66876
67017
|
this._graphicLabelElMap.each((item) => {
|
|
66877
|
-
const yAxisId =
|
|
66878
|
-
const isSort =
|
|
67018
|
+
const yAxisId = inner21(item).yAxisIndex;
|
|
67019
|
+
const isSort = inner21(item).isSort;
|
|
66879
67020
|
if (item.ignore || !isSort) {
|
|
66880
67021
|
return;
|
|
66881
67022
|
}
|
|
@@ -66891,18 +67032,18 @@ var MarkLabelView2 = class extends Component_default2 {
|
|
|
66891
67032
|
var MarkLabelView = MarkLabelView2;
|
|
66892
67033
|
MarkLabelView.type = "markLabel";
|
|
66893
67034
|
function labelAvoidOverlap(labels, marginTop = 0) {
|
|
66894
|
-
labels.sort((a, b) =>
|
|
67035
|
+
labels.sort((a, b) => inner21(a).y - inner21(b).y);
|
|
67036
|
+
const sortYbyId = {};
|
|
66895
67037
|
for (let i = 1; i < labels.length; i++) {
|
|
66896
|
-
const
|
|
67038
|
+
const prevLabel = labels[i - 1];
|
|
67039
|
+
const prevLabelY = sortYbyId[prevLabel.id] ?? inner21(prevLabel).y;
|
|
66897
67040
|
const currentLabel = labels[i];
|
|
66898
67041
|
const prevHeight = 18 + marginTop;
|
|
66899
|
-
let currentLabelY =
|
|
67042
|
+
let currentLabelY = inner21(currentLabel).y;
|
|
66900
67043
|
if (Math.abs(currentLabelY - prevLabelY) < prevHeight) {
|
|
66901
67044
|
currentLabelY = prevLabelY + prevHeight;
|
|
66902
67045
|
}
|
|
66903
|
-
|
|
66904
|
-
return;
|
|
66905
|
-
}
|
|
67046
|
+
sortYbyId[currentLabel.id] = currentLabelY;
|
|
66906
67047
|
if (currentLabel.type === "text") {
|
|
66907
67048
|
currentLabel.y = currentLabelY;
|
|
66908
67049
|
} else {
|
|
@@ -66932,7 +67073,7 @@ function createText({option, gridRect, position: position2, ecModel, y}) {
|
|
|
66932
67073
|
z: 101,
|
|
66933
67074
|
zlevel
|
|
66934
67075
|
});
|
|
66935
|
-
|
|
67076
|
+
inner21(textEl).y = y;
|
|
66936
67077
|
return textEl;
|
|
66937
67078
|
}
|
|
66938
67079
|
function updateText({option, gridRect, position: position2, ecModel, el, y}) {
|
|
@@ -66943,12 +67084,12 @@ function updateText({option, gridRect, position: position2, ecModel, el, y}) {
|
|
|
66943
67084
|
el.x = x;
|
|
66944
67085
|
el.y = y;
|
|
66945
67086
|
el.attr("style", style);
|
|
66946
|
-
|
|
67087
|
+
inner21(el).y = y;
|
|
66947
67088
|
}
|
|
66948
67089
|
function createLabel({x, y, labelData, markerModel, gridRect, position: position2}) {
|
|
66949
67090
|
const {zlevel} = markerModel.option;
|
|
66950
|
-
const {textStyle, lineStyle, showLine, showName
|
|
66951
|
-
const text =
|
|
67091
|
+
const {textStyle, lineStyle, showLine, showName} = labelData;
|
|
67092
|
+
const text = labelData.text;
|
|
66952
67093
|
const isLeft = position2 === "left";
|
|
66953
67094
|
const group = new Group_default();
|
|
66954
67095
|
const labelY = y - 9;
|
|
@@ -66970,33 +67111,33 @@ function createLabel({x, y, labelData, markerModel, gridRect, position: position
|
|
|
66970
67111
|
const lineEl = new Line_default({
|
|
66971
67112
|
style: lineStyle,
|
|
66972
67113
|
shape: {
|
|
66973
|
-
x1: gridRect.x,
|
|
67114
|
+
x1: showName && isLeft ? gridRect.x - 10 : gridRect.x,
|
|
66974
67115
|
y1: y,
|
|
66975
|
-
x2: gridRect.x + gridRect.width,
|
|
67116
|
+
x2: showName && !isLeft ? gridRect.x + gridRect.width - 10 : gridRect.x + gridRect.width,
|
|
66976
67117
|
y2: y
|
|
66977
67118
|
},
|
|
66978
67119
|
z: 100,
|
|
66979
67120
|
ignore: !showLine
|
|
66980
67121
|
});
|
|
66981
|
-
|
|
66982
|
-
|
|
66983
|
-
|
|
66984
|
-
|
|
67122
|
+
inner21(lineEl).labelType = "line";
|
|
67123
|
+
inner21(textNameEl).labelType = "nameLabel";
|
|
67124
|
+
inner21(textEl).labelType = "textLabel";
|
|
67125
|
+
inner21(group).y = labelY;
|
|
66985
67126
|
group.add(lineEl);
|
|
66986
67127
|
group.add(textEl);
|
|
66987
67128
|
group.add(textNameEl);
|
|
66988
67129
|
return group;
|
|
66989
67130
|
}
|
|
66990
67131
|
function updateLabel({x, y, labelData, markerModel, gridRect, position: position2, el, labelTextStyle}) {
|
|
66991
|
-
const {textStyle, lineStyle, showLine, showName
|
|
67132
|
+
const {textStyle, lineStyle, showLine, showName} = labelData;
|
|
66992
67133
|
const isLeft = position2 === "left";
|
|
66993
67134
|
if (el.ignore) {
|
|
66994
67135
|
el.ignore = false;
|
|
66995
67136
|
}
|
|
66996
67137
|
const labelY = y - 9;
|
|
66997
|
-
|
|
67138
|
+
inner21(el).y = labelY;
|
|
66998
67139
|
each(el.children(), (element) => {
|
|
66999
|
-
const labelType =
|
|
67140
|
+
const labelType = inner21(element).labelType;
|
|
67000
67141
|
switch (labelType) {
|
|
67001
67142
|
case "line":
|
|
67002
67143
|
if (!showLine) {
|
|
@@ -67005,9 +67146,9 @@ function updateLabel({x, y, labelData, markerModel, gridRect, position: position
|
|
|
67005
67146
|
}
|
|
67006
67147
|
element.attr({
|
|
67007
67148
|
shape: {
|
|
67008
|
-
x1: gridRect.x,
|
|
67149
|
+
x1: showName && isLeft ? gridRect.x - 10 : gridRect.x,
|
|
67009
67150
|
y1: y,
|
|
67010
|
-
x2: gridRect.x + gridRect.width,
|
|
67151
|
+
x2: showName && !isLeft ? gridRect.x + gridRect.width - 10 : gridRect.x + gridRect.width,
|
|
67011
67152
|
y2: y
|
|
67012
67153
|
},
|
|
67013
67154
|
style: lineStyle
|
|
@@ -67015,8 +67156,9 @@ function updateLabel({x, y, labelData, markerModel, gridRect, position: position
|
|
|
67015
67156
|
element.ignore = false;
|
|
67016
67157
|
break;
|
|
67017
67158
|
case "textLabel":
|
|
67018
|
-
const textLabel =
|
|
67019
|
-
|
|
67159
|
+
const textLabel = labelData.text;
|
|
67160
|
+
const labelX = isLeft ? getLeftTextX(x, textLabel, textStyle, markerModel.ecModel) : x;
|
|
67161
|
+
element.x = labelX + (labelTextStyle ? 1 : 0);
|
|
67020
67162
|
element.y = labelY;
|
|
67021
67163
|
element.attr("style", Object.assign({text: textLabel}, textStyle, labelTextStyle));
|
|
67022
67164
|
break;
|
|
@@ -67026,7 +67168,8 @@ function updateLabel({x, y, labelData, markerModel, gridRect, position: position
|
|
|
67026
67168
|
return;
|
|
67027
67169
|
}
|
|
67028
67170
|
const nameLabel = labelData.name;
|
|
67029
|
-
|
|
67171
|
+
const nameX = isLeft ? x : getLeftTextX(x, nameLabel, textStyle, markerModel.ecModel);
|
|
67172
|
+
element.x = nameX;
|
|
67030
67173
|
element.y = labelY;
|
|
67031
67174
|
element.attr("style", Object.assign({text: nameLabel}, textStyle, labelTextStyle));
|
|
67032
67175
|
element.ignore = false;
|
|
@@ -68082,9 +68225,9 @@ InsideZoomModel.defaultOption = inheritDefaultOption(DataZoomModel_default.defau
|
|
|
68082
68225
|
var InsideZoomModel_default = InsideZoomModel;
|
|
68083
68226
|
|
|
68084
68227
|
// src/component/dataZoom/roams.ts
|
|
68085
|
-
var
|
|
68228
|
+
var inner22 = makeInner();
|
|
68086
68229
|
function setViewInfoToCoordSysRecord(api2, dataZoomModel, getRange) {
|
|
68087
|
-
|
|
68230
|
+
inner22(api2).coordSysRecordMap.each(function(coordSysRecord) {
|
|
68088
68231
|
const dzInfo = coordSysRecord.dataZoomInfoMap.get(dataZoomModel.uid);
|
|
68089
68232
|
if (dzInfo) {
|
|
68090
68233
|
dzInfo.getRange = getRange;
|
|
@@ -68092,7 +68235,7 @@ function setViewInfoToCoordSysRecord(api2, dataZoomModel, getRange) {
|
|
|
68092
68235
|
});
|
|
68093
68236
|
}
|
|
68094
68237
|
function disposeCoordSysRecordIfNeeded(api2, dataZoomModel) {
|
|
68095
|
-
const coordSysRecordMap =
|
|
68238
|
+
const coordSysRecordMap = inner22(api2).coordSysRecordMap;
|
|
68096
68239
|
const coordSysKeyArr = coordSysRecordMap.keys();
|
|
68097
68240
|
for (let i = 0; i < coordSysKeyArr.length; i++) {
|
|
68098
68241
|
const coordSysKey = coordSysKeyArr[i];
|
|
@@ -68214,7 +68357,7 @@ function mergeControllerParams(dataZoomInfoMap) {
|
|
|
68214
68357
|
}
|
|
68215
68358
|
function installDataZoomRoamProcessor(registers) {
|
|
68216
68359
|
registers.registerProcessor(registers.PRIORITY.PROCESSOR.FILTER, function(ecModel, api2) {
|
|
68217
|
-
const apiInner =
|
|
68360
|
+
const apiInner = inner22(api2);
|
|
68218
68361
|
const coordSysRecordMap = apiInner.coordSysRecordMap || (apiInner.coordSysRecordMap = createHashMap());
|
|
68219
68362
|
coordSysRecordMap.each(function(coordSysRecord) {
|
|
68220
68363
|
coordSysRecord.dataZoomInfoMap = null;
|
|
@@ -70906,7 +71049,7 @@ var DEFAULT_OPTION = {
|
|
|
70906
71049
|
show: false
|
|
70907
71050
|
}
|
|
70908
71051
|
};
|
|
70909
|
-
var
|
|
71052
|
+
var inner23 = makeInner();
|
|
70910
71053
|
var decalPaletteScope = {};
|
|
70911
71054
|
function ariaVisual(ecModel, api2) {
|
|
70912
71055
|
const ariaModel = ecModel.getModel("aria");
|
|
@@ -70932,7 +71075,7 @@ function ariaVisual(ecModel, api2) {
|
|
|
70932
71075
|
decalScope = {};
|
|
70933
71076
|
paletteScopeGroupByType.set(seriesModel.type, decalScope);
|
|
70934
71077
|
}
|
|
70935
|
-
|
|
71078
|
+
inner23(seriesModel).scope = decalScope;
|
|
70936
71079
|
});
|
|
70937
71080
|
ecModel.eachRawSeries((seriesModel) => {
|
|
70938
71081
|
if (ecModel.isSeriesFiltered(seriesModel)) {
|
|
@@ -70946,7 +71089,7 @@ function ariaVisual(ecModel, api2) {
|
|
|
70946
71089
|
if (!seriesModel.isColorBySeries()) {
|
|
70947
71090
|
const dataAll = seriesModel.getRawData();
|
|
70948
71091
|
const idxMap = {};
|
|
70949
|
-
const decalScope =
|
|
71092
|
+
const decalScope = inner23(seriesModel).scope;
|
|
70950
71093
|
data.each(function(idx) {
|
|
70951
71094
|
const rawIdx = data.getRawIndex(idx);
|
|
70952
71095
|
idxMap[rawIdx] = idx;
|