tvcharts 0.6.36 → 0.6.38

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
@@ -22220,13 +22220,14 @@ var ArrowUp = Path_default.extend({
22220
22220
  cy: 0,
22221
22221
  width: 0,
22222
22222
  height: 0,
22223
- rectWidth: 0
22223
+ rectWidth: 0,
22224
+ triangleHeight: 0
22224
22225
  },
22225
22226
  buildPath: function(ctx, shape) {
22226
- const {cx, cy, rectWidth} = shape;
22227
+ const {cx, cy, rectWidth, triangleHeight} = shape;
22227
22228
  const width = shape.width / 2;
22228
22229
  const height = shape.height / 2;
22229
- const triangleY = cy - 2;
22230
+ const triangleY = cy - height + triangleHeight;
22230
22231
  ctx.moveTo(cx, cy - height);
22231
22232
  ctx.lineTo(cx + width, triangleY);
22232
22233
  ctx.lineTo(cx + width - rectWidth, triangleY);
@@ -22244,13 +22245,14 @@ var ArrowDown = Path_default.extend({
22244
22245
  cy: 0,
22245
22246
  width: 0,
22246
22247
  height: 0,
22247
- rectWidth: 0
22248
+ rectWidth: 0,
22249
+ triangleHeight: 0
22248
22250
  },
22249
22251
  buildPath: function(ctx, shape) {
22250
- const {cx, cy, rectWidth} = shape;
22252
+ const {cx, cy, rectWidth, triangleHeight} = shape;
22251
22253
  const width = shape.width / 2;
22252
22254
  const height = shape.height / 2;
22253
- const triangleY = cy + 2;
22255
+ const triangleY = cy + height - triangleHeight;
22254
22256
  ctx.moveTo(cx, cy + height);
22255
22257
  ctx.lineTo(cx + width, triangleY);
22256
22258
  ctx.lineTo(cx + width - rectWidth, triangleY);
@@ -22375,7 +22377,7 @@ var symbolShapeMakers = {
22375
22377
  const offset = 1;
22376
22378
  shape.x = x - w / 2 + offset;
22377
22379
  shape.triangleWidth = parentShape.triangleWidth;
22378
- shape.y = y - h;
22380
+ shape.y = y - h + parentShape.triangleWidth;
22379
22381
  shape.width = w;
22380
22382
  shape.height = h;
22381
22383
  shape.r = r;
@@ -22385,7 +22387,7 @@ var symbolShapeMakers = {
22385
22387
  const r = 2;
22386
22388
  shape.triangleWidth = triangleWidth;
22387
22389
  shape.x = x + triangleWidth;
22388
- shape.y = y - h;
22390
+ shape.y = y - h / 2;
22389
22391
  shape.width = w;
22390
22392
  shape.height = h;
22391
22393
  shape.r = r;
@@ -22395,7 +22397,7 @@ var symbolShapeMakers = {
22395
22397
  const r = 2;
22396
22398
  shape.triangleWidth = triangleWidth;
22397
22399
  shape.x = x - w - triangleWidth;
22398
- shape.y = y - h;
22400
+ shape.y = y - h / 2;
22399
22401
  shape.width = w;
22400
22402
  shape.height = h;
22401
22403
  shape.r = r;
@@ -22431,7 +22433,7 @@ var symbolShapeMakers = {
22431
22433
  const offsetX = parentShape.offsetX;
22432
22434
  const offsetWidth = parentShape.offsetWidth;
22433
22435
  shape.x = x + offsetX;
22434
- shape.y = y - h - offsetY;
22436
+ shape.y = y - h + parentShape.offsetY;
22435
22437
  shape.width = w;
22436
22438
  shape.height = h;
22437
22439
  shape.r = 2;
@@ -22444,7 +22446,7 @@ var symbolShapeMakers = {
22444
22446
  const offsetX = parentShape.offsetX;
22445
22447
  const offsetWidth = parentShape.offsetWidth;
22446
22448
  shape.x = x - w - offsetX;
22447
- shape.y = y - h;
22449
+ shape.y = y - h + parentShape.offsetY;
22448
22450
  shape.width = w;
22449
22451
  shape.height = h;
22450
22452
  shape.r = 2;
@@ -22478,14 +22480,16 @@ var symbolShapeMakers = {
22478
22480
  },
22479
22481
  arrowUp: function(x, y, w, h, shape, parentShape) {
22480
22482
  shape.rectWidth = parentShape.triangleWidth;
22481
- shape.cx = x + 1;
22483
+ shape.triangleHeight = parentShape.triangleHeight;
22484
+ shape.cx = x;
22482
22485
  shape.cy = y;
22483
22486
  shape.width = w;
22484
22487
  shape.height = h;
22485
22488
  },
22486
22489
  arrowDown: function(x, y, w, h, shape, parentShape) {
22487
22490
  shape.rectWidth = parentShape.triangleWidth;
22488
- shape.cx = x + 1;
22491
+ shape.triangleHeight = parentShape.triangleHeight;
22492
+ shape.cx = x;
22489
22493
  shape.cy = y;
22490
22494
  shape.width = w;
22491
22495
  shape.height = h;
@@ -55517,7 +55521,7 @@ var LabelsView2 = class extends Chart_default {
55517
55521
  },
55518
55522
  style: {
55519
55523
  fill: "none",
55520
- lineWidth: isLine ? 2 : void 0
55524
+ lineWidth: isLine ? 3 : void 0
55521
55525
  }
55522
55526
  });
55523
55527
  el.symbolProxy = createSymbol(key, 0, 0, 0, 0);
@@ -55552,7 +55556,7 @@ var xCrossMapping = {
55552
55556
  small: () => ({w: 25, h: 21}),
55553
55557
  tiny: () => ({w: 20, h: 17}),
55554
55558
  auto: (width) => {
55555
- return {w: width, h: width};
55559
+ return {w: width * 0.7, h: width * 0.7};
55556
55560
  }
55557
55561
  };
55558
55562
  var lCrossMapping = {
@@ -55562,7 +55566,7 @@ var lCrossMapping = {
55562
55566
  small: () => ({w: 24, h: 20}),
55563
55567
  tiny: () => ({w: 18, h: 16}),
55564
55568
  auto: (width) => {
55565
- return {w: width, h: width};
55569
+ return {w: width * 0.7, h: width * 0.7};
55566
55570
  }
55567
55571
  };
55568
55572
  var triangleMapping = {
@@ -55623,17 +55627,25 @@ var rectMapping = {
55623
55627
  small: () => ({w: 21, h: 21}),
55624
55628
  tiny: () => ({w: 17, h: 17}),
55625
55629
  auto: (width) => {
55626
- return {w: width, h: width};
55630
+ return {w: width * 0.7, h: width * 0.7};
55627
55631
  }
55628
55632
  };
55633
+ var getArrowShape = (width, height, baseW) => {
55634
+ const w = width * 0.6;
55635
+ const rectHeight = Math.max(Math.floor((baseW - w) / 3), 0);
55636
+ return {w, h: height, shape: {triangleWidth: Math.floor(w / 10 * 3), triangleHeight: height - rectHeight}};
55637
+ };
55629
55638
  var arrowMapping = {
55630
- huge: () => ({w: 40, h: 45, shape: {triangleWidth: 12}}),
55631
- large: () => ({w: 30, h: 35, shape: {triangleWidth: 8}}),
55632
- normal: () => ({w: 25, h: 27, shape: {triangleWidth: 6}}),
55633
- small: () => ({w: 17, h: 21, shape: {triangleWidth: 4}}),
55634
- tiny: () => ({w: 15, h: 17, shape: {triangleWidth: 3}}),
55639
+ huge: (width) => getArrowShape(width, 51, 114),
55640
+ large: (width) => getArrowShape(width, 39, 82),
55641
+ normal: (width) => {
55642
+ return getArrowShape(width, 28, 54);
55643
+ },
55644
+ small: (width) => getArrowShape(width, 21, 34),
55645
+ tiny: (width) => getArrowShape(width, 17, 18),
55635
55646
  auto: (width) => {
55636
- return {w: width, h: width + 4, shape: {triangleWidth: Math.max(width / 3, 3)}};
55647
+ const w = width * 0.6;
55648
+ return {w, h: w, shape: {triangleWidth: Math.floor(w / 10 * 3), triangleHeight: w / 2}};
55637
55649
  }
55638
55650
  };
55639
55651
  var symbolSizeMapping = {
@@ -55697,6 +55709,7 @@ var labelSymbols = [
55697
55709
  "labelUpperRight",
55698
55710
  "labelCenter"
55699
55711
  ];
55712
+ var upSymbols = ["labelUp", "labelUpperLeft", "labelUpperRight"];
55700
55713
  var labelSymbolByType = {};
55701
55714
  each(labelSymbols, function(type) {
55702
55715
  labelSymbolByType[type] = 1;
@@ -55708,19 +55721,19 @@ function changeLabelOffsetBySymbol(symbol, symbolRect, shape, oldOffset) {
55708
55721
  case "labelDown":
55709
55722
  return [offsetX, offsetY - shape.triangleWidth];
55710
55723
  case "labelUp":
55711
- break;
55724
+ return [offsetX, offsetY + shape.triangleWidth];
55712
55725
  case "labelLeft":
55713
- return [offsetX + shape.triangleWidth + symbolRect[0] / 2, offsetY];
55726
+ return [offsetX + shape.triangleWidth + symbolRect[0] / 2, offsetY + symbolRect[1] / 2];
55714
55727
  case "labelRight":
55715
- return [offsetX - shape.triangleWidth - symbolRect[0] / 2, offsetY];
55728
+ return [offsetX - shape.triangleWidth - symbolRect[0] / 2, offsetY + symbolRect[1] / 2];
55716
55729
  case "labelLowerLeft":
55717
55730
  return [offsetX + shape.offsetX / 2 + symbolRect[0] / 2, offsetY - shape.offsetY];
55718
55731
  case "labelLowerRight":
55719
55732
  return [offsetX - shape.offsetX - symbolRect[0] / 2, offsetY - shape.offsetY];
55720
55733
  case "labelUpperLeft":
55721
- return [offsetX + shape.offsetX + symbolRect[0] / 2, offsetY + shape.offsetWidth - symbolRect[1] / 2];
55734
+ return [offsetX + shape.offsetX + symbolRect[0] / 2, offsetY + shape.offsetY];
55722
55735
  case "labelUpperRight":
55723
- return [offsetX - shape.offsetX - symbolRect[0] / 2, offsetY];
55736
+ return [offsetX - shape.offsetX - symbolRect[0] / 2, offsetY + shape.offsetY];
55724
55737
  }
55725
55738
  return oldOffset;
55726
55739
  }
@@ -55733,7 +55746,7 @@ var labelsLayout = {
55733
55746
  if (!coordSys) {
55734
55747
  return;
55735
55748
  }
55736
- const bandWidth = Math.max(1, Math.round(seriesModel.coordinateSystem.getAxesByScale("ordinal")[0].scale.barSpace * 0.8));
55749
+ const bandWidth = Math.max(1, Math.round(coordSys.getAxesByScale("ordinal")[0].scale.barSpace * 0.8));
55737
55750
  const location = seriesModel.get("location");
55738
55751
  const dims = map(coordSys.dimensions, function(dim) {
55739
55752
  return data.mapDimension(dim);
@@ -55761,6 +55774,7 @@ var labelsLayout = {
55761
55774
  continue;
55762
55775
  }
55763
55776
  const itemModel = data.getItemModel(i);
55777
+ const yloc = itemModel.get("yloc");
55764
55778
  const symbol = itemModel.getShallow("symbol");
55765
55779
  let symbolSize = itemModel.getShallow("symbolSize");
55766
55780
  const symbolOffset = itemModel.getShallow("symbolOffset") || [0, 0];
@@ -55772,19 +55786,19 @@ var labelsLayout = {
55772
55786
  const size = itemModel.get("size") ?? "normal";
55773
55787
  const text = labelModel.get("formatter");
55774
55788
  const isLabel = labelSymbolByType[symbol];
55775
- const labelShow = labelModel.get("show");
55789
+ const textShow = labelModel.get("show");
55776
55790
  let fontSize = labelModel.getShallow("fontSize");
55777
- let position2 = "top";
55778
- if (location === "top") {
55791
+ let position2 = labelModel.get("position") || "top";
55792
+ if (location === "top" || location === "belowbar") {
55779
55793
  position2 = "bottom";
55780
- } else {
55781
- position2 = isLabel || symbol === "textOutline" ? "inside" : "top";
55794
+ } else if (isLabel || symbol === "textOutline") {
55795
+ position2 = "inside";
55782
55796
  }
55783
- if (!fontSize && labelShow) {
55797
+ if (textShow) {
55784
55798
  labelModel.option.fontSize = fontSize = getSymbolLabelFontSize(size, bandWidth);
55785
55799
  }
55786
55800
  let textRect = void 0;
55787
- if (labelShow) {
55801
+ if (textShow) {
55788
55802
  textRect = labelModel.getTextRect(text);
55789
55803
  if (isLabel) {
55790
55804
  symbolSize = [textRect.width + padding, textRect.height + padding];
@@ -55797,17 +55811,23 @@ var labelsLayout = {
55797
55811
  }
55798
55812
  }
55799
55813
  const {w, h, shape} = getSymbolSize2(symbol, size, bandWidth);
55800
- if (isLabel ? !labelShow || !text : true) {
55814
+ if (isLabel ? !textShow || !text : true) {
55801
55815
  symbolSize = [w, h];
55802
55816
  }
55803
55817
  const symbolRect = Array.isArray(symbolSize) ? symbolSize : [symbolSize, symbolSize];
55804
55818
  if (shape) {
55805
55819
  symbolShape = shape;
55806
- if (labelShow) {
55820
+ if (textShow) {
55807
55821
  oldOffset = changeLabelOffsetBySymbol(symbol, symbolRect, shape, oldOffset);
55808
55822
  }
55809
55823
  }
55810
55824
  const symbolPoint = [point[0], price || point[1]];
55825
+ if ((yloc === "belowbar" || yloc === "price") && upSymbols.includes(symbol)) {
55826
+ symbolPoint[1] = symbolPoint[1] + symbolRect[1];
55827
+ }
55828
+ if (symbol === "labelCenter") {
55829
+ symbolPoint[1] = symbolPoint[1] + symbolRect[1] / 2;
55830
+ }
55811
55831
  if (symbol !== "none" && style.fill) {
55812
55832
  const symbolStyles = symbolStyleMap[symbol] || [];
55813
55833
  symbolStyles.push({
@@ -55819,14 +55839,14 @@ var labelsLayout = {
55819
55839
  });
55820
55840
  symbolStyleMap[symbol] = symbolStyles;
55821
55841
  }
55822
- if (labelShow) {
55842
+ if (textShow) {
55823
55843
  const labelPoint = [...symbolPoint];
55824
55844
  if (position2 === "inside") {
55825
55845
  labelPoint[1] = labelPoint[1] - textRect.height / 2 - symbolRect[1] / 2;
55826
55846
  } else if (position2 === "top") {
55827
55847
  labelPoint[1] = labelPoint[1] - symbolRect[1] - textRect.height / 2 - 10;
55828
55848
  } else {
55829
- labelPoint[1] = labelPoint[1] + 10;
55849
+ labelPoint[1] = labelPoint[1] + symbolRect[1] - textRect.height / 2 + 10;
55830
55850
  }
55831
55851
  textList.push({
55832
55852
  text,
@@ -64668,7 +64688,12 @@ function installDataZoomAction(registers) {
64668
64688
  });
64669
64689
  });
64670
64690
  }
64671
- dataZoomModel.setRawRange({
64691
+ dataZoomModel.setRawRange(isLocalDataZoom ? {
64692
+ start: payload.start,
64693
+ end: payload.end,
64694
+ lastBarRightSideDiffBarCount: payload.lastBarRightSideDiffBarCount,
64695
+ barSpace: payload.barSpace
64696
+ } : {
64672
64697
  start: payload.start,
64673
64698
  end: payload.end,
64674
64699
  startValue: payload.startValue,
@@ -70377,7 +70402,8 @@ var markerTypeCalculator2 = {
70377
70402
  value: seriesData.getByRawIndex(item.valueDim, lastIndex),
70378
70403
  labelTextStyle: {
70379
70404
  fill: "#fff",
70380
- backgroundColor: fill
70405
+ backgroundColor: fill,
70406
+ borderWidth: 0
70381
70407
  }
70382
70408
  };
70383
70409
  },
@@ -70449,7 +70475,7 @@ var MarkLabelView2 = class extends Component_default2 {
70449
70475
  const labelMap = markerModel.labelMap;
70450
70476
  const updatedSeriesByName = {};
70451
70477
  ecModel.eachSeries((seriesModel) => {
70452
- const invisible = seriesModel.get("invisible");
70478
+ const invisible = seriesModel.get("priceScaleInvisible");
70453
70479
  if (invisible) {
70454
70480
  return;
70455
70481
  }
@@ -70755,7 +70781,7 @@ function updateText({option, gridRect, position: position2, ecModel, el, y, offs
70755
70781
  function createLabel({x, y, labelData, markerModel, gridRect, position: position2, labelTextStyle, fontSize}) {
70756
70782
  const {zlevel} = markerModel.option;
70757
70783
  const {lineStyle, showLine, showName, showTitle, title} = labelData;
70758
- const textStyle = Object.assign(labelData.textStyle ?? {}, {fontSize, padding: getPaddingByStyle(fontSize, labelData.textStyle.borderWidth)});
70784
+ const textStyle = Object.assign(labelData.textStyle ?? {}, {fontSize, padding: getPaddingByStyle(fontSize, labelTextStyle.borderWidth)}, labelTextStyle);
70759
70785
  const text = labelData.text;
70760
70786
  const labelTitle = title || labelData.name;
70761
70787
  const isLeft = position2 === "left";
@@ -70765,7 +70791,7 @@ function createLabel({x, y, labelData, markerModel, gridRect, position: position
70765
70791
  const textEl = new Text_default({
70766
70792
  x: isLeft ? getLeftTextX(x, text, textStyle, markerModel.ecModel) : x,
70767
70793
  y: labelY,
70768
- style: Object.assign({text}, textStyle, labelTextStyle),
70794
+ style: Object.assign({text}, textStyle),
70769
70795
  z: 101,
70770
70796
  zlevel,
70771
70797
  ignore: !showName
@@ -70773,7 +70799,7 @@ function createLabel({x, y, labelData, markerModel, gridRect, position: position
70773
70799
  const textNameEl = new Text_default({
70774
70800
  x: isLeft ? gridRect.x - borderWidth : getLeftTextX(gridRect.x + gridRect.width, labelTitle, textStyle, markerModel.ecModel) + borderWidth,
70775
70801
  y: labelY,
70776
- style: Object.assign({text: labelTitle}, textStyle, labelTextStyle),
70802
+ style: Object.assign({text: labelTitle}, textStyle),
70777
70803
  z: 101,
70778
70804
  zlevel,
70779
70805
  ignore: !showTitle
@@ -70800,7 +70826,7 @@ function createLabel({x, y, labelData, markerModel, gridRect, position: position
70800
70826
  }
70801
70827
  function updateLabel({x, y, labelData, markerModel, gridRect, position: position2, el, labelTextStyle, fontSize}) {
70802
70828
  const {lineStyle, showLine, showName, showTitle, title} = labelData;
70803
- const textStyle = Object.assign(labelData.textStyle ?? {}, {fontSize, padding: getPaddingByStyle(fontSize, labelData.textStyle.borderWidth)});
70829
+ const textStyle = Object.assign(labelData.textStyle ?? {}, {fontSize, padding: getPaddingByStyle(fontSize, labelTextStyle.borderWidth)}, labelTextStyle);
70804
70830
  const borderWidth = textStyle.borderWidth ?? 0;
70805
70831
  const isLeft = position2 === "left";
70806
70832
  if (el.ignore) {
@@ -70836,7 +70862,7 @@ function updateLabel({x, y, labelData, markerModel, gridRect, position: position
70836
70862
  const labelX = isLeft ? getLeftTextX(x, textLabel, textStyle, markerModel.ecModel) - borderWidth : x + borderWidth;
70837
70863
  element.x = labelX;
70838
70864
  element.y = labelY;
70839
- element.attr("style", Object.assign({text: textLabel}, textStyle, labelTextStyle));
70865
+ element.attr("style", Object.assign({text: textLabel}, textStyle));
70840
70866
  element.ignore = false;
70841
70867
  break;
70842
70868
  case "nameLabel":
@@ -70848,7 +70874,7 @@ function updateLabel({x, y, labelData, markerModel, gridRect, position: position
70848
70874
  const nameX = isLeft ? gridRect.x : getLeftTextX(gridRect.x + gridRect.width, labelTitle, textStyle, markerModel.ecModel);
70849
70875
  element.x = nameX;
70850
70876
  element.y = labelY;
70851
- element.attr("style", Object.assign({text: labelTitle}, textStyle, labelTextStyle));
70877
+ element.attr("style", Object.assign({text: labelTitle}, textStyle));
70852
70878
  element.ignore = false;
70853
70879
  break;
70854
70880
  }
@@ -72092,7 +72118,7 @@ function installDataZoomRoamProcessor(registers) {
72092
72118
  const controllerParams = mergeControllerParams(dataZoomInfoMap);
72093
72119
  controller.enable(controllerParams.controlType, controllerParams.opt);
72094
72120
  controller.setPointerChecker(coordSysRecord.containsPoint);
72095
- createOrUpdate(coordSysRecord, "dispatchAction", 60, "fixRate");
72121
+ createOrUpdate(coordSysRecord, "dispatchAction", 30, "fixRate");
72096
72122
  });
72097
72123
  });
72098
72124
  }