@visactor/vrender-components 0.16.9-alpha.1 → 0.16.9

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/index.js CHANGED
@@ -7658,9 +7658,7 @@
7658
7658
  var data = ResourceLoader.cache.get(url);
7659
7659
  data ? "fail" === data.loadState ? application.global.getRequestAnimationFrame()(function () {
7660
7660
  mark.imageLoadFail(url);
7661
- }) : "init" === data.loadState || "loading" === data.loadState ? null === (_a = data.waitingMark) || void 0 === _a || _a.push(mark) : mark && application.global.getRequestAnimationFrame()(function () {
7662
- mark.imageLoadSuccess(url, data.data);
7663
- }) : (data = {
7661
+ }) : "init" === data.loadState || "loading" === data.loadState ? null === (_a = data.waitingMark) || void 0 === _a || _a.push(mark) : mark && mark.imageLoadSuccess(url, data.data) : (data = {
7664
7662
  type: "image",
7665
7663
  loadState: "init"
7666
7664
  }, ResourceLoader.cache.set(url, data), data.dataPromise = application.global.loadImage(url), data.dataPromise ? (data.waitingMark = [mark], data.dataPromise.then(function (res) {
@@ -8492,7 +8490,7 @@
8492
8490
  data: "init",
8493
8491
  state: null
8494
8492
  };
8495
- this.resources.set(url, cache), "string" == typeof image ? (cache.state = "loading", vutils.isValidUrl(image) || vutils.isBase64(image) ? (ResourceLoader.GetImage(image, this), this.backgroundImg = this.backgroundImg || background) : image.startsWith("<svg") && (ResourceLoader.GetSvg(image, this), this.backgroundImg = this.backgroundImg || background)) : (cache.state = "success", cache.data = image, this.backgroundImg = this.backgroundImg || background);
8493
+ this.resources.set(url, cache), "string" == typeof image ? (cache.state = "loading", image.startsWith("<svg") ? (ResourceLoader.GetSvg(image, this), this.backgroundImg = this.backgroundImg || background) : (vutils.isValidUrl(image) || image.includes("/") || vutils.isBase64(image)) && (ResourceLoader.GetImage(image, this), this.backgroundImg = this.backgroundImg || background)) : (cache.state = "success", cache.data = image, this.backgroundImg = this.backgroundImg || background);
8496
8494
  }
8497
8495
  }, {
8498
8496
  key: "imageLoadSuccess",
@@ -17831,6 +17829,7 @@
17831
17829
  }, {
17832
17830
  key: "clearScreen",
17833
17831
  value: function clearScreen(renderService, context, drawContext) {
17832
+ var _a;
17834
17833
  var clear = drawContext.clear;
17835
17834
  if (clear) {
17836
17835
  var canvas = context.getCanvas(),
@@ -17840,7 +17839,12 @@
17840
17839
  height = _drawContext$height === void 0 ? canvas.height : _drawContext$height,
17841
17840
  x = 0,
17842
17841
  y = 0;
17843
- context.clearRect(x, y, width, height), context.fillStyle = createColor(context, clear, {
17842
+ context.clearRect(x, y, width, height);
17843
+ var stage = null === (_a = renderService.drawParams) || void 0 === _a ? void 0 : _a.stage;
17844
+ if (stage && stage.backgroundImg && stage.resources) {
17845
+ var res = stage.resources.get(clear);
17846
+ res && "success" === res.state && res.data && context.drawImage(res.data, x, y, width, height);
17847
+ } else context.fillStyle = createColor(context, clear, {
17844
17848
  AABBBounds: {
17845
17849
  x1: x,
17846
17850
  y1: y,
@@ -20037,7 +20041,10 @@
20037
20041
  });
20038
20042
  }
20039
20043
  setAttribute(key, value, forceUpdateTag) {
20040
- if (vutils.isPlainObject(this.attribute[key]) && !vutils.isFunction(this.attribute[key]) && !vutils.isFunction(value)) {
20044
+ if (vutils.isPlainObject(this.attribute[key]) &&
20045
+ vutils.isPlainObject(value) &&
20046
+ !vutils.isFunction(this.attribute[key]) &&
20047
+ !vutils.isFunction(value)) {
20041
20048
  vutils.merge(this.attribute[key], value);
20042
20049
  }
20043
20050
  else {
@@ -22679,6 +22686,21 @@
22679
22686
  case 'inside-right':
22680
22687
  sx = 0.5;
22681
22688
  break;
22689
+ case 'top-right':
22690
+ sx = 0.5;
22691
+ sy = -0.5;
22692
+ break;
22693
+ case 'top-left':
22694
+ sx = -0.5;
22695
+ sy = -0.5;
22696
+ break;
22697
+ case 'bottom-right':
22698
+ sx = 0.5;
22699
+ sy = 0.5;
22700
+ break;
22701
+ case 'bottom-left':
22702
+ sx = -0.5;
22703
+ sy = 0.5;
22682
22704
  }
22683
22705
  anchorX += sx * rectWidth;
22684
22706
  anchorY += sy * rectHeight;
@@ -22697,6 +22719,16 @@
22697
22719
  else if (position.includes('right')) {
22698
22720
  vx = isInside ? -1 : 1;
22699
22721
  }
22722
+ switch (position) {
22723
+ case 'top-right':
22724
+ case 'bottom-right':
22725
+ vx = -1;
22726
+ break;
22727
+ case 'top-left':
22728
+ case 'bottom-left':
22729
+ vx = 1;
22730
+ break;
22731
+ }
22700
22732
  const x = anchorX + vx * offset + (vx * width) / 2;
22701
22733
  const y = anchorY + vy * offset + (vy * height) / 2;
22702
22734
  return { x, y };
@@ -24341,7 +24373,6 @@
24341
24373
  if (items.length > 1) {
24342
24374
  vutils.last(items).setAttribute('opacity', 0);
24343
24375
  }
24344
- vutils.last(source).setAttribute('opacity', 1);
24345
24376
  }
24346
24377
  }
24347
24378
  source.forEach(item => {
@@ -26580,7 +26611,8 @@
26580
26611
  const groupClip = createGroup(Object.assign(Object.assign({}, limitRect), { clip: true, pickable: false }));
26581
26612
  group = createGroup({
26582
26613
  x: -((_a = limitRect === null || limitRect === void 0 ? void 0 : limitRect.x) !== null && _a !== void 0 ? _a : 0),
26583
- y: -((_b = limitRect === null || limitRect === void 0 ? void 0 : limitRect.y) !== null && _b !== void 0 ? _b : 0)
26614
+ y: -((_b = limitRect === null || limitRect === void 0 ? void 0 : limitRect.y) !== null && _b !== void 0 ? _b : 0),
26615
+ pickable: false
26584
26616
  });
26585
26617
  groupClip.add(group);
26586
26618
  this._containerClip = groupClip;
@@ -26589,7 +26621,8 @@
26589
26621
  else {
26590
26622
  group = createGroup({
26591
26623
  x: 0,
26592
- y: 0
26624
+ y: 0,
26625
+ pickable: false
26593
26626
  });
26594
26627
  this.add(group);
26595
26628
  }
@@ -26606,11 +26639,10 @@
26606
26639
  });
26607
26640
  }
26608
26641
  render() {
26609
- var _a, _b;
26642
+ var _a;
26643
+ this.setAttribute('pickable', false);
26610
26644
  const markerVisible = (_a = this.attribute.visible) !== null && _a !== void 0 ? _a : true;
26611
- const markerInteractive = (_b = this.attribute.interactive) !== null && _b !== void 0 ? _b : false;
26612
- if (!markerInteractive) {
26613
- this.setAttribute('pickable', false);
26645
+ if (this.attribute.interactive === false) {
26614
26646
  this.setAttribute('childrenPickable', false);
26615
26647
  }
26616
26648
  if (markerVisible) {
@@ -26934,7 +26966,8 @@
26934
26966
  endSymbol,
26935
26967
  lineStyle,
26936
26968
  mainSegmentIndex,
26937
- multiSegment
26969
+ multiSegment,
26970
+ pickable: false
26938
26971
  });
26939
26972
  line.name = 'mark-line-line';
26940
26973
  this._line = line;
@@ -27211,7 +27244,8 @@
27211
27244
  y: position.y + ((itemContent === null || itemContent === void 0 ? void 0 : itemContent.offsetY) || 0)
27212
27245
  };
27213
27246
  const line = new Segment({
27214
- points: []
27247
+ points: [],
27248
+ pickable: false
27215
27249
  });
27216
27250
  line.name = 'mark-point-line';
27217
27251
  this._line = line;
@@ -31212,7 +31246,7 @@
31212
31246
  }
31213
31247
  };
31214
31248
 
31215
- const version = "0.16.9-alpha.1";
31249
+ const version = "0.16.9";
31216
31250
 
31217
31251
  exports.AbstractComponent = AbstractComponent;
31218
31252
  exports.ArcInfo = ArcInfo;