@visactor/vrender-core 0.20.2-alpha.3 → 0.20.2

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 (74) hide show
  1. package/cjs/animate/animate.d.ts +2 -1
  2. package/cjs/animate/animate.js +3 -3
  3. package/cjs/animate/animate.js.map +1 -1
  4. package/cjs/color-string/interpolate.js.map +1 -1
  5. package/cjs/common/3d-interceptor.js +1 -2
  6. package/cjs/common/bounds-context.js +2 -1
  7. package/cjs/common/morphing-utils.js +1 -1
  8. package/cjs/common/path-svg.js +1 -1
  9. package/cjs/common/polygon.js +2 -2
  10. package/cjs/common/rect-utils.js +1 -1
  11. package/cjs/common/render-area.js +1 -1
  12. package/cjs/common/render-command-list.js +1 -2
  13. package/cjs/common/render-curve.js +1 -1
  14. package/cjs/common/render-utils.js +1 -1
  15. package/cjs/common/seg-context.js +1 -1
  16. package/cjs/common/simplify.js +1 -1
  17. package/cjs/common/sort.js +1 -1
  18. package/cjs/common/split-path.js +1 -1
  19. package/cjs/common/store.js +1 -1
  20. package/cjs/core/application.js +2 -1
  21. package/cjs/core/camera.js +1 -1
  22. package/cjs/core/constants.js +1 -1
  23. package/cjs/core/core-modules.js +1 -1
  24. package/cjs/core/global-module.js +2 -0
  25. package/cjs/core/global.js +1 -1
  26. package/cjs/core/graphic-utils.js +1 -1
  27. package/cjs/core/index.js +1 -1
  28. package/cjs/core/layer-service.js +1 -1
  29. package/cjs/core/layer.js +1 -1
  30. package/cjs/core/light.js +1 -1
  31. package/cjs/core/stage.js +1 -1
  32. package/cjs/core/window.js +1 -1
  33. package/cjs/graphic/graphic.js +6 -4
  34. package/cjs/graphic/graphic.js.map +1 -1
  35. package/cjs/interface/graphic.d.ts +1 -0
  36. package/cjs/interface/graphic.js.map +1 -1
  37. package/dist/index.es.js +7 -5
  38. package/es/animate/animate.d.ts +2 -1
  39. package/es/animate/animate.js +3 -3
  40. package/es/animate/animate.js.map +1 -1
  41. package/es/color-string/interpolate.js.map +1 -1
  42. package/es/common/3d-interceptor.js +1 -2
  43. package/es/common/bounds-context.js +2 -1
  44. package/es/common/morphing-utils.js +1 -1
  45. package/es/common/path-svg.js +1 -1
  46. package/es/common/polygon.js +1 -1
  47. package/es/common/rect-utils.js +1 -1
  48. package/es/common/render-area.js +1 -1
  49. package/es/common/render-command-list.js +1 -2
  50. package/es/common/render-curve.js +1 -1
  51. package/es/common/render-utils.js +1 -1
  52. package/es/common/seg-context.js +1 -1
  53. package/es/common/simplify.js +1 -1
  54. package/es/common/sort.js +1 -1
  55. package/es/common/split-path.js +1 -1
  56. package/es/common/store.js +1 -1
  57. package/es/core/application.js +2 -1
  58. package/es/core/camera.js +1 -1
  59. package/es/core/constants.js +1 -1
  60. package/es/core/core-modules.js +1 -1
  61. package/es/core/global-module.js +2 -0
  62. package/es/core/global.js +1 -1
  63. package/es/core/graphic-utils.js +1 -1
  64. package/es/core/index.js +1 -1
  65. package/es/core/layer-service.js +1 -1
  66. package/es/core/layer.js +1 -1
  67. package/es/core/light.js +1 -1
  68. package/es/core/stage.js +1 -1
  69. package/es/core/window.js +1 -1
  70. package/es/graphic/graphic.js +6 -4
  71. package/es/graphic/graphic.js.map +1 -1
  72. package/es/interface/graphic.d.ts +1 -0
  73. package/es/interface/graphic.js.map +1 -1
  74. package/package.json +2 -2
package/cjs/core/layer.js CHANGED
@@ -116,4 +116,4 @@ class Layer extends group_1.Group {
116
116
  }
117
117
 
118
118
  exports.Layer = Layer;
119
- //# sourceMappingURL=layer.js.map
119
+ //# sourceMappingURL=layer.js.map
package/cjs/core/light.js CHANGED
@@ -29,4 +29,4 @@ const registerDirectionalLight = () => {
29
29
  };
30
30
 
31
31
  exports.registerDirectionalLight = registerDirectionalLight;
32
- //# sourceMappingURL=light.js.map
32
+ //# sourceMappingURL=light.js.map
package/cjs/core/stage.js CHANGED
@@ -498,4 +498,4 @@ class Stage extends group_1.Group {
498
498
  }
499
499
 
500
500
  exports.Stage = Stage;
501
- //# sourceMappingURL=stage.js.map
501
+ //# sourceMappingURL=stage.js.map
@@ -152,4 +152,4 @@ let DefaultWindow = class {
152
152
 
153
153
  DefaultWindow = __decorate([ (0, inversify_lite_1.injectable)(), __metadata("design:paramtypes", []) ], DefaultWindow),
154
154
  exports.DefaultWindow = DefaultWindow;
155
- //# sourceMappingURL=window.js.map
155
+ //# sourceMappingURL=window.js.map
@@ -316,8 +316,8 @@ class Graphic extends node_tree_1.Node {
316
316
  }
317
317
  animate(params) {
318
318
  this.animates || (this.animates = new Map);
319
- const animate = new animate_1.Animate(null == params ? void 0 : params.id, this.stage && this.stage.getTimeline()).bind(this);
320
- if (params) {
319
+ const animate = new animate_1.Animate(null == params ? void 0 : params.id, this.stage && this.stage.getTimeline(), null == params ? void 0 : params.slience);
320
+ if (animate.bind(this), params) {
321
321
  const {onStart: onStart, onFrame: onFrame, onEnd: onEnd, onRemove: onRemove} = params;
322
322
  null != onStart && animate.onStart(onStart), null != onFrame && animate.onFrame(onFrame),
323
323
  null != onEnd && animate.onEnd(onEnd), null != onRemove && animate.onRemove(onRemove),
@@ -351,7 +351,9 @@ class Graphic extends node_tree_1.Node {
351
351
  keys.forEach((key => {
352
352
  noWorkAttrs[key] ? (noAnimateAttrs || (noAnimateAttrs = {}), noAnimateAttrs[key] = attrs[key]) : animateAttrs[key] = isClear && void 0 === attrs[key] ? this.getDefaultAttribute(key) : attrs[key];
353
353
  }));
354
- const animate = this.animate();
354
+ const animate = this.animate({
355
+ slience: !0
356
+ });
355
357
  animate.stateNames = stateNames, animate.to(animateAttrs, null !== (_b = null === (_a = this.stateAnimateConfig) || void 0 === _a ? void 0 : _a.duration) && void 0 !== _b ? _b : animate_1.DefaultStateAnimateConfig.duration, null !== (_d = null === (_c = this.stateAnimateConfig) || void 0 === _c ? void 0 : _c.easing) && void 0 !== _d ? _d : animate_1.DefaultStateAnimateConfig.easing),
356
358
  noAnimateAttrs && this.setAttributes(noAnimateAttrs, !1, {
357
359
  type: enums_1.AttributeUpdateType.STATE
@@ -551,7 +553,7 @@ class Graphic extends node_tree_1.Node {
551
553
  var _a;
552
554
  if (!animate.validAttr(key)) return;
553
555
  const nextStepVal = nextProps[key], lastStepVal = null !== (_a = lastProps && lastProps[key]) && void 0 !== _a ? _a : subAnimate.getLastPropByName(key, step);
554
- if (null == nextStepVal || null == lastStepVal) return void (nextAttributes[key] = nextStepVal);
556
+ if (null == nextStepVal || null == lastStepVal || nextStepVal === lastStepVal) return void (nextAttributes[key] = nextStepVal);
555
557
  let match;
556
558
  match = animate.interpolateFunc && animate.interpolateFunc(key, ratio, lastStepVal, nextStepVal, nextAttributes),
557
559
  match || (match = animate.customInterpolate(key, ratio, lastStepVal, nextStepVal, this, nextAttributes),
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/graphic/graphic.ts"],"names":[],"mappings":";;;AAEA,6CAW0B;AAY1B,2CAAmC;AAanC,oCAAoD;AACpD,qCAA4C;AAC5C,gDAA6C;AAC7C,wCAAgE;AAChE,6DAA+D;AAC/D,2DAAuD;AACvD,sDAA2D;AAC3D,2CAAoF;AACpF,6DAAyD;AACzD,uEAAkE;AAClE,2CAA+C;AAmC/C,MAAM,UAAU,GAAG,IAAI,eAAM,EAAE,CAAC;AAChC,MAAM,UAAU,GAAG,IAAI,mBAAU,EAAE,CAAC;AAEvB,QAAA,cAAc,GAAG;IAC5B,QAAQ;IACR,SAAS;IACT,eAAe;IACf,UAAU;IACV,gBAAgB;IAChB,SAAS;IACT,UAAU;IACV,YAAY;IACZ,MAAM;IACN,aAAa;CACd,CAAC;AAEW,QAAA,sBAAsB,GAAG;IACpC,WAAW;IAIX,QAAQ;IACR,QAAQ;IACR,OAAO;IACP,QAAQ;IACR,SAAS;CACV,CAAC;AAEF,MAAM,iBAAiB,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;AACrC,MAAM,sBAAsB,GAAG,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;AACpD,MAAM,oBAAoB,GAAG,CAAC,OAAO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AG,KAAK,CAAC;YAE3B,WAAmB,CAAC,OAAO,GAAG,MAAA,MAAC,IAAI,CAAC,KAAa,0CAAE,WAAW,0CAAE,OAAO,CAAC;YACzE,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC;SACjC;IACH,CAAC;CAKF;AAz0CD,0BAy0CC;AAED,OAAO,CAAC,KAAK,CAAC,mBAAW,CAAC,CAAC;AAE3B,SAAS,kBAAkB,CAAC,KAAU;IACpC,IAAI,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,MAAM,EAAE;QAC9B,OAAO,IAAI,CAAC;KACb;IACD,OAAO,KAAK,CAAC;AACf,CAAC","file":"graphic.js","sourcesContent":["import type { ICustomPath2D } from './../interface/path';\nimport type { Dict, IPointLike, IAABBBounds } from '@visactor/vutils';\nimport {\n AABBBounds,\n Matrix,\n normalTransform,\n Point,\n isNil,\n has,\n isString,\n isValidUrl,\n isBase64,\n isObject\n} from '@visactor/vutils';\nimport type {\n GraphicType,\n IAnimateConfig,\n IGraphicAttribute,\n IGraphic,\n IGraphicAnimateParams,\n IGraphicJson,\n ISetAttributeContext,\n ITransform,\n GraphicReleaseStatus\n} from '../interface/graphic';\nimport { Node } from './node-tree';\nimport type {\n IAnimate,\n IAnimateTarget,\n IGlyphGraphicAttribute,\n IGroup,\n ILayer,\n IPickerService,\n IShadowRoot,\n IStage,\n IStep,\n ISubAnimate\n} from '../interface';\nimport { EventTarget, CustomEvent } from '../event';\nimport { DefaultTransform } from './config';\nimport { application } from '../application';\nimport { Animate, DefaultStateAnimateConfig } from '../animate';\nimport { interpolateColor } from '../color-string/interpolate';\nimport { CustomPath2D } from '../common/custom-path2d';\nimport { ResourceLoader } from '../resource-loader/loader';\nimport { AttributeUpdateType, IContainPointMode, UpdateTag } from '../common/enums';\nimport { BoundsContext } from '../common/bounds-context';\nimport { renderCommandList } from '../common/render-command-list';\nimport { parsePadding } from '../common/utils';\n\n/**\n * pathProxy参考自zrender\n * BSD 3-Clause License\n\n Copyright (c) 2017, Baidu Inc.\n All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n * Redistributions of source code must retain the above copyright notice, this\n list of conditions and the following disclaimer.\n\n * Redistributions in binary form must reproduce the above copyright notice,\n this list of conditions and the following disclaimer in the documentation\n and/or other materials provided with the distribution.\n\n * Neither the name of the copyright holder nor the names of its\n contributors may be used to endorse or promote products derived from\n this software without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nconst tempMatrix = new Matrix();\nconst tempBounds = new AABBBounds();\n\nexport const PURE_STYLE_KEY = [\n 'stroke',\n 'opacity',\n 'strokeOpacity',\n 'lineDash',\n 'lineDashOffset',\n 'lineCap',\n 'lineJoin',\n 'miterLimit',\n 'fill',\n 'fillOpacity'\n];\n\nexport const GRAPHIC_UPDATE_TAG_KEY = [\n 'lineWidth',\n // 'lineCap',\n // 'lineJoin',\n // 'miterLimit',\n 'scaleX',\n 'scaleY',\n 'angle',\n 'anchor',\n 'visible'\n];\n\nconst tempConstantXYKey = ['x', 'y'];\nconst tempConstantScaleXYKey = ['scaleX', 'scaleY'];\nconst tempConstantAngleKey = ['angle'];\n\nconst point = new Point();\n\nexport const NOWORK_ANIMATE_ATTR = {\n strokeSeg: 1,\n boundsPadding: 2,\n pickMode: 1,\n boundsMode: 1,\n customPickShape: 1,\n pickable: 1,\n childrenPickable: 1,\n visible: 1,\n zIndex: 1,\n layout: 1,\n keepDirIn3d: 1,\n globalZIndex: 1,\n\n outerBorder: 1,\n innerBorder: 1,\n lineDash: 1,\n lineCap: 1,\n lineJoin: 1,\n miterLimit: 2,\n strokeBoundsBuffer: 2,\n\n scaleCenter: 1,\n anchor: 1,\n anchor3d: 1,\n postMatrix: 1,\n\n backgroundMode: 2,\n background: 1,\n texture: 1,\n cursor: 1,\n html: 1\n};\n\n/**\n * globalTransMatrix更新逻辑\n * 1. group的transform修改,会下发到所有下层group,将所有下层的tag修改\n * 2. 叶子graphic每次获取globalTransMatrix都重新计算\n * 3. 所有节点的transform修改,或者globalTransform修改,都会下发到自己的shadowRoot上\n */\n\nexport abstract class Graphic<T extends Partial<IGraphicAttribute> = Partial<IGraphicAttribute>>\n extends Node\n implements IGraphic<T>, IAnimateTarget\n{\n /**\n * Mixes all enumerable properties and methods from a source object to Element.\n * @param source - The source of properties and methods to mix in.\n */\n static mixin(source: Dict<any>): void {\n // in ES8/ES2017, this would be really easy:\n // Object.defineProperties(Element.prototype, Object.getOwnPropertyDescriptors(source));\n\n // get all the enumerable property keys\n const keys = Object.keys(source);\n\n // loop through properties\n for (let i = 0; i < keys.length; ++i) {\n const propertyName = keys[i];\n\n // Set the property using the property descriptor - this works for accessors and normal value properties\n Object.defineProperty(\n Graphic.prototype,\n propertyName,\n Object.getOwnPropertyDescriptor(source, propertyName) as PropertyDecorator\n );\n }\n }\n\n declare _events?: any;\n\n declare onBeforeAttributeUpdate?: (\n val: any,\n attributes: Partial<T>,\n key: null | string | string[],\n context?: ISetAttributeContext\n ) => T | undefined;\n declare parent: any;\n\n declare resources?: Map<\n string,\n { state: 'init' | 'loading' | 'success' | 'fail'; data?: HTMLImageElement | HTMLCanvasElement }\n >;\n declare backgroundImg?: boolean;\n\n declare type: GraphicType;\n declare prefixed: string;\n declare numberType: number;\n declare isContainer?: boolean;\n declare valid: boolean;\n declare stage?: IStage;\n declare layer?: ILayer;\n declare incremental?: number;\n declare glyphHost?: IGraphic<IGlyphGraphicAttribute>;\n declare _onSetStage?: (g: IGraphic, stage: IStage, layer: ILayer) => void;\n // declare _beforeAttributeUpdate?: (key: string | string, value: any) => void;\n // 标记是否是在3d模式下\n declare in3dMode?: boolean;\n\n // aabbBounds,所有图形都需要有,所以初始化即赋值\n protected declare _AABBBounds: IAABBBounds;\n get AABBBounds(): IAABBBounds {\n return this.tryUpdateAABBBounds(this.attribute.boundsMode === 'imprecise');\n }\n // 具有旋转的包围盒,部分图元需要,动态初始化\n // protected declare _OBBBounds?: OBBBounds;\n // get OBBBounds(): OBBBounds {\n // return this.tryUpdateOBBBounds();\n // }\n protected declare _globalAABBBounds: IAABBBounds;\n // 全局包围盒,部分图元需要,动态初始化,建议使用AABBBounds\n get globalAABBBounds(): IAABBBounds {\n return this.tryUpdateGlobalAABBBounds();\n }\n protected declare _transMatrix: Matrix;\n get transMatrix(): Matrix {\n return this.tryUpdateLocalTransMatrix(true);\n }\n protected declare _globalTransMatrix: Matrix;\n get globalTransMatrix(): Matrix {\n return this.tryUpdateGlobalTransMatrix(true);\n }\n protected declare _updateTag: number;\n\n // 上次更新的stamp\n declare stamp?: number;\n\n declare attribute: T;\n\n declare shadowRoot?: IShadowRoot;\n\n declare releaseStatus?: GraphicReleaseStatus;\n\n /** 记录state对应的图形属性 */\n declare states?: Record<string, Partial<T>>;\n /** 当前state值 */\n declare currentStates?: string[];\n /** TODO: state更新对应的动画配置 */\n declare stateAnimateConfig?: IAnimateConfig;\n /** 记录应用state之前,attribute对应的原始图形属性 */\n declare normalAttrs?: Partial<T>;\n /** 获取state图形属性的方法 */\n declare stateProxy?: (stateName: string, targetStates?: string[]) => T;\n declare animates: Map<string | number, IAnimate>;\n\n declare nextAttrs?: T;\n declare prevAttrs?: T;\n declare finalAttrs?: T;\n\n declare pathProxy?: ICustomPath2D;\n // 依附于某个theme,如果该节点不存在parent,那么这个Theme就作为节点的Theme,避免添加到节点前计算属性\n declare attachedThemeGraphic?: IGraphic;\n\n constructor(params: T = {} as T) {\n super();\n this._AABBBounds = new AABBBounds();\n this._updateTag = UpdateTag.INIT;\n this.attribute = params;\n this.valid = this.isValid();\n if (params.background) {\n this.loadImage((params.background as any).background ?? params.background, true);\n } else if (params.shadowGraphic) {\n this.setShadowGraphic(params.shadowGraphic);\n }\n }\n\n setMode(mode: '2d' | '3d') {\n mode === '3d' ? this.set3dMode() : this.set2dMode();\n }\n\n set3dMode() {\n this.in3dMode = true;\n }\n set2dMode() {\n this.in3dMode = false;\n }\n getOffsetXY(attr?: ITransform, includeScroll: boolean = false) {\n const { dx = attr.dx, dy = attr.dy } = this.attribute;\n if (includeScroll && this.parent) {\n // const groupTheme = getTheme(this.parent).group;\n const attribute = this.parent.attribute;\n point.x = dx + (attribute.scrollX ?? 0);\n point.y = dy + (attribute.scrollY ?? 0);\n } else {\n point.x = dx;\n point.y = dy;\n }\n return point;\n }\n\n onAnimateBind(animate: IAnimate | ISubAnimate) {\n this._emitCustomEvent('animate-bind', animate);\n }\n\n protected tryUpdateAABBBounds(full?: boolean): IAABBBounds {\n if (!this.shouldUpdateAABBBounds()) {\n return this._AABBBounds;\n }\n if (!this.valid) {\n this._AABBBounds.clear();\n return this._AABBBounds;\n }\n\n application.graphicService.beforeUpdateAABBBounds(this, this.stage, true, this._AABBBounds);\n const bounds = this.doUpdateAABBBounds(full);\n // this.addUpdateLayoutTag();\n application.graphicService.afterUpdateAABBBounds(this, this.stage, this._AABBBounds, this, true);\n return bounds;\n }\n\n protected combindShadowAABBBounds(bounds: IAABBBounds) {\n // 合并shadowRoot的Bounds\n if (this.shadowRoot) {\n const b = this.shadowRoot.AABBBounds.clone();\n bounds.union(b);\n }\n }\n\n abstract getGraphicTheme(): T;\n\n protected abstract updateAABBBounds(\n attribute: T,\n symbolTheme: Required<T>,\n aabbBounds: IAABBBounds,\n full?: boolean\n ): IAABBBounds;\n\n protected doUpdateAABBBounds(full?: boolean): IAABBBounds {\n const graphicTheme = this.getGraphicTheme();\n this._AABBBounds.clear();\n const attribute = this.attribute;\n const bounds = this.updateAABBBounds(attribute, graphicTheme as Required<T>, this._AABBBounds, full) as AABBBounds;\n\n const { boundsPadding = graphicTheme.boundsPadding } = attribute;\n const paddingArray = parsePadding(boundsPadding);\n if (paddingArray) {\n bounds.expand(paddingArray);\n }\n\n this.clearUpdateBoundTag();\n return bounds;\n }\n\n updatePathProxyAABBBounds(aabbBounds: IAABBBounds): boolean {\n const path = typeof this.pathProxy === 'function' ? (this.pathProxy as any)(this.attribute) : this.pathProxy;\n if (!path) {\n return false;\n }\n const boundsContext = new BoundsContext(aabbBounds);\n renderCommandList(path.commandList, boundsContext, 0, 0);\n return true;\n }\n\n protected tryUpdateGlobalAABBBounds(): IAABBBounds {\n const b = this.AABBBounds;\n if (!this._globalAABBBounds) {\n this._globalAABBBounds = b.clone();\n } else {\n this._globalAABBBounds.setValue(b.x1, b.y1, b.x2, b.y2);\n }\n if (this._globalAABBBounds.empty()) {\n return this._globalAABBBounds;\n }\n // 使用parent的grloalAABBBounds\n // todo: 考虑是否需要性能优化\n if (this.parent) {\n this._globalAABBBounds.transformWithMatrix((this.parent as IGroup).globalTransMatrix);\n }\n return this._globalAABBBounds;\n }\n\n /**\n * 这里都是叶子节点的UpdateGlobalTransMatrix函数,只要走进来就直接计算\n * @param clearTag\n * @returns\n */\n protected tryUpdateGlobalTransMatrix(clearTag: boolean = true): Matrix {\n if (!this._globalTransMatrix) {\n this._globalTransMatrix = this.parent\n ? (this.parent as IGroup).globalTransMatrix.clone()\n : this.transMatrix.clone();\n } else if (this.parent) {\n const m = (this.parent as IGroup).globalTransMatrix;\n this._globalTransMatrix.setValue(m.a, m.b, m.c, m.d, m.e, m.f);\n }\n if (this.shouldUpdateGlobalMatrix()) {\n this.doUpdateGlobalMatrix();\n }\n return this._globalTransMatrix;\n }\n\n shouldUpdateGlobalMatrix(): boolean {\n return true;\n }\n\n protected tryUpdateLocalTransMatrix(clearTag: boolean = true) {\n if (!this._transMatrix) {\n this._transMatrix = new Matrix();\n }\n if (this.shouldUpdateLocalMatrix()) {\n this.doUpdateLocalMatrix();\n clearTag && this.clearUpdateLocalPositionTag();\n }\n return this._transMatrix;\n }\n\n shouldUpdateAABBBounds(): boolean {\n // 如果存在shadowRoot,那么判断shadowRoot是否需要更新\n if (this.shadowRoot) {\n return !!(this._updateTag & UpdateTag.UPDATE_BOUNDS) || this.shadowRoot.shouldUpdateAABBBounds();\n }\n return !!(this._updateTag & UpdateTag.UPDATE_BOUNDS);\n }\n\n // 自身变化导致的AABBBounds的变化\n shouldSelfChangeUpdateAABBBounds(): boolean {\n // 如果存在shadowRoot,那么判断shadowRoot是否需要更新\n if (this.shadowRoot) {\n return !!(this._updateTag & UpdateTag.UPDATE_BOUNDS) || this.shadowRoot.shouldUpdateAABBBounds();\n }\n return !!(this._updateTag & UpdateTag.UPDATE_BOUNDS);\n }\n\n protected shouldUpdateLocalMatrix(): boolean {\n return !!(this._updateTag & UpdateTag.UPDATE_LOCAL_MATRIX);\n }\n\n isValid(): boolean {\n const attribute = this.attribute;\n return Number.isFinite((attribute.x ?? 0) + (attribute.y ?? 0));\n }\n\n protected _validNumber(num?: number) {\n return num == null || Number.isFinite(num);\n }\n\n shouldUpdateShape(): boolean {\n return !!(this._updateTag & UpdateTag.UPDATE_SHAPE);\n }\n clearUpdateShapeTag() {\n this._updateTag &= UpdateTag.CLEAR_SHAPE;\n }\n\n /**\n * 是否包含某个点(点需要是全局坐标系)\n * @param x\n * @param y\n * @param mode\n * @returns\n */\n containsPoint(x: number, y: number, mode: IContainPointMode, picker?: IPickerService): boolean {\n if (!picker) {\n return false;\n }\n if (mode === IContainPointMode.GLOBAL) {\n // 转换x,y更精准\n const point = new Point(x, y);\n if (this.parent) {\n this.parent.globalTransMatrix.transformPoint(point, point);\n }\n x = point.x;\n y = point.y;\n }\n return picker.containsPoint(this, { x, y });\n }\n\n setAttributes(params: Partial<T>, forceUpdateTag: boolean = false, context?: ISetAttributeContext) {\n params =\n (this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(params, this.attribute, null, context)) || params;\n\n if (params.background) {\n this.loadImage(params.background, true);\n } else if (params.shadowGraphic) {\n this.setShadowGraphic(params.shadowGraphic);\n }\n this._setAttributes(params, forceUpdateTag, context);\n }\n\n _setAttributes(params: Partial<T>, forceUpdateTag: boolean = false, context?: ISetAttributeContext) {\n const keys = Object.keys(params);\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n\n (this.attribute as any)[key] = (params as any)[key];\n }\n this.valid = this.isValid();\n // 没有设置shape&bounds的tag\n if (!this.updateShapeAndBoundsTagSetted() && (forceUpdateTag || this.needUpdateTags(keys))) {\n this.addUpdateShapeAndBoundsTag();\n } else {\n this.addUpdateBoundTag();\n }\n this.addUpdatePositionTag();\n this.addUpdateLayoutTag();\n this.onAttributeUpdate(context);\n }\n\n setAttribute(key: string, value: any, forceUpdateTag?: boolean, context?: ISetAttributeContext) {\n const params =\n this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate({ [key]: value }, this.attribute, key, context);\n if (!params) {\n if (!isNil((this.normalAttrs as any)?.[key])) {\n (this.normalAttrs as any)[key] = value;\n } else {\n (this.attribute as any)[key] = value;\n this.valid = this.isValid();\n if (!this.updateShapeAndBoundsTagSetted() && (forceUpdateTag || this.needUpdateTag(key))) {\n this.addUpdateShapeAndBoundsTag();\n } else {\n this.addUpdateBoundTag();\n }\n this.addUpdatePositionTag();\n this.addUpdateLayoutTag();\n this.onAttributeUpdate(context);\n }\n } else {\n this._setAttributes(params, forceUpdateTag, context);\n }\n if (key === 'background') {\n this.loadImage(value, true);\n } else if (key === 'shadowGraphic') {\n this.setShadowGraphic(value);\n }\n }\n\n protected needUpdateTags(keys: string[], k: string[] = GRAPHIC_UPDATE_TAG_KEY): boolean {\n for (let i = 0; i < k.length; i++) {\n const attrKey = k[i];\n if (keys.indexOf(attrKey) !== -1) {\n return true;\n }\n }\n return false;\n }\n\n protected needUpdateTag(key: string, k: string[] = GRAPHIC_UPDATE_TAG_KEY): boolean {\n for (let i = 0; i < k.length; i++) {\n const attrKey = k[i];\n if (key === attrKey) {\n return true;\n }\n }\n return false;\n }\n\n initAttributes(params: T) {\n // this.setAttributes(params, true);\n const context = { type: AttributeUpdateType.INIT };\n params =\n (this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(params, this.attribute, null, context)) || params;\n this.attribute = params;\n if (params.background) {\n this.loadImage(params.background, true);\n } else if (params.shadowGraphic) {\n this.setShadowGraphic(params.shadowGraphic);\n }\n this._updateTag = UpdateTag.INIT;\n this.valid = this.isValid();\n this.onAttributeUpdate(context);\n }\n\n translate(x: number, y: number) {\n if (x === 0 && y === 0) {\n return this;\n }\n const context = {\n type: AttributeUpdateType.TRANSLATE\n };\n const params =\n this.onBeforeAttributeUpdate &&\n this.onBeforeAttributeUpdate({ x, y }, this.attribute, tempConstantXYKey, context);\n if (params) {\n x = params.x;\n y = params.y;\n delete params.x;\n delete params.y;\n this._setAttributes(params);\n }\n const attribute = this.attribute;\n const postMatrix = attribute.postMatrix;\n if (!postMatrix) {\n attribute.x = (attribute.x ?? DefaultTransform.x) + x;\n attribute.y = (attribute.y ?? DefaultTransform.y) + y;\n } else {\n application.transformUtil.fromMatrix(postMatrix, postMatrix).translate(x, y);\n }\n\n this.addUpdatePositionTag();\n this.addUpdateBoundTag();\n this.addUpdateLayoutTag();\n this.onAttributeUpdate(context);\n return this;\n }\n\n translateTo(x: number, y: number) {\n const attribute = this.attribute;\n if (attribute.x === x && attribute.y === y) {\n return this;\n }\n const context = {\n type: AttributeUpdateType.TRANSLATE_TO\n };\n const params =\n this.onBeforeAttributeUpdate &&\n this.onBeforeAttributeUpdate({ x, y }, this.attribute, tempConstantXYKey, context);\n if (params) {\n this._setAttributes(params, false, context);\n return this;\n }\n attribute.x = x;\n attribute.y = y;\n this.addUpdatePositionTag();\n this.addUpdateBoundTag();\n this.addUpdateLayoutTag();\n this.onAttributeUpdate(context);\n return this;\n }\n\n scale(scaleX: number, scaleY: number, scaleCenter?: IPointLike) {\n if (scaleX === 1 && scaleY === 1) {\n return this;\n }\n const context = {\n type: AttributeUpdateType.SCALE\n };\n const params =\n this.onBeforeAttributeUpdate &&\n this.onBeforeAttributeUpdate({ scaleX, scaleY, scaleCenter }, this.attribute, tempConstantScaleXYKey, context);\n if (params) {\n scaleX = params.scaleX;\n scaleY = params.scaleY;\n delete params.scaleX;\n delete params.scaleY;\n this._setAttributes(params);\n }\n const attribute = this.attribute;\n if (!scaleCenter) {\n attribute.scaleX = (attribute.scaleX ?? DefaultTransform.scaleX) * scaleX;\n attribute.scaleY = (attribute.scaleY ?? DefaultTransform.scaleY) * scaleY;\n } else {\n let { postMatrix } = this.attribute;\n if (!postMatrix) {\n postMatrix = new Matrix();\n attribute.postMatrix = postMatrix;\n }\n application.transformUtil.fromMatrix(postMatrix, postMatrix).scale(scaleX, scaleY, scaleCenter);\n }\n this.addUpdatePositionTag();\n this.addUpdateBoundTag();\n this.addUpdateLayoutTag();\n this.onAttributeUpdate(context);\n return this;\n }\n\n scaleTo(scaleX: number, scaleY: number) {\n const attribute = this.attribute;\n if (attribute.scaleX === scaleX && attribute.scaleY === scaleY) {\n return this;\n }\n const context = {\n type: AttributeUpdateType.SCALE_TO\n };\n const params =\n this.onBeforeAttributeUpdate &&\n this.onBeforeAttributeUpdate({ scaleX, scaleY }, this.attribute, tempConstantScaleXYKey, context);\n if (params) {\n this._setAttributes(params, false, context);\n return this;\n }\n attribute.scaleX = scaleX;\n attribute.scaleY = scaleY;\n this.addUpdatePositionTag();\n this.addUpdateBoundTag();\n this.addUpdateLayoutTag();\n this.onAttributeUpdate(context);\n return this;\n }\n\n rotate(angle: number, rotateCenter?: IPointLike) {\n if (angle === 0) {\n return this;\n }\n const context = { type: AttributeUpdateType.ROTATE };\n const params =\n this.onBeforeAttributeUpdate &&\n this.onBeforeAttributeUpdate({ angle, rotateCenter }, this.attribute, tempConstantAngleKey, context);\n if (params) {\n delete params.angle;\n this._setAttributes(params, false, context);\n // return this;\n }\n const attribute = this.attribute;\n if (!rotateCenter) {\n attribute.angle = (attribute.angle ?? DefaultTransform.angle) + angle;\n } else {\n let { postMatrix } = this.attribute;\n if (!postMatrix) {\n postMatrix = new Matrix();\n attribute.postMatrix = postMatrix;\n }\n application.transformUtil.fromMatrix(postMatrix, postMatrix).rotate(angle, rotateCenter);\n }\n this.addUpdatePositionTag();\n this.addUpdateBoundTag();\n this.addUpdateLayoutTag();\n this.onAttributeUpdate(context);\n return this;\n }\n\n rotateTo(angle: number) {\n const attribute = this.attribute;\n if (attribute.angle === angle) {\n return this;\n }\n const context = {\n type: AttributeUpdateType.ROTATE_TO\n };\n const params =\n this.onBeforeAttributeUpdate &&\n this.onBeforeAttributeUpdate(angle, this.attribute, tempConstantAngleKey, context);\n if (params) {\n this._setAttributes(params, false, context);\n return this;\n }\n attribute.angle = angle;\n this.addUpdatePositionTag();\n this.addUpdateBoundTag();\n this.addUpdateLayoutTag();\n this.onAttributeUpdate(context);\n return this;\n }\n\n skewTo(b: number, c: number) {\n return this;\n }\n\n animate(params?: IGraphicAnimateParams) {\n if (!this.animates) {\n this.animates = new Map();\n }\n const animate = new Animate(params?.id, this.stage && this.stage.getTimeline()).bind(this);\n if (params) {\n const { onStart, onFrame, onEnd, onRemove } = params;\n onStart != null && animate.onStart(onStart);\n onFrame != null && animate.onFrame(onFrame);\n onEnd != null && animate.onEnd(onEnd);\n onRemove != null && animate.onRemove(onRemove);\n animate.interpolateFunc = params.interpolate;\n }\n this.animates.set(animate.id, animate);\n animate.onRemove(() => {\n this.animates.delete(animate.id);\n });\n\n return animate;\n }\n\n onAttributeUpdate(context?: ISetAttributeContext) {\n if (context && context.skipUpdateCallback) {\n return;\n }\n application.graphicService.onAttributeUpdate(this);\n this._emitCustomEvent('afterAttributeUpdate', context);\n }\n\n // hasListener(event: string) {\n // const prefix = this.prefixed;\n // var evt = prefix ? prefix + event : event;\n // return this._events[evt];\n // }\n\n update(d?: { bounds: boolean; trans: boolean }) {\n if (d) {\n d.bounds && this.tryUpdateAABBBounds(this.attribute.boundsMode === 'imprecise');\n d.trans && this.tryUpdateLocalTransMatrix();\n } else {\n this.tryUpdateAABBBounds(this.attribute.boundsMode === 'imprecise');\n this.tryUpdateLocalTransMatrix();\n }\n }\n\n hasState(stateName?: string) {\n if (!this.currentStates || !this.currentStates.length) {\n return false;\n }\n\n if (!isNil(stateName)) {\n return this.currentStates.includes(stateName);\n }\n\n return true;\n }\n getState(stateName: string) {\n return this.states?.[stateName];\n }\n\n applyStateAttrs(attrs: Partial<T>, stateNames: string[], hasAnimation?: boolean, isClear?: boolean) {\n if (hasAnimation) {\n const keys = Object.keys(attrs);\n const noWorkAttrs = this.getNoWorkAnimateAttr();\n const animateAttrs: Partial<T> = {};\n let noAnimateAttrs: Partial<T> | undefined;\n\n keys.forEach(key => {\n if (!noWorkAttrs[key]) {\n (animateAttrs as any)[key] =\n isClear && (attrs as any)[key] === undefined ? this.getDefaultAttribute(key) : (attrs as any)[key];\n } else {\n if (!noAnimateAttrs) {\n noAnimateAttrs = {};\n }\n (noAnimateAttrs as any)[key] = (attrs as any)[key];\n }\n });\n\n const animate = this.animate();\n (animate as any).stateNames = stateNames;\n animate.to(\n animateAttrs,\n this.stateAnimateConfig?.duration ?? DefaultStateAnimateConfig.duration,\n this.stateAnimateConfig?.easing ?? DefaultStateAnimateConfig.easing\n );\n noAnimateAttrs && this.setAttributes(noAnimateAttrs, false, { type: AttributeUpdateType.STATE });\n } else {\n this.stopStateAnimates();\n this.setAttributes(attrs, false, { type: AttributeUpdateType.STATE });\n }\n }\n\n updateNormalAttrs(stateAttrs: Partial<T>) {\n const newNormalAttrs = {};\n if (this.normalAttrs) {\n Object.keys(stateAttrs).forEach(key => {\n if (key in this.normalAttrs) {\n (newNormalAttrs as any)[key] = (this.normalAttrs as any)[key];\n delete (this.normalAttrs as any)[key];\n } else {\n (newNormalAttrs as any)[key] = this.getNormalAttribute(key);\n }\n });\n Object.keys(this.normalAttrs).forEach(key => {\n (stateAttrs as any)[key] = (this.normalAttrs as any)[key];\n });\n } else {\n Object.keys(stateAttrs).forEach(key => {\n (newNormalAttrs as any)[key] = this.getNormalAttribute(key);\n });\n }\n\n this.normalAttrs = newNormalAttrs;\n }\n\n protected stopStateAnimates(type: 'start' | 'end' = 'end') {\n if (this.animates) {\n this.animates.forEach(animate => {\n if ((animate as any).stateNames) {\n animate.stop(type);\n this.animates.delete(animate.id);\n }\n });\n }\n }\n\n private getNormalAttribute(key: string) {\n let value = (this.attribute as any)[key];\n\n if (this.animates) {\n this.animates.forEach(animate => {\n if ((animate as any).stateNames) {\n const endProps = animate.getEndProps();\n if (has(endProps, key)) {\n value = endProps[key];\n }\n }\n });\n }\n\n return value;\n }\n\n clearStates(hasAnimation?: boolean) {\n if (this.hasState() && this.normalAttrs) {\n this.currentStates = [];\n this.applyStateAttrs(this.normalAttrs, this.currentStates, hasAnimation, true);\n } else {\n this.currentStates = [];\n }\n this.normalAttrs = null;\n }\n\n removeState(stateName: string, hasAnimation?: boolean) {\n const index = this.currentStates ? this.currentStates.indexOf(stateName) : -1;\n\n if (index >= 0) {\n const currentStates = this.currentStates.filter(state => state !== stateName);\n\n this.useStates(currentStates, hasAnimation);\n }\n }\n\n toggleState(stateName: string, hasAnimation?: boolean) {\n if (this.hasState(stateName)) {\n this.removeState(stateName, hasAnimation);\n } else {\n const index = this.currentStates ? this.currentStates.indexOf(stateName) : -1;\n if (index < 0) {\n const nextStates = this.currentStates ? this.currentStates.slice() : [];\n nextStates.push(stateName);\n this.useStates(nextStates, hasAnimation);\n }\n }\n }\n\n addState(stateName: string, keepCurrentStates?: boolean, hasAnimation?: boolean) {\n if (\n this.currentStates &&\n this.currentStates.includes(stateName) &&\n (keepCurrentStates || this.currentStates.length === 1)\n ) {\n return;\n }\n\n const newStates =\n keepCurrentStates && this.currentStates?.length ? this.currentStates.concat([stateName]) : [stateName];\n\n this.useStates(newStates, hasAnimation);\n }\n\n useStates(states: string[], hasAnimation?: boolean) {\n if (!states.length) {\n this.clearStates(hasAnimation);\n return;\n }\n\n const isChange =\n this.currentStates?.length !== states.length ||\n states.some((stateName, index) => this.currentStates[index] !== stateName);\n\n if (!isChange) {\n return;\n }\n\n const stateAttrs = {};\n states.forEach(stateName => {\n const attrs = this.stateProxy ? this.stateProxy(stateName, states) : this.states?.[stateName];\n\n if (attrs) {\n Object.assign(stateAttrs, attrs);\n }\n });\n\n this.updateNormalAttrs(stateAttrs);\n\n this.currentStates = states;\n this.applyStateAttrs(stateAttrs, states, hasAnimation);\n }\n\n addUpdateBoundTag() {\n this._updateTag |= UpdateTag.UPDATE_BOUNDS; // for bounds\n if (this.parent) {\n this.parent.addChildUpdateBoundTag();\n }\n if (this.glyphHost) {\n this.glyphHost.addUpdateBoundTag();\n }\n }\n\n addUpdateShapeTag() {\n this._updateTag |= UpdateTag.UPDATE_SHAPE; // for shape\n }\n\n addUpdateShapeAndBoundsTag() {\n this._updateTag |= UpdateTag.UPDATE_SHAPE_AND_BOUNDS; // for shape&bounds\n if (this.parent) {\n this.parent.addChildUpdateBoundTag();\n }\n if (this.glyphHost) {\n this.glyphHost.addUpdateBoundTag();\n }\n }\n\n protected updateShapeAndBoundsTagSetted(): boolean {\n return (this._updateTag & UpdateTag.UPDATE_SHAPE_AND_BOUNDS) === UpdateTag.UPDATE_SHAPE_AND_BOUNDS;\n }\n\n protected clearUpdateBoundTag() {\n this._updateTag &= UpdateTag.CLEAR_BOUNDS;\n }\n /**\n * 更新位置tag,包括全局tag和局部tag\n */\n addUpdatePositionTag() {\n // 更新shadowRoot的全局位置\n this.shadowRoot && this.shadowRoot.addUpdateGlobalPositionTag();\n this._updateTag |= UpdateTag.UPDATE_GLOBAL_LOCAL_MATRIX;\n }\n /**\n * 更新全局位置tag\n */\n addUpdateGlobalPositionTag() {\n // 更新shadowRoot的全局位置\n this.shadowRoot && this.shadowRoot.addUpdateGlobalPositionTag();\n this._updateTag |= UpdateTag.UPDATE_GLOBAL_MATRIX;\n }\n /**\n * 清除局部位置tag\n */\n protected clearUpdateLocalPositionTag() {\n this._updateTag &= UpdateTag.CLEAR_LOCAL_MATRIX;\n }\n /**\n * 清除全局位置tag\n */\n protected clearUpdateGlobalPositionTag() {\n this._updateTag &= UpdateTag.CLEAR_GLOBAL_MATRIX;\n }\n\n addUpdateLayoutTag() {\n this._updateTag |= UpdateTag.UPDATE_LAYOUT;\n }\n\n protected clearUpdateLayoutTag() {\n this._updateTag &= UpdateTag.CLEAR_LAYOUT;\n }\n\n protected needUpdateLayout(): boolean {\n return !!(this._updateTag & UpdateTag.UPDATE_LAYOUT);\n }\n\n protected getAnchor(anchor: [string | number, string | number], params: { b?: IAABBBounds }) {\n const _anchor: [number, number] = [0, 0];\n const getBounds = () => {\n if (params.b) {\n return params.b;\n }\n const { scaleX, scaleY, angle } = this.attribute;\n // 拷贝一份,避免计算bounds的过程中计算matrix,然后matrix又修改了bounds\n tempBounds.copy(this._AABBBounds);\n // @ts-ignore\n this.setAttributes({ scaleX: 1, scaleY: 1, angle: 0 });\n params.b = this.AABBBounds.clone();\n this._AABBBounds.copy(tempBounds);\n // @ts-ignore\n this.setAttributes({ scaleX, scaleY, angle });\n return params.b;\n };\n if (typeof anchor[0] === 'string') {\n const ratio = parseFloat(anchor[0]) / 100;\n const bounds = getBounds();\n _anchor[0] = bounds.x1 + (bounds.x2 - bounds.x1) * ratio;\n } else {\n _anchor[0] = anchor[0];\n }\n if (typeof anchor[1] === 'string') {\n const ratio = parseFloat(anchor[1]) / 100;\n const bounds = getBounds();\n _anchor[1] = bounds.y1 + (bounds.y2 - bounds.y1) * ratio;\n } else {\n _anchor[1] = anchor[1];\n }\n\n return _anchor;\n }\n\n /**\n * 更新局部matrix的具体函数\n */\n protected doUpdateLocalMatrix() {\n const {\n x = DefaultTransform.x,\n y = DefaultTransform.y,\n scaleX = DefaultTransform.scaleX,\n scaleY = DefaultTransform.scaleY,\n angle = DefaultTransform.angle,\n scaleCenter,\n anchor,\n postMatrix\n } = this.attribute;\n let _anchor: [number, number] = [0, 0];\n const params = {};\n if (anchor) {\n _anchor = this.getAnchor(anchor, params);\n }\n if (scaleCenter && (scaleX !== 1 || scaleY !== 1)) {\n const m = this._transMatrix;\n m.reset();\n m.translate(_anchor[0], _anchor[1]);\n m.rotate(angle);\n m.translate(-_anchor[0], -_anchor[1]);\n\n m.translate(x, y);\n // m.translate(scaleCenter[0] * scaleX, scaleCenter[1] * scaleY);\n // 计算bounds\n _anchor = this.getAnchor(scaleCenter, params);\n application.transformUtil.fromMatrix(m, m).scale(scaleX, scaleY, { x: _anchor[0], y: _anchor[1] });\n // m.translate(-scaleCenter[0], -scaleCenter[1]);\n } else {\n normalTransform(this._transMatrix, this._transMatrix.reset(), x, y, scaleX, scaleY, angle, anchor && _anchor);\n }\n const p = this.getOffsetXY(DefaultTransform);\n this._transMatrix.e += p.x;\n this._transMatrix.f += p.y;\n\n if (postMatrix) {\n const m1 = tempMatrix.setValue(\n postMatrix.a,\n postMatrix.b,\n postMatrix.c,\n postMatrix.d,\n postMatrix.e,\n postMatrix.f\n );\n const m2 = this._transMatrix;\n m1.multiply(m2.a, m2.b, m2.c, m2.d, m2.e, m2.f);\n m2.setValue(m1.a, m1.b, m1.c, m1.d, m1.e, m1.f);\n }\n }\n /**\n * 更新全局matrix的具体函数\n */\n protected doUpdateGlobalMatrix() {\n // 基于parent的matrix修改\n if (this.parent) {\n this._globalTransMatrix.multiply(\n this.transMatrix.a,\n this.transMatrix.b,\n this.transMatrix.c,\n this.transMatrix.d,\n this.transMatrix.e,\n this.transMatrix.f\n );\n const { scrollX = 0, scrollY = 0 } = this.parent.attribute;\n this._globalTransMatrix.translate(scrollX, scrollY);\n }\n }\n\n setStage(stage?: IStage, layer?: ILayer) {\n if (this.stage !== stage) {\n this.stage = stage;\n this.layer = layer;\n this.setStageToShadowRoot(stage, layer);\n if (this.animates && this.animates.size) {\n const timeline = stage.getTimeline();\n this.animates.forEach(a => {\n a.setTimeline(timeline);\n });\n }\n this._onSetStage && this._onSetStage(this, stage, layer);\n application.graphicService.onSetStage(this, stage);\n }\n }\n\n setStageToShadowRoot(stage?: IStage, layer?: ILayer) {\n if (this.shadowRoot) {\n this.shadowRoot.setStage(stage, layer);\n }\n }\n\n onAddStep(step: IStep) {\n return;\n }\n onStop(props?: Partial<T>): void {\n if (props) {\n this.setAttributes(props, false, { type: AttributeUpdateType.ANIMATE_END });\n }\n }\n // step时调用\n onStep(subAnimate: ISubAnimate, animate: IAnimate, step: IStep, ratio: number, end: boolean) {\n const nextAttributes = {};\n if (step.customAnimate) {\n step.customAnimate.update(end, ratio, nextAttributes);\n } else {\n const nextProps = step.props;\n const nextParsedProps = step.parsedProps;\n const propKeys = step.propKeys;\n this.stepInterpolate(\n subAnimate,\n animate,\n nextAttributes,\n step,\n ratio,\n end,\n nextProps,\n undefined,\n nextParsedProps,\n propKeys\n );\n }\n this.setAttributes(nextAttributes, false, {\n type: AttributeUpdateType.ANIMATE_UPDATE,\n animationState: {\n ratio,\n end,\n step,\n isFirstFrameOfStep: subAnimate.getLastStep() !== step\n }\n });\n this.stage && this.stage.renderNextFrame();\n }\n\n stepInterpolate(\n subAnimate: ISubAnimate,\n animate: IAnimate,\n nextAttributes: Record<string, any>,\n step: IStep,\n ratio: number,\n end: boolean,\n nextProps: Record<string, any>,\n lastProps?: Record<string, any>,\n nextParsedProps?: any,\n propKeys?: string[]\n ) {\n if (!propKeys) {\n propKeys = Object.keys(nextProps);\n step.propKeys = propKeys;\n }\n if (end) {\n step.propKeys.forEach(key => {\n if (!animate.validAttr(key)) {\n return;\n }\n nextAttributes[key] = nextProps[key];\n });\n } else {\n propKeys.forEach(key => {\n // 如果属性不合法,那直接return\n if (!animate.validAttr(key)) {\n return;\n }\n const nextStepVal = nextProps[key];\n const lastStepVal = (lastProps && lastProps[key]) ?? subAnimate.getLastPropByName(key, step);\n if (nextStepVal == null || lastStepVal == null) {\n // 用户直接调用stepInterpolate可能会走进来,如果传入的参数出现null或者undefined,直接赋值最终的值\n nextAttributes[key] = nextStepVal;\n return;\n }\n let match: boolean;\n match =\n animate.interpolateFunc && animate.interpolateFunc(key, ratio, lastStepVal, nextStepVal, nextAttributes);\n if (match) {\n return;\n }\n match = animate.customInterpolate(key, ratio, lastStepVal, nextStepVal, this, nextAttributes);\n if (match) {\n return;\n }\n if (!this.defaultInterpolate(nextStepVal, lastStepVal, key, nextAttributes, nextParsedProps, ratio)) {\n this._interpolate(key, ratio, lastStepVal, nextStepVal, nextAttributes);\n }\n });\n }\n\n step.parsedProps = nextParsedProps;\n }\n\n defaultInterpolate(\n nextStepVal: any,\n lastStepVal: any,\n key: string,\n nextAttributes: Record<string, any>,\n nextParsedProps: any,\n ratio: number\n ) {\n if (Number.isFinite(nextStepVal)) {\n nextAttributes[key] = lastStepVal + (nextStepVal - lastStepVal) * ratio;\n return true;\n } else if (key === 'fill') {\n if (!nextParsedProps) {\n nextParsedProps = {};\n }\n // 保存解析的结果到step\n const fillColorArray: [number, number, number, number] = nextParsedProps.fillColorArray;\n const color = interpolateColor(lastStepVal, fillColorArray ?? nextStepVal, ratio, false, (fArray, tArray) => {\n nextParsedProps.fillColorArray = tArray;\n });\n if (color) {\n nextAttributes[key] = color;\n }\n return true;\n } else if (key === 'stroke') {\n if (!nextParsedProps) {\n nextParsedProps = {};\n }\n // 保存解析的结果到step\n const strokeColorArray: [number, number, number, number] = nextParsedProps.strokeColorArray;\n const color = interpolateColor(lastStepVal, strokeColorArray ?? nextStepVal, ratio, false, (fArray, tArray) => {\n nextParsedProps.strokeColorArray = tArray;\n });\n if (color) {\n nextAttributes[key] = color;\n }\n return true;\n } else if (key === 'shadowColor') {\n if (!nextParsedProps) {\n nextParsedProps = {};\n }\n // 保存解析的结果到step\n const shadowColorArray: [number, number, number, number] = nextParsedProps.shadowColorArray;\n const color = interpolateColor(lastStepVal, shadowColorArray ?? nextStepVal, ratio, true, (fArray, tArray) => {\n nextParsedProps.shadowColorArray = tArray;\n });\n if (color) {\n nextAttributes[key] = color;\n }\n\n return true;\n }\n\n return false;\n }\n\n protected _interpolate(key: string, ratio: number, lastStepVal: any, nextStepVal: any, nextAttributes: any) {\n return;\n }\n\n getDefaultAttribute(name: string) {\n return (this.getGraphicTheme() as any)[name];\n }\n\n // 获取属性\n getComputedAttribute(name: string) {\n return (this.attribute as any)[name] ?? this.getDefaultAttribute(name);\n }\n /**\n * 添加onSetStage钩子\n * @param cb 回调函数\n * @param immediate 是否立刻执行,如果在回调添加之前stage就已经绑定,那么如果第二个参数为true就立刻执行回调\n */\n onSetStage(cb: (g: IGraphic, stage: IStage) => void, immediate: boolean = false) {\n this._onSetStage = cb;\n if (immediate && this.stage) {\n cb(this, this.stage);\n }\n }\n\n /******************** shadow graphic *********************/\n attachShadow(shadowRoot?: IShadowRoot) {\n if (shadowRoot) {\n shadowRoot.shadowHost = this;\n }\n\n this.shadowRoot = shadowRoot ?? application.graphicService.creator.shadowRoot(this);\n this.addUpdateBoundTag();\n this.shadowRoot.setStage(this.stage, this.layer);\n return this.shadowRoot;\n }\n\n detachShadow() {\n if (this.shadowRoot) {\n this.addUpdateBoundTag();\n this.shadowRoot = null;\n }\n }\n\n toJson(): IGraphicJson {\n return {\n attribute: this.attribute,\n _uid: this._uid,\n type: this.type,\n name: this.name,\n children: this.children.map((item: IGraphic) => item.toJson())\n };\n }\n\n createPathProxy(path?: string) {\n if (isString(path, true)) {\n this.pathProxy = new CustomPath2D().fromString(path as string);\n } else {\n this.pathProxy = new CustomPath2D();\n }\n\n return this.pathProxy;\n }\n\n loadImage(image: any, background: boolean = false) {\n if (!image || (background && backgroundNotImage(image))) {\n return;\n }\n const url = image;\n if (!this.resources) {\n this.resources = new Map();\n }\n const cache: {\n state: 'loading' | 'success' | 'init' | 'fail';\n data: any;\n } = {\n data: 'init',\n state: null\n };\n this.resources.set(url, cache);\n if (typeof image === 'string') {\n cache.state = 'loading';\n if (image.startsWith('<svg')) {\n // TODO 封装isSvg到@visactor/vutils\n ResourceLoader.GetSvg(image, this);\n this.backgroundImg = this.backgroundImg || background;\n } else if (isValidUrl(image) || image.includes('/') || isBase64(image)) {\n ResourceLoader.GetImage(image, this);\n this.backgroundImg = this.backgroundImg || background;\n }\n } else if (isObject(image)) {\n (cache.state = 'success'), (cache.data = image);\n this.backgroundImg = this.backgroundImg || background;\n } else {\n cache.state = 'fail';\n }\n }\n\n setShadowGraphic(graphic: IGraphic) {\n if (!graphic) {\n this.detachShadow();\n } else {\n const root = this.attachShadow();\n root.add(graphic);\n }\n }\n\n imageLoadSuccess(url: string, image: HTMLImageElement, cb?: () => void) {\n // 更新属性\n // this.resourceState = 'success';\n // this.resource = image;\n if (!this.resources) {\n return;\n }\n const res = this.resources.get(url);\n if (!res) {\n return;\n }\n res.state = 'success';\n res.data = image;\n\n cb && cb();\n\n // 触发重绘\n // 暂时全量,TODO 启动局部重绘\n // this.stage.enableDirtyBounds();\n // this.stage.dirty(this.AABBBounds);\n this.addUpdateBoundTag(); // 添加bounds更新tag重绘才会绘制这个mark\n this.stage && this.stage.renderNextFrame();\n }\n\n imageLoadFail(url: string, cb?: () => void) {\n if (!this.resources) {\n return;\n }\n const res = this.resources.get(url);\n if (!res) {\n return;\n }\n res.state = 'fail';\n\n cb && cb();\n }\n\n private _stopAnimates(animates: Map<string | number, IAnimate>) {\n if (animates) {\n animates.forEach(animate => {\n animate.stop();\n });\n }\n }\n\n stopAnimates(stopChildren: boolean = false) {\n this._stopAnimates(this.animates);\n\n if (this.shadowRoot) {\n // 停止所有影子节点的动画\n this.shadowRoot.stopAnimates(true);\n }\n if (this.isContainer && stopChildren) {\n this.forEachChildren((c: IGraphic) => {\n c.stopAnimates(stopChildren);\n });\n }\n }\n\n release(): void {\n this.releaseStatus = 'released';\n application.graphicService.onRelease(this);\n }\n\n protected _emitCustomEvent(type: string, context?: any) {\n if (this._events && type in this._events) {\n const changeEvent = new CustomEvent(type, context);\n changeEvent.bubbles = false;\n\n (changeEvent as any).manager = (this.stage as any)?.eventSystem?.manager;\n this.dispatchEvent(changeEvent);\n }\n }\n\n abstract getNoWorkAnimateAttr(): Record<string, number>;\n\n abstract clone(): IGraphic<any>;\n}\n\nGraphic.mixin(EventTarget);\n\nfunction backgroundNotImage(image: any) {\n if (image.fill || image.stroke) {\n return true;\n }\n return false;\n}\n"]}
1
+ {"version":3,"sources":["../src/graphic/graphic.ts"],"names":[],"mappings":";;;AAEA,6CAW0B;AAY1B,2CAAmC;AAanC,oCAAoD;AACpD,qCAA4C;AAC5C,gDAA6C;AAC7C,wCAAgE;AAChE,6DAA+D;AAC/D,2DAAuD;AACvD,sDAA2D;AAC3D,2CAAoF;AACpF,6DAAyD;AACzD,uEAAkE;AAClE,2CAA+C;AAmC/C,MAAM,UAAU,GAAG,IAAI,eAAM,EAAE,CAAC;AAChC,MAAM,UAAU,GAAG,IAAI,mBAAU,EAAE,CAAC;AAEvB,QAAA,cAAc,GAAG;IAC5B,QAAQ;IACR,SAAS;IACT,eAAe;IACf,UAAU;IACV,gBAAgB;IAChB,SAAS;IACT,UAAU;IACV,YAAY;IACZ,MAAM;IACN,aAAa;CACd,CAAC;AAEW,QAAA,sBAAsB,GAAG;IACpC,WAAW;IAIX,QAAQ;IACR,QAAQ;IACR,OAAO;IACP,QAAQ;IACR,SAAS;CACV,CAAC;AAEF,MAAM,iBAAiB,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;AACrC,MAAM,sBAAsB,GAAG,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;AACpD,MAAM,oBAAoB,GAAG,CAAC,OAAO,CAAC,CAAC;AAEvC,MAAM,KAAK,GAAG,IAAI,cAAK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G,IAAI,mBAAW,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;YACnD,WAAW,CAAC,OAAO,GAAG,KAAK,CAAC;YAE3B,WAAmB,CAAC,OAAO,GAAG,MAAA,MAAC,IAAI,CAAC,KAAa,0CAAE,WAAW,0CAAE,OAAO,CAAC;YACzE,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC;SACjC;IACH,CAAC;CAKF;AA30CD,0BA20CC;AAED,OAAO,CAAC,KAAK,CAAC,mBAAW,CAAC,CAAC;AAE3B,SAAS,kBAAkB,CAAC,KAAU;IACpC,IAAI,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,MAAM,EAAE;QAC9B,OAAO,IAAI,CAAC;KACb;IACD,OAAO,KAAK,CAAC;AACf,CAAC","file":"graphic.js","sourcesContent":["import type { ICustomPath2D } from './../interface/path';\nimport type { Dict, IPointLike, IAABBBounds } from '@visactor/vutils';\nimport {\n AABBBounds,\n Matrix,\n normalTransform,\n Point,\n isNil,\n has,\n isString,\n isValidUrl,\n isBase64,\n isObject\n} from '@visactor/vutils';\nimport type {\n GraphicType,\n IAnimateConfig,\n IGraphicAttribute,\n IGraphic,\n IGraphicAnimateParams,\n IGraphicJson,\n ISetAttributeContext,\n ITransform,\n GraphicReleaseStatus\n} from '../interface/graphic';\nimport { Node } from './node-tree';\nimport type {\n IAnimate,\n IAnimateTarget,\n IGlyphGraphicAttribute,\n IGroup,\n ILayer,\n IPickerService,\n IShadowRoot,\n IStage,\n IStep,\n ISubAnimate\n} from '../interface';\nimport { EventTarget, CustomEvent } from '../event';\nimport { DefaultTransform } from './config';\nimport { application } from '../application';\nimport { Animate, DefaultStateAnimateConfig } from '../animate';\nimport { interpolateColor } from '../color-string/interpolate';\nimport { CustomPath2D } from '../common/custom-path2d';\nimport { ResourceLoader } from '../resource-loader/loader';\nimport { AttributeUpdateType, IContainPointMode, UpdateTag } from '../common/enums';\nimport { BoundsContext } from '../common/bounds-context';\nimport { renderCommandList } from '../common/render-command-list';\nimport { parsePadding } from '../common/utils';\n\n/**\n * pathProxy参考自zrender\n * BSD 3-Clause License\n\n Copyright (c) 2017, Baidu Inc.\n All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n * Redistributions of source code must retain the above copyright notice, this\n list of conditions and the following disclaimer.\n\n * Redistributions in binary form must reproduce the above copyright notice,\n this list of conditions and the following disclaimer in the documentation\n and/or other materials provided with the distribution.\n\n * Neither the name of the copyright holder nor the names of its\n contributors may be used to endorse or promote products derived from\n this software without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nconst tempMatrix = new Matrix();\nconst tempBounds = new AABBBounds();\n\nexport const PURE_STYLE_KEY = [\n 'stroke',\n 'opacity',\n 'strokeOpacity',\n 'lineDash',\n 'lineDashOffset',\n 'lineCap',\n 'lineJoin',\n 'miterLimit',\n 'fill',\n 'fillOpacity'\n];\n\nexport const GRAPHIC_UPDATE_TAG_KEY = [\n 'lineWidth',\n // 'lineCap',\n // 'lineJoin',\n // 'miterLimit',\n 'scaleX',\n 'scaleY',\n 'angle',\n 'anchor',\n 'visible'\n];\n\nconst tempConstantXYKey = ['x', 'y'];\nconst tempConstantScaleXYKey = ['scaleX', 'scaleY'];\nconst tempConstantAngleKey = ['angle'];\n\nconst point = new Point();\n\nexport const NOWORK_ANIMATE_ATTR = {\n strokeSeg: 1,\n boundsPadding: 2,\n pickMode: 1,\n boundsMode: 1,\n customPickShape: 1,\n pickable: 1,\n childrenPickable: 1,\n visible: 1,\n zIndex: 1,\n layout: 1,\n keepDirIn3d: 1,\n globalZIndex: 1,\n\n outerBorder: 1,\n innerBorder: 1,\n lineDash: 1,\n lineCap: 1,\n lineJoin: 1,\n miterLimit: 2,\n strokeBoundsBuffer: 2,\n\n scaleCenter: 1,\n anchor: 1,\n anchor3d: 1,\n postMatrix: 1,\n\n backgroundMode: 2,\n background: 1,\n texture: 1,\n cursor: 1,\n html: 1\n};\n\n/**\n * globalTransMatrix更新逻辑\n * 1. group的transform修改,会下发到所有下层group,将所有下层的tag修改\n * 2. 叶子graphic每次获取globalTransMatrix都重新计算\n * 3. 所有节点的transform修改,或者globalTransform修改,都会下发到自己的shadowRoot上\n */\n\nexport abstract class Graphic<T extends Partial<IGraphicAttribute> = Partial<IGraphicAttribute>>\n extends Node\n implements IGraphic<T>, IAnimateTarget\n{\n /**\n * Mixes all enumerable properties and methods from a source object to Element.\n * @param source - The source of properties and methods to mix in.\n */\n static mixin(source: Dict<any>): void {\n // in ES8/ES2017, this would be really easy:\n // Object.defineProperties(Element.prototype, Object.getOwnPropertyDescriptors(source));\n\n // get all the enumerable property keys\n const keys = Object.keys(source);\n\n // loop through properties\n for (let i = 0; i < keys.length; ++i) {\n const propertyName = keys[i];\n\n // Set the property using the property descriptor - this works for accessors and normal value properties\n Object.defineProperty(\n Graphic.prototype,\n propertyName,\n Object.getOwnPropertyDescriptor(source, propertyName) as PropertyDecorator\n );\n }\n }\n\n declare _events?: any;\n\n declare onBeforeAttributeUpdate?: (\n val: any,\n attributes: Partial<T>,\n key: null | string | string[],\n context?: ISetAttributeContext\n ) => T | undefined;\n declare parent: any;\n\n declare resources?: Map<\n string,\n { state: 'init' | 'loading' | 'success' | 'fail'; data?: HTMLImageElement | HTMLCanvasElement }\n >;\n declare backgroundImg?: boolean;\n\n declare type: GraphicType;\n declare prefixed: string;\n declare numberType: number;\n declare isContainer?: boolean;\n declare valid: boolean;\n declare stage?: IStage;\n declare layer?: ILayer;\n declare incremental?: number;\n declare glyphHost?: IGraphic<IGlyphGraphicAttribute>;\n declare _onSetStage?: (g: IGraphic, stage: IStage, layer: ILayer) => void;\n // declare _beforeAttributeUpdate?: (key: string | string, value: any) => void;\n // 标记是否是在3d模式下\n declare in3dMode?: boolean;\n\n // aabbBounds,所有图形都需要有,所以初始化即赋值\n protected declare _AABBBounds: IAABBBounds;\n get AABBBounds(): IAABBBounds {\n return this.tryUpdateAABBBounds(this.attribute.boundsMode === 'imprecise');\n }\n // 具有旋转的包围盒,部分图元需要,动态初始化\n // protected declare _OBBBounds?: OBBBounds;\n // get OBBBounds(): OBBBounds {\n // return this.tryUpdateOBBBounds();\n // }\n protected declare _globalAABBBounds: IAABBBounds;\n // 全局包围盒,部分图元需要,动态初始化,建议使用AABBBounds\n get globalAABBBounds(): IAABBBounds {\n return this.tryUpdateGlobalAABBBounds();\n }\n protected declare _transMatrix: Matrix;\n get transMatrix(): Matrix {\n return this.tryUpdateLocalTransMatrix(true);\n }\n protected declare _globalTransMatrix: Matrix;\n get globalTransMatrix(): Matrix {\n return this.tryUpdateGlobalTransMatrix(true);\n }\n protected declare _updateTag: number;\n\n // 上次更新的stamp\n declare stamp?: number;\n\n declare attribute: T;\n\n declare shadowRoot?: IShadowRoot;\n\n declare releaseStatus?: GraphicReleaseStatus;\n\n /** 记录state对应的图形属性 */\n declare states?: Record<string, Partial<T>>;\n /** 当前state值 */\n declare currentStates?: string[];\n /** TODO: state更新对应的动画配置 */\n declare stateAnimateConfig?: IAnimateConfig;\n /** 记录应用state之前,attribute对应的原始图形属性 */\n declare normalAttrs?: Partial<T>;\n /** 获取state图形属性的方法 */\n declare stateProxy?: (stateName: string, targetStates?: string[]) => T;\n declare animates: Map<string | number, IAnimate>;\n\n declare nextAttrs?: T;\n declare prevAttrs?: T;\n declare finalAttrs?: T;\n\n declare pathProxy?: ICustomPath2D;\n // 依附于某个theme,如果该节点不存在parent,那么这个Theme就作为节点的Theme,避免添加到节点前计算属性\n declare attachedThemeGraphic?: IGraphic;\n\n constructor(params: T = {} as T) {\n super();\n this._AABBBounds = new AABBBounds();\n this._updateTag = UpdateTag.INIT;\n this.attribute = params;\n this.valid = this.isValid();\n if (params.background) {\n this.loadImage((params.background as any).background ?? params.background, true);\n } else if (params.shadowGraphic) {\n this.setShadowGraphic(params.shadowGraphic);\n }\n }\n\n setMode(mode: '2d' | '3d') {\n mode === '3d' ? this.set3dMode() : this.set2dMode();\n }\n\n set3dMode() {\n this.in3dMode = true;\n }\n set2dMode() {\n this.in3dMode = false;\n }\n getOffsetXY(attr?: ITransform, includeScroll: boolean = false) {\n const { dx = attr.dx, dy = attr.dy } = this.attribute;\n if (includeScroll && this.parent) {\n // const groupTheme = getTheme(this.parent).group;\n const attribute = this.parent.attribute;\n point.x = dx + (attribute.scrollX ?? 0);\n point.y = dy + (attribute.scrollY ?? 0);\n } else {\n point.x = dx;\n point.y = dy;\n }\n return point;\n }\n\n onAnimateBind(animate: IAnimate | ISubAnimate) {\n this._emitCustomEvent('animate-bind', animate);\n }\n\n protected tryUpdateAABBBounds(full?: boolean): IAABBBounds {\n if (!this.shouldUpdateAABBBounds()) {\n return this._AABBBounds;\n }\n if (!this.valid) {\n this._AABBBounds.clear();\n return this._AABBBounds;\n }\n\n application.graphicService.beforeUpdateAABBBounds(this, this.stage, true, this._AABBBounds);\n const bounds = this.doUpdateAABBBounds(full);\n // this.addUpdateLayoutTag();\n application.graphicService.afterUpdateAABBBounds(this, this.stage, this._AABBBounds, this, true);\n return bounds;\n }\n\n protected combindShadowAABBBounds(bounds: IAABBBounds) {\n // 合并shadowRoot的Bounds\n if (this.shadowRoot) {\n const b = this.shadowRoot.AABBBounds.clone();\n bounds.union(b);\n }\n }\n\n abstract getGraphicTheme(): T;\n\n protected abstract updateAABBBounds(\n attribute: T,\n symbolTheme: Required<T>,\n aabbBounds: IAABBBounds,\n full?: boolean\n ): IAABBBounds;\n\n protected doUpdateAABBBounds(full?: boolean): IAABBBounds {\n const graphicTheme = this.getGraphicTheme();\n this._AABBBounds.clear();\n const attribute = this.attribute;\n const bounds = this.updateAABBBounds(attribute, graphicTheme as Required<T>, this._AABBBounds, full) as AABBBounds;\n\n const { boundsPadding = graphicTheme.boundsPadding } = attribute;\n const paddingArray = parsePadding(boundsPadding);\n if (paddingArray) {\n bounds.expand(paddingArray);\n }\n\n this.clearUpdateBoundTag();\n return bounds;\n }\n\n updatePathProxyAABBBounds(aabbBounds: IAABBBounds): boolean {\n const path = typeof this.pathProxy === 'function' ? (this.pathProxy as any)(this.attribute) : this.pathProxy;\n if (!path) {\n return false;\n }\n const boundsContext = new BoundsContext(aabbBounds);\n renderCommandList(path.commandList, boundsContext, 0, 0);\n return true;\n }\n\n protected tryUpdateGlobalAABBBounds(): IAABBBounds {\n const b = this.AABBBounds;\n if (!this._globalAABBBounds) {\n this._globalAABBBounds = b.clone();\n } else {\n this._globalAABBBounds.setValue(b.x1, b.y1, b.x2, b.y2);\n }\n if (this._globalAABBBounds.empty()) {\n return this._globalAABBBounds;\n }\n // 使用parent的grloalAABBBounds\n // todo: 考虑是否需要性能优化\n if (this.parent) {\n this._globalAABBBounds.transformWithMatrix((this.parent as IGroup).globalTransMatrix);\n }\n return this._globalAABBBounds;\n }\n\n /**\n * 这里都是叶子节点的UpdateGlobalTransMatrix函数,只要走进来就直接计算\n * @param clearTag\n * @returns\n */\n protected tryUpdateGlobalTransMatrix(clearTag: boolean = true): Matrix {\n if (!this._globalTransMatrix) {\n this._globalTransMatrix = this.parent\n ? (this.parent as IGroup).globalTransMatrix.clone()\n : this.transMatrix.clone();\n } else if (this.parent) {\n const m = (this.parent as IGroup).globalTransMatrix;\n this._globalTransMatrix.setValue(m.a, m.b, m.c, m.d, m.e, m.f);\n }\n if (this.shouldUpdateGlobalMatrix()) {\n this.doUpdateGlobalMatrix();\n }\n return this._globalTransMatrix;\n }\n\n shouldUpdateGlobalMatrix(): boolean {\n return true;\n }\n\n protected tryUpdateLocalTransMatrix(clearTag: boolean = true) {\n if (!this._transMatrix) {\n this._transMatrix = new Matrix();\n }\n if (this.shouldUpdateLocalMatrix()) {\n this.doUpdateLocalMatrix();\n clearTag && this.clearUpdateLocalPositionTag();\n }\n return this._transMatrix;\n }\n\n shouldUpdateAABBBounds(): boolean {\n // 如果存在shadowRoot,那么判断shadowRoot是否需要更新\n if (this.shadowRoot) {\n return !!(this._updateTag & UpdateTag.UPDATE_BOUNDS) || this.shadowRoot.shouldUpdateAABBBounds();\n }\n return !!(this._updateTag & UpdateTag.UPDATE_BOUNDS);\n }\n\n // 自身变化导致的AABBBounds的变化\n shouldSelfChangeUpdateAABBBounds(): boolean {\n // 如果存在shadowRoot,那么判断shadowRoot是否需要更新\n if (this.shadowRoot) {\n return !!(this._updateTag & UpdateTag.UPDATE_BOUNDS) || this.shadowRoot.shouldUpdateAABBBounds();\n }\n return !!(this._updateTag & UpdateTag.UPDATE_BOUNDS);\n }\n\n protected shouldUpdateLocalMatrix(): boolean {\n return !!(this._updateTag & UpdateTag.UPDATE_LOCAL_MATRIX);\n }\n\n isValid(): boolean {\n const attribute = this.attribute;\n return Number.isFinite((attribute.x ?? 0) + (attribute.y ?? 0));\n }\n\n protected _validNumber(num?: number) {\n return num == null || Number.isFinite(num);\n }\n\n shouldUpdateShape(): boolean {\n return !!(this._updateTag & UpdateTag.UPDATE_SHAPE);\n }\n clearUpdateShapeTag() {\n this._updateTag &= UpdateTag.CLEAR_SHAPE;\n }\n\n /**\n * 是否包含某个点(点需要是全局坐标系)\n * @param x\n * @param y\n * @param mode\n * @returns\n */\n containsPoint(x: number, y: number, mode: IContainPointMode, picker?: IPickerService): boolean {\n if (!picker) {\n return false;\n }\n if (mode === IContainPointMode.GLOBAL) {\n // 转换x,y更精准\n const point = new Point(x, y);\n if (this.parent) {\n this.parent.globalTransMatrix.transformPoint(point, point);\n }\n x = point.x;\n y = point.y;\n }\n return picker.containsPoint(this, { x, y });\n }\n\n setAttributes(params: Partial<T>, forceUpdateTag: boolean = false, context?: ISetAttributeContext) {\n params =\n (this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(params, this.attribute, null, context)) || params;\n\n if (params.background) {\n this.loadImage(params.background, true);\n } else if (params.shadowGraphic) {\n this.setShadowGraphic(params.shadowGraphic);\n }\n this._setAttributes(params, forceUpdateTag, context);\n }\n\n _setAttributes(params: Partial<T>, forceUpdateTag: boolean = false, context?: ISetAttributeContext) {\n const keys = Object.keys(params);\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n\n (this.attribute as any)[key] = (params as any)[key];\n }\n this.valid = this.isValid();\n // 没有设置shape&bounds的tag\n if (!this.updateShapeAndBoundsTagSetted() && (forceUpdateTag || this.needUpdateTags(keys))) {\n this.addUpdateShapeAndBoundsTag();\n } else {\n this.addUpdateBoundTag();\n }\n this.addUpdatePositionTag();\n this.addUpdateLayoutTag();\n this.onAttributeUpdate(context);\n }\n\n setAttribute(key: string, value: any, forceUpdateTag?: boolean, context?: ISetAttributeContext) {\n const params =\n this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate({ [key]: value }, this.attribute, key, context);\n if (!params) {\n if (!isNil((this.normalAttrs as any)?.[key])) {\n (this.normalAttrs as any)[key] = value;\n } else {\n (this.attribute as any)[key] = value;\n this.valid = this.isValid();\n if (!this.updateShapeAndBoundsTagSetted() && (forceUpdateTag || this.needUpdateTag(key))) {\n this.addUpdateShapeAndBoundsTag();\n } else {\n this.addUpdateBoundTag();\n }\n this.addUpdatePositionTag();\n this.addUpdateLayoutTag();\n this.onAttributeUpdate(context);\n }\n } else {\n this._setAttributes(params, forceUpdateTag, context);\n }\n if (key === 'background') {\n this.loadImage(value, true);\n } else if (key === 'shadowGraphic') {\n this.setShadowGraphic(value);\n }\n }\n\n protected needUpdateTags(keys: string[], k: string[] = GRAPHIC_UPDATE_TAG_KEY): boolean {\n for (let i = 0; i < k.length; i++) {\n const attrKey = k[i];\n if (keys.indexOf(attrKey) !== -1) {\n return true;\n }\n }\n return false;\n }\n\n protected needUpdateTag(key: string, k: string[] = GRAPHIC_UPDATE_TAG_KEY): boolean {\n for (let i = 0; i < k.length; i++) {\n const attrKey = k[i];\n if (key === attrKey) {\n return true;\n }\n }\n return false;\n }\n\n initAttributes(params: T) {\n // this.setAttributes(params, true);\n const context = { type: AttributeUpdateType.INIT };\n params =\n (this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(params, this.attribute, null, context)) || params;\n this.attribute = params;\n if (params.background) {\n this.loadImage(params.background, true);\n } else if (params.shadowGraphic) {\n this.setShadowGraphic(params.shadowGraphic);\n }\n this._updateTag = UpdateTag.INIT;\n this.valid = this.isValid();\n this.onAttributeUpdate(context);\n }\n\n translate(x: number, y: number) {\n if (x === 0 && y === 0) {\n return this;\n }\n const context = {\n type: AttributeUpdateType.TRANSLATE\n };\n const params =\n this.onBeforeAttributeUpdate &&\n this.onBeforeAttributeUpdate({ x, y }, this.attribute, tempConstantXYKey, context);\n if (params) {\n x = params.x;\n y = params.y;\n delete params.x;\n delete params.y;\n this._setAttributes(params);\n }\n const attribute = this.attribute;\n const postMatrix = attribute.postMatrix;\n if (!postMatrix) {\n attribute.x = (attribute.x ?? DefaultTransform.x) + x;\n attribute.y = (attribute.y ?? DefaultTransform.y) + y;\n } else {\n application.transformUtil.fromMatrix(postMatrix, postMatrix).translate(x, y);\n }\n\n this.addUpdatePositionTag();\n this.addUpdateBoundTag();\n this.addUpdateLayoutTag();\n this.onAttributeUpdate(context);\n return this;\n }\n\n translateTo(x: number, y: number) {\n const attribute = this.attribute;\n if (attribute.x === x && attribute.y === y) {\n return this;\n }\n const context = {\n type: AttributeUpdateType.TRANSLATE_TO\n };\n const params =\n this.onBeforeAttributeUpdate &&\n this.onBeforeAttributeUpdate({ x, y }, this.attribute, tempConstantXYKey, context);\n if (params) {\n this._setAttributes(params, false, context);\n return this;\n }\n attribute.x = x;\n attribute.y = y;\n this.addUpdatePositionTag();\n this.addUpdateBoundTag();\n this.addUpdateLayoutTag();\n this.onAttributeUpdate(context);\n return this;\n }\n\n scale(scaleX: number, scaleY: number, scaleCenter?: IPointLike) {\n if (scaleX === 1 && scaleY === 1) {\n return this;\n }\n const context = {\n type: AttributeUpdateType.SCALE\n };\n const params =\n this.onBeforeAttributeUpdate &&\n this.onBeforeAttributeUpdate({ scaleX, scaleY, scaleCenter }, this.attribute, tempConstantScaleXYKey, context);\n if (params) {\n scaleX = params.scaleX;\n scaleY = params.scaleY;\n delete params.scaleX;\n delete params.scaleY;\n this._setAttributes(params);\n }\n const attribute = this.attribute;\n if (!scaleCenter) {\n attribute.scaleX = (attribute.scaleX ?? DefaultTransform.scaleX) * scaleX;\n attribute.scaleY = (attribute.scaleY ?? DefaultTransform.scaleY) * scaleY;\n } else {\n let { postMatrix } = this.attribute;\n if (!postMatrix) {\n postMatrix = new Matrix();\n attribute.postMatrix = postMatrix;\n }\n application.transformUtil.fromMatrix(postMatrix, postMatrix).scale(scaleX, scaleY, scaleCenter);\n }\n this.addUpdatePositionTag();\n this.addUpdateBoundTag();\n this.addUpdateLayoutTag();\n this.onAttributeUpdate(context);\n return this;\n }\n\n scaleTo(scaleX: number, scaleY: number) {\n const attribute = this.attribute;\n if (attribute.scaleX === scaleX && attribute.scaleY === scaleY) {\n return this;\n }\n const context = {\n type: AttributeUpdateType.SCALE_TO\n };\n const params =\n this.onBeforeAttributeUpdate &&\n this.onBeforeAttributeUpdate({ scaleX, scaleY }, this.attribute, tempConstantScaleXYKey, context);\n if (params) {\n this._setAttributes(params, false, context);\n return this;\n }\n attribute.scaleX = scaleX;\n attribute.scaleY = scaleY;\n this.addUpdatePositionTag();\n this.addUpdateBoundTag();\n this.addUpdateLayoutTag();\n this.onAttributeUpdate(context);\n return this;\n }\n\n rotate(angle: number, rotateCenter?: IPointLike) {\n if (angle === 0) {\n return this;\n }\n const context = { type: AttributeUpdateType.ROTATE };\n const params =\n this.onBeforeAttributeUpdate &&\n this.onBeforeAttributeUpdate({ angle, rotateCenter }, this.attribute, tempConstantAngleKey, context);\n if (params) {\n delete params.angle;\n this._setAttributes(params, false, context);\n // return this;\n }\n const attribute = this.attribute;\n if (!rotateCenter) {\n attribute.angle = (attribute.angle ?? DefaultTransform.angle) + angle;\n } else {\n let { postMatrix } = this.attribute;\n if (!postMatrix) {\n postMatrix = new Matrix();\n attribute.postMatrix = postMatrix;\n }\n application.transformUtil.fromMatrix(postMatrix, postMatrix).rotate(angle, rotateCenter);\n }\n this.addUpdatePositionTag();\n this.addUpdateBoundTag();\n this.addUpdateLayoutTag();\n this.onAttributeUpdate(context);\n return this;\n }\n\n rotateTo(angle: number) {\n const attribute = this.attribute;\n if (attribute.angle === angle) {\n return this;\n }\n const context = {\n type: AttributeUpdateType.ROTATE_TO\n };\n const params =\n this.onBeforeAttributeUpdate &&\n this.onBeforeAttributeUpdate(angle, this.attribute, tempConstantAngleKey, context);\n if (params) {\n this._setAttributes(params, false, context);\n return this;\n }\n attribute.angle = angle;\n this.addUpdatePositionTag();\n this.addUpdateBoundTag();\n this.addUpdateLayoutTag();\n this.onAttributeUpdate(context);\n return this;\n }\n\n skewTo(b: number, c: number) {\n return this;\n }\n\n animate(params?: IGraphicAnimateParams) {\n if (!this.animates) {\n this.animates = new Map();\n }\n const animate = new Animate(params?.id, this.stage && this.stage.getTimeline(), params?.slience);\n\n animate.bind(this);\n if (params) {\n const { onStart, onFrame, onEnd, onRemove } = params;\n onStart != null && animate.onStart(onStart);\n onFrame != null && animate.onFrame(onFrame);\n onEnd != null && animate.onEnd(onEnd);\n onRemove != null && animate.onRemove(onRemove);\n animate.interpolateFunc = params.interpolate;\n }\n this.animates.set(animate.id, animate);\n animate.onRemove(() => {\n this.animates.delete(animate.id);\n });\n\n return animate;\n }\n\n onAttributeUpdate(context?: ISetAttributeContext) {\n if (context && context.skipUpdateCallback) {\n return;\n }\n application.graphicService.onAttributeUpdate(this);\n this._emitCustomEvent('afterAttributeUpdate', context);\n }\n\n // hasListener(event: string) {\n // const prefix = this.prefixed;\n // var evt = prefix ? prefix + event : event;\n // return this._events[evt];\n // }\n\n update(d?: { bounds: boolean; trans: boolean }) {\n if (d) {\n d.bounds && this.tryUpdateAABBBounds(this.attribute.boundsMode === 'imprecise');\n d.trans && this.tryUpdateLocalTransMatrix();\n } else {\n this.tryUpdateAABBBounds(this.attribute.boundsMode === 'imprecise');\n this.tryUpdateLocalTransMatrix();\n }\n }\n\n hasState(stateName?: string) {\n if (!this.currentStates || !this.currentStates.length) {\n return false;\n }\n\n if (!isNil(stateName)) {\n return this.currentStates.includes(stateName);\n }\n\n return true;\n }\n getState(stateName: string) {\n return this.states?.[stateName];\n }\n\n applyStateAttrs(attrs: Partial<T>, stateNames: string[], hasAnimation?: boolean, isClear?: boolean) {\n if (hasAnimation) {\n const keys = Object.keys(attrs);\n const noWorkAttrs = this.getNoWorkAnimateAttr();\n const animateAttrs: Partial<T> = {};\n let noAnimateAttrs: Partial<T> | undefined;\n\n keys.forEach(key => {\n if (!noWorkAttrs[key]) {\n (animateAttrs as any)[key] =\n isClear && (attrs as any)[key] === undefined ? this.getDefaultAttribute(key) : (attrs as any)[key];\n } else {\n if (!noAnimateAttrs) {\n noAnimateAttrs = {};\n }\n (noAnimateAttrs as any)[key] = (attrs as any)[key];\n }\n });\n\n const animate = this.animate({ slience: true });\n (animate as any).stateNames = stateNames;\n animate.to(\n animateAttrs,\n this.stateAnimateConfig?.duration ?? DefaultStateAnimateConfig.duration,\n this.stateAnimateConfig?.easing ?? DefaultStateAnimateConfig.easing\n );\n noAnimateAttrs && this.setAttributes(noAnimateAttrs, false, { type: AttributeUpdateType.STATE });\n } else {\n this.stopStateAnimates();\n this.setAttributes(attrs, false, { type: AttributeUpdateType.STATE });\n }\n }\n\n updateNormalAttrs(stateAttrs: Partial<T>) {\n const newNormalAttrs = {};\n if (this.normalAttrs) {\n Object.keys(stateAttrs).forEach(key => {\n if (key in this.normalAttrs) {\n (newNormalAttrs as any)[key] = (this.normalAttrs as any)[key];\n delete (this.normalAttrs as any)[key];\n } else {\n (newNormalAttrs as any)[key] = this.getNormalAttribute(key);\n }\n });\n Object.keys(this.normalAttrs).forEach(key => {\n (stateAttrs as any)[key] = (this.normalAttrs as any)[key];\n });\n } else {\n Object.keys(stateAttrs).forEach(key => {\n (newNormalAttrs as any)[key] = this.getNormalAttribute(key);\n });\n }\n\n this.normalAttrs = newNormalAttrs;\n }\n\n protected stopStateAnimates(type: 'start' | 'end' = 'end') {\n if (this.animates) {\n this.animates.forEach(animate => {\n if ((animate as any).stateNames) {\n animate.stop(type);\n this.animates.delete(animate.id);\n }\n });\n }\n }\n\n private getNormalAttribute(key: string) {\n let value = (this.attribute as any)[key];\n\n if (this.animates) {\n this.animates.forEach(animate => {\n if ((animate as any).stateNames) {\n const endProps = animate.getEndProps();\n if (has(endProps, key)) {\n value = endProps[key];\n }\n }\n });\n }\n\n return value;\n }\n\n clearStates(hasAnimation?: boolean) {\n if (this.hasState() && this.normalAttrs) {\n this.currentStates = [];\n this.applyStateAttrs(this.normalAttrs, this.currentStates, hasAnimation, true);\n } else {\n this.currentStates = [];\n }\n this.normalAttrs = null;\n }\n\n removeState(stateName: string, hasAnimation?: boolean) {\n const index = this.currentStates ? this.currentStates.indexOf(stateName) : -1;\n\n if (index >= 0) {\n const currentStates = this.currentStates.filter(state => state !== stateName);\n\n this.useStates(currentStates, hasAnimation);\n }\n }\n\n toggleState(stateName: string, hasAnimation?: boolean) {\n if (this.hasState(stateName)) {\n this.removeState(stateName, hasAnimation);\n } else {\n const index = this.currentStates ? this.currentStates.indexOf(stateName) : -1;\n if (index < 0) {\n const nextStates = this.currentStates ? this.currentStates.slice() : [];\n nextStates.push(stateName);\n this.useStates(nextStates, hasAnimation);\n }\n }\n }\n\n addState(stateName: string, keepCurrentStates?: boolean, hasAnimation?: boolean) {\n if (\n this.currentStates &&\n this.currentStates.includes(stateName) &&\n (keepCurrentStates || this.currentStates.length === 1)\n ) {\n return;\n }\n\n const newStates =\n keepCurrentStates && this.currentStates?.length ? this.currentStates.concat([stateName]) : [stateName];\n\n this.useStates(newStates, hasAnimation);\n }\n\n useStates(states: string[], hasAnimation?: boolean) {\n if (!states.length) {\n this.clearStates(hasAnimation);\n return;\n }\n\n const isChange =\n this.currentStates?.length !== states.length ||\n states.some((stateName, index) => this.currentStates[index] !== stateName);\n\n if (!isChange) {\n return;\n }\n\n const stateAttrs = {};\n states.forEach(stateName => {\n const attrs = this.stateProxy ? this.stateProxy(stateName, states) : this.states?.[stateName];\n\n if (attrs) {\n Object.assign(stateAttrs, attrs);\n }\n });\n\n this.updateNormalAttrs(stateAttrs);\n\n this.currentStates = states;\n this.applyStateAttrs(stateAttrs, states, hasAnimation);\n }\n\n addUpdateBoundTag() {\n this._updateTag |= UpdateTag.UPDATE_BOUNDS; // for bounds\n if (this.parent) {\n this.parent.addChildUpdateBoundTag();\n }\n if (this.glyphHost) {\n this.glyphHost.addUpdateBoundTag();\n }\n }\n\n addUpdateShapeTag() {\n this._updateTag |= UpdateTag.UPDATE_SHAPE; // for shape\n }\n\n addUpdateShapeAndBoundsTag() {\n this._updateTag |= UpdateTag.UPDATE_SHAPE_AND_BOUNDS; // for shape&bounds\n if (this.parent) {\n this.parent.addChildUpdateBoundTag();\n }\n if (this.glyphHost) {\n this.glyphHost.addUpdateBoundTag();\n }\n }\n\n protected updateShapeAndBoundsTagSetted(): boolean {\n return (this._updateTag & UpdateTag.UPDATE_SHAPE_AND_BOUNDS) === UpdateTag.UPDATE_SHAPE_AND_BOUNDS;\n }\n\n protected clearUpdateBoundTag() {\n this._updateTag &= UpdateTag.CLEAR_BOUNDS;\n }\n /**\n * 更新位置tag,包括全局tag和局部tag\n */\n addUpdatePositionTag() {\n // 更新shadowRoot的全局位置\n this.shadowRoot && this.shadowRoot.addUpdateGlobalPositionTag();\n this._updateTag |= UpdateTag.UPDATE_GLOBAL_LOCAL_MATRIX;\n }\n /**\n * 更新全局位置tag\n */\n addUpdateGlobalPositionTag() {\n // 更新shadowRoot的全局位置\n this.shadowRoot && this.shadowRoot.addUpdateGlobalPositionTag();\n this._updateTag |= UpdateTag.UPDATE_GLOBAL_MATRIX;\n }\n /**\n * 清除局部位置tag\n */\n protected clearUpdateLocalPositionTag() {\n this._updateTag &= UpdateTag.CLEAR_LOCAL_MATRIX;\n }\n /**\n * 清除全局位置tag\n */\n protected clearUpdateGlobalPositionTag() {\n this._updateTag &= UpdateTag.CLEAR_GLOBAL_MATRIX;\n }\n\n addUpdateLayoutTag() {\n this._updateTag |= UpdateTag.UPDATE_LAYOUT;\n }\n\n protected clearUpdateLayoutTag() {\n this._updateTag &= UpdateTag.CLEAR_LAYOUT;\n }\n\n protected needUpdateLayout(): boolean {\n return !!(this._updateTag & UpdateTag.UPDATE_LAYOUT);\n }\n\n protected getAnchor(anchor: [string | number, string | number], params: { b?: IAABBBounds }) {\n const _anchor: [number, number] = [0, 0];\n const getBounds = () => {\n if (params.b) {\n return params.b;\n }\n const { scaleX, scaleY, angle } = this.attribute;\n // 拷贝一份,避免计算bounds的过程中计算matrix,然后matrix又修改了bounds\n tempBounds.copy(this._AABBBounds);\n // @ts-ignore\n this.setAttributes({ scaleX: 1, scaleY: 1, angle: 0 });\n params.b = this.AABBBounds.clone();\n this._AABBBounds.copy(tempBounds);\n // @ts-ignore\n this.setAttributes({ scaleX, scaleY, angle });\n return params.b;\n };\n if (typeof anchor[0] === 'string') {\n const ratio = parseFloat(anchor[0]) / 100;\n const bounds = getBounds();\n _anchor[0] = bounds.x1 + (bounds.x2 - bounds.x1) * ratio;\n } else {\n _anchor[0] = anchor[0];\n }\n if (typeof anchor[1] === 'string') {\n const ratio = parseFloat(anchor[1]) / 100;\n const bounds = getBounds();\n _anchor[1] = bounds.y1 + (bounds.y2 - bounds.y1) * ratio;\n } else {\n _anchor[1] = anchor[1];\n }\n\n return _anchor;\n }\n\n /**\n * 更新局部matrix的具体函数\n */\n protected doUpdateLocalMatrix() {\n const {\n x = DefaultTransform.x,\n y = DefaultTransform.y,\n scaleX = DefaultTransform.scaleX,\n scaleY = DefaultTransform.scaleY,\n angle = DefaultTransform.angle,\n scaleCenter,\n anchor,\n postMatrix\n } = this.attribute;\n let _anchor: [number, number] = [0, 0];\n const params = {};\n if (anchor) {\n _anchor = this.getAnchor(anchor, params);\n }\n if (scaleCenter && (scaleX !== 1 || scaleY !== 1)) {\n const m = this._transMatrix;\n m.reset();\n m.translate(_anchor[0], _anchor[1]);\n m.rotate(angle);\n m.translate(-_anchor[0], -_anchor[1]);\n\n m.translate(x, y);\n // m.translate(scaleCenter[0] * scaleX, scaleCenter[1] * scaleY);\n // 计算bounds\n _anchor = this.getAnchor(scaleCenter, params);\n application.transformUtil.fromMatrix(m, m).scale(scaleX, scaleY, { x: _anchor[0], y: _anchor[1] });\n // m.translate(-scaleCenter[0], -scaleCenter[1]);\n } else {\n normalTransform(this._transMatrix, this._transMatrix.reset(), x, y, scaleX, scaleY, angle, anchor && _anchor);\n }\n const p = this.getOffsetXY(DefaultTransform);\n this._transMatrix.e += p.x;\n this._transMatrix.f += p.y;\n\n if (postMatrix) {\n const m1 = tempMatrix.setValue(\n postMatrix.a,\n postMatrix.b,\n postMatrix.c,\n postMatrix.d,\n postMatrix.e,\n postMatrix.f\n );\n const m2 = this._transMatrix;\n m1.multiply(m2.a, m2.b, m2.c, m2.d, m2.e, m2.f);\n m2.setValue(m1.a, m1.b, m1.c, m1.d, m1.e, m1.f);\n }\n }\n /**\n * 更新全局matrix的具体函数\n */\n protected doUpdateGlobalMatrix() {\n // 基于parent的matrix修改\n if (this.parent) {\n this._globalTransMatrix.multiply(\n this.transMatrix.a,\n this.transMatrix.b,\n this.transMatrix.c,\n this.transMatrix.d,\n this.transMatrix.e,\n this.transMatrix.f\n );\n const { scrollX = 0, scrollY = 0 } = this.parent.attribute;\n this._globalTransMatrix.translate(scrollX, scrollY);\n }\n }\n\n setStage(stage?: IStage, layer?: ILayer) {\n if (this.stage !== stage) {\n this.stage = stage;\n this.layer = layer;\n this.setStageToShadowRoot(stage, layer);\n if (this.animates && this.animates.size) {\n const timeline = stage.getTimeline();\n this.animates.forEach(a => {\n a.setTimeline(timeline);\n });\n }\n this._onSetStage && this._onSetStage(this, stage, layer);\n application.graphicService.onSetStage(this, stage);\n }\n }\n\n setStageToShadowRoot(stage?: IStage, layer?: ILayer) {\n if (this.shadowRoot) {\n this.shadowRoot.setStage(stage, layer);\n }\n }\n\n onAddStep(step: IStep) {\n return;\n }\n onStop(props?: Partial<T>): void {\n if (props) {\n this.setAttributes(props, false, { type: AttributeUpdateType.ANIMATE_END });\n }\n }\n // step时调用\n onStep(subAnimate: ISubAnimate, animate: IAnimate, step: IStep, ratio: number, end: boolean) {\n const nextAttributes = {};\n if (step.customAnimate) {\n step.customAnimate.update(end, ratio, nextAttributes);\n } else {\n const nextProps = step.props;\n const nextParsedProps = step.parsedProps;\n const propKeys = step.propKeys;\n this.stepInterpolate(\n subAnimate,\n animate,\n nextAttributes,\n step,\n ratio,\n end,\n nextProps,\n undefined,\n nextParsedProps,\n propKeys\n );\n }\n this.setAttributes(nextAttributes, false, {\n type: AttributeUpdateType.ANIMATE_UPDATE,\n animationState: {\n ratio,\n end,\n step,\n isFirstFrameOfStep: subAnimate.getLastStep() !== step\n }\n });\n this.stage && this.stage.renderNextFrame();\n }\n\n stepInterpolate(\n subAnimate: ISubAnimate,\n animate: IAnimate,\n nextAttributes: Record<string, any>,\n step: IStep,\n ratio: number,\n end: boolean,\n nextProps: Record<string, any>,\n lastProps?: Record<string, any>,\n nextParsedProps?: any,\n propKeys?: string[]\n ) {\n if (!propKeys) {\n propKeys = Object.keys(nextProps);\n step.propKeys = propKeys;\n }\n if (end) {\n step.propKeys.forEach(key => {\n if (!animate.validAttr(key)) {\n return;\n }\n nextAttributes[key] = nextProps[key];\n });\n } else {\n propKeys.forEach(key => {\n // 如果属性不合法,那直接return\n if (!animate.validAttr(key)) {\n return;\n }\n const nextStepVal = nextProps[key];\n const lastStepVal = (lastProps && lastProps[key]) ?? subAnimate.getLastPropByName(key, step);\n if (nextStepVal == null || lastStepVal == null || nextStepVal === lastStepVal) {\n // 用户直接调用stepInterpolate可能会走进来,如果传入的参数出现null或者undefined,直接赋值最终的值\n nextAttributes[key] = nextStepVal;\n return;\n }\n let match: boolean;\n match =\n animate.interpolateFunc && animate.interpolateFunc(key, ratio, lastStepVal, nextStepVal, nextAttributes);\n if (match) {\n return;\n }\n match = animate.customInterpolate(key, ratio, lastStepVal, nextStepVal, this, nextAttributes);\n if (match) {\n return;\n }\n if (!this.defaultInterpolate(nextStepVal, lastStepVal, key, nextAttributes, nextParsedProps, ratio)) {\n this._interpolate(key, ratio, lastStepVal, nextStepVal, nextAttributes);\n }\n });\n }\n\n step.parsedProps = nextParsedProps;\n }\n\n defaultInterpolate(\n nextStepVal: any,\n lastStepVal: any,\n key: string,\n nextAttributes: Record<string, any>,\n nextParsedProps: any,\n ratio: number\n ) {\n if (Number.isFinite(nextStepVal)) {\n nextAttributes[key] = lastStepVal + (nextStepVal - lastStepVal) * ratio;\n return true;\n } else if (key === 'fill') {\n if (!nextParsedProps) {\n nextParsedProps = {};\n }\n // 保存解析的结果到step\n const fillColorArray: [number, number, number, number] = nextParsedProps.fillColorArray;\n const color = interpolateColor(lastStepVal, fillColorArray ?? nextStepVal, ratio, false, (fArray, tArray) => {\n nextParsedProps.fillColorArray = tArray;\n });\n if (color) {\n nextAttributes[key] = color;\n }\n return true;\n } else if (key === 'stroke') {\n if (!nextParsedProps) {\n nextParsedProps = {};\n }\n // 保存解析的结果到step\n const strokeColorArray: [number, number, number, number] = nextParsedProps.strokeColorArray;\n const color = interpolateColor(lastStepVal, strokeColorArray ?? nextStepVal, ratio, false, (fArray, tArray) => {\n nextParsedProps.strokeColorArray = tArray;\n });\n if (color) {\n nextAttributes[key] = color;\n }\n return true;\n } else if (key === 'shadowColor') {\n if (!nextParsedProps) {\n nextParsedProps = {};\n }\n // 保存解析的结果到step\n const shadowColorArray: [number, number, number, number] = nextParsedProps.shadowColorArray;\n const color = interpolateColor(lastStepVal, shadowColorArray ?? nextStepVal, ratio, true, (fArray, tArray) => {\n nextParsedProps.shadowColorArray = tArray;\n });\n if (color) {\n nextAttributes[key] = color;\n }\n\n return true;\n }\n\n return false;\n }\n\n protected _interpolate(key: string, ratio: number, lastStepVal: any, nextStepVal: any, nextAttributes: any) {\n return;\n }\n\n getDefaultAttribute(name: string) {\n return (this.getGraphicTheme() as any)[name];\n }\n\n // 获取属性\n getComputedAttribute(name: string) {\n return (this.attribute as any)[name] ?? this.getDefaultAttribute(name);\n }\n /**\n * 添加onSetStage钩子\n * @param cb 回调函数\n * @param immediate 是否立刻执行,如果在回调添加之前stage就已经绑定,那么如果第二个参数为true就立刻执行回调\n */\n onSetStage(cb: (g: IGraphic, stage: IStage) => void, immediate: boolean = false) {\n this._onSetStage = cb;\n if (immediate && this.stage) {\n cb(this, this.stage);\n }\n }\n\n /******************** shadow graphic *********************/\n attachShadow(shadowRoot?: IShadowRoot) {\n if (shadowRoot) {\n shadowRoot.shadowHost = this;\n }\n\n this.shadowRoot = shadowRoot ?? application.graphicService.creator.shadowRoot(this);\n this.addUpdateBoundTag();\n this.shadowRoot.setStage(this.stage, this.layer);\n return this.shadowRoot;\n }\n\n detachShadow() {\n if (this.shadowRoot) {\n this.addUpdateBoundTag();\n this.shadowRoot = null;\n }\n }\n\n toJson(): IGraphicJson {\n return {\n attribute: this.attribute,\n _uid: this._uid,\n type: this.type,\n name: this.name,\n children: this.children.map((item: IGraphic) => item.toJson())\n };\n }\n\n createPathProxy(path?: string) {\n if (isString(path, true)) {\n this.pathProxy = new CustomPath2D().fromString(path as string);\n } else {\n this.pathProxy = new CustomPath2D();\n }\n\n return this.pathProxy;\n }\n\n loadImage(image: any, background: boolean = false) {\n if (!image || (background && backgroundNotImage(image))) {\n return;\n }\n const url = image;\n if (!this.resources) {\n this.resources = new Map();\n }\n const cache: {\n state: 'loading' | 'success' | 'init' | 'fail';\n data: any;\n } = {\n data: 'init',\n state: null\n };\n this.resources.set(url, cache);\n if (typeof image === 'string') {\n cache.state = 'loading';\n if (image.startsWith('<svg')) {\n // TODO 封装isSvg到@visactor/vutils\n ResourceLoader.GetSvg(image, this);\n this.backgroundImg = this.backgroundImg || background;\n } else if (isValidUrl(image) || image.includes('/') || isBase64(image)) {\n ResourceLoader.GetImage(image, this);\n this.backgroundImg = this.backgroundImg || background;\n }\n } else if (isObject(image)) {\n (cache.state = 'success'), (cache.data = image);\n this.backgroundImg = this.backgroundImg || background;\n } else {\n cache.state = 'fail';\n }\n }\n\n setShadowGraphic(graphic: IGraphic) {\n if (!graphic) {\n this.detachShadow();\n } else {\n const root = this.attachShadow();\n root.add(graphic);\n }\n }\n\n imageLoadSuccess(url: string, image: HTMLImageElement, cb?: () => void) {\n // 更新属性\n // this.resourceState = 'success';\n // this.resource = image;\n if (!this.resources) {\n return;\n }\n const res = this.resources.get(url);\n if (!res) {\n return;\n }\n res.state = 'success';\n res.data = image;\n\n cb && cb();\n\n // 触发重绘\n // 暂时全量,TODO 启动局部重绘\n // this.stage.enableDirtyBounds();\n // this.stage.dirty(this.AABBBounds);\n this.addUpdateBoundTag(); // 添加bounds更新tag重绘才会绘制这个mark\n this.stage && this.stage.renderNextFrame();\n }\n\n imageLoadFail(url: string, cb?: () => void) {\n if (!this.resources) {\n return;\n }\n const res = this.resources.get(url);\n if (!res) {\n return;\n }\n res.state = 'fail';\n\n cb && cb();\n }\n\n private _stopAnimates(animates: Map<string | number, IAnimate>) {\n if (animates) {\n animates.forEach(animate => {\n animate.stop();\n });\n }\n }\n\n stopAnimates(stopChildren: boolean = false) {\n this._stopAnimates(this.animates);\n\n if (this.shadowRoot) {\n // 停止所有影子节点的动画\n this.shadowRoot.stopAnimates(true);\n }\n if (this.isContainer && stopChildren) {\n this.forEachChildren((c: IGraphic) => {\n c.stopAnimates(stopChildren);\n });\n }\n }\n\n release(): void {\n this.releaseStatus = 'released';\n application.graphicService.onRelease(this);\n }\n\n protected _emitCustomEvent(type: string, context?: any) {\n if (this._events && type in this._events) {\n const changeEvent = new CustomEvent(type, context);\n changeEvent.bubbles = false;\n\n (changeEvent as any).manager = (this.stage as any)?.eventSystem?.manager;\n this.dispatchEvent(changeEvent);\n }\n }\n\n abstract getNoWorkAnimateAttr(): Record<string, number>;\n\n abstract clone(): IGraphic<any>;\n}\n\nGraphic.mixin(EventTarget);\n\nfunction backgroundNotImage(image: any) {\n if (image.fill || image.stroke) {\n return true;\n }\n return false;\n}\n"]}
@@ -188,6 +188,7 @@ export type ISetAttributeContext = {
188
188
  skipUpdateCallback?: boolean;
189
189
  };
190
190
  export type IGraphicAnimateParams = {
191
+ slience?: boolean;
191
192
  id?: number | string;
192
193
  onStart?: () => void;
193
194
  onFrame?: (step: IStep, ratio: number) => void;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/interface/graphic.ts"],"names":[],"mappings":"","file":"graphic.js","sourcesContent":["import type { IAABBBounds, IMatrix, IPointLike, IPoint, BoundsAnchorType } from '@visactor/vutils';\nimport type { IAnimate, IStep, EasingType, IAnimateTarget } from './animate';\nimport type { IColor } from './color';\nimport type { IGroup } from './graphic/group';\nimport type { IShadowRoot } from './graphic/shadow-root';\nimport type { ILayer } from './layer';\nimport type { INode } from './node-tree';\nimport type { ICustomPath2D } from './path';\nimport type { IStage } from './stage';\nimport type { IGlyphGraphicAttribute } from './graphic/glyph';\nimport type { IContainPointMode } from '../common/enums';\nimport type { IFace3d } from './graphic/face3d';\nimport type { IPickerService } from './picker';\n\ntype IStrokeSeg = {\n start: number; // 百分比\n // end和length二选一\n end: number; // 百分比\n length: number; // 像素长度\n};\n\n// TODO 最后加一个any\nexport type GraphicType =\n | 'area'\n | 'circle'\n | 'ellipse'\n | 'line'\n | 'rect'\n | 'rect3d'\n | 'path'\n | 'richtext'\n | 'text'\n | 'arc'\n | 'arc3d'\n | 'image'\n | 'symbol'\n | 'group'\n | 'shadowroot'\n | 'polygon'\n | 'pyramid3d'\n | 'glyph';\n\n// Cursor style\n// See: https://developer.mozilla.org/en-US/docs/Web/CSS/cursor\nexport type Cursor =\n | 'auto'\n | 'default'\n | 'none'\n | 'context-menu'\n | 'help'\n | 'pointer'\n | 'progress'\n | 'wait'\n | 'cell'\n | 'crosshair'\n | 'text'\n | 'vertical-text'\n | 'alias'\n | 'copy'\n | 'move'\n | 'no-drop'\n | 'not-allowed'\n | 'grab'\n | 'grabbing'\n | 'all-scroll'\n | 'col-resize'\n | 'row-resize'\n | 'n-resize'\n | 'e-resize'\n | 's-resize'\n | 'w-resize'\n | 'ne-resize'\n | 'nw-resize'\n | 'se-resize'\n | 'sw-resize'\n | 'ew-resize'\n | 'ns-resize'\n | 'nesw-resize'\n | 'nwse-resize'\n | 'zoom-in'\n | 'zoom-out';\n\nexport type ITransform = {\n x: number;\n y: number;\n z: number;\n dx: number;\n dy: number;\n dz: number;\n scrollX: number;\n scrollY: number;\n scaleX: number;\n scaleY: number;\n scaleZ: number;\n angle: number;\n alpha: number;\n beta: number;\n scaleCenter: [number | string, number | string];\n anchor: [number | string, number | string]; // 基于AABB的锚点位置,用于简单的定位某些path\n anchor3d: [number | string, number | string, number] | [number | string, number | string]; // 3d的锚点位置\n postMatrix: IMatrix;\n};\n\nexport type IFillType = boolean | string | IColor;\nexport type IFillStyle = {\n fillOpacity: number;\n shadowBlur: number;\n shadowColor: string;\n shadowOffsetX: number;\n shadowOffsetY: number;\n fill: IFillType;\n};\n\nexport type ILayout = {\n alignSelf: 'auto' | 'flex-start' | 'flex-end' | 'center';\n};\n\nexport type IBorderStyle = Omit<IStrokeStyle, 'outerBorder' | 'innerBorder'> & {\n distance: number | string;\n visible?: boolean;\n};\n\nexport type IStrokeType = boolean | string | IColor | null;\nexport type IStrokeStyle = {\n outerBorder: Partial<IBorderStyle>;\n innerBorder: Partial<IBorderStyle>;\n strokeOpacity: number;\n lineDash: number[];\n lineDashOffset: number;\n lineWidth: number;\n lineCap: CanvasLineCap;\n lineJoin: CanvasLineJoin;\n miterLimit: number;\n // 描边的boundsBuffer,用于控制bounds的buffer\n strokeBoundsBuffer: number;\n /**\n * stroke - true 全描边\n * stroke - false 不描边\n * stroke 为数值类型,适用于rect\\arc等图形,用于配置部分描边的场景,其中\n *\n * 0b00000 - 不描边\n * 0b000001 - top\n * 0b000010 - right\n * 0b000100 - bottom\n * 0b001000 - left\n * 相应的:\n * 0b000011 - top + right\n * 0b000111 - top + right + bottom\n * 0b001111 - 全描边\n *\n * stroke - boolean[],适用于rect\\arc等图形,用于配置部分描边的场景\n */\n stroke: IStrokeType[] | IStrokeType;\n};\n\ntype TextureType = 'circle' | 'diamond' | 'rect' | 'vertical-line' | 'horizontal-line' | 'bias-lr' | 'bias-rl' | 'grid';\n\nexport type IConnectedStyle = {\n // 连接,取零或者断开\n connectedType: 'connect' | 'zero' | 'none';\n connectedStyle: {\n stroke: IStrokeStyle['stroke'];\n strokeOpacity: IStrokeStyle['strokeOpacity'];\n lineDash: IStrokeStyle['lineDash'];\n lineDashOffset: IStrokeStyle['lineDashOffset'];\n lineCap: IStrokeStyle['lineCap'];\n lineJoin: IStrokeStyle['lineJoin'];\n lineWidth: IStrokeStyle['lineWidth'];\n fill: IFillStyle['fill'];\n fillOpacity: IFillStyle['fillOpacity'];\n };\n connectedX: number;\n connectedY: number;\n};\n\nexport type IBackgroundConfig = {\n stroke?: string | boolean;\n fill?: string | boolean;\n lineWidth?: number;\n cornerRadius?: number;\n expandX?: number;\n expandY?: number;\n};\n\ntype IBackgroundType = string | HTMLImageElement | HTMLCanvasElement | IBackgroundConfig;\n\nexport interface SimpleDomStyleOptions {\n width: number; // 容器的宽度\n height: number; // 容器的高度\n style?:\n | string\n | Record<string, any>\n | ((\n pos: { top: number; left: number; width: number; height: number },\n graphic: IGraphic,\n wrapContainer: HTMLElement\n ) => Record<string, any>); // 容器的样式\n}\n\nexport interface CommonDomOptions {\n id?: string;\n container: string | HTMLElement | null; // id或者dom\n visible?: boolean;\n pointerEvents?: boolean | string;\n anchorType?: 'position' | 'boundsLeftTop' | BoundsAnchorType;\n}\n\nexport type IGraphicStyle = ILayout &\n IFillStyle &\n IStrokeStyle &\n IPickStyle & {\n forceBoundsWidth: number | (() => number) | undefined;\n forceBoundsHeight: number | (() => number) | undefined;\n opacity: number;\n shadowGraphic?: IGraphic | undefined;\n backgroundMode: 'repeat' | 'repeat-x' | 'repeat-y' | 'no-repeat'; // 填充模式(与具体图元有关)\n backgroundFit: boolean; // 是否正好填充,只在repeat-x或者repeat-y以及no-repeat的时候生效\n backgroundCornerRadius: number | number[];\n backgroundOpacity: number;\n background:\n | IBackgroundType\n | {\n background: IBackgroundType;\n dx?: number;\n dy?: number;\n width?: number;\n height?: number;\n x?: number;\n y?: number;\n }\n | null; // 背景,可以与fill同时存在\n texture: TextureType | string; // 纹理\n textureColor: string; // 纹理颜色\n textureSize: number; // 纹理大小\n texturePadding: number; // 纹理间隙\n blur: number;\n cursor: Cursor | null; // 鼠标样式\n renderStyle?: 'default' | 'rough' | any;\n // HTML的dom或者string\n html:\n | ({\n dom: string | HTMLElement; // dom字符串或者dom\n } & SimpleDomStyleOptions &\n CommonDomOptions)\n | null;\n react:\n | ({\n element: any; // react场景节点\n } & SimpleDomStyleOptions &\n CommonDomOptions)\n | null;\n };\n\nexport type IPickStyle = {\n // 给stroke模式的pick额外加的buffer,用于外界控制stroke区域的pick范围\n pickStrokeBuffer: number;\n};\n\nexport type IDebugType = {\n _debug_bounds: boolean | ((c: any, g: any) => void);\n};\nexport type IGraphicAttribute = IDebugType &\n IGraphicStyle &\n ITransform & {\n /**\n * stroke百分比\n */\n strokeSeg: IStrokeSeg | null;\n // 包围盒的padding\n boundsPadding: number | number[];\n /**\n * 选择模式,精确模式,粗糙模式(包围盒模式),自定义模式\n */\n pickMode: 'accurate' | 'imprecise' | 'custom';\n boundsMode: 'accurate' | 'imprecise';\n customPickShape: () => boolean | null;\n /**\n * 是否支持事件拾取,默认为 true。\n * @default true\n */\n pickable: boolean;\n /**\n * 是否支持fill拾取,默认为 true。\n * @experimental\n * @default true\n */\n fillPickable: boolean;\n /**\n * 是否支持stroke拾取,默认为 true。\n * @experimental\n * @default true\n */\n strokePickable: boolean;\n /**\n * 对于 group 节点,是否支持其子元素的事件拾取,默认为 true。\n * 如果 group `pickable` 关闭,`childrenPickable` 开启,那么 group 的子节点仍参与事件拾取\n * @default true\n */\n childrenPickable: boolean;\n /**\n * 元素是否可见。\n * @default true\n */\n visible: boolean;\n zIndex: number;\n layout: any;\n /**\n * 是否隐藏元素(只是绘制的时候不绘制)\n */\n renderable: boolean;\n /**\n * 是否在3d中控制方向\n * false: 不控制方向\n * true: 始终控制方向朝摄像机\n */\n keepDirIn3d?: boolean;\n shadowRootIdx: number;\n shadowPickMode?: 'full' | 'graphic';\n globalZIndex: number;\n globalCompositeOperation: CanvasRenderingContext2D['globalCompositeOperation'] | '';\n // 完全支持滚动 | 完全不支持滚动 | 支持x方向的滚动 | 支持y方向的滚动\n overflow: 'scroll' | 'hidden' | 'scroll-x' | 'scroll-y';\n };\n\nexport interface IGraphicJson<T extends Partial<IGraphicAttribute> = Partial<IGraphicAttribute>> {\n attribute: Partial<T>;\n _uid: number;\n type: string;\n name: string;\n children: IGraphicJson<T>[];\n}\n\n/** the context of setAttribute */\nexport type ISetAttributeContext = {\n /** type of setAttribute */\n type?: number;\n animationState?: {\n step?: IStep;\n isFirstFrameOfStep?: boolean;\n /** ratio of animation */\n ratio?: number;\n /** is animation end? */\n end?: boolean;\n };\n skipUpdateCallback?: boolean;\n};\n\nexport type IGraphicAnimateParams = {\n id?: number | string;\n onStart?: () => void;\n onFrame?: (step: IStep, ratio: number) => void;\n onEnd?: () => void;\n onRemove?: () => void;\n interpolate?: (key: string, ratio: number, from: any, to: any, nextAttributes: any) => boolean;\n};\n\nexport interface IGraphic<T extends Partial<IGraphicAttribute> = Partial<IGraphicAttribute>>\n extends INode,\n IAnimateTarget {\n type?: GraphicType;\n numberType?: number;\n stage?: IStage;\n layer?: ILayer;\n shadowRoot?: IShadowRoot;\n glyphHost?: IGraphic<IGlyphGraphicAttribute>;\n backgroundImg?: boolean;\n attachedThemeGraphic?: IGraphic<any>;\n\n bindDom?: Map<\n string | HTMLElement,\n { container: HTMLElement | string; dom: HTMLElement | any; wrapGroup: HTMLDivElement | any; root?: any }\n >;\n\n valid: boolean;\n parent: IGroup | null;\n isContainer?: boolean;\n // 是否是3d模式(是否应用3d视角)\n in3dMode?: boolean;\n\n // 上次更新的stamp\n stamp?: number;\n animationBackUps?: {\n from: Record<string, any>;\n to: Record<string, any>;\n };\n\n attribute: Partial<T>;\n\n /** 用于实现morph动画场景,转换成bezier曲线渲染 */\n pathProxy?: ICustomPath2D | ((attrs: T) => ICustomPath2D);\n incremental?: number;\n incrementalAt?: number;\n\n /** 记录state对应的图形属性 */\n states?: Record<string, Partial<T>>;\n normalAttrs?: Partial<T>;\n stateProxy?: (stateName: string, targetStates?: string[]) => Partial<T>;\n findFace?: () => IFace3d;\n toggleState: (stateName: string, hasAnimation?: boolean) => void;\n removeState: (stateName: string, hasAnimation?: boolean) => void;\n clearStates: (hasAnimation?: boolean) => void;\n useStates: (states: string[], hasAnimation?: boolean) => void;\n addState: (stateName: string, keepCurrentStates?: boolean, hasAnimation?: boolean) => void;\n hasState: (stateName?: string) => boolean;\n getState: (stateName: string) => Partial<T>;\n onBeforeAttributeUpdate?: (\n val: any,\n attributes: Partial<T>,\n key: null | string | string[],\n context?: ISetAttributeContext\n ) => T | undefined;\n applyStateAttrs: (attrs: Partial<T>, stateNames: string[], hasAnimation?: boolean, isClear?: boolean) => void;\n updateNormalAttrs: (stateAttrs: Partial<T>) => void;\n\n // get\n readonly AABBBounds: IAABBBounds; // 用于获取当前节点的AABB包围盒\n // readonly OBBBounds: IOBBBounds; // 获取OBB包围盒,旋转防重叠需要用\n readonly globalAABBBounds: IAABBBounds; // 全局AABB包围盒\n readonly transMatrix: IMatrix; // 变换矩阵,动态计算\n readonly globalTransMatrix: IMatrix; // 变换矩阵,动态计算\n\n getOffsetXY: (attr?: ITransform) => IPoint;\n\n // function\n containsPoint: (x: number, y: number, mode?: IContainPointMode, picker?: IPickerService) => boolean;\n\n setMode: (mode: '3d' | '2d') => void;\n isValid: () => boolean;\n\n // TODO: transform API\n // 基于当前transform的变换,普通用户尽量别用,拿捏不住的~\n translate: (x: number, y: number) => this;\n translateTo: (x: number, y: number) => this;\n scale: (scaleX: number, scaleY: number, scaleCenter?: IPointLike) => this;\n scaleTo: (scaleX: number, scaleY: number) => this;\n rotate: (angle: number, rotateCenter?: IPointLike) => this;\n rotateTo: (angle: number) => this;\n skewTo: (b: number, c: number) => this;\n addUpdateBoundTag: () => void;\n addUpdateShapeAndBoundsTag: () => void;\n addUpdateLayoutTag: () => void;\n\n update: (d?: { bounds: boolean; trans: boolean }) => void;\n\n // animate\n animate: (params?: IGraphicAnimateParams) => IAnimate;\n\n // 语法糖,可有可无,有的为了首屏性能考虑做成get方法,有的由外界直接托管,内部不赋值\n name?: string;\n\n // 供render处理shape缓存tag\n shouldUpdateShape: () => boolean;\n clearUpdateShapeTag: () => void;\n\n // // 供render缓存shape\n // cacheShape?: ICustomPath2D;\n // // 线段使用的path2D\n // cacheLine?: ISegPath2D | ISegPath2D[];\n // // 面积图使用的path2D\n // cacheArea?: IAreaCacheItem | IAreaCacheItem[];\n\n setAttributes: (params: Partial<T>, forceUpdateTag?: boolean, context?: ISetAttributeContext) => void;\n\n initAttributes: (params: Partial<T>) => void;\n\n setAttribute: (key: string, value: any, forceUpdateTag?: boolean, context?: ISetAttributeContext) => void;\n\n setStage: (stage?: IStage, layer?: ILayer) => void;\n onSetStage: (cb: (g: IGraphic, stage: IStage) => void) => void;\n\n shouldUpdateAABBBounds: () => boolean;\n shouldSelfChangeUpdateAABBBounds: () => boolean;\n shouldUpdateGlobalMatrix: () => boolean;\n\n addUpdatePositionTag: () => void;\n addUpdateGlobalPositionTag: () => void;\n\n attachShadow: () => IShadowRoot;\n detachShadow: () => void;\n\n toJson: () => IGraphicJson;\n\n /** 创建pathProxy */\n createPathProxy: (path?: string) => void;\n /** 将图形转换成CustomPath2D */\n toCustomPath?: () => ICustomPath2D;\n\n resources?: Map<\n string | HTMLImageElement | HTMLCanvasElement | IBackgroundConfig,\n { state: 'init' | 'loading' | 'success' | 'fail'; data?: HTMLImageElement | HTMLCanvasElement }\n >;\n imageLoadSuccess: (url: string, data: HTMLImageElement) => void;\n imageLoadFail: (url: string) => void;\n\n clone: () => IGraphic;\n stopAnimates: (stopChildren?: boolean) => void;\n getNoWorkAnimateAttr: () => Record<string, number>;\n getGraphicTheme: () => T;\n}\n\nexport interface IRoot extends IGraphic {\n pick: (x: number, y: number) => IGraphic;\n}\n\n/**\n * 动画配置\n */\nexport type IAnimateConfig = {\n duration?: number;\n easing?: EasingType;\n};\n\nexport type GraphicReleaseStatus = 'released' | 'willRelease';\n"]}
1
+ {"version":3,"sources":["../src/interface/graphic.ts"],"names":[],"mappings":"","file":"graphic.js","sourcesContent":["import type { IAABBBounds, IMatrix, IPointLike, IPoint, BoundsAnchorType } from '@visactor/vutils';\nimport type { IAnimate, IStep, EasingType, IAnimateTarget } from './animate';\nimport type { IColor } from './color';\nimport type { IGroup } from './graphic/group';\nimport type { IShadowRoot } from './graphic/shadow-root';\nimport type { ILayer } from './layer';\nimport type { INode } from './node-tree';\nimport type { ICustomPath2D } from './path';\nimport type { IStage } from './stage';\nimport type { IGlyphGraphicAttribute } from './graphic/glyph';\nimport type { IContainPointMode } from '../common/enums';\nimport type { IFace3d } from './graphic/face3d';\nimport type { IPickerService } from './picker';\n\ntype IStrokeSeg = {\n start: number; // 百分比\n // end和length二选一\n end: number; // 百分比\n length: number; // 像素长度\n};\n\n// TODO 最后加一个any\nexport type GraphicType =\n | 'area'\n | 'circle'\n | 'ellipse'\n | 'line'\n | 'rect'\n | 'rect3d'\n | 'path'\n | 'richtext'\n | 'text'\n | 'arc'\n | 'arc3d'\n | 'image'\n | 'symbol'\n | 'group'\n | 'shadowroot'\n | 'polygon'\n | 'pyramid3d'\n | 'glyph';\n\n// Cursor style\n// See: https://developer.mozilla.org/en-US/docs/Web/CSS/cursor\nexport type Cursor =\n | 'auto'\n | 'default'\n | 'none'\n | 'context-menu'\n | 'help'\n | 'pointer'\n | 'progress'\n | 'wait'\n | 'cell'\n | 'crosshair'\n | 'text'\n | 'vertical-text'\n | 'alias'\n | 'copy'\n | 'move'\n | 'no-drop'\n | 'not-allowed'\n | 'grab'\n | 'grabbing'\n | 'all-scroll'\n | 'col-resize'\n | 'row-resize'\n | 'n-resize'\n | 'e-resize'\n | 's-resize'\n | 'w-resize'\n | 'ne-resize'\n | 'nw-resize'\n | 'se-resize'\n | 'sw-resize'\n | 'ew-resize'\n | 'ns-resize'\n | 'nesw-resize'\n | 'nwse-resize'\n | 'zoom-in'\n | 'zoom-out';\n\nexport type ITransform = {\n x: number;\n y: number;\n z: number;\n dx: number;\n dy: number;\n dz: number;\n scrollX: number;\n scrollY: number;\n scaleX: number;\n scaleY: number;\n scaleZ: number;\n angle: number;\n alpha: number;\n beta: number;\n scaleCenter: [number | string, number | string];\n anchor: [number | string, number | string]; // 基于AABB的锚点位置,用于简单的定位某些path\n anchor3d: [number | string, number | string, number] | [number | string, number | string]; // 3d的锚点位置\n postMatrix: IMatrix;\n};\n\nexport type IFillType = boolean | string | IColor;\nexport type IFillStyle = {\n fillOpacity: number;\n shadowBlur: number;\n shadowColor: string;\n shadowOffsetX: number;\n shadowOffsetY: number;\n fill: IFillType;\n};\n\nexport type ILayout = {\n alignSelf: 'auto' | 'flex-start' | 'flex-end' | 'center';\n};\n\nexport type IBorderStyle = Omit<IStrokeStyle, 'outerBorder' | 'innerBorder'> & {\n distance: number | string;\n visible?: boolean;\n};\n\nexport type IStrokeType = boolean | string | IColor | null;\nexport type IStrokeStyle = {\n outerBorder: Partial<IBorderStyle>;\n innerBorder: Partial<IBorderStyle>;\n strokeOpacity: number;\n lineDash: number[];\n lineDashOffset: number;\n lineWidth: number;\n lineCap: CanvasLineCap;\n lineJoin: CanvasLineJoin;\n miterLimit: number;\n // 描边的boundsBuffer,用于控制bounds的buffer\n strokeBoundsBuffer: number;\n /**\n * stroke - true 全描边\n * stroke - false 不描边\n * stroke 为数值类型,适用于rect\\arc等图形,用于配置部分描边的场景,其中\n *\n * 0b00000 - 不描边\n * 0b000001 - top\n * 0b000010 - right\n * 0b000100 - bottom\n * 0b001000 - left\n * 相应的:\n * 0b000011 - top + right\n * 0b000111 - top + right + bottom\n * 0b001111 - 全描边\n *\n * stroke - boolean[],适用于rect\\arc等图形,用于配置部分描边的场景\n */\n stroke: IStrokeType[] | IStrokeType;\n};\n\ntype TextureType = 'circle' | 'diamond' | 'rect' | 'vertical-line' | 'horizontal-line' | 'bias-lr' | 'bias-rl' | 'grid';\n\nexport type IConnectedStyle = {\n // 连接,取零或者断开\n connectedType: 'connect' | 'zero' | 'none';\n connectedStyle: {\n stroke: IStrokeStyle['stroke'];\n strokeOpacity: IStrokeStyle['strokeOpacity'];\n lineDash: IStrokeStyle['lineDash'];\n lineDashOffset: IStrokeStyle['lineDashOffset'];\n lineCap: IStrokeStyle['lineCap'];\n lineJoin: IStrokeStyle['lineJoin'];\n lineWidth: IStrokeStyle['lineWidth'];\n fill: IFillStyle['fill'];\n fillOpacity: IFillStyle['fillOpacity'];\n };\n connectedX: number;\n connectedY: number;\n};\n\nexport type IBackgroundConfig = {\n stroke?: string | boolean;\n fill?: string | boolean;\n lineWidth?: number;\n cornerRadius?: number;\n expandX?: number;\n expandY?: number;\n};\n\ntype IBackgroundType = string | HTMLImageElement | HTMLCanvasElement | IBackgroundConfig;\n\nexport interface SimpleDomStyleOptions {\n width: number; // 容器的宽度\n height: number; // 容器的高度\n style?:\n | string\n | Record<string, any>\n | ((\n pos: { top: number; left: number; width: number; height: number },\n graphic: IGraphic,\n wrapContainer: HTMLElement\n ) => Record<string, any>); // 容器的样式\n}\n\nexport interface CommonDomOptions {\n id?: string;\n container: string | HTMLElement | null; // id或者dom\n visible?: boolean;\n pointerEvents?: boolean | string;\n anchorType?: 'position' | 'boundsLeftTop' | BoundsAnchorType;\n}\n\nexport type IGraphicStyle = ILayout &\n IFillStyle &\n IStrokeStyle &\n IPickStyle & {\n forceBoundsWidth: number | (() => number) | undefined;\n forceBoundsHeight: number | (() => number) | undefined;\n opacity: number;\n shadowGraphic?: IGraphic | undefined;\n backgroundMode: 'repeat' | 'repeat-x' | 'repeat-y' | 'no-repeat'; // 填充模式(与具体图元有关)\n backgroundFit: boolean; // 是否正好填充,只在repeat-x或者repeat-y以及no-repeat的时候生效\n backgroundCornerRadius: number | number[];\n backgroundOpacity: number;\n background:\n | IBackgroundType\n | {\n background: IBackgroundType;\n dx?: number;\n dy?: number;\n width?: number;\n height?: number;\n x?: number;\n y?: number;\n }\n | null; // 背景,可以与fill同时存在\n texture: TextureType | string; // 纹理\n textureColor: string; // 纹理颜色\n textureSize: number; // 纹理大小\n texturePadding: number; // 纹理间隙\n blur: number;\n cursor: Cursor | null; // 鼠标样式\n renderStyle?: 'default' | 'rough' | any;\n // HTML的dom或者string\n html:\n | ({\n dom: string | HTMLElement; // dom字符串或者dom\n } & SimpleDomStyleOptions &\n CommonDomOptions)\n | null;\n react:\n | ({\n element: any; // react场景节点\n } & SimpleDomStyleOptions &\n CommonDomOptions)\n | null;\n };\n\nexport type IPickStyle = {\n // 给stroke模式的pick额外加的buffer,用于外界控制stroke区域的pick范围\n pickStrokeBuffer: number;\n};\n\nexport type IDebugType = {\n _debug_bounds: boolean | ((c: any, g: any) => void);\n};\nexport type IGraphicAttribute = IDebugType &\n IGraphicStyle &\n ITransform & {\n /**\n * stroke百分比\n */\n strokeSeg: IStrokeSeg | null;\n // 包围盒的padding\n boundsPadding: number | number[];\n /**\n * 选择模式,精确模式,粗糙模式(包围盒模式),自定义模式\n */\n pickMode: 'accurate' | 'imprecise' | 'custom';\n boundsMode: 'accurate' | 'imprecise';\n customPickShape: () => boolean | null;\n /**\n * 是否支持事件拾取,默认为 true。\n * @default true\n */\n pickable: boolean;\n /**\n * 是否支持fill拾取,默认为 true。\n * @experimental\n * @default true\n */\n fillPickable: boolean;\n /**\n * 是否支持stroke拾取,默认为 true。\n * @experimental\n * @default true\n */\n strokePickable: boolean;\n /**\n * 对于 group 节点,是否支持其子元素的事件拾取,默认为 true。\n * 如果 group `pickable` 关闭,`childrenPickable` 开启,那么 group 的子节点仍参与事件拾取\n * @default true\n */\n childrenPickable: boolean;\n /**\n * 元素是否可见。\n * @default true\n */\n visible: boolean;\n zIndex: number;\n layout: any;\n /**\n * 是否隐藏元素(只是绘制的时候不绘制)\n */\n renderable: boolean;\n /**\n * 是否在3d中控制方向\n * false: 不控制方向\n * true: 始终控制方向朝摄像机\n */\n keepDirIn3d?: boolean;\n shadowRootIdx: number;\n shadowPickMode?: 'full' | 'graphic';\n globalZIndex: number;\n globalCompositeOperation: CanvasRenderingContext2D['globalCompositeOperation'] | '';\n // 完全支持滚动 | 完全不支持滚动 | 支持x方向的滚动 | 支持y方向的滚动\n overflow: 'scroll' | 'hidden' | 'scroll-x' | 'scroll-y';\n };\n\nexport interface IGraphicJson<T extends Partial<IGraphicAttribute> = Partial<IGraphicAttribute>> {\n attribute: Partial<T>;\n _uid: number;\n type: string;\n name: string;\n children: IGraphicJson<T>[];\n}\n\n/** the context of setAttribute */\nexport type ISetAttributeContext = {\n /** type of setAttribute */\n type?: number;\n animationState?: {\n step?: IStep;\n isFirstFrameOfStep?: boolean;\n /** ratio of animation */\n ratio?: number;\n /** is animation end? */\n end?: boolean;\n };\n skipUpdateCallback?: boolean;\n};\n\nexport type IGraphicAnimateParams = {\n slience?: boolean;\n id?: number | string;\n onStart?: () => void;\n onFrame?: (step: IStep, ratio: number) => void;\n onEnd?: () => void;\n onRemove?: () => void;\n interpolate?: (key: string, ratio: number, from: any, to: any, nextAttributes: any) => boolean;\n};\n\nexport interface IGraphic<T extends Partial<IGraphicAttribute> = Partial<IGraphicAttribute>>\n extends INode,\n IAnimateTarget {\n type?: GraphicType;\n numberType?: number;\n stage?: IStage;\n layer?: ILayer;\n shadowRoot?: IShadowRoot;\n glyphHost?: IGraphic<IGlyphGraphicAttribute>;\n backgroundImg?: boolean;\n attachedThemeGraphic?: IGraphic<any>;\n\n bindDom?: Map<\n string | HTMLElement,\n { container: HTMLElement | string; dom: HTMLElement | any; wrapGroup: HTMLDivElement | any; root?: any }\n >;\n\n valid: boolean;\n parent: IGroup | null;\n isContainer?: boolean;\n // 是否是3d模式(是否应用3d视角)\n in3dMode?: boolean;\n\n // 上次更新的stamp\n stamp?: number;\n animationBackUps?: {\n from: Record<string, any>;\n to: Record<string, any>;\n };\n\n attribute: Partial<T>;\n\n /** 用于实现morph动画场景,转换成bezier曲线渲染 */\n pathProxy?: ICustomPath2D | ((attrs: T) => ICustomPath2D);\n incremental?: number;\n incrementalAt?: number;\n\n /** 记录state对应的图形属性 */\n states?: Record<string, Partial<T>>;\n normalAttrs?: Partial<T>;\n stateProxy?: (stateName: string, targetStates?: string[]) => Partial<T>;\n findFace?: () => IFace3d;\n toggleState: (stateName: string, hasAnimation?: boolean) => void;\n removeState: (stateName: string, hasAnimation?: boolean) => void;\n clearStates: (hasAnimation?: boolean) => void;\n useStates: (states: string[], hasAnimation?: boolean) => void;\n addState: (stateName: string, keepCurrentStates?: boolean, hasAnimation?: boolean) => void;\n hasState: (stateName?: string) => boolean;\n getState: (stateName: string) => Partial<T>;\n onBeforeAttributeUpdate?: (\n val: any,\n attributes: Partial<T>,\n key: null | string | string[],\n context?: ISetAttributeContext\n ) => T | undefined;\n applyStateAttrs: (attrs: Partial<T>, stateNames: string[], hasAnimation?: boolean, isClear?: boolean) => void;\n updateNormalAttrs: (stateAttrs: Partial<T>) => void;\n\n // get\n readonly AABBBounds: IAABBBounds; // 用于获取当前节点的AABB包围盒\n // readonly OBBBounds: IOBBBounds; // 获取OBB包围盒,旋转防重叠需要用\n readonly globalAABBBounds: IAABBBounds; // 全局AABB包围盒\n readonly transMatrix: IMatrix; // 变换矩阵,动态计算\n readonly globalTransMatrix: IMatrix; // 变换矩阵,动态计算\n\n getOffsetXY: (attr?: ITransform) => IPoint;\n\n // function\n containsPoint: (x: number, y: number, mode?: IContainPointMode, picker?: IPickerService) => boolean;\n\n setMode: (mode: '3d' | '2d') => void;\n isValid: () => boolean;\n\n // TODO: transform API\n // 基于当前transform的变换,普通用户尽量别用,拿捏不住的~\n translate: (x: number, y: number) => this;\n translateTo: (x: number, y: number) => this;\n scale: (scaleX: number, scaleY: number, scaleCenter?: IPointLike) => this;\n scaleTo: (scaleX: number, scaleY: number) => this;\n rotate: (angle: number, rotateCenter?: IPointLike) => this;\n rotateTo: (angle: number) => this;\n skewTo: (b: number, c: number) => this;\n addUpdateBoundTag: () => void;\n addUpdateShapeAndBoundsTag: () => void;\n addUpdateLayoutTag: () => void;\n\n update: (d?: { bounds: boolean; trans: boolean }) => void;\n\n // animate\n animate: (params?: IGraphicAnimateParams) => IAnimate;\n\n // 语法糖,可有可无,有的为了首屏性能考虑做成get方法,有的由外界直接托管,内部不赋值\n name?: string;\n\n // 供render处理shape缓存tag\n shouldUpdateShape: () => boolean;\n clearUpdateShapeTag: () => void;\n\n // // 供render缓存shape\n // cacheShape?: ICustomPath2D;\n // // 线段使用的path2D\n // cacheLine?: ISegPath2D | ISegPath2D[];\n // // 面积图使用的path2D\n // cacheArea?: IAreaCacheItem | IAreaCacheItem[];\n\n setAttributes: (params: Partial<T>, forceUpdateTag?: boolean, context?: ISetAttributeContext) => void;\n\n initAttributes: (params: Partial<T>) => void;\n\n setAttribute: (key: string, value: any, forceUpdateTag?: boolean, context?: ISetAttributeContext) => void;\n\n setStage: (stage?: IStage, layer?: ILayer) => void;\n onSetStage: (cb: (g: IGraphic, stage: IStage) => void) => void;\n\n shouldUpdateAABBBounds: () => boolean;\n shouldSelfChangeUpdateAABBBounds: () => boolean;\n shouldUpdateGlobalMatrix: () => boolean;\n\n addUpdatePositionTag: () => void;\n addUpdateGlobalPositionTag: () => void;\n\n attachShadow: () => IShadowRoot;\n detachShadow: () => void;\n\n toJson: () => IGraphicJson;\n\n /** 创建pathProxy */\n createPathProxy: (path?: string) => void;\n /** 将图形转换成CustomPath2D */\n toCustomPath?: () => ICustomPath2D;\n\n resources?: Map<\n string | HTMLImageElement | HTMLCanvasElement | IBackgroundConfig,\n { state: 'init' | 'loading' | 'success' | 'fail'; data?: HTMLImageElement | HTMLCanvasElement }\n >;\n imageLoadSuccess: (url: string, data: HTMLImageElement) => void;\n imageLoadFail: (url: string) => void;\n\n clone: () => IGraphic;\n stopAnimates: (stopChildren?: boolean) => void;\n getNoWorkAnimateAttr: () => Record<string, number>;\n getGraphicTheme: () => T;\n}\n\nexport interface IRoot extends IGraphic {\n pick: (x: number, y: number) => IGraphic;\n}\n\n/**\n * 动画配置\n */\nexport type IAnimateConfig = {\n duration?: number;\n easing?: EasingType;\n};\n\nexport type GraphicReleaseStatus = 'released' | 'willRelease';\n"]}