tvcharts 0.7.59 → 0.7.60

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
@@ -24691,6 +24691,7 @@ var ECharts = class extends Eventful_default {
24691
24691
  "selectitem",
24692
24692
  "loadmore",
24693
24693
  "zoomend",
24694
+ "extraclick",
24694
24695
  "visiblechanged",
24695
24696
  "dataappend",
24696
24697
  "alarmchanged",
@@ -63837,11 +63838,11 @@ function doCreateOrUpdateEl(api2, existsEl, dataIndex, elOption, seriesModel, gr
63837
63838
  return el;
63838
63839
  }
63839
63840
  function doesElNeedRecreate(el, elOption, seriesModel) {
63840
- const elInner = customInnerStore(el);
63841
+ const elInner2 = customInnerStore(el);
63841
63842
  const elOptionType = elOption.type;
63842
63843
  const elOptionShape = elOption.shape;
63843
63844
  const elOptionStyle = elOption.style;
63844
- return seriesModel.isUniversalTransitionEnabled() || elOptionType != null && elOptionType !== elInner.customGraphicType || elOptionType === "path" && hasOwnPathData(elOptionShape) && getPathData(elOptionShape) !== elInner.customPathData || elOptionType === "image" && hasOwn(elOptionStyle, "image") && elOptionStyle.image !== elInner.customImagePath;
63845
+ return seriesModel.isUniversalTransitionEnabled() || elOptionType != null && elOptionType !== elInner2.customGraphicType || elOptionType === "path" && hasOwnPathData(elOptionShape) && getPathData(elOptionShape) !== elInner2.customPathData || elOptionType === "image" && hasOwn(elOptionStyle, "image") && elOptionStyle.image !== elInner2.customImagePath;
63845
63846
  }
63846
63847
  function doCreateOrUpdateClipPath(el, dataIndex, elOption, seriesModel, isInit) {
63847
63848
  const clipPathOpt = elOption.clipPath;
@@ -64181,6 +64182,7 @@ GraphicComponentModel.defaultOption = {
64181
64182
 
64182
64183
  // src/component/axisPointer/BaseAxisPointer.ts
64183
64184
  var inner11 = makeInner();
64185
+ var elInner = makeInner();
64184
64186
  var clone4 = clone;
64185
64187
  var bind2 = bind;
64186
64188
  var BaseAxisPointer = class {
@@ -64201,13 +64203,16 @@ var BaseAxisPointer = class {
64201
64203
  this._lastStatus = status;
64202
64204
  let group = this._group;
64203
64205
  const handle = this._handle;
64206
+ const extraGroup = this._extraGroup;
64204
64207
  if (!status || status === "hide") {
64205
64208
  group && group.hide();
64206
64209
  handle && handle.hide();
64210
+ extraGroup && extraGroup.hide();
64207
64211
  return;
64208
64212
  }
64209
64213
  group && group.show();
64210
64214
  handle && handle.show();
64215
+ extraGroup && extraGroup.show();
64211
64216
  const elOption = {};
64212
64217
  this.makeElOption(elOption, value, axisModel, axisPointerModel, api2);
64213
64218
  const graphicKey = elOption.graphicKey;
@@ -64227,6 +64232,7 @@ var BaseAxisPointer = class {
64227
64232
  }
64228
64233
  updateMandatoryProps(group, axisPointerModel, true);
64229
64234
  this._renderHandle(value);
64235
+ this._renderExtraGroup(elOption);
64230
64236
  }
64231
64237
  remove(api2) {
64232
64238
  this.clear(api2);
@@ -64262,14 +64268,12 @@ var BaseAxisPointer = class {
64262
64268
  const pointerOption = elOption.pointer;
64263
64269
  if (pointerOption) {
64264
64270
  const pointerEl = inner11(group).pointerEl = new graphic_exports[pointerOption.type](clone4(elOption.pointer));
64265
- pointerEl.zlevel = 2;
64266
64271
  group.add(pointerEl);
64267
64272
  }
64268
64273
  }
64269
64274
  createLabelEl(group, elOption, axisModel, axisPointerModel) {
64270
64275
  if (elOption.label) {
64271
64276
  const labelEl = inner11(group).labelEl = new Text_default(clone4(elOption.label));
64272
- labelEl.zlevel = 2;
64273
64277
  group.add(labelEl);
64274
64278
  updateLabelShowHide(labelEl, axisPointerModel);
64275
64279
  }
@@ -64292,6 +64296,98 @@ var BaseAxisPointer = class {
64292
64296
  updateLabelShowHide(labelEl, axisPointerModel);
64293
64297
  }
64294
64298
  }
64299
+ _renderExtraGroup(elOption) {
64300
+ const axisPointerModel = this._axisPointerModel;
64301
+ const extraGroupModel = axisPointerModel.getModel("extraIcon");
64302
+ const status = axisPointerModel.get("status");
64303
+ let extraGroup = this._extraGroup;
64304
+ const api2 = this._api;
64305
+ const zr = api2.getZr();
64306
+ if (!extraGroupModel.get("show") || !status || status === "hide") {
64307
+ extraGroup && zr.remove(extraGroup);
64308
+ this._extraGroup = null;
64309
+ return;
64310
+ }
64311
+ let size = extraGroupModel.get("size");
64312
+ const padding = extraGroupModel.get("padding");
64313
+ if (!isArray(size)) {
64314
+ size = [size, size];
64315
+ }
64316
+ const position2 = this._axisModel.axis.position;
64317
+ if (!this._extraGroup) {
64318
+ const zlevel = axisPointerModel.get("zlevel") || 2;
64319
+ const color2 = extraGroupModel.get("color");
64320
+ const z = axisPointerModel.get("z");
64321
+ const backgroundColor2 = extraGroupModel.get("backgroundColor");
64322
+ const hoverBackgroundColor = extraGroupModel.get("hoverBackgroundColor");
64323
+ const extraIcon = createIcon(extraGroupModel.get("icon"), {
64324
+ x: size[0] / 2,
64325
+ y: size[1] / 2,
64326
+ scaleX: size[0] / 2,
64327
+ scaleY: size[1] / 2,
64328
+ z2: 11,
64329
+ silent: true,
64330
+ zlevel,
64331
+ z
64332
+ });
64333
+ extraIcon.style.fill = color2;
64334
+ const extraRect = new Rect_default({
64335
+ shape: {
64336
+ y: -padding / 2,
64337
+ x: -padding / 2,
64338
+ width: size[0] + padding,
64339
+ height: size[1] + padding
64340
+ },
64341
+ style: {
64342
+ fill: backgroundColor2
64343
+ },
64344
+ z2: 10,
64345
+ zlevel,
64346
+ z
64347
+ });
64348
+ elInner(extraRect).type = "rect";
64349
+ extraGroup = this._extraGroup = new Group_default({
64350
+ onmousedown(e2) {
64351
+ api2.trigger("extraclick", {
64352
+ event: e2,
64353
+ value: axisPointerModel.get("value"),
64354
+ position: position2
64355
+ });
64356
+ },
64357
+ onmouseover() {
64358
+ extraRect.style.fill = hoverBackgroundColor;
64359
+ },
64360
+ onmouseout() {
64361
+ extraIcon.style.fill = color2;
64362
+ extraRect.style.fill = backgroundColor2;
64363
+ }
64364
+ });
64365
+ extraGroup.add(extraRect);
64366
+ extraGroup.add(extraIcon);
64367
+ zr.add(extraGroup);
64368
+ }
64369
+ const pointer = elOption.pointer;
64370
+ const isLeft = position2 === "left";
64371
+ const distance2 = extraGroupModel.get("distance");
64372
+ extraGroup.x = isLeft ? pointer.shape.x1 + distance2 : pointer.shape.x2 - (size[0] + distance2);
64373
+ extraGroup.y = pointer.shape.y1 - size[1] / 2;
64374
+ extraGroup.eachChild((el) => {
64375
+ if (elInner(el).type === "rect") {
64376
+ el.attr("shape", {
64377
+ y: -padding / 2,
64378
+ x: -padding / 2,
64379
+ width: size[0] + padding,
64380
+ height: size[1] + padding
64381
+ });
64382
+ } else {
64383
+ el.x = size[0] / 2;
64384
+ el.y = size[1] / 2;
64385
+ el.scaleX = size[0] / 2;
64386
+ el.scaleY = size[1] / 2;
64387
+ }
64388
+ ;
64389
+ });
64390
+ }
64295
64391
  _renderHandle(value) {
64296
64392
  if (this._dragging || !this.updateHandleTransform) {
64297
64393
  return;
@@ -64393,11 +64489,14 @@ var BaseAxisPointer = class {
64393
64489
  const zr = api2.getZr();
64394
64490
  const group = this._group;
64395
64491
  const handle = this._handle;
64492
+ const extraGroup = this._extraGroup;
64396
64493
  if (zr && group) {
64397
64494
  this._lastGraphicKey = null;
64398
64495
  group && zr.remove(group);
64399
64496
  handle && zr.remove(handle);
64497
+ extraGroup && zr.remove(extraGroup);
64400
64498
  this._group = null;
64499
+ this._extraGroup = null;
64401
64500
  this._handle = null;
64402
64501
  this._payloadInfo = null;
64403
64502
  }
@@ -64444,7 +64543,7 @@ function getHandleTransProps(trans) {
64444
64543
  }
64445
64544
  function updateMandatoryProps(group, axisPointerModel, silent) {
64446
64545
  const z = axisPointerModel.get("z");
64447
- const zlevel = axisPointerModel.get("zlevel");
64546
+ const zlevel = axisPointerModel.get("zlevel") || 2;
64448
64547
  group && group.traverse(function(el) {
64449
64548
  if (el.type !== "group") {
64450
64549
  z != null && (el.z = z);
@@ -64727,6 +64826,16 @@ AxisPointerModel.defaultOption = {
64727
64826
  shadowOffsetX: 0,
64728
64827
  shadowOffsetY: 2,
64729
64828
  throttle: 40
64829
+ },
64830
+ extraIcon: {
64831
+ show: false,
64832
+ icon: "M537.6 102.4c-225.28 0-409.6 184.32-409.6 409.6s184.32 409.6 409.6 409.6 409.6-184.32 409.6-409.6-184.32-409.6-409.6-409.6z m0 768c-199.68 0-358.4-158.72-358.4-358.4s158.72-358.4 358.4-358.4 358.4 158.72 358.4 358.4-158.72 358.4-358.4 358.4z M563.2 307.2h-51.2v179.2H332.8v51.2H512V716.8h51.2v-179.2h179.2v-51.2H563.2z",
64833
+ size: 14,
64834
+ color: "#fff",
64835
+ backgroundColor: "#B9BEC9",
64836
+ hoverBackgroundColor: "rgb(99,99,99)",
64837
+ distance: 2,
64838
+ padding: 4
64730
64839
  }
64731
64840
  };
64732
64841
  var AxisPointerModel_default = AxisPointerModel;
@@ -67626,9 +67735,9 @@ var GraphicComponentView2 = class extends Component_default2 {
67626
67735
  applyUpdateTransition(clipPath, clipPathOption, graphicModel, {isInit});
67627
67736
  applyKeyframeAnimation(clipPath, clipPathOption.keyframeAnimation, graphicModel);
67628
67737
  }
67629
- const elInner = inner15(el);
67738
+ const elInner2 = inner15(el);
67630
67739
  el.setTextConfig(textConfig);
67631
- elInner.option = elOption;
67740
+ elInner2.option = elOption;
67632
67741
  setEventData(el, graphicModel, elOption);
67633
67742
  setTooltipConfig({
67634
67743
  el,
@@ -67656,10 +67765,10 @@ var GraphicComponentView2 = class extends Component_default2 {
67656
67765
  }
67657
67766
  const parentEl = el.parent;
67658
67767
  const isParentRoot = parentEl === rootGroup;
67659
- const elInner = inner15(el);
67768
+ const elInner2 = inner15(el);
67660
67769
  const parentElInner = inner15(parentEl);
67661
- elInner.width = parsePercent2(elInner.option.width, isParentRoot ? apiWidth : parentElInner.width) || 0;
67662
- elInner.height = parsePercent2(elInner.option.height, isParentRoot ? apiHeight : parentElInner.height) || 0;
67770
+ elInner2.width = parsePercent2(elInner2.option.width, isParentRoot ? apiWidth : parentElInner.width) || 0;
67771
+ elInner2.height = parsePercent2(elInner2.option.height, isParentRoot ? apiHeight : parentElInner.height) || 0;
67663
67772
  }
67664
67773
  for (let i = elOptions.length - 1; i >= 0; i--) {
67665
67774
  const elOption = elOptions[i];
@@ -75204,6 +75313,9 @@ var MarkLabelModal2 = class extends Component_default {
75204
75313
  this._mergeOption(newOpt, ecModel);
75205
75314
  }
75206
75315
  _mergeOption(newOpt, ecModel) {
75316
+ if (newOpt.isAvoidOverlap !== void 0) {
75317
+ this.option.isAvoidOverlap = newOpt.isAvoidOverlap;
75318
+ }
75207
75319
  ecModel.eachSeries(function(seriesModel) {
75208
75320
  const seriesName = seriesModel.name;
75209
75321
  const markerOpt = seriesModel.get(this.mainType, true);
@@ -75238,7 +75350,8 @@ MarkLabelModal.defaultOption = {
75238
75350
  },
75239
75351
  textStyle: {
75240
75352
  padding: [4, 6, 2, 8]
75241
- }
75353
+ },
75354
+ isAvoidOverlap: true
75242
75355
  };
75243
75356
  var MarkLabelModal_default = MarkLabelModal;
75244
75357
 
@@ -75347,6 +75460,7 @@ var MarkLabelView2 = class extends Component_default2 {
75347
75460
  this.group.add(this._graphLabelGroup);
75348
75461
  }
75349
75462
  render(markerModel, ecModel, api2, payload) {
75463
+ const isAvoidOverlap = markerModel.get("isAvoidOverlap");
75350
75464
  const type = payload?.type;
75351
75465
  if (type !== "updateComOption") {
75352
75466
  this.updateMarkLabels(markerModel, ecModel);
@@ -75356,7 +75470,9 @@ var MarkLabelView2 = class extends Component_default2 {
75356
75470
  if (isUpdateGraphic) {
75357
75471
  this.graphicLabelsResize(ecModel);
75358
75472
  }
75359
- this.avoidOverlap();
75473
+ if (isAvoidOverlap) {
75474
+ this.avoidOverlap();
75475
+ }
75360
75476
  }
75361
75477
  updateMarkLabels(markerModel, ecModel) {
75362
75478
  const markerGroupMapBySeries = this.markerGroupMapBySeries;