@visactor/vchart-extension 1.13.5-vstory.2 → 1.13.5-vstory.3

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
@@ -2336,7 +2336,7 @@
2336
2336
  default:
2337
2337
  if (this._t <= 0) this.context.lineTo(this._x, y, !1 !== this._lastDefined && !1 !== p.defined, this.lastPoint), this.context.lineTo(x, y, !1 !== this._lastDefined && !1 !== p.defined, p);else {
2338
2338
  const x1 = this._x * (1 - this._t) + x * this._t;
2339
- this.context.lineTo(x1, this._y, !1 !== this._lastDefined && !1 !== p.defined, this.lastPoint), this.context.lineTo(x1, y, !1 !== this._lastDefined && !1 !== p.defined, p);
2339
+ .5 === this._t ? this.context.lineTo(x1, this._y, !1 !== this._lastDefined, this.lastPoint) : this.context.lineTo(x1, this._y, !1 !== this._lastDefined && !1 !== p.defined, this.lastPoint), this.context.lineTo(x1, y, !1 !== this._lastDefined && !1 !== p.defined, p);
2340
2340
  }
2341
2341
  }
2342
2342
  this._lastDefined = p.defined, this._x = x, this._y = y, this.lastPoint = p;
@@ -3158,6 +3158,7 @@
3158
3158
  const DefaultRichTextAttribute = Object.assign(Object.assign(Object.assign({}, DefaultAttribute), DefaultTextStyle), {
3159
3159
  editable: !1,
3160
3160
  editOptions: null,
3161
+ ascentDescentMode: "actual",
3161
3162
  width: 300,
3162
3163
  height: 300,
3163
3164
  ellipsis: !0,
@@ -4031,7 +4032,7 @@
4031
4032
  let id = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : Generator.GenAutoIncrementId();
4032
4033
  let timeline = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultTimeline;
4033
4034
  let slience = arguments.length > 2 ? arguments[2] : undefined;
4034
- this.id = id, this.timeline = timeline, this.status = AnimateStatus.INITIAL, this.tailAnimate = new SubAnimate(this), this.subAnimates = [this.tailAnimate], this.timeScale = 1, this.rawPosition = -1, this._startTime = 0, this._duringTime = 0, this.timeline.addAnimate(this), this.slience = slience;
4035
+ this.id = id, this.timeline = timeline || defaultTimeline, this.status = AnimateStatus.INITIAL, this.tailAnimate = new SubAnimate(this), this.subAnimates = [this.tailAnimate], this.timeScale = 1, this.rawPosition = -1, this._startTime = 0, this._duringTime = 0, this.timeline.addAnimate(this), this.slience = slience;
4035
4036
  }
4036
4037
  setTimeline(timeline) {
4037
4038
  timeline !== this.timeline && (this.timeline.removeAnimate(this, !1), timeline.addAnimate(this));
@@ -4565,7 +4566,7 @@
4565
4566
  }
4566
4567
  static GetFile(url, type) {
4567
4568
  let data = ResourceLoader.cache.get(url);
4568
- return data ? "init" === data.loadState || "fail" === data.loadState ? Promise.reject() : "loading" === data.loadState ? data.dataPromise.then(data => data.data) : Promise.resolve(data.data) : (data = {
4569
+ return data ? "fail" === data.loadState ? Promise.reject() : "init" === data.loadState || "loading" === data.loadState ? data.dataPromise.then(data => data.data) : Promise.resolve(data.data) : (data = {
4569
4570
  type: type,
4570
4571
  loadState: "init"
4571
4572
  }, ResourceLoader.cache.set(url, data), "arrayBuffer" === type ? data.dataPromise = application.global.loadArrayBuffer(url) : "blob" === type ? data.dataPromise = application.global.loadBlob(url) : "json" === type && (data.dataPromise = application.global.loadJson(url)), data.dataPromise.then(data => data.data));
@@ -5677,7 +5678,7 @@
5677
5678
  application.graphicService.beforeUpdateAABBBounds(this, this.stage, !0, this._AABBBounds);
5678
5679
  const selfChange = this.shouldSelfChangeUpdateAABBBounds(),
5679
5680
  bounds = this.doUpdateAABBBounds();
5680
- return this.addUpdateLayoutTag(), application.graphicService.afterUpdateAABBBounds(this, this.stage, this._AABBBounds, this, selfChange), bounds;
5681
+ return this.addUpdateLayoutTag(), application.graphicService.afterUpdateAABBBounds(this, this.stage, this._AABBBounds, this, selfChange), "empty" === this.attribute.boundsMode && bounds.clear(), bounds;
5681
5682
  }
5682
5683
  doUpdateLocalMatrix() {
5683
5684
  const {
@@ -7371,7 +7372,7 @@
7371
7372
  } = attribute,
7372
7373
  b = aabbBounds;
7373
7374
  return points.forEach(p => {
7374
- !1 === p.defined && "zero" !== connectedType && "connect" !== connectedType || b.add(p.x, p.y);
7375
+ !1 === p.defined && "connect" !== connectedType || b.add(p.x, p.y);
7375
7376
  }), b;
7376
7377
  }
7377
7378
  updateLineAABBBoundsBySegments(attribute, lineTheme, aabbBounds, graphic) {
@@ -7382,7 +7383,7 @@
7382
7383
  b = aabbBounds;
7383
7384
  return segments.forEach(s => {
7384
7385
  s.points.forEach(p => {
7385
- !1 === p.defined && "zero" !== connectedType && "connect" !== connectedType || b.add(p.x, p.y);
7386
+ !1 === p.defined && "connect" !== connectedType || b.add(p.x, p.y);
7386
7387
  });
7387
7388
  }), b;
7388
7389
  }
@@ -8275,7 +8276,7 @@
8275
8276
  this._draw(line, lineAttribute, !1, drawContext, params);
8276
8277
  }
8277
8278
  drawSegmentItem(context, cache, fill, stroke, fillOpacity, strokeOpacity, attribute, defaultAttribute, clipRange, clipRangeByDimension, offsetX, offsetY, line, fillCb, strokeCb) {
8278
- var _a, _b, _c, _d, _e;
8279
+ var _a;
8279
8280
  if (!cache) return;
8280
8281
  context.beginPath();
8281
8282
  const z = null !== (_a = this.z) && void 0 !== _a ? _a : 0;
@@ -8288,27 +8289,7 @@
8288
8289
  x: originX = 0,
8289
8290
  x: originY = 0
8290
8291
  } = attribute;
8291
- !1 !== fill && (fillCb ? fillCb(context, attribute, defaultAttribute) : fillOpacity && (context.setCommonStyle(line, attribute, originX - offsetX, originY - offsetY, defaultAttribute), context.fill())), !1 !== stroke && (strokeCb ? strokeCb(context, attribute, defaultAttribute) : strokeOpacity && (context.setStrokeStyle(line, attribute, originX - offsetX, originY - offsetY, defaultAttribute), context.stroke()));
8292
- let {
8293
- connectedType: connectedType,
8294
- connectedX: connectedX,
8295
- connectedY: connectedY,
8296
- connectedStyle: connectedStyle
8297
- } = attribute;
8298
- if (vutils.isArray(defaultAttribute) ? (connectedType = null !== (_b = null != connectedType ? connectedType : defaultAttribute[0].connectedType) && void 0 !== _b ? _b : defaultAttribute[1].connectedType, connectedX = null !== (_c = null != connectedX ? connectedX : defaultAttribute[0].connectedX) && void 0 !== _c ? _c : defaultAttribute[1].connectedX, connectedY = null !== (_d = null != connectedY ? connectedY : defaultAttribute[0].connectedY) && void 0 !== _d ? _d : defaultAttribute[1].connectedY, connectedStyle = null !== (_e = null != connectedStyle ? connectedStyle : defaultAttribute[0].connectedStyle) && void 0 !== _e ? _e : defaultAttribute[1].connectedStyle) : (connectedType = null != connectedType ? connectedType : defaultAttribute.connectedType, connectedX = null != connectedX ? connectedX : defaultAttribute.connectedX, connectedY = null != connectedY ? connectedY : defaultAttribute.connectedY, connectedStyle = null != connectedStyle ? connectedStyle : defaultAttribute.connectedStyle), "connect" !== connectedType && "zero" !== connectedType && (connectedType = "none"), "none" !== connectedType) {
8299
- context.beginPath(), drawSegments(context.camera ? context : context.nativeContext, cache, clipRange, clipRangeByDimension, {
8300
- offsetX: offsetX,
8301
- offsetY: offsetY,
8302
- offsetZ: z,
8303
- drawConnect: !0,
8304
- mode: connectedType,
8305
- zeroX: connectedX,
8306
- zeroY: connectedY
8307
- });
8308
- const da = [];
8309
- vutils.isArray(defaultAttribute) ? defaultAttribute.forEach(i => da.push(i)) : da.push(defaultAttribute), da.push(attribute), !1 !== fill && (fillCb ? fillCb(context, attribute, defaultAttribute) : fillOpacity && (context.setCommonStyle(line, connectedStyle, originX - offsetX, originY - offsetY, da), context.fill())), !1 !== stroke && (strokeCb ? strokeCb(context, attribute, defaultAttribute) : strokeOpacity && (context.setStrokeStyle(line, connectedStyle, originX - offsetX, originY - offsetY, da), context.stroke()));
8310
- }
8311
- return !1;
8292
+ return !1 !== fill && (fillCb ? fillCb(context, attribute, defaultAttribute) : fillOpacity && (context.setCommonStyle(line, attribute, originX - offsetX, originY - offsetY, defaultAttribute), context.fill())), !1 !== stroke && (strokeCb ? strokeCb(context, attribute, defaultAttribute) : strokeOpacity && (context.setStrokeStyle(line, attribute, originX - offsetX, originY - offsetY, defaultAttribute), context.stroke())), !1;
8312
8293
  }
8313
8294
  drawLinearLineHighPerformance(line, context, fill, stroke, fillOpacity, strokeOpacity, offsetX, offsetY, lineAttribute, drawContext, params, fillCb, strokeCb) {
8314
8295
  var _a;
@@ -8340,7 +8321,8 @@
8340
8321
  segments: segments,
8341
8322
  points: points,
8342
8323
  closePath: closePath,
8343
- curveTension = lineAttribute.curveTension
8324
+ curveTension = lineAttribute.curveTension,
8325
+ connectedType = lineAttribute.connectedType
8344
8326
  } = line.attribute;
8345
8327
  if (!this.valid(line, lineAttribute, fillCb, strokeCb)) return;
8346
8328
  let {
@@ -8352,6 +8334,9 @@
8352
8334
  clipRangeByDimension = lineAttribute.clipRangeByDimension
8353
8335
  } = line.attribute;
8354
8336
  if (1 === clipRange && !segments && !points.some(p => !1 === p.defined) && "linear" === curveType) return this.drawLinearLineHighPerformance(line, context, !!fill, !!stroke, fillOpacity, strokeOpacity, x, y, lineAttribute, drawContext, params, fillCb, strokeCb);
8337
+ function parsePoint(points, connectedType) {
8338
+ return "none" === connectedType ? points : points.filter(p => !1 !== p.defined);
8339
+ }
8355
8340
  if (line.shouldUpdateShape()) {
8356
8341
  const {
8357
8342
  points: points,
@@ -8373,7 +8358,7 @@
8373
8358
  y: lastSeg.endY,
8374
8359
  defined: lastSeg.curves[lastSeg.curves.length - 1].defined
8375
8360
  } : index > 1 && (startPoint.x = lastSeg.endX, startPoint.y = lastSeg.endY, startPoint.defined = lastSeg.curves[lastSeg.curves.length - 1].defined);
8376
- const data = calcLineCache(seg.points, curveType, {
8361
+ const data = calcLineCache(parsePoint(seg.points, connectedType), curveType, {
8377
8362
  startPoint: startPoint,
8378
8363
  curveTension: curveTension
8379
8364
  });
@@ -8392,7 +8377,7 @@
8392
8377
  }
8393
8378
  } else {
8394
8379
  if (!points || !points.length) return line.cache = null, void line.clearUpdateShapeTag();
8395
- line.cache = calcLineCache(_points, curveType, {
8380
+ line.cache = calcLineCache(parsePoint(_points, connectedType), curveType, {
8396
8381
  curveTension: curveTension
8397
8382
  });
8398
8383
  }