@visactor/vrender-components 0.20.0-alpha.4 → 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.
- package/cjs/axis/animate/group-transition.js +1 -1
- package/cjs/axis/animate/group-transition.js.map +1 -1
- package/cjs/axis/base.js +2 -1
- package/cjs/axis/base.js.map +1 -1
- package/cjs/axis/circle.js +20 -12
- package/cjs/axis/circle.js.map +1 -1
- package/cjs/axis/grid/base.js +5 -12
- package/cjs/axis/grid/base.js.map +1 -1
- package/cjs/axis/grid/line.js +3 -12
- package/cjs/axis/grid/line.js.map +1 -1
- package/cjs/axis/tick-data/continuous.js +3 -2
- package/cjs/axis/tick-data/continuous.js.map +1 -1
- package/cjs/axis/type.d.ts +3 -1
- package/cjs/axis/type.js.map +1 -1
- package/cjs/axis/util.d.ts +2 -0
- package/cjs/axis/util.js +19 -2
- package/cjs/axis/util.js.map +1 -1
- package/cjs/brush/type.js +1 -2
- package/cjs/core/base.js +2 -1
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/label/arc.d.ts +1 -0
- package/cjs/label/arc.js +14 -18
- package/cjs/label/arc.js.map +1 -1
- package/cjs/label/base.d.ts +4 -0
- package/cjs/label/base.js +11 -8
- package/cjs/label/base.js.map +1 -1
- package/cjs/legend/discrete/discrete.js +3 -3
- package/cjs/legend/discrete/discrete.js.map +1 -1
- package/cjs/timeline/timeline.js +14 -16
- package/cjs/timeline/timeline.js.map +1 -1
- package/dist/index.es.js +179 -342
- package/es/axis/animate/group-transition.js +1 -1
- package/es/axis/animate/group-transition.js.map +1 -1
- package/es/axis/base.js +2 -1
- package/es/axis/base.js.map +1 -1
- package/es/axis/circle.js +22 -13
- package/es/axis/circle.js.map +1 -1
- package/es/axis/grid/base.js +6 -13
- package/es/axis/grid/base.js.map +1 -1
- package/es/axis/grid/line.js +4 -11
- package/es/axis/grid/line.js.map +1 -1
- package/es/axis/tick-data/continuous.js +3 -2
- package/es/axis/tick-data/continuous.js.map +1 -1
- package/es/axis/type.d.ts +3 -1
- package/es/axis/type.js.map +1 -1
- package/es/axis/util.d.ts +2 -0
- package/es/axis/util.js +16 -0
- package/es/axis/util.js.map +1 -1
- package/es/brush/type.js +1 -2
- package/es/core/base.js +2 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/label/arc.d.ts +1 -0
- package/es/label/arc.js +13 -19
- package/es/label/arc.js.map +1 -1
- package/es/label/base.d.ts +4 -0
- package/es/label/base.js +11 -8
- package/es/label/base.js.map +1 -1
- package/es/legend/discrete/discrete.js +3 -3
- package/es/legend/discrete/discrete.js.map +1 -1
- package/es/timeline/timeline.js +14 -16
- package/es/timeline/timeline.js.map +1 -1
- 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
|
|
36
|
-
supportsSymbol = "function" == typeof Symbol,
|
|
35
|
+
const supportsSymbol = "function" == typeof Symbol,
|
|
37
36
|
toPrimitiveSymbol = supportsSymbol && void 0 !== Symbol.toPrimitive ? Symbol.toPrimitive : "@@toPrimitive",
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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),
|
|
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()
|
|
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
|
|
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,
|
|
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
|
-
|
|
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.
|
|
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() {
|
|
@@ -16320,26 +16129,30 @@ class LabelBase extends AbstractComponent {
|
|
|
16320
16129
|
labeling(textBounds, graphicBounds, position, offset) {
|
|
16321
16130
|
return;
|
|
16322
16131
|
}
|
|
16132
|
+
_getLabelLinePoints(text, baseMark) {
|
|
16133
|
+
return connectLineBetweenBounds(text.AABBBounds, baseMark === null || baseMark === void 0 ? void 0 : baseMark.AABBBounds);
|
|
16134
|
+
}
|
|
16323
16135
|
_createLabelLine(text, baseMark) {
|
|
16324
|
-
const points =
|
|
16136
|
+
const points = this._getLabelLinePoints(text, baseMark);
|
|
16325
16137
|
if (points) {
|
|
16326
|
-
const
|
|
16138
|
+
const lineGraphic = graphicCreator.line({
|
|
16327
16139
|
points
|
|
16328
16140
|
});
|
|
16329
|
-
|
|
16141
|
+
const { line = {} } = text.attribute;
|
|
16142
|
+
if (line.customShape) {
|
|
16330
16143
|
const customShape = line.customShape;
|
|
16331
|
-
|
|
16144
|
+
lineGraphic.pathProxy = (attrs) => {
|
|
16332
16145
|
return customShape(text.attribute, attrs, new CustomPath2D());
|
|
16333
16146
|
};
|
|
16334
16147
|
}
|
|
16335
16148
|
if (baseMark && baseMark.attribute.fill) {
|
|
16336
|
-
|
|
16149
|
+
lineGraphic.setAttribute('stroke', baseMark.attribute.fill);
|
|
16337
16150
|
}
|
|
16338
16151
|
if (this.attribute.line && !isEmpty(this.attribute.line.style)) {
|
|
16339
|
-
|
|
16152
|
+
lineGraphic.setAttributes(this.attribute.line.style);
|
|
16340
16153
|
}
|
|
16341
|
-
this._setStatesOfLabelLine(
|
|
16342
|
-
return
|
|
16154
|
+
this._setStatesOfLabelLine(lineGraphic);
|
|
16155
|
+
return lineGraphic;
|
|
16343
16156
|
}
|
|
16344
16157
|
}
|
|
16345
16158
|
render() {
|
|
@@ -17141,6 +16954,9 @@ class ArcLabel extends LabelBase {
|
|
|
17141
16954
|
: undefined,
|
|
17142
16955
|
line: basedArc.labelLine
|
|
17143
16956
|
};
|
|
16957
|
+
if (labels[i].type === 'richtext') {
|
|
16958
|
+
labelAttribute.width = basedArc.labelLimit;
|
|
16959
|
+
}
|
|
17144
16960
|
labels[i].setAttributes(labelAttribute);
|
|
17145
16961
|
}
|
|
17146
16962
|
}
|
|
@@ -17747,28 +17563,25 @@ class ArcLabel extends LabelBase {
|
|
|
17747
17563
|
}
|
|
17748
17564
|
}
|
|
17749
17565
|
}
|
|
17566
|
+
_getLabelLinePoints(text, baseMark) {
|
|
17567
|
+
return text.attribute.points;
|
|
17568
|
+
}
|
|
17750
17569
|
_createLabelLine(text, baseMark) {
|
|
17751
|
-
var _a, _b, _c, _d, _e
|
|
17752
|
-
const {
|
|
17753
|
-
const
|
|
17754
|
-
|
|
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({
|
|
17755
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,
|
|
17756
|
-
|
|
17757
|
-
|
|
17758
|
-
|
|
17759
|
-
|
|
17760
|
-
|
|
17761
|
-
|
|
17762
|
-
if (labelLine) {
|
|
17763
|
-
if (line === null || line === void 0 ? void 0 : line.customShape) {
|
|
17764
|
-
const customShape = line.customShape;
|
|
17765
|
-
labelLine.pathProxy = (attrs) => {
|
|
17766
|
-
return customShape(text.attribute, attrs, new CustomPath2D());
|
|
17767
|
-
};
|
|
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
|
+
});
|
|
17768
17582
|
}
|
|
17769
|
-
this._setStatesOfLabelLine(labelLine);
|
|
17770
17583
|
}
|
|
17771
|
-
return
|
|
17584
|
+
return lineGraphic;
|
|
17772
17585
|
}
|
|
17773
17586
|
computeRadius(r, width, height, k) {
|
|
17774
17587
|
return this.computeLayoutRadius(width ? width : 0, height ? height : 0) * r * (isNil(k) ? 1 : k);
|
|
@@ -17796,7 +17609,8 @@ ArcLabel.defaultAttributes = {
|
|
|
17796
17609
|
fontSize: 14,
|
|
17797
17610
|
fontWeight: 'normal',
|
|
17798
17611
|
fillOpacity: 1,
|
|
17799
|
-
boundsPadding: [-1, 0, -1, 0]
|
|
17612
|
+
boundsPadding: [-1, 0, -1, 0],
|
|
17613
|
+
ellipsis: true
|
|
17800
17614
|
},
|
|
17801
17615
|
position: 'outside',
|
|
17802
17616
|
line: {
|
|
@@ -18371,6 +18185,33 @@ function getPolarAngleLabelPosition(angle, center, radius, labelOffset, inside,
|
|
|
18371
18185
|
const vector = getCircleVerticalVector(labelOffset || 1, labelPoint, center, inside);
|
|
18372
18186
|
return getCircleLabelPosition(labelPoint, vector, text, style);
|
|
18373
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
|
+
}
|
|
18374
18215
|
|
|
18375
18216
|
const dispatchHoverState = (e, container, lastHover) => {
|
|
18376
18217
|
const target = e.target;
|
|
@@ -18481,7 +18322,7 @@ class AxisBase extends AbstractComponent {
|
|
|
18481
18322
|
}
|
|
18482
18323
|
_renderInner(container) {
|
|
18483
18324
|
const { title, label, tick, line, items } = this.attribute;
|
|
18484
|
-
const axisContainer = graphicCreator.group({ x: 0, y: 0, zIndex: 1 });
|
|
18325
|
+
const axisContainer = graphicCreator.group({ x: 0, y: 0, zIndex: 1, pickable: false });
|
|
18485
18326
|
axisContainer.name = AXIS_ELEMENT_NAME.axisContainer;
|
|
18486
18327
|
axisContainer.id = this._getNodeId('container');
|
|
18487
18328
|
axisContainer.setMode(this.mode);
|
|
@@ -19685,22 +19526,29 @@ class CircleAxis extends AxisBase {
|
|
|
19685
19526
|
super((options === null || options === void 0 ? void 0 : options.skipDefault) ? attributes : merge({}, CircleAxis.defaultAttributes, attributes));
|
|
19686
19527
|
}
|
|
19687
19528
|
renderLine(container) {
|
|
19688
|
-
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;
|
|
19689
19530
|
let arcRadius = radius;
|
|
19690
19531
|
let arcInnerRadius = innerRadius;
|
|
19691
19532
|
if (inside && innerRadius > 0) {
|
|
19692
19533
|
arcRadius = innerRadius;
|
|
19693
19534
|
arcInnerRadius = 0;
|
|
19694
19535
|
}
|
|
19695
|
-
|
|
19696
|
-
|
|
19697
|
-
|
|
19698
|
-
|
|
19699
|
-
|
|
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');
|
|
19700
19548
|
if (!isEmpty(line.state)) {
|
|
19701
|
-
|
|
19549
|
+
lineGraphic.states = merge({}, DEFAULT_STATES$1, line.state);
|
|
19702
19550
|
}
|
|
19703
|
-
container.add(
|
|
19551
|
+
container.add(lineGraphic);
|
|
19704
19552
|
}
|
|
19705
19553
|
getTitleAttribute() {
|
|
19706
19554
|
var _a, _b, _c;
|
|
@@ -19869,33 +19717,34 @@ class GroupTransition extends ACustomAnimate {
|
|
|
19869
19717
|
onStart() {
|
|
19870
19718
|
let duration = this.duration;
|
|
19871
19719
|
let easing = this.easing;
|
|
19872
|
-
|
|
19873
|
-
|
|
19874
|
-
|
|
19875
|
-
|
|
19876
|
-
|
|
19877
|
-
|
|
19878
|
-
|
|
19879
|
-
|
|
19880
|
-
|
|
19881
|
-
node
|
|
19882
|
-
|
|
19883
|
-
|
|
19884
|
-
|
|
19885
|
-
|
|
19886
|
-
|
|
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;
|
|
19887
19738
|
}
|
|
19888
|
-
|
|
19889
|
-
|
|
19890
|
-
}
|
|
19891
|
-
|
|
19892
|
-
|
|
19893
|
-
|
|
19894
|
-
|
|
19895
|
-
|
|
19896
|
-
|
|
19897
|
-
}
|
|
19898
|
-
});
|
|
19739
|
+
})
|
|
19740
|
+
.to(attrs, duration, easing);
|
|
19741
|
+
}
|
|
19742
|
+
else {
|
|
19743
|
+
node
|
|
19744
|
+
.animate()
|
|
19745
|
+
.to(attrs, duration, easing);
|
|
19746
|
+
}
|
|
19747
|
+
});
|
|
19899
19748
|
}
|
|
19900
19749
|
onUpdate(end, ratio, out) {
|
|
19901
19750
|
}
|
|
@@ -20038,7 +19887,8 @@ const continuousTicks = (scale, op) => {
|
|
|
20038
19887
|
}
|
|
20039
19888
|
else {
|
|
20040
19889
|
const count = isFunction(tickCount) ? tickCount({ axisLength: rangeSize, labelStyle }) : tickCount;
|
|
20041
|
-
|
|
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 });
|
|
20042
19892
|
}
|
|
20043
19893
|
if (op.sampling) {
|
|
20044
19894
|
if (op.coordinateType === 'cartesian' || (op.coordinateType === 'polar' && op.axisOrientType === 'radius')) {
|
|
@@ -20403,24 +20253,6 @@ const polarTicks = (scale, op) => {
|
|
|
20403
20253
|
return convertDomainToTickData(scale.domain());
|
|
20404
20254
|
};
|
|
20405
20255
|
|
|
20406
|
-
function getLinePath(points, closed) {
|
|
20407
|
-
let path = '';
|
|
20408
|
-
if (points.length === 0) {
|
|
20409
|
-
return path;
|
|
20410
|
-
}
|
|
20411
|
-
points.forEach((point, index) => {
|
|
20412
|
-
if (index === 0) {
|
|
20413
|
-
path = `M${point.x},${point.y}`;
|
|
20414
|
-
}
|
|
20415
|
-
else {
|
|
20416
|
-
path += `L${point.x},${point.y}`;
|
|
20417
|
-
}
|
|
20418
|
-
});
|
|
20419
|
-
if (closed) {
|
|
20420
|
-
path += 'Z';
|
|
20421
|
-
}
|
|
20422
|
-
return path;
|
|
20423
|
-
}
|
|
20424
20256
|
function getArcPath(center, points, reverse, closed) {
|
|
20425
20257
|
let path = '';
|
|
20426
20258
|
if (!center || points.length === 0) {
|
|
@@ -20453,8 +20285,8 @@ function getRegionPath(from, to, attribute) {
|
|
|
20453
20285
|
const fromStart = from[0];
|
|
20454
20286
|
const toEnd = reversePoints[0];
|
|
20455
20287
|
const center = attribute.center;
|
|
20456
|
-
regionPath =
|
|
20457
|
-
nextPath =
|
|
20288
|
+
regionPath = getPolygonPath(from, !!closed);
|
|
20289
|
+
nextPath = getPolygonPath(reversePoints, !!closed);
|
|
20458
20290
|
const toEndRadius = PointService.distancePP(toEnd, center);
|
|
20459
20291
|
const fromStartRadius = PointService.distancePP(fromStart, center);
|
|
20460
20292
|
regionPath += `A${toEndRadius},${toEndRadius},0,0,1,${toEnd.x},${toEnd.y}L${toEnd.x},${toEnd.y}`;
|
|
@@ -20466,8 +20298,8 @@ function getRegionPath(from, to, attribute) {
|
|
|
20466
20298
|
nextPath = getArcPath(center, reversePoints, true, !!closed);
|
|
20467
20299
|
}
|
|
20468
20300
|
else if (type === 'line' || type === 'polygon') {
|
|
20469
|
-
regionPath =
|
|
20470
|
-
nextPath =
|
|
20301
|
+
regionPath = getPolygonPath(from, !!closed);
|
|
20302
|
+
nextPath = getPolygonPath(reversePoints, !!closed);
|
|
20471
20303
|
}
|
|
20472
20304
|
if (closed) {
|
|
20473
20305
|
regionPath += nextPath;
|
|
@@ -20528,7 +20360,7 @@ class BaseGrid extends AbstractComponent {
|
|
|
20528
20360
|
const { id, points } = item;
|
|
20529
20361
|
let path = '';
|
|
20530
20362
|
if (type === 'line' || type === 'polygon') {
|
|
20531
|
-
path =
|
|
20363
|
+
path = getPolygonPath(points, !!closed);
|
|
20532
20364
|
}
|
|
20533
20365
|
else if (type === 'circle') {
|
|
20534
20366
|
const { center } = this.attribute;
|
|
@@ -20550,7 +20382,7 @@ class BaseGrid extends AbstractComponent {
|
|
|
20550
20382
|
const dirLen = Math.sqrt(dir.x * dir.x + dir.y * dir.y);
|
|
20551
20383
|
const ratio = depth / dirLen;
|
|
20552
20384
|
nextPoints.push({ x: points[0].x + dir.x * ratio, y: points[0].y + dir.y * ratio });
|
|
20553
|
-
const path =
|
|
20385
|
+
const path = getPolygonPath(nextPoints, !!closed);
|
|
20554
20386
|
const deltaX = abs(nextPoints[0].x - nextPoints[1].x);
|
|
20555
20387
|
const deltaY = abs(nextPoints[0].y - nextPoints[1].y);
|
|
20556
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)
|
|
@@ -20634,15 +20466,6 @@ BaseGrid.defaultAttributes = {
|
|
|
20634
20466
|
}
|
|
20635
20467
|
};
|
|
20636
20468
|
|
|
20637
|
-
function getCirclePoints(center, count, radius, startAngle, endAngle) {
|
|
20638
|
-
const points = [];
|
|
20639
|
-
const range = endAngle - startAngle;
|
|
20640
|
-
for (let i = 0; i < count; i++) {
|
|
20641
|
-
const angle = startAngle + (i * range) / count;
|
|
20642
|
-
points.push(polarToCartesian(center, radius, angle));
|
|
20643
|
-
}
|
|
20644
|
-
return points;
|
|
20645
|
-
}
|
|
20646
20469
|
loadLineAxisGridComponent();
|
|
20647
20470
|
class LineAxisGrid extends BaseGrid {
|
|
20648
20471
|
constructor(attributes, options) {
|
|
@@ -24324,14 +24147,23 @@ class DiscreteLegend extends LegendBase {
|
|
|
24324
24147
|
_createPager(compStyle) {
|
|
24325
24148
|
var _a, _b;
|
|
24326
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
|
+
};
|
|
24327
24159
|
return this._itemContext.isHorizontal
|
|
24328
|
-
? new Pager(Object.assign(Object.assign({ layout: maxRow === 1 ? 'horizontal' : 'vertical', total:
|
|
24160
|
+
? new Pager(Object.assign(Object.assign({ layout: maxRow === 1 ? 'horizontal' : 'vertical', total: estimateTotal(this._itemContext.pages) }, merge({
|
|
24329
24161
|
handler: {
|
|
24330
24162
|
preShape: 'triangleUp',
|
|
24331
24163
|
nextShape: 'triangleDown'
|
|
24332
24164
|
}
|
|
24333
24165
|
}, compStyle)), { defaultCurrent: (_a = this.attribute.pager) === null || _a === void 0 ? void 0 : _a.defaultCurrent, disableTriggerEvent }))
|
|
24334
|
-
: new Pager(Object.assign({ layout: 'horizontal', total:
|
|
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));
|
|
24335
24167
|
}
|
|
24336
24168
|
_createScrollbar(compStyle, compSize) {
|
|
24337
24169
|
const { disableTriggerEvent } = this.attribute;
|
|
@@ -28203,7 +28035,10 @@ class Timeline extends AbstractComponent {
|
|
|
28203
28035
|
const delay = percent * (size === 1 ? 0 : (500 - 100) / (size - 1));
|
|
28204
28036
|
const delayNormal = percent * (size === 1 ? 0 : (400 - 160) / (size - 1));
|
|
28205
28037
|
this._symbolGroup.forEachChildren((symbol, i) => {
|
|
28206
|
-
const originAttrs =
|
|
28038
|
+
const originAttrs = {};
|
|
28039
|
+
Object.keys(activeSymbolStyle).forEach(k => {
|
|
28040
|
+
originAttrs[k] = symbol.attribute[k];
|
|
28041
|
+
});
|
|
28207
28042
|
symbol.setAttributes({ opacity: 0 });
|
|
28208
28043
|
symbol
|
|
28209
28044
|
.animate()
|
|
@@ -28212,8 +28047,8 @@ class Timeline extends AbstractComponent {
|
|
|
28212
28047
|
symbol
|
|
28213
28048
|
.animate()
|
|
28214
28049
|
.wait(symbolNormalDelay + delayNormal * i)
|
|
28215
|
-
.to(Object.assign({
|
|
28216
|
-
.to(Object.assign({
|
|
28050
|
+
.to(Object.assign({}, activeSymbolStyle), perSymbolNormalDuration, easing)
|
|
28051
|
+
.to(Object.assign({}, originAttrs), perSymbolNormalDuration, easing);
|
|
28217
28052
|
});
|
|
28218
28053
|
}
|
|
28219
28054
|
if (this._labelGroup) {
|
|
@@ -28221,7 +28056,10 @@ class Timeline extends AbstractComponent {
|
|
|
28221
28056
|
const delay = percent * (size === 1 ? 0 : (500 - 100) / (size - 1));
|
|
28222
28057
|
const delayNormal = percent * (size === 1 ? 0 : (400 - 160) / (size - 1));
|
|
28223
28058
|
this._labelGroup.forEachChildren((label, i) => {
|
|
28224
|
-
const originAttrs =
|
|
28059
|
+
const originAttrs = {};
|
|
28060
|
+
Object.keys(activeLabelStyle).forEach(k => {
|
|
28061
|
+
originAttrs[k] = label.attribute[k];
|
|
28062
|
+
});
|
|
28225
28063
|
label.setAttributes({ opacity: 0 });
|
|
28226
28064
|
label
|
|
28227
28065
|
.animate()
|
|
@@ -28236,7 +28074,6 @@ class Timeline extends AbstractComponent {
|
|
|
28236
28074
|
}
|
|
28237
28075
|
}
|
|
28238
28076
|
goto(flag, animateConfig) {
|
|
28239
|
-
var _a;
|
|
28240
28077
|
let { clipRange } = this.attribute;
|
|
28241
28078
|
const { animation } = this.attribute;
|
|
28242
28079
|
if (flag > 0) {
|
|
@@ -28264,11 +28101,10 @@ class Timeline extends AbstractComponent {
|
|
|
28264
28101
|
break;
|
|
28265
28102
|
}
|
|
28266
28103
|
}
|
|
28267
|
-
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;
|
|
28268
28105
|
if (animation) {
|
|
28269
28106
|
const { duration = 1000, easing = 'quadOut' } = animateConfig;
|
|
28270
|
-
|
|
28271
|
-
this.animate().to({ clipRange: nextClipRange }, actDuration, easing);
|
|
28107
|
+
this.animate().to({ clipRange: nextClipRange }, duration, easing);
|
|
28272
28108
|
}
|
|
28273
28109
|
else {
|
|
28274
28110
|
this.setAttributes({ clipRange: nextClipRange });
|
|
@@ -28291,7 +28127,8 @@ Timeline.defaultAttributes = {
|
|
|
28291
28127
|
symbolType: 'circle'
|
|
28292
28128
|
},
|
|
28293
28129
|
activeSymbolStyle: {
|
|
28294
|
-
fill: 'orange'
|
|
28130
|
+
fill: 'orange',
|
|
28131
|
+
size: 16
|
|
28295
28132
|
},
|
|
28296
28133
|
lineStyle: {
|
|
28297
28134
|
lineDash: [2, 2],
|
|
@@ -28671,6 +28508,6 @@ EmptyTip.defaultAttributes = {
|
|
|
28671
28508
|
}
|
|
28672
28509
|
};
|
|
28673
28510
|
|
|
28674
|
-
const version = "0.20.0
|
|
28511
|
+
const version = "0.20.0";
|
|
28675
28512
|
|
|
28676
|
-
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 };
|