tvcharts 0.8.73 → 0.8.74

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
@@ -14327,9 +14327,9 @@ function setTextStyleCommon(textStyle, textStyleModel, opt, isNotNormal, isAttac
14327
14327
  if (overflow) {
14328
14328
  textStyle.overflow = overflow;
14329
14329
  }
14330
- const margin3 = textStyleModel.get("minMargin");
14331
- if (margin3 != null) {
14332
- textStyle.margin = margin3;
14330
+ const margin4 = textStyleModel.get("minMargin");
14331
+ if (margin4 != null) {
14332
+ textStyle.margin = margin4;
14333
14333
  }
14334
14334
  setTokenTextStyle(textStyle, textStyleModel, globalTextStyle, opt, isNotNormal, isAttached, true, false);
14335
14335
  }
@@ -15646,7 +15646,7 @@ function boxLayout(orient, group, gap, maxWidth, maxHeight) {
15646
15646
  var box = boxLayout;
15647
15647
  var vbox = curry(boxLayout, "vertical");
15648
15648
  var hbox = curry(boxLayout, "horizontal");
15649
- function getAvailableSize(positionInfo, containerRect, margin3) {
15649
+ function getAvailableSize(positionInfo, containerRect, margin4) {
15650
15650
  const containerWidth = containerRect.width;
15651
15651
  const containerHeight = containerRect.height;
15652
15652
  let x = parsePercent2(positionInfo.left, containerWidth);
@@ -15657,14 +15657,14 @@ function getAvailableSize(positionInfo, containerRect, margin3) {
15657
15657
  (isNaN(x2) || isNaN(parseFloat(positionInfo.right))) && (x2 = containerWidth);
15658
15658
  (isNaN(y) || isNaN(parseFloat(positionInfo.top))) && (y = 0);
15659
15659
  (isNaN(y2) || isNaN(parseFloat(positionInfo.bottom))) && (y2 = containerHeight);
15660
- margin3 = normalizeCssArray2(margin3 || 0);
15660
+ margin4 = normalizeCssArray2(margin4 || 0);
15661
15661
  return {
15662
- width: Math.max(x2 - x - margin3[1] - margin3[3], 0),
15663
- height: Math.max(y2 - y - margin3[0] - margin3[2], 0)
15662
+ width: Math.max(x2 - x - margin4[1] - margin4[3], 0),
15663
+ height: Math.max(y2 - y - margin4[0] - margin4[2], 0)
15664
15664
  };
15665
15665
  }
15666
- function getLayoutRect(positionInfo, containerRect, margin3) {
15667
- margin3 = normalizeCssArray2(margin3 || 0);
15666
+ function getLayoutRect(positionInfo, containerRect, margin4) {
15667
+ margin4 = normalizeCssArray2(margin4 || 0);
15668
15668
  const containerWidth = containerRect.width;
15669
15669
  const containerHeight = containerRect.height;
15670
15670
  let left = parsePercent2(positionInfo.left, containerWidth);
@@ -15673,8 +15673,8 @@ function getLayoutRect(positionInfo, containerRect, margin3) {
15673
15673
  const bottom = parsePercent2(positionInfo.bottom, containerHeight);
15674
15674
  let width = parsePercent2(positionInfo.width, containerWidth);
15675
15675
  let height = parsePercent2(positionInfo.height, containerHeight);
15676
- const verticalMargin = margin3[2] + margin3[0];
15677
- const horizontalMargin = margin3[1] + margin3[3];
15676
+ const verticalMargin = margin4[2] + margin4[0];
15677
+ const horizontalMargin = margin4[1] + margin4[3];
15678
15678
  const aspect = positionInfo.aspect;
15679
15679
  if (isNaN(width)) {
15680
15680
  width = containerWidth - right - horizontalMargin - left;
@@ -15705,7 +15705,7 @@ function getLayoutRect(positionInfo, containerRect, margin3) {
15705
15705
  }
15706
15706
  switch (positionInfo.left || positionInfo.right) {
15707
15707
  case "center":
15708
- left = containerWidth / 2 - width / 2 - margin3[3];
15708
+ left = containerWidth / 2 - width / 2 - margin4[3];
15709
15709
  break;
15710
15710
  case "right":
15711
15711
  left = containerWidth - width - horizontalMargin;
@@ -15714,7 +15714,7 @@ function getLayoutRect(positionInfo, containerRect, margin3) {
15714
15714
  switch (positionInfo.top || positionInfo.bottom) {
15715
15715
  case "middle":
15716
15716
  case "center":
15717
- top = containerHeight / 2 - height / 2 - margin3[0];
15717
+ top = containerHeight / 2 - height / 2 - margin4[0];
15718
15718
  break;
15719
15719
  case "bottom":
15720
15720
  top = containerHeight - height - verticalMargin;
@@ -15728,11 +15728,11 @@ function getLayoutRect(positionInfo, containerRect, margin3) {
15728
15728
  if (isNaN(height)) {
15729
15729
  height = containerHeight - verticalMargin - top - (bottom || 0);
15730
15730
  }
15731
- const rect = new BoundingRect_default(left + margin3[3], top + margin3[0], width, height);
15732
- rect.margin = margin3;
15731
+ const rect = new BoundingRect_default(left + margin4[3], top + margin4[0], width, height);
15732
+ rect.margin = margin4;
15733
15733
  return rect;
15734
15734
  }
15735
- function positionElement(el, positionInfo, containerRect, margin3, opt, out2) {
15735
+ function positionElement(el, positionInfo, containerRect, margin4, opt, out2) {
15736
15736
  const h = !opt || !opt.hv || opt.hv[0];
15737
15737
  const v = !opt || !opt.hv || opt.hv[1];
15738
15738
  const boundingMode = opt && opt.boundingMode || "all";
@@ -15753,7 +15753,7 @@ function positionElement(el, positionInfo, containerRect, margin3, opt, out2) {
15753
15753
  rect.applyTransform(transform2);
15754
15754
  }
15755
15755
  }
15756
- const layoutRect = getLayoutRect(defaults({width: rect.width, height: rect.height}, positionInfo), containerRect, margin3);
15756
+ const layoutRect = getLayoutRect(defaults({width: rect.width, height: rect.height}, positionInfo), containerRect, margin4);
15757
15757
  const dx = h ? layoutRect.x - rect.x : 0;
15758
15758
  const dy = v ? layoutRect.y - rect.y : 0;
15759
15759
  if (boundingMode === "raw") {
@@ -31232,9 +31232,9 @@ var Axis = class {
31232
31232
  function fixExtentWithBands(extent3, nTick) {
31233
31233
  const size = extent3[1] - extent3[0];
31234
31234
  const len2 = nTick;
31235
- const margin3 = size / len2 / 2;
31236
- extent3[0] += margin3;
31237
- extent3[1] -= margin3;
31235
+ const margin4 = size / len2 / 2;
31236
+ extent3[0] += margin4;
31237
+ extent3[1] -= margin4;
31238
31238
  }
31239
31239
  function fixOnBandTicksCoords(axis, ticksCoords, alignWithLabel, clamp2) {
31240
31240
  const ticksLen = ticksCoords.length;
@@ -38406,8 +38406,8 @@ function constrainTextWidth(layout18, availableWidth, forceRecalculate = false)
38406
38406
  }
38407
38407
  const newRect = label.getBoundingRect();
38408
38408
  textRect.width = newRect.width;
38409
- const margin3 = (label.style.margin || 0) + 2.1;
38410
- textRect.height = newRect.height + margin3;
38409
+ const margin4 = (label.style.margin || 0) + 2.1;
38410
+ textRect.height = newRect.height + margin4;
38411
38411
  textRect.y -= (textRect.height - oldHeight) / 2;
38412
38412
  }
38413
38413
  }
@@ -38535,9 +38535,9 @@ function pieLabelLayout(seriesModel) {
38535
38535
  if (!isLabelInside) {
38536
38536
  const textRect = label.getBoundingRect().clone();
38537
38537
  textRect.applyTransform(label.getComputedTransform());
38538
- const margin3 = (label.style.margin || 0) + 2.1;
38539
- textRect.y -= margin3 / 2;
38540
- textRect.height += margin3;
38538
+ const margin4 = (label.style.margin || 0) + 2.1;
38539
+ textRect.y -= margin4 / 2;
38540
+ textRect.height += margin4;
38541
38541
  labelLayoutList.push({
38542
38542
  label,
38543
38543
  labelLine,
@@ -39957,12 +39957,12 @@ var Grid2 = class {
39957
39957
  const labelUnionRect = estimateLabelUnionRect(axis);
39958
39958
  if (labelUnionRect) {
39959
39959
  const dim = axis.isHorizontal() ? "height" : "width";
39960
- const margin3 = axis.model.get(["axisLabel", "margin"]);
39961
- gridRect[dim] -= labelUnionRect[dim] + margin3;
39960
+ const margin4 = axis.model.get(["axisLabel", "margin"]);
39961
+ gridRect[dim] -= labelUnionRect[dim] + margin4;
39962
39962
  if (axis.position === "top") {
39963
- gridRect.y += labelUnionRect.height + margin3;
39963
+ gridRect.y += labelUnionRect.height + margin4;
39964
39964
  } else if (axis.position === "left") {
39965
- gridRect.x += labelUnionRect.width + margin3;
39965
+ gridRect.x += labelUnionRect.width + margin4;
39966
39966
  }
39967
39967
  }
39968
39968
  }
@@ -57664,12 +57664,11 @@ var TooltipHTMLContent = class {
57664
57664
  el.innerHTML = `<div style="padding-left: 4px;border-left: 4px solid var(${primaryColor});width: 290px;z-index: 10;border-radius: 6px;background: var(--container-bg);box-shadow: rgba(0, 0, 0, 0.4) 0px 2px 4px 0px;color: var(--title-color);">
57665
57665
  <div style="padding: 16px 12px;"><div style="display: flex; align-items: center; margin-bottom: 12px;">
57666
57666
  <div style="height: 20px; border-radius: 50px; min-width: 20px; margin-right: 8px; text-align: center; background-color: var(${primaryColor}); font-size: 12px; color: #fff;line-height:20px;">${orders.length}</div>
57667
- <div style="font-weight: 600; font-size: 18px;">\u4E70\u5165</div></div><div style="font-size: 13px; margin-bottom: 12px;">${title}</div>
57667
+ <div style="font-weight: 600; font-size: 18px;">${isUp ? "\u4E70\u5165" : "\u5356\u51FA"}</div></div><div style="font-size: 13px; margin-bottom: 12px;">${title}</div>
57668
57668
  ${ordersHtml}
57669
57669
  </div>
57670
57670
  </div>
57671
57671
  `;
57672
- console.log("====", el.clientHeight, el.clientWidth);
57673
57672
  if (x + el.clientWidth > this._container.clientWidth) {
57674
57673
  style.left = x - el.clientWidth - margin + "px";
57675
57674
  }
@@ -57713,7 +57712,7 @@ var PlaybackOrderView2 = class extends Chart_default {
57713
57712
  this._renderHover();
57714
57713
  if (!this.htmlContent) {
57715
57714
  this.htmlContent = new PlaybackHtmlContent_default(api2);
57716
- api2.getZr().on("click", this._clickGlobal, this);
57715
+ api2.getZr().on("mousedown", this._clickGlobal, this);
57717
57716
  }
57718
57717
  const clipPath = seriesModel.get("clip", true) && createClipPath(seriesModel.coordinateSystem, false, seriesModel);
57719
57718
  if (clipPath) {
@@ -57790,6 +57789,13 @@ var PlaybackOrderView2 = class extends Chart_default {
57790
57789
  const coordSys = seriesModel.coordinateSystem;
57791
57790
  return coordSys && coordSys.getArea && coordSys.getArea(0.1);
57792
57791
  }
57792
+ _mouseDown(e2) {
57793
+ const obj = inner11(e2.target);
57794
+ if (!obj) {
57795
+ return;
57796
+ }
57797
+ e2.cancelBubble = true;
57798
+ }
57793
57799
  _mouseClick(e2) {
57794
57800
  const obj = inner11(e2.target);
57795
57801
  if (!obj) {
@@ -57841,6 +57847,7 @@ var PlaybackOrderView2 = class extends Chart_default {
57841
57847
  this.group.on("mouseover", this._mouseover, this);
57842
57848
  this.group.on("mouseout", this._mouseout, this);
57843
57849
  this.group.on("click", this._mouseClick, this);
57850
+ this.group.on("mousedown", this._mouseDown, this);
57844
57851
  } else {
57845
57852
  this._symbolGroup.removeAll();
57846
57853
  }
@@ -57912,7 +57919,7 @@ var PlaybackOrderView2 = class extends Chart_default {
57912
57919
  dispose(ecModel, api2) {
57913
57920
  this.remove(ecModel, api2);
57914
57921
  this.htmlContent.dispose();
57915
- api2.getZr().off("click", this._clickGlobal);
57922
+ api2.getZr().off("mousedown", this._clickGlobal);
57916
57923
  this.htmlContent = null;
57917
57924
  }
57918
57925
  };
@@ -62770,7 +62777,7 @@ var ThemeRiverView2 = class extends Chart_default {
62770
62777
  let polygon;
62771
62778
  const textLayout = data.getItemLayout(indices[0]);
62772
62779
  const labelModel = seriesModel.getModel("label");
62773
- const margin3 = labelModel.get("margin");
62780
+ const margin4 = labelModel.get("margin");
62774
62781
  const emphasisModel = seriesModel.getModel("emphasis");
62775
62782
  if (status === "add") {
62776
62783
  const layerGroup = newLayersGroups[idx] = new Group_default();
@@ -62819,7 +62826,7 @@ var ThemeRiverView2 = class extends Chart_default {
62819
62826
  });
62820
62827
  const labelEl = polygon.getTextContent();
62821
62828
  if (labelEl) {
62822
- labelEl.x = textLayout.x - margin3;
62829
+ labelEl.x = textLayout.x - margin4;
62823
62830
  labelEl.y = textLayout.y0 + textLayout.y / 2;
62824
62831
  }
62825
62832
  polygon.useStyle(style);
@@ -68303,20 +68310,20 @@ var CalendarView2 = class extends Component_default2 {
68303
68310
  }
68304
68311
  return params.nameMap;
68305
68312
  }
68306
- _yearTextPositionControl(textEl, point, orient, position2, margin3) {
68313
+ _yearTextPositionControl(textEl, point, orient, position2, margin4) {
68307
68314
  let x = point[0];
68308
68315
  let y = point[1];
68309
68316
  let aligns = ["center", "bottom"];
68310
68317
  if (position2 === "bottom") {
68311
- y += margin3;
68318
+ y += margin4;
68312
68319
  aligns = ["center", "top"];
68313
68320
  } else if (position2 === "left") {
68314
- x -= margin3;
68321
+ x -= margin4;
68315
68322
  } else if (position2 === "right") {
68316
- x += margin3;
68323
+ x += margin4;
68317
68324
  aligns = ["center", "top"];
68318
68325
  } else {
68319
- y -= margin3;
68326
+ y -= margin4;
68320
68327
  }
68321
68328
  let rotate2 = 0;
68322
68329
  if (position2 === "left" || position2 === "right") {
@@ -68337,7 +68344,7 @@ var CalendarView2 = class extends Component_default2 {
68337
68344
  if (!yearLabel.get("show")) {
68338
68345
  return;
68339
68346
  }
68340
- const margin3 = yearLabel.get("margin");
68347
+ const margin4 = yearLabel.get("margin");
68341
68348
  let pos = yearLabel.get("position");
68342
68349
  if (!pos) {
68343
68350
  pos = orient !== "horizontal" ? "top" : "left";
@@ -68369,16 +68376,16 @@ var CalendarView2 = class extends Component_default2 {
68369
68376
  text: content
68370
68377
  })
68371
68378
  });
68372
- yearText.attr(this._yearTextPositionControl(yearText, posPoints[pos], orient, pos, margin3));
68379
+ yearText.attr(this._yearTextPositionControl(yearText, posPoints[pos], orient, pos, margin4));
68373
68380
  group.add(yearText);
68374
68381
  }
68375
- _monthTextPositionControl(point, isCenter, orient, position2, margin3) {
68382
+ _monthTextPositionControl(point, isCenter, orient, position2, margin4) {
68376
68383
  let align = "left";
68377
68384
  let vAlign = "top";
68378
68385
  let x = point[0];
68379
68386
  let y = point[1];
68380
68387
  if (orient === "horizontal") {
68381
- y = y + margin3;
68388
+ y = y + margin4;
68382
68389
  if (isCenter) {
68383
68390
  align = "center";
68384
68391
  }
@@ -68386,7 +68393,7 @@ var CalendarView2 = class extends Component_default2 {
68386
68393
  vAlign = "bottom";
68387
68394
  }
68388
68395
  } else {
68389
- x = x + margin3;
68396
+ x = x + margin4;
68390
68397
  if (isCenter) {
68391
68398
  vAlign = "middle";
68392
68399
  }
@@ -68407,7 +68414,7 @@ var CalendarView2 = class extends Component_default2 {
68407
68414
  return;
68408
68415
  }
68409
68416
  let nameMap = monthLabel.get("nameMap");
68410
- let margin3 = monthLabel.get("margin");
68417
+ let margin4 = monthLabel.get("margin");
68411
68418
  const pos = monthLabel.get("position");
68412
68419
  const align = monthLabel.get("align");
68413
68420
  const termPoints = [this._tlpoints, this._blpoints];
@@ -68419,7 +68426,7 @@ var CalendarView2 = class extends Component_default2 {
68419
68426
  }
68420
68427
  const idx = pos === "start" ? 0 : 1;
68421
68428
  const axis = orient === "horizontal" ? 0 : 1;
68422
- margin3 = pos === "start" ? -margin3 : margin3;
68429
+ margin4 = pos === "start" ? -margin4 : margin4;
68423
68430
  const isCenter = align === "center";
68424
68431
  for (let i = 0; i < termPoints[idx].length - 1; i++) {
68425
68432
  const tmp = termPoints[idx][i].slice();
@@ -68440,22 +68447,22 @@ var CalendarView2 = class extends Component_default2 {
68440
68447
  const content = this._formatterLabel(formatter, params);
68441
68448
  const monthText = new Text_default({
68442
68449
  z2: 30,
68443
- style: extend(createTextStyle(monthLabel, {text: content}), this._monthTextPositionControl(tmp, isCenter, orient, pos, margin3))
68450
+ style: extend(createTextStyle(monthLabel, {text: content}), this._monthTextPositionControl(tmp, isCenter, orient, pos, margin4))
68444
68451
  });
68445
68452
  group.add(monthText);
68446
68453
  }
68447
68454
  }
68448
- _weekTextPositionControl(point, orient, position2, margin3, cellSize) {
68455
+ _weekTextPositionControl(point, orient, position2, margin4, cellSize) {
68449
68456
  let align = "center";
68450
68457
  let vAlign = "middle";
68451
68458
  let x = point[0];
68452
68459
  let y = point[1];
68453
68460
  const isStart = position2 === "start";
68454
68461
  if (orient === "horizontal") {
68455
- x = x + margin3 + (isStart ? 1 : -1) * cellSize[0] / 2;
68462
+ x = x + margin4 + (isStart ? 1 : -1) * cellSize[0] / 2;
68456
68463
  align = isStart ? "right" : "left";
68457
68464
  } else {
68458
- y = y + margin3 + (isStart ? 1 : -1) * cellSize[1] / 2;
68465
+ y = y + margin4 + (isStart ? 1 : -1) * cellSize[1] / 2;
68459
68466
  vAlign = isStart ? "bottom" : "top";
68460
68467
  }
68461
68468
  return {
@@ -68473,7 +68480,7 @@ var CalendarView2 = class extends Component_default2 {
68473
68480
  const coordSys = calendarModel.coordinateSystem;
68474
68481
  const pos = dayLabel.get("position");
68475
68482
  let nameMap = dayLabel.get("nameMap");
68476
- let margin3 = dayLabel.get("margin");
68483
+ let margin4 = dayLabel.get("margin");
68477
68484
  const firstDayOfWeek = coordSys.getFirstDayOfWeek();
68478
68485
  if (!nameMap || isString(nameMap)) {
68479
68486
  if (nameMap) {
@@ -68484,10 +68491,10 @@ var CalendarView2 = class extends Component_default2 {
68484
68491
  }
68485
68492
  let start2 = coordSys.getNextNDay(rangeData.end.time, 7 - rangeData.lweek).time;
68486
68493
  const cellSize = [coordSys.getCellWidth(), coordSys.getCellHeight()];
68487
- margin3 = parsePercent2(margin3, Math.min(cellSize[1], cellSize[0]));
68494
+ margin4 = parsePercent2(margin4, Math.min(cellSize[1], cellSize[0]));
68488
68495
  if (pos === "start") {
68489
68496
  start2 = coordSys.getNextNDay(rangeData.start.time, -(7 + rangeData.fweek)).time;
68490
- margin3 = -margin3;
68497
+ margin4 = -margin4;
68491
68498
  }
68492
68499
  for (let i = 0; i < 7; i++) {
68493
68500
  const tmpD = coordSys.getNextNDay(start2, i);
@@ -68496,7 +68503,7 @@ var CalendarView2 = class extends Component_default2 {
68496
68503
  day = Math.abs((i + firstDayOfWeek) % 7);
68497
68504
  const weekText = new Text_default({
68498
68505
  z2: 30,
68499
- style: extend(createTextStyle(dayLabel, {text: nameMap[day]}), this._weekTextPositionControl(point, orient, pos, margin3, cellSize))
68506
+ style: extend(createTextStyle(dayLabel, {text: nameMap[day]}), this._weekTextPositionControl(point, orient, pos, margin4, cellSize))
68500
68507
  });
68501
68508
  group.add(weekText);
68502
68509
  }
@@ -72107,6 +72114,59 @@ function makeStyleCoord2(out2, zr, zrX, zrY) {
72107
72114
  }
72108
72115
  var TooltipRichContent_default = TooltipRichContent;
72109
72116
 
72117
+ // src/component/tooltip/TooltipTextHtmlContent.ts
72118
+ var margin2 = 10;
72119
+ var TooltipTextHtmlContent = class {
72120
+ constructor(api2) {
72121
+ this._show = false;
72122
+ this._enterable = true;
72123
+ if (env_default.wxa) {
72124
+ return null;
72125
+ }
72126
+ const el = document.createElement("div");
72127
+ el.domBelongToZr = true;
72128
+ this.el = el;
72129
+ const container = api2.getDom();
72130
+ (container || api2.getDom()).appendChild(el);
72131
+ this._api = api2;
72132
+ this._container = container;
72133
+ }
72134
+ show({x, y, text}) {
72135
+ const el = this.el;
72136
+ const style = el.style;
72137
+ style.position = "absolute";
72138
+ style.top = y - margin2 + "px";
72139
+ style.left = x + "px";
72140
+ style.visibility = "visible";
72141
+ style.opacity = "1";
72142
+ style.transform = "translateX(-50%) translateY(-100%)";
72143
+ el.innerHTML = `<div>
72144
+ <div style="min-width: 32px; padding: 4px 8px; color: var(--title-color); background-color: var(--modal-bg); font-size: 14px; border-radius: 6px; box-shadow: rgba(0, 0, 0, 0.08) 0px 6px 16px 0px, rgba(0, 0, 0, 0.12) 0px 3px 6px -4px, rgba(0, 0, 0, 0.05) 0px 9px 28px 8px;">${text}</div>
72145
+ <div style="width: 10px; height: 8px; transform: translateX(-50%) translateY(50%) rotate(45deg); position: absolute; bottom: 0px; left: 50%; background-color: var(--modal-bg);"></div>
72146
+ </div>`;
72147
+ }
72148
+ getSize() {
72149
+ const el = this.el;
72150
+ return [el.offsetWidth, el.offsetHeight];
72151
+ }
72152
+ hide() {
72153
+ const style = this.el.style;
72154
+ style.visibility = "hidden";
72155
+ style.opacity = "0";
72156
+ env_default.transform3dSupported && (style.willChange = "");
72157
+ this._show = false;
72158
+ }
72159
+ isShow() {
72160
+ return this._show;
72161
+ }
72162
+ dispose() {
72163
+ const parentNode2 = this.el.parentNode;
72164
+ parentNode2 && parentNode2.removeChild(this.el);
72165
+ this.el = this._container = null;
72166
+ }
72167
+ };
72168
+ var TooltipTextHtmlContent_default = TooltipTextHtmlContent;
72169
+
72110
72170
  // src/component/tooltip/TooltipView.ts
72111
72171
  var proxyRect = new Rect_default({
72112
72172
  shape: {x: -1, y: -1, width: 2, height: 2}
@@ -72126,6 +72186,7 @@ var TooltipView2 = class extends Component_default2 {
72126
72186
  this._tooltipContent = renderMode === "richText" ? new TooltipRichContent_default(api2) : new TooltipHTMLContent_default(api2, {
72127
72187
  appendTo: tooltipModel.get("appendToBody", true) ? "body" : tooltipModel.get("appendTo", true)
72128
72188
  });
72189
+ this._tooltipText = new TooltipTextHtmlContent_default(api2);
72129
72190
  }
72130
72191
  render(tooltipModel, ecModel, api2) {
72131
72192
  if (env_default.node || !api2.getDom()) {
@@ -72657,6 +72718,12 @@ var TooltipView2 = class extends Component_default2 {
72657
72718
  this._lastPoint = [];
72658
72719
  }
72659
72720
  }
72721
+ showTipText(tooltipModel, ecModel, api2, payload) {
72722
+ this._tooltipText.show(payload);
72723
+ }
72724
+ hideTipText(tooltipModel, ecModel, api2, payload) {
72725
+ this._tooltipText.hide();
72726
+ }
72660
72727
  dispose(ecModel, api2) {
72661
72728
  if (env_default.node || !api2.getDom()) {
72662
72729
  return;
@@ -72668,6 +72735,7 @@ var TooltipView2 = class extends Component_default2 {
72668
72735
  }
72669
72736
  clear(this, "_updatePosition");
72670
72737
  this._tooltipContent.dispose();
72738
+ this._tooltipText.dispose();
72671
72739
  unregister("itemTooltip", api2);
72672
72740
  }
72673
72741
  };
@@ -72822,6 +72890,16 @@ function install52(registers) {
72822
72890
  event: "hidePointer",
72823
72891
  update: "tooltip:hidePoint"
72824
72892
  }, noop);
72893
+ registers.registerAction({
72894
+ type: "showTipText",
72895
+ event: "showTipText",
72896
+ update: "tooltip:showTipText"
72897
+ }, noop);
72898
+ registers.registerAction({
72899
+ type: "hideTipText",
72900
+ event: "hideTipText",
72901
+ update: "tooltip:hideTipText"
72902
+ }, noop);
72825
72903
  }
72826
72904
 
72827
72905
  // src/component/brush/preprocessor.ts
@@ -73733,7 +73811,7 @@ function getTextYOffset(height, align, paddings) {
73733
73811
  return paddings;
73734
73812
  }
73735
73813
  }
73736
- var margin2 = 6;
73814
+ var margin3 = 6;
73737
73815
  function getXYByPosition(rect, position2, width, height, frame_width = 0) {
73738
73816
  let x = rect.x;
73739
73817
  let y = rect.y;
@@ -73750,16 +73828,16 @@ function getXYByPosition(rect, position2, width, height, frame_width = 0) {
73750
73828
  x = x + (rect.width - width) / 2 + frame_width;
73751
73829
  break;
73752
73830
  case "top":
73753
- y = y + frame_width + margin2;
73831
+ y = y + frame_width + margin3;
73754
73832
  break;
73755
73833
  case "bottom":
73756
- y = y + rect.height - height - frame_width - margin2;
73834
+ y = y + rect.height - height - frame_width - margin3;
73757
73835
  break;
73758
73836
  case "middle":
73759
73837
  y = y + (rect.height - height) / 2 + frame_width;
73760
73838
  break;
73761
73839
  default:
73762
- y = y + frame_width + margin2;
73840
+ y = y + frame_width + margin3;
73763
73841
  break;
73764
73842
  }
73765
73843
  }
@@ -74664,7 +74742,7 @@ var PlaybackSelectView2 = class extends Component_default2 {
74664
74742
  const yData = playbackSelectModel.get("yData");
74665
74743
  const xAxis = ecModel.getComponent("xAxis", 0);
74666
74744
  const xAxis2D = xAxis.axis;
74667
- const x = Math.floor(xAxis2D.toGlobalCoord(xAxis2D.dataToCoord(startIndex))) - 0.5;
74745
+ const x = Math.floor(xAxis2D.toGlobalCoord(xAxis2D.dataToCoord(startIndex)));
74668
74746
  const lineStyle = {
74669
74747
  lineWidth: 2,
74670
74748
  stroke: color2
@@ -74681,6 +74759,7 @@ var PlaybackSelectView2 = class extends Component_default2 {
74681
74759
  style: lineStyle
74682
74760
  });
74683
74761
  this.lineEl = lineEl;
74762
+ lineEl.z2 = 2;
74684
74763
  group.add(lineEl);
74685
74764
  } else {
74686
74765
  this.lineEl.attr({
@@ -74703,6 +74782,7 @@ var PlaybackSelectView2 = class extends Component_default2 {
74703
74782
  shape: rectShape,
74704
74783
  style: rectStyle
74705
74784
  });
74785
+ rectEl.z2 = 1;
74706
74786
  group.add(rectEl);
74707
74787
  this.rectEl = rectEl;
74708
74788
  } else {
@@ -75075,10 +75155,26 @@ var PlaybackOrderView4 = class extends Component_default2 {
75075
75155
  orderClosePositionEl.add(closePositionRect);
75076
75156
  orderClosePositionEl.add(closePositionIcon);
75077
75157
  orderClosePositionEl.onmouseover = () => {
75158
+ this.clearTimer();
75159
+ this._timer = setTimeout(() => {
75160
+ const [x, y] = closePositionRect.transformCoordToGlobal(closePositionRect.shape.x + closePositionRect.shape.width / 2, closePositionRect.shape.y);
75161
+ this.api.dispatchAction({
75162
+ type: "showTipText",
75163
+ escapeConnect: true,
75164
+ text: "\u5E73\u4ED3\u53CD\u624B",
75165
+ x,
75166
+ y
75167
+ });
75168
+ }, 300);
75078
75169
  closePositionRect.attr("style", {fill: blendColors(orderBg, this.backgroundColor)});
75079
75170
  };
75080
75171
  orderClosePositionEl.onmouseout = () => {
75081
75172
  closePositionRect.attr("style", {fill: this.backgroundColor});
75173
+ this.clearTimer();
75174
+ this.api.dispatchAction({
75175
+ type: "hideTipText",
75176
+ escapeConnect: true
75177
+ });
75082
75178
  };
75083
75179
  orderClosePositionEl.onclick = () => {
75084
75180
  this.sendMessage("closePosition");
@@ -75110,11 +75206,27 @@ var PlaybackOrderView4 = class extends Component_default2 {
75110
75206
  },
75111
75207
  ignore: false
75112
75208
  });
75209
+ this.clearTimer();
75210
+ this._timer = setTimeout(() => {
75211
+ const [x, y] = orderTpRect.transformCoordToGlobal(orderTpRect.shape.x + orderTpRect.shape.width / 2, orderTpRect.shape.y);
75212
+ this.api.dispatchAction({
75213
+ type: "showTipText",
75214
+ escapeConnect: true,
75215
+ text: "\u62D6\u52A8\u4EE5\u6DFB\u52A0\u6B62\u76C8",
75216
+ x,
75217
+ y
75218
+ });
75219
+ }, 300);
75113
75220
  orderTpRect.attr("style", {fill: blendColors(stopProfitBg, this.backgroundColor)});
75114
75221
  };
75115
75222
  orderTpEl.onmouseout = () => {
75116
75223
  orderTpRect.attr("style", {fill: this.backgroundColor});
75117
75224
  orderTpBgEl.attr("ignore", true);
75225
+ this.clearTimer();
75226
+ this.api.dispatchAction({
75227
+ type: "hideTipText",
75228
+ escapeConnect: true
75229
+ });
75118
75230
  };
75119
75231
  orderTpEl.onmousedown = () => {
75120
75232
  this.dragType = "TP";
@@ -75149,10 +75261,26 @@ var PlaybackOrderView4 = class extends Component_default2 {
75149
75261
  ignore: false
75150
75262
  });
75151
75263
  orderSlRect.attr("style", {fill: blendColors(stopLossBg, this.backgroundColor)});
75264
+ this.clearTimer();
75265
+ this._timer = setTimeout(() => {
75266
+ const [x, y] = orderSlRect.transformCoordToGlobal(orderSlRect.shape.x + orderSlRect.shape.width / 2, orderSlRect.shape.y);
75267
+ this.api.dispatchAction({
75268
+ type: "showTipText",
75269
+ escapeConnect: true,
75270
+ text: "\u62D6\u52A8\u4EE5\u6DFB\u52A0\u6B62\u635F",
75271
+ x,
75272
+ y
75273
+ });
75274
+ }, 300);
75152
75275
  };
75153
75276
  orderSlEl.onmouseout = () => {
75154
75277
  orderSlRect.attr("style", {fill: this.backgroundColor});
75155
75278
  orderSlBgEl.attr("ignore", true);
75279
+ this.clearTimer();
75280
+ this.api.dispatchAction({
75281
+ type: "hideTipText",
75282
+ escapeConnect: true
75283
+ });
75156
75284
  };
75157
75285
  orderSlEl.onmousedown = () => {
75158
75286
  this.dragType = "SL";
@@ -75191,9 +75319,25 @@ var PlaybackOrderView4 = class extends Component_default2 {
75191
75319
  },
75192
75320
  invisible: false
75193
75321
  });
75322
+ this.clearTimer();
75323
+ this._timer = setTimeout(() => {
75324
+ const [x, y] = orderCloseRect.transformCoordToGlobal(orderCloseRect.shape.x + orderCloseRect.shape.width / 2, orderCloseRect.shape.y);
75325
+ this.api.dispatchAction({
75326
+ type: "showTipText",
75327
+ escapeConnect: true,
75328
+ text: "\u5E73\u4ED3",
75329
+ x,
75330
+ y
75331
+ });
75332
+ }, 300);
75194
75333
  };
75195
75334
  orderCloseEl.onmouseout = () => {
75196
75335
  orderCloseRect.attr("invisible", true);
75336
+ this.clearTimer();
75337
+ this.api.dispatchAction({
75338
+ type: "hideTipText",
75339
+ escapeConnect: true
75340
+ });
75197
75341
  };
75198
75342
  orderCloseEl.onclick = () => {
75199
75343
  this.sendMessage("delete");
@@ -75236,7 +75380,7 @@ var PlaybackOrderView4 = class extends Component_default2 {
75236
75380
  return;
75237
75381
  }
75238
75382
  const yAxisModel = coordSys.getAxis("y");
75239
- const y = Math.floor(yAxisModel.toGlobalCoord(yAxisModel.dataToCoord(order.price)));
75383
+ const y = Math.floor(yAxisModel.toGlobalCoord(yAxisModel.dataToCoord(order.price))) + 0.5;
75240
75384
  let backgroundColor2 = ecModel.get("backgroundColor") || "#fff";
75241
75385
  if (backgroundColor2 && isGradientObject(backgroundColor2) && !backgroundColor2.global && backgroundColor2.type === "linear") {
75242
75386
  backgroundColor2 = {
@@ -75410,7 +75554,7 @@ var PlaybackOrderView4 = class extends Component_default2 {
75410
75554
  });
75411
75555
  orderDescEl.childAt(2).attr({
75412
75556
  style: {
75413
- text: order.size + "",
75557
+ text: `${order.direction === "long" ? "" : "-"}${order.size}`,
75414
75558
  fill: "#ffffff",
75415
75559
  fontSize: 14
75416
75560
  },
@@ -75616,7 +75760,7 @@ var PlaybackOrderView4 = class extends Component_default2 {
75616
75760
  const order = playbackOrderModel.get("order");
75617
75761
  const stopPrice = isStopProfit ? order.stopProfit : order.stopLoss;
75618
75762
  const zlevel = playbackOrderModel.get("zlevel");
75619
- const profitY = yAxisModel.toGlobalCoord(yAxisModel.dataToCoord(stopPrice));
75763
+ const profitY = yAxisModel.toGlobalCoord(yAxisModel.dataToCoord(stopPrice)) + 0.5;
75620
75764
  const rect = this.rect;
75621
75765
  const circleX = this.circleX;
75622
75766
  const circleMargin = this.circleMargin;
@@ -75659,8 +75803,24 @@ var PlaybackOrderView4 = class extends Component_default2 {
75659
75803
  },
75660
75804
  invisible: false
75661
75805
  });
75806
+ this.clearTimer();
75807
+ this._timer = setTimeout(() => {
75808
+ const [x, y] = stopCloseRect.transformCoordToGlobal(stopCloseRect.shape.x + stopCloseRect.shape.width / 2, stopCloseRect.shape.y);
75809
+ this.api.dispatchAction({
75810
+ type: "showTipText",
75811
+ escapeConnect: true,
75812
+ text: "\u53D6\u6D88\u8BA2\u5355",
75813
+ x,
75814
+ y
75815
+ });
75816
+ }, 300);
75662
75817
  };
75663
75818
  stopCloseEl2.onmouseout = () => {
75819
+ this.clearTimer();
75820
+ this.api.dispatchAction({
75821
+ type: "hideTipText",
75822
+ escapeConnect: true
75823
+ });
75664
75824
  stopCloseRect.attr("invisible", true);
75665
75825
  };
75666
75826
  stopCloseEl2.onclick = () => {
@@ -75738,7 +75898,7 @@ var PlaybackOrderView4 = class extends Component_default2 {
75738
75898
  });
75739
75899
  stopDescEl.childAt(2).attr({
75740
75900
  style: {
75741
- text: order.size + "",
75901
+ text: `${isLong ? "" : "-"}${order.size}`,
75742
75902
  fill: "#ffffff",
75743
75903
  fontSize: 14
75744
75904
  },
@@ -75930,6 +76090,11 @@ var PlaybackOrderView4 = class extends Component_default2 {
75930
76090
  view.avoidOverlap(true, this.ecModel, this.api);
75931
76091
  }
75932
76092
  }
76093
+ clearTimer() {
76094
+ if (this._timer) {
76095
+ clearTimeout(this._timer);
76096
+ }
76097
+ }
75933
76098
  clear() {
75934
76099
  if (!this.orderGroup) {
75935
76100
  return;