@visactor/vrender 1.0.46-alpha.2 → 1.0.47-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/cjs/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import '@visactor/vrender-core';
2
- export declare const version = "1.0.46-alpha.2";
2
+ export declare const version = "1.0.47-alpha.0";
3
3
  export * from '@visactor/vrender-core';
4
4
  export * from '@visactor/vrender-kits';
5
5
  export * from '@visactor/vrender-animate';
package/cjs/index.js CHANGED
@@ -21,7 +21,7 @@ Object.defineProperty(exports, "__esModule", {
21
21
 
22
22
  const vrender_core_1 = require("@visactor/vrender-core"), vrender_kits_1 = require("@visactor/vrender-kits"), vrender_kits_2 = require("@visactor/vrender-kits"), vrender_animate_1 = require("@visactor/vrender-animate");
23
23
 
24
- exports.version = "1.0.46-alpha.2", (0, vrender_core_1.preLoadAllModule)(), (0,
24
+ exports.version = "1.0.47-alpha.0", (0, vrender_core_1.preLoadAllModule)(), (0,
25
25
  vrender_core_1.isBrowserEnv)() ? (0, vrender_kits_1.loadBrowserEnv)(vrender_core_1.container) : (0,
26
26
  vrender_core_1.isNodeEnv)() && (0, vrender_kits_1.loadNodeEnv)(vrender_core_1.container),
27
27
  (0, vrender_kits_2.registerArc)(), (0, vrender_kits_2.registerArc3d)(), (0, vrender_kits_2.registerArea)(),
package/cjs/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,kCAAgC;AAChC,yDAWgC;AAChC,yDAAmF;AACnF,yDAmBgC;AAChC,+DAAmF;AAEtE,QAAA,OAAO,GAAG,gBAAgB,CAAC;AAExC,IAAA,+BAAgB,GAAE,CAAC;AAEnB,IAAI,IAAA,2BAAY,GAAE,EAAE;IAClB,IAAA,6BAAc,EAAC,wBAAS,CAAC,CAAC;CAC3B;KAAM,IAAI,IAAA,wBAAS,GAAE,EAAE;IACtB,IAAA,0BAAW,EAAC,wBAAS,CAAC,CAAC;CACxB;AACD,IAAA,0BAAW,GAAE,CAAC;AACd,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,6BAAc,GAAE,CAAC;AACjB,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,8BAAe,GAAE,CAAC;AAClB,IAAA,gCAAiB,GAAE,CAAC;AACpB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,6BAAc,GAAE,CAAC;AACjB,IAAA,+BAAgB,GAAE,CAAC;AACnB,IAAA,iCAAkB,GAAE,CAAC;AACrB,IAAA,6BAAc,GAAE,CAAC;AACjB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,+BAAgB,GAAE,CAAC;AACnB,IAAA,2BAAY,GAAE,CAAC;AAEf,IAAA,uCAAwB,GAAE,CAAC;AAC3B,IAAA,4CAA6B,GAAE,CAAC;AAChC,IAAA,0CAA2B,GAAE,CAAC;AAC9B,IAAA,2CAA4B,GAAE,CAAC;AAC/B,IAAA,uCAAwB,GAAE,CAAC;AAC3B,IAAA,kCAAmB,GAAE,CAAC;AAEtB,IAAA,uCAAqB,GAAE,CAAC;AACxB,IAAA,iCAAe,GAAE,CAAC;AAElB,yDAAuC;AACvC,yDAAuC;AACvC,4DAA0C;AAC1C,+DAA6C;AAG7C,6DAAkD;AAAzC,wGAAA,KAAK,OAAA;AACd,uDAAmD;AAA1C,yGAAA,SAAS,OAAA","file":"index.js","sourcesContent":["import '@visactor/vrender-core';\nimport {\n container,\n isBrowserEnv,\n isNodeEnv,\n preLoadAllModule,\n registerFlexLayoutPlugin,\n registerViewTransform3dPlugin,\n registerHtmlAttributePlugin,\n registerReactAttributePlugin,\n registerDirectionalLight,\n registerOrthoCamera\n} from '@visactor/vrender-core';\nimport { loadBrowserEnv, loadNodeEnv, registerStar } from '@visactor/vrender-kits';\nimport {\n registerArc,\n registerArc3d,\n registerArea,\n registerCircle,\n registerGlyph,\n registerGroup,\n registerImage,\n registerLine,\n registerPath,\n registerPolygon,\n registerPyramid3d,\n registerRect,\n registerRect3d,\n registerRichtext,\n registerShadowRoot,\n registerSymbol,\n registerText,\n registerWrapText\n} from '@visactor/vrender-kits';\nimport { registerCustomAnimate, registerAnimate } from '@visactor/vrender-animate';\n// 导出版本号\nexport const version = \"1.0.46-alpha.2\";\n\npreLoadAllModule();\n\nif (isBrowserEnv()) {\n loadBrowserEnv(container);\n} else if (isNodeEnv()) {\n loadNodeEnv(container);\n}\nregisterArc();\nregisterArc3d();\nregisterArea();\nregisterCircle();\nregisterGlyph();\nregisterGroup();\nregisterImage();\nregisterLine();\nregisterPath();\nregisterPolygon();\nregisterPyramid3d();\nregisterRect();\nregisterRect3d();\nregisterRichtext();\nregisterShadowRoot();\nregisterSymbol();\nregisterText();\nregisterWrapText();\nregisterStar();\n\nregisterFlexLayoutPlugin();\nregisterViewTransform3dPlugin();\nregisterHtmlAttributePlugin();\nregisterReactAttributePlugin();\nregisterDirectionalLight();\nregisterOrthoCamera();\n\nregisterCustomAnimate();\nregisterAnimate();\n\nexport * from '@visactor/vrender-core';\nexport * from '@visactor/vrender-kits';\nexport * from '@visactor/vrender-animate';\nexport * from '@visactor/vrender-components';\n\n// avoid naming conflicts with 'State' & 'Direction' in '@visactor/vrender-components'\nexport { State } from '@visactor/vrender-animate';\nexport { Direction } from '@visactor/vrender-core';\n"]}
1
+ {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,kCAAgC;AAChC,yDAWgC;AAChC,yDAAmF;AACnF,yDAmBgC;AAChC,+DAAmF;AAEtE,QAAA,OAAO,GAAG,gBAAgB,CAAC;AAExC,IAAA,+BAAgB,GAAE,CAAC;AAEnB,IAAI,IAAA,2BAAY,GAAE,EAAE;IAClB,IAAA,6BAAc,EAAC,wBAAS,CAAC,CAAC;CAC3B;KAAM,IAAI,IAAA,wBAAS,GAAE,EAAE;IACtB,IAAA,0BAAW,EAAC,wBAAS,CAAC,CAAC;CACxB;AACD,IAAA,0BAAW,GAAE,CAAC;AACd,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,6BAAc,GAAE,CAAC;AACjB,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,8BAAe,GAAE,CAAC;AAClB,IAAA,gCAAiB,GAAE,CAAC;AACpB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,6BAAc,GAAE,CAAC;AACjB,IAAA,+BAAgB,GAAE,CAAC;AACnB,IAAA,iCAAkB,GAAE,CAAC;AACrB,IAAA,6BAAc,GAAE,CAAC;AACjB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,+BAAgB,GAAE,CAAC;AACnB,IAAA,2BAAY,GAAE,CAAC;AAEf,IAAA,uCAAwB,GAAE,CAAC;AAC3B,IAAA,4CAA6B,GAAE,CAAC;AAChC,IAAA,0CAA2B,GAAE,CAAC;AAC9B,IAAA,2CAA4B,GAAE,CAAC;AAC/B,IAAA,uCAAwB,GAAE,CAAC;AAC3B,IAAA,kCAAmB,GAAE,CAAC;AAEtB,IAAA,uCAAqB,GAAE,CAAC;AACxB,IAAA,iCAAe,GAAE,CAAC;AAElB,yDAAuC;AACvC,yDAAuC;AACvC,4DAA0C;AAC1C,+DAA6C;AAG7C,6DAAkD;AAAzC,wGAAA,KAAK,OAAA;AACd,uDAAmD;AAA1C,yGAAA,SAAS,OAAA","file":"index.js","sourcesContent":["import '@visactor/vrender-core';\nimport {\n container,\n isBrowserEnv,\n isNodeEnv,\n preLoadAllModule,\n registerFlexLayoutPlugin,\n registerViewTransform3dPlugin,\n registerHtmlAttributePlugin,\n registerReactAttributePlugin,\n registerDirectionalLight,\n registerOrthoCamera\n} from '@visactor/vrender-core';\nimport { loadBrowserEnv, loadNodeEnv, registerStar } from '@visactor/vrender-kits';\nimport {\n registerArc,\n registerArc3d,\n registerArea,\n registerCircle,\n registerGlyph,\n registerGroup,\n registerImage,\n registerLine,\n registerPath,\n registerPolygon,\n registerPyramid3d,\n registerRect,\n registerRect3d,\n registerRichtext,\n registerShadowRoot,\n registerSymbol,\n registerText,\n registerWrapText\n} from '@visactor/vrender-kits';\nimport { registerCustomAnimate, registerAnimate } from '@visactor/vrender-animate';\n// 导出版本号\nexport const version = \"1.0.47-alpha.0\";\n\npreLoadAllModule();\n\nif (isBrowserEnv()) {\n loadBrowserEnv(container);\n} else if (isNodeEnv()) {\n loadNodeEnv(container);\n}\nregisterArc();\nregisterArc3d();\nregisterArea();\nregisterCircle();\nregisterGlyph();\nregisterGroup();\nregisterImage();\nregisterLine();\nregisterPath();\nregisterPolygon();\nregisterPyramid3d();\nregisterRect();\nregisterRect3d();\nregisterRichtext();\nregisterShadowRoot();\nregisterSymbol();\nregisterText();\nregisterWrapText();\nregisterStar();\n\nregisterFlexLayoutPlugin();\nregisterViewTransform3dPlugin();\nregisterHtmlAttributePlugin();\nregisterReactAttributePlugin();\nregisterDirectionalLight();\nregisterOrthoCamera();\n\nregisterCustomAnimate();\nregisterAnimate();\n\nexport * from '@visactor/vrender-core';\nexport * from '@visactor/vrender-kits';\nexport * from '@visactor/vrender-animate';\nexport * from '@visactor/vrender-components';\n\n// avoid naming conflicts with 'State' & 'Direction' in '@visactor/vrender-components'\nexport { State } from '@visactor/vrender-animate';\nexport { Direction } from '@visactor/vrender-core';\n"]}
package/dist/index.es.js CHANGED
@@ -4685,9 +4685,7 @@ const DefaultStyle = Object.assign(Object.assign(Object.assign(Object.assign({
4685
4685
  background: null,
4686
4686
  autoAnimateTexture: !1,
4687
4687
  textureRatio: 1,
4688
- textureOptions: {
4689
- alignToGraphic: !0
4690
- },
4688
+ textureOptions: null,
4691
4689
  backgroundOpacity: 1,
4692
4690
  backgroundCornerRadius: 0,
4693
4691
  texture: null,
@@ -4743,6 +4741,7 @@ const DefaultAttribute = Object.assign(Object.assign(Object.assign({
4743
4741
  shadowPickMode: "graphic",
4744
4742
  keepStrokeScale: !1,
4745
4743
  clipConfig: null,
4744
+ pathProxy: null,
4746
4745
  roughStyle: null
4747
4746
  }, DefaultDebugAttribute), DefaultStyle), DefaultTransform);
4748
4747
  function addAttributeToPrototype(obj, c, keys) {
@@ -9453,7 +9452,7 @@ const _tempBounds$1 = new AABBBounds(),
9453
9452
  tempMatrix = new Matrix();
9454
9453
  new AABBBounds();
9455
9454
  const PURE_STYLE_KEY = ["stroke", "opacity", "strokeOpacity", "lineDash", "lineDashOffset", "lineCap", "lineJoin", "miterLimit", "fill", "fillOpacity"];
9456
- const GRAPHIC_UPDATE_TAG_KEY = ["lineWidth", "scaleX", "scaleY", "angle", "anchor", "visible"];
9455
+ const GRAPHIC_UPDATE_TAG_KEY = ["lineWidth", "pathProxy", "scaleX", "scaleY", "angle", "anchor", "visible"];
9457
9456
  const tempConstantXYKey = ["x", "y"],
9458
9457
  tempConstantScaleXYKey = ["scaleX", "scaleY"],
9459
9458
  tempConstantAngleKey = ["angle"],
@@ -9514,7 +9513,7 @@ class Graphic extends Node {
9514
9513
  }
9515
9514
  constructor(params = {}) {
9516
9515
  var _a;
9517
- super(), this._AABBBounds = new AABBBounds(), this._updateTag = UpdateTag.INIT, this.attribute = params, this.valid = this.isValid(), this.updateAABBBoundsStamp = 0, params.background && this.loadImage(null !== (_a = params.background.background) && void 0 !== _a ? _a : params.background, !0), isExternalTexture(params.texture) ? this.loadImage(params.texture, !1) : params.shadowGraphic && this.setShadowGraphic(params.shadowGraphic);
9516
+ super(), this._AABBBounds = new AABBBounds(), this._updateTag = UpdateTag.INIT, this.attribute = params, this.valid = this.isValid(), this.updateAABBBoundsStamp = 0, params.background && this.loadImage(null !== (_a = params.background.background) && void 0 !== _a ? _a : params.background, !0), isExternalTexture(params.texture) && this.loadImage(params.texture, !1), params.shadowGraphic && this.setShadowGraphic(params.shadowGraphic);
9518
9517
  }
9519
9518
  getGraphicService() {
9520
9519
  var _a, _b;
@@ -9634,7 +9633,7 @@ class Graphic extends Node {
9634
9633
  return paddingArray && bounds.expand(paddingArray), this.clearUpdateBoundTag(), bounds;
9635
9634
  }
9636
9635
  updatePathProxyAABBBounds(aabbBounds) {
9637
- const path = "function" == typeof this.pathProxy ? this.pathProxy(this.attribute) : this.pathProxy;
9636
+ const path = this.getPathProxy();
9638
9637
  if (!path) return !1;
9639
9638
  const boundsContext = new BoundsContext(aabbBounds);
9640
9639
  return renderCommandList(path.commandList, boundsContext, 0, 0), !0;
@@ -9703,7 +9702,7 @@ class Graphic extends Node {
9703
9702
  });
9704
9703
  }
9705
9704
  setAttributes(params, forceUpdateTag = !1, context) {
9706
- params && ((params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(params, this.attribute, null, context) || params).background && this.loadImage(params.background, !0), isExternalTexture(params.texture) ? this.loadImage(params.texture, !1) : params.shadowGraphic && this.setShadowGraphic(params.shadowGraphic), this._setAttributes(params, forceUpdateTag, context));
9705
+ params && ((params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(params, this.attribute, null, context) || params).background && this.loadImage(params.background, !0), isExternalTexture(params.texture) && this.loadImage(params.texture, !1), params.shadowGraphic && this.setShadowGraphic(params.shadowGraphic), this._setAttributes(params, forceUpdateTag, context));
9707
9706
  }
9708
9707
  _setAttributes(params, forceUpdateTag = !1, context) {
9709
9708
  const keys = Object.keys(params);
@@ -9737,7 +9736,7 @@ class Graphic extends Node {
9737
9736
  const context = {
9738
9737
  type: AttributeUpdateType.INIT
9739
9738
  };
9740
- params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(params, this.attribute, null, context) || params, this.attribute = params, params.background && this.loadImage(params.background, !0), isExternalTexture(params.texture) ? this.loadImage(params.texture, !1) : params.shadowGraphic && this.setShadowGraphic(params.shadowGraphic), this._updateTag = UpdateTag.INIT, this.valid = this.isValid(), this.onAttributeUpdate(context);
9739
+ params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(params, this.attribute, null, context) || params, this.attribute = params, params.background && this.loadImage(params.background, !0), isExternalTexture(params.texture) && this.loadImage(params.texture, !1), params.shadowGraphic && this.setShadowGraphic(params.shadowGraphic), this._updateTag = UpdateTag.INIT, this.valid = this.isValid(), this.onAttributeUpdate(context);
9741
9740
  }
9742
9741
  translate(x, y) {
9743
9742
  var _a, _b;
@@ -10067,7 +10066,16 @@ class Graphic extends Node {
10067
10066
  };
10068
10067
  }
10069
10068
  createPathProxy(path) {
10070
- return isString$1(path, !0) ? this.pathProxy = new CustomPath2D().fromString(path) : this.pathProxy = new CustomPath2D(), this.pathProxy;
10069
+ const proxy = isString$1(path, !0) ? new CustomPath2D().fromString(path) : new CustomPath2D();
10070
+ return this.pathProxy = proxy, this.attribute.pathProxy = proxy, this.addUpdateShapeAndBoundsTag(), this.onAttributeUpdate(), proxy;
10071
+ }
10072
+ getPathProxy() {
10073
+ var _a;
10074
+ const attributePathProxy = null === (_a = this.attribute) || void 0 === _a ? void 0 : _a.pathProxy,
10075
+ rawPathProxy = null != attributePathProxy ? attributePathProxy : this.pathProxy;
10076
+ if (!rawPathProxy) return null;
10077
+ const resolvedPathProxy = "function" == typeof rawPathProxy ? rawPathProxy(this.attribute) : rawPathProxy;
10078
+ return resolvedPathProxy ? isString$1(resolvedPathProxy, !0) ? new CustomPath2D().fromString(resolvedPathProxy) : resolvedPathProxy : null;
10071
10079
  }
10072
10080
  loadImage(image, background = !1) {
10073
10081
  if (background && (null == image ? void 0 : image.background) && (image = image.background), background && (!image || backgroundNotImage(image))) return void (this.backgroundImg = !1);
@@ -10117,6 +10125,8 @@ class Graphic extends Node {
10117
10125
  }
10118
10126
  toCustomPath() {
10119
10127
  var _a, _b, _c;
10128
+ const pathProxy = this.getPathProxy();
10129
+ if (pathProxy) return pathProxy;
10120
10130
  const renderer = null === (_c = null === (_b = (null === (_a = this.stage) || void 0 === _a ? void 0 : _a.renderService) || application.renderService) || void 0 === _b ? void 0 : _b.drawContribution) || void 0 === _c ? void 0 : _c.getRenderContribution(this);
10121
10131
  if (renderer) {
10122
10132
  const context = new EmptyContext2d(null, 1);
@@ -10879,7 +10889,8 @@ let DefaultGraphicService = class {
10879
10889
  this.hooks.clearAABBBounds.taps.length && this.hooks.clearAABBBounds.call(graphic, stage, b);
10880
10890
  }
10881
10891
  updatePathProxyAABBBounds(aabbBounds, graphic) {
10882
- const path = "function" == typeof graphic.pathProxy ? graphic.pathProxy(graphic.attribute) : graphic.pathProxy;
10892
+ var _a;
10893
+ const path = null === (_a = null == graphic ? void 0 : graphic.getPathProxy) || void 0 === _a ? void 0 : _a.call(graphic);
10883
10894
  if (!path) return !1;
10884
10895
  const boundsContext = new BoundsContext(aabbBounds);
10885
10896
  return renderCommandList(path.commandList, boundsContext, 0, 0), !0;
@@ -11825,7 +11836,7 @@ let Line$1 = class Line extends Graphic {
11825
11836
  return super.isValid() && this._isValid();
11826
11837
  }
11827
11838
  _isValid() {
11828
- if (this.pathProxy) return !0;
11839
+ if (this.getPathProxy()) return !0;
11829
11840
  const {
11830
11841
  points: points,
11831
11842
  segments: segments
@@ -13171,7 +13182,7 @@ class Area extends Graphic {
13171
13182
  return super.isValid() && this._isValid();
13172
13183
  }
13173
13184
  _isValid() {
13174
- if (this.pathProxy) return !0;
13185
+ if (this.getPathProxy()) return !0;
13175
13186
  const {
13176
13187
  points: points,
13177
13188
  segments: segments
@@ -14058,6 +14069,7 @@ class DefaultBaseClipRenderAfterContribution {
14058
14069
  }
14059
14070
  const defaultBaseClipRenderAfterContribution = new DefaultBaseClipRenderAfterContribution();
14060
14071
 
14072
+ const builtinProceduralTextureTypes = new Set(["circle", "diamond", "rect", "vertical-line", "horizontal-line", "bias-lr", "bias-rl", "grid"]);
14061
14073
  function formatRatio(ratio) {
14062
14074
  return ratio <= .5 ? 4 * ratio - 1 : -4 * ratio + 3;
14063
14075
  }
@@ -14278,7 +14290,7 @@ class DefaultBaseTextureRenderContribution {
14278
14290
  }
14279
14291
  }
14280
14292
  getPatternCacheKey(texture, textureSize, texturePadding, textureColor, dpr, textureRadius) {
14281
- return "string" != typeof texture ? texturePadding > 0 || textureRadius > 0 ? null : texture : "wave" === texture ? null : `${texture}-${textureSize}-${texturePadding}-${textureColor}-${dpr}`;
14293
+ return "string" != typeof texture ? texturePadding > 0 || textureRadius > 0 ? null : texture : "wave" === texture ? null : builtinProceduralTextureTypes.has(texture) ? `builtin:${texture}|size:${textureSize}|padding:${texturePadding}|color:${textureColor}|dpr:${dpr}` : `resource:${texture}|padding:${texturePadding}|radius:${textureRadius}|dpr:${dpr}`;
14282
14294
  }
14283
14295
  createResourcePattern(texture, graphic, context, texturePadding, textureRadius) {
14284
14296
  var _a;
@@ -14756,7 +14768,8 @@ class BaseRender {
14756
14768
  });
14757
14769
  }
14758
14770
  drawPathProxy(graphic, context, x, y, drawContext, params, fillCb, strokeCb) {
14759
- if (!graphic.pathProxy) return !1;
14771
+ const path = graphic.getPathProxy();
14772
+ if (!path) return !1;
14760
14773
  const themeAttributes = getTheme(graphic, null == params ? void 0 : params.theme)[graphic.type.replace("3d", "")],
14761
14774
  {
14762
14775
  fill = themeAttributes.fill,
@@ -14773,12 +14786,7 @@ class BaseRender {
14773
14786
  sVisible = strokeVisible(opacity, strokeOpacity),
14774
14787
  doFill = runFill(fill),
14775
14788
  doStroke = runStroke(stroke, lineWidth);
14776
- if (!visible) return !0;
14777
- if (!doFill && !doStroke) return !0;
14778
- if (!(fVisible || sVisible || fillCb || strokeCb)) return !0;
14779
- context.beginPath();
14780
- const path = "function" == typeof graphic.pathProxy ? graphic.pathProxy(graphic.attribute) : graphic.pathProxy;
14781
- return renderCommandList(path.commandList, context, x, y), context.setShadowBlendStyle && context.setShadowBlendStyle(graphic, graphic.attribute, themeAttributes), this.beforeRenderStep(graphic, context, x, y, doFill, doStroke, fVisible, sVisible, themeAttributes, drawContext, fillCb, strokeCb), doStroke && (strokeCb ? strokeCb(context, graphic.attribute, themeAttributes) : sVisible && (context.setStrokeStyle(graphic, graphic.attribute, x - originX, y - originY, themeAttributes), context.stroke())), doFill && (fillCb ? fillCb(context, graphic.attribute, themeAttributes) : fVisible && (context.setCommonStyle(graphic, graphic.attribute, x - originX, y - originY, themeAttributes), context.fill())), this.afterRenderStep(graphic, context, x, y, doFill, doStroke, fVisible, sVisible, themeAttributes, drawContext, fillCb, strokeCb), !0;
14789
+ return !visible || !doFill && !doStroke || !(fVisible || sVisible || fillCb || strokeCb) || (context.beginPath(), renderCommandList(path.commandList, context, x, y), context.setShadowBlendStyle && context.setShadowBlendStyle(graphic, graphic.attribute, themeAttributes), this.beforeRenderStep(graphic, context, x, y, doFill, doStroke, fVisible, sVisible, themeAttributes, drawContext, fillCb, strokeCb), doStroke && (strokeCb ? strokeCb(context, graphic.attribute, themeAttributes) : sVisible && (context.setStrokeStyle(graphic, graphic.attribute, x - originX, y - originY, themeAttributes), context.stroke())), doFill && (fillCb ? fillCb(context, graphic.attribute, themeAttributes) : fVisible && (context.setCommonStyle(graphic, graphic.attribute, x - originX, y - originY, themeAttributes), context.fill())), this.afterRenderStep(graphic, context, x, y, doFill, doStroke, fVisible, sVisible, themeAttributes, drawContext, fillCb, strokeCb), !0);
14782
14790
  }
14783
14791
  valid(graphic, defaultAttribute, fillCb, strokeCb) {
14784
14792
  const {
@@ -32765,9 +32773,8 @@ class MorphingPath extends ACustomAnimate {
32765
32773
  }
32766
32774
  onEnd() {}
32767
32775
  onUpdate(end, ratio, out) {
32768
- const target = this.target,
32769
- pathProxy = "function" == typeof target.pathProxy ? target.pathProxy(target.attribute) : target.pathProxy;
32770
- interpolateMorphingData(this.morphingData, pathProxy, ratio), this.otherAttrs && this.otherAttrs.length && interpolateOtherAttrs(this.otherAttrs, out, ratio), this.target.setAttributes(out), end && !this.saveOnEnd && (this.target.pathProxy = null);
32776
+ const pathProxy = this.target.getPathProxy();
32777
+ pathProxy && (interpolateMorphingData(this.morphingData, pathProxy, ratio), this.otherAttrs && this.otherAttrs.length && interpolateOtherAttrs(this.otherAttrs, out, ratio), this.target.setAttributes(out), end && !this.saveOnEnd && (this.target.pathProxy = null, this.target.setAttribute("pathProxy", null)));
32771
32778
  }
32772
32779
  }
32773
32780
  const morphPath = (fromGraphic, toGraphic, animationConfig, fromGraphicTransform) => {
@@ -32826,14 +32833,15 @@ class MultiToOneMorphingPath extends ACustomAnimate {
32826
32833
  }
32827
32834
  clearPathProxy() {
32828
32835
  this.target.shadowRoot.forEachChildren(child => {
32829
- child.pathProxy = null;
32836
+ child.pathProxy = null, child.setAttribute("pathProxy", null);
32830
32837
  });
32831
32838
  }
32832
32839
  onEnd() {}
32833
32840
  onUpdate(end, ratio, out) {
32834
32841
  this.target.shadowRoot.forEachChildren((child, index) => {
32835
32842
  var _a;
32836
- interpolateMorphingData(this.morphingData[index], "function" == typeof child.pathProxy ? child.pathProxy(child.attribute) : child.pathProxy, ratio), (null === (_a = this.otherAttrs) || void 0 === _a ? void 0 : _a[index]) && this.otherAttrs[index].length && interpolateOtherAttrs(this.otherAttrs[index], child.attribute, ratio);
32843
+ const pathProxy = child.getPathProxy();
32844
+ pathProxy && (interpolateMorphingData(this.morphingData[index], pathProxy, ratio), (null === (_a = this.otherAttrs) || void 0 === _a ? void 0 : _a[index]) && this.otherAttrs[index].length && interpolateOtherAttrs(this.otherAttrs[index], child.attribute, ratio));
32837
32845
  }), end && (this.clearPathProxy(), this.morphingData = null);
32838
32846
  }
32839
32847
  }
@@ -52992,7 +53000,7 @@ TableSeriesNumber.defaultAttributes = {
52992
53000
  select: !0
52993
53001
  };
52994
53002
 
52995
- const version = "1.0.46-alpha.2";
53003
+ const version = "1.0.47-alpha.0";
52996
53004
  preLoadAllModule();
52997
53005
  if (isBrowserEnv()) {
52998
53006
  loadBrowserEnv(container);
package/dist/index.js CHANGED
@@ -4691,9 +4691,7 @@
4691
4691
  background: null,
4692
4692
  autoAnimateTexture: !1,
4693
4693
  textureRatio: 1,
4694
- textureOptions: {
4695
- alignToGraphic: !0
4696
- },
4694
+ textureOptions: null,
4697
4695
  backgroundOpacity: 1,
4698
4696
  backgroundCornerRadius: 0,
4699
4697
  texture: null,
@@ -4749,6 +4747,7 @@
4749
4747
  shadowPickMode: "graphic",
4750
4748
  keepStrokeScale: !1,
4751
4749
  clipConfig: null,
4750
+ pathProxy: null,
4752
4751
  roughStyle: null
4753
4752
  }, DefaultDebugAttribute), DefaultStyle), DefaultTransform);
4754
4753
  function addAttributeToPrototype(obj, c, keys) {
@@ -9459,7 +9458,7 @@
9459
9458
  tempMatrix = new Matrix();
9460
9459
  new AABBBounds();
9461
9460
  const PURE_STYLE_KEY = ["stroke", "opacity", "strokeOpacity", "lineDash", "lineDashOffset", "lineCap", "lineJoin", "miterLimit", "fill", "fillOpacity"];
9462
- const GRAPHIC_UPDATE_TAG_KEY = ["lineWidth", "scaleX", "scaleY", "angle", "anchor", "visible"];
9461
+ const GRAPHIC_UPDATE_TAG_KEY = ["lineWidth", "pathProxy", "scaleX", "scaleY", "angle", "anchor", "visible"];
9463
9462
  const tempConstantXYKey = ["x", "y"],
9464
9463
  tempConstantScaleXYKey = ["scaleX", "scaleY"],
9465
9464
  tempConstantAngleKey = ["angle"],
@@ -9520,7 +9519,7 @@
9520
9519
  }
9521
9520
  constructor(params = {}) {
9522
9521
  var _a;
9523
- super(), this._AABBBounds = new AABBBounds(), this._updateTag = exports.UpdateTag.INIT, this.attribute = params, this.valid = this.isValid(), this.updateAABBBoundsStamp = 0, params.background && this.loadImage(null !== (_a = params.background.background) && void 0 !== _a ? _a : params.background, !0), isExternalTexture(params.texture) ? this.loadImage(params.texture, !1) : params.shadowGraphic && this.setShadowGraphic(params.shadowGraphic);
9522
+ super(), this._AABBBounds = new AABBBounds(), this._updateTag = exports.UpdateTag.INIT, this.attribute = params, this.valid = this.isValid(), this.updateAABBBoundsStamp = 0, params.background && this.loadImage(null !== (_a = params.background.background) && void 0 !== _a ? _a : params.background, !0), isExternalTexture(params.texture) && this.loadImage(params.texture, !1), params.shadowGraphic && this.setShadowGraphic(params.shadowGraphic);
9524
9523
  }
9525
9524
  getGraphicService() {
9526
9525
  var _a, _b;
@@ -9640,7 +9639,7 @@
9640
9639
  return paddingArray && bounds.expand(paddingArray), this.clearUpdateBoundTag(), bounds;
9641
9640
  }
9642
9641
  updatePathProxyAABBBounds(aabbBounds) {
9643
- const path = "function" == typeof this.pathProxy ? this.pathProxy(this.attribute) : this.pathProxy;
9642
+ const path = this.getPathProxy();
9644
9643
  if (!path) return !1;
9645
9644
  const boundsContext = new BoundsContext(aabbBounds);
9646
9645
  return renderCommandList(path.commandList, boundsContext, 0, 0), !0;
@@ -9709,7 +9708,7 @@
9709
9708
  });
9710
9709
  }
9711
9710
  setAttributes(params, forceUpdateTag = !1, context) {
9712
- params && ((params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(params, this.attribute, null, context) || params).background && this.loadImage(params.background, !0), isExternalTexture(params.texture) ? this.loadImage(params.texture, !1) : params.shadowGraphic && this.setShadowGraphic(params.shadowGraphic), this._setAttributes(params, forceUpdateTag, context));
9711
+ params && ((params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(params, this.attribute, null, context) || params).background && this.loadImage(params.background, !0), isExternalTexture(params.texture) && this.loadImage(params.texture, !1), params.shadowGraphic && this.setShadowGraphic(params.shadowGraphic), this._setAttributes(params, forceUpdateTag, context));
9713
9712
  }
9714
9713
  _setAttributes(params, forceUpdateTag = !1, context) {
9715
9714
  const keys = Object.keys(params);
@@ -9743,7 +9742,7 @@
9743
9742
  const context = {
9744
9743
  type: exports.AttributeUpdateType.INIT
9745
9744
  };
9746
- params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(params, this.attribute, null, context) || params, this.attribute = params, params.background && this.loadImage(params.background, !0), isExternalTexture(params.texture) ? this.loadImage(params.texture, !1) : params.shadowGraphic && this.setShadowGraphic(params.shadowGraphic), this._updateTag = exports.UpdateTag.INIT, this.valid = this.isValid(), this.onAttributeUpdate(context);
9745
+ params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(params, this.attribute, null, context) || params, this.attribute = params, params.background && this.loadImage(params.background, !0), isExternalTexture(params.texture) && this.loadImage(params.texture, !1), params.shadowGraphic && this.setShadowGraphic(params.shadowGraphic), this._updateTag = exports.UpdateTag.INIT, this.valid = this.isValid(), this.onAttributeUpdate(context);
9747
9746
  }
9748
9747
  translate(x, y) {
9749
9748
  var _a, _b;
@@ -10073,7 +10072,16 @@
10073
10072
  };
10074
10073
  }
10075
10074
  createPathProxy(path) {
10076
- return isString$1(path, !0) ? this.pathProxy = new CustomPath2D().fromString(path) : this.pathProxy = new CustomPath2D(), this.pathProxy;
10075
+ const proxy = isString$1(path, !0) ? new CustomPath2D().fromString(path) : new CustomPath2D();
10076
+ return this.pathProxy = proxy, this.attribute.pathProxy = proxy, this.addUpdateShapeAndBoundsTag(), this.onAttributeUpdate(), proxy;
10077
+ }
10078
+ getPathProxy() {
10079
+ var _a;
10080
+ const attributePathProxy = null === (_a = this.attribute) || void 0 === _a ? void 0 : _a.pathProxy,
10081
+ rawPathProxy = null != attributePathProxy ? attributePathProxy : this.pathProxy;
10082
+ if (!rawPathProxy) return null;
10083
+ const resolvedPathProxy = "function" == typeof rawPathProxy ? rawPathProxy(this.attribute) : rawPathProxy;
10084
+ return resolvedPathProxy ? isString$1(resolvedPathProxy, !0) ? new CustomPath2D().fromString(resolvedPathProxy) : resolvedPathProxy : null;
10077
10085
  }
10078
10086
  loadImage(image, background = !1) {
10079
10087
  if (background && (null == image ? void 0 : image.background) && (image = image.background), background && (!image || backgroundNotImage(image))) return void (this.backgroundImg = !1);
@@ -10123,6 +10131,8 @@
10123
10131
  }
10124
10132
  toCustomPath() {
10125
10133
  var _a, _b, _c;
10134
+ const pathProxy = this.getPathProxy();
10135
+ if (pathProxy) return pathProxy;
10126
10136
  const renderer = null === (_c = null === (_b = (null === (_a = this.stage) || void 0 === _a ? void 0 : _a.renderService) || application.renderService) || void 0 === _b ? void 0 : _b.drawContribution) || void 0 === _c ? void 0 : _c.getRenderContribution(this);
10127
10137
  if (renderer) {
10128
10138
  const context = new exports.EmptyContext2d(null, 1);
@@ -10885,7 +10895,8 @@
10885
10895
  this.hooks.clearAABBBounds.taps.length && this.hooks.clearAABBBounds.call(graphic, stage, b);
10886
10896
  }
10887
10897
  updatePathProxyAABBBounds(aabbBounds, graphic) {
10888
- const path = "function" == typeof graphic.pathProxy ? graphic.pathProxy(graphic.attribute) : graphic.pathProxy;
10898
+ var _a;
10899
+ const path = null === (_a = null == graphic ? void 0 : graphic.getPathProxy) || void 0 === _a ? void 0 : _a.call(graphic);
10889
10900
  if (!path) return !1;
10890
10901
  const boundsContext = new BoundsContext(aabbBounds);
10891
10902
  return renderCommandList(path.commandList, boundsContext, 0, 0), !0;
@@ -11831,7 +11842,7 @@
11831
11842
  return super.isValid() && this._isValid();
11832
11843
  }
11833
11844
  _isValid() {
11834
- if (this.pathProxy) return !0;
11845
+ if (this.getPathProxy()) return !0;
11835
11846
  const {
11836
11847
  points: points,
11837
11848
  segments: segments
@@ -13177,7 +13188,7 @@
13177
13188
  return super.isValid() && this._isValid();
13178
13189
  }
13179
13190
  _isValid() {
13180
- if (this.pathProxy) return !0;
13191
+ if (this.getPathProxy()) return !0;
13181
13192
  const {
13182
13193
  points: points,
13183
13194
  segments: segments
@@ -14064,6 +14075,7 @@
14064
14075
  }
14065
14076
  const defaultBaseClipRenderAfterContribution = new DefaultBaseClipRenderAfterContribution();
14066
14077
 
14078
+ const builtinProceduralTextureTypes = new Set(["circle", "diamond", "rect", "vertical-line", "horizontal-line", "bias-lr", "bias-rl", "grid"]);
14067
14079
  function formatRatio(ratio) {
14068
14080
  return ratio <= .5 ? 4 * ratio - 1 : -4 * ratio + 3;
14069
14081
  }
@@ -14284,7 +14296,7 @@
14284
14296
  }
14285
14297
  }
14286
14298
  getPatternCacheKey(texture, textureSize, texturePadding, textureColor, dpr, textureRadius) {
14287
- return "string" != typeof texture ? texturePadding > 0 || textureRadius > 0 ? null : texture : "wave" === texture ? null : `${texture}-${textureSize}-${texturePadding}-${textureColor}-${dpr}`;
14299
+ return "string" != typeof texture ? texturePadding > 0 || textureRadius > 0 ? null : texture : "wave" === texture ? null : builtinProceduralTextureTypes.has(texture) ? `builtin:${texture}|size:${textureSize}|padding:${texturePadding}|color:${textureColor}|dpr:${dpr}` : `resource:${texture}|padding:${texturePadding}|radius:${textureRadius}|dpr:${dpr}`;
14288
14300
  }
14289
14301
  createResourcePattern(texture, graphic, context, texturePadding, textureRadius) {
14290
14302
  var _a;
@@ -14762,7 +14774,8 @@
14762
14774
  });
14763
14775
  }
14764
14776
  drawPathProxy(graphic, context, x, y, drawContext, params, fillCb, strokeCb) {
14765
- if (!graphic.pathProxy) return !1;
14777
+ const path = graphic.getPathProxy();
14778
+ if (!path) return !1;
14766
14779
  const themeAttributes = getTheme(graphic, null == params ? void 0 : params.theme)[graphic.type.replace("3d", "")],
14767
14780
  {
14768
14781
  fill = themeAttributes.fill,
@@ -14779,12 +14792,7 @@
14779
14792
  sVisible = strokeVisible(opacity, strokeOpacity),
14780
14793
  doFill = runFill(fill),
14781
14794
  doStroke = runStroke(stroke, lineWidth);
14782
- if (!visible) return !0;
14783
- if (!doFill && !doStroke) return !0;
14784
- if (!(fVisible || sVisible || fillCb || strokeCb)) return !0;
14785
- context.beginPath();
14786
- const path = "function" == typeof graphic.pathProxy ? graphic.pathProxy(graphic.attribute) : graphic.pathProxy;
14787
- return renderCommandList(path.commandList, context, x, y), context.setShadowBlendStyle && context.setShadowBlendStyle(graphic, graphic.attribute, themeAttributes), this.beforeRenderStep(graphic, context, x, y, doFill, doStroke, fVisible, sVisible, themeAttributes, drawContext, fillCb, strokeCb), doStroke && (strokeCb ? strokeCb(context, graphic.attribute, themeAttributes) : sVisible && (context.setStrokeStyle(graphic, graphic.attribute, x - originX, y - originY, themeAttributes), context.stroke())), doFill && (fillCb ? fillCb(context, graphic.attribute, themeAttributes) : fVisible && (context.setCommonStyle(graphic, graphic.attribute, x - originX, y - originY, themeAttributes), context.fill())), this.afterRenderStep(graphic, context, x, y, doFill, doStroke, fVisible, sVisible, themeAttributes, drawContext, fillCb, strokeCb), !0;
14795
+ return !visible || !doFill && !doStroke || !(fVisible || sVisible || fillCb || strokeCb) || (context.beginPath(), renderCommandList(path.commandList, context, x, y), context.setShadowBlendStyle && context.setShadowBlendStyle(graphic, graphic.attribute, themeAttributes), this.beforeRenderStep(graphic, context, x, y, doFill, doStroke, fVisible, sVisible, themeAttributes, drawContext, fillCb, strokeCb), doStroke && (strokeCb ? strokeCb(context, graphic.attribute, themeAttributes) : sVisible && (context.setStrokeStyle(graphic, graphic.attribute, x - originX, y - originY, themeAttributes), context.stroke())), doFill && (fillCb ? fillCb(context, graphic.attribute, themeAttributes) : fVisible && (context.setCommonStyle(graphic, graphic.attribute, x - originX, y - originY, themeAttributes), context.fill())), this.afterRenderStep(graphic, context, x, y, doFill, doStroke, fVisible, sVisible, themeAttributes, drawContext, fillCb, strokeCb), !0);
14788
14796
  }
14789
14797
  valid(graphic, defaultAttribute, fillCb, strokeCb) {
14790
14798
  const {
@@ -32771,9 +32779,8 @@
32771
32779
  }
32772
32780
  onEnd() {}
32773
32781
  onUpdate(end, ratio, out) {
32774
- const target = this.target,
32775
- pathProxy = "function" == typeof target.pathProxy ? target.pathProxy(target.attribute) : target.pathProxy;
32776
- interpolateMorphingData(this.morphingData, pathProxy, ratio), this.otherAttrs && this.otherAttrs.length && interpolateOtherAttrs(this.otherAttrs, out, ratio), this.target.setAttributes(out), end && !this.saveOnEnd && (this.target.pathProxy = null);
32782
+ const pathProxy = this.target.getPathProxy();
32783
+ pathProxy && (interpolateMorphingData(this.morphingData, pathProxy, ratio), this.otherAttrs && this.otherAttrs.length && interpolateOtherAttrs(this.otherAttrs, out, ratio), this.target.setAttributes(out), end && !this.saveOnEnd && (this.target.pathProxy = null, this.target.setAttribute("pathProxy", null)));
32777
32784
  }
32778
32785
  }
32779
32786
  const morphPath = (fromGraphic, toGraphic, animationConfig, fromGraphicTransform) => {
@@ -32832,14 +32839,15 @@
32832
32839
  }
32833
32840
  clearPathProxy() {
32834
32841
  this.target.shadowRoot.forEachChildren(child => {
32835
- child.pathProxy = null;
32842
+ child.pathProxy = null, child.setAttribute("pathProxy", null);
32836
32843
  });
32837
32844
  }
32838
32845
  onEnd() {}
32839
32846
  onUpdate(end, ratio, out) {
32840
32847
  this.target.shadowRoot.forEachChildren((child, index) => {
32841
32848
  var _a;
32842
- interpolateMorphingData(this.morphingData[index], "function" == typeof child.pathProxy ? child.pathProxy(child.attribute) : child.pathProxy, ratio), (null === (_a = this.otherAttrs) || void 0 === _a ? void 0 : _a[index]) && this.otherAttrs[index].length && interpolateOtherAttrs(this.otherAttrs[index], child.attribute, ratio);
32849
+ const pathProxy = child.getPathProxy();
32850
+ pathProxy && (interpolateMorphingData(this.morphingData[index], pathProxy, ratio), (null === (_a = this.otherAttrs) || void 0 === _a ? void 0 : _a[index]) && this.otherAttrs[index].length && interpolateOtherAttrs(this.otherAttrs[index], child.attribute, ratio));
32843
32851
  }), end && (this.clearPathProxy(), this.morphingData = null);
32844
32852
  }
32845
32853
  }
@@ -52998,7 +53006,7 @@
52998
53006
  select: !0
52999
53007
  };
53000
53008
 
53001
- const version = "1.0.46-alpha.2";
53009
+ const version = "1.0.47-alpha.0";
53002
53010
  preLoadAllModule();
53003
53011
  if (isBrowserEnv()) {
53004
53012
  loadBrowserEnv(container);