tvcharts 0.7.44 → 0.7.45

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 CHANGED
@@ -24570,7 +24570,7 @@ var ECharts = class extends Eventful_default {
24570
24570
  this.trigger(eventType, event);
24571
24571
  }, this);
24572
24572
  });
24573
- each(["selectchanged", "selectitem", "loadmore", "zoomend", "visiblechanged"], (eventType) => {
24573
+ each(["selectchanged", "selectitem", "loadmore", "zoomend", "visiblechanged", "dataappend"], (eventType) => {
24574
24574
  this._messageCenter.on(eventType, function(event) {
24575
24575
  this.trigger(eventType, event);
24576
24576
  }, this);
@@ -24894,24 +24894,15 @@ var ECharts = class extends Eventful_default {
24894
24894
  return;
24895
24895
  }
24896
24896
  updateMethods.update.call(chart, isAdd ? {type: "dataZoom"} : void 0);
24897
+ if (isAdd) {
24898
+ chart._messageCenter.trigger("dataappend");
24899
+ }
24897
24900
  });
24898
24901
  } else {
24899
- const xAxisModal = this._model.getComponent("xAxis", 0);
24900
- const scale4 = xAxisModal.axis.scale;
24901
- const ordinalMeta = scale4.getOrdinalMeta();
24902
- const lastTime = ordinalMeta.getLastCategories();
24903
- const isMove = isAdd && scale4.lastBarRightSideDiffBarCount < 1.5 && lastTime !== time;
24904
- if (isMove) {
24905
- const payload = {
24906
- type: "dataZoom",
24907
- barSpace: scale4.barSpace,
24908
- lastBarRightSideDiffBarCount: scale4.lastBarRightSideDiffBarCount - 1,
24909
- isPushSync: true
24910
- };
24911
- doDispatchAction.call(this, payload, false);
24912
- return;
24902
+ updateMethods.update.call(this, isAdd ? {type: "dataZoom"} : void 0);
24903
+ if (isAdd) {
24904
+ this._messageCenter.trigger("dataappend");
24913
24905
  }
24914
- updateMethods.update.call(this);
24915
24906
  }
24916
24907
  }
24917
24908
  scrollByDistance(distance2, animationDuration) {
@@ -27826,11 +27817,11 @@ var intradayWeightDivisors = [
27826
27817
  {divisor: hours(12), weight: TickMarkWeight.Hour12}
27827
27818
  ];
27828
27819
  function weightByTime(currentDate, prevDate) {
27829
- if (currentDate.getFullYear() !== prevDate.getFullYear()) {
27820
+ if (currentDate.getUTCFullYear() !== prevDate.getUTCFullYear()) {
27830
27821
  return TickMarkWeight.Year;
27831
- } else if (currentDate.getMonth() !== prevDate.getMonth()) {
27822
+ } else if (currentDate.getUTCMonth() !== prevDate.getUTCMonth()) {
27832
27823
  return TickMarkWeight.Month;
27833
- } else if (currentDate.getDate() !== prevDate.getDate()) {
27824
+ } else if (currentDate.getUTCDate() !== prevDate.getUTCDate()) {
27834
27825
  return TickMarkWeight.Day;
27835
27826
  }
27836
27827
  for (let i = intradayWeightDivisors.length - 1; i >= 0; --i) {
@@ -30207,8 +30198,8 @@ function weightToTickMarkType(weight, timeVisible, secondsVisible) {
30207
30198
  return TickMarkType.Year;
30208
30199
  }
30209
30200
  }
30210
- function defaultTickMarkFormatter(timePoint, tickMarkType, locale) {
30211
- const formatOptions = {timeZone: "Asia/Shanghai"};
30201
+ function defaultTickMarkFormatter(timePoint, tickMarkType, locale, timeZone = "Asia/Shanghai") {
30202
+ const formatOptions = {timeZone};
30212
30203
  switch (tickMarkType) {
30213
30204
  case TickMarkType.Year:
30214
30205
  formatOptions.year = "numeric";
@@ -55826,7 +55817,8 @@ var LinesPlotView2 = class extends Chart_default {
55826
55817
  style: {
55827
55818
  lineDash,
55828
55819
  stroke: visualColor || color2,
55829
- lineWidth: +lineWidth
55820
+ lineWidth: +lineWidth,
55821
+ lineJoin: "round"
55830
55822
  },
55831
55823
  z2: isDefaultColor ? LastZ2 : z2
55832
55824
  });
@@ -55863,7 +55855,8 @@ var LinesPlotView2 = class extends Chart_default {
55863
55855
  },
55864
55856
  style: {
55865
55857
  stroke: "none",
55866
- fill: visualColor || color2
55858
+ fill: visualColor || color2,
55859
+ lineJoin: "round"
55867
55860
  },
55868
55861
  z2: isDefaultColor ? LastZ2 : z2
55869
55862
  });
@@ -56656,7 +56649,7 @@ function getArrowPoints(fromX, fromY, toX, toY, arrowAngle = Math.PI / 4) {
56656
56649
  if (length2 <= 20) {
56657
56650
  return;
56658
56651
  }
56659
- const arrowLength = Math.min(Math.floor(length2 / 3), 30);
56652
+ const arrowLength = Math.min(Math.floor(length2 / 3), 10);
56660
56653
  const normalizedDirectionX = dx / length2;
56661
56654
  const normalizedDirectionY = dy / length2;
56662
56655
  const perpendicularX = -normalizedDirectionY;
@@ -56880,18 +56873,18 @@ var MineLinesSeriesModel2 = class extends Series_default {
56880
56873
  this.dataIndexById = dataIndexById;
56881
56874
  }
56882
56875
  getResetData(data) {
56883
- const dataIndexById = this.dataIndexById;
56884
- const that = this;
56885
- each(data, function(item) {
56886
- const index = dataIndexById[item.id];
56887
- if (typeof index === "number") {
56888
- that.option.data[index] = item;
56889
- } else {
56890
- that.option.data.push(item);
56876
+ const mergeIdById = {};
56877
+ const mergeData = filter(data, function(item) {
56878
+ mergeIdById[item.id] = 1;
56879
+ return !item.isDelete;
56880
+ });
56881
+ const newData = filter(this.option.data, function(item) {
56882
+ if (mergeIdById[item.id]) {
56883
+ return false;
56891
56884
  }
56885
+ return true;
56892
56886
  });
56893
- this.option.data = this.option.data.filter((item) => !item.isDelete).slice(-this.option.limit);
56894
- this.computedDataIndexById(this.option);
56887
+ this.option.data = newData.concat(mergeData).slice(-this.option.limit);
56895
56888
  return this.option.data;
56896
56889
  }
56897
56890
  };
@@ -57184,18 +57177,18 @@ var MinePolyLinesSeriesModel2 = class extends Series_default {
57184
57177
  this.dataIndexById = dataIndexById;
57185
57178
  }
57186
57179
  getResetData(data) {
57187
- const dataIndexById = this.dataIndexById;
57188
- const that = this;
57189
- each(data, function(item) {
57190
- const index = dataIndexById[item.id];
57191
- if (typeof index === "number") {
57192
- that.option.data[index] = item;
57193
- } else {
57194
- that.option.data.push(item);
57180
+ const mergeIdById = {};
57181
+ const mergeData = filter(data, function(item) {
57182
+ mergeIdById[item.id] = 1;
57183
+ return !item.isDelete;
57184
+ });
57185
+ const newData = filter(this.option.data, function(item) {
57186
+ if (mergeIdById[item.id]) {
57187
+ return false;
57195
57188
  }
57189
+ return true;
57196
57190
  });
57197
- this.option.data = this.option.data.filter((item) => !item.isDelete).slice(-this.option.limit);
57198
- this.computedDataIndexById(this.option);
57191
+ this.option.data = newData.concat(mergeData).slice(-this.option.limit);
57199
57192
  return this.option.data;
57200
57193
  }
57201
57194
  };
@@ -57394,18 +57387,18 @@ var LineFillsSeriesModel2 = class extends Series_default {
57394
57387
  this.dataIndexById = dataIndexById;
57395
57388
  }
57396
57389
  getResetData(data) {
57397
- const dataIndexById = this.dataIndexById;
57398
- const that = this;
57399
- each(data, function(item) {
57400
- const index = dataIndexById[item.id];
57401
- if (typeof index === "number") {
57402
- that.option.data[index] = item;
57403
- } else {
57404
- that.option.data.push(item);
57390
+ const mergeIdById = {};
57391
+ const mergeData = filter(data, function(item) {
57392
+ mergeIdById[item.id] = 1;
57393
+ return !item.isDelete;
57394
+ });
57395
+ const newData = filter(this.option.data, function(item) {
57396
+ if (mergeIdById[item.id]) {
57397
+ return false;
57405
57398
  }
57399
+ return true;
57406
57400
  });
57407
- this.option.data = this.option.data.filter((item) => !item.isDelete);
57408
- this.computedDataIndexById(this.option);
57401
+ this.option.data = newData.concat(mergeData);
57409
57402
  return this.option.data;
57410
57403
  }
57411
57404
  };
@@ -57651,7 +57644,6 @@ var BoxesSeriesModel2 = class extends Series_default {
57651
57644
  throw new Error("Boxes not support coordinateSystem besides cartesian and polar");
57652
57645
  }
57653
57646
  }
57654
- this.computedDataIndexById(option);
57655
57647
  return createSeriesData_default(null, this, {
57656
57648
  useEncodeDefaulter: true
57657
57649
  });
@@ -57659,26 +57651,19 @@ var BoxesSeriesModel2 = class extends Series_default {
57659
57651
  getZLevelKey() {
57660
57652
  return this.getData().count() > this.getProgressiveThreshold() ? this.id : "";
57661
57653
  }
57662
- computedDataIndexById(option) {
57663
- const dataIndexById = {};
57664
- each(option.data, function(item, index) {
57665
- dataIndexById[item.id] = index;
57666
- });
57667
- this.dataIndexById = dataIndexById;
57668
- }
57669
57654
  getResetData(data) {
57670
- const dataIndexById = this.dataIndexById;
57671
- const that = this;
57672
- each(data, function(item) {
57673
- const index = dataIndexById[item.id];
57674
- if (typeof index === "number") {
57675
- that.option.data[index] = item;
57676
- } else {
57677
- that.option.data.push(item);
57655
+ const mergeIdById = {};
57656
+ const mergeData = filter(data, function(item) {
57657
+ mergeIdById[item.id] = 1;
57658
+ return !item.isDelete;
57659
+ });
57660
+ const newData = filter(this.option.data, function(item) {
57661
+ if (mergeIdById[item.id]) {
57662
+ return false;
57678
57663
  }
57664
+ return true;
57679
57665
  });
57680
- this.option.data = this.option.data.filter((item) => !item.isDelete).slice(-this.option.limit);
57681
- this.computedDataIndexById(this.option);
57666
+ this.option.data = newData.concat(mergeData).slice(-this.option.limit);
57682
57667
  return this.option.data;
57683
57668
  }
57684
57669
  };
@@ -57850,7 +57835,7 @@ var BoxesLayout = {
57850
57835
  const width2 = Math.abs(endPoint[0] - startPoint[0]);
57851
57836
  const height = Math.abs(endPoint[1] - startPoint[1]);
57852
57837
  const minBoxSize = Math.min(width2, height);
57853
- if (!minBoxSize) {
57838
+ if (!minBoxSize && text_size === "auto") {
57854
57839
  continue;
57855
57840
  }
57856
57841
  const {x, y, align, v_align} = getBoxPoint(startPoint, endPoint, text_halign, text_valign);
@@ -58912,7 +58897,6 @@ var LabelsSeriesModel2 = class extends Series_default {
58912
58897
  this.dataIndexById = {};
58913
58898
  }
58914
58899
  getInitialData(option, ecModel) {
58915
- this.computedDataIndexById(option);
58916
58900
  return createSeriesData_default(null, this, {
58917
58901
  useEncodeDefaulter: true
58918
58902
  });
@@ -58937,31 +58921,22 @@ var LabelsSeriesModel2 = class extends Series_default {
58937
58921
  getZLevelKey() {
58938
58922
  return this.getData().count() > this.getProgressiveThreshold() ? this.id : "";
58939
58923
  }
58940
- computedDataIndexById(option) {
58941
- const dataIndexById = {};
58942
- if (!option.isShape) {
58943
- each(option.data, function(item, index) {
58944
- dataIndexById[item.id] = index;
58945
- });
58946
- }
58947
- this.dataIndexById = dataIndexById;
58948
- }
58949
58924
  getResetData(data) {
58950
58925
  if (this.option.isShape) {
58951
58926
  return;
58952
58927
  }
58953
- const dataIndexById = this.dataIndexById;
58954
- const that = this;
58955
- each(data, function(item) {
58956
- const index = dataIndexById[item.id];
58957
- if (typeof index === "number") {
58958
- that.option.data[index] = item;
58959
- } else {
58960
- that.option.data.push(item);
58928
+ const mergeIdById = {};
58929
+ const mergeData = filter(data, function(item) {
58930
+ mergeIdById[item.id] = 1;
58931
+ return !item.isDelete;
58932
+ });
58933
+ const newData = filter(this.option.data, function(item) {
58934
+ if (mergeIdById[item.id]) {
58935
+ return false;
58961
58936
  }
58937
+ return true;
58962
58938
  });
58963
- this.option.data = this.option.data.filter((item) => !item.isDelete).slice(-this.option.limit);
58964
- this.computedDataIndexById(this.option);
58939
+ this.option.data = newData.concat(mergeData).slice(-this.option.limit);
58965
58940
  return this.option.data;
58966
58941
  }
58967
58942
  };
@@ -59492,7 +59467,8 @@ var labelsLayout = {
59492
59467
  if (location === "top") {
59493
59468
  symbolPoint[1] = symbolPoint[1] + symbolRect[1];
59494
59469
  }
59495
- if ((yloc === "belowbar" || yloc === "price") && upSymbols.includes(symbol)) {
59470
+ const ylocIsBottom = yloc ? yloc === "belowbar" || yloc === "price" : true;
59471
+ if (ylocIsBottom && upSymbols.includes(symbol)) {
59496
59472
  symbolPoint[1] = symbolPoint[1] + symbolRect[1];
59497
59473
  }
59498
59474
  if (symbol === "labelCenter") {
@@ -59815,7 +59791,8 @@ var FillsView2 = class extends Chart_default {
59815
59791
  points: points4
59816
59792
  },
59817
59793
  style: {
59818
- fill
59794
+ fill,
59795
+ lineJoin: "round"
59819
59796
  },
59820
59797
  z2: isDefaultFill ? -1 : z2
59821
59798
  });
@@ -71964,15 +71941,23 @@ var TableView2 = class extends Component_default2 {
71964
71941
  const textRect = computedText.getBoundingRect();
71965
71942
  const textHight = height2 ? Math.max(height2 / 100 * rect.height, 1) : textRect.height + paddings;
71966
71943
  const textWidth = width2 ? Math.max(width2 / 100 * rect.width, 1) : textRect.width + 2 + paddings;
71967
- const isMergeColumn = mergeCell && mergeCell.start_column !== mergeCell.end_column;
71968
- const isMergeRow = mergeCell && mergeCell.start_row !== mergeCell.end_row;
71944
+ const isMergeColumn = mergeCell;
71945
+ const isMergeRow = mergeCell;
71969
71946
  if (isMergeColumn) {
71970
- columnWidthByIndex[column] = Math.floor(Math.max(0, columnWidthByIndex[column] || 0));
71947
+ const mergeColumnSize = mergeCell.end_column - mergeCell.start_column + 1;
71948
+ const avgWidth = textWidth / mergeColumnSize;
71949
+ for (let index2 = mergeCell.start_column; index2 <= mergeCell.end_column; index2++) {
71950
+ columnWidthByIndex[index2] = Math.floor(Math.max(avgWidth, columnWidthByIndex[index2] || 0));
71951
+ }
71971
71952
  } else {
71972
71953
  columnWidthByIndex[column] = Math.floor(Math.max(textWidth, columnWidthByIndex[column] || 0));
71973
71954
  }
71974
71955
  if (isMergeRow) {
71975
- rowHeightByIndex[row] = Math.floor(Math.max(0, rowHeightByIndex[row] || 0));
71956
+ const mergeRowSize = mergeCell.end_row - mergeCell.start_row + 1;
71957
+ const avgHeight = textHight / mergeRowSize;
71958
+ for (let index2 = mergeCell.start_row; index2 <= mergeCell.end_row; index2++) {
71959
+ rowHeightByIndex[index2] = Math.floor(Math.max(avgHeight, rowHeightByIndex[index2] || 0));
71960
+ }
71976
71961
  } else {
71977
71962
  rowHeightByIndex[row] = Math.floor(Math.max(textHight, rowHeightByIndex[row] || 0));
71978
71963
  }
@@ -72068,17 +72053,18 @@ var TableView2 = class extends Component_default2 {
72068
72053
  style: {
72069
72054
  text,
72070
72055
  backgroundColor: bgcolor2,
72056
+ padding: [cellItem.height ? 0 : paddings / 2, cellItem.width ? 0 : paddings / 2],
72071
72057
  fill: text_color,
72072
- width: width2,
72073
- height: height2,
72058
+ width: cellItem.width ? width2 : width2 - paddings,
72059
+ height: cellItem.height ? height2 : height2 - paddings,
72074
72060
  fontSize,
72075
72061
  fontFamily: text_font_family,
72076
72062
  verticalAlign,
72077
72063
  align,
72078
72064
  overflow: "truncate"
72079
72065
  },
72080
- x: x2 + getTextXOffset(width2, align, paddings / 2),
72081
- y: y2 + getTextYOffset(height2, verticalAlign, paddings / 2),
72066
+ x: x2 + getTextXOffset(width2, align, 0),
72067
+ y: y2 + getTextYOffset(height2, verticalAlign, 0),
72082
72068
  z,
72083
72069
  z2: 10
72084
72070
  });