@visactor/vrender 0.17.19-alpha.1 → 0.17.19

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/dist/index.js CHANGED
@@ -6977,10 +6977,7 @@
6977
6977
  value: function removeAllChild() {
6978
6978
  if (!this._idMap) return;
6979
6979
  var child = this._firstChild;
6980
- for (; child;) {
6981
- var next = child._next;
6982
- child.parent = null, child._prev = null, child._next = null, child = next;
6983
- }
6980
+ for (; child;) child.parent = null, child._prev = null, child._next = null, child = child._next;
6984
6981
  this._firstChild = null, this._lastChild = null, this._idMap.clear(), this._structEdit = !0, this.setCount(1 - this._count);
6985
6982
  }
6986
6983
  }, {
@@ -11364,7 +11361,15 @@
11364
11361
  var data = ResourceLoader.cache.get(url);
11365
11362
  data ? "fail" === data.loadState ? application.global.getRequestAnimationFrame()(function () {
11366
11363
  mark.imageLoadFail(url);
11367
- }) : "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);
11364
+ }) : "init" === data.loadState || "loading" === data.loadState ? null === (_a = data.waitingMark) || void 0 === _a || _a.push(mark) : mark && mark.imageLoadSuccess(url, data.data) : (data = {
11365
+ type: "image",
11366
+ loadState: "init"
11367
+ }, ResourceLoader.cache.set(url, data), data.dataPromise = application.global.loadImage(url), data.dataPromise ? (data.waitingMark = [mark], data.dataPromise.then(function (res) {
11368
+ var _a;
11369
+ 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) {
11370
+ (null == res ? void 0 : res.data) ? (data.loadState = "success", data.data = res.data, mark.imageLoadSuccess(url, res.data)) : (data.loadState = "fail", mark.imageLoadFail(url));
11371
+ });
11372
+ })) : (data.loadState = "fail", mark.imageLoadFail(url)));
11368
11373
  }
11369
11374
  }, {
11370
11375
  key: "GetSvg",
@@ -11398,68 +11403,10 @@
11398
11403
  return data.data;
11399
11404
  }));
11400
11405
  }
11401
- }, {
11402
- key: "loading",
11403
- value: function loading() {
11404
- setTimeout(function () {
11405
- if (!ResourceLoader.isLoading && ResourceLoader.toLoadAueue.length) {
11406
- ResourceLoader.isLoading = !0;
11407
- var tasks = ResourceLoader.toLoadAueue.splice(0, 10),
11408
- promises = [];
11409
- tasks.forEach(function (task) {
11410
- var url = task.url,
11411
- marks = task.marks,
11412
- data = {
11413
- type: "image",
11414
- loadState: "init"
11415
- };
11416
- if (ResourceLoader.cache.set(url, data), data.dataPromise = application.global.loadImage(url), data.dataPromise) {
11417
- data.waitingMark = marks;
11418
- var end = data.dataPromise.then(function (res) {
11419
- var _a;
11420
- 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) {
11421
- (null == res ? void 0 : res.data) ? (data.loadState = "success", data.data = res.data, mark.imageLoadSuccess(url, res.data)) : (data.loadState = "fail", mark.imageLoadFail(url));
11422
- });
11423
- });
11424
- promises.push(end);
11425
- } else data.loadState = "fail", marks.forEach(function (mark) {
11426
- return mark.imageLoadFail(url);
11427
- });
11428
- }), Promise.all(promises).then(function () {
11429
- ResourceLoader.isLoading = !1, ResourceLoader.loading();
11430
- })["catch"](function (error) {
11431
- console.error(error), ResourceLoader.isLoading = !1, ResourceLoader.loading();
11432
- });
11433
- }
11434
- }, 0);
11435
- }
11436
- }, {
11437
- key: "loadImage",
11438
- value: function loadImage(url, mark) {
11439
- var index = getIndex(url, ResourceLoader.toLoadAueue);
11440
- if (-1 !== index) return ResourceLoader.toLoadAueue[index].marks.push(mark), void ResourceLoader.loading();
11441
- ResourceLoader.toLoadAueue.push({
11442
- url: url,
11443
- marks: [mark]
11444
- }), ResourceLoader.loading();
11445
- }
11446
- }, {
11447
- key: "improveImageLoading",
11448
- value: function improveImageLoading(url) {
11449
- var index = getIndex(url, ResourceLoader.toLoadAueue);
11450
- if (-1 !== index) {
11451
- var elememt = ResourceLoader.toLoadAueue.splice(index, 1);
11452
- ResourceLoader.toLoadAueue.unshift(elememt[0]);
11453
- }
11454
- }
11455
11406
  }]);
11456
11407
  return ResourceLoader;
11457
11408
  }();
11458
- function getIndex(url, arr) {
11459
- for (var i = 0; i < arr.length; i++) if (arr[i].url === url) return i;
11460
- return -1;
11461
- }
11462
- ResourceLoader.cache = new Map(), ResourceLoader.isLoading = !1, ResourceLoader.toLoadAueue = [];
11409
+ ResourceLoader.cache = new Map();
11463
11410
 
11464
11411
  var tempMatrix = new Matrix(),
11465
11412
  tempBounds$1 = new AABBBounds();
@@ -12245,7 +12192,7 @@
12245
12192
  data: "init",
12246
12193
  state: null
12247
12194
  };
12248
- 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
+ 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);
12249
12196
  }
12250
12197
  }, {
12251
12198
  key: "imageLoadSuccess",
@@ -21252,9 +21199,7 @@
21252
21199
  value: function draw(image, renderService, drawContext) {
21253
21200
  var url = image.attribute.image;
21254
21201
  if (!url || !image.resources) return;
21255
- var res = image.resources.get(url);
21256
- if ("loading" === res.state && isString$1(url)) return void ResourceLoader.improveImageLoading(url);
21257
- if ("success" !== res.state) return;
21202
+ if ("success" !== image.resources.get(url).state) return;
21258
21203
  var context = renderService.drawParams.context;
21259
21204
  if (!context) return;
21260
21205
  var imageAttribute = getTheme(image).image;
@@ -21295,241 +21240,6 @@
21295
21240
  },
21296
21241
  __metadata$$ = undefined && undefined.__metadata || function (k, v) {
21297
21242
  if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
21298
- };
21299
- var DrawItemInterceptor = Symbol["for"]("DrawItemInterceptor");
21300
- var tempDirtyBounds = new AABBBounds();
21301
- var ShadowRootDrawItemInterceptorContribution = /*#__PURE__*/function () {
21302
- function ShadowRootDrawItemInterceptorContribution() {
21303
- _classCallCheck(this, ShadowRootDrawItemInterceptorContribution);
21304
- this.order = 1;
21305
- }
21306
- _createClass(ShadowRootDrawItemInterceptorContribution, [{
21307
- key: "afterDrawItem",
21308
- value: function afterDrawItem(graphic, renderService, drawContext, drawContribution, params) {
21309
- return (graphic.attribute.shadowRootIdx > 0 || !graphic.attribute.shadowRootIdx) && this.drawItem(graphic, renderService, drawContext, drawContribution, params), !1;
21310
- }
21311
- }, {
21312
- key: "beforeDrawItem",
21313
- value: function beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
21314
- return graphic.attribute.shadowRootIdx < 0 && this.drawItem(graphic, renderService, drawContext, drawContribution, params), !1;
21315
- }
21316
- }, {
21317
- key: "drawItem",
21318
- value: function drawItem(graphic, renderService, drawContext, drawContribution, params) {
21319
- if (!graphic.shadowRoot) return !1;
21320
- var context = drawContext.context;
21321
- if (context.highPerformanceSave(), context.transformFromMatrix(graphic.transMatrix, !0), drawContribution.dirtyBounds && drawContribution.backupDirtyBounds) {
21322
- tempDirtyBounds.copy(drawContribution.dirtyBounds);
21323
- var m = graphic.globalTransMatrix.getInverse();
21324
- drawContribution.dirtyBounds.copy(drawContribution.backupDirtyBounds).transformWithMatrix(m);
21325
- }
21326
- return drawContribution.renderGroup(graphic.shadowRoot, drawContext, graphic.parent.globalTransMatrix), context.highPerformanceRestore(), drawContribution.dirtyBounds && drawContribution.backupDirtyBounds && drawContribution.dirtyBounds.copy(tempDirtyBounds), !0;
21327
- }
21328
- }]);
21329
- return ShadowRootDrawItemInterceptorContribution;
21330
- }();
21331
- var DebugDrawItemInterceptorContribution = /*#__PURE__*/function () {
21332
- function DebugDrawItemInterceptorContribution() {
21333
- _classCallCheck(this, DebugDrawItemInterceptorContribution);
21334
- this.order = 1;
21335
- }
21336
- _createClass(DebugDrawItemInterceptorContribution, [{
21337
- key: "afterDrawItem",
21338
- value: function afterDrawItem(graphic, renderService, drawContext, drawContribution, params) {
21339
- return graphic.attribute._debug_bounds && this.drawItem(graphic, renderService, drawContext, drawContribution, params), !1;
21340
- }
21341
- }, {
21342
- key: "drawItem",
21343
- value: function drawItem(graphic, renderService, drawContext, drawContribution, params) {
21344
- if (!graphic.attribute._debug_bounds) return !1;
21345
- var context = drawContext.context;
21346
- context.highPerformanceSave(), graphic.parent && context.setTransformFromMatrix(graphic.parent.globalTransMatrix, !0), graphic.glyphHost && graphic.glyphHost.parent && context.setTransformFromMatrix(graphic.glyphHost.parent.globalTransMatrix, !0);
21347
- var b = graphic.AABBBounds;
21348
- 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;
21349
- }
21350
- }]);
21351
- return DebugDrawItemInterceptorContribution;
21352
- }();
21353
- exports.CommonDrawItemInterceptorContribution = /*#__PURE__*/function () {
21354
- function CommonDrawItemInterceptorContribution() {
21355
- _classCallCheck(this, CommonDrawItemInterceptorContribution);
21356
- this.order = 1, this.interceptors = [new ShadowRootDrawItemInterceptorContribution(), new Canvas3DDrawItemInterceptor(), new InteractiveDrawItemInterceptorContribution(), new DebugDrawItemInterceptorContribution()];
21357
- }
21358
- _createClass(CommonDrawItemInterceptorContribution, [{
21359
- key: "afterDrawItem",
21360
- value: function afterDrawItem(graphic, renderService, drawContext, drawContribution, params) {
21361
- 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;
21362
- return !1;
21363
- }
21364
- }, {
21365
- key: "beforeDrawItem",
21366
- value: function beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
21367
- if ((!graphic.in3dMode || drawContext.in3dInterceptor) && !graphic.shadowRoot && !(graphic.baseGraphic || graphic.attribute.globalZIndex || graphic.interactiveGraphic)) return !1;
21368
- 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;
21369
- return !1;
21370
- }
21371
- }]);
21372
- return CommonDrawItemInterceptorContribution;
21373
- }();
21374
- exports.CommonDrawItemInterceptorContribution = __decorate$1j([injectable(), __metadata$$("design:paramtypes", [])], exports.CommonDrawItemInterceptorContribution);
21375
- var InteractiveDrawItemInterceptorContribution = /*#__PURE__*/function () {
21376
- function InteractiveDrawItemInterceptorContribution() {
21377
- _classCallCheck(this, InteractiveDrawItemInterceptorContribution);
21378
- this.order = 1;
21379
- }
21380
- _createClass(InteractiveDrawItemInterceptorContribution, [{
21381
- key: "beforeDrawItem",
21382
- value: function beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
21383
- return !this.processing && (graphic.baseGraphic ? this.beforeDrawInteractive(graphic, renderService, drawContext, drawContribution, params) : this.beforeSetInteractive(graphic, renderService, drawContext, drawContribution, params));
21384
- }
21385
- }, {
21386
- key: "beforeSetInteractive",
21387
- value: function beforeSetInteractive(graphic, renderService, drawContext, drawContribution, params) {
21388
- var interactiveGraphic = graphic.interactiveGraphic;
21389
- if (graphic.attribute.globalZIndex) {
21390
- interactiveGraphic || (interactiveGraphic = graphic.clone(), graphic.interactiveGraphic = interactiveGraphic, interactiveGraphic.baseGraphic = graphic), interactiveGraphic.setAttributes({
21391
- globalZIndex: 0,
21392
- zIndex: graphic.attribute.globalZIndex
21393
- }, !1, {
21394
- skipUpdateCallback: !0
21395
- }), drawContext.stage.tryInitInteractiveLayer();
21396
- var interactiveLayer = drawContext.stage.getLayer("_builtin_interactive");
21397
- if (interactiveLayer) {
21398
- this.getShadowRoot(interactiveLayer).add(interactiveGraphic);
21399
- }
21400
- return !0;
21401
- }
21402
- if (interactiveGraphic) {
21403
- drawContext.stage.tryInitInteractiveLayer();
21404
- var _interactiveLayer = drawContext.stage.getLayer("_builtin_interactive");
21405
- if (_interactiveLayer) {
21406
- this.getShadowRoot(_interactiveLayer).removeChild(interactiveGraphic);
21407
- }
21408
- graphic.interactiveGraphic = null, interactiveGraphic.baseGraphic = null;
21409
- }
21410
- return !1;
21411
- }
21412
- }, {
21413
- key: "beforeDrawInteractive",
21414
- value: function beforeDrawInteractive(graphic, renderService, drawContext, drawContribution, params) {
21415
- var baseGraphic = graphic.baseGraphic;
21416
- if (baseGraphic) {
21417
- this.processing = !0;
21418
- var context = drawContext.context;
21419
- 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;
21420
- }
21421
- return !1;
21422
- }
21423
- }, {
21424
- key: "getShadowRoot",
21425
- value: function getShadowRoot(interactiveLayer) {
21426
- var _a;
21427
- var group = interactiveLayer.getElementById("_interactive_group");
21428
- return group || (group = graphicCreator.CreateGraphic("group", {}), group.id = "_interactive_group", interactiveLayer.add(group)), null !== (_a = group.shadowRoot) && void 0 !== _a ? _a : group.attachShadow();
21429
- }
21430
- }]);
21431
- return InteractiveDrawItemInterceptorContribution;
21432
- }();
21433
- var Canvas3DDrawItemInterceptor = /*#__PURE__*/function () {
21434
- function Canvas3DDrawItemInterceptor() {
21435
- _classCallCheck(this, Canvas3DDrawItemInterceptor);
21436
- this.order = 1;
21437
- }
21438
- _createClass(Canvas3DDrawItemInterceptor, [{
21439
- key: "beforeDrawItem",
21440
- value: function beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
21441
- if (!graphic.in3dMode || drawContext.in3dInterceptor) return !1;
21442
- drawContext.in3dInterceptor = !0;
21443
- var _renderService$drawPa = renderService.drawParams,
21444
- context = _renderService$drawPa.context,
21445
- stage = _renderService$drawPa.stage;
21446
- context.canvas;
21447
- context.save(), this.initCanvasCtx(context), context.camera = stage.camera;
21448
- var m = context.currentMatrix;
21449
- m.a /= context.dpr, m.b /= context.dpr, m.c /= context.dpr, m.d /= context.dpr, m.e /= context.dpr, m.f /= context.dpr;
21450
- var matrix = mat4Allocate.allocate();
21451
- mat3Tomat4(matrix, m);
21452
- var lastModelMatrix = context.modelMatrix;
21453
- if (lastModelMatrix) {
21454
- if (matrix) {
21455
- var _m = mat4Allocate.allocate();
21456
- context.modelMatrix = multiplyMat4Mat4(_m, lastModelMatrix, matrix);
21457
- }
21458
- } else context.modelMatrix = matrix;
21459
- if (context.setTransform(1, 0, 0, 1, 0, 0, !0), graphic.isContainer) {
21460
- var isPie = !1,
21461
- is3d = !1;
21462
- if (graphic.forEachChildren(function (c) {
21463
- return isPie = c.numberType === ARC3D_NUMBER_TYPE, !isPie;
21464
- }), graphic.forEachChildren(function (c) {
21465
- return is3d = !!c.findFace, !is3d;
21466
- }), isPie) {
21467
- var children = graphic.getChildren(),
21468
- sortedChildren = _toConsumableArray(children);
21469
- sortedChildren.sort(function (a, b) {
21470
- var _a, _b, _c, _d;
21471
- var angle1 = ((null !== (_a = a.attribute.startAngle) && void 0 !== _a ? _a : 0) + (null !== (_b = a.attribute.endAngle) && void 0 !== _b ? _b : 0)) / 2,
21472
- angle2 = ((null !== (_c = b.attribute.startAngle) && void 0 !== _c ? _c : 0) + (null !== (_d = b.attribute.endAngle) && void 0 !== _d ? _d : 0)) / 2;
21473
- for (; angle1 < 0;) angle1 += pi2;
21474
- for (; angle2 < 0;) angle2 += pi2;
21475
- return angle2 - angle1;
21476
- }), sortedChildren.forEach(function (c) {
21477
- c._next = null, c._prev = null;
21478
- }), graphic.removeAllChild(), graphic.update(), sortedChildren.forEach(function (c) {
21479
- graphic.appendChild(c);
21480
- });
21481
- var _m2 = graphic.parent.globalTransMatrix;
21482
- 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) {
21483
- c._next = null, c._prev = null;
21484
- }), children.forEach(function (c) {
21485
- graphic.appendChild(c);
21486
- });
21487
- } else if (is3d) {
21488
- var _children = graphic.getChildren(),
21489
- zChildren = _children.map(function (g) {
21490
- return {
21491
- ave_z: g.findFace().vertices.map(function (v) {
21492
- var _a;
21493
- return context.view(v[0], v[1], null !== (_a = v[2] + g.attribute.z) && void 0 !== _a ? _a : 0)[2];
21494
- }).reduce(function (a, b) {
21495
- return a + b;
21496
- }, 0),
21497
- g: g
21498
- };
21499
- });
21500
- zChildren.sort(function (a, b) {
21501
- return b.ave_z - a.ave_z;
21502
- }), graphic.removeAllChild(), zChildren.forEach(function (i) {
21503
- i.g._next = null, i.g._prev = null;
21504
- }), graphic.update(), zChildren.forEach(function (i) {
21505
- graphic.add(i.g);
21506
- }), drawContribution.renderGroup(graphic, drawContext, graphic.parent.globalTransMatrix, !0), graphic.removeAllChild(), _children.forEach(function (g) {
21507
- g._next = null, g._prev = null;
21508
- }), graphic.update(), _children.forEach(function (g) {
21509
- graphic.add(g);
21510
- });
21511
- } else drawContribution.renderGroup(graphic, drawContext, graphic.parent.globalTransMatrix);
21512
- } else drawContribution.renderItem(graphic, drawContext);
21513
- return context.camera = null, context.restore(), context.modelMatrix !== lastModelMatrix && mat4Allocate.free(context.modelMatrix), context.modelMatrix = lastModelMatrix, drawContext.in3dInterceptor = !1, !0;
21514
- }
21515
- }, {
21516
- key: "initCanvasCtx",
21517
- value: function initCanvasCtx(context) {
21518
- context.setTransformForCurrent();
21519
- }
21520
- }]);
21521
- return Canvas3DDrawItemInterceptor;
21522
- }();
21523
-
21524
- var __decorate$1i = undefined && undefined.__decorate || function (decorators, target, key, desc) {
21525
- var d,
21526
- c = arguments.length,
21527
- r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
21528
- 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);
21529
- return c > 3 && r && Object.defineProperty(target, key, r), r;
21530
- },
21531
- __metadata$_ = undefined && undefined.__metadata || function (k, v) {
21532
- if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
21533
21243
  },
21534
21244
  __param$E = undefined && undefined.__param || function (paramIndex, decorator) {
21535
21245
  return function (target, key) {
@@ -21588,7 +21298,7 @@
21588
21298
  }]);
21589
21299
  return DefaultRenderService;
21590
21300
  }();
21591
- exports.DefaultRenderService = __decorate$1i([injectable(), __param$E(0, inject(DrawContribution)), __metadata$_("design:paramtypes", [Object])], exports.DefaultRenderService);
21301
+ exports.DefaultRenderService = __decorate$1j([injectable(), __param$E(0, inject(DrawContribution)), __metadata$$("design:paramtypes", [Object])], exports.DefaultRenderService);
21592
21302
 
21593
21303
  var renderModule$1 = new ContainerModule(function (bind) {
21594
21304
  bind(RenderService).to(exports.DefaultRenderService).inSingletonScope();
@@ -21599,7 +21309,7 @@
21599
21309
  var BoundsPicker = Symbol["for"]("BoundsPicker");
21600
21310
  var GlobalPickerService = Symbol["for"]("GlobalPickerService");
21601
21311
 
21602
- var __decorate$1h = undefined && undefined.__decorate || function (decorators, target, key, desc) {
21312
+ var __decorate$1i = undefined && undefined.__decorate || function (decorators, target, key, desc) {
21603
21313
  var d,
21604
21314
  c = arguments.length,
21605
21315
  r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
@@ -21640,7 +21350,7 @@
21640
21350
  }]);
21641
21351
  return ShadowRootPickItemInterceptorContribution;
21642
21352
  }();
21643
- exports.ShadowRootPickItemInterceptorContribution = __decorate$1h([injectable()], exports.ShadowRootPickItemInterceptorContribution);
21353
+ exports.ShadowRootPickItemInterceptorContribution = __decorate$1i([injectable()], exports.ShadowRootPickItemInterceptorContribution);
21644
21354
  exports.InteractivePickItemInterceptorContribution = /*#__PURE__*/function () {
21645
21355
  function InteractivePickItemInterceptorContribution() {
21646
21356
  _classCallCheck(this, InteractivePickItemInterceptorContribution);
@@ -21664,7 +21374,7 @@
21664
21374
  }]);
21665
21375
  return InteractivePickItemInterceptorContribution;
21666
21376
  }();
21667
- exports.InteractivePickItemInterceptorContribution = __decorate$1h([injectable()], exports.InteractivePickItemInterceptorContribution);
21377
+ exports.InteractivePickItemInterceptorContribution = __decorate$1i([injectable()], exports.InteractivePickItemInterceptorContribution);
21668
21378
  exports.Canvas3DPickItemInterceptor = /*#__PURE__*/function () {
21669
21379
  function Canvas3DPickItemInterceptor() {
21670
21380
  _classCallCheck(this, Canvas3DPickItemInterceptor);
@@ -21741,7 +21451,7 @@
21741
21451
  }]);
21742
21452
  return Canvas3DPickItemInterceptor;
21743
21453
  }();
21744
- exports.Canvas3DPickItemInterceptor = __decorate$1h([injectable()], exports.Canvas3DPickItemInterceptor);
21454
+ exports.Canvas3DPickItemInterceptor = __decorate$1i([injectable()], exports.Canvas3DPickItemInterceptor);
21745
21455
 
21746
21456
  var pickModule = new ContainerModule(function (bind, unbind, isBound) {
21747
21457
  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);
@@ -21754,14 +21464,14 @@
21754
21464
  var AutoEnablePlugins = Symbol["for"]("AutoEnablePlugins");
21755
21465
  var PluginService = Symbol["for"]("PluginService");
21756
21466
 
21757
- var __decorate$1g = undefined && undefined.__decorate || function (decorators, target, key, desc) {
21467
+ var __decorate$1h = undefined && undefined.__decorate || function (decorators, target, key, desc) {
21758
21468
  var d,
21759
21469
  c = arguments.length,
21760
21470
  r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
21761
21471
  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);
21762
21472
  return c > 3 && r && Object.defineProperty(target, key, r), r;
21763
21473
  },
21764
- __metadata$Z = undefined && undefined.__metadata || function (k, v) {
21474
+ __metadata$_ = undefined && undefined.__metadata || function (k, v) {
21765
21475
  if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
21766
21476
  },
21767
21477
  __param$D = undefined && undefined.__param || function (paramIndex, decorator) {
@@ -21817,7 +21527,7 @@
21817
21527
  }]);
21818
21528
  return DefaultPluginService;
21819
21529
  }();
21820
- DefaultPluginService = __decorate$1g([injectable(), __param$D(0, inject(ContributionProvider)), __param$D(0, named(AutoEnablePlugins)), __metadata$Z("design:paramtypes", [Object])], DefaultPluginService);
21530
+ DefaultPluginService = __decorate$1h([injectable(), __param$D(0, inject(ContributionProvider)), __param$D(0, named(AutoEnablePlugins)), __metadata$_("design:paramtypes", [Object])], DefaultPluginService);
21821
21531
 
21822
21532
  var pluginModule = new ContainerModule(function (bind) {
21823
21533
  bind(PluginService).to(DefaultPluginService), bindContributionProviderNoSingletonScope(bind, AutoEnablePlugins);
@@ -21831,14 +21541,14 @@
21831
21541
  bind(TextMeasureContribution).to(exports.DefaultTextMeasureContribution).inSingletonScope(), bindContributionProvider(bind, TextMeasureContribution);
21832
21542
  });
21833
21543
 
21834
- var __decorate$1f = undefined && undefined.__decorate || function (decorators, target, key, desc) {
21544
+ var __decorate$1g = undefined && undefined.__decorate || function (decorators, target, key, desc) {
21835
21545
  var d,
21836
21546
  c = arguments.length,
21837
21547
  r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
21838
21548
  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);
21839
21549
  return c > 3 && r && Object.defineProperty(target, key, r), r;
21840
21550
  },
21841
- __metadata$Y = undefined && undefined.__metadata || function (k, v) {
21551
+ __metadata$Z = undefined && undefined.__metadata || function (k, v) {
21842
21552
  if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
21843
21553
  };
21844
21554
  var CanvasLayerHandlerContribution = /*#__PURE__*/function () {
@@ -21932,16 +21642,16 @@
21932
21642
  }]);
21933
21643
  return CanvasLayerHandlerContribution;
21934
21644
  }();
21935
- CanvasLayerHandlerContribution = __decorate$1f([injectable(), __metadata$Y("design:paramtypes", [])], CanvasLayerHandlerContribution);
21645
+ CanvasLayerHandlerContribution = __decorate$1g([injectable(), __metadata$Z("design:paramtypes", [])], CanvasLayerHandlerContribution);
21936
21646
 
21937
- var __decorate$1e = undefined && undefined.__decorate || function (decorators, target, key, desc) {
21647
+ var __decorate$1f = undefined && undefined.__decorate || function (decorators, target, key, desc) {
21938
21648
  var d,
21939
21649
  c = arguments.length,
21940
21650
  r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
21941
21651
  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);
21942
21652
  return c > 3 && r && Object.defineProperty(target, key, r), r;
21943
21653
  },
21944
- __metadata$X = undefined && undefined.__metadata || function (k, v) {
21654
+ __metadata$Y = undefined && undefined.__metadata || function (k, v) {
21945
21655
  if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
21946
21656
  };
21947
21657
  var EmptyLayerHandlerContribution = /*#__PURE__*/function () {
@@ -21999,16 +21709,16 @@
21999
21709
  }]);
22000
21710
  return EmptyLayerHandlerContribution;
22001
21711
  }();
22002
- EmptyLayerHandlerContribution = __decorate$1e([injectable(), __metadata$X("design:paramtypes", [])], EmptyLayerHandlerContribution);
21712
+ EmptyLayerHandlerContribution = __decorate$1f([injectable(), __metadata$Y("design:paramtypes", [])], EmptyLayerHandlerContribution);
22003
21713
 
22004
- var __decorate$1d = undefined && undefined.__decorate || function (decorators, target, key, desc) {
21714
+ var __decorate$1e = undefined && undefined.__decorate || function (decorators, target, key, desc) {
22005
21715
  var d,
22006
21716
  c = arguments.length,
22007
21717
  r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
22008
21718
  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);
22009
21719
  return c > 3 && r && Object.defineProperty(target, key, r), r;
22010
21720
  },
22011
- __metadata$W = undefined && undefined.__metadata || function (k, v) {
21721
+ __metadata$X = undefined && undefined.__metadata || function (k, v) {
22012
21722
  if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
22013
21723
  };
22014
21724
  var OffscreenLayerHandlerContribution = /*#__PURE__*/function () {
@@ -22095,7 +21805,7 @@
22095
21805
  }]);
22096
21806
  return OffscreenLayerHandlerContribution;
22097
21807
  }();
22098
- OffscreenLayerHandlerContribution = __decorate$1d([injectable(), __metadata$W("design:paramtypes", [])], OffscreenLayerHandlerContribution);
21808
+ OffscreenLayerHandlerContribution = __decorate$1e([injectable(), __metadata$X("design:paramtypes", [])], OffscreenLayerHandlerContribution);
22099
21809
 
22100
21810
  var layerHandlerModules = new ContainerModule(function (bind) {
22101
21811
  bind(CanvasLayerHandlerContribution).toSelf(), bind(OffscreenLayerHandlerContribution).toSelf(), bind(EmptyLayerHandlerContribution).toSelf(), bind(StaticLayerHandlerContribution).toService(CanvasLayerHandlerContribution), bind(DynamicLayerHandlerContribution).toService(OffscreenLayerHandlerContribution), bind(VirtualLayerHandlerContribution).toService(EmptyLayerHandlerContribution);
@@ -22222,6 +21932,241 @@
22222
21932
  return result;
22223
21933
  }
22224
21934
 
21935
+ var __decorate$1d = undefined && undefined.__decorate || function (decorators, target, key, desc) {
21936
+ var d,
21937
+ c = arguments.length,
21938
+ r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
21939
+ 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);
21940
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
21941
+ },
21942
+ __metadata$W = undefined && undefined.__metadata || function (k, v) {
21943
+ if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
21944
+ };
21945
+ var DrawItemInterceptor = Symbol["for"]("DrawItemInterceptor");
21946
+ var tempDirtyBounds = new AABBBounds();
21947
+ var ShadowRootDrawItemInterceptorContribution = /*#__PURE__*/function () {
21948
+ function ShadowRootDrawItemInterceptorContribution() {
21949
+ _classCallCheck(this, ShadowRootDrawItemInterceptorContribution);
21950
+ this.order = 1;
21951
+ }
21952
+ _createClass(ShadowRootDrawItemInterceptorContribution, [{
21953
+ key: "afterDrawItem",
21954
+ value: function afterDrawItem(graphic, renderService, drawContext, drawContribution, params) {
21955
+ return (graphic.attribute.shadowRootIdx > 0 || !graphic.attribute.shadowRootIdx) && this.drawItem(graphic, renderService, drawContext, drawContribution, params), !1;
21956
+ }
21957
+ }, {
21958
+ key: "beforeDrawItem",
21959
+ value: function beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
21960
+ return graphic.attribute.shadowRootIdx < 0 && this.drawItem(graphic, renderService, drawContext, drawContribution, params), !1;
21961
+ }
21962
+ }, {
21963
+ key: "drawItem",
21964
+ value: function drawItem(graphic, renderService, drawContext, drawContribution, params) {
21965
+ if (!graphic.shadowRoot) return !1;
21966
+ var context = drawContext.context;
21967
+ if (context.highPerformanceSave(), context.transformFromMatrix(graphic.transMatrix, !0), drawContribution.dirtyBounds && drawContribution.backupDirtyBounds) {
21968
+ tempDirtyBounds.copy(drawContribution.dirtyBounds);
21969
+ var m = graphic.globalTransMatrix.getInverse();
21970
+ drawContribution.dirtyBounds.copy(drawContribution.backupDirtyBounds).transformWithMatrix(m);
21971
+ }
21972
+ return drawContribution.renderGroup(graphic.shadowRoot, drawContext, graphic.parent.globalTransMatrix), context.highPerformanceRestore(), drawContribution.dirtyBounds && drawContribution.backupDirtyBounds && drawContribution.dirtyBounds.copy(tempDirtyBounds), !0;
21973
+ }
21974
+ }]);
21975
+ return ShadowRootDrawItemInterceptorContribution;
21976
+ }();
21977
+ var DebugDrawItemInterceptorContribution = /*#__PURE__*/function () {
21978
+ function DebugDrawItemInterceptorContribution() {
21979
+ _classCallCheck(this, DebugDrawItemInterceptorContribution);
21980
+ this.order = 1;
21981
+ }
21982
+ _createClass(DebugDrawItemInterceptorContribution, [{
21983
+ key: "afterDrawItem",
21984
+ value: function afterDrawItem(graphic, renderService, drawContext, drawContribution, params) {
21985
+ return graphic.attribute._debug_bounds && this.drawItem(graphic, renderService, drawContext, drawContribution, params), !1;
21986
+ }
21987
+ }, {
21988
+ key: "drawItem",
21989
+ value: function drawItem(graphic, renderService, drawContext, drawContribution, params) {
21990
+ if (!graphic.attribute._debug_bounds) return !1;
21991
+ var context = drawContext.context;
21992
+ context.highPerformanceSave(), graphic.parent && context.setTransformFromMatrix(graphic.parent.globalTransMatrix, !0), graphic.glyphHost && graphic.glyphHost.parent && context.setTransformFromMatrix(graphic.glyphHost.parent.globalTransMatrix, !0);
21993
+ var b = graphic.AABBBounds;
21994
+ 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;
21995
+ }
21996
+ }]);
21997
+ return DebugDrawItemInterceptorContribution;
21998
+ }();
21999
+ var CommonDrawItemInterceptorContribution = /*#__PURE__*/function () {
22000
+ function CommonDrawItemInterceptorContribution() {
22001
+ _classCallCheck(this, CommonDrawItemInterceptorContribution);
22002
+ this.order = 1, this.interceptors = [new ShadowRootDrawItemInterceptorContribution(), new Canvas3DDrawItemInterceptor(), new InteractiveDrawItemInterceptorContribution(), new DebugDrawItemInterceptorContribution()];
22003
+ }
22004
+ _createClass(CommonDrawItemInterceptorContribution, [{
22005
+ key: "afterDrawItem",
22006
+ value: function afterDrawItem(graphic, renderService, drawContext, drawContribution, params) {
22007
+ 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;
22008
+ return !1;
22009
+ }
22010
+ }, {
22011
+ key: "beforeDrawItem",
22012
+ value: function beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
22013
+ if ((!graphic.in3dMode || drawContext.in3dInterceptor) && !graphic.shadowRoot && !(graphic.baseGraphic || graphic.attribute.globalZIndex || graphic.interactiveGraphic)) return !1;
22014
+ 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;
22015
+ return !1;
22016
+ }
22017
+ }]);
22018
+ return CommonDrawItemInterceptorContribution;
22019
+ }();
22020
+ CommonDrawItemInterceptorContribution = __decorate$1d([injectable(), __metadata$W("design:paramtypes", [])], CommonDrawItemInterceptorContribution);
22021
+ var InteractiveDrawItemInterceptorContribution = /*#__PURE__*/function () {
22022
+ function InteractiveDrawItemInterceptorContribution() {
22023
+ _classCallCheck(this, InteractiveDrawItemInterceptorContribution);
22024
+ this.order = 1;
22025
+ }
22026
+ _createClass(InteractiveDrawItemInterceptorContribution, [{
22027
+ key: "beforeDrawItem",
22028
+ value: function beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
22029
+ return !this.processing && (graphic.baseGraphic ? this.beforeDrawInteractive(graphic, renderService, drawContext, drawContribution, params) : this.beforeSetInteractive(graphic, renderService, drawContext, drawContribution, params));
22030
+ }
22031
+ }, {
22032
+ key: "beforeSetInteractive",
22033
+ value: function beforeSetInteractive(graphic, renderService, drawContext, drawContribution, params) {
22034
+ var interactiveGraphic = graphic.interactiveGraphic;
22035
+ if (graphic.attribute.globalZIndex) {
22036
+ interactiveGraphic || (interactiveGraphic = graphic.clone(), graphic.interactiveGraphic = interactiveGraphic, interactiveGraphic.baseGraphic = graphic), interactiveGraphic.setAttributes({
22037
+ globalZIndex: 0,
22038
+ zIndex: graphic.attribute.globalZIndex
22039
+ }, !1, {
22040
+ skipUpdateCallback: !0
22041
+ }), drawContext.stage.tryInitInteractiveLayer();
22042
+ var interactiveLayer = drawContext.stage.getLayer("_builtin_interactive");
22043
+ if (interactiveLayer) {
22044
+ this.getShadowRoot(interactiveLayer).add(interactiveGraphic);
22045
+ }
22046
+ return !0;
22047
+ }
22048
+ if (interactiveGraphic) {
22049
+ drawContext.stage.tryInitInteractiveLayer();
22050
+ var _interactiveLayer = drawContext.stage.getLayer("_builtin_interactive");
22051
+ if (_interactiveLayer) {
22052
+ this.getShadowRoot(_interactiveLayer).removeChild(interactiveGraphic);
22053
+ }
22054
+ graphic.interactiveGraphic = null, interactiveGraphic.baseGraphic = null;
22055
+ }
22056
+ return !1;
22057
+ }
22058
+ }, {
22059
+ key: "beforeDrawInteractive",
22060
+ value: function beforeDrawInteractive(graphic, renderService, drawContext, drawContribution, params) {
22061
+ var baseGraphic = graphic.baseGraphic;
22062
+ if (baseGraphic) {
22063
+ this.processing = !0;
22064
+ var context = drawContext.context;
22065
+ 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;
22066
+ }
22067
+ return !1;
22068
+ }
22069
+ }, {
22070
+ key: "getShadowRoot",
22071
+ value: function getShadowRoot(interactiveLayer) {
22072
+ var _a;
22073
+ var group = interactiveLayer.getElementById("_interactive_group");
22074
+ return group || (group = graphicCreator.CreateGraphic("group", {}), group.id = "_interactive_group", interactiveLayer.add(group)), null !== (_a = group.shadowRoot) && void 0 !== _a ? _a : group.attachShadow();
22075
+ }
22076
+ }]);
22077
+ return InteractiveDrawItemInterceptorContribution;
22078
+ }();
22079
+ var Canvas3DDrawItemInterceptor = /*#__PURE__*/function () {
22080
+ function Canvas3DDrawItemInterceptor() {
22081
+ _classCallCheck(this, Canvas3DDrawItemInterceptor);
22082
+ this.order = 1;
22083
+ }
22084
+ _createClass(Canvas3DDrawItemInterceptor, [{
22085
+ key: "beforeDrawItem",
22086
+ value: function beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
22087
+ if (!graphic.in3dMode || drawContext.in3dInterceptor) return !1;
22088
+ drawContext.in3dInterceptor = !0;
22089
+ var _renderService$drawPa = renderService.drawParams,
22090
+ context = _renderService$drawPa.context,
22091
+ stage = _renderService$drawPa.stage;
22092
+ context.canvas;
22093
+ context.save(), this.initCanvasCtx(context), context.camera = stage.camera;
22094
+ var m = context.currentMatrix;
22095
+ m.a /= context.dpr, m.b /= context.dpr, m.c /= context.dpr, m.d /= context.dpr, m.e /= context.dpr, m.f /= context.dpr;
22096
+ var matrix = mat4Allocate.allocate();
22097
+ mat3Tomat4(matrix, m);
22098
+ var lastModelMatrix = context.modelMatrix;
22099
+ if (lastModelMatrix) {
22100
+ if (matrix) {
22101
+ var _m = mat4Allocate.allocate();
22102
+ context.modelMatrix = multiplyMat4Mat4(_m, lastModelMatrix, matrix);
22103
+ }
22104
+ } else context.modelMatrix = matrix;
22105
+ if (context.setTransform(1, 0, 0, 1, 0, 0, !0), graphic.isContainer) {
22106
+ var isPie = !1,
22107
+ is3d = !1;
22108
+ if (graphic.forEachChildren(function (c) {
22109
+ return isPie = c.numberType === ARC3D_NUMBER_TYPE, !isPie;
22110
+ }), graphic.forEachChildren(function (c) {
22111
+ return is3d = !!c.findFace, !is3d;
22112
+ }), isPie) {
22113
+ var children = graphic.getChildren(),
22114
+ sortedChildren = _toConsumableArray(children);
22115
+ sortedChildren.sort(function (a, b) {
22116
+ var _a, _b, _c, _d;
22117
+ var angle1 = ((null !== (_a = a.attribute.startAngle) && void 0 !== _a ? _a : 0) + (null !== (_b = a.attribute.endAngle) && void 0 !== _b ? _b : 0)) / 2,
22118
+ angle2 = ((null !== (_c = b.attribute.startAngle) && void 0 !== _c ? _c : 0) + (null !== (_d = b.attribute.endAngle) && void 0 !== _d ? _d : 0)) / 2;
22119
+ for (; angle1 < 0;) angle1 += pi2;
22120
+ for (; angle2 < 0;) angle2 += pi2;
22121
+ return angle2 - angle1;
22122
+ }), sortedChildren.forEach(function (c) {
22123
+ c._next = null, c._prev = null;
22124
+ }), graphic.removeAllChild(), graphic.update(), sortedChildren.forEach(function (c) {
22125
+ graphic.appendChild(c);
22126
+ });
22127
+ var _m2 = graphic.parent.globalTransMatrix;
22128
+ 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) {
22129
+ c._next = null, c._prev = null;
22130
+ }), children.forEach(function (c) {
22131
+ graphic.appendChild(c);
22132
+ });
22133
+ } else if (is3d) {
22134
+ var _children = graphic.getChildren(),
22135
+ zChildren = _children.map(function (g) {
22136
+ return {
22137
+ ave_z: g.findFace().vertices.map(function (v) {
22138
+ var _a;
22139
+ return context.view(v[0], v[1], null !== (_a = v[2] + g.attribute.z) && void 0 !== _a ? _a : 0)[2];
22140
+ }).reduce(function (a, b) {
22141
+ return a + b;
22142
+ }, 0),
22143
+ g: g
22144
+ };
22145
+ });
22146
+ zChildren.sort(function (a, b) {
22147
+ return b.ave_z - a.ave_z;
22148
+ }), graphic.removeAllChild(), zChildren.forEach(function (i) {
22149
+ i.g._next = null, i.g._prev = null;
22150
+ }), graphic.update(), zChildren.forEach(function (i) {
22151
+ graphic.add(i.g);
22152
+ }), drawContribution.renderGroup(graphic, drawContext, graphic.parent.globalTransMatrix, !0), graphic.removeAllChild(), _children.forEach(function (g) {
22153
+ g._next = null, g._prev = null;
22154
+ }), graphic.update(), _children.forEach(function (g) {
22155
+ graphic.add(g);
22156
+ });
22157
+ } else drawContribution.renderGroup(graphic, drawContext, graphic.parent.globalTransMatrix);
22158
+ } else drawContribution.renderItem(graphic, drawContext);
22159
+ return context.camera = null, context.restore(), context.modelMatrix !== lastModelMatrix && mat4Allocate.free(context.modelMatrix), context.modelMatrix = lastModelMatrix, drawContext.in3dInterceptor = !1, !0;
22160
+ }
22161
+ }, {
22162
+ key: "initCanvasCtx",
22163
+ value: function initCanvasCtx(context) {
22164
+ context.setTransformForCurrent();
22165
+ }
22166
+ }]);
22167
+ return Canvas3DDrawItemInterceptor;
22168
+ }();
22169
+
22225
22170
  var __decorate$1c = undefined && undefined.__decorate || function (decorators, target, key, desc) {
22226
22171
  var d,
22227
22172
  c = arguments.length,
@@ -22282,7 +22227,7 @@
22282
22227
  var d = context.dpr % 1;
22283
22228
  (d || .5 !== d) && (dirtyBounds.x1 = Math.floor(dirtyBounds.x1 * context.dpr) / context.dpr, dirtyBounds.y1 = Math.floor(dirtyBounds.y1 * context.dpr) / context.dpr, dirtyBounds.x2 = Math.ceil(dirtyBounds.x2 * context.dpr) / context.dpr, dirtyBounds.y2 = Math.ceil(dirtyBounds.y2 * context.dpr) / context.dpr), this.backupDirtyBounds.copy(dirtyBounds), context.inuse = !0, context.clearMatrix(), context.setTransformForCurrent(!0);
22284
22229
  var drawInArea = dirtyBounds.width() * context.dpr < context.canvas.width || dirtyBounds.height() * context.dpr < context.canvas.height;
22285
- context.save(), context.translate(x, y, !0), drawInArea && (context.beginPath(), context.rect(dirtyBounds.x1, dirtyBounds.y1, dirtyBounds.width(), dirtyBounds.height()), context.clip()), stage.camera && (this.dirtyBounds.clear(), this.backupDirtyBounds.clear()), this.clearScreen(renderService, context, drawContext), context.save(), renderService.renderTreeRoots.sort(function (a, b) {
22230
+ context.save(), context.translate(x, y, !0), drawInArea && (context.beginPath(), context.rect(dirtyBounds.x1, dirtyBounds.y1, dirtyBounds.width(), dirtyBounds.height()), context.clip()), stage.camera && (this.dirtyBounds.setValue(-1 / 0, -1 / 0, 1 / 0, 1 / 0), this.backupDirtyBounds.setValue(-1 / 0, -1 / 0, 1 / 0, 1 / 0)), this.clearScreen(renderService, context, drawContext), context.save(), renderService.renderTreeRoots.sort(function (a, b) {
22286
22231
  var _a, _b;
22287
22232
  return (null !== (_a = a.attribute.zIndex) && void 0 !== _a ? _a : DefaultAttribute.zIndex) - (null !== (_b = b.attribute.zIndex) && void 0 !== _b ? _b : DefaultAttribute.zIndex);
22288
22233
  }).forEach(function (group) {
@@ -22345,7 +22290,7 @@
22345
22290
  }, subLayers.set(group._uid, incrementalLayer));
22346
22291
  var incrementalContext = incrementalLayer.layer.getNativeHandler().getContext(),
22347
22292
  idc = incrementalLayer.drawContribution || container.get(IncrementalDrawContribution);
22348
- idc.dirtyBounds.clear(), idc.backupDirtyBounds.clear(), idc.draw(this.currentRenderService, Object.assign(Object.assign({}, drawContext), {
22293
+ idc.dirtyBounds.setValue(-1 / 0, -1 / 0, 1 / 0, 1 / 0), idc.backupDirtyBounds.setValue(-1 / 0, -1 / 0, 1 / 0, 1 / 0), idc.draw(this.currentRenderService, Object.assign(Object.assign({}, drawContext), {
22349
22294
  drawContribution: idc,
22350
22295
  clear: "transparent",
22351
22296
  layer: incrementalLayer.layer,
@@ -23055,7 +23000,7 @@
23055
23000
  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);
23056
23001
 
23057
23002
  var renderModule = new ContainerModule(function (bind) {
23058
- 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);
23003
+ 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);
23059
23004
  });
23060
23005
 
23061
23006
  function load(container) {
@@ -34908,7 +34853,7 @@
34908
34853
 
34909
34854
  var roughModule = _roughModule;
34910
34855
 
34911
- const version = "0.17.19-alpha.1";
34856
+ const version = "0.17.19";
34912
34857
  preLoadAllModule();
34913
34858
  if (isBrowserEnv()) {
34914
34859
  loadBrowserEnv(container);
@@ -34959,7 +34904,6 @@
34959
34904
  exports.BoundsContext = BoundsContext;
34960
34905
  exports.BoundsPicker = BoundsPicker;
34961
34906
  exports.CIRCLE_NUMBER_TYPE = CIRCLE_NUMBER_TYPE;
34962
- exports.Canvas3DDrawItemInterceptor = Canvas3DDrawItemInterceptor;
34963
34907
  exports.CanvasFactory = CanvasFactory;
34964
34908
  exports.CanvasTextLayout = CanvasTextLayout;
34965
34909
  exports.CbAnimate = CbAnimate;
@@ -34981,7 +34925,6 @@
34981
34925
  exports.CustomEvent = CustomEvent;
34982
34926
  exports.CustomPath2D = CustomPath2D;
34983
34927
  exports.CustomSymbolClass = CustomSymbolClass;
34984
- exports.DebugDrawItemInterceptorContribution = DebugDrawItemInterceptorContribution;
34985
34928
  exports.DefaultArcAllocate = DefaultArcAllocate;
34986
34929
  exports.DefaultArcAttribute = DefaultArcAttribute;
34987
34930
  exports.DefaultArcRenderContribution = DefaultArcRenderContribution;
@@ -35035,7 +34978,6 @@
35035
34978
  exports.DefaultTransform = DefaultTransform;
35036
34979
  exports.DragNDrop = DragNDrop;
35037
34980
  exports.DrawContribution = DrawContribution;
35038
- exports.DrawItemInterceptor = DrawItemInterceptor;
35039
34981
  exports.DynamicLayerHandlerContribution = DynamicLayerHandlerContribution;
35040
34982
  exports.EnvContribution = EnvContribution;
35041
34983
  exports.EventManager = EventManager;
@@ -35074,7 +35016,6 @@
35074
35016
  exports.IncreaseCount = IncreaseCount;
35075
35017
  exports.IncrementalDrawContribution = IncrementalDrawContribution;
35076
35018
  exports.InputText = InputText;
35077
- exports.InteractiveDrawItemInterceptorContribution = InteractiveDrawItemInterceptorContribution;
35078
35019
  exports.InteractiveSubRenderContribution = InteractiveSubRenderContribution;
35079
35020
  exports.LINE_NUMBER_TYPE = LINE_NUMBER_TYPE;
35080
35021
  exports.Layer = Layer;
@@ -35136,7 +35077,6 @@
35136
35077
  exports.SYMBOL_NUMBER_TYPE = SYMBOL_NUMBER_TYPE;
35137
35078
  exports.SegContext = SegContext;
35138
35079
  exports.ShadowRoot = ShadowRoot;
35139
- exports.ShadowRootDrawItemInterceptorContribution = ShadowRootDrawItemInterceptorContribution;
35140
35080
  exports.Stage = Stage;
35141
35081
  exports.StaticLayerHandlerContribution = StaticLayerHandlerContribution;
35142
35082
  exports.Step = Step$1;