@visactor/vchart-extension 2.0.4-alpha.7 → 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
@@ -7253,34 +7253,6 @@
7253
7253
  }
7254
7254
  return c;
7255
7255
  }
7256
- static processColorStops(colorStops) {
7257
- if (!colorStops || 0 === colorStops.length) return [];
7258
- if (colorStops.some(item => item.length)) {
7259
- const stops = colorStops.map(item => ({
7260
- color: item.value,
7261
- offset: item.length ? parseFloat(item.length.value) / 100 : -1
7262
- }));
7263
- stops[0].offset < 0 && (stops[0].offset = 0), stops[stops.length - 1].offset < 0 && (stops[stops.length - 1].offset = 1);
7264
- for (let i = 1; i < stops.length - 1; i++) if (stops[i].offset < 0) {
7265
- const prevWithOffsetIdx = i - 1;
7266
- let nextWithOffsetIdx = i + 1;
7267
- for (; nextWithOffsetIdx < stops.length && stops[nextWithOffsetIdx].offset < 0;) nextWithOffsetIdx++;
7268
- const startOffset = stops[prevWithOffsetIdx].offset,
7269
- endOffset = stops[nextWithOffsetIdx].offset,
7270
- unspecCount = nextWithOffsetIdx - prevWithOffsetIdx;
7271
- for (let j = 1; j < unspecCount; j++) stops[prevWithOffsetIdx + j].offset = startOffset + (endOffset - startOffset) * j / unspecCount;
7272
- i = nextWithOffsetIdx - 1;
7273
- }
7274
- return stops;
7275
- }
7276
- return colorStops.map((item, index) => {
7277
- const offset = colorStops.length > 1 ? index / (colorStops.length - 1) : 0;
7278
- return {
7279
- color: item.value,
7280
- offset: offset
7281
- };
7282
- });
7283
- }
7284
7256
  static ParseConic(datum) {
7285
7257
  const {
7286
7258
  orientation: orientation,
@@ -7294,7 +7266,10 @@
7294
7266
  y: .5,
7295
7267
  startAngle: sa,
7296
7268
  endAngle: sa + pi2,
7297
- stops: GradientParser.processColorStops(colorStops)
7269
+ stops: colorStops.map(item => ({
7270
+ color: item.value,
7271
+ offset: parseFloat(item.length.value) / 100
7272
+ }))
7298
7273
  };
7299
7274
  }
7300
7275
  static ParseRadial(datum) {
@@ -7309,7 +7284,10 @@
7309
7284
  y1: .5,
7310
7285
  r0: 0,
7311
7286
  r1: 1,
7312
- stops: GradientParser.processColorStops(colorStops)
7287
+ stops: colorStops.map(item => ({
7288
+ color: item.value,
7289
+ offset: parseFloat(item.length.value) / 100
7290
+ }))
7313
7291
  };
7314
7292
  }
7315
7293
  static ParseLinear(datum) {
@@ -7331,7 +7309,10 @@
7331
7309
  y0: y0,
7332
7310
  x1: x1,
7333
7311
  y1: y1,
7334
- stops: GradientParser.processColorStops(colorStops)
7312
+ stops: colorStops.map(item => ({
7313
+ color: item.value,
7314
+ offset: parseFloat(item.length.value) / 100
7315
+ }))
7335
7316
  };
7336
7317
  }
7337
7318
  }
@@ -12864,7 +12845,7 @@
12864
12845
  case "right":
12865
12846
  deltaX = -aabbBounds.width();
12866
12847
  }
12867
- return height || ("middle" === this.verticalDirection ? deltaY -= aabbBounds.height() / 2 : "bottom" === this.verticalDirection && (deltaY -= aabbBounds.height())), aabbBounds.translate(deltaX, deltaY), application.graphicService.updateTempAABBBounds(aabbBounds), null == attribute.forceBoundsHeight && null == attribute.forceBoundsWidth || application.graphicService.updateHTMLTextAABBBounds(attribute, richtextTheme, aabbBounds), this.widthWithoutTransform = aabbBounds.x2 - aabbBounds.x1, this.heightWithoutTransform = aabbBounds.y2 - aabbBounds.y1, application.graphicService.transformAABBBounds(attribute, aabbBounds, richtextTheme, !1, this), 0 === aabbBounds.width() && 0 === aabbBounds.height() && aabbBounds.clear(), aabbBounds;
12848
+ return aabbBounds.translate(deltaX, deltaY), application.graphicService.updateTempAABBBounds(aabbBounds), null == attribute.forceBoundsHeight && null == attribute.forceBoundsWidth || application.graphicService.updateHTMLTextAABBBounds(attribute, richtextTheme, aabbBounds), this.widthWithoutTransform = aabbBounds.x2 - aabbBounds.x1, this.heightWithoutTransform = aabbBounds.y2 - aabbBounds.y1, application.graphicService.transformAABBBounds(attribute, aabbBounds, richtextTheme, !1, this), 0 === aabbBounds.width() && 0 === aabbBounds.height() && aabbBounds.clear(), aabbBounds;
12868
12849
  }
12869
12850
  needUpdateTags(keys) {
12870
12851
  return super.needUpdateTags(keys, RICHTEXT_UPDATE_TAG_KEY);
@@ -17879,6 +17860,8 @@
17879
17860
  }
17880
17861
  onStart() {
17881
17862
  super.onStart();
17863
+ }
17864
+ onFirstRun() {
17882
17865
  const fromProps = this.getFromProps();
17883
17866
  this.target.setAttributes(fromProps);
17884
17867
  }
@@ -21908,14 +21891,7 @@
21908
21891
  if (maskImage && ((_a = this._spec.layoutConfig) === null || _a === void 0 ? void 0 : _a.placement) === 'masked') {
21909
21892
  this._rootMark.getProduct().setAttribute('background', maskImage);
21910
21893
  }
21911
- }).bind(this),
21912
- onLayoutFinished: () => {
21913
- var _a, _b;
21914
- return (_b = (_a = this._option.globalInstance
21915
- .getChart()
21916
- .getOption()
21917
- .performanceHook) === null || _a === void 0 ? void 0 : _a.afterWordcloudShapeDraw) === null || _b === void 0 ? void 0 : _b.call(_a, this._option.globalInstance);
21918
- }
21894
+ }).bind(this)
21919
21895
  };
21920
21896
  }
21921
21897
  _buildMarkAttributeContext() {