@visactor/vchart-extension 2.0.4-alpha.6 → 2.0.4-alpha.8

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/build/index.js CHANGED
@@ -7015,7 +7015,8 @@
7015
7015
  y1: 0,
7016
7016
  strokeBoundsBuffer: 0,
7017
7017
  cornerRadius: 0,
7018
- cornerType: "round"
7018
+ cornerType: "round",
7019
+ drawStrokeWhenZeroWH: !1
7019
7020
  });
7020
7021
  Object.assign(Object.assign({}, DefaultAttribute), {
7021
7022
  width: 0,
@@ -7024,7 +7025,8 @@
7024
7025
  y1: 0,
7025
7026
  cornerRadius: 0,
7026
7027
  length: 0,
7027
- cornerType: "round"
7028
+ cornerType: "round",
7029
+ drawStrokeWhenZeroWH: !1
7028
7030
  });
7029
7031
  const DefaultSymbolAttribute = Object.assign(Object.assign({}, DefaultAttribute), {
7030
7032
  symbolType: "circle",
@@ -10219,7 +10221,7 @@
10219
10221
  });
10220
10222
  }
10221
10223
  setAttributes(params, forceUpdateTag = !1, context) {
10222
- (params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(params, this.attribute, null, context) || params).background ? this.loadImage(params.background, !0) : params.shadowGraphic && this.setShadowGraphic(params.shadowGraphic), this._setAttributes(params, forceUpdateTag, context);
10224
+ params && ((params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(params, this.attribute, null, context) || params).background ? this.loadImage(params.background, !0) : params.shadowGraphic && this.setShadowGraphic(params.shadowGraphic), this._setAttributes(params, forceUpdateTag, context));
10223
10225
  }
10224
10226
  _setAttributes(params, forceUpdateTag = !1, context) {
10225
10227
  const keys = Object.keys(params);
@@ -10854,8 +10856,8 @@
10854
10856
  function strokeVisible(opacity, strokeOpacity) {
10855
10857
  return opacity * strokeOpacity > 0;
10856
10858
  }
10857
- function rectStrokeVisible(opacity, strokeOpacity, width, height) {
10858
- return opacity * strokeOpacity > 0 && 0 !== width && 0 !== height;
10859
+ function rectStrokeVisible(opacity, strokeOpacity, width, height, drawStrokeWhenZeroWH) {
10860
+ return drawStrokeWhenZeroWH ? opacity * strokeOpacity > 0 : opacity * strokeOpacity > 0 && 0 !== width && 0 !== height;
10859
10861
  }
10860
10862
  function intersect(x0, y0, x1, y1, x2, y2, x3, y3) {
10861
10863
  const x10 = x1 - x0,
@@ -14921,7 +14923,8 @@
14921
14923
  y1: y1,
14922
14924
  x: originX = rectAttribute.x,
14923
14925
  y: originY = rectAttribute.y,
14924
- fillStrokeOrder = rectAttribute.fillStrokeOrder
14926
+ fillStrokeOrder = rectAttribute.fillStrokeOrder,
14927
+ drawStrokeWhenZeroWH = rectAttribute.drawStrokeWhenZeroWH
14925
14928
  } = rect.attribute;
14926
14929
  let {
14927
14930
  width: width,
@@ -14929,7 +14932,7 @@
14929
14932
  } = rect.attribute;
14930
14933
  width = (null != width ? width : x1 - originX) || 0, height = (null != height ? height : y1 - originY) || 0;
14931
14934
  const fVisible = rectFillVisible(opacity, fillOpacity, width, height, fill),
14932
- sVisible = rectStrokeVisible(opacity, strokeOpacity, width, height),
14935
+ sVisible = rectStrokeVisible(opacity, strokeOpacity, width, height, drawStrokeWhenZeroWH),
14933
14936
  doFill = runFill(fill, background),
14934
14937
  doStroke = runStroke(stroke, lineWidth);
14935
14938
  if (!rect.valid || !visible) return;
@@ -15833,7 +15836,7 @@
15833
15836
  super(...arguments), this.type = "rect3d", this.numberType = RECT3D_NUMBER_TYPE;
15834
15837
  }
15835
15838
  drawShape(rect, context, x, y, drawContext, params, fillCb, strokeCb) {
15836
- var _a;
15839
+ var _a, _b;
15837
15840
  const rectAttribute = getTheme(rect, null == params ? void 0 : params.theme).rect,
15838
15841
  {
15839
15842
  fill = rectAttribute.fill,
@@ -15846,16 +15849,17 @@
15846
15849
  fillOpacity = rectAttribute.fillOpacity,
15847
15850
  lineWidth = rectAttribute.lineWidth,
15848
15851
  strokeOpacity = rectAttribute.strokeOpacity,
15849
- visible = rectAttribute.visible
15852
+ visible = rectAttribute.visible,
15853
+ drawStrokeWhenZeroWH = null !== (_a = rectAttribute.drawStrokeWhenZeroWH) && void 0 !== _a && _a
15850
15854
  } = rect.attribute;
15851
15855
  let {
15852
15856
  width: width,
15853
15857
  height: height
15854
15858
  } = rect.attribute;
15855
15859
  width = (null != width ? width : x1 - originX) || 0, height = (null != height ? height : y1 - originY) || 0;
15856
- const z = null !== (_a = this.z) && void 0 !== _a ? _a : 0,
15860
+ const z = null !== (_b = this.z) && void 0 !== _b ? _b : 0,
15857
15861
  fVisible = rectFillVisible(opacity, fillOpacity, width, height, fill),
15858
- sVisible = rectStrokeVisible(opacity, strokeOpacity, width, height),
15862
+ sVisible = rectStrokeVisible(opacity, strokeOpacity, width, height, drawStrokeWhenZeroWH),
15859
15863
  doFill = runFill(fill),
15860
15864
  doStroke = runStroke(stroke, lineWidth);
15861
15865
  if (!rect.valid || !visible) return;
@@ -17848,6 +17852,7 @@
17848
17852
  return this.getEndProps();
17849
17853
  }
17850
17854
  stop() {}
17855
+ release() {}
17851
17856
  }
17852
17857
  class WaitStep extends Step {
17853
17858
  constructor(type, props, duration, easing) {
@@ -18065,7 +18070,9 @@
18065
18070
  this.status !== AnimateStatus.END && this.onEnd(), this.status = AnimateStatus.END, this.target && ("start" === type ? this.target.setAttributes(this._startProps) : "end" === type ? this.target.setAttributes(this._endProps) : type && this.target.setAttributes(type));
18066
18071
  }
18067
18072
  release() {
18068
- this.status = AnimateStatus.END, this._onRemove && this._onRemove.forEach(cb => cb()), this._onStart = [], this._onFrame = [], this._onEnd = [], this._onRemove = [];
18073
+ this.status = AnimateStatus.END, this._onRemove && this._onRemove.forEach(cb => cb()), this._onStart = [], this._onFrame = [], this._onEnd = [], this._onRemove = [], this.forEachStep(step => {
18074
+ step.release();
18075
+ });
18069
18076
  }
18070
18077
  getDuration() {
18071
18078
  return this._duration;
@@ -18139,6 +18146,10 @@
18139
18146
  getLoop() {
18140
18147
  return this._loopCount;
18141
18148
  }
18149
+ forEachStep(cb) {
18150
+ let step = this._firstStep;
18151
+ for (; step;) cb(step), step = step.next;
18152
+ }
18142
18153
  }
18143
18154
 
18144
18155
  const performanceRAF = new PerformanceRAF();
@@ -18371,6 +18382,9 @@
18371
18382
  constructor(target) {
18372
18383
  this._animates = [], this._startCallbacks = [], this._endCallbacks = [], this._started = !1, this._activeCount = 0, this._target = target;
18373
18384
  }
18385
+ get started() {
18386
+ return this._started;
18387
+ }
18374
18388
  onStart(cb) {
18375
18389
  cb ? (this._startCallbacks.push(cb), this._started && this._activeCount > 0 && cb()) : this._startCallbacks.forEach(cb => {
18376
18390
  cb();
@@ -18511,14 +18525,14 @@
18511
18525
  return delayAfterValue > 0 && (totalDelay += delayAfterValue), totalDelay > 0 && animate.wait(totalDelay), loop && loop > 0 && animate.loop(loop), bounce && animate.bounce(!0), animate;
18512
18526
  }
18513
18527
  _handleRunAnimate(animate, custom, customType, from, props, duration, easing, customParameters, controlOptions, options, type, graphic) {
18514
- var _a, _b, _c, _d;
18528
+ var _a, _b, _c, _d, _e, _f;
18515
18529
  if (custom && customType) {
18516
18530
  const customParams = Object.assign({
18517
- width: graphic.stage.width,
18518
- height: graphic.stage.height,
18531
+ width: (null === (_a = graphic.stage) || void 0 === _a ? void 0 : _a.width) || 0,
18532
+ height: (null === (_b = graphic.stage) || void 0 === _b ? void 0 : _b.height) || 0,
18519
18533
  group: this._target.parent
18520
18534
  }, this.resolveValue(customParameters, graphic)),
18521
- objOptions = isFunction$1(options) ? options.call(null, null !== (_b = customParams && (null === (_a = customParams.data) || void 0 === _a ? void 0 : _a[0])) && void 0 !== _b ? _b : null === (_d = null === (_c = graphic.context) || void 0 === _c ? void 0 : _c.data) || void 0 === _d ? void 0 : _d[0], graphic, customParams) : options;
18535
+ objOptions = isFunction$1(options) ? options.call(null, null !== (_d = customParams && (null === (_c = customParams.data) || void 0 === _c ? void 0 : _c[0])) && void 0 !== _d ? _d : null === (_f = null === (_e = graphic.context) || void 0 === _e ? void 0 : _e.data) || void 0 === _f ? void 0 : _f[0], graphic, customParams) : options;
18522
18536
  customParams.options = objOptions, customParams.controlOptions = controlOptions, 1 === customType ? this.createCustomAnimation(animate, custom, from, props, duration, easing, customParams) : 2 === customType && this.createCustomInterpolatorAnimation(animate, custom, props, duration, easing, customParams);
18523
18537
  } else "to" === type ? animate.to(props, duration, easing) : "from" === type && animate.from(props, duration, easing);
18524
18538
  }
@@ -18738,7 +18752,7 @@
18738
18752
  reApplyState(state) {
18739
18753
  var _a;
18740
18754
  const stateInfo = null === (_a = this.stateList) || void 0 === _a ? void 0 : _a.find(stateInfo => stateInfo.state === state);
18741
- if (stateInfo) {
18755
+ if (stateInfo && stateInfo.executor.started) {
18742
18756
  const stateList = this.stateList.slice();
18743
18757
  stateInfo.executor.stop(), this.stateList = stateList, stateInfo.executor.execute(stateInfo.animationConfig);
18744
18758
  }