@visactor/vrender 1.0.46 → 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 +1 -1
- package/cjs/index.js +11 -10
- package/cjs/index.js.map +1 -1
- package/dist/index.es.js +28 -19
- package/dist/index.js +28 -19
- package/dist/index.min.js +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/package.json +7 -7
package/cjs/index.d.ts
CHANGED
package/cjs/index.js
CHANGED
|
@@ -21,16 +21,17 @@ 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.
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
(0, vrender_kits_2.
|
|
28
|
-
(0, vrender_kits_2.
|
|
29
|
-
(0, vrender_kits_2.
|
|
30
|
-
(0, vrender_kits_2.
|
|
31
|
-
vrender_kits_2.
|
|
32
|
-
(0, vrender_kits_2.
|
|
33
|
-
(0,
|
|
24
|
+
exports.version = "1.0.47-alpha.0", (0, vrender_core_1.preLoadAllModule)(), (0,
|
|
25
|
+
vrender_core_1.isBrowserEnv)() ? (0, vrender_kits_1.loadBrowserEnv)(vrender_core_1.container) : (0,
|
|
26
|
+
vrender_core_1.isNodeEnv)() && (0, vrender_kits_1.loadNodeEnv)(vrender_core_1.container),
|
|
27
|
+
(0, vrender_kits_2.registerArc)(), (0, vrender_kits_2.registerArc3d)(), (0, vrender_kits_2.registerArea)(),
|
|
28
|
+
(0, vrender_kits_2.registerCircle)(), (0, vrender_kits_2.registerGlyph)(), (0, vrender_kits_2.registerGroup)(),
|
|
29
|
+
(0, vrender_kits_2.registerImage)(), (0, vrender_kits_2.registerLine)(), (0, vrender_kits_2.registerPath)(),
|
|
30
|
+
(0, vrender_kits_2.registerPolygon)(), (0, vrender_kits_2.registerPyramid3d)(),
|
|
31
|
+
(0, vrender_kits_2.registerRect)(), (0, vrender_kits_2.registerRect3d)(), (0, vrender_kits_2.registerRichtext)(),
|
|
32
|
+
(0, vrender_kits_2.registerShadowRoot)(), (0, vrender_kits_2.registerSymbol)(),
|
|
33
|
+
(0, vrender_kits_2.registerText)(), (0, vrender_kits_2.registerWrapText)(), (0,
|
|
34
|
+
vrender_kits_1.registerStar)(), (0, vrender_core_1.registerFlexLayoutPlugin)(),
|
|
34
35
|
(0, vrender_core_1.registerViewTransform3dPlugin)(), (0, vrender_core_1.registerHtmlAttributePlugin)(),
|
|
35
36
|
(0, vrender_core_1.registerReactAttributePlugin)(), (0, vrender_core_1.registerDirectionalLight)(),
|
|
36
37
|
(0, vrender_core_1.registerOrthoCamera)(), (0, vrender_animate_1.registerCustomAnimate)(),
|
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,
|
|
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
|
@@ -4741,6 +4741,7 @@ const DefaultAttribute = Object.assign(Object.assign(Object.assign({
|
|
|
4741
4741
|
shadowPickMode: "graphic",
|
|
4742
4742
|
keepStrokeScale: !1,
|
|
4743
4743
|
clipConfig: null,
|
|
4744
|
+
pathProxy: null,
|
|
4744
4745
|
roughStyle: null
|
|
4745
4746
|
}, DefaultDebugAttribute), DefaultStyle), DefaultTransform);
|
|
4746
4747
|
function addAttributeToPrototype(obj, c, keys) {
|
|
@@ -9451,7 +9452,7 @@ const _tempBounds$1 = new AABBBounds(),
|
|
|
9451
9452
|
tempMatrix = new Matrix();
|
|
9452
9453
|
new AABBBounds();
|
|
9453
9454
|
const PURE_STYLE_KEY = ["stroke", "opacity", "strokeOpacity", "lineDash", "lineDashOffset", "lineCap", "lineJoin", "miterLimit", "fill", "fillOpacity"];
|
|
9454
|
-
const GRAPHIC_UPDATE_TAG_KEY = ["lineWidth", "scaleX", "scaleY", "angle", "anchor", "visible"];
|
|
9455
|
+
const GRAPHIC_UPDATE_TAG_KEY = ["lineWidth", "pathProxy", "scaleX", "scaleY", "angle", "anchor", "visible"];
|
|
9455
9456
|
const tempConstantXYKey = ["x", "y"],
|
|
9456
9457
|
tempConstantScaleXYKey = ["scaleX", "scaleY"],
|
|
9457
9458
|
tempConstantAngleKey = ["angle"],
|
|
@@ -9632,7 +9633,7 @@ class Graphic extends Node {
|
|
|
9632
9633
|
return paddingArray && bounds.expand(paddingArray), this.clearUpdateBoundTag(), bounds;
|
|
9633
9634
|
}
|
|
9634
9635
|
updatePathProxyAABBBounds(aabbBounds) {
|
|
9635
|
-
const path =
|
|
9636
|
+
const path = this.getPathProxy();
|
|
9636
9637
|
if (!path) return !1;
|
|
9637
9638
|
const boundsContext = new BoundsContext(aabbBounds);
|
|
9638
9639
|
return renderCommandList(path.commandList, boundsContext, 0, 0), !0;
|
|
@@ -10065,7 +10066,16 @@ class Graphic extends Node {
|
|
|
10065
10066
|
};
|
|
10066
10067
|
}
|
|
10067
10068
|
createPathProxy(path) {
|
|
10068
|
-
|
|
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;
|
|
10069
10079
|
}
|
|
10070
10080
|
loadImage(image, background = !1) {
|
|
10071
10081
|
if (background && (null == image ? void 0 : image.background) && (image = image.background), background && (!image || backgroundNotImage(image))) return void (this.backgroundImg = !1);
|
|
@@ -10115,6 +10125,8 @@ class Graphic extends Node {
|
|
|
10115
10125
|
}
|
|
10116
10126
|
toCustomPath() {
|
|
10117
10127
|
var _a, _b, _c;
|
|
10128
|
+
const pathProxy = this.getPathProxy();
|
|
10129
|
+
if (pathProxy) return pathProxy;
|
|
10118
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);
|
|
10119
10131
|
if (renderer) {
|
|
10120
10132
|
const context = new EmptyContext2d(null, 1);
|
|
@@ -10877,7 +10889,8 @@ let DefaultGraphicService = class {
|
|
|
10877
10889
|
this.hooks.clearAABBBounds.taps.length && this.hooks.clearAABBBounds.call(graphic, stage, b);
|
|
10878
10890
|
}
|
|
10879
10891
|
updatePathProxyAABBBounds(aabbBounds, graphic) {
|
|
10880
|
-
|
|
10892
|
+
var _a;
|
|
10893
|
+
const path = null === (_a = null == graphic ? void 0 : graphic.getPathProxy) || void 0 === _a ? void 0 : _a.call(graphic);
|
|
10881
10894
|
if (!path) return !1;
|
|
10882
10895
|
const boundsContext = new BoundsContext(aabbBounds);
|
|
10883
10896
|
return renderCommandList(path.commandList, boundsContext, 0, 0), !0;
|
|
@@ -11823,7 +11836,7 @@ let Line$1 = class Line extends Graphic {
|
|
|
11823
11836
|
return super.isValid() && this._isValid();
|
|
11824
11837
|
}
|
|
11825
11838
|
_isValid() {
|
|
11826
|
-
if (this.
|
|
11839
|
+
if (this.getPathProxy()) return !0;
|
|
11827
11840
|
const {
|
|
11828
11841
|
points: points,
|
|
11829
11842
|
segments: segments
|
|
@@ -13169,7 +13182,7 @@ class Area extends Graphic {
|
|
|
13169
13182
|
return super.isValid() && this._isValid();
|
|
13170
13183
|
}
|
|
13171
13184
|
_isValid() {
|
|
13172
|
-
if (this.
|
|
13185
|
+
if (this.getPathProxy()) return !0;
|
|
13173
13186
|
const {
|
|
13174
13187
|
points: points,
|
|
13175
13188
|
segments: segments
|
|
@@ -14755,7 +14768,8 @@ class BaseRender {
|
|
|
14755
14768
|
});
|
|
14756
14769
|
}
|
|
14757
14770
|
drawPathProxy(graphic, context, x, y, drawContext, params, fillCb, strokeCb) {
|
|
14758
|
-
|
|
14771
|
+
const path = graphic.getPathProxy();
|
|
14772
|
+
if (!path) return !1;
|
|
14759
14773
|
const themeAttributes = getTheme(graphic, null == params ? void 0 : params.theme)[graphic.type.replace("3d", "")],
|
|
14760
14774
|
{
|
|
14761
14775
|
fill = themeAttributes.fill,
|
|
@@ -14772,12 +14786,7 @@ class BaseRender {
|
|
|
14772
14786
|
sVisible = strokeVisible(opacity, strokeOpacity),
|
|
14773
14787
|
doFill = runFill(fill),
|
|
14774
14788
|
doStroke = runStroke(stroke, lineWidth);
|
|
14775
|
-
|
|
14776
|
-
if (!doFill && !doStroke) return !0;
|
|
14777
|
-
if (!(fVisible || sVisible || fillCb || strokeCb)) return !0;
|
|
14778
|
-
context.beginPath();
|
|
14779
|
-
const path = "function" == typeof graphic.pathProxy ? graphic.pathProxy(graphic.attribute) : graphic.pathProxy;
|
|
14780
|
-
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);
|
|
14781
14790
|
}
|
|
14782
14791
|
valid(graphic, defaultAttribute, fillCb, strokeCb) {
|
|
14783
14792
|
const {
|
|
@@ -32764,9 +32773,8 @@ class MorphingPath extends ACustomAnimate {
|
|
|
32764
32773
|
}
|
|
32765
32774
|
onEnd() {}
|
|
32766
32775
|
onUpdate(end, ratio, out) {
|
|
32767
|
-
const
|
|
32768
|
-
|
|
32769
|
-
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)));
|
|
32770
32778
|
}
|
|
32771
32779
|
}
|
|
32772
32780
|
const morphPath = (fromGraphic, toGraphic, animationConfig, fromGraphicTransform) => {
|
|
@@ -32825,14 +32833,15 @@ class MultiToOneMorphingPath extends ACustomAnimate {
|
|
|
32825
32833
|
}
|
|
32826
32834
|
clearPathProxy() {
|
|
32827
32835
|
this.target.shadowRoot.forEachChildren(child => {
|
|
32828
|
-
child.pathProxy = null;
|
|
32836
|
+
child.pathProxy = null, child.setAttribute("pathProxy", null);
|
|
32829
32837
|
});
|
|
32830
32838
|
}
|
|
32831
32839
|
onEnd() {}
|
|
32832
32840
|
onUpdate(end, ratio, out) {
|
|
32833
32841
|
this.target.shadowRoot.forEachChildren((child, index) => {
|
|
32834
32842
|
var _a;
|
|
32835
|
-
|
|
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));
|
|
32836
32845
|
}), end && (this.clearPathProxy(), this.morphingData = null);
|
|
32837
32846
|
}
|
|
32838
32847
|
}
|
|
@@ -52991,7 +53000,7 @@ TableSeriesNumber.defaultAttributes = {
|
|
|
52991
53000
|
select: !0
|
|
52992
53001
|
};
|
|
52993
53002
|
|
|
52994
|
-
const version = "1.0.
|
|
53003
|
+
const version = "1.0.47-alpha.0";
|
|
52995
53004
|
preLoadAllModule();
|
|
52996
53005
|
if (isBrowserEnv()) {
|
|
52997
53006
|
loadBrowserEnv(container);
|
package/dist/index.js
CHANGED
|
@@ -4747,6 +4747,7 @@
|
|
|
4747
4747
|
shadowPickMode: "graphic",
|
|
4748
4748
|
keepStrokeScale: !1,
|
|
4749
4749
|
clipConfig: null,
|
|
4750
|
+
pathProxy: null,
|
|
4750
4751
|
roughStyle: null
|
|
4751
4752
|
}, DefaultDebugAttribute), DefaultStyle), DefaultTransform);
|
|
4752
4753
|
function addAttributeToPrototype(obj, c, keys) {
|
|
@@ -9457,7 +9458,7 @@
|
|
|
9457
9458
|
tempMatrix = new Matrix();
|
|
9458
9459
|
new AABBBounds();
|
|
9459
9460
|
const PURE_STYLE_KEY = ["stroke", "opacity", "strokeOpacity", "lineDash", "lineDashOffset", "lineCap", "lineJoin", "miterLimit", "fill", "fillOpacity"];
|
|
9460
|
-
const GRAPHIC_UPDATE_TAG_KEY = ["lineWidth", "scaleX", "scaleY", "angle", "anchor", "visible"];
|
|
9461
|
+
const GRAPHIC_UPDATE_TAG_KEY = ["lineWidth", "pathProxy", "scaleX", "scaleY", "angle", "anchor", "visible"];
|
|
9461
9462
|
const tempConstantXYKey = ["x", "y"],
|
|
9462
9463
|
tempConstantScaleXYKey = ["scaleX", "scaleY"],
|
|
9463
9464
|
tempConstantAngleKey = ["angle"],
|
|
@@ -9638,7 +9639,7 @@
|
|
|
9638
9639
|
return paddingArray && bounds.expand(paddingArray), this.clearUpdateBoundTag(), bounds;
|
|
9639
9640
|
}
|
|
9640
9641
|
updatePathProxyAABBBounds(aabbBounds) {
|
|
9641
|
-
const path =
|
|
9642
|
+
const path = this.getPathProxy();
|
|
9642
9643
|
if (!path) return !1;
|
|
9643
9644
|
const boundsContext = new BoundsContext(aabbBounds);
|
|
9644
9645
|
return renderCommandList(path.commandList, boundsContext, 0, 0), !0;
|
|
@@ -10071,7 +10072,16 @@
|
|
|
10071
10072
|
};
|
|
10072
10073
|
}
|
|
10073
10074
|
createPathProxy(path) {
|
|
10074
|
-
|
|
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;
|
|
10075
10085
|
}
|
|
10076
10086
|
loadImage(image, background = !1) {
|
|
10077
10087
|
if (background && (null == image ? void 0 : image.background) && (image = image.background), background && (!image || backgroundNotImage(image))) return void (this.backgroundImg = !1);
|
|
@@ -10121,6 +10131,8 @@
|
|
|
10121
10131
|
}
|
|
10122
10132
|
toCustomPath() {
|
|
10123
10133
|
var _a, _b, _c;
|
|
10134
|
+
const pathProxy = this.getPathProxy();
|
|
10135
|
+
if (pathProxy) return pathProxy;
|
|
10124
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);
|
|
10125
10137
|
if (renderer) {
|
|
10126
10138
|
const context = new exports.EmptyContext2d(null, 1);
|
|
@@ -10883,7 +10895,8 @@
|
|
|
10883
10895
|
this.hooks.clearAABBBounds.taps.length && this.hooks.clearAABBBounds.call(graphic, stage, b);
|
|
10884
10896
|
}
|
|
10885
10897
|
updatePathProxyAABBBounds(aabbBounds, graphic) {
|
|
10886
|
-
|
|
10898
|
+
var _a;
|
|
10899
|
+
const path = null === (_a = null == graphic ? void 0 : graphic.getPathProxy) || void 0 === _a ? void 0 : _a.call(graphic);
|
|
10887
10900
|
if (!path) return !1;
|
|
10888
10901
|
const boundsContext = new BoundsContext(aabbBounds);
|
|
10889
10902
|
return renderCommandList(path.commandList, boundsContext, 0, 0), !0;
|
|
@@ -11829,7 +11842,7 @@
|
|
|
11829
11842
|
return super.isValid() && this._isValid();
|
|
11830
11843
|
}
|
|
11831
11844
|
_isValid() {
|
|
11832
|
-
if (this.
|
|
11845
|
+
if (this.getPathProxy()) return !0;
|
|
11833
11846
|
const {
|
|
11834
11847
|
points: points,
|
|
11835
11848
|
segments: segments
|
|
@@ -13175,7 +13188,7 @@
|
|
|
13175
13188
|
return super.isValid() && this._isValid();
|
|
13176
13189
|
}
|
|
13177
13190
|
_isValid() {
|
|
13178
|
-
if (this.
|
|
13191
|
+
if (this.getPathProxy()) return !0;
|
|
13179
13192
|
const {
|
|
13180
13193
|
points: points,
|
|
13181
13194
|
segments: segments
|
|
@@ -14761,7 +14774,8 @@
|
|
|
14761
14774
|
});
|
|
14762
14775
|
}
|
|
14763
14776
|
drawPathProxy(graphic, context, x, y, drawContext, params, fillCb, strokeCb) {
|
|
14764
|
-
|
|
14777
|
+
const path = graphic.getPathProxy();
|
|
14778
|
+
if (!path) return !1;
|
|
14765
14779
|
const themeAttributes = getTheme(graphic, null == params ? void 0 : params.theme)[graphic.type.replace("3d", "")],
|
|
14766
14780
|
{
|
|
14767
14781
|
fill = themeAttributes.fill,
|
|
@@ -14778,12 +14792,7 @@
|
|
|
14778
14792
|
sVisible = strokeVisible(opacity, strokeOpacity),
|
|
14779
14793
|
doFill = runFill(fill),
|
|
14780
14794
|
doStroke = runStroke(stroke, lineWidth);
|
|
14781
|
-
|
|
14782
|
-
if (!doFill && !doStroke) return !0;
|
|
14783
|
-
if (!(fVisible || sVisible || fillCb || strokeCb)) return !0;
|
|
14784
|
-
context.beginPath();
|
|
14785
|
-
const path = "function" == typeof graphic.pathProxy ? graphic.pathProxy(graphic.attribute) : graphic.pathProxy;
|
|
14786
|
-
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);
|
|
14787
14796
|
}
|
|
14788
14797
|
valid(graphic, defaultAttribute, fillCb, strokeCb) {
|
|
14789
14798
|
const {
|
|
@@ -32770,9 +32779,8 @@
|
|
|
32770
32779
|
}
|
|
32771
32780
|
onEnd() {}
|
|
32772
32781
|
onUpdate(end, ratio, out) {
|
|
32773
|
-
const
|
|
32774
|
-
|
|
32775
|
-
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)));
|
|
32776
32784
|
}
|
|
32777
32785
|
}
|
|
32778
32786
|
const morphPath = (fromGraphic, toGraphic, animationConfig, fromGraphicTransform) => {
|
|
@@ -32831,14 +32839,15 @@
|
|
|
32831
32839
|
}
|
|
32832
32840
|
clearPathProxy() {
|
|
32833
32841
|
this.target.shadowRoot.forEachChildren(child => {
|
|
32834
|
-
child.pathProxy = null;
|
|
32842
|
+
child.pathProxy = null, child.setAttribute("pathProxy", null);
|
|
32835
32843
|
});
|
|
32836
32844
|
}
|
|
32837
32845
|
onEnd() {}
|
|
32838
32846
|
onUpdate(end, ratio, out) {
|
|
32839
32847
|
this.target.shadowRoot.forEachChildren((child, index) => {
|
|
32840
32848
|
var _a;
|
|
32841
|
-
|
|
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));
|
|
32842
32851
|
}), end && (this.clearPathProxy(), this.morphingData = null);
|
|
32843
32852
|
}
|
|
32844
32853
|
}
|
|
@@ -52997,7 +53006,7 @@
|
|
|
52997
53006
|
select: !0
|
|
52998
53007
|
};
|
|
52999
53008
|
|
|
53000
|
-
const version = "1.0.
|
|
53009
|
+
const version = "1.0.47-alpha.0";
|
|
53001
53010
|
preLoadAllModule();
|
|
53002
53011
|
if (isBrowserEnv()) {
|
|
53003
53012
|
loadBrowserEnv(container);
|