tvcharts 0.7.61 → 0.7.63

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
@@ -7238,7 +7238,7 @@ function getElementSSRData(el) {
7238
7238
  function registerSSRDataGetter(getter) {
7239
7239
  ssrDataGetter = getter;
7240
7240
  }
7241
- var version = "5.6.78";
7241
+ var version = "5.6.79";
7242
7242
 
7243
7243
  // src/util/number.ts
7244
7244
  var RADIAN_EPSILON = 1e-4;
@@ -25788,7 +25788,7 @@ ECharts.internalField = function() {
25788
25788
  if (isGroup) {
25789
25789
  const children = el.childrenRef();
25790
25790
  for (let i = 0; i < children.length; i++) {
25791
- maxZ2 = Math.max(doUpdateZ(children[i], z, el.zLevel ?? zlevel, maxZ2), maxZ2, z2);
25791
+ maxZ2 = Math.max(doUpdateZ(children[i], z, el.zLevel ?? zlevel, maxZ2, z2), maxZ2);
25792
25792
  }
25793
25793
  } else {
25794
25794
  el.z = z;
@@ -33691,7 +33691,8 @@ var Layer = class extends Eventful_default {
33691
33691
  if (clearColor && clearColor !== "transparent") {
33692
33692
  let clearColorGradientOrPattern;
33693
33693
  if (isGradientObject(clearColor)) {
33694
- const shouldCache = clearColor.global || clearColor.__width === width2 && clearColor.__height === height2;
33694
+ const colorStopStr = clearColor.colorStops.map((item) => item.color + item.offset).toString();
33695
+ const shouldCache = clearColor.global || clearColor.__width === width2 && clearColor.__height === height2 && clearColor._colorStopStr === colorStopStr;
33695
33696
  clearColorGradientOrPattern = shouldCache && clearColor.__canvasGradient || getCanvasGradient(ctx2, clearColor, {
33696
33697
  x: 0,
33697
33698
  y: 0,
@@ -33701,6 +33702,7 @@ var Layer = class extends Eventful_default {
33701
33702
  clearColor.__canvasGradient = clearColorGradientOrPattern;
33702
33703
  clearColor.__width = width2;
33703
33704
  clearColor.__height = height2;
33705
+ clearColor._colorStopStr = colorStopStr;
33704
33706
  } else if (isImagePatternObject(clearColor)) {
33705
33707
  clearColor.scaleX = clearColor.scaleX || horizontalPixelRatio;
33706
33708
  clearColor.scaleY = clearColor.scaleY || verticalPixelRatio;
@@ -64322,7 +64324,6 @@ var BaseAxisPointer = class {
64322
64324
  const hoverBackgroundColor = extraGroupModel.get("hoverBackgroundColor");
64323
64325
  const extraIcon = createIcon(extraGroupModel.get("icon"), {
64324
64326
  x: size[0] / 2,
64325
- y: size[1] / 2,
64326
64327
  scaleX: size[0] / 2,
64327
64328
  scaleY: size[1] / 2,
64328
64329
  z2: 11,
@@ -64333,7 +64334,6 @@ var BaseAxisPointer = class {
64333
64334
  extraIcon.style.fill = color2;
64334
64335
  const extraRect = new Rect_default({
64335
64336
  shape: {
64336
- y: -padding / 2,
64337
64337
  x: -padding / 2,
64338
64338
  width: size[0] + padding,
64339
64339
  height: size[1] + padding
@@ -64370,18 +64370,17 @@ var BaseAxisPointer = class {
64370
64370
  const isLeft = position2 === "left";
64371
64371
  const distance2 = extraGroupModel.get("distance");
64372
64372
  extraGroup.x = isLeft ? pointer.shape.x1 + distance2 : pointer.shape.x2 - (size[0] + distance2);
64373
- extraGroup.y = pointer.shape.y1 - size[1] / 2;
64373
+ extraGroup.y = elOption.label.y;
64374
64374
  extraGroup.eachChild((el) => {
64375
64375
  if (elInner(el).type === "rect") {
64376
64376
  el.attr("shape", {
64377
- y: -padding / 2,
64378
64377
  x: -padding / 2,
64379
64378
  width: size[0] + padding,
64380
64379
  height: size[1] + padding
64381
64380
  });
64382
64381
  } else {
64383
64382
  el.x = size[0] / 2;
64384
- el.y = size[1] / 2;
64383
+ el.y = size[1] / 2 + padding / 2;
64385
64384
  el.scaleX = size[0] / 2;
64386
64385
  el.scaleY = size[1] / 2;
64387
64386
  }
@@ -68783,10 +68782,11 @@ var AxisProxy = class {
68783
68782
  let precision = getPixelPrecision(valueWindow, [0, 500]);
68784
68783
  precision = Math.min(precision, 20);
68785
68784
  const rawExtentInfo = axisModel.axis.scale.rawExtentInfo;
68786
- if (percentWindow[0] !== 0) {
68785
+ const isUseValueRange = this._dataZoomModel.get("useValueRange");
68786
+ if (percentWindow[0] !== 0 || isUseValueRange) {
68787
68787
  rawExtentInfo.setDeterminedMinMax("min", +valueWindow[0].toFixed(precision));
68788
68788
  }
68789
- if (percentWindow[1] !== 100) {
68789
+ if (percentWindow[1] !== 100 || isUseValueRange) {
68790
68790
  rawExtentInfo.setDeterminedMinMax("max", +valueWindow[1].toFixed(precision));
68791
68791
  }
68792
68792
  rawExtentInfo.freeze();
@@ -72766,7 +72766,7 @@ function formatSeconds(seconds2) {
72766
72766
  return [
72767
72767
  months > 0 ? `${months}m` : null,
72768
72768
  days > 0 ? `${days}d` : null,
72769
- hours2 > 0 ? `${hours2}h` : null
72769
+ hours2 > 0 && months === 0 ? `${hours2}h` : null
72770
72770
  ].filter(Boolean).join(" ");
72771
72771
  } else {
72772
72772
  const hours2 = Math.floor(seconds2 / SECONDS_PER_HOUR);
@@ -75351,9 +75351,10 @@ var MarkLabelModal2 = class extends Component_default {
75351
75351
  each(markerOpt.data, (item, key) => {
75352
75352
  if (!this.option.data[key]) {
75353
75353
  dataMap[key] = this.option.data[key] = merge(item, defaultDataOption);
75354
+ item.countDown = dataMap[key].countDown;
75354
75355
  } else {
75355
75356
  dataMap[key] = merge(this.option.data[key], item, true);
75356
- console.log("%c [ item ]-178", "font-size:13px; background:pink; color:#bf2c9f;", item);
75357
+ item.countDown = dataMap[key].countDown;
75357
75358
  }
75358
75359
  if (item.$action === "remove") {
75359
75360
  this.option.data[key] = void 0;
@@ -75384,31 +75385,31 @@ var MarkLabelModal_default = MarkLabelModal;
75384
75385
  // src/component/marker/MarkLabelView.ts
75385
75386
  var DefaultColor = "rgb(41,98,255)";
75386
75387
  var markerTypeCalculator2 = {
75387
- dataMin: (item, seriesModel) => {
75388
+ dataMin: (item, seriesModel, backgroundColor2) => {
75388
75389
  const seriesData = seriesModel.getData();
75389
75390
  return {
75390
75391
  value: seriesData.getDataExtent(item.valueDim)[0]
75391
75392
  };
75392
75393
  },
75393
- dataMax: (item, seriesModel) => {
75394
+ dataMax: (item, seriesModel, backgroundColor2) => {
75394
75395
  const seriesData = seriesModel.getData();
75395
75396
  return {
75396
75397
  value: seriesData.getDataExtent(item.valueDim)[1]
75397
75398
  };
75398
75399
  },
75399
- min: (item, seriesModel) => {
75400
+ min: (item, seriesModel, backgroundColor2) => {
75400
75401
  const seriesData = seriesModel.getData();
75401
75402
  return {
75402
75403
  value: seriesData.getDataExtent(item.valueDim, true)[0]
75403
75404
  };
75404
75405
  },
75405
- max: (item, seriesModel) => {
75406
+ max: (item, seriesModel, backgroundColor2) => {
75406
75407
  const seriesData = seriesModel.getData();
75407
75408
  return {
75408
75409
  value: seriesData.getDataExtent(item.valueDim, true)[1]
75409
75410
  };
75410
75411
  },
75411
- rawLast: (item, seriesModel) => {
75412
+ rawLast: (item, seriesModel, backgroundColor2) => {
75412
75413
  const seriesData = seriesModel.getData();
75413
75414
  const lastIndex = seriesData.count(true) - 1;
75414
75415
  let fill = seriesData.getItemVisual(lastIndex, "style")?.fill;
@@ -75432,7 +75433,7 @@ var markerTypeCalculator2 = {
75432
75433
  }
75433
75434
  };
75434
75435
  },
75435
- last: (item, seriesModel) => {
75436
+ last: (item, seriesModel, backgroundColor2) => {
75436
75437
  const seriesData = seriesModel.getData();
75437
75438
  const count2 = seriesData.count(true);
75438
75439
  const axisModel = seriesModel.getBaseAxis();
@@ -75442,7 +75443,6 @@ var markerTypeCalculator2 = {
75442
75443
  if (lastIndex >= count2 || lastIndex < 0) {
75443
75444
  return null;
75444
75445
  }
75445
- const backgroundColor2 = seriesModel.ecModel.get("backgroundColor");
75446
75446
  const lastItem = seriesData.count() - 1;
75447
75447
  let fill = isCandle(seriesModel.subType) ? seriesData.getItemVisual(lastItem, "style")?.stroke : seriesData.getItemVisual(lastItem, "style")?.fill;
75448
75448
  if (isPlot(seriesModel.subType)) {
@@ -75460,7 +75460,7 @@ var markerTypeCalculator2 = {
75460
75460
  }
75461
75461
  };
75462
75462
  },
75463
- allLast: (item, seriesModel) => {
75463
+ allLast: (item, seriesModel, backgroundColor2) => {
75464
75464
  const seriesData = seriesModel.getData();
75465
75465
  const count2 = seriesData.count(true);
75466
75466
  const axisModel = seriesModel.getBaseAxis();
@@ -75468,9 +75468,9 @@ var markerTypeCalculator2 = {
75468
75468
  const offset = seriesModel.get("offset") || 0;
75469
75469
  const lastIndex = extent3[1] + offset;
75470
75470
  if (lastIndex >= count2 || lastIndex < 0) {
75471
- return markerTypeCalculator2.rawLast(item, seriesModel);
75471
+ return markerTypeCalculator2.rawLast(item, seriesModel, backgroundColor2);
75472
75472
  }
75473
- return markerTypeCalculator2.last(item, seriesModel);
75473
+ return markerTypeCalculator2.last(item, seriesModel, backgroundColor2);
75474
75474
  }
75475
75475
  };
75476
75476
  var inner21 = makeInner();
@@ -75490,7 +75490,7 @@ var MarkLabelView2 = class extends Component_default2 {
75490
75490
  const isAvoidOverlap = markerModel.get("isAvoidOverlap");
75491
75491
  const type = payload?.type;
75492
75492
  if (type !== "updateComOption") {
75493
- this.updateMarkLabels(markerModel, ecModel);
75493
+ this.updateMarkLabels(markerModel, ecModel, api2);
75494
75494
  }
75495
75495
  this.updateGraphicLabels(ecModel);
75496
75496
  const isUpdateGraphic = payload?.type ? ["dataZoom", "resize"].includes(payload.type) : Object.keys(ecModel.getNewBaseOption()).some((key) => ["grid", "yAxis", "xAxis"].includes(key));
@@ -75499,11 +75499,20 @@ var MarkLabelView2 = class extends Component_default2 {
75499
75499
  }
75500
75500
  this.avoidOverlap(isAvoidOverlap);
75501
75501
  }
75502
- updateMarkLabels(markerModel, ecModel) {
75502
+ updateMarkLabels(markerModel, ecModel, api2) {
75503
75503
  const markerGroupMapBySeries = this.markerGroupMapBySeries;
75504
75504
  const timerMap = this._timerMap;
75505
75505
  const labelMap = markerModel.labelMap;
75506
75506
  const updatedSeriesByName = {};
75507
+ const height = api2.getHeight();
75508
+ let backgroundColor2 = ecModel.get("backgroundColor");
75509
+ if (isGradientObject(backgroundColor2) && !backgroundColor2.global && backgroundColor2.type === "linear") {
75510
+ backgroundColor2 = {
75511
+ ...backgroundColor2,
75512
+ global: true,
75513
+ y2: height
75514
+ };
75515
+ }
75507
75516
  ecModel.eachSeries((seriesModel) => {
75508
75517
  const priceScaleInvisible = seriesModel.get("priceScaleInvisible");
75509
75518
  const invisible = seriesModel.get("invisible");
@@ -75538,7 +75547,7 @@ var MarkLabelView2 = class extends Component_default2 {
75538
75547
  return;
75539
75548
  }
75540
75549
  const yCalcFn = markerTypeCalculator2[item.type];
75541
- const {value, labelTextStyle} = yCalcFn ? yCalcFn(item, seriesModel) || {} : {value: item.value};
75550
+ const {value, labelTextStyle} = yCalcFn ? yCalcFn(item, seriesModel, backgroundColor2) || {} : {value: item.value};
75542
75551
  if (!value) {
75543
75552
  if (el) {
75544
75553
  el.ignore = true;
@@ -75776,10 +75785,10 @@ function textYChange(label, y, height) {
75776
75785
  each(label.children(), (item) => {
75777
75786
  if (item.type === "text") {
75778
75787
  if (inner21(item).labelType === "countDown") {
75779
- item.y = y + inner21(item).parentHeight;
75788
+ item.attr("style", {y: y + inner21(item).parentHeight});
75780
75789
  return;
75781
75790
  }
75782
- item.y = y;
75791
+ item.attr("style", {y});
75783
75792
  }
75784
75793
  });
75785
75794
  }
@@ -75859,17 +75868,22 @@ function createLabel({x, y, labelData, markerModel, gridRect, position: position
75859
75868
  const textElWidth = textRect.width + paddings[1] + paddings[3];
75860
75869
  const textElx = isLeft ? x - textElWidth - borderWidth - 1 : x + borderWidth;
75861
75870
  const textEl = new Text_default({
75862
- x: textElx,
75863
- y: labelY,
75864
- style: Object.assign({text, width: textRect.width}, textStyle),
75871
+ style: Object.assign({
75872
+ text,
75873
+ width: textRect.width,
75874
+ x: textElx,
75875
+ y: labelY
75876
+ }, textStyle),
75865
75877
  z: 101,
75866
75878
  zlevel,
75867
75879
  ignore: !showName
75868
75880
  });
75869
75881
  const textNameEl = new Text_default({
75870
- x: isLeft ? gridRect.x - borderWidth : getLeftTextX(gridRect.x + gridRect.width, labelTitle, textStyle, markerModel.ecModel) + borderWidth,
75871
- y: labelY,
75872
- style: Object.assign({text: labelTitle}, textStyle),
75882
+ style: Object.assign({
75883
+ text: labelTitle,
75884
+ x: isLeft ? gridRect.x - borderWidth : getLeftTextX(gridRect.x + gridRect.width, labelTitle, textStyle, markerModel.ecModel) + borderWidth,
75885
+ y: labelY
75886
+ }, textStyle),
75873
75887
  z: 101,
75874
75888
  zlevel,
75875
75889
  ignore: !showTitle
@@ -75896,11 +75910,14 @@ function createLabel({x, y, labelData, markerModel, gridRect, position: position
75896
75910
  if (countDown) {
75897
75911
  const show = countDown.show && !!countDown.value;
75898
75912
  const offsetY = showName && show ? textRect.height + paddings[0] + paddings[2] - 1 : 0;
75899
- const fill = textStyle.fill === "#ffffff" ? "rgba(255,255,255,0.9)" : "rgba(0,0,0,0.9)";
75913
+ const fill = textStyle.fill === "#ffffff" ? "rgba(255,255,255,0.8)" : "rgba(0,0,0,0.8)";
75900
75914
  const countDownEl = new Text_default({
75901
- x: textElx,
75902
- y: labelY + offsetY,
75903
- style: Object.assign({text: countDownText, width: textRect.width}, textStyle, {fill}),
75915
+ style: Object.assign({
75916
+ text: countDownText,
75917
+ width: textRect.width,
75918
+ x: textElx,
75919
+ y: labelY + offsetY
75920
+ }, textStyle, {fill}),
75904
75921
  z: 101,
75905
75922
  zlevel,
75906
75923
  ignore: !show
@@ -75956,9 +75973,12 @@ function updateLabel({x, y, labelData, markerModel, gridRect, position: position
75956
75973
  return;
75957
75974
  }
75958
75975
  const textLabel = labelData.text;
75959
- element.x = textElx;
75960
- element.y = labelY;
75961
- element.attr("style", Object.assign({text: textLabel, width: textRect.width}, textStyle));
75976
+ element.attr("style", Object.assign({
75977
+ text: textLabel,
75978
+ width: textRect.width,
75979
+ x: textElx,
75980
+ y: labelY
75981
+ }, textStyle));
75962
75982
  element.ignore = false;
75963
75983
  break;
75964
75984
  case "nameLabel":
@@ -75968,9 +75988,7 @@ function updateLabel({x, y, labelData, markerModel, gridRect, position: position
75968
75988
  }
75969
75989
  const labelTitle = title || labelData.name;
75970
75990
  const nameX = isLeft ? gridRect.x : getLeftTextX(gridRect.x + gridRect.width, labelTitle, textStyle, markerModel.ecModel);
75971
- element.x = nameX;
75972
- element.y = labelY;
75973
- element.attr("style", Object.assign({text: labelTitle}, textStyle));
75991
+ element.attr("style", Object.assign({text: labelTitle, x: nameX, y: labelY}, textStyle));
75974
75992
  element.ignore = false;
75975
75993
  break;
75976
75994
  case "countDown":
@@ -75983,10 +76001,13 @@ function updateLabel({x, y, labelData, markerModel, gridRect, position: position
75983
76001
  const offsetY = showName ? textRect.height + paddings[0] + paddings[2] - 1 : 0;
75984
76002
  inner21(el).showCountDown = true;
75985
76003
  inner21(element).parentHeight = offsetY;
75986
- const fill = textStyle.fill === "#ffffff" ? "rgba(255,255,255,0.9)" : "rgba(0,0,0,0.9)";
75987
- element.x = textElx;
75988
- element.y = labelY + offsetY;
75989
- element.attr("style", Object.assign({text: countDownText, width: textRect.width}, textStyle, {fill}));
76004
+ const fill = textStyle.fill === "#ffffff" ? "rgba(255,255,255,0.8)" : "rgba(0,0,0,0.8)";
76005
+ element.attr("style", Object.assign({
76006
+ text: countDownText,
76007
+ width: textRect.width,
76008
+ x: textElx,
76009
+ y: labelY + offsetY
76010
+ }, textStyle, {fill}));
75990
76011
  element.ignore = false;
75991
76012
  break;
75992
76013
  }