@visactor/vrender 1.0.41-alpha.1 → 1.0.41
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/index.d.ts +1 -1
- package/cjs/index.js +10 -11
- package/cjs/index.js.map +1 -1
- package/dist/index.es.js +64 -48
- package/dist/index.js +64 -48
- package/dist/index.min.js +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/package.json +6 -6
package/cjs/index.d.ts
CHANGED
package/cjs/index.js
CHANGED
|
@@ -21,17 +21,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
21
21
|
|
|
22
22
|
const vrender_core_1 = require("@visactor/vrender-core"), vrender_kits_1 = require("@visactor/vrender-kits"), vrender_kits_2 = require("@visactor/vrender-kits"), vrender_animate_1 = require("@visactor/vrender-animate");
|
|
23
23
|
|
|
24
|
-
exports.version = "1.0.41
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
(0, vrender_kits_2.
|
|
28
|
-
(0, vrender_kits_2.
|
|
29
|
-
(0, vrender_kits_2.
|
|
30
|
-
(0, vrender_kits_2.
|
|
31
|
-
|
|
32
|
-
(0, vrender_kits_2.
|
|
33
|
-
(0,
|
|
34
|
-
vrender_kits_1.registerStar)(), (0, vrender_core_1.registerFlexLayoutPlugin)(),
|
|
24
|
+
exports.version = "1.0.41", (0, vrender_core_1.preLoadAllModule)(), (0, vrender_core_1.isBrowserEnv)() ? (0,
|
|
25
|
+
vrender_kits_1.loadBrowserEnv)(vrender_core_1.container) : (0, vrender_core_1.isNodeEnv)() && (0,
|
|
26
|
+
vrender_kits_1.loadNodeEnv)(vrender_core_1.container), (0, vrender_kits_2.registerArc)(),
|
|
27
|
+
(0, vrender_kits_2.registerArc3d)(), (0, vrender_kits_2.registerArea)(), (0, vrender_kits_2.registerCircle)(),
|
|
28
|
+
(0, vrender_kits_2.registerGlyph)(), (0, vrender_kits_2.registerGroup)(), (0, vrender_kits_2.registerImage)(),
|
|
29
|
+
(0, vrender_kits_2.registerLine)(), (0, vrender_kits_2.registerPath)(), (0, vrender_kits_2.registerPolygon)(),
|
|
30
|
+
(0, vrender_kits_2.registerPyramid3d)(), (0, vrender_kits_2.registerRect)(), (0,
|
|
31
|
+
vrender_kits_2.registerRect3d)(), (0, vrender_kits_2.registerRichtext)(), (0, vrender_kits_2.registerShadowRoot)(),
|
|
32
|
+
(0, vrender_kits_2.registerSymbol)(), (0, vrender_kits_2.registerText)(), (0, vrender_kits_2.registerWrapText)(),
|
|
33
|
+
(0, vrender_kits_1.registerStar)(), (0, vrender_core_1.registerFlexLayoutPlugin)(),
|
|
35
34
|
(0, vrender_core_1.registerViewTransform3dPlugin)(), (0, vrender_core_1.registerHtmlAttributePlugin)(),
|
|
36
35
|
(0, vrender_core_1.registerReactAttributePlugin)(), (0, vrender_core_1.registerDirectionalLight)(),
|
|
37
36
|
(0, vrender_core_1.registerOrthoCamera)(), (0, vrender_animate_1.registerCustomAnimate)(),
|
package/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,kCAAgC;AAChC,yDAWgC;AAChC,yDAAmF;AACnF,yDAmBgC;AAChC,+DAAmF;AAEtE,QAAA,OAAO,GAAG,
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,kCAAgC;AAChC,yDAWgC;AAChC,yDAAmF;AACnF,yDAmBgC;AAChC,+DAAmF;AAEtE,QAAA,OAAO,GAAG,QAAQ,CAAC;AAEhC,IAAA,+BAAgB,GAAE,CAAC;AAEnB,IAAI,IAAA,2BAAY,GAAE,EAAE;IAClB,IAAA,6BAAc,EAAC,wBAAS,CAAC,CAAC;CAC3B;KAAM,IAAI,IAAA,wBAAS,GAAE,EAAE;IACtB,IAAA,0BAAW,EAAC,wBAAS,CAAC,CAAC;CACxB;AACD,IAAA,0BAAW,GAAE,CAAC;AACd,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,6BAAc,GAAE,CAAC;AACjB,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,8BAAe,GAAE,CAAC;AAClB,IAAA,gCAAiB,GAAE,CAAC;AACpB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,6BAAc,GAAE,CAAC;AACjB,IAAA,+BAAgB,GAAE,CAAC;AACnB,IAAA,iCAAkB,GAAE,CAAC;AACrB,IAAA,6BAAc,GAAE,CAAC;AACjB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,+BAAgB,GAAE,CAAC;AACnB,IAAA,2BAAY,GAAE,CAAC;AAEf,IAAA,uCAAwB,GAAE,CAAC;AAC3B,IAAA,4CAA6B,GAAE,CAAC;AAChC,IAAA,0CAA2B,GAAE,CAAC;AAC9B,IAAA,2CAA4B,GAAE,CAAC;AAC/B,IAAA,uCAAwB,GAAE,CAAC;AAC3B,IAAA,kCAAmB,GAAE,CAAC;AAEtB,IAAA,uCAAqB,GAAE,CAAC;AACxB,IAAA,iCAAe,GAAE,CAAC;AAElB,yDAAuC;AACvC,yDAAuC;AACvC,4DAA0C;AAC1C,+DAA6C;AAG7C,6DAAkD;AAAzC,wGAAA,KAAK,OAAA;AACd,uDAAmD;AAA1C,yGAAA,SAAS,OAAA","file":"index.js","sourcesContent":["import '@visactor/vrender-core';\nimport {\n container,\n isBrowserEnv,\n isNodeEnv,\n preLoadAllModule,\n registerFlexLayoutPlugin,\n registerViewTransform3dPlugin,\n registerHtmlAttributePlugin,\n registerReactAttributePlugin,\n registerDirectionalLight,\n registerOrthoCamera\n} from '@visactor/vrender-core';\nimport { loadBrowserEnv, loadNodeEnv, registerStar } from '@visactor/vrender-kits';\nimport {\n registerArc,\n registerArc3d,\n registerArea,\n registerCircle,\n registerGlyph,\n registerGroup,\n registerImage,\n registerLine,\n registerPath,\n registerPolygon,\n registerPyramid3d,\n registerRect,\n registerRect3d,\n registerRichtext,\n registerShadowRoot,\n registerSymbol,\n registerText,\n registerWrapText\n} from '@visactor/vrender-kits';\nimport { registerCustomAnimate, registerAnimate } from '@visactor/vrender-animate';\n// 导出版本号\nexport const version = \"1.0.41\";\n\npreLoadAllModule();\n\nif (isBrowserEnv()) {\n loadBrowserEnv(container);\n} else if (isNodeEnv()) {\n loadNodeEnv(container);\n}\nregisterArc();\nregisterArc3d();\nregisterArea();\nregisterCircle();\nregisterGlyph();\nregisterGroup();\nregisterImage();\nregisterLine();\nregisterPath();\nregisterPolygon();\nregisterPyramid3d();\nregisterRect();\nregisterRect3d();\nregisterRichtext();\nregisterShadowRoot();\nregisterSymbol();\nregisterText();\nregisterWrapText();\nregisterStar();\n\nregisterFlexLayoutPlugin();\nregisterViewTransform3dPlugin();\nregisterHtmlAttributePlugin();\nregisterReactAttributePlugin();\nregisterDirectionalLight();\nregisterOrthoCamera();\n\nregisterCustomAnimate();\nregisterAnimate();\n\nexport * from '@visactor/vrender-core';\nexport * from '@visactor/vrender-kits';\nexport * from '@visactor/vrender-animate';\nexport * from '@visactor/vrender-components';\n\n// avoid naming conflicts with 'State' & 'Direction' in '@visactor/vrender-components'\nexport { State } from '@visactor/vrender-animate';\nexport { Direction } from '@visactor/vrender-core';\n"]}
|
package/dist/index.es.js
CHANGED
|
@@ -631,28 +631,59 @@ class EventListenerManager {
|
|
|
631
631
|
}
|
|
632
632
|
addEventListener(type, listener, options) {
|
|
633
633
|
if (!listener) return;
|
|
634
|
+
const capture = this._resolveCapture(options),
|
|
635
|
+
once = this._resolveOnce(options),
|
|
636
|
+
listenerTypeMap = this._getOrCreateListenerTypeMap(type),
|
|
637
|
+
wrappedMap = this._getOrCreateWrappedMap(listenerTypeMap, listener);
|
|
638
|
+
if (wrappedMap.has(capture)) return;
|
|
634
639
|
const wrappedListener = event => {
|
|
635
640
|
const transformedEvent = this._eventListenerTransformer(event);
|
|
636
|
-
"function" == typeof listener ? listener(transformedEvent) : listener.handleEvent && listener.handleEvent(transformedEvent);
|
|
641
|
+
"function" == typeof listener ? listener(transformedEvent) : listener.handleEvent && listener.handleEvent(transformedEvent), once && this._deleteListenerRecord(type, listener, capture);
|
|
637
642
|
};
|
|
638
|
-
|
|
643
|
+
wrappedMap.set(capture, {
|
|
644
|
+
wrappedListener: wrappedListener,
|
|
645
|
+
options: options
|
|
646
|
+
}), this._nativeAddEventListener(type, wrappedListener, options);
|
|
639
647
|
}
|
|
640
648
|
removeEventListener(type, listener, options) {
|
|
641
|
-
var _a;
|
|
649
|
+
var _a, _b;
|
|
642
650
|
if (!listener) return;
|
|
643
|
-
const
|
|
644
|
-
|
|
651
|
+
const capture = this._resolveCapture(options),
|
|
652
|
+
wrappedRecord = null === (_b = null === (_a = this._listenerMap.get(type)) || void 0 === _a ? void 0 : _a.get(listener)) || void 0 === _b ? void 0 : _b.get(capture);
|
|
653
|
+
wrappedRecord && (this._nativeRemoveEventListener(type, wrappedRecord.wrappedListener, capture), this._deleteListenerRecord(type, listener, capture));
|
|
645
654
|
}
|
|
646
655
|
dispatchEvent(event) {
|
|
647
656
|
return this._nativeDispatchEvent(event);
|
|
648
657
|
}
|
|
649
658
|
clearAllEventListeners() {
|
|
650
|
-
this._listenerMap.forEach((
|
|
651
|
-
|
|
652
|
-
|
|
659
|
+
this._listenerMap.forEach((listenerMap, type) => {
|
|
660
|
+
listenerMap.forEach(wrappedMap => {
|
|
661
|
+
wrappedMap.forEach((wrappedRecord, capture) => {
|
|
662
|
+
this._nativeRemoveEventListener(type, wrappedRecord.wrappedListener, capture);
|
|
663
|
+
});
|
|
653
664
|
});
|
|
654
665
|
}), this._listenerMap.clear();
|
|
655
666
|
}
|
|
667
|
+
_resolveCapture(options) {
|
|
668
|
+
return "boolean" == typeof options ? options : !!(null == options ? void 0 : options.capture);
|
|
669
|
+
}
|
|
670
|
+
_resolveOnce(options) {
|
|
671
|
+
return "object" == typeof options && !!(null == options ? void 0 : options.once);
|
|
672
|
+
}
|
|
673
|
+
_getOrCreateListenerTypeMap(type) {
|
|
674
|
+
let listenerTypeMap = this._listenerMap.get(type);
|
|
675
|
+
return listenerTypeMap || (listenerTypeMap = new Map(), this._listenerMap.set(type, listenerTypeMap)), listenerTypeMap;
|
|
676
|
+
}
|
|
677
|
+
_getOrCreateWrappedMap(listenerTypeMap, listener) {
|
|
678
|
+
let wrappedMap = listenerTypeMap.get(listener);
|
|
679
|
+
return wrappedMap || (wrappedMap = new Map(), listenerTypeMap.set(listener, wrappedMap)), wrappedMap;
|
|
680
|
+
}
|
|
681
|
+
_deleteListenerRecord(type, listener, capture) {
|
|
682
|
+
const listenerTypeMap = this._listenerMap.get(type);
|
|
683
|
+
if (!listenerTypeMap) return;
|
|
684
|
+
const wrappedMap = listenerTypeMap.get(listener);
|
|
685
|
+
wrappedMap && (wrappedMap.delete(capture), 0 === wrappedMap.size && listenerTypeMap.delete(listener), 0 === listenerTypeMap.size && this._listenerMap.delete(type));
|
|
686
|
+
}
|
|
656
687
|
_nativeAddEventListener(type, listener, options) {
|
|
657
688
|
throw new Error("_nativeAddEventListener must be implemented by derived classes");
|
|
658
689
|
}
|
|
@@ -7460,7 +7491,9 @@ class EventManager {
|
|
|
7460
7491
|
var _a;
|
|
7461
7492
|
if (event.manager !== this) throw new Error("It is illegal to free an event not managed by this EventManager!");
|
|
7462
7493
|
const constructor = event.constructor;
|
|
7463
|
-
this.eventPool.has(constructor) || this.eventPool.
|
|
7494
|
+
this.eventPool.has(constructor) || (this.eventPool.get(constructor).forEach(e => {
|
|
7495
|
+
e.eventPhase = event.NONE, e.currentTarget = null, e.path = [], e.detailPath = [], e.target = null;
|
|
7496
|
+
}), this.eventPool.set(constructor, [])), null === (_a = this.eventPool.get(constructor)) || void 0 === _a || _a.push(event);
|
|
7464
7497
|
}
|
|
7465
7498
|
notifyListeners(e, type) {
|
|
7466
7499
|
const listeners = e.currentTarget._events[type];
|
|
@@ -10264,7 +10297,7 @@ class Graphic extends Node {
|
|
|
10264
10297
|
});
|
|
10265
10298
|
}
|
|
10266
10299
|
release() {
|
|
10267
|
-
this.releaseStatus = "released", this.stopAnimates(), application.graphicService.onRelease(this);
|
|
10300
|
+
this.releaseStatus = "released", this.stopAnimates(), application.graphicService.onRelease(this), super.release();
|
|
10268
10301
|
}
|
|
10269
10302
|
_emitCustomEvent(type, context) {
|
|
10270
10303
|
var _a, _b;
|
|
@@ -15994,10 +16027,9 @@ class DefaultTextBackgroundRenderContribution extends DefaultBaseBackgroundRende
|
|
|
15994
16027
|
}), context.highPerformanceRestore(), context.setTransformForCurrent();
|
|
15995
16028
|
} else {
|
|
15996
16029
|
const {
|
|
15997
|
-
backgroundCornerRadius: backgroundCornerRadius
|
|
15998
|
-
backgroundOpacity = 1
|
|
16030
|
+
backgroundCornerRadius: backgroundCornerRadius
|
|
15999
16031
|
} = graphic.attribute;
|
|
16000
|
-
context.highPerformanceSave(), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), context.
|
|
16032
|
+
context.highPerformanceSave(), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), context.fillStyle = background, backgroundCornerRadius ? (createRectPath(context, b.x1, b.y1, b.width(), b.height(), backgroundCornerRadius, !0), context.fill()) : context.fillRect(b.x1, b.y1, b.width(), b.height()), context.highPerformanceRestore();
|
|
16001
16033
|
}
|
|
16002
16034
|
shouldReCalBounds && boundsAllocate.free(b), restore();
|
|
16003
16035
|
}
|
|
@@ -18263,12 +18295,12 @@ class Stage extends Group {
|
|
|
18263
18295
|
throw new Error("暂不支持");
|
|
18264
18296
|
}
|
|
18265
18297
|
release() {
|
|
18266
|
-
var _a, _b;
|
|
18298
|
+
var _a, _b, _d;
|
|
18267
18299
|
super.release(), this.hooks.beforeRender.unTap("constructor", this.beforeRender), this.hooks.afterRender.unTap("constructor", this.afterRender), this.eventSystem && this.eventSystem.release(), this.layerService.releaseStage(this), this.pluginService.release(), this.forEach(layer => {
|
|
18268
18300
|
layer.release();
|
|
18269
18301
|
}), this.interactiveLayer && (this.interactiveLayer.forEachChildren(item => {
|
|
18270
18302
|
item.setStage && item.setStage(null, null), this.interactiveLayer.removeChild(item);
|
|
18271
|
-
}), this.interactiveLayer.release()), this.window.release(), null === (_a = this._ticker) || void 0 === _a || _a.remTimeline(null == this ? void 0 : this.timeline), null === (_b = this._ticker) || void 0 === _b || _b.removeListener("tick", this.afterTickCb), this.renderService.renderTreeRoots = [];
|
|
18303
|
+
}), this.interactiveLayer.release()), this.window.release(), null === (_a = this._ticker) || void 0 === _a || _a.remTimeline(null == this ? void 0 : this.timeline), null === (_b = this._ticker) || void 0 === _b || _b.removeListener("tick", this.afterTickCb), this.params.ticker || null === (_d = this._ticker) || void 0 === _d || _d.release(), this.renderService.renderTreeRoots = [];
|
|
18272
18304
|
}
|
|
18273
18305
|
setStage(stage) {}
|
|
18274
18306
|
dirty(b, matrix) {
|
|
@@ -31702,6 +31734,8 @@ class DefaultTicker extends EventEmitter {
|
|
|
31702
31734
|
this.status === STATUS$1.RUNNING && (this.tickCounts++, this.timelines.forEach(timeline => {
|
|
31703
31735
|
timeline.tick(delta);
|
|
31704
31736
|
}), this.emit("tick", delta));
|
|
31737
|
+
}, this._handleGraphTick = () => {
|
|
31738
|
+
this.initHandler(!1);
|
|
31705
31739
|
}, this.init(), this.lastFrameTime = -1, this.tickCounts = 0, this.stage = stage, this.autoStop = !0, this.interval = 16, this.computeTimeOffsetAndJitter();
|
|
31706
31740
|
}
|
|
31707
31741
|
bindStage(stage) {
|
|
@@ -31711,9 +31745,7 @@ class DefaultTicker extends EventEmitter {
|
|
|
31711
31745
|
this.timeOffset = Math.floor(Math.random() * this.interval), this._jitter = Math.min(Math.max(.2 * this.interval, 6), .7 * this.interval);
|
|
31712
31746
|
}
|
|
31713
31747
|
init() {
|
|
31714
|
-
this.interval = 16, this.status = STATUS$1.INITIAL, application.global.hooks.onSetEnv.tap("graph-ticker",
|
|
31715
|
-
this.initHandler(!1);
|
|
31716
|
-
}), application.global.env && this.initHandler(!1);
|
|
31748
|
+
this.interval = 16, this.status = STATUS$1.INITIAL, application.global.hooks.onSetEnv.tap("graph-ticker", this._handleGraphTick), application.global.env && this.initHandler(!1);
|
|
31717
31749
|
}
|
|
31718
31750
|
addTimeline(timeline) {
|
|
31719
31751
|
this.timelines.push(timeline);
|
|
@@ -31789,7 +31821,7 @@ class DefaultTicker extends EventEmitter {
|
|
|
31789
31821
|
}
|
|
31790
31822
|
release() {
|
|
31791
31823
|
var _a;
|
|
31792
|
-
this.stop(), this.timelines = [], null === (_a = this.tickerHandler) || void 0 === _a || _a.release(), this.tickerHandler = null, this.lastFrameTime = -1;
|
|
31824
|
+
this.stop(), this.timelines = [], null === (_a = this.tickerHandler) || void 0 === _a || _a.release(), this.tickerHandler = null, this.lastFrameTime = -1, application.global.hooks.onSetEnv.unTap("graph-ticker", this._handleGraphTick);
|
|
31793
31825
|
}
|
|
31794
31826
|
checkSkip(delta) {
|
|
31795
31827
|
var _a, _b, _c;
|
|
@@ -37695,7 +37727,7 @@ class ScrollBar extends AbstractComponent {
|
|
|
37695
37727
|
this._sliderRenderBounds = null, this._sliderLimitRange = null;
|
|
37696
37728
|
}
|
|
37697
37729
|
release(all) {
|
|
37698
|
-
super.release(all), ("browser" === vglobal.env ? vglobal : this.stage).
|
|
37730
|
+
super.release(all), ("browser" === vglobal.env ? vglobal : this.stage).removeEventListener("touchmove", this._handleTouchMove, {
|
|
37699
37731
|
passive: !1
|
|
37700
37732
|
}), this._clearDragEvents();
|
|
37701
37733
|
}
|
|
@@ -43524,9 +43556,8 @@ class LabelBase extends AnimateComponent {
|
|
|
43524
43556
|
const label = labels[i];
|
|
43525
43557
|
if (!label) continue;
|
|
43526
43558
|
const baseMark = this.getRelatedGraphic(label.attribute);
|
|
43527
|
-
let backgroundColor = baseMark.getAttributes(!0).fill
|
|
43528
|
-
|
|
43529
|
-
let foregroundColor = label.attribute.fill;
|
|
43559
|
+
let backgroundColor = baseMark.getAttributes(!0).fill,
|
|
43560
|
+
foregroundColor = label.attribute.fill;
|
|
43530
43561
|
if (isObject$1(backgroundColor) && backgroundColor.gradient) {
|
|
43531
43562
|
const firstStopColor = null === (_g = null === (_f = backgroundColor.stops) || void 0 === _f ? void 0 : _f[0]) || void 0 === _g ? void 0 : _g.color;
|
|
43532
43563
|
firstStopColor && (backgroundColor = firstStopColor, foregroundColor = firstStopColor);
|
|
@@ -43540,26 +43571,11 @@ class LabelBase extends AnimateComponent {
|
|
|
43540
43571
|
if (fill && label.setAttributes({
|
|
43541
43572
|
fill: fill
|
|
43542
43573
|
}), 0 === label.attribute.lineWidth || 0 === label.attribute.strokeOpacity) continue;
|
|
43543
|
-
|
|
43544
|
-
|
|
43545
|
-
|
|
43546
|
-
|
|
43547
|
-
stroke && label.setAttributes({
|
|
43548
|
-
stroke: stroke
|
|
43549
|
-
});
|
|
43550
|
-
}
|
|
43574
|
+
const stroke = smartInvertStrategy(strokeStrategy, backgroundColor, invertColor, similarColor);
|
|
43575
|
+
stroke && label.setAttributes({
|
|
43576
|
+
stroke: stroke
|
|
43577
|
+
});
|
|
43551
43578
|
} else if (isIntersect && "none" !== interactInvertType) {
|
|
43552
|
-
if ("background" === interactInvertType) {
|
|
43553
|
-
const fill = smartInvertStrategy(fillStrategy, backgroundColor, invertColor, similarColor);
|
|
43554
|
-
fill && label.setAttributes({
|
|
43555
|
-
fill: fill
|
|
43556
|
-
}), label.setAttributes({
|
|
43557
|
-
stroke: !1,
|
|
43558
|
-
background: backgroundColor,
|
|
43559
|
-
backgroundOpacity: backgroundOpacity
|
|
43560
|
-
});
|
|
43561
|
-
continue;
|
|
43562
|
-
}
|
|
43563
43579
|
if (0 === label.attribute.lineWidth || 0 === label.attribute.strokeOpacity) continue;
|
|
43564
43580
|
if (label.attribute.stroke) {
|
|
43565
43581
|
label.setAttributes({
|
|
@@ -43576,9 +43592,6 @@ class LabelBase extends AnimateComponent {
|
|
|
43576
43592
|
stroke: stroke
|
|
43577
43593
|
});
|
|
43578
43594
|
}
|
|
43579
|
-
!1 === isInside && "background" === interactInvertType && label.setAttributes({
|
|
43580
|
-
background: null
|
|
43581
|
-
});
|
|
43582
43595
|
}
|
|
43583
43596
|
}
|
|
43584
43597
|
_canPlaceInside(textBound, shapeBound) {
|
|
@@ -45633,7 +45646,7 @@ class DataZoomInteraction extends EventEmitter {
|
|
|
45633
45646
|
});
|
|
45634
45647
|
}
|
|
45635
45648
|
clearVGlobalEvents() {
|
|
45636
|
-
("browser" === vglobal.env ? vglobal : this.stage).
|
|
45649
|
+
("browser" === vglobal.env ? vglobal : this.stage).removeEventListener("touchmove", this._handleTouchMove, {
|
|
45637
45650
|
passive: !1
|
|
45638
45651
|
});
|
|
45639
45652
|
}
|
|
@@ -49340,7 +49353,7 @@ class Slider extends AbstractComponent {
|
|
|
49340
49353
|
};
|
|
49341
49354
|
}
|
|
49342
49355
|
release(all) {
|
|
49343
|
-
super.release(all), ("browser" === vglobal.env ? vglobal : this.stage).
|
|
49356
|
+
super.release(all), ("browser" === vglobal.env ? vglobal : this.stage).removeEventListener("touchmove", this._handleTouchMove, {
|
|
49344
49357
|
passive: !1
|
|
49345
49358
|
}), this._clearAllDragEvents();
|
|
49346
49359
|
}
|
|
@@ -50478,6 +50491,9 @@ class BasePlayer extends AbstractComponent {
|
|
|
50478
50491
|
value: this._data[dataIndex]
|
|
50479
50492
|
});
|
|
50480
50493
|
}
|
|
50494
|
+
release(all) {
|
|
50495
|
+
this._sliderVisible || this._slider.release(all), super.release(all);
|
|
50496
|
+
}
|
|
50481
50497
|
}
|
|
50482
50498
|
BasePlayer.defaultAttributes = {
|
|
50483
50499
|
visible: !0,
|
|
@@ -53077,7 +53093,7 @@ TableSeriesNumber.defaultAttributes = {
|
|
|
53077
53093
|
select: !0
|
|
53078
53094
|
};
|
|
53079
53095
|
|
|
53080
|
-
const version = "1.0.41
|
|
53096
|
+
const version = "1.0.41";
|
|
53081
53097
|
preLoadAllModule();
|
|
53082
53098
|
if (isBrowserEnv()) {
|
|
53083
53099
|
loadBrowserEnv(container);
|
package/dist/index.js
CHANGED
|
@@ -637,28 +637,59 @@
|
|
|
637
637
|
}
|
|
638
638
|
addEventListener(type, listener, options) {
|
|
639
639
|
if (!listener) return;
|
|
640
|
+
const capture = this._resolveCapture(options),
|
|
641
|
+
once = this._resolveOnce(options),
|
|
642
|
+
listenerTypeMap = this._getOrCreateListenerTypeMap(type),
|
|
643
|
+
wrappedMap = this._getOrCreateWrappedMap(listenerTypeMap, listener);
|
|
644
|
+
if (wrappedMap.has(capture)) return;
|
|
640
645
|
const wrappedListener = event => {
|
|
641
646
|
const transformedEvent = this._eventListenerTransformer(event);
|
|
642
|
-
"function" == typeof listener ? listener(transformedEvent) : listener.handleEvent && listener.handleEvent(transformedEvent);
|
|
647
|
+
"function" == typeof listener ? listener(transformedEvent) : listener.handleEvent && listener.handleEvent(transformedEvent), once && this._deleteListenerRecord(type, listener, capture);
|
|
643
648
|
};
|
|
644
|
-
|
|
649
|
+
wrappedMap.set(capture, {
|
|
650
|
+
wrappedListener: wrappedListener,
|
|
651
|
+
options: options
|
|
652
|
+
}), this._nativeAddEventListener(type, wrappedListener, options);
|
|
645
653
|
}
|
|
646
654
|
removeEventListener(type, listener, options) {
|
|
647
|
-
var _a;
|
|
655
|
+
var _a, _b;
|
|
648
656
|
if (!listener) return;
|
|
649
|
-
const
|
|
650
|
-
|
|
657
|
+
const capture = this._resolveCapture(options),
|
|
658
|
+
wrappedRecord = null === (_b = null === (_a = this._listenerMap.get(type)) || void 0 === _a ? void 0 : _a.get(listener)) || void 0 === _b ? void 0 : _b.get(capture);
|
|
659
|
+
wrappedRecord && (this._nativeRemoveEventListener(type, wrappedRecord.wrappedListener, capture), this._deleteListenerRecord(type, listener, capture));
|
|
651
660
|
}
|
|
652
661
|
dispatchEvent(event) {
|
|
653
662
|
return this._nativeDispatchEvent(event);
|
|
654
663
|
}
|
|
655
664
|
clearAllEventListeners() {
|
|
656
|
-
this._listenerMap.forEach((
|
|
657
|
-
|
|
658
|
-
|
|
665
|
+
this._listenerMap.forEach((listenerMap, type) => {
|
|
666
|
+
listenerMap.forEach(wrappedMap => {
|
|
667
|
+
wrappedMap.forEach((wrappedRecord, capture) => {
|
|
668
|
+
this._nativeRemoveEventListener(type, wrappedRecord.wrappedListener, capture);
|
|
669
|
+
});
|
|
659
670
|
});
|
|
660
671
|
}), this._listenerMap.clear();
|
|
661
672
|
}
|
|
673
|
+
_resolveCapture(options) {
|
|
674
|
+
return "boolean" == typeof options ? options : !!(null == options ? void 0 : options.capture);
|
|
675
|
+
}
|
|
676
|
+
_resolveOnce(options) {
|
|
677
|
+
return "object" == typeof options && !!(null == options ? void 0 : options.once);
|
|
678
|
+
}
|
|
679
|
+
_getOrCreateListenerTypeMap(type) {
|
|
680
|
+
let listenerTypeMap = this._listenerMap.get(type);
|
|
681
|
+
return listenerTypeMap || (listenerTypeMap = new Map(), this._listenerMap.set(type, listenerTypeMap)), listenerTypeMap;
|
|
682
|
+
}
|
|
683
|
+
_getOrCreateWrappedMap(listenerTypeMap, listener) {
|
|
684
|
+
let wrappedMap = listenerTypeMap.get(listener);
|
|
685
|
+
return wrappedMap || (wrappedMap = new Map(), listenerTypeMap.set(listener, wrappedMap)), wrappedMap;
|
|
686
|
+
}
|
|
687
|
+
_deleteListenerRecord(type, listener, capture) {
|
|
688
|
+
const listenerTypeMap = this._listenerMap.get(type);
|
|
689
|
+
if (!listenerTypeMap) return;
|
|
690
|
+
const wrappedMap = listenerTypeMap.get(listener);
|
|
691
|
+
wrappedMap && (wrappedMap.delete(capture), 0 === wrappedMap.size && listenerTypeMap.delete(listener), 0 === listenerTypeMap.size && this._listenerMap.delete(type));
|
|
692
|
+
}
|
|
662
693
|
_nativeAddEventListener(type, listener, options) {
|
|
663
694
|
throw new Error("_nativeAddEventListener must be implemented by derived classes");
|
|
664
695
|
}
|
|
@@ -7466,7 +7497,9 @@
|
|
|
7466
7497
|
var _a;
|
|
7467
7498
|
if (event.manager !== this) throw new Error("It is illegal to free an event not managed by this EventManager!");
|
|
7468
7499
|
const constructor = event.constructor;
|
|
7469
|
-
this.eventPool.has(constructor) || this.eventPool.
|
|
7500
|
+
this.eventPool.has(constructor) || (this.eventPool.get(constructor).forEach(e => {
|
|
7501
|
+
e.eventPhase = event.NONE, e.currentTarget = null, e.path = [], e.detailPath = [], e.target = null;
|
|
7502
|
+
}), this.eventPool.set(constructor, [])), null === (_a = this.eventPool.get(constructor)) || void 0 === _a || _a.push(event);
|
|
7470
7503
|
}
|
|
7471
7504
|
notifyListeners(e, type) {
|
|
7472
7505
|
const listeners = e.currentTarget._events[type];
|
|
@@ -10270,7 +10303,7 @@
|
|
|
10270
10303
|
});
|
|
10271
10304
|
}
|
|
10272
10305
|
release() {
|
|
10273
|
-
this.releaseStatus = "released", this.stopAnimates(), application.graphicService.onRelease(this);
|
|
10306
|
+
this.releaseStatus = "released", this.stopAnimates(), application.graphicService.onRelease(this), super.release();
|
|
10274
10307
|
}
|
|
10275
10308
|
_emitCustomEvent(type, context) {
|
|
10276
10309
|
var _a, _b;
|
|
@@ -16000,10 +16033,9 @@
|
|
|
16000
16033
|
}), context.highPerformanceRestore(), context.setTransformForCurrent();
|
|
16001
16034
|
} else {
|
|
16002
16035
|
const {
|
|
16003
|
-
backgroundCornerRadius: backgroundCornerRadius
|
|
16004
|
-
backgroundOpacity = 1
|
|
16036
|
+
backgroundCornerRadius: backgroundCornerRadius
|
|
16005
16037
|
} = graphic.attribute;
|
|
16006
|
-
context.highPerformanceSave(), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), context.
|
|
16038
|
+
context.highPerformanceSave(), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), context.fillStyle = background, backgroundCornerRadius ? (createRectPath(context, b.x1, b.y1, b.width(), b.height(), backgroundCornerRadius, !0), context.fill()) : context.fillRect(b.x1, b.y1, b.width(), b.height()), context.highPerformanceRestore();
|
|
16007
16039
|
}
|
|
16008
16040
|
shouldReCalBounds && boundsAllocate.free(b), restore();
|
|
16009
16041
|
}
|
|
@@ -18269,12 +18301,12 @@
|
|
|
18269
18301
|
throw new Error("暂不支持");
|
|
18270
18302
|
}
|
|
18271
18303
|
release() {
|
|
18272
|
-
var _a, _b;
|
|
18304
|
+
var _a, _b, _d;
|
|
18273
18305
|
super.release(), this.hooks.beforeRender.unTap("constructor", this.beforeRender), this.hooks.afterRender.unTap("constructor", this.afterRender), this.eventSystem && this.eventSystem.release(), this.layerService.releaseStage(this), this.pluginService.release(), this.forEach(layer => {
|
|
18274
18306
|
layer.release();
|
|
18275
18307
|
}), this.interactiveLayer && (this.interactiveLayer.forEachChildren(item => {
|
|
18276
18308
|
item.setStage && item.setStage(null, null), this.interactiveLayer.removeChild(item);
|
|
18277
|
-
}), this.interactiveLayer.release()), this.window.release(), null === (_a = this._ticker) || void 0 === _a || _a.remTimeline(null == this ? void 0 : this.timeline), null === (_b = this._ticker) || void 0 === _b || _b.removeListener("tick", this.afterTickCb), this.renderService.renderTreeRoots = [];
|
|
18309
|
+
}), this.interactiveLayer.release()), this.window.release(), null === (_a = this._ticker) || void 0 === _a || _a.remTimeline(null == this ? void 0 : this.timeline), null === (_b = this._ticker) || void 0 === _b || _b.removeListener("tick", this.afterTickCb), this.params.ticker || null === (_d = this._ticker) || void 0 === _d || _d.release(), this.renderService.renderTreeRoots = [];
|
|
18278
18310
|
}
|
|
18279
18311
|
setStage(stage) {}
|
|
18280
18312
|
dirty(b, matrix) {
|
|
@@ -31708,6 +31740,8 @@
|
|
|
31708
31740
|
this.status === exports.STATUS.RUNNING && (this.tickCounts++, this.timelines.forEach(timeline => {
|
|
31709
31741
|
timeline.tick(delta);
|
|
31710
31742
|
}), this.emit("tick", delta));
|
|
31743
|
+
}, this._handleGraphTick = () => {
|
|
31744
|
+
this.initHandler(!1);
|
|
31711
31745
|
}, this.init(), this.lastFrameTime = -1, this.tickCounts = 0, this.stage = stage, this.autoStop = !0, this.interval = 16, this.computeTimeOffsetAndJitter();
|
|
31712
31746
|
}
|
|
31713
31747
|
bindStage(stage) {
|
|
@@ -31717,9 +31751,7 @@
|
|
|
31717
31751
|
this.timeOffset = Math.floor(Math.random() * this.interval), this._jitter = Math.min(Math.max(.2 * this.interval, 6), .7 * this.interval);
|
|
31718
31752
|
}
|
|
31719
31753
|
init() {
|
|
31720
|
-
this.interval = 16, this.status = exports.STATUS.INITIAL, application.global.hooks.onSetEnv.tap("graph-ticker",
|
|
31721
|
-
this.initHandler(!1);
|
|
31722
|
-
}), application.global.env && this.initHandler(!1);
|
|
31754
|
+
this.interval = 16, this.status = exports.STATUS.INITIAL, application.global.hooks.onSetEnv.tap("graph-ticker", this._handleGraphTick), application.global.env && this.initHandler(!1);
|
|
31723
31755
|
}
|
|
31724
31756
|
addTimeline(timeline) {
|
|
31725
31757
|
this.timelines.push(timeline);
|
|
@@ -31795,7 +31827,7 @@
|
|
|
31795
31827
|
}
|
|
31796
31828
|
release() {
|
|
31797
31829
|
var _a;
|
|
31798
|
-
this.stop(), this.timelines = [], null === (_a = this.tickerHandler) || void 0 === _a || _a.release(), this.tickerHandler = null, this.lastFrameTime = -1;
|
|
31830
|
+
this.stop(), this.timelines = [], null === (_a = this.tickerHandler) || void 0 === _a || _a.release(), this.tickerHandler = null, this.lastFrameTime = -1, application.global.hooks.onSetEnv.unTap("graph-ticker", this._handleGraphTick);
|
|
31799
31831
|
}
|
|
31800
31832
|
checkSkip(delta) {
|
|
31801
31833
|
var _a, _b, _c;
|
|
@@ -37701,7 +37733,7 @@
|
|
|
37701
37733
|
this._sliderRenderBounds = null, this._sliderLimitRange = null;
|
|
37702
37734
|
}
|
|
37703
37735
|
release(all) {
|
|
37704
|
-
super.release(all), ("browser" === vglobal.env ? vglobal : this.stage).
|
|
37736
|
+
super.release(all), ("browser" === vglobal.env ? vglobal : this.stage).removeEventListener("touchmove", this._handleTouchMove, {
|
|
37705
37737
|
passive: !1
|
|
37706
37738
|
}), this._clearDragEvents();
|
|
37707
37739
|
}
|
|
@@ -43530,9 +43562,8 @@
|
|
|
43530
43562
|
const label = labels[i];
|
|
43531
43563
|
if (!label) continue;
|
|
43532
43564
|
const baseMark = this.getRelatedGraphic(label.attribute);
|
|
43533
|
-
let backgroundColor = baseMark.getAttributes(!0).fill
|
|
43534
|
-
|
|
43535
|
-
let foregroundColor = label.attribute.fill;
|
|
43565
|
+
let backgroundColor = baseMark.getAttributes(!0).fill,
|
|
43566
|
+
foregroundColor = label.attribute.fill;
|
|
43536
43567
|
if (isObject$1(backgroundColor) && backgroundColor.gradient) {
|
|
43537
43568
|
const firstStopColor = null === (_g = null === (_f = backgroundColor.stops) || void 0 === _f ? void 0 : _f[0]) || void 0 === _g ? void 0 : _g.color;
|
|
43538
43569
|
firstStopColor && (backgroundColor = firstStopColor, foregroundColor = firstStopColor);
|
|
@@ -43546,26 +43577,11 @@
|
|
|
43546
43577
|
if (fill && label.setAttributes({
|
|
43547
43578
|
fill: fill
|
|
43548
43579
|
}), 0 === label.attribute.lineWidth || 0 === label.attribute.strokeOpacity) continue;
|
|
43549
|
-
|
|
43550
|
-
|
|
43551
|
-
|
|
43552
|
-
|
|
43553
|
-
stroke && label.setAttributes({
|
|
43554
|
-
stroke: stroke
|
|
43555
|
-
});
|
|
43556
|
-
}
|
|
43580
|
+
const stroke = smartInvertStrategy(strokeStrategy, backgroundColor, invertColor, similarColor);
|
|
43581
|
+
stroke && label.setAttributes({
|
|
43582
|
+
stroke: stroke
|
|
43583
|
+
});
|
|
43557
43584
|
} else if (isIntersect && "none" !== interactInvertType) {
|
|
43558
|
-
if ("background" === interactInvertType) {
|
|
43559
|
-
const fill = smartInvertStrategy(fillStrategy, backgroundColor, invertColor, similarColor);
|
|
43560
|
-
fill && label.setAttributes({
|
|
43561
|
-
fill: fill
|
|
43562
|
-
}), label.setAttributes({
|
|
43563
|
-
stroke: !1,
|
|
43564
|
-
background: backgroundColor,
|
|
43565
|
-
backgroundOpacity: backgroundOpacity
|
|
43566
|
-
});
|
|
43567
|
-
continue;
|
|
43568
|
-
}
|
|
43569
43585
|
if (0 === label.attribute.lineWidth || 0 === label.attribute.strokeOpacity) continue;
|
|
43570
43586
|
if (label.attribute.stroke) {
|
|
43571
43587
|
label.setAttributes({
|
|
@@ -43582,9 +43598,6 @@
|
|
|
43582
43598
|
stroke: stroke
|
|
43583
43599
|
});
|
|
43584
43600
|
}
|
|
43585
|
-
!1 === isInside && "background" === interactInvertType && label.setAttributes({
|
|
43586
|
-
background: null
|
|
43587
|
-
});
|
|
43588
43601
|
}
|
|
43589
43602
|
}
|
|
43590
43603
|
_canPlaceInside(textBound, shapeBound) {
|
|
@@ -45639,7 +45652,7 @@
|
|
|
45639
45652
|
});
|
|
45640
45653
|
}
|
|
45641
45654
|
clearVGlobalEvents() {
|
|
45642
|
-
("browser" === vglobal.env ? vglobal : this.stage).
|
|
45655
|
+
("browser" === vglobal.env ? vglobal : this.stage).removeEventListener("touchmove", this._handleTouchMove, {
|
|
45643
45656
|
passive: !1
|
|
45644
45657
|
});
|
|
45645
45658
|
}
|
|
@@ -49346,7 +49359,7 @@
|
|
|
49346
49359
|
};
|
|
49347
49360
|
}
|
|
49348
49361
|
release(all) {
|
|
49349
|
-
super.release(all), ("browser" === vglobal.env ? vglobal : this.stage).
|
|
49362
|
+
super.release(all), ("browser" === vglobal.env ? vglobal : this.stage).removeEventListener("touchmove", this._handleTouchMove, {
|
|
49350
49363
|
passive: !1
|
|
49351
49364
|
}), this._clearAllDragEvents();
|
|
49352
49365
|
}
|
|
@@ -50484,6 +50497,9 @@
|
|
|
50484
50497
|
value: this._data[dataIndex]
|
|
50485
50498
|
});
|
|
50486
50499
|
}
|
|
50500
|
+
release(all) {
|
|
50501
|
+
this._sliderVisible || this._slider.release(all), super.release(all);
|
|
50502
|
+
}
|
|
50487
50503
|
}
|
|
50488
50504
|
BasePlayer.defaultAttributes = {
|
|
50489
50505
|
visible: !0,
|
|
@@ -53083,7 +53099,7 @@
|
|
|
53083
53099
|
select: !0
|
|
53084
53100
|
};
|
|
53085
53101
|
|
|
53086
|
-
const version = "1.0.41
|
|
53102
|
+
const version = "1.0.41";
|
|
53087
53103
|
preLoadAllModule();
|
|
53088
53104
|
if (isBrowserEnv()) {
|
|
53089
53105
|
loadBrowserEnv(container);
|