@visactor/vchart 2.1.1 → 2.1.2-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/build/es5/index.js +1 -1
  2. package/build/index.es.js +287 -287
  3. package/build/index.js +287 -287
  4. package/build/index.min.js +2 -2
  5. package/build/tsconfig.tsbuildinfo +1 -1
  6. package/cjs/constant/box-plot.js +2 -1
  7. package/cjs/constant/layout.js +1 -1
  8. package/cjs/constant/marker.js +1 -1
  9. package/cjs/constant/polar.js +1 -2
  10. package/cjs/constant/scatter.js +1 -1
  11. package/cjs/constant/scroll-bar.js +1 -1
  12. package/cjs/constant/sunburst.js +1 -1
  13. package/cjs/constant/waterfall.js +1 -1
  14. package/cjs/constant/word-cloud.js +1 -1
  15. package/cjs/core/index.js +1 -1
  16. package/cjs/core/instance-manager.js +1 -1
  17. package/cjs/core/interface.js +1 -1
  18. package/cjs/core/util.js +1 -1
  19. package/cjs/core/vchart.js +1 -1
  20. package/cjs/data/data-view-utils.js +1 -1
  21. package/cjs/data/initialize.js +1 -1
  22. package/cjs/data/register.js +1 -1
  23. package/cjs/index.d.ts +6 -1
  24. package/cjs/index.js +32 -12
  25. package/cjs/index.js.map +1 -1
  26. package/esm/constant/box-plot.js +2 -1
  27. package/esm/constant/layout.js +1 -1
  28. package/esm/constant/marker.js +1 -1
  29. package/esm/constant/polar.js +1 -2
  30. package/esm/constant/scatter.js +1 -1
  31. package/esm/constant/scroll-bar.js +1 -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/data/data-view-utils.js +1 -1
  41. package/esm/data/initialize.js +1 -1
  42. package/esm/data/register.js +1 -1
  43. package/esm/index.d.ts +6 -1
  44. package/esm/index.js +11 -1
  45. package/esm/index.js.map +1 -1
  46. package/package.json +9 -9
package/build/index.js CHANGED
@@ -24488,6 +24488,199 @@
24488
24488
  }
24489
24489
  }
24490
24490
 
24491
+ function drawArcPath(arc, context, cx, cy, z, outerRadius, innerRadius) {
24492
+ const {
24493
+ startAngle: startAngle,
24494
+ endAngle: endAngle
24495
+ } = arc.getParsedAngle(),
24496
+ deltaAngle = abs$1(endAngle - startAngle),
24497
+ clockwise = endAngle > startAngle;
24498
+ let collapsedToLine = !1;
24499
+ if (outerRadius < innerRadius) {
24500
+ const temp = outerRadius;
24501
+ outerRadius = innerRadius, innerRadius = temp;
24502
+ }
24503
+ 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 {
24504
+ const {
24505
+ outerDeltaAngle: outerDeltaAngle,
24506
+ innerDeltaAngle: innerDeltaAngle,
24507
+ outerStartAngle: outerStartAngle,
24508
+ outerEndAngle: outerEndAngle,
24509
+ innerEndAngle: innerEndAngle,
24510
+ innerStartAngle: innerStartAngle
24511
+ } = arc.getParsePadAngle(startAngle, endAngle),
24512
+ xors = outerRadius * cos$1(outerStartAngle),
24513
+ yors = outerRadius * sin$1(outerStartAngle),
24514
+ xire = innerRadius * cos$1(innerEndAngle),
24515
+ yire = innerRadius * sin$1(innerEndAngle);
24516
+ 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));
24517
+ }
24518
+ return context.closePath(), collapsedToLine;
24519
+ }
24520
+ function drawInnerOuterArcPath(arc, context, cx, cy, z1, z2, radius, getParsePadAngle) {
24521
+ const {
24522
+ startAngle: startAngle,
24523
+ endAngle: endAngle
24524
+ } = arc.getParsedAngle(),
24525
+ deltaAngle = abs$1(endAngle - startAngle),
24526
+ clockwise = endAngle > startAngle;
24527
+ let collapsedToLine = !1;
24528
+ 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 {
24529
+ const {
24530
+ innerouterDeltaAngle: innerouterDeltaAngle,
24531
+ innerouterStartAngle: innerouterStartAngle,
24532
+ innerouterEndAngle: innerouterEndAngle
24533
+ } = getParsePadAngle(startAngle, endAngle),
24534
+ xors = radius * cos$1(innerouterStartAngle),
24535
+ yors = radius * sin$1(innerouterStartAngle),
24536
+ xore = radius * cos$1(innerouterEndAngle),
24537
+ yore = radius * sin$1(innerouterEndAngle);
24538
+ 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));
24539
+ }
24540
+ return context.closePath(), collapsedToLine;
24541
+ }
24542
+ class DefaultCanvasArc3DRender extends BaseRender {
24543
+ constructor() {
24544
+ super(...arguments), this.numberType = ARC3D_NUMBER_TYPE;
24545
+ }
24546
+ drawShape(arc, context, x, y, drawContext, params, fillCb, strokeCb) {
24547
+ var _a;
24548
+ const arcAttribute = getTheme$1(arc, null == params ? void 0 : params.theme).arc,
24549
+ {
24550
+ fill = arcAttribute.fill
24551
+ } = arc.attribute,
24552
+ data = this.valid(arc, arcAttribute, fillCb, strokeCb);
24553
+ if (!data) return;
24554
+ const {
24555
+ fVisible: fVisible,
24556
+ sVisible: sVisible,
24557
+ doFill: doFill,
24558
+ doStroke: doStroke
24559
+ } = data,
24560
+ z = null !== (_a = this.z) && void 0 !== _a ? _a : 0,
24561
+ {
24562
+ outerPadding = arcAttribute.outerPadding,
24563
+ innerPadding = arcAttribute.innerPadding,
24564
+ height = 10
24565
+ } = arc.attribute;
24566
+ let {
24567
+ outerRadius = arcAttribute.outerRadius,
24568
+ innerRadius = arcAttribute.innerRadius
24569
+ } = arc.attribute;
24570
+ outerRadius += outerPadding, innerRadius -= innerPadding;
24571
+ const rgbArray = ColorStore.Get(fill, ColorType.Color255),
24572
+ {
24573
+ light: light
24574
+ } = drawContext.stage || {},
24575
+ face = drawContext.hack_pieFace,
24576
+ z_face = {
24577
+ top: z,
24578
+ bottom: z + height
24579
+ },
24580
+ n_face = {
24581
+ top: [0, 1, 0],
24582
+ bottom: [0, -1, 0],
24583
+ outside: [1, 0, -1],
24584
+ inside: [1, 0, -1]
24585
+ };
24586
+ "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) => {
24587
+ const {
24588
+ outerDeltaAngle: outerDeltaAngle,
24589
+ innerDeltaAngle: innerDeltaAngle,
24590
+ outerStartAngle: outerStartAngle,
24591
+ outerEndAngle: outerEndAngle,
24592
+ innerEndAngle: innerEndAngle,
24593
+ innerStartAngle: innerStartAngle
24594
+ } = arc.getParsePadAngle(startAngle, endAngle);
24595
+ return "outside" === face ? {
24596
+ innerouterDeltaAngle: outerDeltaAngle,
24597
+ innerouterEndAngle: outerEndAngle,
24598
+ innerouterStartAngle: outerStartAngle
24599
+ } : {
24600
+ innerouterDeltaAngle: innerDeltaAngle,
24601
+ innerouterEndAngle: innerEndAngle,
24602
+ innerouterStartAngle: innerStartAngle
24603
+ };
24604
+ }), 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());
24605
+ }
24606
+ draw(arc, renderService, drawContext, params) {
24607
+ const arcAttribute = getTheme$1(arc, null == params ? void 0 : params.theme).arc;
24608
+ this._draw(arc, arcAttribute, !1, drawContext, params);
24609
+ }
24610
+ }
24611
+
24612
+ class Base3dRender extends BaseRender {
24613
+ stroke(x, y, z, face3d, context) {
24614
+ const vertices = face3d.vertices;
24615
+ face3d.edges.forEach(edge => {
24616
+ const p1 = vertices[edge[0]],
24617
+ v1 = {
24618
+ x: x + p1[0],
24619
+ y: y + p1[1],
24620
+ z: z + p1[2]
24621
+ },
24622
+ p2 = vertices[edge[1]],
24623
+ v2 = {
24624
+ x: x + p2[0],
24625
+ y: y + p2[1],
24626
+ z: z + p2[2]
24627
+ };
24628
+ context.beginPath(), context.moveTo(v1.x, v1.y, v1.z), context.lineTo(v2.x, v2.y, v2.z), context.stroke();
24629
+ });
24630
+ }
24631
+ fill(x, y, z, face3d, faces, fillColor, context, light, graphic3d, graphic3dAttribute, fillCb) {
24632
+ const rgbArray = ColorStore.Get(fillColor, ColorType.Color255),
24633
+ vertices = face3d.vertices,
24634
+ viewdVerticesZ = vertices.map(v => context.view(v[0], v[1], v[2])[2]),
24635
+ sortFace = [];
24636
+ face3d.polygons.forEach((p, i) => {
24637
+ if (faces && !faces[i]) return;
24638
+ sortFace.push({
24639
+ faceIdx: i,
24640
+ polygon: p
24641
+ });
24642
+ const {
24643
+ polygon: polygon
24644
+ } = p,
24645
+ z1 = viewdVerticesZ[polygon[0]],
24646
+ z2 = viewdVerticesZ[polygon[1]],
24647
+ z3 = viewdVerticesZ[polygon[2]],
24648
+ z4 = viewdVerticesZ[polygon[3]];
24649
+ p.ave_z = z1 + z2 + z3 + z4;
24650
+ }), sortFace.sort((a, b) => b.polygon.ave_z - a.polygon.ave_z), sortFace.forEach(item => {
24651
+ const {
24652
+ polygon: polygon,
24653
+ normal: normal
24654
+ } = item.polygon,
24655
+ p1 = vertices[polygon[0]],
24656
+ p2 = vertices[polygon[1]],
24657
+ p3 = vertices[polygon[2]],
24658
+ p4 = vertices[polygon[3]],
24659
+ v1 = {
24660
+ x: x + p1[0],
24661
+ y: y + p1[1],
24662
+ z: z + p1[2]
24663
+ },
24664
+ v2 = {
24665
+ x: x + p2[0],
24666
+ y: y + p2[1],
24667
+ z: z + p2[2]
24668
+ },
24669
+ v3 = {
24670
+ x: x + p3[0],
24671
+ y: y + p3[1],
24672
+ z: z + p3[2]
24673
+ },
24674
+ v4 = {
24675
+ x: x + p4[0],
24676
+ y: y + p4[1],
24677
+ z: z + p4[2]
24678
+ };
24679
+ 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());
24680
+ });
24681
+ }
24682
+ }
24683
+
24491
24684
  class DefaultCanvasCircleRender extends BaseRender {
24492
24685
  constructor(graphicRenderContributions) {
24493
24686
  super(), this.graphicRenderContributions = graphicRenderContributions, this.numberType = CIRCLE_NUMBER_TYPE, this.builtinContributions = [defaultCircleRenderContribution, defaultCircleBackgroundRenderContribution, defaultCircleTextureRenderContribution], this.init(graphicRenderContributions);
@@ -25174,6 +25367,57 @@
25174
25367
  }
25175
25368
  }
25176
25369
 
25370
+ class DefaultCanvasRect3dRender extends Base3dRender {
25371
+ constructor() {
25372
+ super(...arguments), this.type = "rect3d", this.numberType = RECT3D_NUMBER_TYPE;
25373
+ }
25374
+ drawShape(rect, context, x, y, drawContext, params, fillCb, strokeCb) {
25375
+ var _a, _b;
25376
+ const rectAttribute = getTheme$1(rect, null == params ? void 0 : params.theme).rect,
25377
+ {
25378
+ fill = rectAttribute.fill,
25379
+ stroke = rectAttribute.stroke,
25380
+ x1: x1,
25381
+ y1: y1,
25382
+ x: originX,
25383
+ y: originY,
25384
+ opacity = rectAttribute.opacity,
25385
+ fillOpacity = rectAttribute.fillOpacity,
25386
+ lineWidth = rectAttribute.lineWidth,
25387
+ strokeOpacity = rectAttribute.strokeOpacity,
25388
+ visible = rectAttribute.visible,
25389
+ drawStrokeWhenZeroWH = null !== (_a = rectAttribute.drawStrokeWhenZeroWH) && void 0 !== _a && _a
25390
+ } = rect.attribute;
25391
+ let {
25392
+ width: width,
25393
+ height: height
25394
+ } = rect.attribute;
25395
+ width = (null != width ? width : x1 - originX) || 0, height = (null != height ? height : y1 - originY) || 0;
25396
+ const z = null !== (_b = this.z) && void 0 !== _b ? _b : 0,
25397
+ fVisible = rectFillVisible(opacity, fillOpacity, width, height, fill),
25398
+ sVisible = rectStrokeVisible(opacity, strokeOpacity, width, height, drawStrokeWhenZeroWH),
25399
+ doFill = runFill(fill),
25400
+ doStroke = runStroke(stroke, lineWidth);
25401
+ if (!rect.valid || !visible) return;
25402
+ if (!doFill && !doStroke) return;
25403
+ if (!(fVisible || sVisible || fillCb || strokeCb)) return;
25404
+ const {
25405
+ light: light
25406
+ } = drawContext.stage || {},
25407
+ face3d = rect.findFace();
25408
+ if (!1 !== fill) {
25409
+ context.setCommonStyle(rect, rect.attribute, x, y, rectAttribute);
25410
+ let fc = fill;
25411
+ "string" != typeof fc && (fc = "black"), this.fill(x, y, z, face3d, null, fc, context, light, null, null, fillCb);
25412
+ }
25413
+ !1 !== stroke && (context.setStrokeStyle(rect, rect.attribute, x, y, rectAttribute), this.stroke(x, y, z, face3d, context));
25414
+ }
25415
+ draw(rect, renderService, drawContext) {
25416
+ const rectAttribute = getTheme$1(rect).rect;
25417
+ this._draw(rect, rectAttribute, !1, drawContext);
25418
+ }
25419
+ }
25420
+
25177
25421
  class DefaultCanvasSymbolRender extends BaseRender {
25178
25422
  constructor(graphicRenderContributions) {
25179
25423
  super(), this.graphicRenderContributions = graphicRenderContributions, this.numberType = SYMBOL_NUMBER_TYPE, this.builtinContributions = [defaultSymbolRenderContribution, defaultSymbolBackgroundRenderContribution, defaultSymbolTextureRenderContribution, defaultSymbolClipRangeStrokeRenderContribution], this.init(graphicRenderContributions);
@@ -25536,18 +25780,49 @@
25536
25780
  }
25537
25781
  }
25538
25782
 
25539
- const repeatStr = ["", "repeat-x", "repeat-y", "repeat"];
25540
- function resolveImageRepeatMode(repeatX, repeatY) {
25541
- let repeat = 0;
25542
- return "repeat" === repeatX && (repeat |= 1), "repeat" === repeatY && (repeat |= 2), repeat ? repeatStr[repeat] : "no-repeat";
25543
- }
25544
- function resolveImageMode({
25545
- repeatX = "no-repeat",
25546
- repeatY = "no-repeat",
25547
- imageMode: imageMode
25548
- }) {
25549
- const repeatMode = resolveImageRepeatMode(repeatX, repeatY);
25550
- return {
25783
+ class DefaultCanvasPyramid3dRender extends Base3dRender {
25784
+ constructor() {
25785
+ super(...arguments), this.type = "pyramid3d", this.numberType = PYRAMID3D_NUMBER_TYPE;
25786
+ }
25787
+ drawShape(pyramid3d, context, x, y, drawContext, params, fillCb, strokeCb) {
25788
+ var _a;
25789
+ const pyramidAttribute = getTheme$1(pyramid3d, null == params ? void 0 : params.theme).polygon,
25790
+ {
25791
+ fill = pyramidAttribute.fill,
25792
+ stroke = pyramidAttribute.stroke,
25793
+ face = [!0, !0, !0, !0, !0, !0]
25794
+ } = pyramid3d.attribute,
25795
+ z = null !== (_a = this.z) && void 0 !== _a ? _a : 0;
25796
+ if (!this.valid(pyramid3d, pyramidAttribute, fillCb, strokeCb)) return;
25797
+ const {
25798
+ light: light
25799
+ } = drawContext.stage || {},
25800
+ face3d = pyramid3d.findFace();
25801
+ if (!1 !== fill) {
25802
+ context.setCommonStyle(pyramid3d, pyramid3d.attribute, x, y, pyramidAttribute);
25803
+ let fc = fill;
25804
+ "string" != typeof fc && (fc = "black"), this.fill(x, y, z, face3d, face, fc, context, light, pyramid3d, pyramidAttribute, fillCb);
25805
+ }
25806
+ !1 !== stroke && (context.setStrokeStyle(pyramid3d, pyramid3d.attribute, x, y, pyramidAttribute), this.stroke(x, y, z, face3d, context));
25807
+ }
25808
+ draw(pyramid3d, renderService, drawContext) {
25809
+ const pyramid3dAttribute = getTheme$1(pyramid3d).polygon;
25810
+ this._draw(pyramid3d, pyramid3dAttribute, !1, drawContext);
25811
+ }
25812
+ }
25813
+
25814
+ const repeatStr = ["", "repeat-x", "repeat-y", "repeat"];
25815
+ function resolveImageRepeatMode(repeatX, repeatY) {
25816
+ let repeat = 0;
25817
+ return "repeat" === repeatX && (repeat |= 1), "repeat" === repeatY && (repeat |= 2), repeat ? repeatStr[repeat] : "no-repeat";
25818
+ }
25819
+ function resolveImageMode({
25820
+ repeatX = "no-repeat",
25821
+ repeatY = "no-repeat",
25822
+ imageMode: imageMode
25823
+ }) {
25824
+ const repeatMode = resolveImageRepeatMode(repeatX, repeatY);
25825
+ return {
25551
25826
  repeatMode: repeatMode,
25552
25827
  sizingMode: "no-repeat" === repeatMode && null != imageMode ? imageMode : "fill"
25553
25828
  };
@@ -27145,129 +27420,6 @@
27145
27420
  }
27146
27421
  const imageModule = bindImageRenderModule;
27147
27422
 
27148
- class Base3dRender extends BaseRender {
27149
- stroke(x, y, z, face3d, context) {
27150
- const vertices = face3d.vertices;
27151
- face3d.edges.forEach(edge => {
27152
- const p1 = vertices[edge[0]],
27153
- v1 = {
27154
- x: x + p1[0],
27155
- y: y + p1[1],
27156
- z: z + p1[2]
27157
- },
27158
- p2 = vertices[edge[1]],
27159
- v2 = {
27160
- x: x + p2[0],
27161
- y: y + p2[1],
27162
- z: z + p2[2]
27163
- };
27164
- context.beginPath(), context.moveTo(v1.x, v1.y, v1.z), context.lineTo(v2.x, v2.y, v2.z), context.stroke();
27165
- });
27166
- }
27167
- fill(x, y, z, face3d, faces, fillColor, context, light, graphic3d, graphic3dAttribute, fillCb) {
27168
- const rgbArray = ColorStore.Get(fillColor, ColorType.Color255),
27169
- vertices = face3d.vertices,
27170
- viewdVerticesZ = vertices.map(v => context.view(v[0], v[1], v[2])[2]),
27171
- sortFace = [];
27172
- face3d.polygons.forEach((p, i) => {
27173
- if (faces && !faces[i]) return;
27174
- sortFace.push({
27175
- faceIdx: i,
27176
- polygon: p
27177
- });
27178
- const {
27179
- polygon: polygon
27180
- } = p,
27181
- z1 = viewdVerticesZ[polygon[0]],
27182
- z2 = viewdVerticesZ[polygon[1]],
27183
- z3 = viewdVerticesZ[polygon[2]],
27184
- z4 = viewdVerticesZ[polygon[3]];
27185
- p.ave_z = z1 + z2 + z3 + z4;
27186
- }), sortFace.sort((a, b) => b.polygon.ave_z - a.polygon.ave_z), sortFace.forEach(item => {
27187
- const {
27188
- polygon: polygon,
27189
- normal: normal
27190
- } = item.polygon,
27191
- p1 = vertices[polygon[0]],
27192
- p2 = vertices[polygon[1]],
27193
- p3 = vertices[polygon[2]],
27194
- p4 = vertices[polygon[3]],
27195
- v1 = {
27196
- x: x + p1[0],
27197
- y: y + p1[1],
27198
- z: z + p1[2]
27199
- },
27200
- v2 = {
27201
- x: x + p2[0],
27202
- y: y + p2[1],
27203
- z: z + p2[2]
27204
- },
27205
- v3 = {
27206
- x: x + p3[0],
27207
- y: y + p3[1],
27208
- z: z + p3[2]
27209
- },
27210
- v4 = {
27211
- x: x + p4[0],
27212
- y: y + p4[1],
27213
- z: z + p4[2]
27214
- };
27215
- 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());
27216
- });
27217
- }
27218
- }
27219
-
27220
- class DefaultCanvasRect3dRender extends Base3dRender {
27221
- constructor() {
27222
- super(...arguments), this.type = "rect3d", this.numberType = RECT3D_NUMBER_TYPE;
27223
- }
27224
- drawShape(rect, context, x, y, drawContext, params, fillCb, strokeCb) {
27225
- var _a, _b;
27226
- const rectAttribute = getTheme$1(rect, null == params ? void 0 : params.theme).rect,
27227
- {
27228
- fill = rectAttribute.fill,
27229
- stroke = rectAttribute.stroke,
27230
- x1: x1,
27231
- y1: y1,
27232
- x: originX,
27233
- y: originY,
27234
- opacity = rectAttribute.opacity,
27235
- fillOpacity = rectAttribute.fillOpacity,
27236
- lineWidth = rectAttribute.lineWidth,
27237
- strokeOpacity = rectAttribute.strokeOpacity,
27238
- visible = rectAttribute.visible,
27239
- drawStrokeWhenZeroWH = null !== (_a = rectAttribute.drawStrokeWhenZeroWH) && void 0 !== _a && _a
27240
- } = rect.attribute;
27241
- let {
27242
- width: width,
27243
- height: height
27244
- } = rect.attribute;
27245
- width = (null != width ? width : x1 - originX) || 0, height = (null != height ? height : y1 - originY) || 0;
27246
- const z = null !== (_b = this.z) && void 0 !== _b ? _b : 0,
27247
- fVisible = rectFillVisible(opacity, fillOpacity, width, height, fill),
27248
- sVisible = rectStrokeVisible(opacity, strokeOpacity, width, height, drawStrokeWhenZeroWH),
27249
- doFill = runFill(fill),
27250
- doStroke = runStroke(stroke, lineWidth);
27251
- if (!rect.valid || !visible) return;
27252
- if (!doFill && !doStroke) return;
27253
- if (!(fVisible || sVisible || fillCb || strokeCb)) return;
27254
- const {
27255
- light: light
27256
- } = drawContext.stage || {},
27257
- face3d = rect.findFace();
27258
- if (!1 !== fill) {
27259
- context.setCommonStyle(rect, rect.attribute, x, y, rectAttribute);
27260
- let fc = fill;
27261
- "string" != typeof fc && (fc = "black"), this.fill(x, y, z, face3d, null, fc, context, light, null, null, fillCb);
27262
- }
27263
- !1 !== stroke && (context.setStrokeStyle(rect, rect.attribute, x, y, rectAttribute), this.stroke(x, y, z, face3d, context));
27264
- }
27265
- draw(rect, renderService, drawContext) {
27266
- const rectAttribute = getTheme$1(rect).rect;
27267
- this._draw(rect, rectAttribute, !1, drawContext);
27268
- }
27269
- }
27270
-
27271
27423
  const loadedRect3dModuleContexts = new WeakSet();
27272
27424
  function bindRect3dRenderModule({
27273
27425
  bind: bind
@@ -27276,127 +27428,6 @@
27276
27428
  }
27277
27429
  const rect3dModule = bindRect3dRenderModule;
27278
27430
 
27279
- function drawArcPath(arc, context, cx, cy, z, outerRadius, innerRadius) {
27280
- const {
27281
- startAngle: startAngle,
27282
- endAngle: endAngle
27283
- } = arc.getParsedAngle(),
27284
- deltaAngle = abs$1(endAngle - startAngle),
27285
- clockwise = endAngle > startAngle;
27286
- let collapsedToLine = !1;
27287
- if (outerRadius < innerRadius) {
27288
- const temp = outerRadius;
27289
- outerRadius = innerRadius, innerRadius = temp;
27290
- }
27291
- 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 {
27292
- const {
27293
- outerDeltaAngle: outerDeltaAngle,
27294
- innerDeltaAngle: innerDeltaAngle,
27295
- outerStartAngle: outerStartAngle,
27296
- outerEndAngle: outerEndAngle,
27297
- innerEndAngle: innerEndAngle,
27298
- innerStartAngle: innerStartAngle
27299
- } = arc.getParsePadAngle(startAngle, endAngle),
27300
- xors = outerRadius * cos$1(outerStartAngle),
27301
- yors = outerRadius * sin$1(outerStartAngle),
27302
- xire = innerRadius * cos$1(innerEndAngle),
27303
- yire = innerRadius * sin$1(innerEndAngle);
27304
- 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));
27305
- }
27306
- return context.closePath(), collapsedToLine;
27307
- }
27308
- function drawInnerOuterArcPath(arc, context, cx, cy, z1, z2, radius, getParsePadAngle) {
27309
- const {
27310
- startAngle: startAngle,
27311
- endAngle: endAngle
27312
- } = arc.getParsedAngle(),
27313
- deltaAngle = abs$1(endAngle - startAngle),
27314
- clockwise = endAngle > startAngle;
27315
- let collapsedToLine = !1;
27316
- 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 {
27317
- const {
27318
- innerouterDeltaAngle: innerouterDeltaAngle,
27319
- innerouterStartAngle: innerouterStartAngle,
27320
- innerouterEndAngle: innerouterEndAngle
27321
- } = getParsePadAngle(startAngle, endAngle),
27322
- xors = radius * cos$1(innerouterStartAngle),
27323
- yors = radius * sin$1(innerouterStartAngle),
27324
- xore = radius * cos$1(innerouterEndAngle),
27325
- yore = radius * sin$1(innerouterEndAngle);
27326
- 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));
27327
- }
27328
- return context.closePath(), collapsedToLine;
27329
- }
27330
- class DefaultCanvasArc3DRender extends BaseRender {
27331
- constructor() {
27332
- super(...arguments), this.numberType = ARC3D_NUMBER_TYPE;
27333
- }
27334
- drawShape(arc, context, x, y, drawContext, params, fillCb, strokeCb) {
27335
- var _a;
27336
- const arcAttribute = getTheme$1(arc, null == params ? void 0 : params.theme).arc,
27337
- {
27338
- fill = arcAttribute.fill
27339
- } = arc.attribute,
27340
- data = this.valid(arc, arcAttribute, fillCb, strokeCb);
27341
- if (!data) return;
27342
- const {
27343
- fVisible: fVisible,
27344
- sVisible: sVisible,
27345
- doFill: doFill,
27346
- doStroke: doStroke
27347
- } = data,
27348
- z = null !== (_a = this.z) && void 0 !== _a ? _a : 0,
27349
- {
27350
- outerPadding = arcAttribute.outerPadding,
27351
- innerPadding = arcAttribute.innerPadding,
27352
- height = 10
27353
- } = arc.attribute;
27354
- let {
27355
- outerRadius = arcAttribute.outerRadius,
27356
- innerRadius = arcAttribute.innerRadius
27357
- } = arc.attribute;
27358
- outerRadius += outerPadding, innerRadius -= innerPadding;
27359
- const rgbArray = ColorStore.Get(fill, ColorType.Color255),
27360
- {
27361
- light: light
27362
- } = drawContext.stage || {},
27363
- face = drawContext.hack_pieFace,
27364
- z_face = {
27365
- top: z,
27366
- bottom: z + height
27367
- },
27368
- n_face = {
27369
- top: [0, 1, 0],
27370
- bottom: [0, -1, 0],
27371
- outside: [1, 0, -1],
27372
- inside: [1, 0, -1]
27373
- };
27374
- "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) => {
27375
- const {
27376
- outerDeltaAngle: outerDeltaAngle,
27377
- innerDeltaAngle: innerDeltaAngle,
27378
- outerStartAngle: outerStartAngle,
27379
- outerEndAngle: outerEndAngle,
27380
- innerEndAngle: innerEndAngle,
27381
- innerStartAngle: innerStartAngle
27382
- } = arc.getParsePadAngle(startAngle, endAngle);
27383
- return "outside" === face ? {
27384
- innerouterDeltaAngle: outerDeltaAngle,
27385
- innerouterEndAngle: outerEndAngle,
27386
- innerouterStartAngle: outerStartAngle
27387
- } : {
27388
- innerouterDeltaAngle: innerDeltaAngle,
27389
- innerouterEndAngle: innerEndAngle,
27390
- innerouterStartAngle: innerStartAngle
27391
- };
27392
- }), 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());
27393
- }
27394
- draw(arc, renderService, drawContext, params) {
27395
- const arcAttribute = getTheme$1(arc, null == params ? void 0 : params.theme).arc;
27396
- this._draw(arc, arcAttribute, !1, drawContext, params);
27397
- }
27398
- }
27399
-
27400
27431
  const loadedArc3dModuleContexts = new WeakSet();
27401
27432
  function bindArc3dRenderModule({
27402
27433
  bind: bind
@@ -27405,37 +27436,6 @@
27405
27436
  }
27406
27437
  const arc3dModule = bindArc3dRenderModule;
27407
27438
 
27408
- class DefaultCanvasPyramid3dRender extends Base3dRender {
27409
- constructor() {
27410
- super(...arguments), this.type = "pyramid3d", this.numberType = PYRAMID3D_NUMBER_TYPE;
27411
- }
27412
- drawShape(pyramid3d, context, x, y, drawContext, params, fillCb, strokeCb) {
27413
- var _a;
27414
- const pyramidAttribute = getTheme$1(pyramid3d, null == params ? void 0 : params.theme).polygon,
27415
- {
27416
- fill = pyramidAttribute.fill,
27417
- stroke = pyramidAttribute.stroke,
27418
- face = [!0, !0, !0, !0, !0, !0]
27419
- } = pyramid3d.attribute,
27420
- z = null !== (_a = this.z) && void 0 !== _a ? _a : 0;
27421
- if (!this.valid(pyramid3d, pyramidAttribute, fillCb, strokeCb)) return;
27422
- const {
27423
- light: light
27424
- } = drawContext.stage || {},
27425
- face3d = pyramid3d.findFace();
27426
- if (!1 !== fill) {
27427
- context.setCommonStyle(pyramid3d, pyramid3d.attribute, x, y, pyramidAttribute);
27428
- let fc = fill;
27429
- "string" != typeof fc && (fc = "black"), this.fill(x, y, z, face3d, face, fc, context, light, pyramid3d, pyramidAttribute, fillCb);
27430
- }
27431
- !1 !== stroke && (context.setStrokeStyle(pyramid3d, pyramid3d.attribute, x, y, pyramidAttribute), this.stroke(x, y, z, face3d, context));
27432
- }
27433
- draw(pyramid3d, renderService, drawContext) {
27434
- const pyramid3dAttribute = getTheme$1(pyramid3d).polygon;
27435
- this._draw(pyramid3d, pyramid3dAttribute, !1, drawContext);
27436
- }
27437
- }
27438
-
27439
27439
  const loadedPyramid3dModuleContexts = new WeakSet();
27440
27440
  function bindPyramid3dRenderModule({
27441
27441
  bind: bind