tvcharts 0.6.56 → 0.6.58
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 +287 -196
- package/dist/echarts.js.map +2 -2
- package/lib/chart/labels/LabelsSeries.js +30 -0
- package/lib/component/table/TableModel.js +10 -0
- package/lib/component/table/TableView.js +13 -2
- package/lib/core/echarts.js +41 -49
- package/lib/data/DataStore.js +10 -0
- package/lib/data/SeriesData.js +8 -0
- package/lib/data/helper/dataProvider.js +10 -3
- package/lib/model/Series.js +17 -1
- package/package.json +1 -1
- package/types/dist/echarts.d.ts +8 -0
- package/types/dist/shared.d.ts +8 -0
- package/types/src/chart/labels/LabelsSeries.d.ts +5 -1
- package/types/src/component/table/TableModel.d.ts +4 -1
- package/types/src/data/DataStore.d.ts +1 -0
- package/types/src/data/SeriesData.d.ts +5 -0
- package/types/src/data/helper/dataProvider.d.ts +2 -0
- package/types/src/model/Series.d.ts +1 -0
package/dist/echarts.js
CHANGED
|
@@ -17802,6 +17802,8 @@ var DefaultDataProvider2 = class {
|
|
|
17802
17802
|
}
|
|
17803
17803
|
appendData(newData) {
|
|
17804
17804
|
}
|
|
17805
|
+
resetData(newData) {
|
|
17806
|
+
}
|
|
17805
17807
|
updateData(newData) {
|
|
17806
17808
|
return {update: 0};
|
|
17807
17809
|
}
|
|
@@ -17873,7 +17875,8 @@ DefaultDataProvider.internalField = function() {
|
|
|
17873
17875
|
[SOURCE_FORMAT_ARRAY_ROWS + "_" + SERIES_LAYOUT_BY_COLUMN]: {
|
|
17874
17876
|
pure: true,
|
|
17875
17877
|
appendData: appendDataSimply,
|
|
17876
|
-
updateData: updateDataSimply
|
|
17878
|
+
updateData: updateDataSimply,
|
|
17879
|
+
resetData: resetDataSimply
|
|
17877
17880
|
},
|
|
17878
17881
|
[SOURCE_FORMAT_ARRAY_ROWS + "_" + SERIES_LAYOUT_BY_ROW]: {
|
|
17879
17882
|
pure: true,
|
|
@@ -17884,7 +17887,8 @@ DefaultDataProvider.internalField = function() {
|
|
|
17884
17887
|
[SOURCE_FORMAT_OBJECT_ROWS]: {
|
|
17885
17888
|
pure: true,
|
|
17886
17889
|
appendData: appendDataSimply,
|
|
17887
|
-
updateData: updateDataSimply
|
|
17890
|
+
updateData: updateDataSimply,
|
|
17891
|
+
resetData: resetDataSimply
|
|
17888
17892
|
},
|
|
17889
17893
|
[SOURCE_FORMAT_KEYED_COLUMNS]: {
|
|
17890
17894
|
pure: true,
|
|
@@ -17900,7 +17904,8 @@ DefaultDataProvider.internalField = function() {
|
|
|
17900
17904
|
},
|
|
17901
17905
|
[SOURCE_FORMAT_ORIGINAL]: {
|
|
17902
17906
|
appendData: appendDataSimply,
|
|
17903
|
-
updateData: updateDataSimply
|
|
17907
|
+
updateData: updateDataSimply,
|
|
17908
|
+
resetData: resetDataSimply
|
|
17904
17909
|
},
|
|
17905
17910
|
[SOURCE_FORMAT_TYPED_ARRAY]: {
|
|
17906
17911
|
persistent: false,
|
|
@@ -17922,6 +17927,9 @@ DefaultDataProvider.internalField = function() {
|
|
|
17922
17927
|
this._data.push(newData[i]);
|
|
17923
17928
|
}
|
|
17924
17929
|
}
|
|
17930
|
+
function resetDataSimply(newData) {
|
|
17931
|
+
this._data = newData;
|
|
17932
|
+
}
|
|
17925
17933
|
function updateDataSimply(newData) {
|
|
17926
17934
|
const data = this._data;
|
|
17927
17935
|
let lastIndex = data.length - 1;
|
|
@@ -18873,6 +18881,16 @@ var DataStore2 = class {
|
|
|
18873
18881
|
}
|
|
18874
18882
|
return [start2, end2];
|
|
18875
18883
|
}
|
|
18884
|
+
resetUpdateData(data) {
|
|
18885
|
+
if (true) {
|
|
18886
|
+
assert(!this._indices, "appendData can only be called on raw data.");
|
|
18887
|
+
}
|
|
18888
|
+
const provider = this._provider;
|
|
18889
|
+
provider.resetData(data);
|
|
18890
|
+
const end2 = provider.count();
|
|
18891
|
+
this._initDataFromProvider(0, end2);
|
|
18892
|
+
return [0, end2];
|
|
18893
|
+
}
|
|
18876
18894
|
updateData(data) {
|
|
18877
18895
|
if (true) {
|
|
18878
18896
|
assert(!this._indices, "appendData can only be called on raw data.");
|
|
@@ -20064,6 +20082,7 @@ var SeriesModel2 = class extends Component_default {
|
|
|
20064
20082
|
inner2(this).dataBeforeProcessed = data;
|
|
20065
20083
|
autoSeriesName(this);
|
|
20066
20084
|
this._initSelectedMapFromData(data);
|
|
20085
|
+
console.log("%c [ data ]-241", "font-size:13px; background:pink; color:#bf2c9f;", data);
|
|
20067
20086
|
}
|
|
20068
20087
|
mergeDefaultAndTheme(option, ecModel) {
|
|
20069
20088
|
const layoutMode = fetchLayoutMode(this);
|
|
@@ -20121,7 +20140,18 @@ var SeriesModel2 = class extends Component_default {
|
|
|
20121
20140
|
}
|
|
20122
20141
|
updateData(params) {
|
|
20123
20142
|
const data = this.getRawData();
|
|
20124
|
-
|
|
20143
|
+
const formatData = this.getFormatUpdateData(params.data);
|
|
20144
|
+
if (formatData) {
|
|
20145
|
+
data.resetUpdateData(formatData);
|
|
20146
|
+
return;
|
|
20147
|
+
}
|
|
20148
|
+
const lastIndex = data.count(true) - 1;
|
|
20149
|
+
const list = map(params.data, (item, index) => {
|
|
20150
|
+
const idx = lastIndex + index;
|
|
20151
|
+
item.value[0] = idx;
|
|
20152
|
+
return item;
|
|
20153
|
+
});
|
|
20154
|
+
data.updateData(list);
|
|
20125
20155
|
}
|
|
20126
20156
|
getData(dataType) {
|
|
20127
20157
|
const task = getCurrentTask(this);
|
|
@@ -20278,6 +20308,9 @@ var SeriesModel2 = class extends Component_default {
|
|
|
20278
20308
|
}
|
|
20279
20309
|
return universalTransitionOpt && universalTransitionOpt.enabled;
|
|
20280
20310
|
}
|
|
20311
|
+
getFormatUpdateData(data) {
|
|
20312
|
+
return;
|
|
20313
|
+
}
|
|
20281
20314
|
_innerSelect(data, innerDataIndices) {
|
|
20282
20315
|
const option = this.option;
|
|
20283
20316
|
const selectedMode = option.selectedMode;
|
|
@@ -24487,15 +24520,14 @@ var ECharts = class extends Eventful_default {
|
|
|
24487
24520
|
disposedWarning(this.id);
|
|
24488
24521
|
return;
|
|
24489
24522
|
}
|
|
24490
|
-
let firstSeriesModel = void 0;
|
|
24491
|
-
let isUpdateData = false;
|
|
24492
24523
|
each(batch, (params, index) => {
|
|
24493
24524
|
const ecModel = this.getModel();
|
|
24494
24525
|
const seriesIndex = params.seriesIndex;
|
|
24495
24526
|
const seriesName = params.seriesName;
|
|
24496
24527
|
if (params.type === "component") {
|
|
24497
|
-
const tableModal = ecModel.findComponents({mainType: "table"})[0];
|
|
24498
|
-
|
|
24528
|
+
const tableModal = ecModel.findComponents({mainType: "table", query: {name: seriesName}})[0];
|
|
24529
|
+
tableModal.mergeTables(params.data);
|
|
24530
|
+
tableModal.setAbleDataZoomUpdate(true);
|
|
24499
24531
|
return;
|
|
24500
24532
|
}
|
|
24501
24533
|
const seriesModel = seriesIndex !== void 0 ? ecModel.getSeriesByIndex(seriesIndex) : ecModel.getSeriesByName(seriesName)[0];
|
|
@@ -24504,80 +24536,68 @@ var ECharts = class extends Eventful_default {
|
|
|
24504
24536
|
}
|
|
24505
24537
|
const seriesData = seriesModel.getData();
|
|
24506
24538
|
const lastIndex = seriesData.count(true) - 1;
|
|
24507
|
-
const scale5 = seriesModel.coordinateSystem.getBaseAxis().scale;
|
|
24508
|
-
const ordinalMeta = scale5.getOrdinalMeta();
|
|
24509
24539
|
const isUpdate = params.operation === "update";
|
|
24510
24540
|
if (isUpdate) {
|
|
24511
24541
|
seriesModel.updateValue({data: map(params.data, (item, index2) => {
|
|
24512
24542
|
const idx = lastIndex + index2;
|
|
24513
|
-
|
|
24543
|
+
const value = item.slice(1);
|
|
24544
|
+
seriesModel.option.data[idx] = value.length === 1 ? value[0] : value;
|
|
24514
24545
|
item[0] = idx;
|
|
24515
24546
|
return item;
|
|
24516
24547
|
})});
|
|
24517
|
-
isUpdateData = true;
|
|
24518
24548
|
} else if (params.operation === "script") {
|
|
24519
|
-
|
|
24520
|
-
const data = map(params.data, (item, index2) => {
|
|
24521
|
-
const idx = lastIndex + index2;
|
|
24522
|
-
if (index2 !== 0) {
|
|
24523
|
-
categories.push(item.value[0]);
|
|
24524
|
-
}
|
|
24525
|
-
item.value[0] = idx;
|
|
24526
|
-
return item;
|
|
24527
|
-
});
|
|
24528
|
-
if (params.isMainSeries && data.length > 1) {
|
|
24529
|
-
ordinalMeta.appendData(categories);
|
|
24530
|
-
}
|
|
24531
|
-
seriesModel.updateData({data});
|
|
24549
|
+
seriesModel.updateData({data: params.data});
|
|
24532
24550
|
} else {
|
|
24533
|
-
const categories = [];
|
|
24534
24551
|
const formatData = map(params.data, (item) => {
|
|
24535
|
-
const idx = lastIndex +
|
|
24536
|
-
seriesModel.option.data[idx] = item.slice(1);
|
|
24537
|
-
categories.push(item[0]);
|
|
24552
|
+
const idx = lastIndex + 1;
|
|
24538
24553
|
item[0] = idx;
|
|
24539
24554
|
return item;
|
|
24540
24555
|
});
|
|
24541
|
-
if (params.isMainSeries) {
|
|
24542
|
-
ordinalMeta.appendData(categories);
|
|
24543
|
-
}
|
|
24544
24556
|
seriesModel.appendData({data: formatData});
|
|
24545
24557
|
}
|
|
24546
|
-
if (!firstSeriesModel) {
|
|
24547
|
-
firstSeriesModel = seriesModel;
|
|
24548
|
-
}
|
|
24549
24558
|
});
|
|
24550
|
-
if (!firstSeriesModel) {
|
|
24551
|
-
return;
|
|
24552
|
-
}
|
|
24553
|
-
const coordSys = firstSeriesModel.coordinateSystem;
|
|
24554
|
-
const baseAxis = coordSys.getBaseAxis();
|
|
24555
|
-
const scale4 = baseAxis.scale;
|
|
24556
|
-
const isMove = !isUpdateData && scale4.lastBarRightSideDiffBarCount < 1.5;
|
|
24557
|
-
const payload = {
|
|
24558
|
-
type: "dataZoom",
|
|
24559
|
-
barSpace: scale4.barSpace,
|
|
24560
|
-
lastBarRightSideDiffBarCount: isMove ? scale4.lastBarRightSideDiffBarCount - 1 : scale4.lastBarRightSideDiffBarCount
|
|
24561
|
-
};
|
|
24562
|
-
doDispatchAction.call(this, payload, true);
|
|
24563
24559
|
}
|
|
24564
|
-
updateXAxisData(time) {
|
|
24560
|
+
updateXAxisData(time, isAdd = true, connect2 = true) {
|
|
24565
24561
|
if (this._disposed) {
|
|
24566
24562
|
disposedWarning(this.id);
|
|
24567
24563
|
return;
|
|
24568
24564
|
}
|
|
24569
|
-
const
|
|
24570
|
-
|
|
24571
|
-
|
|
24572
|
-
|
|
24573
|
-
|
|
24574
|
-
|
|
24565
|
+
const groupId = this.group;
|
|
24566
|
+
if (connect2 && connectedGroups[groupId]) {
|
|
24567
|
+
each(instances2, function(chart) {
|
|
24568
|
+
if (chart.group !== groupId) {
|
|
24569
|
+
return;
|
|
24570
|
+
}
|
|
24571
|
+
const xAxisModal = chart._model.getComponent("xAxis", 0);
|
|
24572
|
+
const scale4 = xAxisModal.axis.scale;
|
|
24573
|
+
const ordinalMeta = scale4.getOrdinalMeta();
|
|
24574
|
+
const lastTime = ordinalMeta.getLastCategories();
|
|
24575
|
+
const isMove = isAdd && scale4.lastBarRightSideDiffBarCount < 1.5 && lastTime !== time;
|
|
24576
|
+
if (isAdd && lastTime !== time) {
|
|
24577
|
+
ordinalMeta.appendData([time]);
|
|
24578
|
+
}
|
|
24579
|
+
const payload = {
|
|
24580
|
+
type: "dataZoom",
|
|
24581
|
+
barSpace: scale4.barSpace,
|
|
24582
|
+
lastBarRightSideDiffBarCount: isMove ? scale4.lastBarRightSideDiffBarCount - 1 : scale4.lastBarRightSideDiffBarCount
|
|
24583
|
+
};
|
|
24584
|
+
doDispatchAction.call(chart, payload, false);
|
|
24585
|
+
});
|
|
24586
|
+
} else {
|
|
24587
|
+
const xAxisModal = this._model.getComponent("xAxis", 0);
|
|
24588
|
+
const scale4 = xAxisModal.axis.scale;
|
|
24589
|
+
const ordinalMeta = scale4.getOrdinalMeta();
|
|
24590
|
+
const lastTime = ordinalMeta.getLastCategories();
|
|
24591
|
+
const isMove = isAdd && scale4.lastBarRightSideDiffBarCount < 1.5;
|
|
24592
|
+
if (isAdd && lastTime !== time) {
|
|
24593
|
+
ordinalMeta.appendData([time]);
|
|
24594
|
+
}
|
|
24575
24595
|
const payload = {
|
|
24576
24596
|
type: "dataZoom",
|
|
24577
24597
|
barSpace: scale4.barSpace,
|
|
24578
|
-
lastBarRightSideDiffBarCount:
|
|
24598
|
+
lastBarRightSideDiffBarCount: isMove && lastTime !== time ? scale4.lastBarRightSideDiffBarCount - 1 : scale4.lastBarRightSideDiffBarCount
|
|
24579
24599
|
};
|
|
24580
|
-
doDispatchAction.call(this, payload,
|
|
24600
|
+
doDispatchAction.call(this, payload, false);
|
|
24581
24601
|
}
|
|
24582
24602
|
}
|
|
24583
24603
|
scrollByDistance(distance2, animationDuration) {
|
|
@@ -26320,6 +26340,10 @@ var SeriesData2 = class {
|
|
|
26320
26340
|
const range = this._store.updateData(data);
|
|
26321
26341
|
this._doInit(range[0], range[1]);
|
|
26322
26342
|
}
|
|
26343
|
+
resetUpdateData(data) {
|
|
26344
|
+
const range = this._store.resetUpdateData(data);
|
|
26345
|
+
this._doInit(range[0], range[1]);
|
|
26346
|
+
}
|
|
26323
26347
|
updateValue(value) {
|
|
26324
26348
|
this._store.updateValue(value);
|
|
26325
26349
|
}
|
|
@@ -55764,145 +55788,163 @@ var StrategyView2 = class extends Chart_default {
|
|
|
55764
55788
|
const symbolGroup = this._symbolGroup;
|
|
55765
55789
|
const z2 = seriesModel.get("z2");
|
|
55766
55790
|
const upTriangle = data.getLayout("upTriangle");
|
|
55767
|
-
|
|
55768
|
-
|
|
55769
|
-
|
|
55770
|
-
|
|
55771
|
-
|
|
55772
|
-
|
|
55773
|
-
|
|
55774
|
-
|
|
55775
|
-
|
|
55776
|
-
|
|
55777
|
-
|
|
55778
|
-
|
|
55791
|
+
if (upTriangle && upTriangle.length) {
|
|
55792
|
+
const upTriangleEl = new SymbolPath_default2({
|
|
55793
|
+
shape: {
|
|
55794
|
+
points: upTriangle,
|
|
55795
|
+
size: TriangleSize
|
|
55796
|
+
},
|
|
55797
|
+
style: {
|
|
55798
|
+
fill: LongColor
|
|
55799
|
+
},
|
|
55800
|
+
z2
|
|
55801
|
+
});
|
|
55802
|
+
upTriangleEl.symbolProxy = createSymbol("triangleRight", 0, 0, 0, 0);
|
|
55803
|
+
symbolGroup.add(upTriangleEl);
|
|
55804
|
+
}
|
|
55779
55805
|
const closeUpTriangle = data.getLayout("closeUpTriangle");
|
|
55780
|
-
|
|
55781
|
-
|
|
55782
|
-
|
|
55783
|
-
|
|
55784
|
-
|
|
55785
|
-
|
|
55786
|
-
|
|
55787
|
-
|
|
55788
|
-
|
|
55789
|
-
|
|
55790
|
-
|
|
55791
|
-
|
|
55806
|
+
if (closeUpTriangle && closeUpTriangle.length) {
|
|
55807
|
+
const closeUpTriangleEl = new SymbolPath_default2({
|
|
55808
|
+
shape: {
|
|
55809
|
+
points: closeUpTriangle,
|
|
55810
|
+
size: TriangleSize
|
|
55811
|
+
},
|
|
55812
|
+
style: {
|
|
55813
|
+
fill: CloseColor
|
|
55814
|
+
},
|
|
55815
|
+
z2
|
|
55816
|
+
});
|
|
55817
|
+
closeUpTriangleEl.symbolProxy = createSymbol("triangleRight", 0, 0, 0, 0);
|
|
55818
|
+
symbolGroup.add(closeUpTriangleEl);
|
|
55819
|
+
}
|
|
55792
55820
|
const upArrow = data.getLayout("upArrow");
|
|
55793
|
-
|
|
55794
|
-
|
|
55795
|
-
|
|
55796
|
-
|
|
55797
|
-
|
|
55798
|
-
|
|
55799
|
-
|
|
55800
|
-
|
|
55801
|
-
|
|
55802
|
-
|
|
55803
|
-
|
|
55804
|
-
|
|
55805
|
-
|
|
55806
|
-
|
|
55807
|
-
|
|
55808
|
-
|
|
55809
|
-
|
|
55821
|
+
if (upArrow && upArrow.length) {
|
|
55822
|
+
const arrowUpEl = new SymbolPath_default2({
|
|
55823
|
+
shape: {
|
|
55824
|
+
points: upArrow,
|
|
55825
|
+
size: ArrowSize
|
|
55826
|
+
},
|
|
55827
|
+
style: {
|
|
55828
|
+
fill: LongColor
|
|
55829
|
+
},
|
|
55830
|
+
z2
|
|
55831
|
+
});
|
|
55832
|
+
arrowUpEl.symbolProxy = createSymbol("arrowUp", 0, 0, 0, 0);
|
|
55833
|
+
arrowUpEl.symbolProxy.shape = {
|
|
55834
|
+
...arrowUpEl.symbolProxy.shape,
|
|
55835
|
+
triangleWidth: 4,
|
|
55836
|
+
triangleHeight: 6
|
|
55837
|
+
};
|
|
55838
|
+
symbolGroup.add(arrowUpEl);
|
|
55839
|
+
}
|
|
55810
55840
|
const closeUpArrow = data.getLayout("closeUpArrow");
|
|
55811
|
-
|
|
55812
|
-
|
|
55813
|
-
|
|
55814
|
-
|
|
55815
|
-
|
|
55816
|
-
|
|
55817
|
-
|
|
55818
|
-
|
|
55819
|
-
|
|
55820
|
-
|
|
55821
|
-
|
|
55822
|
-
|
|
55823
|
-
|
|
55824
|
-
|
|
55825
|
-
|
|
55826
|
-
|
|
55827
|
-
|
|
55841
|
+
if (closeUpArrow && closeUpArrow.length) {
|
|
55842
|
+
const closeUpArrowEl = new SymbolPath_default2({
|
|
55843
|
+
shape: {
|
|
55844
|
+
points: closeUpArrow,
|
|
55845
|
+
size: ArrowSize
|
|
55846
|
+
},
|
|
55847
|
+
style: {
|
|
55848
|
+
fill: CloseColor
|
|
55849
|
+
},
|
|
55850
|
+
z2
|
|
55851
|
+
});
|
|
55852
|
+
closeUpArrowEl.symbolProxy = createSymbol("arrowUpClose", 0, 0, 0, 0);
|
|
55853
|
+
closeUpArrowEl.symbolProxy.shape = {
|
|
55854
|
+
...closeUpArrowEl.symbolProxy.shape,
|
|
55855
|
+
triangleWidth: 4,
|
|
55856
|
+
triangleHeight: 6
|
|
55857
|
+
};
|
|
55858
|
+
symbolGroup.add(closeUpArrowEl);
|
|
55859
|
+
}
|
|
55828
55860
|
const downTriangle = data.getLayout("downTriangle");
|
|
55829
|
-
|
|
55830
|
-
|
|
55831
|
-
|
|
55832
|
-
|
|
55833
|
-
|
|
55834
|
-
|
|
55835
|
-
|
|
55836
|
-
|
|
55837
|
-
|
|
55838
|
-
|
|
55839
|
-
|
|
55840
|
-
|
|
55861
|
+
if (downTriangle && downTriangle.length) {
|
|
55862
|
+
const downTriangleEl = new SymbolPath_default2({
|
|
55863
|
+
shape: {
|
|
55864
|
+
points: downTriangle,
|
|
55865
|
+
size: TriangleSize
|
|
55866
|
+
},
|
|
55867
|
+
style: {
|
|
55868
|
+
fill: ShortColor
|
|
55869
|
+
},
|
|
55870
|
+
z2
|
|
55871
|
+
});
|
|
55872
|
+
downTriangleEl.symbolProxy = createSymbol("triangleLeft", 0, 0, 0, 0);
|
|
55873
|
+
symbolGroup.add(downTriangleEl);
|
|
55874
|
+
}
|
|
55841
55875
|
const closeDownTriangle = data.getLayout("closeDownTriangle");
|
|
55842
|
-
|
|
55843
|
-
|
|
55844
|
-
|
|
55845
|
-
|
|
55846
|
-
|
|
55847
|
-
|
|
55848
|
-
|
|
55849
|
-
|
|
55850
|
-
|
|
55851
|
-
|
|
55852
|
-
|
|
55853
|
-
|
|
55876
|
+
if (closeDownTriangle && closeDownTriangle.length) {
|
|
55877
|
+
const closeDownTriangleEl = new SymbolPath_default2({
|
|
55878
|
+
shape: {
|
|
55879
|
+
points: closeDownTriangle,
|
|
55880
|
+
size: TriangleSize
|
|
55881
|
+
},
|
|
55882
|
+
style: {
|
|
55883
|
+
fill: CloseColor
|
|
55884
|
+
},
|
|
55885
|
+
z2
|
|
55886
|
+
});
|
|
55887
|
+
closeDownTriangleEl.symbolProxy = createSymbol("triangleLeft", 0, 0, 0, 0);
|
|
55888
|
+
symbolGroup.add(closeDownTriangleEl);
|
|
55889
|
+
}
|
|
55854
55890
|
const downArrow = data.getLayout("downArrow");
|
|
55855
|
-
|
|
55856
|
-
|
|
55857
|
-
|
|
55858
|
-
|
|
55859
|
-
|
|
55860
|
-
|
|
55861
|
-
|
|
55862
|
-
|
|
55863
|
-
|
|
55864
|
-
|
|
55865
|
-
|
|
55866
|
-
|
|
55867
|
-
|
|
55868
|
-
|
|
55869
|
-
|
|
55870
|
-
|
|
55871
|
-
|
|
55891
|
+
if (downArrow && downArrow.length) {
|
|
55892
|
+
const arrowDownEl = new SymbolPath_default2({
|
|
55893
|
+
shape: {
|
|
55894
|
+
points: downArrow,
|
|
55895
|
+
size: ArrowSize
|
|
55896
|
+
},
|
|
55897
|
+
style: {
|
|
55898
|
+
fill: ShortColor
|
|
55899
|
+
},
|
|
55900
|
+
z2
|
|
55901
|
+
});
|
|
55902
|
+
arrowDownEl.symbolProxy = createSymbol("arrowDown", 0, 0, 0, 0);
|
|
55903
|
+
arrowDownEl.symbolProxy.shape = {
|
|
55904
|
+
...arrowDownEl.symbolProxy.shape,
|
|
55905
|
+
triangleWidth: 4,
|
|
55906
|
+
triangleHeight: 6
|
|
55907
|
+
};
|
|
55908
|
+
symbolGroup.add(arrowDownEl);
|
|
55909
|
+
}
|
|
55872
55910
|
const closeDownArrow = data.getLayout("closeDownArrow");
|
|
55873
|
-
|
|
55874
|
-
|
|
55875
|
-
|
|
55876
|
-
|
|
55877
|
-
|
|
55878
|
-
|
|
55879
|
-
fill: CloseColor
|
|
55880
|
-
},
|
|
55881
|
-
z2
|
|
55882
|
-
});
|
|
55883
|
-
closeDownArrowEl.symbolProxy = createSymbol("arrowDownClose", 0, 0, 0, 0);
|
|
55884
|
-
closeDownArrowEl.symbolProxy.shape = {
|
|
55885
|
-
...closeDownArrowEl.symbolProxy.shape,
|
|
55886
|
-
triangleWidth: 4,
|
|
55887
|
-
triangleHeight: 6
|
|
55888
|
-
};
|
|
55889
|
-
symbolGroup.add(closeDownArrowEl);
|
|
55890
|
-
const texts = data.getLayout("texts");
|
|
55891
|
-
const textColor = seriesModel.get("textColor");
|
|
55892
|
-
each(texts, function(item) {
|
|
55893
|
-
const {text, point} = item;
|
|
55894
|
-
const el = new Text_default({
|
|
55911
|
+
if (closeDownArrow && closeDownArrow.length) {
|
|
55912
|
+
const closeDownArrowEl = new SymbolPath_default2({
|
|
55913
|
+
shape: {
|
|
55914
|
+
points: closeDownArrow,
|
|
55915
|
+
size: ArrowSize
|
|
55916
|
+
},
|
|
55895
55917
|
style: {
|
|
55896
|
-
|
|
55897
|
-
align: "center",
|
|
55898
|
-
fill: textColor ?? "#fff",
|
|
55899
|
-
fontSize: 12
|
|
55918
|
+
fill: CloseColor
|
|
55900
55919
|
},
|
|
55901
|
-
|
|
55902
|
-
y: point[1]
|
|
55920
|
+
z2
|
|
55903
55921
|
});
|
|
55904
|
-
|
|
55905
|
-
|
|
55922
|
+
closeDownArrowEl.symbolProxy = createSymbol("arrowDownClose", 0, 0, 0, 0);
|
|
55923
|
+
closeDownArrowEl.symbolProxy.shape = {
|
|
55924
|
+
...closeDownArrowEl.symbolProxy.shape,
|
|
55925
|
+
triangleWidth: 4,
|
|
55926
|
+
triangleHeight: 6
|
|
55927
|
+
};
|
|
55928
|
+
symbolGroup.add(closeDownArrowEl);
|
|
55929
|
+
}
|
|
55930
|
+
const texts = data.getLayout("texts");
|
|
55931
|
+
if (texts && texts.length) {
|
|
55932
|
+
const textColor = seriesModel.get("textColor");
|
|
55933
|
+
each(texts, function(item) {
|
|
55934
|
+
const {text, point} = item;
|
|
55935
|
+
const el = new Text_default({
|
|
55936
|
+
style: {
|
|
55937
|
+
text,
|
|
55938
|
+
align: "center",
|
|
55939
|
+
fill: textColor ?? "#fff",
|
|
55940
|
+
fontSize: 12
|
|
55941
|
+
},
|
|
55942
|
+
x: point[0],
|
|
55943
|
+
y: point[1]
|
|
55944
|
+
});
|
|
55945
|
+
symbolGroup.add(el);
|
|
55946
|
+
});
|
|
55947
|
+
}
|
|
55906
55948
|
}
|
|
55907
55949
|
remove(ecModel, api2) {
|
|
55908
55950
|
this._symbolGroup && this._symbolGroup.removeAll();
|
|
@@ -56068,8 +56110,16 @@ var LabelsSeriesModel2 = class extends Series_default {
|
|
|
56068
56110
|
constructor() {
|
|
56069
56111
|
super(...arguments);
|
|
56070
56112
|
this.type = LabelsSeriesModel2.type;
|
|
56113
|
+
this.dataIndexById = {};
|
|
56071
56114
|
}
|
|
56072
56115
|
getInitialData(option, ecModel) {
|
|
56116
|
+
const dataIndexById = {};
|
|
56117
|
+
if (!option.isShape) {
|
|
56118
|
+
each(option.data, function(item, index) {
|
|
56119
|
+
dataIndexById[item.id] = index;
|
|
56120
|
+
});
|
|
56121
|
+
}
|
|
56122
|
+
this.dataIndexById = dataIndexById;
|
|
56073
56123
|
return createSeriesData_default(null, this, {
|
|
56074
56124
|
useEncodeDefaulter: true
|
|
56075
56125
|
});
|
|
@@ -56094,6 +56144,20 @@ var LabelsSeriesModel2 = class extends Series_default {
|
|
|
56094
56144
|
getZLevelKey() {
|
|
56095
56145
|
return this.getData().count() > this.getProgressiveThreshold() ? this.id : "";
|
|
56096
56146
|
}
|
|
56147
|
+
getFormatUpdateData(data) {
|
|
56148
|
+
if (this.option.isShape) {
|
|
56149
|
+
return;
|
|
56150
|
+
}
|
|
56151
|
+
const dataIndexById = this.dataIndexById;
|
|
56152
|
+
const that = this;
|
|
56153
|
+
each(data, function(item) {
|
|
56154
|
+
const index = dataIndexById[item.id];
|
|
56155
|
+
if (typeof index === "number") {
|
|
56156
|
+
that.option.data = item;
|
|
56157
|
+
}
|
|
56158
|
+
});
|
|
56159
|
+
return that.option.data;
|
|
56160
|
+
}
|
|
56097
56161
|
};
|
|
56098
56162
|
var LabelsSeriesModel = LabelsSeriesModel2;
|
|
56099
56163
|
LabelsSeriesModel.type = "series.labels";
|
|
@@ -68809,6 +68873,19 @@ var TableModel2 = class extends Component_default {
|
|
|
68809
68873
|
constructor() {
|
|
68810
68874
|
super(...arguments);
|
|
68811
68875
|
this.type = TableModel2.type;
|
|
68876
|
+
this.ableDataZoomUpdate = false;
|
|
68877
|
+
}
|
|
68878
|
+
mergeTables(tables) {
|
|
68879
|
+
const newTableById = {};
|
|
68880
|
+
each(tables, function(table) {
|
|
68881
|
+
newTableById[table.id] = table;
|
|
68882
|
+
});
|
|
68883
|
+
this.option.tables = map(this.option.tables, function(table) {
|
|
68884
|
+
return newTableById[table.id] || table;
|
|
68885
|
+
});
|
|
68886
|
+
}
|
|
68887
|
+
setAbleDataZoomUpdate(ableDataZoomUpdate) {
|
|
68888
|
+
this.ableDataZoomUpdate = ableDataZoomUpdate;
|
|
68812
68889
|
}
|
|
68813
68890
|
};
|
|
68814
68891
|
var TableModel = TableModel2;
|
|
@@ -68892,6 +68969,7 @@ function getXYByPosition(rect, position2, width, height, frame_width = 0) {
|
|
|
68892
68969
|
y: Math.floor(y)
|
|
68893
68970
|
};
|
|
68894
68971
|
}
|
|
68972
|
+
var computedText = new Text_default();
|
|
68895
68973
|
var TableView2 = class extends Component_default2 {
|
|
68896
68974
|
constructor() {
|
|
68897
68975
|
super(...arguments);
|
|
@@ -68899,19 +68977,33 @@ var TableView2 = class extends Component_default2 {
|
|
|
68899
68977
|
}
|
|
68900
68978
|
render(tableModel, ecModel, api2, payload) {
|
|
68901
68979
|
if (payload?.type === "dataZoom") {
|
|
68902
|
-
|
|
68980
|
+
if (!tableModel.ableDataZoomUpdate) {
|
|
68981
|
+
return;
|
|
68982
|
+
}
|
|
68983
|
+
tableModel.setAbleDataZoomUpdate(false);
|
|
68903
68984
|
}
|
|
68904
68985
|
this.group.removeAll();
|
|
68905
68986
|
if (!tableModel.get("show")) {
|
|
68906
68987
|
return;
|
|
68907
68988
|
}
|
|
68989
|
+
const tables = tableModel.get("tables");
|
|
68990
|
+
const tableByPosition = {};
|
|
68991
|
+
each(tables, function(table) {
|
|
68992
|
+
if (tableByPosition[table.position] && tableByPosition[table.position].line > table.line) {
|
|
68993
|
+
return;
|
|
68994
|
+
}
|
|
68995
|
+
tableByPosition[table.position] = table;
|
|
68996
|
+
});
|
|
68997
|
+
const visibleTables = [];
|
|
68998
|
+
each(tableByPosition, function(table) {
|
|
68999
|
+
visibleTables.push(table);
|
|
69000
|
+
});
|
|
68908
69001
|
const grid = ecModel.getComponent("grid", 0);
|
|
68909
69002
|
const z = tableModel.get("z");
|
|
68910
69003
|
const rect = grid.coordinateSystem.getRect();
|
|
68911
|
-
const tables = tableModel.get("tables");
|
|
68912
69004
|
const paddings = tableModel.get("paddings");
|
|
68913
69005
|
const tableAttrByIndex = {};
|
|
68914
|
-
each(
|
|
69006
|
+
each(visibleTables, function(item, index) {
|
|
68915
69007
|
const columnWidthByIndex = [];
|
|
68916
69008
|
const rowHeightByIndex = [];
|
|
68917
69009
|
const margeCellByKey = {};
|
|
@@ -68930,12 +69022,11 @@ var TableView2 = class extends Component_default2 {
|
|
|
68930
69022
|
fontSize,
|
|
68931
69023
|
fontFamily: text_font_family
|
|
68932
69024
|
}, ecModel);
|
|
68933
|
-
|
|
68934
|
-
|
|
68935
|
-
|
|
68936
|
-
|
|
68937
|
-
|
|
68938
|
-
}).getBoundingRect();
|
|
69025
|
+
computedText.useStyle({
|
|
69026
|
+
text,
|
|
69027
|
+
font
|
|
69028
|
+
});
|
|
69029
|
+
const textRect = computedText.getBoundingRect();
|
|
68939
69030
|
const textHight = height2 ? height2 / 100 * rect.height : textRect.height;
|
|
68940
69031
|
const textWidth = width2 ? width2 / 100 * rect.width : textRect.width + 2;
|
|
68941
69032
|
if (mergeCell) {
|
|
@@ -68982,7 +69073,7 @@ var TableView2 = class extends Component_default2 {
|
|
|
68982
69073
|
};
|
|
68983
69074
|
});
|
|
68984
69075
|
const group = this.group;
|
|
68985
|
-
each(
|
|
69076
|
+
each(visibleTables, function(item, index) {
|
|
68986
69077
|
const {x, y, columnObjByIndex, rowObjByIndex, width, height} = tableAttrByIndex[index];
|
|
68987
69078
|
const {bgcolor, frame_color, frame_width = 0, border_width = 0, border_color, columns} = item;
|
|
68988
69079
|
const tableGroup = new Group_default({x, y});
|