tvcharts 0.7.54 → 0.7.56
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 +63 -39
- package/dist/echarts.js.map +2 -2
- package/lib/chart/barPlot/BarPlotSeries.js +1 -0
- package/lib/chart/candlePlot/CandlePlotSeries.js +1 -0
- package/lib/chart/fills/FillsSeries.js +2 -1
- package/lib/chart/mineLines/MineLinesSeries.js +1 -0
- package/lib/chart/minePolyLines/MinePolyLinesSeries.js +1 -0
- package/lib/component/axisPointer/AxisPointerView.js +29 -21
- package/lib/component/dataZoom/AxisProxy.js +3 -2
- package/lib/coord/axisHelper.js +1 -0
- package/lib/coord/cartesian/Cartesian2D.js +3 -3
- package/lib/coord/cartesian/Grid.js +5 -4
- package/lib/core/echarts.js +7 -1
- package/lib/data/DataStore.js +21 -0
- package/lib/data/SeriesData.js +7 -0
- package/lib/scale/Percentage.js +11 -3
- package/package.json +1 -1
- package/types/dist/echarts.d.ts +5 -0
- package/types/dist/shared.d.ts +5 -0
- package/types/src/component/tooltip/TooltipModel.d.ts +1 -0
- package/types/src/data/DataStore.d.ts +1 -0
- package/types/src/data/SeriesData.d.ts +1 -0
- package/types/src/util/types.d.ts +2 -0
package/dist/echarts.js
CHANGED
|
@@ -7238,7 +7238,7 @@ function getElementSSRData(el) {
|
|
|
7238
7238
|
function registerSSRDataGetter(getter) {
|
|
7239
7239
|
ssrDataGetter = getter;
|
|
7240
7240
|
}
|
|
7241
|
-
var version = "5.6.
|
|
7241
|
+
var version = "5.6.76";
|
|
7242
7242
|
|
|
7243
7243
|
// src/util/number.ts
|
|
7244
7244
|
var RADIAN_EPSILON = 1e-4;
|
|
@@ -19140,6 +19140,27 @@ var DataStore2 = class {
|
|
|
19140
19140
|
const dimStore = this._chunks[dim];
|
|
19141
19141
|
return dimStore ? dimStore[this.getRawIndex(idx)] : NaN;
|
|
19142
19142
|
}
|
|
19143
|
+
getBaseValue(dim) {
|
|
19144
|
+
const dimStore = this._chunks[dim];
|
|
19145
|
+
if (!dimStore) {
|
|
19146
|
+
return;
|
|
19147
|
+
}
|
|
19148
|
+
if (this._indices) {
|
|
19149
|
+
for (let i = 0; i < this._indices.length; i++) {
|
|
19150
|
+
const index = this._indices[i];
|
|
19151
|
+
if (!Number.isNaN(dimStore[index])) {
|
|
19152
|
+
return dimStore[index];
|
|
19153
|
+
}
|
|
19154
|
+
}
|
|
19155
|
+
return;
|
|
19156
|
+
}
|
|
19157
|
+
for (let index = 0; index < dimStore.length; index++) {
|
|
19158
|
+
const value = dimStore[index];
|
|
19159
|
+
if (!Number.isNaN(value)) {
|
|
19160
|
+
return value;
|
|
19161
|
+
}
|
|
19162
|
+
}
|
|
19163
|
+
}
|
|
19143
19164
|
getValues(dimensions, idx) {
|
|
19144
19165
|
const values = [];
|
|
19145
19166
|
let dimArr = [];
|
|
@@ -25114,7 +25135,10 @@ var ECharts = class extends Eventful_default {
|
|
|
25114
25135
|
});
|
|
25115
25136
|
const markLabelModal = this._model.getComponent("markLabel", 0);
|
|
25116
25137
|
markLabelModal.mergeOption(data, this._model);
|
|
25117
|
-
|
|
25138
|
+
const view = this.getViewOfComponentModel(markLabelModal);
|
|
25139
|
+
if (view) {
|
|
25140
|
+
view.render(markLabelModal, this._model, this._api, {type: "markLabel"});
|
|
25141
|
+
}
|
|
25118
25142
|
}
|
|
25119
25143
|
}
|
|
25120
25144
|
};
|
|
@@ -25908,7 +25932,6 @@ ECharts.internalField = function() {
|
|
|
25908
25932
|
ecIns.selectedComponentGroupId = id;
|
|
25909
25933
|
ecIns.trigger("selectidchanged", id);
|
|
25910
25934
|
updateMethods.update.call(ecIns);
|
|
25911
|
-
console.log("\u56FE\u5F62\u66F4\u65B0");
|
|
25912
25935
|
}
|
|
25913
25936
|
getSelectedComponentGroupId() {
|
|
25914
25937
|
return ecIns.selectedComponentGroupId;
|
|
@@ -27022,6 +27045,13 @@ var SeriesData2 = class {
|
|
|
27022
27045
|
return store.get(dimInfo.storeDimIndex, idx);
|
|
27023
27046
|
}
|
|
27024
27047
|
}
|
|
27048
|
+
getBaseValue(dim) {
|
|
27049
|
+
const store = this._store;
|
|
27050
|
+
const dimInfo = this._dimInfos[dim];
|
|
27051
|
+
if (dimInfo) {
|
|
27052
|
+
return store.getBaseValue(dimInfo.storeDimIndex);
|
|
27053
|
+
}
|
|
27054
|
+
}
|
|
27025
27055
|
getByRawIndex(dim, rawIdx) {
|
|
27026
27056
|
const store = this._store;
|
|
27027
27057
|
const dimInfo = this._dimInfos[dim];
|
|
@@ -29450,10 +29480,14 @@ var PercentageScale = class extends Scale_default {
|
|
|
29450
29480
|
}
|
|
29451
29481
|
parsePercentageValue(value, baseValue) {
|
|
29452
29482
|
const fromValue = baseValue !== void 0 ? +baseValue : this._fromValue;
|
|
29453
|
-
|
|
29483
|
+
const result = (value - fromValue) / fromValue * 100;
|
|
29484
|
+
return fromValue < 0 ? -result : result;
|
|
29454
29485
|
}
|
|
29455
29486
|
restorePercentageValue(value, baseValue) {
|
|
29456
29487
|
const fromValue = baseValue !== void 0 ? +baseValue : this._fromValue;
|
|
29488
|
+
if (fromValue < 0) {
|
|
29489
|
+
value = -value;
|
|
29490
|
+
}
|
|
29457
29491
|
return value / 100 * fromValue + fromValue;
|
|
29458
29492
|
}
|
|
29459
29493
|
getExtent() {
|
|
@@ -29465,14 +29499,14 @@ var PercentageScale = class extends Scale_default {
|
|
|
29465
29499
|
return extent3;
|
|
29466
29500
|
}
|
|
29467
29501
|
unionExtent(extent3, baseValue) {
|
|
29468
|
-
this._originalScale.unionExtent(extent3);
|
|
29469
29502
|
extent3[0] = this.parsePercentageValue(extent3[0], baseValue);
|
|
29470
29503
|
extent3[1] = this.parsePercentageValue(extent3[1], baseValue);
|
|
29471
29504
|
scaleProto2.unionExtent.call(this, extent3, baseValue);
|
|
29505
|
+
this._originalScale.unionExtent(extent3);
|
|
29472
29506
|
}
|
|
29473
29507
|
unionExtentFromData(data, dim, baseValue) {
|
|
29474
29508
|
if (dim === this._baseDim || !this._fromValue) {
|
|
29475
|
-
this._fromValue = data.get(this._baseDim, 0);
|
|
29509
|
+
this._fromValue = data.get(this._baseDim, 0) ?? +baseValue;
|
|
29476
29510
|
}
|
|
29477
29511
|
this.unionExtent(data.getApproximateExtent(dim), baseValue);
|
|
29478
29512
|
}
|
|
@@ -39289,7 +39323,14 @@ var Cartesian2D = class extends Cartesian_default {
|
|
|
39289
39323
|
return new BoundingRect_default(x, y, width, height);
|
|
39290
39324
|
}
|
|
39291
39325
|
getBaseValue() {
|
|
39292
|
-
|
|
39326
|
+
let baseValue;
|
|
39327
|
+
const seriesModal = this.seriesModal;
|
|
39328
|
+
if (seriesModal) {
|
|
39329
|
+
const seriesData = seriesModal.getData();
|
|
39330
|
+
const dim = seriesModal.option.baseDim || "y";
|
|
39331
|
+
baseValue = seriesData.getBaseValue(dim);
|
|
39332
|
+
}
|
|
39333
|
+
return baseValue;
|
|
39293
39334
|
}
|
|
39294
39335
|
};
|
|
39295
39336
|
var Cartesian2D_default = Cartesian2D;
|
|
@@ -39720,14 +39761,14 @@ var Grid2 = class {
|
|
|
39720
39761
|
unionExtent(data, xAxis);
|
|
39721
39762
|
const dataFromSeriesName = yAxis.model.get("dataFromSeriesName");
|
|
39722
39763
|
if (!dataFromSeriesName || dataFromSeriesName === seriesModel.name) {
|
|
39723
|
-
|
|
39764
|
+
const baseDim = seriesModel.option.baseDim || "y";
|
|
39765
|
+
const baseValue = data.getBaseValue(baseDim);
|
|
39766
|
+
unionExtent(data, yAxis, baseValue);
|
|
39724
39767
|
}
|
|
39725
39768
|
}
|
|
39726
39769
|
}, this);
|
|
39727
|
-
function unionExtent(data, axis) {
|
|
39770
|
+
function unionExtent(data, axis, baseValue) {
|
|
39728
39771
|
const axisDims = getDataDimensionsOnAxis(data, axis.dim);
|
|
39729
|
-
const baseDim = axisDims.includes("close") ? "close" : "y";
|
|
39730
|
-
const baseValue = data.get(baseDim, 0);
|
|
39731
39772
|
each(axisDims, function(dim) {
|
|
39732
39773
|
axis.scale.unionExtentFromData(data, dim, baseValue);
|
|
39733
39774
|
});
|
|
@@ -39773,10 +39814,7 @@ var Grid2 = class {
|
|
|
39773
39814
|
seriesModel.coordinateSystem = grid.getCartesian(xAxisModel.componentIndex, yAxisModel.componentIndex);
|
|
39774
39815
|
const copy3 = Object.create(Object.getPrototypeOf(seriesModel.coordinateSystem));
|
|
39775
39816
|
seriesModel.coordinateSystem = Object.assign(copy3, seriesModel.coordinateSystem);
|
|
39776
|
-
|
|
39777
|
-
const dim = isCandle(seriesModel.subType) ? "close" : "y";
|
|
39778
|
-
const baseValue = seriesData.get(dim, 0);
|
|
39779
|
-
seriesModel.coordinateSystem.baseValue = baseValue;
|
|
39817
|
+
seriesModel.coordinateSystem.seriesModal = seriesModel;
|
|
39780
39818
|
});
|
|
39781
39819
|
return grids;
|
|
39782
39820
|
}
|
|
@@ -57162,6 +57200,7 @@ MineLinesSeriesModel.defaultOption = {
|
|
|
57162
57200
|
x: ["extend", "x1", "x2"],
|
|
57163
57201
|
y: ["y1", "y2"]
|
|
57164
57202
|
},
|
|
57203
|
+
baseDim: "y1",
|
|
57165
57204
|
large: true,
|
|
57166
57205
|
largeThreshold: 600,
|
|
57167
57206
|
clip: true,
|
|
@@ -57477,6 +57516,7 @@ MinePolyLinesSeriesModel.defaultOption = {
|
|
|
57477
57516
|
x: ["x1", "x2"],
|
|
57478
57517
|
y: ["y1", "y2"]
|
|
57479
57518
|
},
|
|
57519
|
+
baseDim: "y1",
|
|
57480
57520
|
emphasis: {
|
|
57481
57521
|
emphasisState: {
|
|
57482
57522
|
zlevel: 1
|
|
@@ -58575,6 +58615,7 @@ CandlePlotSeriesModel.defaultOption = {
|
|
|
58575
58615
|
borderColorDoji: null,
|
|
58576
58616
|
borderWidth: 1
|
|
58577
58617
|
},
|
|
58618
|
+
baseDim: "close",
|
|
58578
58619
|
emphasis: {
|
|
58579
58620
|
emphasisState: {
|
|
58580
58621
|
zlevel: 1
|
|
@@ -58866,6 +58907,7 @@ BarPlotSeriesModel.defaultOption = {
|
|
|
58866
58907
|
color0: "#47b262",
|
|
58867
58908
|
borderWidth: 1
|
|
58868
58909
|
},
|
|
58910
|
+
baseDim: "close",
|
|
58869
58911
|
emphasis: {
|
|
58870
58912
|
emphasisState: {
|
|
58871
58913
|
zlevel: 1
|
|
@@ -60044,7 +60086,8 @@ FillsSeriesModel.defaultOption = {
|
|
|
60044
60086
|
encode: {
|
|
60045
60087
|
x: ["x"],
|
|
60046
60088
|
y: ["plot1", "plot2"]
|
|
60047
|
-
}
|
|
60089
|
+
},
|
|
60090
|
+
baseDim: "plot1"
|
|
60048
60091
|
};
|
|
60049
60092
|
var FillsSeries_default = FillsSeriesModel;
|
|
60050
60093
|
|
|
@@ -64545,9 +64588,6 @@ function makeSectorShape(cx, cy, r0, r, startAngle, endAngle) {
|
|
|
64545
64588
|
clockwise: true
|
|
64546
64589
|
};
|
|
64547
64590
|
}
|
|
64548
|
-
function findClosestValue(target, numbers) {
|
|
64549
|
-
return numbers.reduce((closest, current) => Math.abs(current - target) < Math.abs(closest - target) ? current : closest);
|
|
64550
|
-
}
|
|
64551
64591
|
|
|
64552
64592
|
// src/component/axisPointer/CartesianAxisPointer.ts
|
|
64553
64593
|
var CartesianAxisPointer = class extends BaseAxisPointer_default {
|
|
@@ -64785,7 +64825,6 @@ var AxisPointerView2 = class extends Component_default2 {
|
|
|
64785
64825
|
const yAxisModel = ecModel.getComponent("yAxis");
|
|
64786
64826
|
const globalTooltipModel = ecModel.getComponent("tooltip");
|
|
64787
64827
|
const triggerOn = globalAxisPointerModel.get("triggerOn") || (globalTooltipModel && globalTooltipModel.get("triggerOn") || "mousemove|click|mousewheel");
|
|
64788
|
-
const magnet = globalTooltipModel?.get("magnet");
|
|
64789
64828
|
const payload = ecModel.getUpdatePayload();
|
|
64790
64829
|
const isDataZoom = payload?.type === "dataZoom";
|
|
64791
64830
|
const handleAxisPointer = (currTrigger, e2, dispatchAction3) => {
|
|
@@ -64795,29 +64834,14 @@ var AxisPointerView2 = class extends Component_default2 {
|
|
|
64795
64834
|
if (currTrigger === "mouseup") {
|
|
64796
64835
|
this.xLock = false;
|
|
64797
64836
|
}
|
|
64837
|
+
const updatePointDisable = globalTooltipModel.option.updatePointDisable;
|
|
64838
|
+
if (updatePointDisable) {
|
|
64839
|
+
return;
|
|
64840
|
+
}
|
|
64798
64841
|
if (triggerOn !== "none" && (currTrigger === "leave" || triggerOn.indexOf(currTrigger) >= 0)) {
|
|
64799
64842
|
let x = e2 && e2.offsetX;
|
|
64800
64843
|
let y = e2 && e2.offsetY;
|
|
64801
64844
|
const lastXIndex = xAxisModel?.get("axisPointer").value;
|
|
64802
|
-
if (e2 && magnet === "magnet" && currTrigger === "mousemove") {
|
|
64803
|
-
const xData = xAxisModel.axis.pointToData([e2.offsetX, e2.offsetY]);
|
|
64804
|
-
const yData = yAxisModel.axis.pointToData([e2.offsetX, e2.offsetY]);
|
|
64805
|
-
const seriesModel = ecModel.getSeriesByIndex(0);
|
|
64806
|
-
if (!seriesModel) {
|
|
64807
|
-
return;
|
|
64808
|
-
}
|
|
64809
|
-
const data = seriesModel.getData();
|
|
64810
|
-
const xDataDim = data.mapDimensionsAll(xAxisModel.axis.dim);
|
|
64811
|
-
const dataIndices = data.indicesOfNearest(xDataDim[0], xData, xAxisModel.axis.type === "category" ? 0.5 : null);
|
|
64812
|
-
if (dataIndices) {
|
|
64813
|
-
const yDataSource = data.getRawDataItem(dataIndices[0]);
|
|
64814
|
-
if (Array.isArray(yDataSource)) {
|
|
64815
|
-
const dataSource = yDataSource.slice(1);
|
|
64816
|
-
const newDataY = findClosestValue(yData, dataSource);
|
|
64817
|
-
y = yAxisModel.axis.toGlobalCoord(yAxisModel.axis.dataToCoord(newDataY));
|
|
64818
|
-
}
|
|
64819
|
-
}
|
|
64820
|
-
}
|
|
64821
64845
|
if (e2 && this.xLock && typeof lastXIndex === "number") {
|
|
64822
64846
|
const dataZoomModal = ecModel.getComponent("dataZoom");
|
|
64823
64847
|
const zoomDisabled = dataZoomModal ? dataZoomModal.get("disabled") || dataZoomModal.get("moveOnMouseMove") === false : true;
|