@visactor/vchart 2.1.2-alpha.3 → 2.1.2-alpha.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/build/es5/index.js +1 -1
  2. package/build/index.es.js +451 -477
  3. package/build/index.js +451 -477
  4. package/build/index.min.js +2 -2
  5. package/build/tsconfig.tsbuildinfo +1 -1
  6. package/cjs/animation/animation-planner.js +2 -1
  7. package/cjs/animation/grammar-dector.js +1 -2
  8. package/cjs/constant/event.js +1 -2
  9. package/cjs/constant/scatter.js +1 -1
  10. package/cjs/constant/scroll-bar.js +2 -1
  11. package/cjs/constant/sunburst.js +1 -1
  12. package/cjs/constant/waterfall.js +1 -1
  13. package/cjs/constant/word-cloud.js +1 -1
  14. package/cjs/core/index.js +1 -1
  15. package/cjs/core/instance-manager.js +1 -1
  16. package/cjs/core/interface.js +1 -1
  17. package/cjs/core/util.js +1 -1
  18. package/cjs/core/vchart.js +1 -1
  19. package/cjs/index.d.ts +6 -1
  20. package/cjs/index.js +32 -12
  21. package/cjs/index.js.map +1 -1
  22. package/cjs/mark/base/base-mark.d.ts +0 -1
  23. package/cjs/mark/base/base-mark.js +1 -9
  24. package/cjs/mark/base/base-mark.js.map +1 -1
  25. package/cjs/mark/group.js +1 -2
  26. package/cjs/mark/group.js.map +1 -1
  27. package/esm/animation/animation-planner.js +2 -1
  28. package/esm/animation/grammar-dector.js +1 -2
  29. package/esm/constant/event.js +1 -2
  30. package/esm/constant/scatter.js +1 -1
  31. package/esm/constant/scroll-bar.js +2 -1
  32. package/esm/constant/sunburst.js +1 -1
  33. package/esm/constant/waterfall.js +1 -1
  34. package/esm/constant/word-cloud.js +1 -1
  35. package/esm/core/index.js +1 -1
  36. package/esm/core/instance-manager.js +1 -1
  37. package/esm/core/interface.js +1 -1
  38. package/esm/core/util.js +1 -1
  39. package/esm/core/vchart.js +1 -1
  40. package/esm/index.d.ts +6 -1
  41. package/esm/index.js +11 -1
  42. package/esm/index.js.map +1 -1
  43. package/esm/mark/base/base-mark.d.ts +0 -1
  44. package/esm/mark/base/base-mark.js +1 -9
  45. package/esm/mark/base/base-mark.js.map +1 -1
  46. package/esm/mark/group.js +1 -2
  47. package/esm/mark/group.js.map +1 -1
  48. package/package.json +10 -10
package/build/index.es.js CHANGED
@@ -24482,6 +24482,199 @@ class DefaultCanvasArcRender extends BaseRender {
24482
24482
  }
24483
24483
  }
24484
24484
 
24485
+ function drawArcPath(arc, context, cx, cy, z, outerRadius, innerRadius) {
24486
+ const {
24487
+ startAngle: startAngle,
24488
+ endAngle: endAngle
24489
+ } = arc.getParsedAngle(),
24490
+ deltaAngle = abs$1(endAngle - startAngle),
24491
+ clockwise = endAngle > startAngle;
24492
+ let collapsedToLine = !1;
24493
+ if (outerRadius < innerRadius) {
24494
+ const temp = outerRadius;
24495
+ outerRadius = innerRadius, innerRadius = temp;
24496
+ }
24497
+ if (outerRadius <= epsilon$1) context.moveTo(cx, cy, z);else if (deltaAngle >= pi2 - epsilon$1) context.moveTo(cx + outerRadius * cos$1(startAngle), cy + outerRadius * sin$1(startAngle), z), context.arc(cx, cy, outerRadius, startAngle, endAngle, !clockwise, z), innerRadius > epsilon$1 && (context.moveTo(cx + innerRadius * cos$1(endAngle), cy + innerRadius * sin$1(endAngle), z), context.arc(cx, cy, innerRadius, endAngle, startAngle, clockwise, z));else {
24498
+ const {
24499
+ outerDeltaAngle: outerDeltaAngle,
24500
+ innerDeltaAngle: innerDeltaAngle,
24501
+ outerStartAngle: outerStartAngle,
24502
+ outerEndAngle: outerEndAngle,
24503
+ innerEndAngle: innerEndAngle,
24504
+ innerStartAngle: innerStartAngle
24505
+ } = arc.getParsePadAngle(startAngle, endAngle),
24506
+ xors = outerRadius * cos$1(outerStartAngle),
24507
+ yors = outerRadius * sin$1(outerStartAngle),
24508
+ xire = innerRadius * cos$1(innerEndAngle),
24509
+ yire = innerRadius * sin$1(innerEndAngle);
24510
+ outerDeltaAngle < .001 ? collapsedToLine = !0 : (context.moveTo(cx + xors, cy + yors, z), context.arc(cx, cy, outerRadius, outerStartAngle, outerEndAngle, !clockwise, z)), !(innerRadius > epsilon$1) || innerDeltaAngle < .001 ? (context.lineTo(cx + xire, cy + yire, z), collapsedToLine = !0) : (context.lineTo(cx + xire, cy + yire, z), context.arc(cx, cy, innerRadius, innerEndAngle, innerStartAngle, clockwise, z));
24511
+ }
24512
+ return context.closePath(), collapsedToLine;
24513
+ }
24514
+ function drawInnerOuterArcPath(arc, context, cx, cy, z1, z2, radius, getParsePadAngle) {
24515
+ const {
24516
+ startAngle: startAngle,
24517
+ endAngle: endAngle
24518
+ } = arc.getParsedAngle(),
24519
+ deltaAngle = abs$1(endAngle - startAngle),
24520
+ clockwise = endAngle > startAngle;
24521
+ let collapsedToLine = !1;
24522
+ if (radius <= epsilon$1) context.moveTo(cx, cy, z1);else if (deltaAngle >= pi2 - epsilon$1) context.moveTo(cx + radius * cos$1(startAngle), cy + radius * sin$1(startAngle), z1), context.arc(cx, cy, radius, startAngle, endAngle, !clockwise, z1), context.lineTo(cx + radius * cos$1(endAngle), cy + radius * sin$1(endAngle), z2), context.arc(cx, cy, radius, endAngle, startAngle, clockwise, z2);else {
24523
+ const {
24524
+ innerouterDeltaAngle: innerouterDeltaAngle,
24525
+ innerouterStartAngle: innerouterStartAngle,
24526
+ innerouterEndAngle: innerouterEndAngle
24527
+ } = getParsePadAngle(startAngle, endAngle),
24528
+ xors = radius * cos$1(innerouterStartAngle),
24529
+ yors = radius * sin$1(innerouterStartAngle),
24530
+ xore = radius * cos$1(innerouterEndAngle),
24531
+ yore = radius * sin$1(innerouterEndAngle);
24532
+ innerouterDeltaAngle < .001 ? collapsedToLine = !0 : (context.moveTo(cx + xors, cy + yors, z1), context.arc(cx, cy, radius, innerouterStartAngle, innerouterEndAngle, !clockwise, z1), context.lineTo(cx + xore, cy + yore, z2), context.arc(cx, cy, radius, innerouterEndAngle, innerouterStartAngle, clockwise, z2));
24533
+ }
24534
+ return context.closePath(), collapsedToLine;
24535
+ }
24536
+ class DefaultCanvasArc3DRender extends BaseRender {
24537
+ constructor() {
24538
+ super(...arguments), this.numberType = ARC3D_NUMBER_TYPE;
24539
+ }
24540
+ drawShape(arc, context, x, y, drawContext, params, fillCb, strokeCb) {
24541
+ var _a;
24542
+ const arcAttribute = getTheme$1(arc, null == params ? void 0 : params.theme).arc,
24543
+ {
24544
+ fill = arcAttribute.fill
24545
+ } = arc.attribute,
24546
+ data = this.valid(arc, arcAttribute, fillCb, strokeCb);
24547
+ if (!data) return;
24548
+ const {
24549
+ fVisible: fVisible,
24550
+ sVisible: sVisible,
24551
+ doFill: doFill,
24552
+ doStroke: doStroke
24553
+ } = data,
24554
+ z = null !== (_a = this.z) && void 0 !== _a ? _a : 0,
24555
+ {
24556
+ outerPadding = arcAttribute.outerPadding,
24557
+ innerPadding = arcAttribute.innerPadding,
24558
+ height = 10
24559
+ } = arc.attribute;
24560
+ let {
24561
+ outerRadius = arcAttribute.outerRadius,
24562
+ innerRadius = arcAttribute.innerRadius
24563
+ } = arc.attribute;
24564
+ outerRadius += outerPadding, innerRadius -= innerPadding;
24565
+ const rgbArray = ColorStore.Get(fill, ColorType.Color255),
24566
+ {
24567
+ light: light
24568
+ } = drawContext.stage || {},
24569
+ face = drawContext.hack_pieFace,
24570
+ z_face = {
24571
+ top: z,
24572
+ bottom: z + height
24573
+ },
24574
+ n_face = {
24575
+ top: [0, 1, 0],
24576
+ bottom: [0, -1, 0],
24577
+ outside: [1, 0, -1],
24578
+ inside: [1, 0, -1]
24579
+ };
24580
+ "bottom" === face || "top" === face ? (context.beginPath(), drawArcPath(arc, context, x, y, z_face[face], outerRadius, innerRadius), context.setShadowBlendStyle && context.setShadowBlendStyle(arc, arc.attribute, arcAttribute), doFill && (fillCb ? fillCb(context, arc.attribute, arcAttribute) : fVisible && (context.setCommonStyle(arc, arc.attribute, x, y, arcAttribute), context.fillStyle = light ? light.computeColor(n_face[face], rgbArray) : fill, context.fill())), doStroke && (strokeCb ? strokeCb(context, arc.attribute, arcAttribute) : sVisible && (context.setStrokeStyle(arc, arc.attribute, x, y, arcAttribute), context.stroke()))) : "outside" !== face && "inside" !== face || ("inside" === face && (context.save(), context.beginPath(), context.arc(x, y, innerRadius, 0, pi2, !0, z_face.top), context.clip()), context.beginPath(), drawInnerOuterArcPath(arc, context, x, y, z_face.top, z_face.bottom, "outside" === face ? outerRadius : innerRadius, (startAngle, endAngle) => {
24581
+ const {
24582
+ outerDeltaAngle: outerDeltaAngle,
24583
+ innerDeltaAngle: innerDeltaAngle,
24584
+ outerStartAngle: outerStartAngle,
24585
+ outerEndAngle: outerEndAngle,
24586
+ innerEndAngle: innerEndAngle,
24587
+ innerStartAngle: innerStartAngle
24588
+ } = arc.getParsePadAngle(startAngle, endAngle);
24589
+ return "outside" === face ? {
24590
+ innerouterDeltaAngle: outerDeltaAngle,
24591
+ innerouterEndAngle: outerEndAngle,
24592
+ innerouterStartAngle: outerStartAngle
24593
+ } : {
24594
+ innerouterDeltaAngle: innerDeltaAngle,
24595
+ innerouterEndAngle: innerEndAngle,
24596
+ innerouterStartAngle: innerStartAngle
24597
+ };
24598
+ }), context.setShadowBlendStyle && context.setShadowBlendStyle(arc, arc.attribute, arcAttribute), doFill && (fillCb ? fillCb(context, arc.attribute, arcAttribute) : fVisible && (context.setCommonStyle(arc, arc.attribute, x, y, arcAttribute), context.fillStyle = light ? light.computeColor(n_face[face], rgbArray) : fill, context.fill())), doStroke && (strokeCb ? strokeCb(context, arc.attribute, arcAttribute) : sVisible && (context.setStrokeStyle(arc, arc.attribute, x, y, arcAttribute), context.stroke())), "inside" === face && context.restore());
24599
+ }
24600
+ draw(arc, renderService, drawContext, params) {
24601
+ const arcAttribute = getTheme$1(arc, null == params ? void 0 : params.theme).arc;
24602
+ this._draw(arc, arcAttribute, !1, drawContext, params);
24603
+ }
24604
+ }
24605
+
24606
+ class Base3dRender extends BaseRender {
24607
+ stroke(x, y, z, face3d, context) {
24608
+ const vertices = face3d.vertices;
24609
+ face3d.edges.forEach(edge => {
24610
+ const p1 = vertices[edge[0]],
24611
+ v1 = {
24612
+ x: x + p1[0],
24613
+ y: y + p1[1],
24614
+ z: z + p1[2]
24615
+ },
24616
+ p2 = vertices[edge[1]],
24617
+ v2 = {
24618
+ x: x + p2[0],
24619
+ y: y + p2[1],
24620
+ z: z + p2[2]
24621
+ };
24622
+ context.beginPath(), context.moveTo(v1.x, v1.y, v1.z), context.lineTo(v2.x, v2.y, v2.z), context.stroke();
24623
+ });
24624
+ }
24625
+ fill(x, y, z, face3d, faces, fillColor, context, light, graphic3d, graphic3dAttribute, fillCb) {
24626
+ const rgbArray = ColorStore.Get(fillColor, ColorType.Color255),
24627
+ vertices = face3d.vertices,
24628
+ viewdVerticesZ = vertices.map(v => context.view(v[0], v[1], v[2])[2]),
24629
+ sortFace = [];
24630
+ face3d.polygons.forEach((p, i) => {
24631
+ if (faces && !faces[i]) return;
24632
+ sortFace.push({
24633
+ faceIdx: i,
24634
+ polygon: p
24635
+ });
24636
+ const {
24637
+ polygon: polygon
24638
+ } = p,
24639
+ z1 = viewdVerticesZ[polygon[0]],
24640
+ z2 = viewdVerticesZ[polygon[1]],
24641
+ z3 = viewdVerticesZ[polygon[2]],
24642
+ z4 = viewdVerticesZ[polygon[3]];
24643
+ p.ave_z = z1 + z2 + z3 + z4;
24644
+ }), sortFace.sort((a, b) => b.polygon.ave_z - a.polygon.ave_z), sortFace.forEach(item => {
24645
+ const {
24646
+ polygon: polygon,
24647
+ normal: normal
24648
+ } = item.polygon,
24649
+ p1 = vertices[polygon[0]],
24650
+ p2 = vertices[polygon[1]],
24651
+ p3 = vertices[polygon[2]],
24652
+ p4 = vertices[polygon[3]],
24653
+ v1 = {
24654
+ x: x + p1[0],
24655
+ y: y + p1[1],
24656
+ z: z + p1[2]
24657
+ },
24658
+ v2 = {
24659
+ x: x + p2[0],
24660
+ y: y + p2[1],
24661
+ z: z + p2[2]
24662
+ },
24663
+ v3 = {
24664
+ x: x + p3[0],
24665
+ y: y + p3[1],
24666
+ z: z + p3[2]
24667
+ },
24668
+ v4 = {
24669
+ x: x + p4[0],
24670
+ y: y + p4[1],
24671
+ z: z + p4[2]
24672
+ };
24673
+ context.beginPath(), context.moveTo(v1.x, v1.y, v1.z), context.lineTo(v2.x, v2.y, v2.z), context.lineTo(v3.x, v3.y, v3.z), context.lineTo(v4.x, v4.y, v4.z), context.closePath(), fillCb ? fillCb(context, graphic3d && graphic3d.attribute, graphic3dAttribute) : (context.fillStyle = light ? light.computeColor(normal, rgbArray) : fillColor, context.fill());
24674
+ });
24675
+ }
24676
+ }
24677
+
24485
24678
  class DefaultCanvasCircleRender extends BaseRender {
24486
24679
  constructor(graphicRenderContributions) {
24487
24680
  super(), this.graphicRenderContributions = graphicRenderContributions, this.numberType = CIRCLE_NUMBER_TYPE, this.builtinContributions = [defaultCircleRenderContribution, defaultCircleBackgroundRenderContribution, defaultCircleTextureRenderContribution], this.init(graphicRenderContributions);
@@ -25168,6 +25361,57 @@ class DefaultCanvasRectRender extends BaseRender {
25168
25361
  }
25169
25362
  }
25170
25363
 
25364
+ class DefaultCanvasRect3dRender extends Base3dRender {
25365
+ constructor() {
25366
+ super(...arguments), this.type = "rect3d", this.numberType = RECT3D_NUMBER_TYPE;
25367
+ }
25368
+ drawShape(rect, context, x, y, drawContext, params, fillCb, strokeCb) {
25369
+ var _a, _b;
25370
+ const rectAttribute = getTheme$1(rect, null == params ? void 0 : params.theme).rect,
25371
+ {
25372
+ fill = rectAttribute.fill,
25373
+ stroke = rectAttribute.stroke,
25374
+ x1: x1,
25375
+ y1: y1,
25376
+ x: originX,
25377
+ y: originY,
25378
+ opacity = rectAttribute.opacity,
25379
+ fillOpacity = rectAttribute.fillOpacity,
25380
+ lineWidth = rectAttribute.lineWidth,
25381
+ strokeOpacity = rectAttribute.strokeOpacity,
25382
+ visible = rectAttribute.visible,
25383
+ drawStrokeWhenZeroWH = null !== (_a = rectAttribute.drawStrokeWhenZeroWH) && void 0 !== _a && _a
25384
+ } = rect.attribute;
25385
+ let {
25386
+ width: width,
25387
+ height: height
25388
+ } = rect.attribute;
25389
+ width = (null != width ? width : x1 - originX) || 0, height = (null != height ? height : y1 - originY) || 0;
25390
+ const z = null !== (_b = this.z) && void 0 !== _b ? _b : 0,
25391
+ fVisible = rectFillVisible(opacity, fillOpacity, width, height, fill),
25392
+ sVisible = rectStrokeVisible(opacity, strokeOpacity, width, height, drawStrokeWhenZeroWH),
25393
+ doFill = runFill(fill),
25394
+ doStroke = runStroke(stroke, lineWidth);
25395
+ if (!rect.valid || !visible) return;
25396
+ if (!doFill && !doStroke) return;
25397
+ if (!(fVisible || sVisible || fillCb || strokeCb)) return;
25398
+ const {
25399
+ light: light
25400
+ } = drawContext.stage || {},
25401
+ face3d = rect.findFace();
25402
+ if (!1 !== fill) {
25403
+ context.setCommonStyle(rect, rect.attribute, x, y, rectAttribute);
25404
+ let fc = fill;
25405
+ "string" != typeof fc && (fc = "black"), this.fill(x, y, z, face3d, null, fc, context, light, null, null, fillCb);
25406
+ }
25407
+ !1 !== stroke && (context.setStrokeStyle(rect, rect.attribute, x, y, rectAttribute), this.stroke(x, y, z, face3d, context));
25408
+ }
25409
+ draw(rect, renderService, drawContext) {
25410
+ const rectAttribute = getTheme$1(rect).rect;
25411
+ this._draw(rect, rectAttribute, !1, drawContext);
25412
+ }
25413
+ }
25414
+
25171
25415
  class DefaultCanvasSymbolRender extends BaseRender {
25172
25416
  constructor(graphicRenderContributions) {
25173
25417
  super(), this.graphicRenderContributions = graphicRenderContributions, this.numberType = SYMBOL_NUMBER_TYPE, this.builtinContributions = [defaultSymbolRenderContribution, defaultSymbolBackgroundRenderContribution, defaultSymbolTextureRenderContribution, defaultSymbolClipRangeStrokeRenderContribution], this.init(graphicRenderContributions);
@@ -25530,18 +25774,49 @@ class DefaultCanvasPolygonRender extends BaseRender {
25530
25774
  }
25531
25775
  }
25532
25776
 
25533
- const repeatStr = ["", "repeat-x", "repeat-y", "repeat"];
25534
- function resolveImageRepeatMode(repeatX, repeatY) {
25535
- let repeat = 0;
25536
- return "repeat" === repeatX && (repeat |= 1), "repeat" === repeatY && (repeat |= 2), repeat ? repeatStr[repeat] : "no-repeat";
25537
- }
25538
- function resolveImageMode({
25539
- repeatX = "no-repeat",
25540
- repeatY = "no-repeat",
25541
- imageMode: imageMode
25542
- }) {
25543
- const repeatMode = resolveImageRepeatMode(repeatX, repeatY);
25544
- return {
25777
+ class DefaultCanvasPyramid3dRender extends Base3dRender {
25778
+ constructor() {
25779
+ super(...arguments), this.type = "pyramid3d", this.numberType = PYRAMID3D_NUMBER_TYPE;
25780
+ }
25781
+ drawShape(pyramid3d, context, x, y, drawContext, params, fillCb, strokeCb) {
25782
+ var _a;
25783
+ const pyramidAttribute = getTheme$1(pyramid3d, null == params ? void 0 : params.theme).polygon,
25784
+ {
25785
+ fill = pyramidAttribute.fill,
25786
+ stroke = pyramidAttribute.stroke,
25787
+ face = [!0, !0, !0, !0, !0, !0]
25788
+ } = pyramid3d.attribute,
25789
+ z = null !== (_a = this.z) && void 0 !== _a ? _a : 0;
25790
+ if (!this.valid(pyramid3d, pyramidAttribute, fillCb, strokeCb)) return;
25791
+ const {
25792
+ light: light
25793
+ } = drawContext.stage || {},
25794
+ face3d = pyramid3d.findFace();
25795
+ if (!1 !== fill) {
25796
+ context.setCommonStyle(pyramid3d, pyramid3d.attribute, x, y, pyramidAttribute);
25797
+ let fc = fill;
25798
+ "string" != typeof fc && (fc = "black"), this.fill(x, y, z, face3d, face, fc, context, light, pyramid3d, pyramidAttribute, fillCb);
25799
+ }
25800
+ !1 !== stroke && (context.setStrokeStyle(pyramid3d, pyramid3d.attribute, x, y, pyramidAttribute), this.stroke(x, y, z, face3d, context));
25801
+ }
25802
+ draw(pyramid3d, renderService, drawContext) {
25803
+ const pyramid3dAttribute = getTheme$1(pyramid3d).polygon;
25804
+ this._draw(pyramid3d, pyramid3dAttribute, !1, drawContext);
25805
+ }
25806
+ }
25807
+
25808
+ const repeatStr = ["", "repeat-x", "repeat-y", "repeat"];
25809
+ function resolveImageRepeatMode(repeatX, repeatY) {
25810
+ let repeat = 0;
25811
+ return "repeat" === repeatX && (repeat |= 1), "repeat" === repeatY && (repeat |= 2), repeat ? repeatStr[repeat] : "no-repeat";
25812
+ }
25813
+ function resolveImageMode({
25814
+ repeatX = "no-repeat",
25815
+ repeatY = "no-repeat",
25816
+ imageMode: imageMode
25817
+ }) {
25818
+ const repeatMode = resolveImageRepeatMode(repeatX, repeatY);
25819
+ return {
25545
25820
  repeatMode: repeatMode,
25546
25821
  sizingMode: "no-repeat" === repeatMode && null != imageMode ? imageMode : "fill"
25547
25822
  };
@@ -26965,373 +27240,40 @@ function bindTextRenderModule({
26965
27240
  container: container
26966
27241
  }) => new DefaultCanvasTextRender(createContributionProvider$1(TextRenderContribution, container))).inSingletonScope(), bind(GraphicRender).toService(TextRender), bind(TextRenderContribution).toService(DefaultBaseInteractiveRenderContribution), bindContributionProvider(bind, TextRenderContribution));
26967
27242
  }
26968
- const textModule = bindTextRenderModule;
26969
-
26970
- const loadedPathModuleContexts = new WeakSet();
26971
- function bindPathRenderModule({
26972
- bind: bind
26973
- }) {
26974
- isBindingContextLoaded(loadedPathModuleContexts, bind) || (bind(DefaultCanvasPathRender).toDynamicValue(({
26975
- container: container
26976
- }) => new DefaultCanvasPathRender(createContributionProvider$1(PathRenderContribution, container))).inSingletonScope(), bind(PathRender).toService(DefaultCanvasPathRender), bind(GraphicRender).toService(PathRender), bind(PathRenderContribution).toService(DefaultBaseInteractiveRenderContribution), bindContributionProvider(bind, PathRenderContribution));
26977
- }
26978
- const pathModule = bindPathRenderModule;
26979
-
26980
- const loadedPolygonModuleContexts = new WeakSet();
26981
- function bindPolygonRenderModule({
26982
- bind: bind
26983
- }) {
26984
- isBindingContextLoaded(loadedPolygonModuleContexts, bind) || (bind(PolygonRender).toDynamicValue(({
26985
- container: container
26986
- }) => new DefaultCanvasPolygonRender(createContributionProvider$1(PolygonRenderContribution, container))).inSingletonScope(), bind(GraphicRender).toService(PolygonRender), bind(PolygonRenderContribution).toService(DefaultBaseInteractiveRenderContribution), bindContributionProvider(bind, PolygonRenderContribution));
26987
- }
26988
- const polygonModule = bindPolygonRenderModule;
26989
-
26990
- class DefaultCanvasStarRender extends BaseRender {
26991
- constructor(graphicRenderContributions) {
26992
- super(), this.graphicRenderContributions = graphicRenderContributions, this.numberType = STAR_NUMBER_TYPE, this.builtinContributions = [defaultStarBackgroundRenderContribution, defaultStarTextureRenderContribution], this.init(graphicRenderContributions);
26993
- }
26994
- drawShape(star, context, x, y, drawContext, params, fillCb, strokeCb) {
26995
- const starAttribute = getTheme$1(star, null == params ? void 0 : params.theme).star,
26996
- {
26997
- x: originX = starAttribute.x,
26998
- y: originY = starAttribute.y,
26999
- fillStrokeOrder = starAttribute.fillStrokeOrder
27000
- } = star.attribute,
27001
- data = this.valid(star, starAttribute, fillCb, strokeCb);
27002
- if (!data) return;
27003
- const {
27004
- fVisible: fVisible,
27005
- sVisible: sVisible,
27006
- doFill: doFill,
27007
- doStroke: doStroke
27008
- } = data,
27009
- points = star.getCachedPoints();
27010
- context.beginPath(), points && points.length && points.forEach((point, index) => {
27011
- 0 === index ? context.moveTo(x + point.x, y + point.y) : context.lineTo(x + point.x, y + point.y);
27012
- }), context.closePath(), context.setShadowBlendStyle && context.setShadowBlendStyle(star, star.attribute, starAttribute), this.beforeRenderStep(star, context, x, y, doFill, doStroke, fVisible, sVisible, starAttribute, drawContext, fillCb, strokeCb);
27013
- const _runFill = () => {
27014
- doFill && (fillCb ? fillCb(context, star.attribute, starAttribute) : fVisible && (context.setCommonStyle(star, star.attribute, originX - x, originY - y, starAttribute), context.fill()));
27015
- },
27016
- _runStroke = () => {
27017
- doStroke && (strokeCb ? strokeCb(context, star.attribute, starAttribute) : sVisible && (context.setStrokeStyle(star, star.attribute, originX - x, originY - y, starAttribute), context.stroke()));
27018
- };
27019
- fillStrokeOrder ? (_runStroke(), _runFill()) : (_runFill(), _runStroke()), this.afterRenderStep(star, context, x, y, doFill, doStroke, fVisible, sVisible, starAttribute, drawContext, fillCb, strokeCb);
27020
- }
27021
- draw(star, renderService, drawContext, params) {
27022
- const starAttribute = getTheme$1(star, null == params ? void 0 : params.theme).star;
27023
- this._draw(star, starAttribute, !1, drawContext, params);
27024
- }
27025
- }
27026
-
27027
- const loadedStarModuleContexts = new WeakSet();
27028
- function bindStarRenderModule({
27029
- bind: bind
27030
- }) {
27031
- isBindingContextLoaded(loadedStarModuleContexts, bind) || (bind(DefaultCanvasStarRender).toDynamicValue(({
27032
- container: container
27033
- }) => new DefaultCanvasStarRender(createContributionProvider$1(StarRenderContribution, container))).inSingletonScope(), bind(StarRender).toService(DefaultCanvasStarRender), bind(GraphicRender).toService(StarRender), bindContributionProvider(bind, StarRenderContribution));
27034
- }
27035
- const starModule = bindStarRenderModule;
27036
-
27037
- class DefaultCanvasGlyphRender {
27038
- constructor() {
27039
- this.numberType = GLYPH_NUMBER_TYPE;
27040
- }
27041
- reInit() {}
27042
- drawShape(glyph, context, x, y, drawContext, params, fillCb, strokeCb) {
27043
- drawContext.drawContribution && glyph.getSubGraphic().forEach(item => {
27044
- const renderer = drawContext.drawContribution.getRenderContribution(item);
27045
- renderer && renderer.drawShape && renderer.drawShape(item, context, x, y, drawContext, params, fillCb, strokeCb);
27046
- });
27047
- }
27048
- draw(glyph, renderService, drawContext, params) {
27049
- const {
27050
- context: context
27051
- } = drawContext;
27052
- if (!context) return;
27053
- if (context.highPerformanceSave(), !drawContext.drawContribution) return;
27054
- const glyphTheme = getTheme$1(glyph),
27055
- subGraphic = glyph.getSubGraphic();
27056
- subGraphic.length && subGraphic.forEach(g => {
27057
- drawContext.drawContribution.renderItem(g, drawContext, {
27058
- theme: glyphTheme
27059
- });
27060
- }), context.highPerformanceRestore();
27061
- }
27062
- }
27063
-
27064
- const loadedGlyphModuleContexts = new WeakSet();
27065
- function bindGlyphRenderModule({
27066
- bind: bind
27067
- }) {
27068
- isBindingContextLoaded(loadedGlyphModuleContexts, bind) || (bind(DefaultCanvasGlyphRender).toDynamicValue(() => new DefaultCanvasGlyphRender()).inSingletonScope(), bind(GlyphRender).toService(DefaultCanvasGlyphRender), bind(GraphicRender).toService(GlyphRender));
27069
- }
27070
- const glyphModule = bindGlyphRenderModule;
27071
-
27072
- class DefaultCanvasRichTextRender extends BaseRender {
27073
- constructor() {
27074
- super(), this.numberType = RICHTEXT_NUMBER_TYPE, this.builtinContributions = [defaultTextBackgroundRenderContribution], this.init();
27075
- }
27076
- drawShape(richtext, context, x, y, drawContext) {
27077
- const richtextAttribute = getTheme$1(richtext).richtext,
27078
- {
27079
- strokeOpacity = richtextAttribute.strokeOpacity,
27080
- opacity = richtextAttribute.opacity,
27081
- fillOpacity = richtextAttribute.fillOpacity,
27082
- visible = richtextAttribute.visible
27083
- } = richtext.attribute;
27084
- if (!richtext.valid || !visible) return;
27085
- const fVisible = fillVisible(opacity, fillOpacity, !0),
27086
- sVisible = fillVisible(opacity, strokeOpacity, !0);
27087
- if (!fVisible) return;
27088
- context.setShadowBlendStyle && context.setShadowBlendStyle(richtext, richtext.attribute, richtextAttribute), context.translate(x, y), this.beforeRenderStep(richtext, context, x, y, fVisible, sVisible, fVisible, sVisible, richtextAttribute, drawContext);
27089
- richtext.getFrameCache().draw(context, this.drawIcon), this.afterRenderStep(richtext, context, x, y, fVisible, sVisible, fVisible, sVisible, richtextAttribute, drawContext);
27090
- }
27091
- drawIcon(icon, context, x, y, baseline) {
27092
- var _a;
27093
- const richtextIconAttribute = getTheme$1(icon).richtextIcon,
27094
- {
27095
- width = richtextIconAttribute.width,
27096
- height = richtextIconAttribute.height,
27097
- opacity = richtextIconAttribute.opacity,
27098
- image: url,
27099
- backgroundFill = richtextIconAttribute.backgroundFill,
27100
- backgroundFillOpacity = richtextIconAttribute.backgroundFillOpacity,
27101
- backgroundStroke = richtextIconAttribute.backgroundStroke,
27102
- backgroundStrokeOpacity = richtextIconAttribute.backgroundStrokeOpacity,
27103
- backgroundRadius = richtextIconAttribute.backgroundRadius,
27104
- margin: margin
27105
- } = icon.attribute,
27106
- {
27107
- backgroundWidth = width,
27108
- backgroundHeight = height
27109
- } = icon.attribute;
27110
- if (margin && (x += icon._marginArray[3], y += icon._marginArray[0]), icon._hovered) {
27111
- const expandX = (backgroundWidth - width) / 2,
27112
- expandY = (backgroundHeight - height) / 2;
27113
- 0 === backgroundRadius ? (context.beginPath(), context.rect(x - expandX, y - expandY, backgroundWidth, backgroundHeight)) : (context.beginPath(), createRectPath(context, x - expandX, y - expandY, backgroundWidth, backgroundHeight, backgroundRadius, !0)), backgroundFill && (context.globalAlpha = backgroundFillOpacity, context.fillStyle = backgroundFill, context.fill()), backgroundStroke && (context.globalAlpha = backgroundStrokeOpacity, context.strokeStyle = backgroundStroke, context.stroke());
27114
- }
27115
- const res = url && (null === (_a = null == icon ? void 0 : icon.resources) || void 0 === _a ? void 0 : _a.get(url));
27116
- res && "success" === res.state && (context.globalAlpha = opacity, context.drawImage(res.data, x, y, width, height));
27117
- }
27118
- draw(richtext, renderService, drawContext) {
27119
- const richtextAttribute = getTheme$1(richtext).richtext;
27120
- this._draw(richtext, richtextAttribute, !1, drawContext);
27121
- }
27122
- }
27123
-
27124
- const loadedRichtextModuleContexts = new WeakSet();
27125
- function bindRichtextRenderModule({
27126
- bind: bind
27127
- }) {
27128
- isBindingContextLoaded(loadedRichtextModuleContexts, bind) || (bind(DefaultCanvasRichTextRender).toDynamicValue(() => new DefaultCanvasRichTextRender()).inSingletonScope(), bind(RichTextRender).toService(DefaultCanvasRichTextRender), bind(GraphicRender).toService(RichTextRender));
27129
- }
27130
- const richtextModule = bindRichtextRenderModule;
27131
-
27132
- const loadedImageModuleContexts = new WeakSet();
27133
- function bindImageRenderModule({
27134
- bind: bind
27135
- }) {
27136
- isBindingContextLoaded(loadedImageModuleContexts, bind) || (bind(ImageRender).toDynamicValue(({
27137
- container: container
27138
- }) => new DefaultCanvasImageRender(createContributionProvider$1(ImageRenderContribution, container))).inSingletonScope(), bind(GraphicRender).toService(ImageRender), bind(ImageRenderContribution).toService(DefaultBaseInteractiveRenderContribution), bindContributionProvider(bind, ImageRenderContribution));
27139
- }
27140
- const imageModule = bindImageRenderModule;
27141
-
27142
- class Base3dRender extends BaseRender {
27143
- stroke(x, y, z, face3d, context) {
27144
- const vertices = face3d.vertices;
27145
- face3d.edges.forEach(edge => {
27146
- const p1 = vertices[edge[0]],
27147
- v1 = {
27148
- x: x + p1[0],
27149
- y: y + p1[1],
27150
- z: z + p1[2]
27151
- },
27152
- p2 = vertices[edge[1]],
27153
- v2 = {
27154
- x: x + p2[0],
27155
- y: y + p2[1],
27156
- z: z + p2[2]
27157
- };
27158
- context.beginPath(), context.moveTo(v1.x, v1.y, v1.z), context.lineTo(v2.x, v2.y, v2.z), context.stroke();
27159
- });
27160
- }
27161
- fill(x, y, z, face3d, faces, fillColor, context, light, graphic3d, graphic3dAttribute, fillCb) {
27162
- const rgbArray = ColorStore.Get(fillColor, ColorType.Color255),
27163
- vertices = face3d.vertices,
27164
- viewdVerticesZ = vertices.map(v => context.view(v[0], v[1], v[2])[2]),
27165
- sortFace = [];
27166
- face3d.polygons.forEach((p, i) => {
27167
- if (faces && !faces[i]) return;
27168
- sortFace.push({
27169
- faceIdx: i,
27170
- polygon: p
27171
- });
27172
- const {
27173
- polygon: polygon
27174
- } = p,
27175
- z1 = viewdVerticesZ[polygon[0]],
27176
- z2 = viewdVerticesZ[polygon[1]],
27177
- z3 = viewdVerticesZ[polygon[2]],
27178
- z4 = viewdVerticesZ[polygon[3]];
27179
- p.ave_z = z1 + z2 + z3 + z4;
27180
- }), sortFace.sort((a, b) => b.polygon.ave_z - a.polygon.ave_z), sortFace.forEach(item => {
27181
- const {
27182
- polygon: polygon,
27183
- normal: normal
27184
- } = item.polygon,
27185
- p1 = vertices[polygon[0]],
27186
- p2 = vertices[polygon[1]],
27187
- p3 = vertices[polygon[2]],
27188
- p4 = vertices[polygon[3]],
27189
- v1 = {
27190
- x: x + p1[0],
27191
- y: y + p1[1],
27192
- z: z + p1[2]
27193
- },
27194
- v2 = {
27195
- x: x + p2[0],
27196
- y: y + p2[1],
27197
- z: z + p2[2]
27198
- },
27199
- v3 = {
27200
- x: x + p3[0],
27201
- y: y + p3[1],
27202
- z: z + p3[2]
27203
- },
27204
- v4 = {
27205
- x: x + p4[0],
27206
- y: y + p4[1],
27207
- z: z + p4[2]
27208
- };
27209
- context.beginPath(), context.moveTo(v1.x, v1.y, v1.z), context.lineTo(v2.x, v2.y, v2.z), context.lineTo(v3.x, v3.y, v3.z), context.lineTo(v4.x, v4.y, v4.z), context.closePath(), fillCb ? fillCb(context, graphic3d && graphic3d.attribute, graphic3dAttribute) : (context.fillStyle = light ? light.computeColor(normal, rgbArray) : fillColor, context.fill());
27210
- });
27211
- }
27212
- }
27213
-
27214
- class DefaultCanvasRect3dRender extends Base3dRender {
27215
- constructor() {
27216
- super(...arguments), this.type = "rect3d", this.numberType = RECT3D_NUMBER_TYPE;
27217
- }
27218
- drawShape(rect, context, x, y, drawContext, params, fillCb, strokeCb) {
27219
- var _a, _b;
27220
- const rectAttribute = getTheme$1(rect, null == params ? void 0 : params.theme).rect,
27221
- {
27222
- fill = rectAttribute.fill,
27223
- stroke = rectAttribute.stroke,
27224
- x1: x1,
27225
- y1: y1,
27226
- x: originX,
27227
- y: originY,
27228
- opacity = rectAttribute.opacity,
27229
- fillOpacity = rectAttribute.fillOpacity,
27230
- lineWidth = rectAttribute.lineWidth,
27231
- strokeOpacity = rectAttribute.strokeOpacity,
27232
- visible = rectAttribute.visible,
27233
- drawStrokeWhenZeroWH = null !== (_a = rectAttribute.drawStrokeWhenZeroWH) && void 0 !== _a && _a
27234
- } = rect.attribute;
27235
- let {
27236
- width: width,
27237
- height: height
27238
- } = rect.attribute;
27239
- width = (null != width ? width : x1 - originX) || 0, height = (null != height ? height : y1 - originY) || 0;
27240
- const z = null !== (_b = this.z) && void 0 !== _b ? _b : 0,
27241
- fVisible = rectFillVisible(opacity, fillOpacity, width, height, fill),
27242
- sVisible = rectStrokeVisible(opacity, strokeOpacity, width, height, drawStrokeWhenZeroWH),
27243
- doFill = runFill(fill),
27244
- doStroke = runStroke(stroke, lineWidth);
27245
- if (!rect.valid || !visible) return;
27246
- if (!doFill && !doStroke) return;
27247
- if (!(fVisible || sVisible || fillCb || strokeCb)) return;
27248
- const {
27249
- light: light
27250
- } = drawContext.stage || {},
27251
- face3d = rect.findFace();
27252
- if (!1 !== fill) {
27253
- context.setCommonStyle(rect, rect.attribute, x, y, rectAttribute);
27254
- let fc = fill;
27255
- "string" != typeof fc && (fc = "black"), this.fill(x, y, z, face3d, null, fc, context, light, null, null, fillCb);
27256
- }
27257
- !1 !== stroke && (context.setStrokeStyle(rect, rect.attribute, x, y, rectAttribute), this.stroke(x, y, z, face3d, context));
27258
- }
27259
- draw(rect, renderService, drawContext) {
27260
- const rectAttribute = getTheme$1(rect).rect;
27261
- this._draw(rect, rectAttribute, !1, drawContext);
27262
- }
27263
- }
27264
-
27265
- const loadedRect3dModuleContexts = new WeakSet();
27266
- function bindRect3dRenderModule({
27267
- bind: bind
27268
- }) {
27269
- isBindingContextLoaded(loadedRect3dModuleContexts, bind) || (bind(DefaultCanvasRect3dRender).toDynamicValue(() => new DefaultCanvasRect3dRender()).inSingletonScope(), bind(Rect3DRender).toService(DefaultCanvasRect3dRender), bind(GraphicRender).toService(Rect3DRender));
27270
- }
27271
- const rect3dModule = bindRect3dRenderModule;
27272
-
27273
- function drawArcPath(arc, context, cx, cy, z, outerRadius, innerRadius) {
27274
- const {
27275
- startAngle: startAngle,
27276
- endAngle: endAngle
27277
- } = arc.getParsedAngle(),
27278
- deltaAngle = abs$1(endAngle - startAngle),
27279
- clockwise = endAngle > startAngle;
27280
- let collapsedToLine = !1;
27281
- if (outerRadius < innerRadius) {
27282
- const temp = outerRadius;
27283
- outerRadius = innerRadius, innerRadius = temp;
27284
- }
27285
- if (outerRadius <= epsilon$1) context.moveTo(cx, cy, z);else if (deltaAngle >= pi2 - epsilon$1) context.moveTo(cx + outerRadius * cos$1(startAngle), cy + outerRadius * sin$1(startAngle), z), context.arc(cx, cy, outerRadius, startAngle, endAngle, !clockwise, z), innerRadius > epsilon$1 && (context.moveTo(cx + innerRadius * cos$1(endAngle), cy + innerRadius * sin$1(endAngle), z), context.arc(cx, cy, innerRadius, endAngle, startAngle, clockwise, z));else {
27286
- const {
27287
- outerDeltaAngle: outerDeltaAngle,
27288
- innerDeltaAngle: innerDeltaAngle,
27289
- outerStartAngle: outerStartAngle,
27290
- outerEndAngle: outerEndAngle,
27291
- innerEndAngle: innerEndAngle,
27292
- innerStartAngle: innerStartAngle
27293
- } = arc.getParsePadAngle(startAngle, endAngle),
27294
- xors = outerRadius * cos$1(outerStartAngle),
27295
- yors = outerRadius * sin$1(outerStartAngle),
27296
- xire = innerRadius * cos$1(innerEndAngle),
27297
- yire = innerRadius * sin$1(innerEndAngle);
27298
- outerDeltaAngle < .001 ? collapsedToLine = !0 : (context.moveTo(cx + xors, cy + yors, z), context.arc(cx, cy, outerRadius, outerStartAngle, outerEndAngle, !clockwise, z)), !(innerRadius > epsilon$1) || innerDeltaAngle < .001 ? (context.lineTo(cx + xire, cy + yire, z), collapsedToLine = !0) : (context.lineTo(cx + xire, cy + yire, z), context.arc(cx, cy, innerRadius, innerEndAngle, innerStartAngle, clockwise, z));
27299
- }
27300
- return context.closePath(), collapsedToLine;
27301
- }
27302
- function drawInnerOuterArcPath(arc, context, cx, cy, z1, z2, radius, getParsePadAngle) {
27303
- const {
27304
- startAngle: startAngle,
27305
- endAngle: endAngle
27306
- } = arc.getParsedAngle(),
27307
- deltaAngle = abs$1(endAngle - startAngle),
27308
- clockwise = endAngle > startAngle;
27309
- let collapsedToLine = !1;
27310
- if (radius <= epsilon$1) context.moveTo(cx, cy, z1);else if (deltaAngle >= pi2 - epsilon$1) context.moveTo(cx + radius * cos$1(startAngle), cy + radius * sin$1(startAngle), z1), context.arc(cx, cy, radius, startAngle, endAngle, !clockwise, z1), context.lineTo(cx + radius * cos$1(endAngle), cy + radius * sin$1(endAngle), z2), context.arc(cx, cy, radius, endAngle, startAngle, clockwise, z2);else {
27311
- const {
27312
- innerouterDeltaAngle: innerouterDeltaAngle,
27313
- innerouterStartAngle: innerouterStartAngle,
27314
- innerouterEndAngle: innerouterEndAngle
27315
- } = getParsePadAngle(startAngle, endAngle),
27316
- xors = radius * cos$1(innerouterStartAngle),
27317
- yors = radius * sin$1(innerouterStartAngle),
27318
- xore = radius * cos$1(innerouterEndAngle),
27319
- yore = radius * sin$1(innerouterEndAngle);
27320
- innerouterDeltaAngle < .001 ? collapsedToLine = !0 : (context.moveTo(cx + xors, cy + yors, z1), context.arc(cx, cy, radius, innerouterStartAngle, innerouterEndAngle, !clockwise, z1), context.lineTo(cx + xore, cy + yore, z2), context.arc(cx, cy, radius, innerouterEndAngle, innerouterStartAngle, clockwise, z2));
27321
- }
27322
- return context.closePath(), collapsedToLine;
27323
- }
27324
- class DefaultCanvasArc3DRender extends BaseRender {
27325
- constructor() {
27326
- super(...arguments), this.numberType = ARC3D_NUMBER_TYPE;
27243
+ const textModule = bindTextRenderModule;
27244
+
27245
+ const loadedPathModuleContexts = new WeakSet();
27246
+ function bindPathRenderModule({
27247
+ bind: bind
27248
+ }) {
27249
+ isBindingContextLoaded(loadedPathModuleContexts, bind) || (bind(DefaultCanvasPathRender).toDynamicValue(({
27250
+ container: container
27251
+ }) => new DefaultCanvasPathRender(createContributionProvider$1(PathRenderContribution, container))).inSingletonScope(), bind(PathRender).toService(DefaultCanvasPathRender), bind(GraphicRender).toService(PathRender), bind(PathRenderContribution).toService(DefaultBaseInteractiveRenderContribution), bindContributionProvider(bind, PathRenderContribution));
27252
+ }
27253
+ const pathModule = bindPathRenderModule;
27254
+
27255
+ const loadedPolygonModuleContexts = new WeakSet();
27256
+ function bindPolygonRenderModule({
27257
+ bind: bind
27258
+ }) {
27259
+ isBindingContextLoaded(loadedPolygonModuleContexts, bind) || (bind(PolygonRender).toDynamicValue(({
27260
+ container: container
27261
+ }) => new DefaultCanvasPolygonRender(createContributionProvider$1(PolygonRenderContribution, container))).inSingletonScope(), bind(GraphicRender).toService(PolygonRender), bind(PolygonRenderContribution).toService(DefaultBaseInteractiveRenderContribution), bindContributionProvider(bind, PolygonRenderContribution));
27262
+ }
27263
+ const polygonModule = bindPolygonRenderModule;
27264
+
27265
+ class DefaultCanvasStarRender extends BaseRender {
27266
+ constructor(graphicRenderContributions) {
27267
+ super(), this.graphicRenderContributions = graphicRenderContributions, this.numberType = STAR_NUMBER_TYPE, this.builtinContributions = [defaultStarBackgroundRenderContribution, defaultStarTextureRenderContribution], this.init(graphicRenderContributions);
27327
27268
  }
27328
- drawShape(arc, context, x, y, drawContext, params, fillCb, strokeCb) {
27329
- var _a;
27330
- const arcAttribute = getTheme$1(arc, null == params ? void 0 : params.theme).arc,
27269
+ drawShape(star, context, x, y, drawContext, params, fillCb, strokeCb) {
27270
+ const starAttribute = getTheme$1(star, null == params ? void 0 : params.theme).star,
27331
27271
  {
27332
- fill = arcAttribute.fill
27333
- } = arc.attribute,
27334
- data = this.valid(arc, arcAttribute, fillCb, strokeCb);
27272
+ x: originX = starAttribute.x,
27273
+ y: originY = starAttribute.y,
27274
+ fillStrokeOrder = starAttribute.fillStrokeOrder
27275
+ } = star.attribute,
27276
+ data = this.valid(star, starAttribute, fillCb, strokeCb);
27335
27277
  if (!data) return;
27336
27278
  const {
27337
27279
  fVisible: fVisible,
@@ -27339,97 +27281,155 @@ class DefaultCanvasArc3DRender extends BaseRender {
27339
27281
  doFill: doFill,
27340
27282
  doStroke: doStroke
27341
27283
  } = data,
27342
- z = null !== (_a = this.z) && void 0 !== _a ? _a : 0,
27343
- {
27344
- outerPadding = arcAttribute.outerPadding,
27345
- innerPadding = arcAttribute.innerPadding,
27346
- height = 10
27347
- } = arc.attribute;
27348
- let {
27349
- outerRadius = arcAttribute.outerRadius,
27350
- innerRadius = arcAttribute.innerRadius
27351
- } = arc.attribute;
27352
- outerRadius += outerPadding, innerRadius -= innerPadding;
27353
- const rgbArray = ColorStore.Get(fill, ColorType.Color255),
27354
- {
27355
- light: light
27356
- } = drawContext.stage || {},
27357
- face = drawContext.hack_pieFace,
27358
- z_face = {
27359
- top: z,
27360
- bottom: z + height
27284
+ points = star.getCachedPoints();
27285
+ context.beginPath(), points && points.length && points.forEach((point, index) => {
27286
+ 0 === index ? context.moveTo(x + point.x, y + point.y) : context.lineTo(x + point.x, y + point.y);
27287
+ }), context.closePath(), context.setShadowBlendStyle && context.setShadowBlendStyle(star, star.attribute, starAttribute), this.beforeRenderStep(star, context, x, y, doFill, doStroke, fVisible, sVisible, starAttribute, drawContext, fillCb, strokeCb);
27288
+ const _runFill = () => {
27289
+ doFill && (fillCb ? fillCb(context, star.attribute, starAttribute) : fVisible && (context.setCommonStyle(star, star.attribute, originX - x, originY - y, starAttribute), context.fill()));
27361
27290
  },
27362
- n_face = {
27363
- top: [0, 1, 0],
27364
- bottom: [0, -1, 0],
27365
- outside: [1, 0, -1],
27366
- inside: [1, 0, -1]
27367
- };
27368
- "bottom" === face || "top" === face ? (context.beginPath(), drawArcPath(arc, context, x, y, z_face[face], outerRadius, innerRadius), context.setShadowBlendStyle && context.setShadowBlendStyle(arc, arc.attribute, arcAttribute), doFill && (fillCb ? fillCb(context, arc.attribute, arcAttribute) : fVisible && (context.setCommonStyle(arc, arc.attribute, x, y, arcAttribute), context.fillStyle = light ? light.computeColor(n_face[face], rgbArray) : fill, context.fill())), doStroke && (strokeCb ? strokeCb(context, arc.attribute, arcAttribute) : sVisible && (context.setStrokeStyle(arc, arc.attribute, x, y, arcAttribute), context.stroke()))) : "outside" !== face && "inside" !== face || ("inside" === face && (context.save(), context.beginPath(), context.arc(x, y, innerRadius, 0, pi2, !0, z_face.top), context.clip()), context.beginPath(), drawInnerOuterArcPath(arc, context, x, y, z_face.top, z_face.bottom, "outside" === face ? outerRadius : innerRadius, (startAngle, endAngle) => {
27369
- const {
27370
- outerDeltaAngle: outerDeltaAngle,
27371
- innerDeltaAngle: innerDeltaAngle,
27372
- outerStartAngle: outerStartAngle,
27373
- outerEndAngle: outerEndAngle,
27374
- innerEndAngle: innerEndAngle,
27375
- innerStartAngle: innerStartAngle
27376
- } = arc.getParsePadAngle(startAngle, endAngle);
27377
- return "outside" === face ? {
27378
- innerouterDeltaAngle: outerDeltaAngle,
27379
- innerouterEndAngle: outerEndAngle,
27380
- innerouterStartAngle: outerStartAngle
27381
- } : {
27382
- innerouterDeltaAngle: innerDeltaAngle,
27383
- innerouterEndAngle: innerEndAngle,
27384
- innerouterStartAngle: innerStartAngle
27291
+ _runStroke = () => {
27292
+ doStroke && (strokeCb ? strokeCb(context, star.attribute, starAttribute) : sVisible && (context.setStrokeStyle(star, star.attribute, originX - x, originY - y, starAttribute), context.stroke()));
27385
27293
  };
27386
- }), context.setShadowBlendStyle && context.setShadowBlendStyle(arc, arc.attribute, arcAttribute), doFill && (fillCb ? fillCb(context, arc.attribute, arcAttribute) : fVisible && (context.setCommonStyle(arc, arc.attribute, x, y, arcAttribute), context.fillStyle = light ? light.computeColor(n_face[face], rgbArray) : fill, context.fill())), doStroke && (strokeCb ? strokeCb(context, arc.attribute, arcAttribute) : sVisible && (context.setStrokeStyle(arc, arc.attribute, x, y, arcAttribute), context.stroke())), "inside" === face && context.restore());
27294
+ fillStrokeOrder ? (_runStroke(), _runFill()) : (_runFill(), _runStroke()), this.afterRenderStep(star, context, x, y, doFill, doStroke, fVisible, sVisible, starAttribute, drawContext, fillCb, strokeCb);
27387
27295
  }
27388
- draw(arc, renderService, drawContext, params) {
27389
- const arcAttribute = getTheme$1(arc, null == params ? void 0 : params.theme).arc;
27390
- this._draw(arc, arcAttribute, !1, drawContext, params);
27296
+ draw(star, renderService, drawContext, params) {
27297
+ const starAttribute = getTheme$1(star, null == params ? void 0 : params.theme).star;
27298
+ this._draw(star, starAttribute, !1, drawContext, params);
27391
27299
  }
27392
27300
  }
27393
27301
 
27394
- const loadedArc3dModuleContexts = new WeakSet();
27395
- function bindArc3dRenderModule({
27302
+ const loadedStarModuleContexts = new WeakSet();
27303
+ function bindStarRenderModule({
27396
27304
  bind: bind
27397
27305
  }) {
27398
- isBindingContextLoaded(loadedArc3dModuleContexts, bind) || (bind(DefaultCanvasArc3DRender).toDynamicValue(() => new DefaultCanvasArc3DRender()).inSingletonScope(), bind(Arc3dRender).toService(DefaultCanvasArc3DRender), bind(GraphicRender).toService(Arc3dRender));
27306
+ isBindingContextLoaded(loadedStarModuleContexts, bind) || (bind(DefaultCanvasStarRender).toDynamicValue(({
27307
+ container: container
27308
+ }) => new DefaultCanvasStarRender(createContributionProvider$1(StarRenderContribution, container))).inSingletonScope(), bind(StarRender).toService(DefaultCanvasStarRender), bind(GraphicRender).toService(StarRender), bindContributionProvider(bind, StarRenderContribution));
27399
27309
  }
27400
- const arc3dModule = bindArc3dRenderModule;
27310
+ const starModule = bindStarRenderModule;
27401
27311
 
27402
- class DefaultCanvasPyramid3dRender extends Base3dRender {
27312
+ class DefaultCanvasGlyphRender {
27403
27313
  constructor() {
27404
- super(...arguments), this.type = "pyramid3d", this.numberType = PYRAMID3D_NUMBER_TYPE;
27314
+ this.numberType = GLYPH_NUMBER_TYPE;
27405
27315
  }
27406
- drawShape(pyramid3d, context, x, y, drawContext, params, fillCb, strokeCb) {
27316
+ reInit() {}
27317
+ drawShape(glyph, context, x, y, drawContext, params, fillCb, strokeCb) {
27318
+ drawContext.drawContribution && glyph.getSubGraphic().forEach(item => {
27319
+ const renderer = drawContext.drawContribution.getRenderContribution(item);
27320
+ renderer && renderer.drawShape && renderer.drawShape(item, context, x, y, drawContext, params, fillCb, strokeCb);
27321
+ });
27322
+ }
27323
+ draw(glyph, renderService, drawContext, params) {
27324
+ const {
27325
+ context: context
27326
+ } = drawContext;
27327
+ if (!context) return;
27328
+ if (context.highPerformanceSave(), !drawContext.drawContribution) return;
27329
+ const glyphTheme = getTheme$1(glyph),
27330
+ subGraphic = glyph.getSubGraphic();
27331
+ subGraphic.length && subGraphic.forEach(g => {
27332
+ drawContext.drawContribution.renderItem(g, drawContext, {
27333
+ theme: glyphTheme
27334
+ });
27335
+ }), context.highPerformanceRestore();
27336
+ }
27337
+ }
27338
+
27339
+ const loadedGlyphModuleContexts = new WeakSet();
27340
+ function bindGlyphRenderModule({
27341
+ bind: bind
27342
+ }) {
27343
+ isBindingContextLoaded(loadedGlyphModuleContexts, bind) || (bind(DefaultCanvasGlyphRender).toDynamicValue(() => new DefaultCanvasGlyphRender()).inSingletonScope(), bind(GlyphRender).toService(DefaultCanvasGlyphRender), bind(GraphicRender).toService(GlyphRender));
27344
+ }
27345
+ const glyphModule = bindGlyphRenderModule;
27346
+
27347
+ class DefaultCanvasRichTextRender extends BaseRender {
27348
+ constructor() {
27349
+ super(), this.numberType = RICHTEXT_NUMBER_TYPE, this.builtinContributions = [defaultTextBackgroundRenderContribution], this.init();
27350
+ }
27351
+ drawShape(richtext, context, x, y, drawContext) {
27352
+ const richtextAttribute = getTheme$1(richtext).richtext,
27353
+ {
27354
+ strokeOpacity = richtextAttribute.strokeOpacity,
27355
+ opacity = richtextAttribute.opacity,
27356
+ fillOpacity = richtextAttribute.fillOpacity,
27357
+ visible = richtextAttribute.visible
27358
+ } = richtext.attribute;
27359
+ if (!richtext.valid || !visible) return;
27360
+ const fVisible = fillVisible(opacity, fillOpacity, !0),
27361
+ sVisible = fillVisible(opacity, strokeOpacity, !0);
27362
+ if (!fVisible) return;
27363
+ context.setShadowBlendStyle && context.setShadowBlendStyle(richtext, richtext.attribute, richtextAttribute), context.translate(x, y), this.beforeRenderStep(richtext, context, x, y, fVisible, sVisible, fVisible, sVisible, richtextAttribute, drawContext);
27364
+ richtext.getFrameCache().draw(context, this.drawIcon), this.afterRenderStep(richtext, context, x, y, fVisible, sVisible, fVisible, sVisible, richtextAttribute, drawContext);
27365
+ }
27366
+ drawIcon(icon, context, x, y, baseline) {
27407
27367
  var _a;
27408
- const pyramidAttribute = getTheme$1(pyramid3d, null == params ? void 0 : params.theme).polygon,
27368
+ const richtextIconAttribute = getTheme$1(icon).richtextIcon,
27409
27369
  {
27410
- fill = pyramidAttribute.fill,
27411
- stroke = pyramidAttribute.stroke,
27412
- face = [!0, !0, !0, !0, !0, !0]
27413
- } = pyramid3d.attribute,
27414
- z = null !== (_a = this.z) && void 0 !== _a ? _a : 0;
27415
- if (!this.valid(pyramid3d, pyramidAttribute, fillCb, strokeCb)) return;
27416
- const {
27417
- light: light
27418
- } = drawContext.stage || {},
27419
- face3d = pyramid3d.findFace();
27420
- if (!1 !== fill) {
27421
- context.setCommonStyle(pyramid3d, pyramid3d.attribute, x, y, pyramidAttribute);
27422
- let fc = fill;
27423
- "string" != typeof fc && (fc = "black"), this.fill(x, y, z, face3d, face, fc, context, light, pyramid3d, pyramidAttribute, fillCb);
27370
+ width = richtextIconAttribute.width,
27371
+ height = richtextIconAttribute.height,
27372
+ opacity = richtextIconAttribute.opacity,
27373
+ image: url,
27374
+ backgroundFill = richtextIconAttribute.backgroundFill,
27375
+ backgroundFillOpacity = richtextIconAttribute.backgroundFillOpacity,
27376
+ backgroundStroke = richtextIconAttribute.backgroundStroke,
27377
+ backgroundStrokeOpacity = richtextIconAttribute.backgroundStrokeOpacity,
27378
+ backgroundRadius = richtextIconAttribute.backgroundRadius,
27379
+ margin: margin
27380
+ } = icon.attribute,
27381
+ {
27382
+ backgroundWidth = width,
27383
+ backgroundHeight = height
27384
+ } = icon.attribute;
27385
+ if (margin && (x += icon._marginArray[3], y += icon._marginArray[0]), icon._hovered) {
27386
+ const expandX = (backgroundWidth - width) / 2,
27387
+ expandY = (backgroundHeight - height) / 2;
27388
+ 0 === backgroundRadius ? (context.beginPath(), context.rect(x - expandX, y - expandY, backgroundWidth, backgroundHeight)) : (context.beginPath(), createRectPath(context, x - expandX, y - expandY, backgroundWidth, backgroundHeight, backgroundRadius, !0)), backgroundFill && (context.globalAlpha = backgroundFillOpacity, context.fillStyle = backgroundFill, context.fill()), backgroundStroke && (context.globalAlpha = backgroundStrokeOpacity, context.strokeStyle = backgroundStroke, context.stroke());
27424
27389
  }
27425
- !1 !== stroke && (context.setStrokeStyle(pyramid3d, pyramid3d.attribute, x, y, pyramidAttribute), this.stroke(x, y, z, face3d, context));
27390
+ const res = url && (null === (_a = null == icon ? void 0 : icon.resources) || void 0 === _a ? void 0 : _a.get(url));
27391
+ res && "success" === res.state && (context.globalAlpha = opacity, context.drawImage(res.data, x, y, width, height));
27426
27392
  }
27427
- draw(pyramid3d, renderService, drawContext) {
27428
- const pyramid3dAttribute = getTheme$1(pyramid3d).polygon;
27429
- this._draw(pyramid3d, pyramid3dAttribute, !1, drawContext);
27393
+ draw(richtext, renderService, drawContext) {
27394
+ const richtextAttribute = getTheme$1(richtext).richtext;
27395
+ this._draw(richtext, richtextAttribute, !1, drawContext);
27430
27396
  }
27431
27397
  }
27432
27398
 
27399
+ const loadedRichtextModuleContexts = new WeakSet();
27400
+ function bindRichtextRenderModule({
27401
+ bind: bind
27402
+ }) {
27403
+ isBindingContextLoaded(loadedRichtextModuleContexts, bind) || (bind(DefaultCanvasRichTextRender).toDynamicValue(() => new DefaultCanvasRichTextRender()).inSingletonScope(), bind(RichTextRender).toService(DefaultCanvasRichTextRender), bind(GraphicRender).toService(RichTextRender));
27404
+ }
27405
+ const richtextModule = bindRichtextRenderModule;
27406
+
27407
+ const loadedImageModuleContexts = new WeakSet();
27408
+ function bindImageRenderModule({
27409
+ bind: bind
27410
+ }) {
27411
+ isBindingContextLoaded(loadedImageModuleContexts, bind) || (bind(ImageRender).toDynamicValue(({
27412
+ container: container
27413
+ }) => new DefaultCanvasImageRender(createContributionProvider$1(ImageRenderContribution, container))).inSingletonScope(), bind(GraphicRender).toService(ImageRender), bind(ImageRenderContribution).toService(DefaultBaseInteractiveRenderContribution), bindContributionProvider(bind, ImageRenderContribution));
27414
+ }
27415
+ const imageModule = bindImageRenderModule;
27416
+
27417
+ const loadedRect3dModuleContexts = new WeakSet();
27418
+ function bindRect3dRenderModule({
27419
+ bind: bind
27420
+ }) {
27421
+ isBindingContextLoaded(loadedRect3dModuleContexts, bind) || (bind(DefaultCanvasRect3dRender).toDynamicValue(() => new DefaultCanvasRect3dRender()).inSingletonScope(), bind(Rect3DRender).toService(DefaultCanvasRect3dRender), bind(GraphicRender).toService(Rect3DRender));
27422
+ }
27423
+ const rect3dModule = bindRect3dRenderModule;
27424
+
27425
+ const loadedArc3dModuleContexts = new WeakSet();
27426
+ function bindArc3dRenderModule({
27427
+ bind: bind
27428
+ }) {
27429
+ isBindingContextLoaded(loadedArc3dModuleContexts, bind) || (bind(DefaultCanvasArc3DRender).toDynamicValue(() => new DefaultCanvasArc3DRender()).inSingletonScope(), bind(Arc3dRender).toService(DefaultCanvasArc3DRender), bind(GraphicRender).toService(Arc3dRender));
27430
+ }
27431
+ const arc3dModule = bindArc3dRenderModule;
27432
+
27433
27433
  const loadedPyramid3dModuleContexts = new WeakSet();
27434
27434
  function bindPyramid3dRenderModule({
27435
27435
  bind: bind
@@ -41628,20 +41628,6 @@ class BaseMark extends GrammarItem {
41628
41628
  _hasDiffAttrs(g) {
41629
41629
  return !!g.context.diffAttrs && Object.keys(g.context.diffAttrs).length > 0;
41630
41630
  }
41631
- _commitPreventedAnimationStaticAttrs(g, attrs) {
41632
- var _a, _b;
41633
- if (!attrs || !Object.keys(attrs).length) {
41634
- return;
41635
- }
41636
- const graphic = g;
41637
- (_a = graphic.setFinalAttributes) === null || _a === void 0 ? void 0 : _a.call(graphic, attrs);
41638
- if (graphic._commitAnimationStaticAttributes) {
41639
- graphic._commitAnimationStaticAttributes(attrs);
41640
- }
41641
- else {
41642
- (_b = graphic.commitInternalBaseAttributes) === null || _b === void 0 ? void 0 : _b.call(graphic, attrs);
41643
- }
41644
- }
41645
41631
  _runApplyGraphic(graphics) {
41646
41632
  const hasAnimation = this.hasAnimation();
41647
41633
  graphics.forEach((g, index) => {
@@ -41679,13 +41665,7 @@ class BaseMark extends GrammarItem {
41679
41665
  g.context.reusing = false;
41680
41666
  }
41681
41667
  else if (!hasStateAnimation) {
41682
- if (hasAnimation) {
41683
- g.setAttributesAndPreventAnimate(diffAttrs);
41684
- this._commitPreventedAnimationStaticAttrs(g, diffAttrs);
41685
- }
41686
- else {
41687
- g.setAttributes(diffAttrs);
41688
- }
41668
+ hasAnimation ? g.setAttributesAndPreventAnimate(diffAttrs) : g.setAttributes(diffAttrs);
41689
41669
  }
41690
41670
  if (!((_b = this.renderContext) === null || _b === void 0 ? void 0 : _b.progressive) && this._product && g.parent !== this._product) {
41691
41671
  this._product.appendChild(g);
@@ -42161,13 +42141,7 @@ class GroupMark extends BaseMark {
42161
42141
  const diffAttrs = getDiffAttributesOfGraphic(this._product, newAttrs);
42162
42142
  this._product.context.diffAttrs = diffAttrs;
42163
42143
  if (!this.hasAnimationByState(this._product.context.animationState)) {
42164
- if (hasAnimation) {
42165
- this._product.setAttributesAndPreventAnimate(diffAttrs);
42166
- this._commitPreventedAnimationStaticAttrs(this._product, diffAttrs);
42167
- }
42168
- else {
42169
- this._product.setAttributes(diffAttrs);
42170
- }
42144
+ hasAnimation ? this._product.setAttributesAndPreventAnimate(diffAttrs) : this._product.setAttributes(diffAttrs);
42171
42145
  }
42172
42146
  }
42173
42147
  else {