@visactor/vrender-components 0.20.0-alpha.3 → 0.20.0

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.
Files changed (62) hide show
  1. package/cjs/axis/animate/group-transition.js +1 -1
  2. package/cjs/axis/animate/group-transition.js.map +1 -1
  3. package/cjs/axis/base.js +2 -1
  4. package/cjs/axis/base.js.map +1 -1
  5. package/cjs/axis/circle.js +20 -12
  6. package/cjs/axis/circle.js.map +1 -1
  7. package/cjs/axis/grid/base.js +5 -12
  8. package/cjs/axis/grid/base.js.map +1 -1
  9. package/cjs/axis/grid/line.js +3 -12
  10. package/cjs/axis/grid/line.js.map +1 -1
  11. package/cjs/axis/tick-data/continuous.js +3 -2
  12. package/cjs/axis/tick-data/continuous.js.map +1 -1
  13. package/cjs/axis/type.d.ts +3 -1
  14. package/cjs/axis/type.js.map +1 -1
  15. package/cjs/axis/util.d.ts +2 -0
  16. package/cjs/axis/util.js +19 -2
  17. package/cjs/axis/util.js.map +1 -1
  18. package/cjs/index.d.ts +1 -1
  19. package/cjs/index.js +1 -1
  20. package/cjs/index.js.map +1 -1
  21. package/cjs/label/arc.d.ts +1 -0
  22. package/cjs/label/arc.js +14 -18
  23. package/cjs/label/arc.js.map +1 -1
  24. package/cjs/label/base.d.ts +4 -0
  25. package/cjs/label/base.js +11 -8
  26. package/cjs/label/base.js.map +1 -1
  27. package/cjs/legend/discrete/discrete.js +3 -3
  28. package/cjs/legend/discrete/discrete.js.map +1 -1
  29. package/cjs/timeline/timeline.js +14 -16
  30. package/cjs/timeline/timeline.js.map +1 -1
  31. package/dist/index.es.js +182 -342
  32. package/es/axis/animate/group-transition.js +1 -1
  33. package/es/axis/animate/group-transition.js.map +1 -1
  34. package/es/axis/base.js +2 -1
  35. package/es/axis/base.js.map +1 -1
  36. package/es/axis/circle.js +22 -13
  37. package/es/axis/circle.js.map +1 -1
  38. package/es/axis/grid/base.js +6 -13
  39. package/es/axis/grid/base.js.map +1 -1
  40. package/es/axis/grid/line.js +4 -11
  41. package/es/axis/grid/line.js.map +1 -1
  42. package/es/axis/tick-data/continuous.js +3 -2
  43. package/es/axis/tick-data/continuous.js.map +1 -1
  44. package/es/axis/type.d.ts +3 -1
  45. package/es/axis/type.js.map +1 -1
  46. package/es/axis/util.d.ts +2 -0
  47. package/es/axis/util.js +16 -0
  48. package/es/axis/util.js.map +1 -1
  49. package/es/index.d.ts +1 -1
  50. package/es/index.js +1 -1
  51. package/es/index.js.map +1 -1
  52. package/es/label/arc.d.ts +1 -0
  53. package/es/label/arc.js +13 -19
  54. package/es/label/arc.js.map +1 -1
  55. package/es/label/base.d.ts +4 -0
  56. package/es/label/base.js +11 -8
  57. package/es/label/base.js.map +1 -1
  58. package/es/legend/discrete/discrete.js +3 -3
  59. package/es/legend/discrete/discrete.js.map +1 -1
  60. package/es/timeline/timeline.js +14 -16
  61. package/es/timeline/timeline.js.map +1 -1
  62. package/package.json +8 -8
package/dist/index.es.js CHANGED
@@ -32,40 +32,11 @@ class Metadata {
32
32
  var Reflect$1 = (function (Reflect) {
33
33
  var target;
34
34
  return function (exporter) {
35
- const hasOwn = Object.prototype.hasOwnProperty,
36
- supportsSymbol = "function" == typeof Symbol,
35
+ const supportsSymbol = "function" == typeof Symbol,
37
36
  toPrimitiveSymbol = supportsSymbol && void 0 !== Symbol.toPrimitive ? Symbol.toPrimitive : "@@toPrimitive",
38
- iteratorSymbol = supportsSymbol && void 0 !== Symbol.iterator ? Symbol.iterator : "@@iterator",
39
- supportsCreate = "function" == typeof Object.create,
40
- supportsProto = {
41
- __proto__: []
42
- } instanceof Array,
43
- downLevel = !supportsCreate && !supportsProto,
44
- HashMap = {
45
- create: supportsCreate ? function () {
46
- return MakeDictionary(Object.create(null));
47
- } : supportsProto ? function () {
48
- return MakeDictionary({
49
- __proto__: null
50
- });
51
- } : function () {
52
- return MakeDictionary({});
53
- },
54
- has: downLevel ? function (map, key) {
55
- return hasOwn.call(map, key);
56
- } : function (map, key) {
57
- return key in map;
58
- },
59
- get: downLevel ? function (map, key) {
60
- return hasOwn.call(map, key) ? map[key] : void 0;
61
- } : function (map, key) {
62
- return map[key];
63
- }
64
- },
65
- functionPrototype = Object.getPrototypeOf(Function),
66
- usePolyfill = "object" == typeof process && process.env && "true" === process.env.REFLECT_METADATA_USE_MAP_POLYFILL,
67
- _Map = usePolyfill || "function" != typeof Map || "function" != typeof Map.prototype.entries ? CreateMapPolyfill() : Map,
68
- Metadata = (usePolyfill || "function" != typeof Set || "function" != typeof Set.prototype.entries ? CreateSetPolyfill() : Set, new (usePolyfill || "function" != typeof WeakMap ? CreateWeakMapPolyfill() : WeakMap)());
37
+ functionPrototype = (Object.getPrototypeOf(Function)),
38
+ _Map = ("object" == typeof process && process.env && process.env.REFLECT_METADATA_USE_MAP_POLYFILL, Map),
39
+ Metadata = (new WeakMap());
69
40
  function defineMetadata(metadataKey, metadataValue, target, propertyKey) {
70
41
  if (!IsObject(target)) throw new TypeError();
71
42
  return OrdinaryDefineOwnMetadata(metadataKey, metadataValue, target, propertyKey);
@@ -222,183 +193,6 @@ var Reflect$1 = (function (Reflect) {
222
193
  const constructor = prototypeProto.constructor;
223
194
  return "function" != typeof constructor || constructor === O ? proto : constructor;
224
195
  }
225
- function CreateMapPolyfill() {
226
- const cacheSentinel = {},
227
- arraySentinel = [],
228
- MapIterator = function () {
229
- function MapIterator(keys, values, selector) {
230
- this._index = 0, this._keys = keys, this._values = values, this._selector = selector;
231
- }
232
- return MapIterator.prototype["@@iterator"] = function () {
233
- return this;
234
- }, MapIterator.prototype[iteratorSymbol] = function () {
235
- return this;
236
- }, MapIterator.prototype.next = function () {
237
- const index = this._index;
238
- if (index >= 0 && index < this._keys.length) {
239
- const result = this._selector(this._keys[index], this._values[index]);
240
- return index + 1 >= this._keys.length ? (this._index = -1, this._keys = arraySentinel, this._values = arraySentinel) : this._index++, {
241
- value: result,
242
- done: !1
243
- };
244
- }
245
- return {
246
- value: void 0,
247
- done: !0
248
- };
249
- }, MapIterator.prototype.throw = function (error) {
250
- throw this._index >= 0 && (this._index = -1, this._keys = arraySentinel, this._values = arraySentinel), error;
251
- }, MapIterator.prototype.return = function (value) {
252
- return this._index >= 0 && (this._index = -1, this._keys = arraySentinel, this._values = arraySentinel), {
253
- value: value,
254
- done: !0
255
- };
256
- }, MapIterator;
257
- }();
258
- return function () {
259
- function Map() {
260
- this._keys = [], this._values = [], this._cacheKey = cacheSentinel, this._cacheIndex = -2;
261
- }
262
- return Object.defineProperty(Map.prototype, "size", {
263
- get: function () {
264
- return this._keys.length;
265
- },
266
- enumerable: !0,
267
- configurable: !0
268
- }), Map.prototype.has = function (key) {
269
- return this._find(key, !1) >= 0;
270
- }, Map.prototype.get = function (key) {
271
- const index = this._find(key, !1);
272
- return index >= 0 ? this._values[index] : void 0;
273
- }, Map.prototype.set = function (key, value) {
274
- const index = this._find(key, !0);
275
- return this._values[index] = value, this;
276
- }, Map.prototype.delete = function (key) {
277
- const index = this._find(key, !1);
278
- if (index >= 0) {
279
- const size = this._keys.length;
280
- for (let i = index + 1; i < size; i++) this._keys[i - 1] = this._keys[i], this._values[i - 1] = this._values[i];
281
- return this._keys.length--, this._values.length--, key === this._cacheKey && (this._cacheKey = cacheSentinel, this._cacheIndex = -2), !0;
282
- }
283
- return !1;
284
- }, Map.prototype.clear = function () {
285
- this._keys.length = 0, this._values.length = 0, this._cacheKey = cacheSentinel, this._cacheIndex = -2;
286
- }, Map.prototype.keys = function () {
287
- return new MapIterator(this._keys, this._values, getKey);
288
- }, Map.prototype.values = function () {
289
- return new MapIterator(this._keys, this._values, getValue);
290
- }, Map.prototype.entries = function () {
291
- return new MapIterator(this._keys, this._values, getEntry);
292
- }, Map.prototype["@@iterator"] = function () {
293
- return this.entries();
294
- }, Map.prototype[iteratorSymbol] = function () {
295
- return this.entries();
296
- }, Map.prototype._find = function (key, insert) {
297
- return this._cacheKey !== key && (this._cacheIndex = this._keys.indexOf(this._cacheKey = key)), this._cacheIndex < 0 && insert && (this._cacheIndex = this._keys.length, this._keys.push(key), this._values.push(void 0)), this._cacheIndex;
298
- }, Map;
299
- }();
300
- function getKey(key, _) {
301
- return key;
302
- }
303
- function getValue(_, value) {
304
- return value;
305
- }
306
- function getEntry(key, value) {
307
- return [key, value];
308
- }
309
- }
310
- function CreateSetPolyfill() {
311
- return function () {
312
- function Set() {
313
- this._map = new _Map();
314
- }
315
- return Object.defineProperty(Set.prototype, "size", {
316
- get: function () {
317
- return this._map.size;
318
- },
319
- enumerable: !0,
320
- configurable: !0
321
- }), Set.prototype.has = function (value) {
322
- return this._map.has(value);
323
- }, Set.prototype.add = function (value) {
324
- return this._map.set(value, value), this;
325
- }, Set.prototype.delete = function (value) {
326
- return this._map.delete(value);
327
- }, Set.prototype.clear = function () {
328
- this._map.clear();
329
- }, Set.prototype.keys = function () {
330
- return this._map.keys();
331
- }, Set.prototype.values = function () {
332
- return this._map.values();
333
- }, Set.prototype.entries = function () {
334
- return this._map.entries();
335
- }, Set.prototype["@@iterator"] = function () {
336
- return this.keys();
337
- }, Set.prototype[iteratorSymbol] = function () {
338
- return this.keys();
339
- }, Set;
340
- }();
341
- }
342
- function CreateWeakMapPolyfill() {
343
- const UUID_SIZE = 16,
344
- keys = HashMap.create(),
345
- rootKey = CreateUniqueKey();
346
- return function () {
347
- function WeakMap() {
348
- this._key = CreateUniqueKey();
349
- }
350
- return WeakMap.prototype.has = function (target) {
351
- const table = GetOrCreateWeakMapTable(target, !1);
352
- return void 0 !== table && HashMap.has(table, this._key);
353
- }, WeakMap.prototype.get = function (target) {
354
- const table = GetOrCreateWeakMapTable(target, !1);
355
- return void 0 !== table ? HashMap.get(table, this._key) : void 0;
356
- }, WeakMap.prototype.set = function (target, value) {
357
- return GetOrCreateWeakMapTable(target, !0)[this._key] = value, this;
358
- }, WeakMap.prototype.delete = function (target) {
359
- const table = GetOrCreateWeakMapTable(target, !1);
360
- return void 0 !== table && delete table[this._key];
361
- }, WeakMap.prototype.clear = function () {
362
- this._key = CreateUniqueKey();
363
- }, WeakMap;
364
- }();
365
- function CreateUniqueKey() {
366
- let key;
367
- do {
368
- key = "@@WeakMap@@" + CreateUUID();
369
- } while (HashMap.has(keys, key));
370
- return keys[key] = !0, key;
371
- }
372
- function GetOrCreateWeakMapTable(target, create) {
373
- if (!hasOwn.call(target, rootKey)) {
374
- if (!create) return;
375
- Object.defineProperty(target, rootKey, {
376
- value: HashMap.create()
377
- });
378
- }
379
- return target[rootKey];
380
- }
381
- function FillRandomBytes(buffer, size) {
382
- for (let i = 0; i < size; ++i) buffer[i] = 255 * Math.random() | 0;
383
- return buffer;
384
- }
385
- function GenRandomBytes(size) {
386
- return "function" == typeof Uint8Array ? "undefined" != typeof crypto ? crypto.getRandomValues(new Uint8Array(size)) : FillRandomBytes(new Uint8Array(size), size) : FillRandomBytes(new Array(size), size);
387
- }
388
- function CreateUUID() {
389
- const data = GenRandomBytes(UUID_SIZE);
390
- data[6] = 79 & data[6] | 64, data[8] = 191 & data[8] | 128;
391
- let result = "";
392
- for (let offset = 0; offset < UUID_SIZE; ++offset) {
393
- const byte = data[offset];
394
- 4 !== offset && 6 !== offset && 8 !== offset || (result += "-"), byte < 16 && (result += "0"), result += byte.toString(16).toLowerCase();
395
- }
396
- return result;
397
- }
398
- }
399
- function MakeDictionary(obj) {
400
- return obj.__ = void 0, delete obj.__, obj;
401
- }
402
196
  exporter("defineMetadata", defineMetadata), exporter("hasMetadata", hasMetadata), exporter("hasOwnMetadata", hasOwnMetadata), exporter("getMetadata", getMetadata);
403
197
  }((target = Reflect, function (key, value) {
404
198
  "function" != typeof target[key] && Object.defineProperty(target, key, {
@@ -7290,7 +7084,7 @@ class DefaultGroupBackgroundRenderContribution extends DefaultBaseBackgroundRend
7290
7084
  const defaultGroupBackgroundRenderContribution = new DefaultGroupBackgroundRenderContribution();
7291
7085
 
7292
7086
  const halfPi = pi / 2;
7293
- function createRectPath(path, x, y, width, height, rectCornerRadius) {
7087
+ function createRectPath(path, x, y, width, height, rectCornerRadius, edgeCb) {
7294
7088
  let cornerRadius;
7295
7089
  if (width < 0 && (x += width, width = -width), height < 0 && (y += height, height = -height), isNumber(rectCornerRadius, !0)) cornerRadius = [rectCornerRadius = abs(rectCornerRadius), rectCornerRadius, rectCornerRadius, rectCornerRadius];else if (Array.isArray(rectCornerRadius)) {
7296
7090
  const cornerRadiusArr = rectCornerRadius;
@@ -7322,27 +7116,28 @@ function createRectPath(path, x, y, width, height, rectCornerRadius) {
7322
7116
  rightBottomPoint2 = [rightBottom[0], rightBottom[1] - _cornerRadius[2]],
7323
7117
  leftBottomPoint1 = [leftBottom[0] + _cornerRadius[3], leftBottom[1]],
7324
7118
  leftBottomPoint2 = [leftBottom[0], leftBottom[1] - _cornerRadius[3]];
7325
- if (path.moveTo(leftTopPoint1[0], leftTopPoint1[1]), path.lineTo(rightTopPoint1[0], rightTopPoint1[1]), !arrayEqual(rightTopPoint1, rightTopPoint2)) {
7119
+ if (path.moveTo(leftTopPoint1[0], leftTopPoint1[1]), edgeCb && edgeCb[0] ? edgeCb[0](leftTopPoint1[0], leftTopPoint1[1], rightTopPoint1[0], rightTopPoint1[1]) : path.lineTo(rightTopPoint1[0], rightTopPoint1[1]), !arrayEqual(rightTopPoint1, rightTopPoint2)) {
7120
+ edgeCb && edgeCb[0] && path.moveTo(rightTopPoint1[0], rightTopPoint1[1]);
7326
7121
  const centerX = rightTopPoint1[0],
7327
7122
  centerY = rightTopPoint1[1] + _cornerRadius[1];
7328
7123
  path.arc(centerX, centerY, _cornerRadius[1], -halfPi, 0, !1);
7329
7124
  }
7330
- if (path.lineTo(rightBottomPoint2[0], rightBottomPoint2[1]), !arrayEqual(rightBottomPoint1, rightBottomPoint2)) {
7125
+ if (edgeCb && edgeCb[1] ? edgeCb[1](rightTopPoint2[0], rightTopPoint2[1], rightBottomPoint2[0], rightBottomPoint2[1]) : path.lineTo(rightBottomPoint2[0], rightBottomPoint2[1]), !arrayEqual(rightBottomPoint1, rightBottomPoint2)) {
7331
7126
  const centerX = rightBottomPoint2[0] - _cornerRadius[2],
7332
7127
  centerY = rightBottomPoint2[1];
7333
- path.arc(centerX, centerY, _cornerRadius[2], 0, halfPi, !1);
7128
+ edgeCb && edgeCb[1] && path.moveTo(rightBottomPoint2[0], rightBottomPoint2[1]), path.arc(centerX, centerY, _cornerRadius[2], 0, halfPi, !1);
7334
7129
  }
7335
- if (path.lineTo(leftBottomPoint1[0], leftBottomPoint1[1]), !arrayEqual(leftBottomPoint1, leftBottomPoint2)) {
7130
+ if (edgeCb && edgeCb[2] ? edgeCb[2](rightBottomPoint1[0], rightBottomPoint1[1], leftBottomPoint1[0], leftBottomPoint1[1]) : path.lineTo(leftBottomPoint1[0], leftBottomPoint1[1]), !arrayEqual(leftBottomPoint1, leftBottomPoint2)) {
7336
7131
  const centerX = leftBottomPoint1[0],
7337
7132
  centerY = leftBottomPoint1[1] - _cornerRadius[3];
7338
- path.arc(centerX, centerY, _cornerRadius[3], halfPi, pi, !1);
7133
+ edgeCb && edgeCb[2] && path.moveTo(leftBottomPoint1[0], leftBottomPoint1[1]), path.arc(centerX, centerY, _cornerRadius[3], halfPi, pi, !1);
7339
7134
  }
7340
- if (path.lineTo(leftTopPoint2[0], leftTopPoint2[1]), !arrayEqual(leftTopPoint1, leftTopPoint2)) {
7135
+ if (edgeCb && edgeCb[3] ? edgeCb[3](leftBottomPoint2[0], leftBottomPoint2[1], leftTopPoint2[0], leftTopPoint2[1]) : path.lineTo(leftTopPoint2[0], leftTopPoint2[1]), !arrayEqual(leftTopPoint1, leftTopPoint2)) {
7341
7136
  const centerX = leftTopPoint1[0],
7342
7137
  centerY = leftTopPoint1[1] + _cornerRadius[0];
7343
- path.arc(centerX, centerY, _cornerRadius[0], pi, pi + halfPi, !1);
7138
+ edgeCb && edgeCb[3] && path.moveTo(leftTopPoint2[0], leftTopPoint2[1]), path.arc(centerX, centerY, _cornerRadius[0], pi, pi + halfPi, !1);
7344
7139
  }
7345
- return path.closePath(), path;
7140
+ return !edgeCb && path.closePath(), path;
7346
7141
  }
7347
7142
 
7348
7143
  var __decorate$H = undefined && undefined.__decorate || function (decorators, target, key, desc) {
@@ -7419,14 +7214,24 @@ let SplitRectAfterRenderContribution = class {
7419
7214
  y1: y1,
7420
7215
  x: originX = groupAttribute.x,
7421
7216
  y: originY = groupAttribute.y,
7422
- stroke = groupAttribute.stroke
7217
+ stroke = groupAttribute.stroke,
7218
+ cornerRadius = groupAttribute.cornerRadius
7423
7219
  } = rect.attribute;
7424
7220
  let {
7425
7221
  width: width,
7426
7222
  height: height
7427
7223
  } = rect.attribute;
7428
7224
  if (width = (null != width ? width : x1 - originX) || 0, height = (null != height ? height : y1 - originY) || 0, Array.isArray(stroke) && stroke.some(s => !1 === s)) {
7429
- if (context.setStrokeStyle(rect, rect.attribute, x, y, groupAttribute), context.beginPath(), context.moveTo(x, y), stroke[0] ? context.lineTo(x + width, y) : context.moveTo(x + width, y), stroke[1] ? context.lineTo(x + width, y + height) : context.moveTo(x + width, y + height), stroke[2] ? context.lineTo(x, y + height) : context.moveTo(x, y + height), stroke[3]) {
7225
+ if (context.setStrokeStyle(rect, rect.attribute, x, y, groupAttribute), !(0 === cornerRadius || isArray(cornerRadius) && cornerRadius.every(num => 0 === num))) {
7226
+ let lastStroke,
7227
+ lastStrokeI = 0;
7228
+ return createRectPath(context, x, y, width, height, cornerRadius, new Array(4).fill(0).map((_, i) => (x1, y1, x2, y2) => {
7229
+ stroke[i] && (lastStrokeI === i - 1 && stroke[i] === lastStroke || (context.setStrokeStyle(rect, Object.assign(Object.assign({}, rect.attribute), {
7230
+ stroke: stroke[i]
7231
+ }), x, y, groupAttribute), context.beginPath(), context.moveTo(x1, y1), lastStroke = stroke[i]), lastStrokeI = i, context.lineTo(x2, y2), context.stroke(), 3 === i && context.beginPath());
7232
+ })), void context.stroke();
7233
+ }
7234
+ if (context.beginPath(), context.moveTo(x, y), stroke[0] ? context.lineTo(x + width, y) : context.moveTo(x + width, y), stroke[1] ? context.lineTo(x + width, y + height) : context.moveTo(x + width, y + height), stroke[2] ? context.lineTo(x, y + height) : context.moveTo(x, y + height), stroke[3]) {
7430
7235
  const adjustY = stroke[0] ? y - context.lineWidth / 2 : y;
7431
7236
  context.lineTo(x, adjustY);
7432
7237
  } else context.moveTo(x, y);
@@ -8271,9 +8076,9 @@ let DefaultCanvasAreaRender = class extends BaseRender {
8271
8076
  data = this.valid(area, areaAttribute, fillCb, strokeCb);
8272
8077
  if (!data) return;
8273
8078
  const {
8274
- doFill: doFill,
8275
- doStroke: doStroke
8079
+ doFill: doFill
8276
8080
  } = data,
8081
+ doStroke = data.doStroke && data.sVisible,
8277
8082
  {
8278
8083
  clipRange = areaAttribute.clipRange,
8279
8084
  closePath: closePath,
@@ -9078,7 +8883,9 @@ let DefaultCanvasGroupRender = class {
9078
8883
  clip: clip,
9079
8884
  baseOpacity = 1
9080
8885
  } = group.attribute;
9081
- clip ? context.save() : context.highPerformanceSave(), context.baseGlobalAlpha *= baseOpacity;
8886
+ clip ? context.save() : context.highPerformanceSave();
8887
+ const baseGlobalAlpha = context.baseGlobalAlpha;
8888
+ context.baseGlobalAlpha *= baseOpacity;
9082
8889
  const groupAttribute = getTheme(group, null == params ? void 0 : params.theme).group,
9083
8890
  lastModelMatrix = context.modelMatrix;
9084
8891
  if (context.camera) {
@@ -9092,7 +8899,7 @@ let DefaultCanvasGroupRender = class {
9092
8899
  scrollY = groupAttribute.scrollY
9093
8900
  } = group.attribute;
9094
8901
  let p;
9095
- (scrollX || scrollY) && context.translate(scrollX, scrollY), params && params.drawingCb && (p = params.drawingCb()), context.modelMatrix !== lastModelMatrix && mat4Allocate.free(context.modelMatrix), context.modelMatrix = lastModelMatrix, context.baseGlobalAlpha /= baseOpacity, p && p.then ? p.then(() => {
8902
+ (scrollX || scrollY) && context.translate(scrollX, scrollY), params && params.drawingCb && (p = params.drawingCb()), context.modelMatrix !== lastModelMatrix && mat4Allocate.free(context.modelMatrix), context.modelMatrix = lastModelMatrix, context.baseGlobalAlpha = baseGlobalAlpha, p && p.then ? p.then(() => {
9096
8903
  clip ? context.restore() : context.highPerformanceRestore();
9097
8904
  }) : clip ? context.restore() : context.highPerformanceRestore();
9098
8905
  }
@@ -9266,7 +9073,7 @@ class ShadowRootDrawItemInterceptorContribution {
9266
9073
  const m = graphic.globalTransMatrix.getInverse();
9267
9074
  drawContribution.dirtyBounds.copy(drawContribution.backupDirtyBounds).transformWithMatrix(m), drawContribution.backupDirtyBounds.copy(drawContribution.dirtyBounds);
9268
9075
  }
9269
- return drawContribution.renderGroup(graphic.shadowRoot, drawContext, graphic.parent.globalTransMatrix), context.highPerformanceRestore(), drawContribution.dirtyBounds && drawContribution.backupDirtyBounds && (drawContribution.dirtyBounds.copy(tempDirtyBounds), drawContribution.backupDirtyBounds.copy(tempBackupDirtyBounds)), !0;
9076
+ return drawContribution.renderGroup(graphic.shadowRoot, drawContext, matrixAllocate.allocate(1, 0, 0, 1, 0, 0)), context.highPerformanceRestore(), drawContribution.dirtyBounds && drawContribution.backupDirtyBounds && (drawContribution.dirtyBounds.copy(tempDirtyBounds), drawContribution.backupDirtyBounds.copy(tempBackupDirtyBounds)), !0;
9270
9077
  }
9271
9078
  }
9272
9079
  class DebugDrawItemInterceptorContribution {
@@ -11452,20 +11259,21 @@ class Wrapper {
11452
11259
  this.frame.lines.push(line), this.frame.actualHeight += line.height, this.y += line.height, this.lineBuffer.length = 0, this.lineWidth = this.maxAscent = this.maxDescent = this.maxAscentForBlank = this.maxDescentForBlank = 0;
11453
11260
  }
11454
11261
  deal(paragraph) {
11455
- paragraph instanceof RichTextIcon ? "horizontal" === this.direction && 0 === this.width || "vertical" === this.direction && 0 === this.height || this.lineWidth + paragraph[this.directionKey.width] <= this[this.directionKey.width] ? this.store(paragraph) : 0 === this.lineBuffer.length ? (this.store(paragraph), this.send()) : (this.send(), this.deal(paragraph)) : "number" != typeof this.width || this.width < 0 || (paragraph.newLine && this.send(), 0 !== paragraph.text.length && ("horizontal" === this.direction && 0 === this.width || "vertical" === this.direction && 0 === this.height || this.lineWidth + paragraph[this.directionKey.width] <= this[this.directionKey.width] ? this.store(paragraph) : this.lineWidth === this[this.directionKey.width] ? (this.send(), this.deal(paragraph)) : this.cut(paragraph)));
11262
+ let singleLine = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
11263
+ paragraph instanceof RichTextIcon ? "horizontal" === this.direction && 0 === this.width || "vertical" === this.direction && 0 === this.height || this.lineWidth + paragraph[this.directionKey.width] <= this[this.directionKey.width] ? this.store(paragraph) : 0 === this.lineBuffer.length ? (this.store(paragraph), this.send()) : (this.send(), this.deal(paragraph)) : "number" != typeof this.width || this.width < 0 || (paragraph.newLine && this.send(), 0 !== paragraph.text.length && ("horizontal" === this.direction && 0 === this.width || "vertical" === this.direction && 0 === this.height || this.lineWidth + paragraph[this.directionKey.width] <= this[this.directionKey.width] ? this.store(paragraph) : this.lineWidth === this[this.directionKey.width] ? (this.send(), this.deal(paragraph)) : this.cut(paragraph, singleLine)));
11456
11264
  }
11457
- cut(paragraph) {
11265
+ cut(paragraph, singleLine) {
11458
11266
  const availableWidth = this[this.directionKey.width] - this.lineWidth || 0,
11459
11267
  guessIndex = Math.ceil(availableWidth / paragraph[this.directionKey.width] * paragraph.length) || 0,
11460
11268
  index = getStrByWithCanvas(paragraph.text, availableWidth, paragraph.character, guessIndex, "break-word" === this.frame.wordBreak);
11461
11269
  if (0 !== index) {
11462
11270
  const [p1, p2] = seperateParagraph(paragraph, index);
11463
- this.store(p1), this.deal(p2);
11271
+ this.store(p1), singleLine ? this.send() : this.deal(p2);
11464
11272
  } else 0 !== this.lineBuffer.length && (this.send(), this.deal(paragraph));
11465
11273
  }
11466
11274
  }
11467
11275
 
11468
- const RICHTEXT_UPDATE_TAG_KEY = ["width", "height", "ellipsis", "wordBreak", "verticalDirection", "maxHeight", "maxWidth", "textAlign", "textBaseline", "textConfig", "layoutDirection", ...GRAPHIC_UPDATE_TAG_KEY];
11276
+ const RICHTEXT_UPDATE_TAG_KEY = ["width", "height", "ellipsis", "wordBreak", "verticalDirection", "maxHeight", "maxWidth", "textAlign", "textBaseline", "textConfig", "layoutDirection", "fill", "stroke", "fontSize", ...GRAPHIC_UPDATE_TAG_KEY];
11469
11277
  class RichText extends Graphic {
11470
11278
  constructor(params) {
11471
11279
  super(params), this.type = "richtext", this._currentHoverIcon = null, this.numberType = RICHTEXT_NUMBER_TYPE;
@@ -11667,7 +11475,7 @@ class RichText extends Graphic {
11667
11475
  skip = !1;
11668
11476
  for (let i = 0; i < paragraphs.length; i++) {
11669
11477
  const p = paragraphs[i];
11670
- skip ? (p.overflow = !0, p.left = 1 / 0, p.top = 1 / 0, !p.newLine && frame.lines[frame.lines.length - 1].paragraphs.push(p)) : wrapper.deal(p), frame.lines.length !== lineCount && (lineCount = frame.lines.length, wrapper.lineBuffer.length = 0, p.overflow = !0, p.left = 1e3, p.top = 1e3, frame.lines[frame.lines.length - 1].paragraphs.push(p), skip = !0), p.newLine && (skip = !1, wrapper.lineWidth = 0);
11478
+ skip ? (p.overflow = !0, p.left = 1 / 0, p.top = 1 / 0, !p.newLine && frame.lines[frame.lines.length - 1].paragraphs.push(p)) : wrapper.deal(p, !0), frame.lines.length !== lineCount && (lineCount = frame.lines.length, wrapper.lineBuffer.length = 0, p.overflow = !0, p.left = 1e3, p.top = 1e3, frame.lines[frame.lines.length - 1].paragraphs.push(p), skip = !0), p.newLine && (skip = !1, wrapper.lineWidth = 0), wrapper.send();
11671
11479
  }
11672
11480
  } else for (let i = 0; i < paragraphs.length; i++) wrapper.deal(paragraphs[i]);
11673
11481
  wrapper.send();
@@ -11708,10 +11516,11 @@ class RichText extends Graphic {
11708
11516
  let pickIcon;
11709
11517
  return frameCache.icons.forEach(icon => {
11710
11518
  var _a, _b;
11711
- icon.AABBBounds.containsPoint({
11519
+ const bounds = icon.AABBBounds.clone();
11520
+ bounds.translate(icon._marginArray[3], icon._marginArray[0]), bounds.containsPoint({
11712
11521
  x: point.x - x,
11713
11522
  y: point.y - y
11714
- }) && (pickIcon = icon, pickIcon.globalX = (null !== (_a = pickIcon.attribute.x) && void 0 !== _a ? _a : 0) + x, pickIcon.globalY = (null !== (_b = pickIcon.attribute.y) && void 0 !== _b ? _b : 0) + y);
11523
+ }) && (pickIcon = icon, pickIcon.globalX = (null !== (_a = pickIcon.attribute.x) && void 0 !== _a ? _a : 0) + x + icon._marginArray[3], pickIcon.globalY = (null !== (_b = pickIcon.attribute.y) && void 0 !== _b ? _b : 0) + y + icon._marginArray[0]);
11715
11524
  }), pickIcon;
11716
11525
  }
11717
11526
  getNoWorkAnimateAttr() {
@@ -11773,6 +11582,9 @@ class Path extends Graphic {
11773
11582
  } = attribute;
11774
11583
  return application.graphicService.transformAABBBounds(attribute, aabbBounds, pathTheme, "miter" === lineJoin, this), aabbBounds;
11775
11584
  }
11585
+ doUpdateAABBBounds(full) {
11586
+ return this.doUpdatePathShape(), super.doUpdateAABBBounds(full);
11587
+ }
11776
11588
  doUpdatePathShape() {
11777
11589
  const attribute = this.attribute;
11778
11590
  isString(attribute.path, !0) ? this.cache = new CustomPath2D().fromString(attribute.path) : attribute.customPath && (this.cache = new CustomPath2D(), attribute.customPath(this.cache, this));
@@ -16317,26 +16129,30 @@ class LabelBase extends AbstractComponent {
16317
16129
  labeling(textBounds, graphicBounds, position, offset) {
16318
16130
  return;
16319
16131
  }
16132
+ _getLabelLinePoints(text, baseMark) {
16133
+ return connectLineBetweenBounds(text.AABBBounds, baseMark === null || baseMark === void 0 ? void 0 : baseMark.AABBBounds);
16134
+ }
16320
16135
  _createLabelLine(text, baseMark) {
16321
- const points = connectLineBetweenBounds(text.AABBBounds, baseMark === null || baseMark === void 0 ? void 0 : baseMark.AABBBounds);
16136
+ const points = this._getLabelLinePoints(text, baseMark);
16322
16137
  if (points) {
16323
- const line = graphicCreator.line({
16138
+ const lineGraphic = graphicCreator.line({
16324
16139
  points
16325
16140
  });
16326
- if (line === null || line === void 0 ? void 0 : line.customShape) {
16141
+ const { line = {} } = text.attribute;
16142
+ if (line.customShape) {
16327
16143
  const customShape = line.customShape;
16328
- line.pathProxy = (attrs) => {
16144
+ lineGraphic.pathProxy = (attrs) => {
16329
16145
  return customShape(text.attribute, attrs, new CustomPath2D());
16330
16146
  };
16331
16147
  }
16332
16148
  if (baseMark && baseMark.attribute.fill) {
16333
- line.setAttribute('stroke', baseMark.attribute.fill);
16149
+ lineGraphic.setAttribute('stroke', baseMark.attribute.fill);
16334
16150
  }
16335
16151
  if (this.attribute.line && !isEmpty(this.attribute.line.style)) {
16336
- line.setAttributes(this.attribute.line.style);
16152
+ lineGraphic.setAttributes(this.attribute.line.style);
16337
16153
  }
16338
- this._setStatesOfLabelLine(line);
16339
- return line;
16154
+ this._setStatesOfLabelLine(lineGraphic);
16155
+ return lineGraphic;
16340
16156
  }
16341
16157
  }
16342
16158
  render() {
@@ -17138,6 +16954,9 @@ class ArcLabel extends LabelBase {
17138
16954
  : undefined,
17139
16955
  line: basedArc.labelLine
17140
16956
  };
16957
+ if (labels[i].type === 'richtext') {
16958
+ labelAttribute.width = basedArc.labelLimit;
16959
+ }
17141
16960
  labels[i].setAttributes(labelAttribute);
17142
16961
  }
17143
16962
  }
@@ -17744,28 +17563,25 @@ class ArcLabel extends LabelBase {
17744
17563
  }
17745
17564
  }
17746
17565
  }
17566
+ _getLabelLinePoints(text, baseMark) {
17567
+ return text.attribute.points;
17568
+ }
17747
17569
  _createLabelLine(text, baseMark) {
17748
- var _a, _b, _c, _d, _e, _f, _g;
17749
- const { points, line = {}, visible, fill } = text.attribute;
17750
- const labelLine = text.attribute.points
17751
- ? graphicCreator.line({
17570
+ var _a, _b, _c, _d, _e;
17571
+ const { line = {}, visible } = text.attribute;
17572
+ const lineGraphic = super._createLabelLine(text, baseMark);
17573
+ if (lineGraphic) {
17574
+ lineGraphic.setAttributes({
17752
17575
  visible: (_c = (_a = (line.visible && visible)) !== null && _a !== void 0 ? _a : (_b = text.attribute) === null || _b === void 0 ? void 0 : _b.visible) !== null && _c !== void 0 ? _c : true,
17753
- stroke: (_e = (_d = line.style) === null || _d === void 0 ? void 0 : _d.stroke) !== null && _e !== void 0 ? _e : fill,
17754
- lineWidth: (_g = (_f = line.style) === null || _f === void 0 ? void 0 : _f.lineWidth) !== null && _g !== void 0 ? _g : 1,
17755
- points: points,
17756
- curveType: line.smooth ? 'basis' : null
17757
- })
17758
- : undefined;
17759
- if (labelLine) {
17760
- if (line === null || line === void 0 ? void 0 : line.customShape) {
17761
- const customShape = line.customShape;
17762
- labelLine.pathProxy = (attrs) => {
17763
- return customShape(text.attribute, attrs, new CustomPath2D());
17764
- };
17576
+ lineWidth: (_e = (_d = line.style) === null || _d === void 0 ? void 0 : _d.lineWidth) !== null && _e !== void 0 ? _e : 1
17577
+ });
17578
+ if (line.smooth) {
17579
+ lineGraphic.setAttributes({
17580
+ curveType: 'basis'
17581
+ });
17765
17582
  }
17766
- this._setStatesOfLabelLine(labelLine);
17767
17583
  }
17768
- return labelLine;
17584
+ return lineGraphic;
17769
17585
  }
17770
17586
  computeRadius(r, width, height, k) {
17771
17587
  return this.computeLayoutRadius(width ? width : 0, height ? height : 0) * r * (isNil(k) ? 1 : k);
@@ -17793,7 +17609,8 @@ ArcLabel.defaultAttributes = {
17793
17609
  fontSize: 14,
17794
17610
  fontWeight: 'normal',
17795
17611
  fillOpacity: 1,
17796
- boundsPadding: [-1, 0, -1, 0]
17612
+ boundsPadding: [-1, 0, -1, 0],
17613
+ ellipsis: true
17797
17614
  },
17798
17615
  position: 'outside',
17799
17616
  line: {
@@ -18368,6 +18185,33 @@ function getPolarAngleLabelPosition(angle, center, radius, labelOffset, inside,
18368
18185
  const vector = getCircleVerticalVector(labelOffset || 1, labelPoint, center, inside);
18369
18186
  return getCircleLabelPosition(labelPoint, vector, text, style);
18370
18187
  }
18188
+ function getCirclePoints(center, count, radius, startAngle, endAngle) {
18189
+ const points = [];
18190
+ const range = endAngle - startAngle;
18191
+ for (let i = 0; i < count; i++) {
18192
+ const angle = startAngle + (i * range) / count;
18193
+ points.push(polarToCartesian(center, radius, angle));
18194
+ }
18195
+ return points;
18196
+ }
18197
+ function getPolygonPath(points, closed) {
18198
+ let path = '';
18199
+ if (points.length === 0) {
18200
+ return path;
18201
+ }
18202
+ points.forEach((point, index) => {
18203
+ if (index === 0) {
18204
+ path = `M${point.x},${point.y}`;
18205
+ }
18206
+ else {
18207
+ path += `L${point.x},${point.y}`;
18208
+ }
18209
+ });
18210
+ if (closed) {
18211
+ path += 'Z';
18212
+ }
18213
+ return path;
18214
+ }
18371
18215
 
18372
18216
  const dispatchHoverState = (e, container, lastHover) => {
18373
18217
  const target = e.target;
@@ -18478,7 +18322,7 @@ class AxisBase extends AbstractComponent {
18478
18322
  }
18479
18323
  _renderInner(container) {
18480
18324
  const { title, label, tick, line, items } = this.attribute;
18481
- const axisContainer = graphicCreator.group({ x: 0, y: 0, zIndex: 1 });
18325
+ const axisContainer = graphicCreator.group({ x: 0, y: 0, zIndex: 1, pickable: false });
18482
18326
  axisContainer.name = AXIS_ELEMENT_NAME.axisContainer;
18483
18327
  axisContainer.id = this._getNodeId('container');
18484
18328
  axisContainer.setMode(this.mode);
@@ -19682,22 +19526,29 @@ class CircleAxis extends AxisBase {
19682
19526
  super((options === null || options === void 0 ? void 0 : options.skipDefault) ? attributes : merge({}, CircleAxis.defaultAttributes, attributes));
19683
19527
  }
19684
19528
  renderLine(container) {
19685
- const { startAngle = POLAR_START_ANGLE, endAngle = POLAR_END_ANGLE, radius, center, innerRadius = 0, line = {}, inside = false } = this.attribute;
19529
+ const { startAngle = POLAR_START_ANGLE, endAngle = POLAR_END_ANGLE, radius, center, innerRadius = 0, line = {}, inside = false, sides } = this.attribute;
19686
19530
  let arcRadius = radius;
19687
19531
  let arcInnerRadius = innerRadius;
19688
19532
  if (inside && innerRadius > 0) {
19689
19533
  arcRadius = innerRadius;
19690
19534
  arcInnerRadius = 0;
19691
19535
  }
19692
- const arcAttrs = Object.assign(Object.assign(Object.assign({}, center), { startAngle,
19693
- endAngle, radius: arcRadius, innerRadius: arcInnerRadius }), line.style);
19694
- const axisLine = graphicCreator.circle(arcAttrs);
19695
- axisLine.name = AXIS_ELEMENT_NAME.line;
19696
- axisLine.id = this._getNodeId('line');
19536
+ let lineGraphic;
19537
+ if (isValidNumber(sides) && sides >= 3) {
19538
+ const gridPoints = getCirclePoints(center, sides, arcRadius, startAngle, endAngle);
19539
+ lineGraphic = graphicCreator.path(Object.assign(Object.assign({}, line.style), { path: getPolygonPath(gridPoints, true) }));
19540
+ }
19541
+ else {
19542
+ const arcAttrs = Object.assign(Object.assign(Object.assign({}, center), { startAngle,
19543
+ endAngle, radius: arcRadius, innerRadius: arcInnerRadius }), line.style);
19544
+ lineGraphic = graphicCreator.circle(arcAttrs);
19545
+ }
19546
+ lineGraphic.name = AXIS_ELEMENT_NAME.line;
19547
+ lineGraphic.id = this._getNodeId('line');
19697
19548
  if (!isEmpty(line.state)) {
19698
- axisLine.states = merge({}, DEFAULT_STATES$1, line.state);
19549
+ lineGraphic.states = merge({}, DEFAULT_STATES$1, line.state);
19699
19550
  }
19700
- container.add(axisLine);
19551
+ container.add(lineGraphic);
19701
19552
  }
19702
19553
  getTitleAttribute() {
19703
19554
  var _a, _b, _c;
@@ -19866,33 +19717,34 @@ class GroupTransition extends ACustomAnimate {
19866
19717
  onStart() {
19867
19718
  let duration = this.duration;
19868
19719
  let easing = this.easing;
19869
- Object.keys(this._newElementAttrMap).forEach(id => {
19870
- var _a;
19871
- const { node, attrs, state } = this._newElementAttrMap[id];
19872
- if (state === 'enter') {
19873
- const { enter = {} } = (_a = this.params) !== null && _a !== void 0 ? _a : {};
19874
- duration = isValidNumber(enter.duration) ? enter.duration : duration;
19875
- easing = enter.easing ? enter.easing : easing;
19876
- }
19877
- if (node.type === 'path') {
19878
- node
19879
- .animate({
19880
- interpolate(key, ratio, from, to, nextAttributes) {
19881
- if (key === 'path') {
19882
- nextAttributes.path = interpolateString(from, to)(ratio);
19883
- return true;
19720
+ this._newElementAttrMap &&
19721
+ Object.keys(this._newElementAttrMap).forEach(id => {
19722
+ var _a;
19723
+ const { node, attrs, state } = this._newElementAttrMap[id];
19724
+ if (state === 'enter') {
19725
+ const { enter = {} } = (_a = this.params) !== null && _a !== void 0 ? _a : {};
19726
+ duration = isValidNumber(enter.duration) ? enter.duration : duration;
19727
+ easing = enter.easing ? enter.easing : easing;
19728
+ }
19729
+ if (node.type === 'path') {
19730
+ node
19731
+ .animate({
19732
+ interpolate(key, ratio, from, to, nextAttributes) {
19733
+ if (key === 'path') {
19734
+ nextAttributes.path = interpolateString(from, to)(ratio);
19735
+ return true;
19736
+ }
19737
+ return false;
19884
19738
  }
19885
- return false;
19886
- }
19887
- })
19888
- .to(attrs, duration, easing);
19889
- }
19890
- else {
19891
- node
19892
- .animate()
19893
- .to(attrs, duration, easing);
19894
- }
19895
- });
19739
+ })
19740
+ .to(attrs, duration, easing);
19741
+ }
19742
+ else {
19743
+ node
19744
+ .animate()
19745
+ .to(attrs, duration, easing);
19746
+ }
19747
+ });
19896
19748
  }
19897
19749
  onUpdate(end, ratio, out) {
19898
19750
  }
@@ -20035,7 +19887,8 @@ const continuousTicks = (scale, op) => {
20035
19887
  }
20036
19888
  else {
20037
19889
  const count = isFunction(tickCount) ? tickCount({ axisLength: rangeSize, labelStyle }) : tickCount;
20038
- scaleTicks = scale.ticks(count !== null && count !== void 0 ? count : DEFAULT_CONTINUOUS_TICK_COUNT, { noDecimals });
19890
+ const customTicks = isFunction(op.tickMode) ? op.tickMode : undefined;
19891
+ scaleTicks = scale.ticks(count !== null && count !== void 0 ? count : DEFAULT_CONTINUOUS_TICK_COUNT, { noDecimals, customTicks });
20039
19892
  }
20040
19893
  if (op.sampling) {
20041
19894
  if (op.coordinateType === 'cartesian' || (op.coordinateType === 'polar' && op.axisOrientType === 'radius')) {
@@ -20400,24 +20253,6 @@ const polarTicks = (scale, op) => {
20400
20253
  return convertDomainToTickData(scale.domain());
20401
20254
  };
20402
20255
 
20403
- function getLinePath(points, closed) {
20404
- let path = '';
20405
- if (points.length === 0) {
20406
- return path;
20407
- }
20408
- points.forEach((point, index) => {
20409
- if (index === 0) {
20410
- path = `M${point.x},${point.y}`;
20411
- }
20412
- else {
20413
- path += `L${point.x},${point.y}`;
20414
- }
20415
- });
20416
- if (closed) {
20417
- path += 'Z';
20418
- }
20419
- return path;
20420
- }
20421
20256
  function getArcPath(center, points, reverse, closed) {
20422
20257
  let path = '';
20423
20258
  if (!center || points.length === 0) {
@@ -20450,8 +20285,8 @@ function getRegionPath(from, to, attribute) {
20450
20285
  const fromStart = from[0];
20451
20286
  const toEnd = reversePoints[0];
20452
20287
  const center = attribute.center;
20453
- regionPath = getLinePath(from, !!closed);
20454
- nextPath = getLinePath(reversePoints, !!closed);
20288
+ regionPath = getPolygonPath(from, !!closed);
20289
+ nextPath = getPolygonPath(reversePoints, !!closed);
20455
20290
  const toEndRadius = PointService.distancePP(toEnd, center);
20456
20291
  const fromStartRadius = PointService.distancePP(fromStart, center);
20457
20292
  regionPath += `A${toEndRadius},${toEndRadius},0,0,1,${toEnd.x},${toEnd.y}L${toEnd.x},${toEnd.y}`;
@@ -20463,8 +20298,8 @@ function getRegionPath(from, to, attribute) {
20463
20298
  nextPath = getArcPath(center, reversePoints, true, !!closed);
20464
20299
  }
20465
20300
  else if (type === 'line' || type === 'polygon') {
20466
- regionPath = getLinePath(from, !!closed);
20467
- nextPath = getLinePath(reversePoints, !!closed);
20301
+ regionPath = getPolygonPath(from, !!closed);
20302
+ nextPath = getPolygonPath(reversePoints, !!closed);
20468
20303
  }
20469
20304
  if (closed) {
20470
20305
  regionPath += nextPath;
@@ -20525,7 +20360,7 @@ class BaseGrid extends AbstractComponent {
20525
20360
  const { id, points } = item;
20526
20361
  let path = '';
20527
20362
  if (type === 'line' || type === 'polygon') {
20528
- path = getLinePath(points, !!closed);
20363
+ path = getPolygonPath(points, !!closed);
20529
20364
  }
20530
20365
  else if (type === 'circle') {
20531
20366
  const { center } = this.attribute;
@@ -20547,7 +20382,7 @@ class BaseGrid extends AbstractComponent {
20547
20382
  const dirLen = Math.sqrt(dir.x * dir.x + dir.y * dir.y);
20548
20383
  const ratio = depth / dirLen;
20549
20384
  nextPoints.push({ x: points[0].x + dir.x * ratio, y: points[0].y + dir.y * ratio });
20550
- const path = getLinePath(nextPoints, !!closed);
20385
+ const path = getPolygonPath(nextPoints, !!closed);
20551
20386
  const deltaX = abs(nextPoints[0].x - nextPoints[1].x);
20552
20387
  const deltaY = abs(nextPoints[0].y - nextPoints[1].y);
20553
20388
  const shape = graphicCreator.path(Object.assign({ path, z: 0, alpha: deltaX > deltaY ? ((points[1].x - points[0].x > 0 ? -1 : 1) * pi) / 2 : 0, beta: deltaX < deltaY ? -pi / 2 : 0, anchor3d: deltaX > deltaY ? [nextPoints[0].x, 0] : [0, nextPoints[0].y] }, (isFunction(style)
@@ -20631,15 +20466,6 @@ BaseGrid.defaultAttributes = {
20631
20466
  }
20632
20467
  };
20633
20468
 
20634
- function getCirclePoints(center, count, radius, startAngle, endAngle) {
20635
- const points = [];
20636
- const range = endAngle - startAngle;
20637
- for (let i = 0; i < count; i++) {
20638
- const angle = startAngle + (i * range) / count;
20639
- points.push(polarToCartesian(center, radius, angle));
20640
- }
20641
- return points;
20642
- }
20643
20469
  loadLineAxisGridComponent();
20644
20470
  class LineAxisGrid extends BaseGrid {
20645
20471
  constructor(attributes, options) {
@@ -24321,14 +24147,23 @@ class DiscreteLegend extends LegendBase {
24321
24147
  _createPager(compStyle) {
24322
24148
  var _a, _b;
24323
24149
  const { disableTriggerEvent, maxRow } = this.attribute;
24150
+ const estimateTotal = (num) => {
24151
+ if (num <= 99) {
24152
+ return 99;
24153
+ }
24154
+ else if (num <= 999) {
24155
+ return 999;
24156
+ }
24157
+ return 9999;
24158
+ };
24324
24159
  return this._itemContext.isHorizontal
24325
- ? new Pager(Object.assign(Object.assign({ layout: maxRow === 1 ? 'horizontal' : 'vertical', total: 99 }, merge({
24160
+ ? new Pager(Object.assign(Object.assign({ layout: maxRow === 1 ? 'horizontal' : 'vertical', total: estimateTotal(this._itemContext.pages) }, merge({
24326
24161
  handler: {
24327
24162
  preShape: 'triangleUp',
24328
24163
  nextShape: 'triangleDown'
24329
24164
  }
24330
24165
  }, compStyle)), { defaultCurrent: (_a = this.attribute.pager) === null || _a === void 0 ? void 0 : _a.defaultCurrent, disableTriggerEvent }))
24331
- : new Pager(Object.assign({ layout: 'horizontal', total: 99, disableTriggerEvent, defaultCurrent: (_b = this.attribute.pager) === null || _b === void 0 ? void 0 : _b.defaultCurrent }, compStyle));
24166
+ : new Pager(Object.assign({ layout: 'horizontal', total: estimateTotal(this._itemContext.pages), disableTriggerEvent, defaultCurrent: (_b = this.attribute.pager) === null || _b === void 0 ? void 0 : _b.defaultCurrent }, compStyle));
24332
24167
  }
24333
24168
  _createScrollbar(compStyle, compSize) {
24334
24169
  const { disableTriggerEvent } = this.attribute;
@@ -28200,7 +28035,10 @@ class Timeline extends AbstractComponent {
28200
28035
  const delay = percent * (size === 1 ? 0 : (500 - 100) / (size - 1));
28201
28036
  const delayNormal = percent * (size === 1 ? 0 : (400 - 160) / (size - 1));
28202
28037
  this._symbolGroup.forEachChildren((symbol, i) => {
28203
- const originAttrs = Object.assign({}, symbol.attribute);
28038
+ const originAttrs = {};
28039
+ Object.keys(activeSymbolStyle).forEach(k => {
28040
+ originAttrs[k] = symbol.attribute[k];
28041
+ });
28204
28042
  symbol.setAttributes({ opacity: 0 });
28205
28043
  symbol
28206
28044
  .animate()
@@ -28209,8 +28047,8 @@ class Timeline extends AbstractComponent {
28209
28047
  symbol
28210
28048
  .animate()
28211
28049
  .wait(symbolNormalDelay + delayNormal * i)
28212
- .to(Object.assign({ scaleX: 1.8, scaleY: 1.8 }, activeSymbolStyle), perSymbolNormalDuration, easing)
28213
- .to(Object.assign({ scaleX: 1, scaleY: 1 }, originAttrs), perSymbolNormalDuration, easing);
28050
+ .to(Object.assign({}, activeSymbolStyle), perSymbolNormalDuration, easing)
28051
+ .to(Object.assign({}, originAttrs), perSymbolNormalDuration, easing);
28214
28052
  });
28215
28053
  }
28216
28054
  if (this._labelGroup) {
@@ -28218,7 +28056,10 @@ class Timeline extends AbstractComponent {
28218
28056
  const delay = percent * (size === 1 ? 0 : (500 - 100) / (size - 1));
28219
28057
  const delayNormal = percent * (size === 1 ? 0 : (400 - 160) / (size - 1));
28220
28058
  this._labelGroup.forEachChildren((label, i) => {
28221
- const originAttrs = Object.assign({}, label.attribute);
28059
+ const originAttrs = {};
28060
+ Object.keys(activeLabelStyle).forEach(k => {
28061
+ originAttrs[k] = label.attribute[k];
28062
+ });
28222
28063
  label.setAttributes({ opacity: 0 });
28223
28064
  label
28224
28065
  .animate()
@@ -28233,7 +28074,6 @@ class Timeline extends AbstractComponent {
28233
28074
  }
28234
28075
  }
28235
28076
  goto(flag, animateConfig) {
28236
- var _a;
28237
28077
  let { clipRange } = this.attribute;
28238
28078
  const { animation } = this.attribute;
28239
28079
  if (flag > 0) {
@@ -28261,11 +28101,10 @@ class Timeline extends AbstractComponent {
28261
28101
  break;
28262
28102
  }
28263
28103
  }
28264
- const nextClipRange = flag > 0 ? this._timesPercent[i] : this._timesPercent[i - 1] || 0;
28104
+ const nextClipRange = flag > 0 ? this._timesPercent[i] || 1 : this._timesPercent[i - 1] || 0;
28265
28105
  if (animation) {
28266
28106
  const { duration = 1000, easing = 'quadOut' } = animateConfig;
28267
- const actDuration = (Math.abs(nextClipRange - clipRange) / (this._timesPercent[i] - ((_a = this._timesPercent[i - 1]) !== null && _a !== void 0 ? _a : 0))) * duration;
28268
- this.animate().to({ clipRange: nextClipRange }, actDuration, easing);
28107
+ this.animate().to({ clipRange: nextClipRange }, duration, easing);
28269
28108
  }
28270
28109
  else {
28271
28110
  this.setAttributes({ clipRange: nextClipRange });
@@ -28288,7 +28127,8 @@ Timeline.defaultAttributes = {
28288
28127
  symbolType: 'circle'
28289
28128
  },
28290
28129
  activeSymbolStyle: {
28291
- fill: 'orange'
28130
+ fill: 'orange',
28131
+ size: 16
28292
28132
  },
28293
28133
  lineStyle: {
28294
28134
  lineDash: [2, 2],
@@ -28668,6 +28508,6 @@ EmptyTip.defaultAttributes = {
28668
28508
  }
28669
28509
  };
28670
28510
 
28671
- const version = "0.20.0-alpha.3";
28511
+ const version = "0.20.0";
28672
28512
 
28673
- export { AXIS_ELEMENT_NAME, AbstractComponent, ArcInfo, ArcLabel, ArcSegment, AxisStateValue, BasePlayer, Brush, CheckBox, CircleAxis, CircleAxisGrid, CircleCrosshair, ColorContinuousLegend, ContinuousPlayer, DEFAULT_ITEM_SPACE_COL, DEFAULT_ITEM_SPACE_ROW, DEFAULT_LABEL_SPACE, DEFAULT_PAGER_SPACE, DEFAULT_SHAPE_SIZE, DEFAULT_SHAPE_SPACE, DEFAULT_STATES$1 as DEFAULT_STATES, DEFAULT_TITLE_SPACE, DEFAULT_VALUE_SPACE, DataLabel, DataZoom, DataZoomActiveTag, DirectionEnum, DiscreteLegend, DiscretePlayer, EmptyTip, GroupTransition, IMarkAreaLabelPosition, IMarkCommonArcLabelPosition, IMarkLineLabelPosition, IMarkPointItemPosition, IOperateType, Indicator, LEGEND_ELEMENT_NAME, LabelBase, LegendEvent, LegendStateValue, LineAxis, LineAxisGrid, LineCrosshair, LineLabel, LinkPath, MarkArcArea, MarkArcLine, MarkArea, MarkLine, MarkPoint, Pager, PlayerEventEnum, PolygonCrosshair, PopTip, Radio, RectCrosshair, RectLabel, SLIDER_ELEMENT_NAME, ScrollBar, SectorCrosshair, Segment, SizeContinuousLegend, Slider, SymbolLabel, Tag, Timeline, Title, Tooltip, VTag, alignTextInLine, angle, angleLabelOrientAttribute, angleTo, cartesianTicks, clampRadian, computeOffsetForlimit, continuousTicks, contrastAccessibilityChecker, convertDomainToTickData, createTextGraphicByType, deltaXYToAngle, fuzzyEqualNumber, getCircleLabelPosition, getCircleVerticalVector, getElMap, getHorizontalPath, getMarksByName, getNoneGroupMarksByName, getPolarAngleLabelPosition, getSizeHandlerPath, getTextAlignAttrOfVerticalDir, getTextType, getVerticalCoord, getVerticalPath, htmlAttributeTransform, initTextMeasure, isInRange, isPostiveXAxis, isRichText, isVisible, labelSmartInvert, length, limitShapeInBounds, linearDiscreteTicks, loadPoptip, measureTextSize, normalize, polarAngleAxisDiscreteTicks, polarTicks, reactAttributeTransform, registerArcDataLabel, registerLineDataLabel, registerMarkArcAreaAnimate, registerMarkArcLineAnimate, registerMarkAreaAnimate, registerMarkLineAnimate, registerMarkPointAnimate, registerRectDataLabel, registerSymbolDataLabel, removeRepeatPoint, richTextAttributeTransform, scale, setPoptipTheme, smartInvertStrategy, tan2AngleToAngle, ticks, traverseGroup, version };
28513
+ export { AXIS_ELEMENT_NAME, AbstractComponent, ArcInfo, ArcLabel, ArcSegment, AxisStateValue, BasePlayer, Brush, CheckBox, CircleAxis, CircleAxisGrid, CircleCrosshair, ColorContinuousLegend, ContinuousPlayer, DEFAULT_ITEM_SPACE_COL, DEFAULT_ITEM_SPACE_ROW, DEFAULT_LABEL_SPACE, DEFAULT_PAGER_SPACE, DEFAULT_SHAPE_SIZE, DEFAULT_SHAPE_SPACE, DEFAULT_STATES$1 as DEFAULT_STATES, DEFAULT_TITLE_SPACE, DEFAULT_VALUE_SPACE, DataLabel, DataZoom, DataZoomActiveTag, DirectionEnum, DiscreteLegend, DiscretePlayer, EmptyTip, GroupTransition, IMarkAreaLabelPosition, IMarkCommonArcLabelPosition, IMarkLineLabelPosition, IMarkPointItemPosition, IOperateType, Indicator, LEGEND_ELEMENT_NAME, LabelBase, LegendEvent, LegendStateValue, LineAxis, LineAxisGrid, LineCrosshair, LineLabel, LinkPath, MarkArcArea, MarkArcLine, MarkArea, MarkLine, MarkPoint, Pager, PlayerEventEnum, PolygonCrosshair, PopTip, Radio, RectCrosshair, RectLabel, SLIDER_ELEMENT_NAME, ScrollBar, SectorCrosshair, Segment, SizeContinuousLegend, Slider, SymbolLabel, Tag, Timeline, Title, Tooltip, VTag, alignTextInLine, angle, angleLabelOrientAttribute, angleTo, cartesianTicks, clampRadian, computeOffsetForlimit, continuousTicks, contrastAccessibilityChecker, convertDomainToTickData, createTextGraphicByType, deltaXYToAngle, fuzzyEqualNumber, getCircleLabelPosition, getCirclePoints, getCircleVerticalVector, getElMap, getHorizontalPath, getMarksByName, getNoneGroupMarksByName, getPolarAngleLabelPosition, getPolygonPath, getSizeHandlerPath, getTextAlignAttrOfVerticalDir, getTextType, getVerticalCoord, getVerticalPath, htmlAttributeTransform, initTextMeasure, isInRange, isPostiveXAxis, isRichText, isVisible, labelSmartInvert, length, limitShapeInBounds, linearDiscreteTicks, loadPoptip, measureTextSize, normalize, polarAngleAxisDiscreteTicks, polarTicks, reactAttributeTransform, registerArcDataLabel, registerLineDataLabel, registerMarkArcAreaAnimate, registerMarkArcLineAnimate, registerMarkAreaAnimate, registerMarkLineAnimate, registerMarkPointAnimate, registerRectDataLabel, registerSymbolDataLabel, removeRepeatPoint, richTextAttributeTransform, scale, setPoptipTheme, smartInvertStrategy, tan2AngleToAngle, ticks, traverseGroup, version };