@visactor/vrender-core 0.17.4 → 0.17.5-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/cjs/animate/custom-animate.d.ts +1 -0
  2. package/cjs/animate/custom-animate.js +2 -2
  3. package/cjs/animate/custom-animate.js.map +1 -1
  4. package/cjs/graphic/config.js +1 -0
  5. package/cjs/graphic/config.js.map +1 -1
  6. package/cjs/graphic/text.js +8 -4
  7. package/cjs/graphic/text.js.map +1 -1
  8. package/cjs/graphic/wrap-text.d.ts +1 -0
  9. package/cjs/graphic/wrap-text.js +5 -0
  10. package/cjs/graphic/wrap-text.js.map +1 -1
  11. package/cjs/interface/graphic/text.d.ts +3 -2
  12. package/cjs/interface/graphic/text.js.map +1 -1
  13. package/cjs/plugins/builtin-plugin/flex-layout-plugin.d.ts +1 -0
  14. package/cjs/plugins/builtin-plugin/flex-layout-plugin.js +13 -5
  15. package/cjs/plugins/builtin-plugin/flex-layout-plugin.js.map +1 -1
  16. package/cjs/render/contributions/render/symbol-render.js +2 -2
  17. package/cjs/render/contributions/render/symbol-render.js.map +1 -1
  18. package/dist/index.js +43 -4
  19. package/dist/index.min.js +1 -1
  20. package/es/animate/custom-animate.d.ts +1 -0
  21. package/es/animate/custom-animate.js +2 -2
  22. package/es/animate/custom-animate.js.map +1 -1
  23. package/es/graphic/config.js +1 -0
  24. package/es/graphic/config.js.map +1 -1
  25. package/es/graphic/text.js +8 -4
  26. package/es/graphic/text.js.map +1 -1
  27. package/es/graphic/wrap-text.d.ts +1 -0
  28. package/es/graphic/wrap-text.js +5 -0
  29. package/es/graphic/wrap-text.js.map +1 -1
  30. package/es/interface/graphic/text.d.ts +3 -2
  31. package/es/interface/graphic/text.js.map +1 -1
  32. package/es/plugins/builtin-plugin/flex-layout-plugin.d.ts +1 -0
  33. package/es/plugins/builtin-plugin/flex-layout-plugin.js +13 -5
  34. package/es/plugins/builtin-plugin/flex-layout-plugin.js.map +1 -1
  35. package/es/render/contributions/render/symbol-render.js +3 -1
  36. package/es/render/contributions/render/symbol-render.js.map +1 -1
  37. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/render/contributions/render/symbol-render.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,mEAA2E;AAE3E,iFAA6E;AAC7E,kDAAkD;AAClD,0DAAgE;AAehE,+CAA2C;AAE3C,yDAAqE;AAErE,mDAIyB;AAGlB,IAAM,yBAAyB,GAA/B,MAAM,yBAA0B,SAAQ,wBAAmB;IAIhE,YAGqB,yBAA2E;QAE9F,KAAK,EAAE,CAAC;QAFW,8BAAyB,GAAzB,yBAAyB,CAAkD;QALhG,eAAU,GAAW,8BAAkB,CAAC;QAQtC,IAAI,CAAC,oBAAoB,GAAG;YAC1B,+CAA+B;YAC/B,yDAAyC;YACzC,sDAAsC;SACvC,CAAC;QACF,IAAI,CAAC,IAAI,CAAC,yBAAyB,CAAC,CAAC;IACvC,CAAC;IAED,SAAS,CACP,MAAe,EACf,OAAmB,EACnB,CAAS,EACT,CAAS,EACT,WAAyB,EACzB,MAAiC,EACjC,MAIY,EACZ,QAIY;;QAGZ,MAAM,eAAe,GAAG,IAAA,gBAAQ,EAAC,MAAM,EAAE,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,CAAC,CAAC,MAAM,CAAC;QAE/D,MAAM,EACJ,IAAI,GAAG,eAAe,CAAC,IAAI,EAC3B,CAAC,EAAE,OAAO,GAAG,eAAe,CAAC,CAAC,EAC9B,CAAC,EAAE,OAAO,GAAG,eAAe,CAAC,CAAC,EAC9B,MAAM,GAAG,eAAe,CAAC,MAAM,EAC/B,MAAM,GAAG,eAAe,CAAC,MAAM,EAChC,GAAG,MAAM,CAAC,SAAS,CAAC;QAErB,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,eAAe,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;QACnE,IAAI,CAA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MAAM,eAAe,GAAG,IAAA,gBAAQ,EAAC,MAAM,EAAE,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,CAAC,CAAC,MAAM,CAAC;QAC/D,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,eAAe,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC;IAClE,CAAC;CACF,CAAA;AA3MY,yBAAyB;IADrC,IAAA,2BAAU,GAAE;IAMR,WAAA,IAAA,uBAAM,EAAC,4CAAoB,CAAC,CAAA;IAC5B,WAAA,IAAA,sBAAK,EAAC,oCAAwB,CAAC,CAAA;;GANvB,yBAAyB,CA2MrC;AA3MY,8DAAyB","file":"symbol-render.js","sourcesContent":["import { mat4Allocate } from '../../../allocator/matrix-allocate';\nimport { inject, injectable, named } from '../../../common/inversify-lite';\n// eslint-disable-next-line\nimport { ContributionProvider } from '../../../common/contribution-provider';\nimport { getTheme } from '../../../graphic/theme';\nimport { SYMBOL_NUMBER_TYPE } from '../../../graphic/constants';\nimport type {\n IGraphicAttribute,\n IContext2d,\n IMarkAttribute,\n ISymbol,\n IThemeAttribute,\n ISymbolRenderContribution,\n IDrawContext,\n IRenderService,\n IGraphicRender,\n IGraphicRenderDrawParams,\n IContributionProvider\n} from '../../../interface';\nimport type {} from '../../render-service';\nimport { BaseRender } from './base-render';\nimport { BaseRenderContributionTime } from '../../../common/enums';\nimport { SymbolRenderContribution } from './contributions/constants';\nimport { drawPathProxy, fillVisible, runFill, runStroke, strokeVisible } from './utils';\nimport {\n defaultSymbolBackgroundRenderContribution,\n defaultSymbolRenderContribution,\n defaultSymbolTextureRenderContribution\n} from './contributions';\n\n@injectable()\nexport class DefaultCanvasSymbolRender extends BaseRender<ISymbol> implements IGraphicRender {\n type: 'symbol';\n numberType: number = SYMBOL_NUMBER_TYPE;\n\n constructor(\n @inject(ContributionProvider)\n @named(SymbolRenderContribution)\n protected readonly symbolRenderContribitions: IContributionProvider<ISymbolRenderContribution>\n ) {\n super();\n this.builtinContributions = [\n defaultSymbolRenderContribution,\n defaultSymbolBackgroundRenderContribution,\n defaultSymbolTextureRenderContribution\n ];\n this.init(symbolRenderContribitions);\n }\n\n drawShape(\n symbol: ISymbol,\n context: IContext2d,\n x: number,\n y: number,\n drawContext: IDrawContext,\n params?: IGraphicRenderDrawParams,\n fillCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean\n ) {\n // const symbolAttribute = graphicService.themeService.getCurrentTheme().symbolAttribute;\n const symbolAttribute = getTheme(symbol, params?.theme).symbol;\n\n const {\n size = symbolAttribute.size,\n x: originX = symbolAttribute.x,\n y: originY = symbolAttribute.y,\n scaleX = symbolAttribute.scaleX,\n scaleY = symbolAttribute.scaleY\n } = symbol.attribute;\n\n const data = this.valid(symbol, symbolAttribute, fillCb, strokeCb);\n if (!data) {\n return;\n }\n const { fVisible, sVisible, doFill, doStroke } = data;\n\n const parsedPath = symbol.getParsedPath();\n // todo: 考虑使用path\n if (!parsedPath) {\n return;\n }\n\n const { keepDirIn3d = symbolAttribute.keepDirIn3d } = symbol.attribute;\n const z = this.z ?? 0;\n context.beginPath();\n if (keepDirIn3d && context.camera && context.project) {\n const p = context.project(x, y, z);\n const camera = context.camera;\n context.camera = null;\n if (\n parsedPath.draw(context, size, p.x, p.y, undefined, (p, a) => {\n // 如果是svg的话,合并一下fill和stroke\n if (symbol._parsedPath.svgCache) {\n const obj = Object.assign({}, a);\n obj.fill = a.fill ?? symbol.attribute.fill;\n obj.opacity = a.fill ?? symbol.attribute.opacity;\n obj.fillOpacity = symbol.attribute.fillOpacity;\n obj.stroke = a.stroke ?? symbol.attribute.stroke;\n a = obj;\n }\n if (a.fill) {\n if (fillCb) {\n fillCb(context, symbol.attribute, symbolAttribute);\n } else {\n context.setCommonStyle(symbol, a, originX - x, originY - y, symbolAttribute);\n context.fill();\n }\n }\n if (a.stroke) {\n if (strokeCb) {\n strokeCb(context, symbol.attribute, symbolAttribute);\n } else {\n context.setStrokeStyle(symbol, a, (originX - x) / scaleX, (originY - y) / scaleY, symbolAttribute);\n context.stroke();\n }\n }\n }) === false\n ) {\n context.closePath();\n }\n context.camera = camera;\n } else {\n if (\n parsedPath.draw(context, size, x, y, z, (p, a) => {\n // 如果是svg的话,合并一下fill和stroke\n if (symbol._parsedPath.svgCache) {\n const obj = Object.assign({}, a);\n obj.fill = a.fill ?? symbol.attribute.fill;\n obj.opacity = a.opacity ?? symbol.attribute.opacity;\n obj.fillOpacity = symbol.attribute.fillOpacity;\n obj.stroke = a.stroke ?? symbol.attribute.stroke;\n a = obj;\n }\n if (a.fill) {\n if (fillCb) {\n fillCb(context, symbol.attribute, symbolAttribute);\n } else {\n context.setCommonStyle(symbol, a, originX - x, originY - y, symbolAttribute);\n context.fill();\n }\n }\n if (a.stroke) {\n if (strokeCb) {\n strokeCb(context, symbol.attribute, symbolAttribute);\n } else {\n context.setStrokeStyle(symbol, a, (originX - x) / scaleX, (originY - y) / scaleY, symbolAttribute);\n context.stroke();\n }\n }\n }) === false\n ) {\n context.closePath();\n }\n }\n\n // shadow\n context.setShadowBlendStyle && context.setShadowBlendStyle(symbol, symbol.attribute, symbolAttribute);\n\n this.beforeRenderStep(\n symbol,\n context,\n x,\n y,\n doFill,\n doStroke,\n fVisible,\n sVisible,\n symbolAttribute,\n drawContext,\n fillCb,\n strokeCb\n );\n\n // if (fill !== false) {\n // context.setCommonStyle(symbol.attribute, symbolAttribute);\n // context.fill();\n // }\n // if (stroke !== false) {\n // context.setStrokeStyle(symbol.attribute, symbolAttribute);\n // context.stroke();\n // }\n\n // svg就不用fill和stroke了\n if (doFill && !parsedPath.isSvg) {\n if (fillCb) {\n fillCb(context, symbol.attribute, symbolAttribute);\n } else if (fVisible) {\n context.setCommonStyle(symbol, symbol.attribute, originX - x, originY - y, symbolAttribute);\n context.fill();\n }\n }\n if (doStroke && !parsedPath.isSvg) {\n if (strokeCb) {\n strokeCb(context, symbol.attribute, symbolAttribute);\n } else if (sVisible) {\n context.setStrokeStyle(\n symbol,\n symbol.attribute,\n (originX - x) / scaleX,\n (originY - y) / scaleY,\n symbolAttribute\n );\n context.stroke();\n }\n }\n\n this.afterRenderStep(\n symbol,\n context,\n x,\n y,\n doFill,\n doStroke,\n fVisible,\n sVisible,\n symbolAttribute,\n drawContext,\n fillCb,\n strokeCb\n );\n }\n\n draw(symbol: ISymbol, renderService: IRenderService, drawContext: IDrawContext, params?: IGraphicRenderDrawParams) {\n const symbolAttribute = getTheme(symbol, params?.theme).symbol;\n this._draw(symbol, symbolAttribute, false, drawContext, params);\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/render/contributions/render/symbol-render.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,mEAA2E;AAE3E,iFAA6E;AAC7E,kDAAkD;AAClD,0DAAgE;AAehE,+CAA2C;AAE3C,yDAAqE;AAErE,6CAA2C;AAC3C,mDAIyB;AAGlB,IAAM,yBAAyB,GAA/B,MAAM,yBAA0B,SAAQ,wBAAmB;IAIhE,YAGqB,yBAA2E;QAE9F,KAAK,EAAE,CAAC;QAFW,8BAAyB,GAAzB,yBAAyB,CAAkD;QALhG,eAAU,GAAW,8BAAkB,CAAC;QAQtC,IAAI,CAAC,oBAAoB,GAAG;YAC1B,+CAA+B;YAC/B,yDAAyC;YACzC,sDAAsC;SACvC,CAAC;QACF,IAAI,CAAC,IAAI,CAAC,yBAAyB,CAAC,CAAC;IACvC,CAAC;IAED,SAAS,CACP,MAAe,EACf,OAAmB,EACnB,CAAS,EACT,CAAS,EACT,WAAyB,EACzB,MAAiC,EACjC,MAIY,EACZ,QAIY;;QAGZ,MAAM,eAAe,GAAG,IAAA,gBAAQ,EAAC,MAAM,EAAE,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,CAAC,CAAC,M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,CAAC,SAAS,EAAE,eAAe,CAAC,CAAC;aACtD;iBAAM,IAAI,QAAQ,EAAE;gBACnB,OAAO,CAAC,cAAc,CACpB,MAAM,EACN,MAAM,CAAC,SAAS,EAChB,CAAC,OAAO,GAAG,CAAC,CAAC,GAAG,MAAM,EACtB,CAAC,OAAO,GAAG,CAAC,CAAC,GAAG,MAAM,EACtB,eAAe,CAChB,CAAC;gBACF,OAAO,CAAC,MAAM,EAAE,CAAC;aAClB;SACF;QAED,IAAI,CAAC,eAAe,CAClB,MAAM,EACN,OAAO,EACP,CAAC,EACD,CAAC,EACD,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,eAAe,EACf,WAAW,EACX,MAAM,EACN,QAAQ,CACT,CAAC;IACJ,CAAC;IAED,IAAI,CAAC,MAAe,EAAE,aAA6B,EAAE,WAAyB,EAAE,MAAiC;QAC/G,MAAM,eAAe,GAAG,IAAA,gBAAQ,EAAC,MAAM,EAAE,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,CAAC,CAAC,MAAM,CAAC;QAC/D,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,eAAe,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC;IAClE,CAAC;CACF,CAAA;AAlNY,yBAAyB;IADrC,IAAA,2BAAU,GAAE;IAMR,WAAA,IAAA,uBAAM,EAAC,4CAAoB,CAAC,CAAA;IAC5B,WAAA,IAAA,sBAAK,EAAC,oCAAwB,CAAC,CAAA;;GANvB,yBAAyB,CAkNrC;AAlNY,8DAAyB","file":"symbol-render.js","sourcesContent":["import { mat4Allocate } from '../../../allocator/matrix-allocate';\nimport { inject, injectable, named } from '../../../common/inversify-lite';\n// eslint-disable-next-line\nimport { ContributionProvider } from '../../../common/contribution-provider';\nimport { getTheme } from '../../../graphic/theme';\nimport { SYMBOL_NUMBER_TYPE } from '../../../graphic/constants';\nimport type {\n IGraphicAttribute,\n IContext2d,\n IMarkAttribute,\n ISymbol,\n IThemeAttribute,\n ISymbolRenderContribution,\n IDrawContext,\n IRenderService,\n IGraphicRender,\n IGraphicRenderDrawParams,\n IContributionProvider\n} from '../../../interface';\nimport type {} from '../../render-service';\nimport { BaseRender } from './base-render';\nimport { BaseRenderContributionTime } from '../../../common/enums';\nimport { SymbolRenderContribution } from './contributions/constants';\nimport { drawPathProxy, fillVisible, runFill, runStroke, strokeVisible } from './utils';\nimport { isArray } from '@visactor/vutils';\nimport {\n defaultSymbolBackgroundRenderContribution,\n defaultSymbolRenderContribution,\n defaultSymbolTextureRenderContribution\n} from './contributions';\n\n@injectable()\nexport class DefaultCanvasSymbolRender extends BaseRender<ISymbol> implements IGraphicRender {\n type: 'symbol';\n numberType: number = SYMBOL_NUMBER_TYPE;\n\n constructor(\n @inject(ContributionProvider)\n @named(SymbolRenderContribution)\n protected readonly symbolRenderContribitions: IContributionProvider<ISymbolRenderContribution>\n ) {\n super();\n this.builtinContributions = [\n defaultSymbolRenderContribution,\n defaultSymbolBackgroundRenderContribution,\n defaultSymbolTextureRenderContribution\n ];\n this.init(symbolRenderContribitions);\n }\n\n drawShape(\n symbol: ISymbol,\n context: IContext2d,\n x: number,\n y: number,\n drawContext: IDrawContext,\n params?: IGraphicRenderDrawParams,\n fillCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean\n ) {\n // const symbolAttribute = graphicService.themeService.getCurrentTheme().symbolAttribute;\n const symbolAttribute = getTheme(symbol, params?.theme).symbol;\n\n const {\n size = symbolAttribute.size,\n x: originX = symbolAttribute.x,\n y: originY = symbolAttribute.y,\n scaleX = symbolAttribute.scaleX,\n scaleY = symbolAttribute.scaleY\n } = symbol.attribute;\n\n const data = this.valid(symbol, symbolAttribute, fillCb, strokeCb);\n if (!data) {\n return;\n }\n const { fVisible, sVisible, doFill, doStroke } = data;\n\n const parsedPath = symbol.getParsedPath();\n // todo: 考虑使用path\n if (!parsedPath) {\n return;\n }\n\n const { keepDirIn3d = symbolAttribute.keepDirIn3d } = symbol.attribute;\n const z = this.z ?? 0;\n context.beginPath();\n if (keepDirIn3d && context.camera && context.project) {\n const p = context.project(x, y, z);\n const camera = context.camera;\n context.camera = null;\n if (\n parsedPath.draw(\n context,\n isArray(size) ? [size[0] * scaleX, size[1] * scaleY] : size * scaleX,\n p.x,\n p.y,\n undefined,\n (p, a) => {\n // 如果是svg的话,合并一下fill和stroke\n if (symbol._parsedPath.svgCache) {\n const obj = Object.assign({}, a);\n obj.fill = a.fill ?? symbol.attribute.fill;\n obj.opacity = a.fill ?? symbol.attribute.opacity;\n obj.fillOpacity = symbol.attribute.fillOpacity;\n obj.stroke = a.stroke ?? symbol.attribute.stroke;\n a = obj;\n }\n if (a.fill) {\n if (fillCb) {\n fillCb(context, symbol.attribute, symbolAttribute);\n } else {\n context.setCommonStyle(symbol, a, originX - x, originY - y, symbolAttribute);\n context.fill();\n }\n }\n if (a.stroke) {\n if (strokeCb) {\n strokeCb(context, symbol.attribute, symbolAttribute);\n } else {\n context.setStrokeStyle(symbol, a, (originX - x) / scaleX, (originY - y) / scaleY, symbolAttribute);\n context.stroke();\n }\n }\n }\n ) === false\n ) {\n context.closePath();\n }\n context.camera = camera;\n } else {\n if (\n parsedPath.draw(context, size, x, y, z, (p, a) => {\n // 如果是svg的话,合并一下fill和stroke\n if (symbol._parsedPath.svgCache) {\n const obj = Object.assign({}, a);\n obj.fill = a.fill ?? symbol.attribute.fill;\n obj.opacity = a.opacity ?? symbol.attribute.opacity;\n obj.fillOpacity = symbol.attribute.fillOpacity;\n obj.stroke = a.stroke ?? symbol.attribute.stroke;\n a = obj;\n }\n if (a.fill) {\n if (fillCb) {\n fillCb(context, symbol.attribute, symbolAttribute);\n } else {\n context.setCommonStyle(symbol, a, originX - x, originY - y, symbolAttribute);\n context.fill();\n }\n }\n if (a.stroke) {\n if (strokeCb) {\n strokeCb(context, symbol.attribute, symbolAttribute);\n } else {\n context.setStrokeStyle(symbol, a, (originX - x) / scaleX, (originY - y) / scaleY, symbolAttribute);\n context.stroke();\n }\n }\n }) === false\n ) {\n context.closePath();\n }\n }\n\n // shadow\n context.setShadowBlendStyle && context.setShadowBlendStyle(symbol, symbol.attribute, symbolAttribute);\n\n this.beforeRenderStep(\n symbol,\n context,\n x,\n y,\n doFill,\n doStroke,\n fVisible,\n sVisible,\n symbolAttribute,\n drawContext,\n fillCb,\n strokeCb\n );\n\n // if (fill !== false) {\n // context.setCommonStyle(symbol.attribute, symbolAttribute);\n // context.fill();\n // }\n // if (stroke !== false) {\n // context.setStrokeStyle(symbol.attribute, symbolAttribute);\n // context.stroke();\n // }\n\n // svg就不用fill和stroke了\n if (doFill && !parsedPath.isSvg) {\n if (fillCb) {\n fillCb(context, symbol.attribute, symbolAttribute);\n } else if (fVisible) {\n context.setCommonStyle(symbol, symbol.attribute, originX - x, originY - y, symbolAttribute);\n context.fill();\n }\n }\n if (doStroke && !parsedPath.isSvg) {\n if (strokeCb) {\n strokeCb(context, symbol.attribute, symbolAttribute);\n } else if (sVisible) {\n context.setStrokeStyle(\n symbol,\n symbol.attribute,\n (originX - x) / scaleX,\n (originY - y) / scaleY,\n symbolAttribute\n );\n context.stroke();\n }\n }\n\n this.afterRenderStep(\n symbol,\n context,\n x,\n y,\n doFill,\n doStroke,\n fVisible,\n sVisible,\n symbolAttribute,\n drawContext,\n fillCb,\n strokeCb\n );\n }\n\n draw(symbol: ISymbol, renderService: IRenderService, drawContext: IDrawContext, params?: IGraphicRenderDrawParams) {\n const symbolAttribute = getTheme(symbol, params?.theme).symbol;\n this._draw(symbol, symbolAttribute, false, drawContext, params);\n }\n}\n"]}
package/dist/index.js CHANGED
@@ -3154,6 +3154,7 @@
3154
3154
  wordBreak: 'break-all',
3155
3155
  ignoreBuf: false,
3156
3156
  verticalMode: 0,
3157
+ wrap: false,
3157
3158
  whiteSpace: 'no-wrap',
3158
3159
  heightLimit: Infinity,
3159
3160
  lineClamp: Infinity,
@@ -8789,7 +8790,7 @@
8789
8790
  if (this.phi == null || this.theta == null) {
8790
8791
  return;
8791
8792
  }
8792
- const { center, r } = typeof this.params === 'function' ? this.params() : this.params;
8793
+ const { center, r, cb } = typeof this.params === 'function' ? this.params() : this.params;
8793
8794
  const deltaAngle = Math.PI * 2 * ratio;
8794
8795
  const theta = this.theta + deltaAngle;
8795
8796
  const phi = this.phi;
@@ -8805,6 +8806,7 @@
8805
8806
  }
8806
8807
  out.alpha = vutils.pi2 - out.alpha;
8807
8808
  out.zIndex = out.z * -10000;
8809
+ cb && cb(out);
8808
8810
  }
8809
8811
  }
8810
8812
  class GroupFadeIn extends ACustomAnimate {
@@ -13522,6 +13524,8 @@
13522
13524
  'lineHeight',
13523
13525
  'direction',
13524
13526
  'wordBreak',
13527
+ 'heightLimit',
13528
+ 'lineClamp',
13525
13529
  ...GRAPHIC_UPDATE_TAG_KEY
13526
13530
  ];
13527
13531
  class Text extends Graphic {
@@ -13584,6 +13588,9 @@
13584
13588
  }
13585
13589
  _isValid() {
13586
13590
  const { text } = this.attribute;
13591
+ if (vutils.isArray(text)) {
13592
+ return !text.every((t) => t == null || t === '');
13593
+ }
13587
13594
  return text != null && text !== '';
13588
13595
  }
13589
13596
  doUpdateAABBBounds() {
@@ -13723,6 +13730,10 @@
13723
13730
  updateHorizontalSinglelineAABBBounds(text) {
13724
13731
  var _a, _b;
13725
13732
  const textTheme = getTheme(this).text;
13733
+ const { wrap = textTheme.wrap } = this.attribute;
13734
+ if (wrap) {
13735
+ return this.updateWrapAABBBounds([text]);
13736
+ }
13726
13737
  const textMeasure = application.graphicUtil.textMeasure;
13727
13738
  let width;
13728
13739
  let str;
@@ -13851,6 +13862,10 @@
13851
13862
  updateHorizontalMultilineAABBBounds(text) {
13852
13863
  var _a, _b;
13853
13864
  const textTheme = getTheme(this).text;
13865
+ const { wrap = textTheme.wrap } = this.attribute;
13866
+ if (wrap) {
13867
+ return this.updateWrapAABBBounds(text);
13868
+ }
13854
13869
  const attribute = this.attribute;
13855
13870
  const { fontFamily = textTheme.fontFamily, textAlign = textTheme.textAlign, textBaseline = textTheme.textBaseline, fontSize = textTheme.fontSize, fontWeight = textTheme.fontWeight, ellipsis = textTheme.ellipsis, maxLineWidth, stroke = textTheme.stroke, lineWidth = textTheme.lineWidth, whiteSpace = textTheme.whiteSpace, suffixPosition = textTheme.suffixPosition } = attribute;
13856
13871
  const lineHeight = (_a = calculateLineHeight(attribute.lineHeight, attribute.fontSize || textTheme.fontSize)) !== null && _a !== void 0 ? _a : (attribute.fontSize || textTheme.fontSize);
@@ -13988,6 +14003,9 @@
13988
14003
 
13989
14004
  const WRAP_TEXT_UPDATE_TAG_KEY = ['heightLimit', 'lineClamp'];
13990
14005
  class WrapText extends Text {
14006
+ constructor(params) {
14007
+ super(Object.assign(Object.assign({}, params), { wrap: true }));
14008
+ }
13991
14009
  _isValid() {
13992
14010
  const { text } = this.attribute;
13993
14011
  if (vutils.isArray(text)) {
@@ -21113,7 +21131,7 @@
21113
21131
  const p = context.project(x, y, z);
21114
21132
  const camera = context.camera;
21115
21133
  context.camera = null;
21116
- if (parsedPath.draw(context, size, p.x, p.y, undefined, (p, a) => {
21134
+ if (parsedPath.draw(context, vutils.isArray(size) ? [size[0] * scaleX, size[1] * scaleY] : size * scaleX, p.x, p.y, undefined, (p, a) => {
21117
21135
  var _a, _b, _c;
21118
21136
  if (symbol._parsedPath.svgCache) {
21119
21137
  const obj = Object.assign({}, a);
@@ -24041,6 +24059,10 @@
24041
24059
  this.tempBounds = new vutils.AABBBounds();
24042
24060
  }
24043
24061
  tryLayout(graphic) {
24062
+ if (this.layouting) {
24063
+ return;
24064
+ }
24065
+ this.layouting = true;
24044
24066
  const p = graphic.parent;
24045
24067
  if (!p || !graphic.needUpdateLayout()) {
24046
24068
  return;
@@ -24213,6 +24235,7 @@
24213
24235
  p.addUpdateLayoutTag();
24214
24236
  if (!clip && !this.tempBounds.equals(p.AABBBounds)) {
24215
24237
  this.tryLayout(p);
24238
+ this.layouting = false;
24216
24239
  }
24217
24240
  }
24218
24241
  layoutMain(p, children, justifyContent, main, mianLenArray, lastIdx, currSeg) {
@@ -24266,6 +24289,13 @@
24266
24289
  }
24267
24290
  }
24268
24291
  }
24292
+ else if (justifyContent === 'center') {
24293
+ let pos = (main.len - currSeg.mainLen) / 2;
24294
+ for (let i = lastIdx; i <= currSeg.idx; i++) {
24295
+ children[i].attribute[main.field] = pos + getPadding(children[i], main.field);
24296
+ pos += mianLenArray[i].mainLen;
24297
+ }
24298
+ }
24269
24299
  }
24270
24300
  layoutCross(children, alignItem, cross, anchorPos, lenArray, currSeg, lastIdx) {
24271
24301
  if (alignItem === 'flex-end') {
@@ -24292,22 +24322,30 @@
24292
24322
  graphic = graphic.glyphHost;
24293
24323
  }
24294
24324
  this.tryLayout(graphic);
24325
+ this.layouting = false;
24295
24326
  });
24296
24327
  application.graphicService.hooks.beforeUpdateAABBBounds.tap(this.key, (graphic, stage, willUpdate, bounds) => {
24297
24328
  if (graphic.glyphHost) {
24298
24329
  graphic = graphic.glyphHost;
24299
24330
  }
24300
- if (!(stage && stage === this.pluginService.stage && stage.renderCount)) {
24331
+ if (!(stage && stage === this.pluginService.stage)) {
24332
+ return;
24333
+ }
24334
+ if (!graphic.isContainer) {
24301
24335
  return;
24302
24336
  }
24303
24337
  _tempBounds.copy(bounds);
24304
24338
  });
24305
24339
  application.graphicService.hooks.afterUpdateAABBBounds.tap(this.key, (graphic, stage, bounds, params, selfChange) => {
24306
- if (!(stage && stage === this.pluginService.stage && stage.renderCount)) {
24340
+ if (!(stage && stage === this.pluginService.stage)) {
24341
+ return;
24342
+ }
24343
+ if (!graphic.isContainer) {
24307
24344
  return;
24308
24345
  }
24309
24346
  if (!_tempBounds.equals(bounds)) {
24310
24347
  this.tryLayout(graphic);
24348
+ this.layouting = false;
24311
24349
  }
24312
24350
  });
24313
24351
  application.graphicService.hooks.onSetStage.tap(this.key, graphic => {
@@ -24315,6 +24353,7 @@
24315
24353
  graphic = graphic.glyphHost;
24316
24354
  }
24317
24355
  this.tryLayout(graphic);
24356
+ this.layouting = false;
24318
24357
  });
24319
24358
  }
24320
24359
  deactivate(context) {