@visactor/vrender 0.17.17 → 0.17.18-alpha.1
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 +11 -10
- package/cjs/index.js.map +1 -1
- package/dist/index.js +327 -267
- 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 +5 -5
package/dist/index.js
CHANGED
|
@@ -6976,7 +6976,10 @@
|
|
|
6976
6976
|
value: function removeAllChild() {
|
|
6977
6977
|
if (!this._idMap) return;
|
|
6978
6978
|
var child = this._firstChild;
|
|
6979
|
-
for (; child;)
|
|
6979
|
+
for (; child;) {
|
|
6980
|
+
var next = child._next;
|
|
6981
|
+
child.parent = null, child._prev = null, child._next = null, child = next;
|
|
6982
|
+
}
|
|
6980
6983
|
this._firstChild = null, this._lastChild = null, this._idMap.clear(), this._structEdit = !0, this.setCount(1 - this._count);
|
|
6981
6984
|
}
|
|
6982
6985
|
}, {
|
|
@@ -11360,15 +11363,7 @@
|
|
|
11360
11363
|
var data = ResourceLoader.cache.get(url);
|
|
11361
11364
|
data ? "fail" === data.loadState ? application.global.getRequestAnimationFrame()(function () {
|
|
11362
11365
|
mark.imageLoadFail(url);
|
|
11363
|
-
}) : "init" === data.loadState || "loading" === data.loadState ? null === (_a = data.waitingMark) || void 0 === _a || _a.push(mark) : mark && mark.imageLoadSuccess(url, data.data) : (
|
|
11364
|
-
type: "image",
|
|
11365
|
-
loadState: "init"
|
|
11366
|
-
}, ResourceLoader.cache.set(url, data), data.dataPromise = application.global.loadImage(url), data.dataPromise ? (data.waitingMark = [mark], data.dataPromise.then(function (res) {
|
|
11367
|
-
var _a;
|
|
11368
|
-
data.loadState = (null == res ? void 0 : res.data) ? "success" : "fail", data.data = null == res ? void 0 : res.data, null === (_a = data.waitingMark) || void 0 === _a || _a.map(function (mark, index) {
|
|
11369
|
-
(null == res ? void 0 : res.data) ? (data.loadState = "success", data.data = res.data, mark.imageLoadSuccess(url, res.data)) : (data.loadState = "fail", mark.imageLoadFail(url));
|
|
11370
|
-
});
|
|
11371
|
-
})) : (data.loadState = "fail", mark.imageLoadFail(url)));
|
|
11366
|
+
}) : "init" === data.loadState || "loading" === data.loadState ? null === (_a = data.waitingMark) || void 0 === _a || _a.push(mark) : mark && mark.imageLoadSuccess(url, data.data) : ResourceLoader.loadImage(url, mark);
|
|
11372
11367
|
}
|
|
11373
11368
|
}, {
|
|
11374
11369
|
key: "GetSvg",
|
|
@@ -11402,10 +11397,68 @@
|
|
|
11402
11397
|
return data.data;
|
|
11403
11398
|
}));
|
|
11404
11399
|
}
|
|
11400
|
+
}, {
|
|
11401
|
+
key: "loading",
|
|
11402
|
+
value: function loading() {
|
|
11403
|
+
setTimeout(function () {
|
|
11404
|
+
if (!ResourceLoader.isLoading && ResourceLoader.toLoadAueue.length) {
|
|
11405
|
+
ResourceLoader.isLoading = !0;
|
|
11406
|
+
var tasks = ResourceLoader.toLoadAueue.splice(0, 10),
|
|
11407
|
+
promises = [];
|
|
11408
|
+
tasks.forEach(function (task) {
|
|
11409
|
+
var url = task.url,
|
|
11410
|
+
marks = task.marks,
|
|
11411
|
+
data = {
|
|
11412
|
+
type: "image",
|
|
11413
|
+
loadState: "init"
|
|
11414
|
+
};
|
|
11415
|
+
if (ResourceLoader.cache.set(url, data), data.dataPromise = application.global.loadImage(url), data.dataPromise) {
|
|
11416
|
+
data.waitingMark = marks;
|
|
11417
|
+
var end = data.dataPromise.then(function (res) {
|
|
11418
|
+
var _a;
|
|
11419
|
+
data.loadState = (null == res ? void 0 : res.data) ? "success" : "fail", data.data = null == res ? void 0 : res.data, null === (_a = data.waitingMark) || void 0 === _a || _a.map(function (mark, index) {
|
|
11420
|
+
(null == res ? void 0 : res.data) ? (data.loadState = "success", data.data = res.data, mark.imageLoadSuccess(url, res.data)) : (data.loadState = "fail", mark.imageLoadFail(url));
|
|
11421
|
+
});
|
|
11422
|
+
});
|
|
11423
|
+
promises.push(end);
|
|
11424
|
+
} else data.loadState = "fail", marks.forEach(function (mark) {
|
|
11425
|
+
return mark.imageLoadFail(url);
|
|
11426
|
+
});
|
|
11427
|
+
}), Promise.all(promises).then(function () {
|
|
11428
|
+
ResourceLoader.isLoading = !1, ResourceLoader.loading();
|
|
11429
|
+
})["catch"](function (error) {
|
|
11430
|
+
console.error(error), ResourceLoader.isLoading = !1, ResourceLoader.loading();
|
|
11431
|
+
});
|
|
11432
|
+
}
|
|
11433
|
+
}, 0);
|
|
11434
|
+
}
|
|
11435
|
+
}, {
|
|
11436
|
+
key: "loadImage",
|
|
11437
|
+
value: function loadImage(url, mark) {
|
|
11438
|
+
var index = getIndex(url, ResourceLoader.toLoadAueue);
|
|
11439
|
+
if (-1 !== index) return ResourceLoader.toLoadAueue[index].marks.push(mark), void ResourceLoader.loading();
|
|
11440
|
+
ResourceLoader.toLoadAueue.push({
|
|
11441
|
+
url: url,
|
|
11442
|
+
marks: [mark]
|
|
11443
|
+
}), ResourceLoader.loading();
|
|
11444
|
+
}
|
|
11445
|
+
}, {
|
|
11446
|
+
key: "improveImageLoading",
|
|
11447
|
+
value: function improveImageLoading(url) {
|
|
11448
|
+
var index = getIndex(url, ResourceLoader.toLoadAueue);
|
|
11449
|
+
if (-1 !== index) {
|
|
11450
|
+
var elememt = ResourceLoader.toLoadAueue.splice(index, 1);
|
|
11451
|
+
ResourceLoader.toLoadAueue.unshift(elememt[0]);
|
|
11452
|
+
}
|
|
11453
|
+
}
|
|
11405
11454
|
}]);
|
|
11406
11455
|
return ResourceLoader;
|
|
11407
11456
|
}();
|
|
11408
|
-
|
|
11457
|
+
function getIndex(url, arr) {
|
|
11458
|
+
for (var i = 0; i < arr.length; i++) if (arr[i].url === url) return i;
|
|
11459
|
+
return -1;
|
|
11460
|
+
}
|
|
11461
|
+
ResourceLoader.cache = new Map(), ResourceLoader.isLoading = !1, ResourceLoader.toLoadAueue = [];
|
|
11409
11462
|
|
|
11410
11463
|
var tempMatrix = new Matrix(),
|
|
11411
11464
|
tempBounds$1 = new AABBBounds();
|
|
@@ -12191,7 +12244,7 @@
|
|
|
12191
12244
|
data: "init",
|
|
12192
12245
|
state: null
|
|
12193
12246
|
};
|
|
12194
|
-
this.resources.set(url, cache), "string" == typeof image ? (cache.state = "loading", image.startsWith("<svg") ? (ResourceLoader.GetSvg(image, this), this.backgroundImg = this.backgroundImg || background) : (isValidUrl$1(image) || image.includes("/") || isBase64$1(image)) && (ResourceLoader.GetImage(image, this), this.backgroundImg = this.backgroundImg || background)) : (cache.state = "success", cache.data = image, this.backgroundImg = this.backgroundImg || background);
|
|
12247
|
+
this.resources.set(url, cache), "string" == typeof image ? (cache.state = "loading", image.startsWith("<svg") ? (ResourceLoader.GetSvg(image, this), this.backgroundImg = this.backgroundImg || background) : (isValidUrl$1(image) || image.includes("/") || isBase64$1(image)) && (ResourceLoader.GetImage(image, this), this.backgroundImg = this.backgroundImg || background)) : isObject$1(image) ? (cache.state = "success", cache.data = image, this.backgroundImg = this.backgroundImg || background) : cache.state = "fail";
|
|
12195
12248
|
}
|
|
12196
12249
|
}, {
|
|
12197
12250
|
key: "imageLoadSuccess",
|
|
@@ -21190,7 +21243,9 @@
|
|
|
21190
21243
|
value: function draw(image, renderService, drawContext) {
|
|
21191
21244
|
var url = image.attribute.image;
|
|
21192
21245
|
if (!url || !image.resources) return;
|
|
21193
|
-
|
|
21246
|
+
var res = image.resources.get(url);
|
|
21247
|
+
if ("loading" === res.state && isString$1(url)) return void ResourceLoader.improveImageLoading(url);
|
|
21248
|
+
if ("success" !== res.state) return;
|
|
21194
21249
|
var context = renderService.drawParams.context;
|
|
21195
21250
|
if (!context) return;
|
|
21196
21251
|
var imageAttribute = getTheme(image).image;
|
|
@@ -21231,6 +21286,241 @@
|
|
|
21231
21286
|
},
|
|
21232
21287
|
__metadata$$ = undefined && undefined.__metadata || function (k, v) {
|
|
21233
21288
|
if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
21289
|
+
};
|
|
21290
|
+
var DrawItemInterceptor = Symbol["for"]("DrawItemInterceptor");
|
|
21291
|
+
var tempDirtyBounds = new AABBBounds();
|
|
21292
|
+
var ShadowRootDrawItemInterceptorContribution = /*#__PURE__*/function () {
|
|
21293
|
+
function ShadowRootDrawItemInterceptorContribution() {
|
|
21294
|
+
_classCallCheck(this, ShadowRootDrawItemInterceptorContribution);
|
|
21295
|
+
this.order = 1;
|
|
21296
|
+
}
|
|
21297
|
+
_createClass(ShadowRootDrawItemInterceptorContribution, [{
|
|
21298
|
+
key: "afterDrawItem",
|
|
21299
|
+
value: function afterDrawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21300
|
+
return (graphic.attribute.shadowRootIdx > 0 || !graphic.attribute.shadowRootIdx) && this.drawItem(graphic, renderService, drawContext, drawContribution, params), !1;
|
|
21301
|
+
}
|
|
21302
|
+
}, {
|
|
21303
|
+
key: "beforeDrawItem",
|
|
21304
|
+
value: function beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21305
|
+
return graphic.attribute.shadowRootIdx < 0 && this.drawItem(graphic, renderService, drawContext, drawContribution, params), !1;
|
|
21306
|
+
}
|
|
21307
|
+
}, {
|
|
21308
|
+
key: "drawItem",
|
|
21309
|
+
value: function drawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21310
|
+
if (!graphic.shadowRoot) return !1;
|
|
21311
|
+
var context = drawContext.context;
|
|
21312
|
+
if (context.highPerformanceSave(), context.transformFromMatrix(graphic.transMatrix, !0), drawContribution.dirtyBounds && drawContribution.backupDirtyBounds) {
|
|
21313
|
+
tempDirtyBounds.copy(drawContribution.dirtyBounds);
|
|
21314
|
+
var m = graphic.globalTransMatrix.getInverse();
|
|
21315
|
+
drawContribution.dirtyBounds.copy(drawContribution.backupDirtyBounds).transformWithMatrix(m);
|
|
21316
|
+
}
|
|
21317
|
+
return drawContribution.renderGroup(graphic.shadowRoot, drawContext, graphic.parent.globalTransMatrix), context.highPerformanceRestore(), drawContribution.dirtyBounds && drawContribution.backupDirtyBounds && drawContribution.dirtyBounds.copy(tempDirtyBounds), !0;
|
|
21318
|
+
}
|
|
21319
|
+
}]);
|
|
21320
|
+
return ShadowRootDrawItemInterceptorContribution;
|
|
21321
|
+
}();
|
|
21322
|
+
var DebugDrawItemInterceptorContribution = /*#__PURE__*/function () {
|
|
21323
|
+
function DebugDrawItemInterceptorContribution() {
|
|
21324
|
+
_classCallCheck(this, DebugDrawItemInterceptorContribution);
|
|
21325
|
+
this.order = 1;
|
|
21326
|
+
}
|
|
21327
|
+
_createClass(DebugDrawItemInterceptorContribution, [{
|
|
21328
|
+
key: "afterDrawItem",
|
|
21329
|
+
value: function afterDrawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21330
|
+
return graphic.attribute._debug_bounds && this.drawItem(graphic, renderService, drawContext, drawContribution, params), !1;
|
|
21331
|
+
}
|
|
21332
|
+
}, {
|
|
21333
|
+
key: "drawItem",
|
|
21334
|
+
value: function drawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21335
|
+
if (!graphic.attribute._debug_bounds) return !1;
|
|
21336
|
+
var context = drawContext.context;
|
|
21337
|
+
context.highPerformanceSave(), graphic.parent && context.setTransformFromMatrix(graphic.parent.globalTransMatrix, !0), graphic.glyphHost && graphic.glyphHost.parent && context.setTransformFromMatrix(graphic.glyphHost.parent.globalTransMatrix, !0);
|
|
21338
|
+
var b = graphic.AABBBounds;
|
|
21339
|
+
return !0 !== graphic.attribute._debug_bounds && graphic.attribute._debug_bounds(context, graphic), context.strokeRect(b.x1, b.y1, b.width(), b.height()), context.highPerformanceRestore(), !0;
|
|
21340
|
+
}
|
|
21341
|
+
}]);
|
|
21342
|
+
return DebugDrawItemInterceptorContribution;
|
|
21343
|
+
}();
|
|
21344
|
+
exports.CommonDrawItemInterceptorContribution = /*#__PURE__*/function () {
|
|
21345
|
+
function CommonDrawItemInterceptorContribution() {
|
|
21346
|
+
_classCallCheck(this, CommonDrawItemInterceptorContribution);
|
|
21347
|
+
this.order = 1, this.interceptors = [new ShadowRootDrawItemInterceptorContribution(), new Canvas3DDrawItemInterceptor(), new InteractiveDrawItemInterceptorContribution(), new DebugDrawItemInterceptorContribution()];
|
|
21348
|
+
}
|
|
21349
|
+
_createClass(CommonDrawItemInterceptorContribution, [{
|
|
21350
|
+
key: "afterDrawItem",
|
|
21351
|
+
value: function afterDrawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21352
|
+
for (var i = 0; i < this.interceptors.length; i++) if (this.interceptors[i].afterDrawItem && this.interceptors[i].afterDrawItem(graphic, renderService, drawContext, drawContribution, params)) return !0;
|
|
21353
|
+
return !1;
|
|
21354
|
+
}
|
|
21355
|
+
}, {
|
|
21356
|
+
key: "beforeDrawItem",
|
|
21357
|
+
value: function beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21358
|
+
if ((!graphic.in3dMode || drawContext.in3dInterceptor) && !graphic.shadowRoot && !(graphic.baseGraphic || graphic.attribute.globalZIndex || graphic.interactiveGraphic)) return !1;
|
|
21359
|
+
for (var i = 0; i < this.interceptors.length; i++) if (this.interceptors[i].beforeDrawItem && this.interceptors[i].beforeDrawItem(graphic, renderService, drawContext, drawContribution, params)) return !0;
|
|
21360
|
+
return !1;
|
|
21361
|
+
}
|
|
21362
|
+
}]);
|
|
21363
|
+
return CommonDrawItemInterceptorContribution;
|
|
21364
|
+
}();
|
|
21365
|
+
exports.CommonDrawItemInterceptorContribution = __decorate$1j([injectable(), __metadata$$("design:paramtypes", [])], exports.CommonDrawItemInterceptorContribution);
|
|
21366
|
+
var InteractiveDrawItemInterceptorContribution = /*#__PURE__*/function () {
|
|
21367
|
+
function InteractiveDrawItemInterceptorContribution() {
|
|
21368
|
+
_classCallCheck(this, InteractiveDrawItemInterceptorContribution);
|
|
21369
|
+
this.order = 1;
|
|
21370
|
+
}
|
|
21371
|
+
_createClass(InteractiveDrawItemInterceptorContribution, [{
|
|
21372
|
+
key: "beforeDrawItem",
|
|
21373
|
+
value: function beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21374
|
+
return !this.processing && (graphic.baseGraphic ? this.beforeDrawInteractive(graphic, renderService, drawContext, drawContribution, params) : this.beforeSetInteractive(graphic, renderService, drawContext, drawContribution, params));
|
|
21375
|
+
}
|
|
21376
|
+
}, {
|
|
21377
|
+
key: "beforeSetInteractive",
|
|
21378
|
+
value: function beforeSetInteractive(graphic, renderService, drawContext, drawContribution, params) {
|
|
21379
|
+
var interactiveGraphic = graphic.interactiveGraphic;
|
|
21380
|
+
if (graphic.attribute.globalZIndex) {
|
|
21381
|
+
interactiveGraphic || (interactiveGraphic = graphic.clone(), graphic.interactiveGraphic = interactiveGraphic, interactiveGraphic.baseGraphic = graphic), interactiveGraphic.setAttributes({
|
|
21382
|
+
globalZIndex: 0,
|
|
21383
|
+
zIndex: graphic.attribute.globalZIndex
|
|
21384
|
+
}, !1, {
|
|
21385
|
+
skipUpdateCallback: !0
|
|
21386
|
+
}), drawContext.stage.tryInitInteractiveLayer();
|
|
21387
|
+
var interactiveLayer = drawContext.stage.getLayer("_builtin_interactive");
|
|
21388
|
+
if (interactiveLayer) {
|
|
21389
|
+
this.getShadowRoot(interactiveLayer).add(interactiveGraphic);
|
|
21390
|
+
}
|
|
21391
|
+
return !0;
|
|
21392
|
+
}
|
|
21393
|
+
if (interactiveGraphic) {
|
|
21394
|
+
drawContext.stage.tryInitInteractiveLayer();
|
|
21395
|
+
var _interactiveLayer = drawContext.stage.getLayer("_builtin_interactive");
|
|
21396
|
+
if (_interactiveLayer) {
|
|
21397
|
+
this.getShadowRoot(_interactiveLayer).removeChild(interactiveGraphic);
|
|
21398
|
+
}
|
|
21399
|
+
graphic.interactiveGraphic = null, interactiveGraphic.baseGraphic = null;
|
|
21400
|
+
}
|
|
21401
|
+
return !1;
|
|
21402
|
+
}
|
|
21403
|
+
}, {
|
|
21404
|
+
key: "beforeDrawInteractive",
|
|
21405
|
+
value: function beforeDrawInteractive(graphic, renderService, drawContext, drawContribution, params) {
|
|
21406
|
+
var baseGraphic = graphic.baseGraphic;
|
|
21407
|
+
if (baseGraphic) {
|
|
21408
|
+
this.processing = !0;
|
|
21409
|
+
var context = drawContext.context;
|
|
21410
|
+
return context.highPerformanceSave(), context.setTransformFromMatrix(baseGraphic.parent.globalTransMatrix, !0), baseGraphic.isContainer ? drawContribution.renderGroup(baseGraphic, drawContext, baseGraphic.parent.globalTransMatrix) : drawContribution.renderItem(baseGraphic, drawContext), context.highPerformanceRestore(), this.processing = !1, !0;
|
|
21411
|
+
}
|
|
21412
|
+
return !1;
|
|
21413
|
+
}
|
|
21414
|
+
}, {
|
|
21415
|
+
key: "getShadowRoot",
|
|
21416
|
+
value: function getShadowRoot(interactiveLayer) {
|
|
21417
|
+
var _a;
|
|
21418
|
+
var group = interactiveLayer.getElementById("_interactive_group");
|
|
21419
|
+
return group || (group = graphicCreator.CreateGraphic("group", {}), group.id = "_interactive_group", interactiveLayer.add(group)), null !== (_a = group.shadowRoot) && void 0 !== _a ? _a : group.attachShadow();
|
|
21420
|
+
}
|
|
21421
|
+
}]);
|
|
21422
|
+
return InteractiveDrawItemInterceptorContribution;
|
|
21423
|
+
}();
|
|
21424
|
+
var Canvas3DDrawItemInterceptor = /*#__PURE__*/function () {
|
|
21425
|
+
function Canvas3DDrawItemInterceptor() {
|
|
21426
|
+
_classCallCheck(this, Canvas3DDrawItemInterceptor);
|
|
21427
|
+
this.order = 1;
|
|
21428
|
+
}
|
|
21429
|
+
_createClass(Canvas3DDrawItemInterceptor, [{
|
|
21430
|
+
key: "beforeDrawItem",
|
|
21431
|
+
value: function beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21432
|
+
if (!graphic.in3dMode || drawContext.in3dInterceptor) return !1;
|
|
21433
|
+
drawContext.in3dInterceptor = !0;
|
|
21434
|
+
var _renderService$drawPa = renderService.drawParams,
|
|
21435
|
+
context = _renderService$drawPa.context,
|
|
21436
|
+
stage = _renderService$drawPa.stage;
|
|
21437
|
+
context.canvas;
|
|
21438
|
+
context.save(), this.initCanvasCtx(context), context.camera = stage.camera;
|
|
21439
|
+
var m = context.currentMatrix;
|
|
21440
|
+
m.a /= context.dpr, m.b /= context.dpr, m.c /= context.dpr, m.d /= context.dpr, m.e /= context.dpr, m.f /= context.dpr;
|
|
21441
|
+
var matrix = mat4Allocate.allocate();
|
|
21442
|
+
mat3Tomat4(matrix, m);
|
|
21443
|
+
var lastModelMatrix = context.modelMatrix;
|
|
21444
|
+
if (lastModelMatrix) {
|
|
21445
|
+
if (matrix) {
|
|
21446
|
+
var _m = mat4Allocate.allocate();
|
|
21447
|
+
context.modelMatrix = multiplyMat4Mat4(_m, lastModelMatrix, matrix);
|
|
21448
|
+
}
|
|
21449
|
+
} else context.modelMatrix = matrix;
|
|
21450
|
+
if (context.setTransform(1, 0, 0, 1, 0, 0, !0), graphic.isContainer) {
|
|
21451
|
+
var isPie = !1,
|
|
21452
|
+
is3d = !1;
|
|
21453
|
+
if (graphic.forEachChildren(function (c) {
|
|
21454
|
+
return isPie = c.numberType === ARC3D_NUMBER_TYPE, !isPie;
|
|
21455
|
+
}), graphic.forEachChildren(function (c) {
|
|
21456
|
+
return is3d = !!c.findFace, !is3d;
|
|
21457
|
+
}), isPie) {
|
|
21458
|
+
var children = graphic.getChildren(),
|
|
21459
|
+
sortedChildren = _toConsumableArray(children);
|
|
21460
|
+
sortedChildren.sort(function (a, b) {
|
|
21461
|
+
var _a, _b, _c, _d;
|
|
21462
|
+
var angle1 = ((null !== (_a = a.attribute.startAngle) && void 0 !== _a ? _a : 0) + (null !== (_b = a.attribute.endAngle) && void 0 !== _b ? _b : 0)) / 2,
|
|
21463
|
+
angle2 = ((null !== (_c = b.attribute.startAngle) && void 0 !== _c ? _c : 0) + (null !== (_d = b.attribute.endAngle) && void 0 !== _d ? _d : 0)) / 2;
|
|
21464
|
+
for (; angle1 < 0;) angle1 += pi2;
|
|
21465
|
+
for (; angle2 < 0;) angle2 += pi2;
|
|
21466
|
+
return angle2 - angle1;
|
|
21467
|
+
}), sortedChildren.forEach(function (c) {
|
|
21468
|
+
c._next = null, c._prev = null;
|
|
21469
|
+
}), graphic.removeAllChild(), graphic.update(), sortedChildren.forEach(function (c) {
|
|
21470
|
+
graphic.appendChild(c);
|
|
21471
|
+
});
|
|
21472
|
+
var _m2 = graphic.parent.globalTransMatrix;
|
|
21473
|
+
drawContext.hack_pieFace = "outside", drawContribution.renderGroup(graphic, drawContext, _m2), drawContext.hack_pieFace = "inside", drawContribution.renderGroup(graphic, drawContext, _m2), drawContext.hack_pieFace = "top", drawContribution.renderGroup(graphic, drawContext, _m2), graphic.removeAllChild(), children.forEach(function (c) {
|
|
21474
|
+
c._next = null, c._prev = null;
|
|
21475
|
+
}), children.forEach(function (c) {
|
|
21476
|
+
graphic.appendChild(c);
|
|
21477
|
+
});
|
|
21478
|
+
} else if (is3d) {
|
|
21479
|
+
var _children = graphic.getChildren(),
|
|
21480
|
+
zChildren = _children.map(function (g) {
|
|
21481
|
+
return {
|
|
21482
|
+
ave_z: g.findFace().vertices.map(function (v) {
|
|
21483
|
+
var _a;
|
|
21484
|
+
return context.view(v[0], v[1], null !== (_a = v[2] + g.attribute.z) && void 0 !== _a ? _a : 0)[2];
|
|
21485
|
+
}).reduce(function (a, b) {
|
|
21486
|
+
return a + b;
|
|
21487
|
+
}, 0),
|
|
21488
|
+
g: g
|
|
21489
|
+
};
|
|
21490
|
+
});
|
|
21491
|
+
zChildren.sort(function (a, b) {
|
|
21492
|
+
return b.ave_z - a.ave_z;
|
|
21493
|
+
}), graphic.removeAllChild(), zChildren.forEach(function (i) {
|
|
21494
|
+
i.g._next = null, i.g._prev = null;
|
|
21495
|
+
}), graphic.update(), zChildren.forEach(function (i) {
|
|
21496
|
+
graphic.add(i.g);
|
|
21497
|
+
}), drawContribution.renderGroup(graphic, drawContext, graphic.parent.globalTransMatrix, !0), graphic.removeAllChild(), _children.forEach(function (g) {
|
|
21498
|
+
g._next = null, g._prev = null;
|
|
21499
|
+
}), graphic.update(), _children.forEach(function (g) {
|
|
21500
|
+
graphic.add(g);
|
|
21501
|
+
});
|
|
21502
|
+
} else drawContribution.renderGroup(graphic, drawContext, graphic.parent.globalTransMatrix);
|
|
21503
|
+
} else drawContribution.renderItem(graphic, drawContext);
|
|
21504
|
+
return context.camera = null, context.restore(), context.modelMatrix !== lastModelMatrix && mat4Allocate.free(context.modelMatrix), context.modelMatrix = lastModelMatrix, drawContext.in3dInterceptor = !1, !0;
|
|
21505
|
+
}
|
|
21506
|
+
}, {
|
|
21507
|
+
key: "initCanvasCtx",
|
|
21508
|
+
value: function initCanvasCtx(context) {
|
|
21509
|
+
context.setTransformForCurrent();
|
|
21510
|
+
}
|
|
21511
|
+
}]);
|
|
21512
|
+
return Canvas3DDrawItemInterceptor;
|
|
21513
|
+
}();
|
|
21514
|
+
|
|
21515
|
+
var __decorate$1i = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
21516
|
+
var d,
|
|
21517
|
+
c = arguments.length,
|
|
21518
|
+
r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
|
|
21519
|
+
if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
|
|
21520
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
21521
|
+
},
|
|
21522
|
+
__metadata$_ = undefined && undefined.__metadata || function (k, v) {
|
|
21523
|
+
if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
21234
21524
|
},
|
|
21235
21525
|
__param$E = undefined && undefined.__param || function (paramIndex, decorator) {
|
|
21236
21526
|
return function (target, key) {
|
|
@@ -21289,7 +21579,7 @@
|
|
|
21289
21579
|
}]);
|
|
21290
21580
|
return DefaultRenderService;
|
|
21291
21581
|
}();
|
|
21292
|
-
exports.DefaultRenderService = __decorate$
|
|
21582
|
+
exports.DefaultRenderService = __decorate$1i([injectable(), __param$E(0, inject(DrawContribution)), __metadata$_("design:paramtypes", [Object])], exports.DefaultRenderService);
|
|
21293
21583
|
|
|
21294
21584
|
var renderModule$1 = new ContainerModule(function (bind) {
|
|
21295
21585
|
bind(RenderService).to(exports.DefaultRenderService).inSingletonScope();
|
|
@@ -21300,7 +21590,7 @@
|
|
|
21300
21590
|
var BoundsPicker = Symbol["for"]("BoundsPicker");
|
|
21301
21591
|
var GlobalPickerService = Symbol["for"]("GlobalPickerService");
|
|
21302
21592
|
|
|
21303
|
-
var __decorate$
|
|
21593
|
+
var __decorate$1h = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
21304
21594
|
var d,
|
|
21305
21595
|
c = arguments.length,
|
|
21306
21596
|
r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
|
|
@@ -21341,7 +21631,7 @@
|
|
|
21341
21631
|
}]);
|
|
21342
21632
|
return ShadowRootPickItemInterceptorContribution;
|
|
21343
21633
|
}();
|
|
21344
|
-
exports.ShadowRootPickItemInterceptorContribution = __decorate$
|
|
21634
|
+
exports.ShadowRootPickItemInterceptorContribution = __decorate$1h([injectable()], exports.ShadowRootPickItemInterceptorContribution);
|
|
21345
21635
|
exports.InteractivePickItemInterceptorContribution = /*#__PURE__*/function () {
|
|
21346
21636
|
function InteractivePickItemInterceptorContribution() {
|
|
21347
21637
|
_classCallCheck(this, InteractivePickItemInterceptorContribution);
|
|
@@ -21365,7 +21655,7 @@
|
|
|
21365
21655
|
}]);
|
|
21366
21656
|
return InteractivePickItemInterceptorContribution;
|
|
21367
21657
|
}();
|
|
21368
|
-
exports.InteractivePickItemInterceptorContribution = __decorate$
|
|
21658
|
+
exports.InteractivePickItemInterceptorContribution = __decorate$1h([injectable()], exports.InteractivePickItemInterceptorContribution);
|
|
21369
21659
|
exports.Canvas3DPickItemInterceptor = /*#__PURE__*/function () {
|
|
21370
21660
|
function Canvas3DPickItemInterceptor() {
|
|
21371
21661
|
_classCallCheck(this, Canvas3DPickItemInterceptor);
|
|
@@ -21442,7 +21732,7 @@
|
|
|
21442
21732
|
}]);
|
|
21443
21733
|
return Canvas3DPickItemInterceptor;
|
|
21444
21734
|
}();
|
|
21445
|
-
exports.Canvas3DPickItemInterceptor = __decorate$
|
|
21735
|
+
exports.Canvas3DPickItemInterceptor = __decorate$1h([injectable()], exports.Canvas3DPickItemInterceptor);
|
|
21446
21736
|
|
|
21447
21737
|
var pickModule = new ContainerModule(function (bind, unbind, isBound) {
|
|
21448
21738
|
isBound(PickerService) || (bind(GlobalPickerService).toSelf(), bind(PickerService).toService(GlobalPickerService)), bind(exports.Canvas3DPickItemInterceptor).toSelf().inSingletonScope(), bind(PickItemInterceptor).toService(exports.Canvas3DPickItemInterceptor), bind(exports.ShadowRootPickItemInterceptorContribution).toSelf().inSingletonScope(), bind(PickItemInterceptor).toService(exports.ShadowRootPickItemInterceptorContribution), bind(exports.InteractivePickItemInterceptorContribution).toSelf().inSingletonScope(), bind(PickItemInterceptor).toService(exports.InteractivePickItemInterceptorContribution), bindContributionProvider(bind, PickItemInterceptor);
|
|
@@ -21455,14 +21745,14 @@
|
|
|
21455
21745
|
var AutoEnablePlugins = Symbol["for"]("AutoEnablePlugins");
|
|
21456
21746
|
var PluginService = Symbol["for"]("PluginService");
|
|
21457
21747
|
|
|
21458
|
-
var __decorate$
|
|
21748
|
+
var __decorate$1g = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
21459
21749
|
var d,
|
|
21460
21750
|
c = arguments.length,
|
|
21461
21751
|
r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
|
|
21462
21752
|
if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
|
|
21463
21753
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
21464
21754
|
},
|
|
21465
|
-
__metadata$
|
|
21755
|
+
__metadata$Z = undefined && undefined.__metadata || function (k, v) {
|
|
21466
21756
|
if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
21467
21757
|
},
|
|
21468
21758
|
__param$D = undefined && undefined.__param || function (paramIndex, decorator) {
|
|
@@ -21518,7 +21808,7 @@
|
|
|
21518
21808
|
}]);
|
|
21519
21809
|
return DefaultPluginService;
|
|
21520
21810
|
}();
|
|
21521
|
-
DefaultPluginService = __decorate$
|
|
21811
|
+
DefaultPluginService = __decorate$1g([injectable(), __param$D(0, inject(ContributionProvider)), __param$D(0, named(AutoEnablePlugins)), __metadata$Z("design:paramtypes", [Object])], DefaultPluginService);
|
|
21522
21812
|
|
|
21523
21813
|
var pluginModule = new ContainerModule(function (bind) {
|
|
21524
21814
|
bind(PluginService).to(DefaultPluginService), bindContributionProviderNoSingletonScope(bind, AutoEnablePlugins);
|
|
@@ -21532,14 +21822,14 @@
|
|
|
21532
21822
|
bind(TextMeasureContribution).to(exports.DefaultTextMeasureContribution).inSingletonScope(), bindContributionProvider(bind, TextMeasureContribution);
|
|
21533
21823
|
});
|
|
21534
21824
|
|
|
21535
|
-
var __decorate$
|
|
21825
|
+
var __decorate$1f = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
21536
21826
|
var d,
|
|
21537
21827
|
c = arguments.length,
|
|
21538
21828
|
r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
|
|
21539
21829
|
if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
|
|
21540
21830
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
21541
21831
|
},
|
|
21542
|
-
__metadata$
|
|
21832
|
+
__metadata$Y = undefined && undefined.__metadata || function (k, v) {
|
|
21543
21833
|
if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
21544
21834
|
};
|
|
21545
21835
|
var CanvasLayerHandlerContribution = /*#__PURE__*/function () {
|
|
@@ -21633,16 +21923,16 @@
|
|
|
21633
21923
|
}]);
|
|
21634
21924
|
return CanvasLayerHandlerContribution;
|
|
21635
21925
|
}();
|
|
21636
|
-
CanvasLayerHandlerContribution = __decorate$
|
|
21926
|
+
CanvasLayerHandlerContribution = __decorate$1f([injectable(), __metadata$Y("design:paramtypes", [])], CanvasLayerHandlerContribution);
|
|
21637
21927
|
|
|
21638
|
-
var __decorate$
|
|
21928
|
+
var __decorate$1e = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
21639
21929
|
var d,
|
|
21640
21930
|
c = arguments.length,
|
|
21641
21931
|
r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
|
|
21642
21932
|
if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
|
|
21643
21933
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
21644
21934
|
},
|
|
21645
|
-
__metadata$
|
|
21935
|
+
__metadata$X = undefined && undefined.__metadata || function (k, v) {
|
|
21646
21936
|
if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
21647
21937
|
};
|
|
21648
21938
|
var EmptyLayerHandlerContribution = /*#__PURE__*/function () {
|
|
@@ -21700,16 +21990,16 @@
|
|
|
21700
21990
|
}]);
|
|
21701
21991
|
return EmptyLayerHandlerContribution;
|
|
21702
21992
|
}();
|
|
21703
|
-
EmptyLayerHandlerContribution = __decorate$
|
|
21993
|
+
EmptyLayerHandlerContribution = __decorate$1e([injectable(), __metadata$X("design:paramtypes", [])], EmptyLayerHandlerContribution);
|
|
21704
21994
|
|
|
21705
|
-
var __decorate$
|
|
21995
|
+
var __decorate$1d = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
21706
21996
|
var d,
|
|
21707
21997
|
c = arguments.length,
|
|
21708
21998
|
r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
|
|
21709
21999
|
if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
|
|
21710
22000
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
21711
22001
|
},
|
|
21712
|
-
__metadata$
|
|
22002
|
+
__metadata$W = undefined && undefined.__metadata || function (k, v) {
|
|
21713
22003
|
if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
21714
22004
|
};
|
|
21715
22005
|
var OffscreenLayerHandlerContribution = /*#__PURE__*/function () {
|
|
@@ -21796,7 +22086,7 @@
|
|
|
21796
22086
|
}]);
|
|
21797
22087
|
return OffscreenLayerHandlerContribution;
|
|
21798
22088
|
}();
|
|
21799
|
-
OffscreenLayerHandlerContribution = __decorate$
|
|
22089
|
+
OffscreenLayerHandlerContribution = __decorate$1d([injectable(), __metadata$W("design:paramtypes", [])], OffscreenLayerHandlerContribution);
|
|
21800
22090
|
|
|
21801
22091
|
var layerHandlerModules = new ContainerModule(function (bind) {
|
|
21802
22092
|
bind(CanvasLayerHandlerContribution).toSelf(), bind(OffscreenLayerHandlerContribution).toSelf(), bind(EmptyLayerHandlerContribution).toSelf(), bind(StaticLayerHandlerContribution).toService(CanvasLayerHandlerContribution), bind(DynamicLayerHandlerContribution).toService(OffscreenLayerHandlerContribution), bind(VirtualLayerHandlerContribution).toService(EmptyLayerHandlerContribution);
|
|
@@ -21923,241 +22213,6 @@
|
|
|
21923
22213
|
return result;
|
|
21924
22214
|
}
|
|
21925
22215
|
|
|
21926
|
-
var __decorate$1d = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
21927
|
-
var d,
|
|
21928
|
-
c = arguments.length,
|
|
21929
|
-
r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
|
|
21930
|
-
if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
|
|
21931
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
21932
|
-
},
|
|
21933
|
-
__metadata$W = undefined && undefined.__metadata || function (k, v) {
|
|
21934
|
-
if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
21935
|
-
};
|
|
21936
|
-
var DrawItemInterceptor = Symbol["for"]("DrawItemInterceptor");
|
|
21937
|
-
var tempDirtyBounds = new AABBBounds();
|
|
21938
|
-
var ShadowRootDrawItemInterceptorContribution = /*#__PURE__*/function () {
|
|
21939
|
-
function ShadowRootDrawItemInterceptorContribution() {
|
|
21940
|
-
_classCallCheck(this, ShadowRootDrawItemInterceptorContribution);
|
|
21941
|
-
this.order = 1;
|
|
21942
|
-
}
|
|
21943
|
-
_createClass(ShadowRootDrawItemInterceptorContribution, [{
|
|
21944
|
-
key: "afterDrawItem",
|
|
21945
|
-
value: function afterDrawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21946
|
-
return (graphic.attribute.shadowRootIdx > 0 || !graphic.attribute.shadowRootIdx) && this.drawItem(graphic, renderService, drawContext, drawContribution, params), !1;
|
|
21947
|
-
}
|
|
21948
|
-
}, {
|
|
21949
|
-
key: "beforeDrawItem",
|
|
21950
|
-
value: function beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21951
|
-
return graphic.attribute.shadowRootIdx < 0 && this.drawItem(graphic, renderService, drawContext, drawContribution, params), !1;
|
|
21952
|
-
}
|
|
21953
|
-
}, {
|
|
21954
|
-
key: "drawItem",
|
|
21955
|
-
value: function drawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21956
|
-
if (!graphic.shadowRoot) return !1;
|
|
21957
|
-
var context = drawContext.context;
|
|
21958
|
-
if (context.highPerformanceSave(), context.transformFromMatrix(graphic.transMatrix, !0), drawContribution.dirtyBounds && drawContribution.backupDirtyBounds) {
|
|
21959
|
-
tempDirtyBounds.copy(drawContribution.dirtyBounds);
|
|
21960
|
-
var m = graphic.globalTransMatrix.getInverse();
|
|
21961
|
-
drawContribution.dirtyBounds.copy(drawContribution.backupDirtyBounds).transformWithMatrix(m);
|
|
21962
|
-
}
|
|
21963
|
-
return drawContribution.renderGroup(graphic.shadowRoot, drawContext, graphic.parent.globalTransMatrix), context.highPerformanceRestore(), drawContribution.dirtyBounds && drawContribution.backupDirtyBounds && drawContribution.dirtyBounds.copy(tempDirtyBounds), !0;
|
|
21964
|
-
}
|
|
21965
|
-
}]);
|
|
21966
|
-
return ShadowRootDrawItemInterceptorContribution;
|
|
21967
|
-
}();
|
|
21968
|
-
var DebugDrawItemInterceptorContribution = /*#__PURE__*/function () {
|
|
21969
|
-
function DebugDrawItemInterceptorContribution() {
|
|
21970
|
-
_classCallCheck(this, DebugDrawItemInterceptorContribution);
|
|
21971
|
-
this.order = 1;
|
|
21972
|
-
}
|
|
21973
|
-
_createClass(DebugDrawItemInterceptorContribution, [{
|
|
21974
|
-
key: "afterDrawItem",
|
|
21975
|
-
value: function afterDrawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21976
|
-
return graphic.attribute._debug_bounds && this.drawItem(graphic, renderService, drawContext, drawContribution, params), !1;
|
|
21977
|
-
}
|
|
21978
|
-
}, {
|
|
21979
|
-
key: "drawItem",
|
|
21980
|
-
value: function drawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21981
|
-
if (!graphic.attribute._debug_bounds) return !1;
|
|
21982
|
-
var context = drawContext.context;
|
|
21983
|
-
context.highPerformanceSave(), graphic.parent && context.setTransformFromMatrix(graphic.parent.globalTransMatrix, !0), graphic.glyphHost && graphic.glyphHost.parent && context.setTransformFromMatrix(graphic.glyphHost.parent.globalTransMatrix, !0);
|
|
21984
|
-
var b = graphic.AABBBounds;
|
|
21985
|
-
return !0 !== graphic.attribute._debug_bounds && graphic.attribute._debug_bounds(context, graphic), context.strokeRect(b.x1, b.y1, b.width(), b.height()), context.highPerformanceRestore(), !0;
|
|
21986
|
-
}
|
|
21987
|
-
}]);
|
|
21988
|
-
return DebugDrawItemInterceptorContribution;
|
|
21989
|
-
}();
|
|
21990
|
-
var CommonDrawItemInterceptorContribution = /*#__PURE__*/function () {
|
|
21991
|
-
function CommonDrawItemInterceptorContribution() {
|
|
21992
|
-
_classCallCheck(this, CommonDrawItemInterceptorContribution);
|
|
21993
|
-
this.order = 1, this.interceptors = [new ShadowRootDrawItemInterceptorContribution(), new Canvas3DDrawItemInterceptor(), new InteractiveDrawItemInterceptorContribution(), new DebugDrawItemInterceptorContribution()];
|
|
21994
|
-
}
|
|
21995
|
-
_createClass(CommonDrawItemInterceptorContribution, [{
|
|
21996
|
-
key: "afterDrawItem",
|
|
21997
|
-
value: function afterDrawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21998
|
-
for (var i = 0; i < this.interceptors.length; i++) if (this.interceptors[i].afterDrawItem && this.interceptors[i].afterDrawItem(graphic, renderService, drawContext, drawContribution, params)) return !0;
|
|
21999
|
-
return !1;
|
|
22000
|
-
}
|
|
22001
|
-
}, {
|
|
22002
|
-
key: "beforeDrawItem",
|
|
22003
|
-
value: function beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
22004
|
-
if ((!graphic.in3dMode || drawContext.in3dInterceptor) && !graphic.shadowRoot && !(graphic.baseGraphic || graphic.attribute.globalZIndex || graphic.interactiveGraphic)) return !1;
|
|
22005
|
-
for (var i = 0; i < this.interceptors.length; i++) if (this.interceptors[i].beforeDrawItem && this.interceptors[i].beforeDrawItem(graphic, renderService, drawContext, drawContribution, params)) return !0;
|
|
22006
|
-
return !1;
|
|
22007
|
-
}
|
|
22008
|
-
}]);
|
|
22009
|
-
return CommonDrawItemInterceptorContribution;
|
|
22010
|
-
}();
|
|
22011
|
-
CommonDrawItemInterceptorContribution = __decorate$1d([injectable(), __metadata$W("design:paramtypes", [])], CommonDrawItemInterceptorContribution);
|
|
22012
|
-
var InteractiveDrawItemInterceptorContribution = /*#__PURE__*/function () {
|
|
22013
|
-
function InteractiveDrawItemInterceptorContribution() {
|
|
22014
|
-
_classCallCheck(this, InteractiveDrawItemInterceptorContribution);
|
|
22015
|
-
this.order = 1;
|
|
22016
|
-
}
|
|
22017
|
-
_createClass(InteractiveDrawItemInterceptorContribution, [{
|
|
22018
|
-
key: "beforeDrawItem",
|
|
22019
|
-
value: function beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
22020
|
-
return !this.processing && (graphic.baseGraphic ? this.beforeDrawInteractive(graphic, renderService, drawContext, drawContribution, params) : this.beforeSetInteractive(graphic, renderService, drawContext, drawContribution, params));
|
|
22021
|
-
}
|
|
22022
|
-
}, {
|
|
22023
|
-
key: "beforeSetInteractive",
|
|
22024
|
-
value: function beforeSetInteractive(graphic, renderService, drawContext, drawContribution, params) {
|
|
22025
|
-
var interactiveGraphic = graphic.interactiveGraphic;
|
|
22026
|
-
if (graphic.attribute.globalZIndex) {
|
|
22027
|
-
interactiveGraphic || (interactiveGraphic = graphic.clone(), graphic.interactiveGraphic = interactiveGraphic, interactiveGraphic.baseGraphic = graphic), interactiveGraphic.setAttributes({
|
|
22028
|
-
globalZIndex: 0,
|
|
22029
|
-
zIndex: graphic.attribute.globalZIndex
|
|
22030
|
-
}, !1, {
|
|
22031
|
-
skipUpdateCallback: !0
|
|
22032
|
-
}), drawContext.stage.tryInitInteractiveLayer();
|
|
22033
|
-
var interactiveLayer = drawContext.stage.getLayer("_builtin_interactive");
|
|
22034
|
-
if (interactiveLayer) {
|
|
22035
|
-
this.getShadowRoot(interactiveLayer).add(interactiveGraphic);
|
|
22036
|
-
}
|
|
22037
|
-
return !0;
|
|
22038
|
-
}
|
|
22039
|
-
if (interactiveGraphic) {
|
|
22040
|
-
drawContext.stage.tryInitInteractiveLayer();
|
|
22041
|
-
var _interactiveLayer = drawContext.stage.getLayer("_builtin_interactive");
|
|
22042
|
-
if (_interactiveLayer) {
|
|
22043
|
-
this.getShadowRoot(_interactiveLayer).removeChild(interactiveGraphic);
|
|
22044
|
-
}
|
|
22045
|
-
graphic.interactiveGraphic = null, interactiveGraphic.baseGraphic = null;
|
|
22046
|
-
}
|
|
22047
|
-
return !1;
|
|
22048
|
-
}
|
|
22049
|
-
}, {
|
|
22050
|
-
key: "beforeDrawInteractive",
|
|
22051
|
-
value: function beforeDrawInteractive(graphic, renderService, drawContext, drawContribution, params) {
|
|
22052
|
-
var baseGraphic = graphic.baseGraphic;
|
|
22053
|
-
if (baseGraphic) {
|
|
22054
|
-
this.processing = !0;
|
|
22055
|
-
var context = drawContext.context;
|
|
22056
|
-
return context.highPerformanceSave(), context.setTransformFromMatrix(baseGraphic.parent.globalTransMatrix, !0), baseGraphic.isContainer ? drawContribution.renderGroup(baseGraphic, drawContext, baseGraphic.parent.globalTransMatrix) : drawContribution.renderItem(baseGraphic, drawContext), context.highPerformanceRestore(), this.processing = !1, !0;
|
|
22057
|
-
}
|
|
22058
|
-
return !1;
|
|
22059
|
-
}
|
|
22060
|
-
}, {
|
|
22061
|
-
key: "getShadowRoot",
|
|
22062
|
-
value: function getShadowRoot(interactiveLayer) {
|
|
22063
|
-
var _a;
|
|
22064
|
-
var group = interactiveLayer.getElementById("_interactive_group");
|
|
22065
|
-
return group || (group = graphicCreator.CreateGraphic("group", {}), group.id = "_interactive_group", interactiveLayer.add(group)), null !== (_a = group.shadowRoot) && void 0 !== _a ? _a : group.attachShadow();
|
|
22066
|
-
}
|
|
22067
|
-
}]);
|
|
22068
|
-
return InteractiveDrawItemInterceptorContribution;
|
|
22069
|
-
}();
|
|
22070
|
-
var Canvas3DDrawItemInterceptor = /*#__PURE__*/function () {
|
|
22071
|
-
function Canvas3DDrawItemInterceptor() {
|
|
22072
|
-
_classCallCheck(this, Canvas3DDrawItemInterceptor);
|
|
22073
|
-
this.order = 1;
|
|
22074
|
-
}
|
|
22075
|
-
_createClass(Canvas3DDrawItemInterceptor, [{
|
|
22076
|
-
key: "beforeDrawItem",
|
|
22077
|
-
value: function beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
22078
|
-
if (!graphic.in3dMode || drawContext.in3dInterceptor) return !1;
|
|
22079
|
-
drawContext.in3dInterceptor = !0;
|
|
22080
|
-
var _renderService$drawPa = renderService.drawParams,
|
|
22081
|
-
context = _renderService$drawPa.context,
|
|
22082
|
-
stage = _renderService$drawPa.stage;
|
|
22083
|
-
context.canvas;
|
|
22084
|
-
context.save(), this.initCanvasCtx(context), context.camera = stage.camera;
|
|
22085
|
-
var m = context.currentMatrix;
|
|
22086
|
-
m.a /= context.dpr, m.b /= context.dpr, m.c /= context.dpr, m.d /= context.dpr, m.e /= context.dpr, m.f /= context.dpr;
|
|
22087
|
-
var matrix = mat4Allocate.allocate();
|
|
22088
|
-
mat3Tomat4(matrix, m);
|
|
22089
|
-
var lastModelMatrix = context.modelMatrix;
|
|
22090
|
-
if (lastModelMatrix) {
|
|
22091
|
-
if (matrix) {
|
|
22092
|
-
var _m = mat4Allocate.allocate();
|
|
22093
|
-
context.modelMatrix = multiplyMat4Mat4(_m, lastModelMatrix, matrix);
|
|
22094
|
-
}
|
|
22095
|
-
} else context.modelMatrix = matrix;
|
|
22096
|
-
if (context.setTransform(1, 0, 0, 1, 0, 0, !0), graphic.isContainer) {
|
|
22097
|
-
var isPie = !1,
|
|
22098
|
-
is3d = !1;
|
|
22099
|
-
if (graphic.forEachChildren(function (c) {
|
|
22100
|
-
return isPie = c.numberType === ARC3D_NUMBER_TYPE, !isPie;
|
|
22101
|
-
}), graphic.forEachChildren(function (c) {
|
|
22102
|
-
return is3d = !!c.findFace, !is3d;
|
|
22103
|
-
}), isPie) {
|
|
22104
|
-
var children = graphic.getChildren(),
|
|
22105
|
-
sortedChildren = _toConsumableArray(children);
|
|
22106
|
-
sortedChildren.sort(function (a, b) {
|
|
22107
|
-
var _a, _b, _c, _d;
|
|
22108
|
-
var angle1 = ((null !== (_a = a.attribute.startAngle) && void 0 !== _a ? _a : 0) + (null !== (_b = a.attribute.endAngle) && void 0 !== _b ? _b : 0)) / 2,
|
|
22109
|
-
angle2 = ((null !== (_c = b.attribute.startAngle) && void 0 !== _c ? _c : 0) + (null !== (_d = b.attribute.endAngle) && void 0 !== _d ? _d : 0)) / 2;
|
|
22110
|
-
for (; angle1 < 0;) angle1 += pi2;
|
|
22111
|
-
for (; angle2 < 0;) angle2 += pi2;
|
|
22112
|
-
return angle2 - angle1;
|
|
22113
|
-
}), sortedChildren.forEach(function (c) {
|
|
22114
|
-
c._next = null, c._prev = null;
|
|
22115
|
-
}), graphic.removeAllChild(), graphic.update(), sortedChildren.forEach(function (c) {
|
|
22116
|
-
graphic.appendChild(c);
|
|
22117
|
-
});
|
|
22118
|
-
var _m2 = graphic.parent.globalTransMatrix;
|
|
22119
|
-
drawContext.hack_pieFace = "outside", drawContribution.renderGroup(graphic, drawContext, _m2), drawContext.hack_pieFace = "inside", drawContribution.renderGroup(graphic, drawContext, _m2), drawContext.hack_pieFace = "top", drawContribution.renderGroup(graphic, drawContext, _m2), graphic.removeAllChild(), children.forEach(function (c) {
|
|
22120
|
-
c._next = null, c._prev = null;
|
|
22121
|
-
}), children.forEach(function (c) {
|
|
22122
|
-
graphic.appendChild(c);
|
|
22123
|
-
});
|
|
22124
|
-
} else if (is3d) {
|
|
22125
|
-
var _children = graphic.getChildren(),
|
|
22126
|
-
zChildren = _children.map(function (g) {
|
|
22127
|
-
return {
|
|
22128
|
-
ave_z: g.findFace().vertices.map(function (v) {
|
|
22129
|
-
var _a;
|
|
22130
|
-
return context.view(v[0], v[1], null !== (_a = v[2] + g.attribute.z) && void 0 !== _a ? _a : 0)[2];
|
|
22131
|
-
}).reduce(function (a, b) {
|
|
22132
|
-
return a + b;
|
|
22133
|
-
}, 0),
|
|
22134
|
-
g: g
|
|
22135
|
-
};
|
|
22136
|
-
});
|
|
22137
|
-
zChildren.sort(function (a, b) {
|
|
22138
|
-
return b.ave_z - a.ave_z;
|
|
22139
|
-
}), graphic.removeAllChild(), zChildren.forEach(function (i) {
|
|
22140
|
-
i.g._next = null, i.g._prev = null;
|
|
22141
|
-
}), graphic.update(), zChildren.forEach(function (i) {
|
|
22142
|
-
graphic.add(i.g);
|
|
22143
|
-
}), drawContribution.renderGroup(graphic, drawContext, graphic.parent.globalTransMatrix, !0), graphic.removeAllChild(), _children.forEach(function (g) {
|
|
22144
|
-
g._next = null, g._prev = null;
|
|
22145
|
-
}), graphic.update(), _children.forEach(function (g) {
|
|
22146
|
-
graphic.add(g);
|
|
22147
|
-
});
|
|
22148
|
-
} else drawContribution.renderGroup(graphic, drawContext, graphic.parent.globalTransMatrix);
|
|
22149
|
-
} else drawContribution.renderItem(graphic, drawContext);
|
|
22150
|
-
return context.camera = null, context.restore(), context.modelMatrix !== lastModelMatrix && mat4Allocate.free(context.modelMatrix), context.modelMatrix = lastModelMatrix, drawContext.in3dInterceptor = !1, !0;
|
|
22151
|
-
}
|
|
22152
|
-
}, {
|
|
22153
|
-
key: "initCanvasCtx",
|
|
22154
|
-
value: function initCanvasCtx(context) {
|
|
22155
|
-
context.setTransformForCurrent();
|
|
22156
|
-
}
|
|
22157
|
-
}]);
|
|
22158
|
-
return Canvas3DDrawItemInterceptor;
|
|
22159
|
-
}();
|
|
22160
|
-
|
|
22161
22216
|
var __decorate$1c = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
22162
22217
|
var d,
|
|
22163
22218
|
c = arguments.length,
|
|
@@ -22991,7 +23046,7 @@
|
|
|
22991
23046
|
DefaultIncrementalDrawContribution = __decorate$18([injectable(), __param$A(0, multiInject(GraphicRender)), __param$A(1, inject(DefaultIncrementalCanvasLineRender)), __param$A(2, inject(DefaultIncrementalCanvasAreaRender)), __param$A(3, inject(ContributionProvider)), __param$A(3, named(DrawItemInterceptor)), __metadata$T("design:paramtypes", [Array, Object, Object, Object])], DefaultIncrementalDrawContribution);
|
|
22992
23047
|
|
|
22993
23048
|
var renderModule = new ContainerModule(function (bind) {
|
|
22994
|
-
bind(DefaultBaseBackgroundRenderContribution).toSelf().inSingletonScope(), bind(DefaultBaseTextureRenderContribution).toSelf().inSingletonScope(), bind(DrawContribution).to(DefaultDrawContribution), bind(IncrementalDrawContribution).to(DefaultIncrementalDrawContribution), bind(GroupRender).to(DefaultCanvasGroupRender).inSingletonScope(), bind(GraphicRender).toService(GroupRender), bindContributionProvider(bind, GroupRenderContribution), bind(exports.DefaultBaseInteractiveRenderContribution).toSelf().inSingletonScope(), bindContributionProvider(bind, InteractiveSubRenderContribution), bindContributionProvider(bind, GraphicRender), bind(CommonDrawItemInterceptorContribution).toSelf().inSingletonScope(), bind(DrawItemInterceptor).toService(CommonDrawItemInterceptorContribution), bindContributionProvider(bind, DrawItemInterceptor);
|
|
23049
|
+
bind(DefaultBaseBackgroundRenderContribution).toSelf().inSingletonScope(), bind(DefaultBaseTextureRenderContribution).toSelf().inSingletonScope(), bind(DrawContribution).to(DefaultDrawContribution), bind(IncrementalDrawContribution).to(DefaultIncrementalDrawContribution), bind(GroupRender).to(DefaultCanvasGroupRender).inSingletonScope(), bind(GraphicRender).toService(GroupRender), bindContributionProvider(bind, GroupRenderContribution), bind(exports.DefaultBaseInteractiveRenderContribution).toSelf().inSingletonScope(), bindContributionProvider(bind, InteractiveSubRenderContribution), bindContributionProvider(bind, GraphicRender), bind(exports.CommonDrawItemInterceptorContribution).toSelf().inSingletonScope(), bind(DrawItemInterceptor).toService(exports.CommonDrawItemInterceptorContribution), bindContributionProvider(bind, DrawItemInterceptor);
|
|
22995
23050
|
});
|
|
22996
23051
|
|
|
22997
23052
|
function load(container) {
|
|
@@ -34793,7 +34848,7 @@
|
|
|
34793
34848
|
|
|
34794
34849
|
var roughModule = _roughModule;
|
|
34795
34850
|
|
|
34796
|
-
const version = "0.17.
|
|
34851
|
+
const version = "0.17.18-alpha.1";
|
|
34797
34852
|
preLoadAllModule();
|
|
34798
34853
|
if (isBrowserEnv()) {
|
|
34799
34854
|
loadBrowserEnv(container);
|
|
@@ -34844,6 +34899,7 @@
|
|
|
34844
34899
|
exports.BoundsContext = BoundsContext;
|
|
34845
34900
|
exports.BoundsPicker = BoundsPicker;
|
|
34846
34901
|
exports.CIRCLE_NUMBER_TYPE = CIRCLE_NUMBER_TYPE;
|
|
34902
|
+
exports.Canvas3DDrawItemInterceptor = Canvas3DDrawItemInterceptor;
|
|
34847
34903
|
exports.CanvasFactory = CanvasFactory;
|
|
34848
34904
|
exports.CanvasTextLayout = CanvasTextLayout;
|
|
34849
34905
|
exports.CbAnimate = CbAnimate;
|
|
@@ -34865,6 +34921,7 @@
|
|
|
34865
34921
|
exports.CustomEvent = CustomEvent;
|
|
34866
34922
|
exports.CustomPath2D = CustomPath2D;
|
|
34867
34923
|
exports.CustomSymbolClass = CustomSymbolClass;
|
|
34924
|
+
exports.DebugDrawItemInterceptorContribution = DebugDrawItemInterceptorContribution;
|
|
34868
34925
|
exports.DefaultArcAllocate = DefaultArcAllocate;
|
|
34869
34926
|
exports.DefaultArcAttribute = DefaultArcAttribute;
|
|
34870
34927
|
exports.DefaultArcRenderContribution = DefaultArcRenderContribution;
|
|
@@ -34918,6 +34975,7 @@
|
|
|
34918
34975
|
exports.DefaultTransform = DefaultTransform;
|
|
34919
34976
|
exports.DragNDrop = DragNDrop;
|
|
34920
34977
|
exports.DrawContribution = DrawContribution;
|
|
34978
|
+
exports.DrawItemInterceptor = DrawItemInterceptor;
|
|
34921
34979
|
exports.DynamicLayerHandlerContribution = DynamicLayerHandlerContribution;
|
|
34922
34980
|
exports.EnvContribution = EnvContribution;
|
|
34923
34981
|
exports.EventManager = EventManager;
|
|
@@ -34956,6 +35014,7 @@
|
|
|
34956
35014
|
exports.IncreaseCount = IncreaseCount;
|
|
34957
35015
|
exports.IncrementalDrawContribution = IncrementalDrawContribution;
|
|
34958
35016
|
exports.InputText = InputText;
|
|
35017
|
+
exports.InteractiveDrawItemInterceptorContribution = InteractiveDrawItemInterceptorContribution;
|
|
34959
35018
|
exports.InteractiveSubRenderContribution = InteractiveSubRenderContribution;
|
|
34960
35019
|
exports.LINE_NUMBER_TYPE = LINE_NUMBER_TYPE;
|
|
34961
35020
|
exports.Layer = Layer;
|
|
@@ -35017,6 +35076,7 @@
|
|
|
35017
35076
|
exports.SYMBOL_NUMBER_TYPE = SYMBOL_NUMBER_TYPE;
|
|
35018
35077
|
exports.SegContext = SegContext;
|
|
35019
35078
|
exports.ShadowRoot = ShadowRoot;
|
|
35079
|
+
exports.ShadowRootDrawItemInterceptorContribution = ShadowRootDrawItemInterceptorContribution;
|
|
35020
35080
|
exports.Stage = Stage;
|
|
35021
35081
|
exports.StaticLayerHandlerContribution = StaticLayerHandlerContribution;
|
|
35022
35082
|
exports.Step = Step$1;
|