@visactor/vrender-core 1.0.0-alpha.5 → 1.0.0-alpha.7

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 (284) hide show
  1. package/cjs/animate/config.d.ts +0 -1
  2. package/cjs/animate/config.js +1 -5
  3. package/cjs/animate/config.js.map +1 -1
  4. package/cjs/application.d.ts +2 -1
  5. package/cjs/application.js.map +1 -1
  6. package/cjs/color-string/interpolate.js +5 -2
  7. package/cjs/color-string/interpolate.js.map +1 -1
  8. package/cjs/common/canvas-utils.js +6 -3
  9. package/cjs/common/canvas-utils.js.map +1 -1
  10. package/cjs/common/custom-path2d.js +2 -2
  11. package/cjs/common/custom-path2d.js.map +1 -1
  12. package/cjs/common/morphing-utils.js +32 -124
  13. package/cjs/common/morphing-utils.js.map +1 -1
  14. package/cjs/common/segment/index.js +3 -0
  15. package/cjs/common/segment/index.js.map +1 -1
  16. package/cjs/common/segment/step.d.ts +6 -0
  17. package/cjs/common/segment/step.js +19 -2
  18. package/cjs/common/segment/step.js.map +1 -1
  19. package/cjs/common/shape/arc.d.ts +1 -1
  20. package/cjs/common/shape/arc.js +7 -3
  21. package/cjs/common/shape/arc.js.map +1 -1
  22. package/cjs/common/split-path.js +1 -1
  23. package/cjs/common/split-path.js.map +1 -1
  24. package/cjs/common/utils.d.ts +0 -2
  25. package/cjs/common/utils.js +4 -8
  26. package/cjs/common/utils.js.map +1 -1
  27. package/cjs/core/stage.d.ts +2 -1
  28. package/cjs/core/stage.js +4 -3
  29. package/cjs/core/stage.js.map +1 -1
  30. package/cjs/graphic/arc.d.ts +1 -2
  31. package/cjs/graphic/arc.js +4 -3
  32. package/cjs/graphic/arc.js.map +1 -1
  33. package/cjs/graphic/area.d.ts +1 -2
  34. package/cjs/graphic/area.js +5 -2
  35. package/cjs/graphic/area.js.map +1 -1
  36. package/cjs/graphic/circle.d.ts +1 -2
  37. package/cjs/graphic/circle.js +7 -3
  38. package/cjs/graphic/circle.js.map +1 -1
  39. package/cjs/graphic/config.d.ts +2 -1
  40. package/cjs/graphic/config.js +10 -3
  41. package/cjs/graphic/config.js.map +1 -1
  42. package/cjs/graphic/constants.d.ts +1 -0
  43. package/cjs/graphic/constants.js +4 -3
  44. package/cjs/graphic/constants.js.map +1 -1
  45. package/cjs/graphic/graphic-service/graphic-module.js +1 -2
  46. package/cjs/graphic/graphic-service/graphic-module.js.map +1 -1
  47. package/cjs/graphic/graphic.d.ts +7 -1
  48. package/cjs/graphic/graphic.js +27 -19
  49. package/cjs/graphic/graphic.js.map +1 -1
  50. package/cjs/graphic/group.js +14 -7
  51. package/cjs/graphic/group.js.map +1 -1
  52. package/cjs/graphic/image.js +2 -1
  53. package/cjs/graphic/image.js.map +1 -1
  54. package/cjs/graphic/index.d.ts +1 -0
  55. package/cjs/graphic/index.js +8 -8
  56. package/cjs/graphic/index.js.map +1 -1
  57. package/cjs/graphic/line.d.ts +1 -2
  58. package/cjs/graphic/line.js +7 -2
  59. package/cjs/graphic/line.js.map +1 -1
  60. package/cjs/graphic/path.js +2 -1
  61. package/cjs/graphic/path.js.map +1 -1
  62. package/cjs/graphic/polygon.js +2 -1
  63. package/cjs/graphic/polygon.js.map +1 -1
  64. package/cjs/graphic/rect.js +7 -3
  65. package/cjs/graphic/rect.js.map +1 -1
  66. package/cjs/graphic/richtext/icon.d.ts +1 -1
  67. package/cjs/graphic/richtext/icon.js.map +1 -1
  68. package/cjs/graphic/richtext.js +3 -2
  69. package/cjs/graphic/richtext.js.map +1 -1
  70. package/cjs/graphic/star.d.ts +52 -0
  71. package/cjs/graphic/star.js +78 -0
  72. package/cjs/graphic/star.js.map +1 -0
  73. package/cjs/graphic/symbol.js +3 -1
  74. package/cjs/graphic/symbol.js.map +1 -1
  75. package/cjs/graphic/text.js +1 -0
  76. package/cjs/graphic/text.js.map +1 -1
  77. package/cjs/graphic/theme.js +2 -0
  78. package/cjs/graphic/theme.js.map +1 -1
  79. package/cjs/index.d.ts +2 -0
  80. package/cjs/index.js +7 -6
  81. package/cjs/index.js.map +1 -1
  82. package/cjs/interface/animation/animate.d.ts +17 -0
  83. package/cjs/interface/animation/animate.js.map +1 -1
  84. package/cjs/interface/common.d.ts +1 -1
  85. package/cjs/interface/common.js.map +1 -1
  86. package/cjs/interface/contribution.d.ts +2 -0
  87. package/cjs/interface/contribution.js.map +1 -1
  88. package/cjs/interface/graphic/index.d.ts +1 -0
  89. package/cjs/interface/graphic/index.js +3 -2
  90. package/cjs/interface/graphic/index.js.map +1 -1
  91. package/cjs/interface/graphic/star.d.ts +12 -0
  92. package/cjs/interface/graphic/star.js +6 -0
  93. package/cjs/interface/graphic/star.js.map +1 -0
  94. package/cjs/interface/graphic/theme.d.ts +3 -0
  95. package/cjs/interface/graphic/theme.js.map +1 -1
  96. package/cjs/interface/graphic.d.ts +11 -0
  97. package/cjs/interface/graphic.js.map +1 -1
  98. package/cjs/interface/render.d.ts +1 -0
  99. package/cjs/interface/render.js.map +1 -1
  100. package/cjs/interface/stage.d.ts +2 -0
  101. package/cjs/interface/stage.js.map +1 -1
  102. package/cjs/modules.d.ts +2 -1
  103. package/cjs/modules.js +4 -3
  104. package/cjs/modules.js.map +1 -1
  105. package/cjs/plugins/builtin-plugin/auto-render-plugin.js +9 -8
  106. package/cjs/plugins/builtin-plugin/auto-render-plugin.js.map +1 -1
  107. package/cjs/plugins/builtin-plugin/dirty-bounds-plugin.js +14 -11
  108. package/cjs/plugins/builtin-plugin/dirty-bounds-plugin.js.map +1 -1
  109. package/cjs/plugins/builtin-plugin/flex-layout-plugin.js +13 -10
  110. package/cjs/plugins/builtin-plugin/flex-layout-plugin.js.map +1 -1
  111. package/cjs/plugins/builtin-plugin/html-attribute-plugin.js +0 -1
  112. package/cjs/plugins/builtin-plugin/html-attribute-plugin.js.map +1 -1
  113. package/cjs/plugins/builtin-plugin/incremental-auto-render-plugin.js +8 -5
  114. package/cjs/plugins/builtin-plugin/incremental-auto-render-plugin.js.map +1 -1
  115. package/cjs/register/register-star.d.ts +1 -0
  116. package/cjs/register/register-star.js +14 -0
  117. package/cjs/register/register-star.js.map +1 -0
  118. package/cjs/render/contributions/render/area-render.js +2 -2
  119. package/cjs/render/contributions/render/area-render.js.map +1 -1
  120. package/cjs/render/contributions/render/contributions/constants.d.ts +1 -0
  121. package/cjs/render/contributions/render/contributions/constants.js +3 -2
  122. package/cjs/render/contributions/render/contributions/constants.js.map +1 -1
  123. package/cjs/render/contributions/render/contributions/index.d.ts +1 -0
  124. package/cjs/render/contributions/render/contributions/index.js +2 -2
  125. package/cjs/render/contributions/render/contributions/index.js.map +1 -1
  126. package/cjs/render/contributions/render/contributions/star-contribution-render.d.ts +2 -0
  127. package/cjs/render/contributions/render/contributions/star-contribution-render.js +11 -0
  128. package/cjs/render/contributions/render/contributions/star-contribution-render.js.map +1 -0
  129. package/cjs/render/contributions/render/line-render.js +1 -1
  130. package/cjs/render/contributions/render/line-render.js.map +1 -1
  131. package/cjs/render/contributions/render/star-module.d.ts +2 -0
  132. package/cjs/render/contributions/render/star-module.js +15 -0
  133. package/cjs/render/contributions/render/star-module.js.map +1 -0
  134. package/cjs/render/contributions/render/star-render.d.ts +10 -0
  135. package/cjs/render/contributions/render/star-render.js +54 -0
  136. package/cjs/render/contributions/render/star-render.js.map +1 -0
  137. package/cjs/render/contributions/render/symbol.d.ts +1 -0
  138. package/cjs/render/contributions/render/symbol.js +2 -2
  139. package/cjs/render/contributions/render/symbol.js.map +1 -1
  140. package/cjs/render/render-service.d.ts +1 -1
  141. package/cjs/render/render-service.js.map +1 -1
  142. package/dist/index.es.js +12340 -12134
  143. package/es/animate/config.d.ts +0 -1
  144. package/es/animate/config.js +0 -5
  145. package/es/animate/config.js.map +1 -1
  146. package/es/application.d.ts +2 -1
  147. package/es/application.js.map +1 -1
  148. package/es/color-string/interpolate.js +4 -1
  149. package/es/color-string/interpolate.js.map +1 -1
  150. package/es/common/canvas-utils.js +6 -3
  151. package/es/common/canvas-utils.js.map +1 -1
  152. package/es/common/custom-path2d.js +2 -2
  153. package/es/common/custom-path2d.js.map +1 -1
  154. package/es/common/morphing-utils.js +29 -124
  155. package/es/common/morphing-utils.js.map +1 -1
  156. package/es/common/segment/index.js +4 -1
  157. package/es/common/segment/index.js.map +1 -1
  158. package/es/common/segment/step.d.ts +6 -0
  159. package/es/common/segment/step.js +13 -0
  160. package/es/common/segment/step.js.map +1 -1
  161. package/es/common/shape/arc.d.ts +1 -1
  162. package/es/common/shape/arc.js +7 -3
  163. package/es/common/shape/arc.js.map +1 -1
  164. package/es/common/split-path.js +1 -1
  165. package/es/common/split-path.js.map +1 -1
  166. package/es/common/utils.d.ts +0 -2
  167. package/es/common/utils.js +0 -4
  168. package/es/common/utils.js.map +1 -1
  169. package/es/core/stage.d.ts +2 -1
  170. package/es/core/stage.js +5 -2
  171. package/es/core/stage.js.map +1 -1
  172. package/es/graphic/arc.d.ts +1 -2
  173. package/es/graphic/arc.js +4 -3
  174. package/es/graphic/arc.js.map +1 -1
  175. package/es/graphic/area.d.ts +1 -2
  176. package/es/graphic/area.js +5 -2
  177. package/es/graphic/area.js.map +1 -1
  178. package/es/graphic/circle.d.ts +1 -2
  179. package/es/graphic/circle.js +6 -3
  180. package/es/graphic/circle.js.map +1 -1
  181. package/es/graphic/config.d.ts +2 -1
  182. package/es/graphic/config.js +11 -2
  183. package/es/graphic/config.js.map +1 -1
  184. package/es/graphic/constants.d.ts +1 -0
  185. package/es/graphic/constants.js +2 -0
  186. package/es/graphic/constants.js.map +1 -1
  187. package/es/graphic/graphic-service/graphic-module.js +1 -1
  188. package/es/graphic/graphic-service/graphic-module.js.map +1 -1
  189. package/es/graphic/graphic.d.ts +7 -1
  190. package/es/graphic/graphic.js +28 -18
  191. package/es/graphic/graphic.js.map +1 -1
  192. package/es/graphic/group.js +15 -8
  193. package/es/graphic/group.js.map +1 -1
  194. package/es/graphic/image.js +2 -1
  195. package/es/graphic/image.js.map +1 -1
  196. package/es/graphic/index.d.ts +1 -0
  197. package/es/graphic/index.js +2 -0
  198. package/es/graphic/index.js.map +1 -1
  199. package/es/graphic/line.d.ts +1 -2
  200. package/es/graphic/line.js +7 -2
  201. package/es/graphic/line.js.map +1 -1
  202. package/es/graphic/path.js +2 -1
  203. package/es/graphic/path.js.map +1 -1
  204. package/es/graphic/polygon.js +2 -1
  205. package/es/graphic/polygon.js.map +1 -1
  206. package/es/graphic/rect.js +7 -3
  207. package/es/graphic/rect.js.map +1 -1
  208. package/es/graphic/richtext/icon.d.ts +1 -1
  209. package/es/graphic/richtext/icon.js.map +1 -1
  210. package/es/graphic/richtext.js +3 -2
  211. package/es/graphic/richtext.js.map +1 -1
  212. package/es/graphic/star.d.ts +52 -0
  213. package/es/graphic/star.js +82 -0
  214. package/es/graphic/star.js.map +1 -0
  215. package/es/graphic/symbol.js +3 -1
  216. package/es/graphic/symbol.js.map +1 -1
  217. package/es/graphic/text.js +1 -0
  218. package/es/graphic/text.js.map +1 -1
  219. package/es/graphic/theme.js +3 -1
  220. package/es/graphic/theme.js.map +1 -1
  221. package/es/index.d.ts +2 -0
  222. package/es/index.js +4 -0
  223. package/es/index.js.map +1 -1
  224. package/es/interface/animation/animate.d.ts +17 -0
  225. package/es/interface/animation/animate.js.map +1 -1
  226. package/es/interface/common.d.ts +1 -1
  227. package/es/interface/common.js.map +1 -1
  228. package/es/interface/contribution.d.ts +2 -0
  229. package/es/interface/contribution.js.map +1 -1
  230. package/es/interface/graphic/index.d.ts +1 -0
  231. package/es/interface/graphic/index.js +2 -0
  232. package/es/interface/graphic/index.js.map +1 -1
  233. package/es/interface/graphic/star.d.ts +12 -0
  234. package/es/interface/graphic/star.js +2 -0
  235. package/es/interface/graphic/star.js.map +1 -0
  236. package/es/interface/graphic/theme.d.ts +3 -0
  237. package/es/interface/graphic/theme.js.map +1 -1
  238. package/es/interface/graphic.d.ts +11 -0
  239. package/es/interface/graphic.js.map +1 -1
  240. package/es/interface/render.d.ts +1 -0
  241. package/es/interface/render.js.map +1 -1
  242. package/es/interface/stage.d.ts +2 -0
  243. package/es/interface/stage.js.map +1 -1
  244. package/es/modules.d.ts +2 -1
  245. package/es/modules.js +6 -0
  246. package/es/modules.js.map +1 -1
  247. package/es/plugins/builtin-plugin/auto-render-plugin.js +8 -8
  248. package/es/plugins/builtin-plugin/auto-render-plugin.js.map +1 -1
  249. package/es/plugins/builtin-plugin/dirty-bounds-plugin.js +13 -12
  250. package/es/plugins/builtin-plugin/dirty-bounds-plugin.js.map +1 -1
  251. package/es/plugins/builtin-plugin/flex-layout-plugin.js +12 -11
  252. package/es/plugins/builtin-plugin/flex-layout-plugin.js.map +1 -1
  253. package/es/plugins/builtin-plugin/html-attribute-plugin.js +0 -1
  254. package/es/plugins/builtin-plugin/html-attribute-plugin.js.map +1 -1
  255. package/es/plugins/builtin-plugin/incremental-auto-render-plugin.js +8 -5
  256. package/es/plugins/builtin-plugin/incremental-auto-render-plugin.js.map +1 -1
  257. package/es/register/register-star.d.ts +1 -0
  258. package/es/register/register-star.js +8 -0
  259. package/es/register/register-star.js.map +1 -0
  260. package/es/render/contributions/render/area-render.js +2 -2
  261. package/es/render/contributions/render/area-render.js.map +1 -1
  262. package/es/render/contributions/render/contributions/constants.d.ts +1 -0
  263. package/es/render/contributions/render/contributions/constants.js +2 -0
  264. package/es/render/contributions/render/contributions/constants.js.map +1 -1
  265. package/es/render/contributions/render/contributions/index.d.ts +1 -0
  266. package/es/render/contributions/render/contributions/index.js +2 -0
  267. package/es/render/contributions/render/contributions/index.js.map +1 -1
  268. package/es/render/contributions/render/contributions/star-contribution-render.d.ts +2 -0
  269. package/es/render/contributions/render/contributions/star-contribution-render.js +8 -0
  270. package/es/render/contributions/render/contributions/star-contribution-render.js.map +1 -0
  271. package/es/render/contributions/render/line-render.js +1 -1
  272. package/es/render/contributions/render/line-render.js.map +1 -1
  273. package/es/render/contributions/render/star-module.d.ts +2 -0
  274. package/es/render/contributions/render/star-module.js +13 -0
  275. package/es/render/contributions/render/star-module.js.map +1 -0
  276. package/es/render/contributions/render/star-render.d.ts +10 -0
  277. package/es/render/contributions/render/star-render.js +59 -0
  278. package/es/render/contributions/render/star-render.js.map +1 -0
  279. package/es/render/contributions/render/symbol.d.ts +1 -0
  280. package/es/render/contributions/render/symbol.js +2 -0
  281. package/es/render/contributions/render/symbol.js.map +1 -1
  282. package/es/render/render-service.d.ts +1 -1
  283. package/es/render/render-service.js.map +1 -1
  284. package/package.json +4 -4
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/graphic/text.ts"],"names":[],"mappings":";;;AACA,6CAAwG;AACxG,yCAAoE;AACpE,qEAA4E;AAC5E,gDAA6C;AAE7C,uCAAiF;AACjF,mCAAmC;AACnC,2CAAsD;AACtD,2CAA+C;AAC/C,mCAAqE;AAErE,MAAM,mBAAmB,GAAG;IAC1B,MAAM;IACN,cAAc;IACd,UAAU;IAEV,WAAW;IACX,cAAc;IACd,aAAa;IACb,WAAW;IACX,UAAU;IACV,YAAY;IACZ,YAAY;IACZ,UAAU;IACV,YAAY;IACZ,WAAW;IACX,WAAW;IACX,aAAa;IACb,WAAW;IACX,GAAG,gCAAsB;CAC1B,CAAC;AAEF,MAAa,IAAK,SAAQ,iBAA8B;IAsBtD,IAAI,IAAI;QACN,MAAM,SAAS,GAAG,IAAI,CAAC,eAAe,EAAE,CAAC;QACzC,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE;YACf,IAAI,CAAC,KAAK,GAAG,IAAA,uBAAc,EAAC,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;SACxD;QACD,OAAO,IAAI,CAAC,KAAe,CAAC;IAC9B,CAAC;IAED,IAAI,UAAU;;QACZ,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;QACjC,MAAM,SAAS,GAAG,IAAI,CAAC,eAAe,EAAE,CAAC;QACzC,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;QAC7C,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE;YAC9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CAAC;AAGJ,SAAgB,UAAU,CAAC,UAAiC;IAC1D,OAAO,IAAI,IAAI,CAAC,UAAU,CAAC,CAAC;AAC9B,CAAC;AAFD,gCAEC","file":"text.js","sourcesContent":["import type { IAABBBounds, IOBBBounds } from '@visactor/vutils';\nimport { max, isArray, getContextFont, transformBoundsWithMatrix, rotatePoint } from '@visactor/vutils';\nimport { textDrawOffsetX, textLayoutOffsetY } from '../common/text';\nimport { CanvasTextLayout } from '../core/contributions/textMeasure/layout';\nimport { application } from '../application';\nimport type { IText, ITextCache, ITextGraphicAttribute, LayoutItemType, LayoutType } from '../interface';\nimport { Graphic, GRAPHIC_UPDATE_TAG_KEY, NOWORK_ANIMATE_ATTR } from './graphic';\nimport { getTheme } from './theme';\nimport { calculateLineHeight } from '../common/utils';\nimport { TEXT_NUMBER_TYPE } from './constants';\nimport { boundStroke, TextDirection, verticalLayout } from './tools';\n\nconst TEXT_UPDATE_TAG_KEY = [\n 'text',\n 'maxLineWidth',\n 'maxWidth',\n // 多行文本要用到\n 'textAlign',\n 'textBaseline',\n 'heightLimit',\n 'lineClamp',\n 'fontSize',\n 'fontFamily',\n 'fontWeight',\n 'ellipsis',\n 'lineHeight',\n 'direction',\n 'wordBreak',\n 'heightLimit',\n 'lineClamp',\n ...GRAPHIC_UPDATE_TAG_KEY\n];\n\nexport class Text extends Graphic<ITextGraphicAttribute> implements IText {\n type: 'text' = 'text';\n\n static NOWORK_ANIMATE_ATTR = {\n ellipsis: 1,\n wordBreak: 1,\n direction: 1,\n textAlign: 1,\n textBaseline: 1,\n fontFamily: 1,\n fontWeight: 1,\n ...NOWORK_ANIMATE_ATTR\n };\n\n cache: ITextCache;\n _font: string;\n\n protected declare obbText?: Text;\n\n /**\n * 获取font字符串\n */\n get font(): string {\n const textTheme = this.getGraphicTheme();\n if (!this._font) {\n this._font = getContextFont(this.attribute, textTheme);\n }\n return this._font as string;\n }\n\n get clipedText(): string | undefined {\n const attribute = this.attribute;\n const textTheme = this.getGraphicTheme();\n const maxWidth = this.getMaxWidth(textTheme);\n if (!Number.isFinite(maxWidth)) {\n return (attribute.text ?? textTheme.text).toString();\n }\n this.tryUpdateAABBBounds();\n return this.cache.clipedText;\n }\n\n get clipedWidth(): number | undefined {\n this.tryUpdateAABBBounds();\n return this.cache.clipedWidth;\n }\n\n /**\n * 支持单行文本,横排纵排均支持\n * TODO 支持多行文本\n */\n get cliped(): boolean | undefined {\n const textTheme = this.getGraphicTheme();\n const attribute = this.attribute;\n const maxWidth = this.getMaxWidth(textTheme);\n if (!Number.isFinite(maxWidth)) {\n return false;\n }\n const { text } = this.attribute;\n this.tryUpdateAABBBounds();\n if (this.cache?.layoutData?.lines) {\n let mergedText = '';\n this.cache.layoutData.lines.forEach(item => {\n mergedText += item.str;\n });\n const originText = Array.isArray(text) ? text.join('') : text;\n\n return originText !== mergedText;\n }\n if (attribute.direction === 'vertical' && this.cache.verticalList && this.cache.verticalList[0]) {\n return this.cache.verticalList[0].map(item => item.text).join('') !== attribute.text.toString();\n }\n if (this.clipedText == null) {\n return false;\n }\n return this.clipedText !== attribute.text.toString();\n }\n\n get multilineLayout(): LayoutType | undefined {\n this.tryUpdateAABBBounds();\n return this.cache.layoutData;\n }\n /**\n * 是否是多行文本\n */\n get isMultiLine(): boolean {\n return Array.isArray(this.attribute.text) || this.attribute.whiteSpace === 'normal';\n }\n\n constructor(params: ITextGraphicAttribute = { text: '', fontSize: 16 }) {\n super(params);\n this.numberType = TEXT_NUMBER_TYPE;\n this.cache = {};\n }\n\n /**\n * 图元属性合法,且文字不为空或者null/undefined\n * @returns\n */\n isValid(): boolean {\n return super.isValid() && this._isValid();\n }\n\n protected _isValid(): boolean {\n const { text } = this.attribute;\n if (isArray(text)) {\n return !(text as any[]).every((t: any) => t == null || t === '');\n }\n return text != null && text !== '';\n }\n\n getGraphicTheme(): Required<ITextGraphicAttribute> {\n return getTheme(this).text;\n }\n\n protected doUpdateOBBBounds(): IOBBBounds {\n const graphicTheme = this.getGraphicTheme();\n this._OBBBounds.clear();\n const attribute = this.attribute;\n const { angle = graphicTheme.angle } = attribute;\n if (!angle) {\n const b = this.AABBBounds;\n this._OBBBounds.setValue(b.x1, b.y1, b.x2, b.y2);\n return this._OBBBounds;\n }\n if (!this.obbText) {\n this.obbText = new Text({});\n }\n this.obbText.setAttributes({ ...attribute, angle: 0 });\n const bounds1 = this.obbText.AABBBounds;\n const { x, y } = attribute;\n const boundsCenter = { x: (bounds1.x1 + bounds1.x2) / 2, y: (bounds1.y1 + bounds1.y2) / 2 };\n const center = rotatePoint(boundsCenter, angle, { x, y });\n this._OBBBounds.copy(bounds1);\n this._OBBBounds.translate(center.x - boundsCenter.x, center.y - boundsCenter.y);\n this._OBBBounds.angle = angle;\n return this._OBBBounds;\n }\n\n protected updateAABBBounds(\n attribute: ITextGraphicAttribute,\n textTheme: Required<ITextGraphicAttribute>,\n aabbBounds: IAABBBounds\n ) {\n const { text = textTheme.text } = this.attribute;\n if (Array.isArray(text)) {\n this.updateMultilineAABBBounds(text as (number | string)[]);\n } else {\n this.updateSingallineAABBBounds(text as number | string);\n }\n\n const { tb1 } = application.graphicService.updateTempAABBBounds(aabbBounds);\n\n const {\n scaleX = textTheme.scaleX,\n scaleY = textTheme.scaleY,\n shadowBlur = textTheme.shadowBlur,\n strokeBoundsBuffer = textTheme.strokeBoundsBuffer\n } = attribute;\n if (shadowBlur) {\n const shadowBlurHalfWidth = shadowBlur / Math.abs(scaleX + scaleY);\n boundStroke(tb1, shadowBlurHalfWidth, true, strokeBoundsBuffer);\n aabbBounds.union(tb1);\n }\n // 合并shadowRoot的bounds\n application.graphicService.combindShadowAABBBounds(aabbBounds, this);\n\n if (attribute.forceBoundsHeight != null || attribute.forceBoundsWidth != null) {\n application.graphicService.updateHTMLTextAABBBounds(attribute, textTheme, aabbBounds);\n }\n\n transformBoundsWithMatrix(aabbBounds, aabbBounds, this.transMatrix);\n return aabbBounds;\n }\n\n /**\n * 计算单行文字的bounds,可以缓存长度以及截取的文字\n * @param text\n */\n updateSingallineAABBBounds(text: number | string): IAABBBounds {\n this.updateMultilineAABBBounds([text]);\n const layoutData = this.cache.layoutData;\n if (layoutData && layoutData.lines && layoutData.lines.length) {\n const line = layoutData.lines[0];\n this.cache.clipedText = line.str;\n this.cache.clipedWidth = line.width;\n }\n return this._AABBBounds;\n }\n\n /**\n * 计算单行文字的bounds,可以缓存长度以及截取的文字\n * @param text\n */\n protected updateMultilineAABBBounds(text: (number | string)[]): IAABBBounds {\n const textTheme = this.getGraphicTheme();\n const { direction = textTheme.direction, underlineOffset = textTheme.underlineOffset } = this.attribute;\n\n const b =\n direction === 'horizontal'\n ? this.updateHorizontalMultilineAABBBounds(text)\n : this.updateVerticalMultilineAABBBounds(text);\n\n if (direction === 'horizontal') {\n if (underlineOffset) {\n this._AABBBounds.add(this._AABBBounds.x1, this._AABBBounds.y2 + underlineOffset);\n }\n }\n return b;\n }\n\n guessLineHeightBuf(fontSize: number) {\n return fontSize ? fontSize * 0.1 : 0;\n }\n\n /**\n * 计算多行文字的bounds,缓存每行文字的布局位置\n * @param text\n */\n updateHorizontalMultilineAABBBounds(text: (number | string)[]): IAABBBounds {\n const textTheme = this.getGraphicTheme();\n\n const attribute = this.attribute;\n const {\n fontFamily = textTheme.fontFamily,\n textAlign = textTheme.textAlign,\n textBaseline = textTheme.textBaseline,\n fontSize = textTheme.fontSize,\n fontWeight = textTheme.fontWeight,\n ellipsis = textTheme.ellipsis,\n maxLineWidth,\n stroke = textTheme.stroke,\n wrap = textTheme.wrap,\n measureMode = textTheme.measureMode,\n lineWidth = textTheme.lineWidth,\n whiteSpace = textTheme.whiteSpace,\n suffixPosition = textTheme.suffixPosition,\n ignoreBuf = textTheme.ignoreBuf,\n keepCenterInLine = textTheme.keepCenterInLine\n } = attribute;\n\n const buf = ignoreBuf ? 0 : this.guessLineHeightBuf(fontSize);\n const lineHeight = this.getLineHeight(attribute, textTheme, buf);\n\n if (whiteSpace === 'normal' || wrap) {\n return this.updateWrapAABBBounds(text);\n }\n if (!this.shouldUpdateShape() && this.cache?.layoutData) {\n const bbox = this.cache.layoutData.bbox;\n this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height);\n if (stroke) {\n this._AABBBounds.expand(lineWidth / 2);\n }\n return this._AABBBounds;\n }\n const textMeasure = application.graphicUtil.textMeasure;\n const layoutObj = new CanvasTextLayout(fontFamily, { fontSize, fontWeight, fontFamily, lineHeight }, textMeasure);\n const layoutData = layoutObj.GetLayoutByLines(\n text,\n textAlign,\n textBaseline as any,\n lineHeight,\n ellipsis === true ? (textTheme.ellipsis as string) : ellipsis || undefined,\n false,\n {\n lineWidth: maxLineWidth,\n suffixPosition,\n measureMode,\n keepCenterInLine\n }\n );\n const { bbox } = layoutData;\n this.cache.layoutData = layoutData;\n this.clearUpdateShapeTag();\n\n this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height);\n\n if (stroke) {\n this._AABBBounds.expand(lineWidth / 2);\n }\n\n return this._AABBBounds;\n }\n\n /**\n * 计算多行文字的bounds,缓存每行文字的布局位置\n * 自动折行params.text是数组,因此只重新updateMultilineAABBBounds\n * @param text\n */\n updateWrapAABBBounds(text: (number | string) | (number | string)[]) {\n const textTheme = this.getGraphicTheme();\n const {\n fontFamily = textTheme.fontFamily,\n textAlign = textTheme.textAlign,\n textBaseline = textTheme.textBaseline,\n fontSize = textTheme.fontSize,\n ellipsis = textTheme.ellipsis,\n maxLineWidth,\n stroke = textTheme.stroke,\n lineWidth = textTheme.lineWidth,\n wordBreak = textTheme.wordBreak,\n fontWeight = textTheme.fontWeight,\n // widthLimit,\n ignoreBuf = textTheme.ignoreBuf,\n measureMode = textTheme.measureMode,\n suffixPosition = textTheme.suffixPosition,\n heightLimit = 0,\n lineClamp,\n keepCenterInLine = textTheme.keepCenterInLine\n } = this.attribute;\n\n const buf = ignoreBuf ? 0 : this.guessLineHeightBuf(fontSize);\n const lineHeight = this.getLineHeight(this.attribute, textTheme, buf);\n\n if (!this.shouldUpdateShape() && this.cache?.layoutData) {\n const bbox = this.cache.layoutData.bbox;\n this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height);\n if (stroke) {\n this._AABBBounds.expand(lineWidth / 2);\n }\n return this._AABBBounds;\n }\n\n const textMeasure = application.graphicUtil.textMeasure;\n const textOptions = { fontSize, fontWeight, fontFamily, lineHeight };\n const layoutObj = new CanvasTextLayout(fontFamily, textOptions, textMeasure as any);\n\n // layoutObj内逻辑\n const lines = isArray(text) ? (text.map(l => l.toString()) as string[]) : [text.toString()];\n const linesLayout: LayoutItemType[] = [];\n const bboxWH: [number, number] = [0, 0];\n\n let lineCountLimit = Infinity;\n if (heightLimit > 0) {\n lineCountLimit = Math.max(Math.floor(heightLimit / lineHeight), 1);\n }\n if (lineClamp) {\n // 处理行数限制\n lineCountLimit = Math.min(lineCountLimit, lineClamp);\n }\n\n if (typeof maxLineWidth === 'number' && maxLineWidth !== Infinity) {\n // widthLimit > 0\n if (maxLineWidth > 0) {\n for (let i = 0; i < lines.length; i++) {\n const str = lines[i] as string;\n let needCut = true;\n\n // 判断是否超过高度限制\n if (i === lineCountLimit - 1) {\n // 当前行为最后一行,如果后面还有行,需要显示省略号\n const clip = textMeasure.clipTextWithSuffix(\n str,\n textOptions,\n maxLineWidth,\n ellipsis,\n false,\n suffixPosition,\n i !== lines.length - 1\n );\n const matrics = textMeasure.measureTextPixelADscentAndWidth(clip.str, textOptions, measureMode);\n linesLayout.push({\n str: clip.str,\n width: clip.width,\n ascent: matrics.ascent,\n descent: matrics.descent,\n keepCenterInLine\n });\n break; // 不处理后续行\n }\n\n // 测量截断位置\n const clip = textMeasure.clipText(\n str,\n textOptions,\n maxLineWidth,\n wordBreak !== 'break-all',\n wordBreak === 'keep-all'\n );\n if ((str !== '' && clip.str === '') || clip.wordBreaked) {\n if (ellipsis) {\n const clipEllipsis = textMeasure.clipTextWithSuffix(\n str,\n textOptions,\n maxLineWidth,\n ellipsis,\n false,\n suffixPosition\n );\n clip.str = clipEllipsis.str ?? '';\n clip.width = clipEllipsis.width ?? 0;\n } else {\n // 宽度限制不足一个字符,不显示\n clip.str = '';\n clip.width = 0;\n }\n needCut = false;\n }\n const matrics = textMeasure.measureTextPixelADscentAndWidth(clip.str, textOptions, measureMode);\n linesLayout.push({\n str: clip.str,\n width: clip.width,\n ascent: matrics.ascent,\n descent: matrics.descent,\n keepCenterInLine\n });\n let cutLength = clip.str.length;\n if (clip.wordBreaked && !(str !== '' && clip.str === '')) {\n needCut = true;\n cutLength = clip.wordBreaked;\n }\n if (clip.str.length === str.length) {\n // 不需要截断\n } else if (needCut) {\n let newStr = str.substring(cutLength);\n // 截断后,避免开头有空格很尬,去掉\n if (wordBreak === 'keep-all') {\n newStr = newStr.replace(/^\\s+/g, '');\n }\n lines.splice(i + 1, 0, newStr);\n }\n }\n }\n // bboxWH[0] = maxLineWidth;\n let maxWidth = 0;\n linesLayout.forEach(layout => {\n maxWidth = Math.max(maxWidth, layout.width);\n });\n bboxWH[0] = maxWidth;\n } else {\n // 使用所有行中最长的作为lineWidth\n let lineWidth = 0;\n let width: number;\n let text: string;\n for (let i = 0, len = lines.length; i < len; i++) {\n // 判断是否超过高度限制\n if (i === lineCountLimit - 1) {\n // 当前行为最后一行\n const clip = textMeasure.clipTextWithSuffix(\n lines[i],\n textOptions,\n maxLineWidth,\n ellipsis,\n false,\n suffixPosition\n );\n const matrics = textMeasure.measureTextPixelADscentAndWidth(clip.str, textOptions, measureMode);\n linesLayout.push({\n str: clip.str,\n width: clip.width,\n ascent: matrics.ascent,\n descent: matrics.descent,\n keepCenterInLine\n });\n lineWidth = Math.max(lineWidth, clip.width);\n break; // 不处理后续行\n }\n\n text = lines[i] as string;\n width = textMeasure.measureTextWidth(text, textOptions);\n lineWidth = Math.max(lineWidth, width);\n const matrics = textMeasure.measureTextPixelADscentAndWidth(text, textOptions, measureMode);\n linesLayout.push({ str: text, width, ascent: matrics.ascent, descent: matrics.descent, keepCenterInLine });\n }\n bboxWH[0] = lineWidth;\n }\n bboxWH[1] = linesLayout.length * lineHeight;\n\n const bbox = {\n xOffset: 0,\n yOffset: 0,\n width: bboxWH[0],\n height: bboxWH[1]\n };\n\n layoutObj.LayoutBBox(bbox, textAlign, textBaseline as any, linesLayout);\n\n const layoutData = layoutObj.layoutWithBBox(bbox, linesLayout, textAlign, textBaseline as any, lineHeight);\n\n this.cache.layoutData = layoutData;\n this.clearUpdateShapeTag();\n this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height);\n\n if (stroke) {\n this._AABBBounds.expand(lineWidth / 2);\n }\n\n return this._AABBBounds;\n }\n\n /**\n * 计算垂直布局的多行文字的bounds,可以缓存长度以及截取的文字\n * @param text\n */\n updateVerticalMultilineAABBBounds(text: (number | string)[]): IAABBBounds {\n const textTheme = this.getGraphicTheme();\n const textMeasure = application.graphicUtil.textMeasure;\n let width: number;\n const attribute = this.attribute;\n const {\n maxLineWidth = textTheme.maxLineWidth,\n ellipsis = textTheme.ellipsis,\n fontFamily = textTheme.fontFamily,\n fontSize = textTheme.fontSize,\n fontWeight = textTheme.fontWeight,\n stroke = textTheme.stroke,\n lineWidth = textTheme.lineWidth,\n // wordBreak = textTheme.wordBreak,\n verticalMode = textTheme.verticalMode,\n suffixPosition = textTheme.suffixPosition\n } = attribute;\n\n const lineHeight = this.getLineHeight(attribute, textTheme, 0);\n\n let { textAlign = textTheme.textAlign, textBaseline = textTheme.textBaseline } = attribute;\n if (!verticalMode) {\n const t = textAlign;\n textAlign = (Text.baselineMapAlign as any)[textBaseline] ?? 'left';\n textBaseline = (Text.alignMapBaseline as any)[t] ?? 'top';\n }\n width = 0;\n if (!this.shouldUpdateShape() && this.cache) {\n this.cache.verticalList.forEach(item => {\n const w = item.reduce((a, b) => a + b.width, 0);\n width = max(w, width);\n });\n const dx = textDrawOffsetX(textAlign, width);\n const height = this.cache.verticalList.length * lineHeight;\n const dy = textLayoutOffsetY(textBaseline, height, fontSize);\n this._AABBBounds.set(dy, dx, dy + height, dx + width);\n if (stroke) {\n this._AABBBounds.expand(lineWidth / 2);\n }\n return this._AABBBounds;\n }\n\n const verticalLists: { text: string; width?: number; direction: TextDirection }[][] = text.map(str => {\n return verticalLayout(str.toString());\n });\n verticalLists.forEach((verticalData, i) => {\n if (Number.isFinite(maxLineWidth)) {\n if (ellipsis) {\n const strEllipsis = (ellipsis === true ? textTheme.ellipsis : ellipsis) as string;\n const data = textMeasure.clipTextWithSuffixVertical(\n verticalData,\n { fontSize, fontWeight, fontFamily },\n maxLineWidth,\n strEllipsis,\n false,\n suffixPosition\n );\n verticalLists[i] = data.verticalList;\n width = data.width;\n } else {\n const data = textMeasure.clipTextVertical(\n verticalData,\n { fontSize, fontWeight, fontFamily },\n maxLineWidth,\n false\n );\n verticalLists[i] = data.verticalList;\n width = data.width;\n }\n // this.cache.clipedWidth = width;\n // todo 计算原本的宽度\n } else {\n width = 0;\n verticalData.forEach(t => {\n const w =\n t.direction === TextDirection.HORIZONTAL\n ? fontSize\n : textMeasure.measureTextWidth(t.text, { fontSize, fontWeight, fontFamily });\n\n width += w;\n t.width = w;\n });\n }\n });\n this.cache.verticalList = verticalLists;\n this.clearUpdateShapeTag();\n\n this.cache.verticalList.forEach(item => {\n const w = item.reduce((a, b) => a + b.width, 0);\n width = max(w, width);\n });\n\n const dx = textDrawOffsetX(textAlign, width);\n const height = this.cache.verticalList.length * lineHeight;\n const dy = textLayoutOffsetY(textBaseline, height, fontSize);\n this._AABBBounds.set(dy, dx, dy + height, dx + width);\n\n if (stroke) {\n this._AABBBounds.expand(lineWidth / 2);\n }\n\n return this._AABBBounds;\n }\n\n // /**\n // * 是否是简单文字\n // * 单行,横排\n // * @returns\n // */\n // protected isSinglelineAndHorizontal(): boolean {\n // return !this.isMultiLine && this.attribute.direction !== 'vertical';\n // }\n\n protected getMaxWidth(theme: ITextGraphicAttribute): number {\n // 传入了maxLineWidth就优先使用,否则使用maxWidth\n const attribute = this.attribute;\n return attribute.maxLineWidth ?? attribute.maxWidth ?? theme.maxWidth;\n }\n\n protected getLineHeight(attribute: ITextGraphicAttribute, textTheme: ITextGraphicAttribute, buf: number) {\n return (\n calculateLineHeight(attribute.lineHeight, attribute.fontSize || textTheme.fontSize) ??\n (attribute.fontSize || textTheme.fontSize) + buf\n );\n }\n\n protected needUpdateTags(keys: string[], k = TEXT_UPDATE_TAG_KEY): boolean {\n return super.needUpdateTags(keys, k);\n }\n protected needUpdateTag(key: string, k = TEXT_UPDATE_TAG_KEY): boolean {\n return super.needUpdateTag(key, k);\n }\n\n protected _interpolate(key: string, ratio: number, lastStepVal: any, nextStepVal: any, nextAttributes: any) {\n if (key === 'text') {\n nextAttributes.text = nextStepVal;\n }\n }\n\n clone(): Text {\n return new Text({ ...this.attribute });\n }\n\n getNoWorkAnimateAttr(): Record<string, number> {\n return Text.NOWORK_ANIMATE_ATTR;\n }\n\n /**\n * 用于垂直布局时align和baseline相互转换\n * @returns\n */\n getBaselineMapAlign(): Record<string, string> {\n return Text.baselineMapAlign;\n }\n\n /**\n * 用于垂直布局时align和baseline相互转换\n * @returns\n */\n getAlignMapBaseline(): Record<string, string> {\n return Text.alignMapBaseline;\n }\n\n static baselineMapAlign = {\n top: 'left',\n bottom: 'right',\n middle: 'center'\n };\n\n static alignMapBaseline = {\n left: 'top',\n right: 'bottom',\n center: 'middle'\n };\n}\n\nexport function createText(attributes: ITextGraphicAttribute): IText {\n return new Text(attributes);\n}\n\n// addAttributeToPrototype(DefaultLineStyle, Text, PURE_STYLE_KEY);\n"]}
1
+ {"version":3,"sources":["../src/graphic/text.ts"],"names":[],"mappings":";;;AACA,6CAAwG;AACxG,yCAAoE;AACpE,qEAA4E;AAC5E,gDAA6C;AAE7C,uCAAiF;AACjF,mCAAmC;AACnC,2CAAsD;AACtD,2CAA+C;AAC/C,mCAAqE;AAErE,MAAM,mBAAmB,GAAG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Aa,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;IACrC,CAAC;IAES,YAAY,CAAC,GAAW,EAAE,KAAa,EAAE,WAAgB,EAAE,WAAgB,EAAE,cAAmB;QACxG,IAAI,GAAG,KAAK,MAAM,EAAE;YAClB,cAAc,CAAC,IAAI,GAAG,WAAW,CAAC;SACnC;IACH,CAAC;IAED,KAAK;QACH,OAAO,IAAI,IAAI,mBAAM,IAAI,CAAC,SAAS,EAAG,CAAC;IACzC,CAAC;IAED,oBAAoB;QAClB,OAAO,IAAI,CAAC,mBAAmB,CAAC;IAClC,CAAC;IAMD,mBAAmB;QACjB,OAAO,IAAI,CAAC,gBAAgB,CAAC;IAC/B,CAAC;IAMD,mBAAmB;QACjB,OAAO,IAAI,CAAC,gBAAgB,CAAC;IAC/B,CAAC;;AAjpBH,oBA8pBC;AA3pBQ,wBAAmB,mBACxB,QAAQ,EAAE,CAAC,EACX,SAAS,EAAE,CAAC,EACZ,SAAS,EAAE,CAAC,EACZ,SAAS,EAAE,CAAC,EACZ,YAAY,EAAE,CAAC,EACf,UAAU,EAAE,CAAC,EACb,UAAU,EAAE,CAAC,IACV,6BAAmB,EACtB;AAuoBK,qBAAgB,GAAG;IACxB,GAAG,EAAE,MAAM;IACX,MAAM,EAAE,OAAO;IACf,MAAM,EAAE,QAAQ;CACjB,CAAC;AAEK,qBAAgB,GAAG;IACxB,IAAI,EAAE,KAAK;IACX,KAAK,EAAE,QAAQ;IACf,MAAM,EAAE,QAAQ;CACjB,CAAC;AAGJ,SAAgB,UAAU,CAAC,UAAiC;IAC1D,OAAO,IAAI,IAAI,CAAC,UAAU,CAAC,CAAC;AAC9B,CAAC;AAFD,gCAEC","file":"text.js","sourcesContent":["import type { IAABBBounds, IOBBBounds } from '@visactor/vutils';\nimport { max, isArray, getContextFont, transformBoundsWithMatrix, rotatePoint } from '@visactor/vutils';\nimport { textDrawOffsetX, textLayoutOffsetY } from '../common/text';\nimport { CanvasTextLayout } from '../core/contributions/textMeasure/layout';\nimport { application } from '../application';\nimport type { IText, ITextCache, ITextGraphicAttribute, LayoutItemType, LayoutType } from '../interface';\nimport { Graphic, GRAPHIC_UPDATE_TAG_KEY, NOWORK_ANIMATE_ATTR } from './graphic';\nimport { getTheme } from './theme';\nimport { calculateLineHeight } from '../common/utils';\nimport { TEXT_NUMBER_TYPE } from './constants';\nimport { boundStroke, TextDirection, verticalLayout } from './tools';\n\nconst TEXT_UPDATE_TAG_KEY = [\n 'text',\n 'maxLineWidth',\n 'maxWidth',\n // 多行文本要用到\n 'textAlign',\n 'textBaseline',\n 'heightLimit',\n 'lineClamp',\n 'fontSize',\n 'fontFamily',\n 'fontWeight',\n 'ellipsis',\n 'lineHeight',\n 'direction',\n 'wordBreak',\n 'heightLimit',\n 'lineClamp',\n ...GRAPHIC_UPDATE_TAG_KEY\n];\n\nexport class Text extends Graphic<ITextGraphicAttribute> implements IText {\n type: 'text' = 'text';\n\n static NOWORK_ANIMATE_ATTR = {\n ellipsis: 1,\n wordBreak: 1,\n direction: 1,\n textAlign: 1,\n textBaseline: 1,\n fontFamily: 1,\n fontWeight: 1,\n ...NOWORK_ANIMATE_ATTR\n };\n\n cache: ITextCache;\n _font: string;\n\n protected declare obbText?: Text;\n\n /**\n * 获取font字符串\n */\n get font(): string {\n const textTheme = this.getGraphicTheme();\n if (!this._font) {\n this._font = getContextFont(this.attribute, textTheme);\n }\n return this._font as string;\n }\n\n get clipedText(): string | undefined {\n const attribute = this.attribute;\n const textTheme = this.getGraphicTheme();\n const maxWidth = this.getMaxWidth(textTheme);\n if (!Number.isFinite(maxWidth)) {\n return (attribute.text ?? textTheme.text).toString();\n }\n this.tryUpdateAABBBounds();\n return this.cache.clipedText;\n }\n\n get clipedWidth(): number | undefined {\n this.tryUpdateAABBBounds();\n return this.cache.clipedWidth;\n }\n\n /**\n * 支持单行文本,横排纵排均支持\n * TODO 支持多行文本\n */\n get cliped(): boolean | undefined {\n const textTheme = this.getGraphicTheme();\n const attribute = this.attribute;\n const maxWidth = this.getMaxWidth(textTheme);\n if (!Number.isFinite(maxWidth)) {\n return false;\n }\n const { text } = this.attribute;\n this.tryUpdateAABBBounds();\n if (this.cache?.layoutData?.lines) {\n let mergedText = '';\n this.cache.layoutData.lines.forEach(item => {\n mergedText += item.str;\n });\n const originText = Array.isArray(text) ? text.join('') : text;\n\n return originText !== mergedText;\n }\n if (attribute.direction === 'vertical' && this.cache.verticalList && this.cache.verticalList[0]) {\n return this.cache.verticalList[0].map(item => item.text).join('') !== attribute.text.toString();\n }\n if (this.clipedText == null) {\n return false;\n }\n return this.clipedText !== attribute.text.toString();\n }\n\n get multilineLayout(): LayoutType | undefined {\n this.tryUpdateAABBBounds();\n return this.cache.layoutData;\n }\n /**\n * 是否是多行文本\n */\n get isMultiLine(): boolean {\n return Array.isArray(this.attribute.text) || this.attribute.whiteSpace === 'normal';\n }\n\n constructor(params: ITextGraphicAttribute = { text: '', fontSize: 16 }) {\n super(params);\n this.numberType = TEXT_NUMBER_TYPE;\n this.cache = {};\n }\n\n /**\n * 图元属性合法,且文字不为空或者null/undefined\n * @returns\n */\n isValid(): boolean {\n return super.isValid() && this._isValid();\n }\n\n protected _isValid(): boolean {\n const { text } = this.attribute;\n if (isArray(text)) {\n return !(text as any[]).every((t: any) => t == null || t === '');\n }\n return text != null && text !== '';\n }\n\n getGraphicTheme(): Required<ITextGraphicAttribute> {\n return getTheme(this).text;\n }\n\n protected doUpdateOBBBounds(): IOBBBounds {\n const graphicTheme = this.getGraphicTheme();\n this._OBBBounds.clear();\n const attribute = this.attribute;\n const { angle = graphicTheme.angle } = attribute;\n if (!angle) {\n const b = this.AABBBounds;\n this._OBBBounds.setValue(b.x1, b.y1, b.x2, b.y2);\n return this._OBBBounds;\n }\n if (!this.obbText) {\n this.obbText = new Text({});\n }\n this.obbText.setAttributes({ ...attribute, angle: 0 });\n const bounds1 = this.obbText.AABBBounds;\n const { x, y } = attribute;\n const boundsCenter = { x: (bounds1.x1 + bounds1.x2) / 2, y: (bounds1.y1 + bounds1.y2) / 2 };\n const center = rotatePoint(boundsCenter, angle, { x, y });\n this._OBBBounds.copy(bounds1);\n this._OBBBounds.translate(center.x - boundsCenter.x, center.y - boundsCenter.y);\n this._OBBBounds.angle = angle;\n return this._OBBBounds;\n }\n\n protected updateAABBBounds(\n attribute: ITextGraphicAttribute,\n textTheme: Required<ITextGraphicAttribute>,\n aabbBounds: IAABBBounds\n ) {\n const { text = textTheme.text } = this.attribute;\n if (Array.isArray(text)) {\n this.updateMultilineAABBBounds(text as (number | string)[]);\n } else {\n this.updateSingallineAABBBounds(text as number | string);\n }\n\n const { tb1 } = application.graphicService.updateTempAABBBounds(aabbBounds);\n\n const {\n scaleX = textTheme.scaleX,\n scaleY = textTheme.scaleY,\n shadowBlur = textTheme.shadowBlur,\n strokeBoundsBuffer = textTheme.strokeBoundsBuffer\n } = attribute;\n if (shadowBlur) {\n const shadowBlurHalfWidth = shadowBlur / Math.abs(scaleX + scaleY);\n boundStroke(tb1, shadowBlurHalfWidth, true, strokeBoundsBuffer);\n aabbBounds.union(tb1);\n }\n // 合并shadowRoot的bounds\n application.graphicService.combindShadowAABBBounds(aabbBounds, this);\n\n if (attribute.forceBoundsHeight != null || attribute.forceBoundsWidth != null) {\n application.graphicService.updateHTMLTextAABBBounds(attribute, textTheme, aabbBounds);\n }\n\n this.widthWithoutTransform = aabbBounds.x2 - aabbBounds.x1;\n this.heightWithoutTransform = aabbBounds.y2 - aabbBounds.y1;\n\n transformBoundsWithMatrix(aabbBounds, aabbBounds, this.transMatrix);\n return aabbBounds;\n }\n\n /**\n * 计算单行文字的bounds,可以缓存长度以及截取的文字\n * @param text\n */\n updateSingallineAABBBounds(text: number | string): IAABBBounds {\n this.updateMultilineAABBBounds([text]);\n const layoutData = this.cache.layoutData;\n if (layoutData && layoutData.lines && layoutData.lines.length) {\n const line = layoutData.lines[0];\n this.cache.clipedText = line.str;\n this.cache.clipedWidth = line.width;\n }\n return this._AABBBounds;\n }\n\n /**\n * 计算单行文字的bounds,可以缓存长度以及截取的文字\n * @param text\n */\n protected updateMultilineAABBBounds(text: (number | string)[]): IAABBBounds {\n const textTheme = this.getGraphicTheme();\n const { direction = textTheme.direction, underlineOffset = textTheme.underlineOffset } = this.attribute;\n\n const b =\n direction === 'horizontal'\n ? this.updateHorizontalMultilineAABBBounds(text)\n : this.updateVerticalMultilineAABBBounds(text);\n\n if (direction === 'horizontal') {\n if (underlineOffset) {\n this._AABBBounds.add(this._AABBBounds.x1, this._AABBBounds.y2 + underlineOffset);\n }\n }\n return b;\n }\n\n guessLineHeightBuf(fontSize: number) {\n return fontSize ? fontSize * 0.1 : 0;\n }\n\n /**\n * 计算多行文字的bounds,缓存每行文字的布局位置\n * @param text\n */\n updateHorizontalMultilineAABBBounds(text: (number | string)[]): IAABBBounds {\n const textTheme = this.getGraphicTheme();\n\n const attribute = this.attribute;\n const {\n fontFamily = textTheme.fontFamily,\n textAlign = textTheme.textAlign,\n textBaseline = textTheme.textBaseline,\n fontSize = textTheme.fontSize,\n fontWeight = textTheme.fontWeight,\n ellipsis = textTheme.ellipsis,\n maxLineWidth,\n stroke = textTheme.stroke,\n wrap = textTheme.wrap,\n measureMode = textTheme.measureMode,\n lineWidth = textTheme.lineWidth,\n whiteSpace = textTheme.whiteSpace,\n suffixPosition = textTheme.suffixPosition,\n ignoreBuf = textTheme.ignoreBuf,\n keepCenterInLine = textTheme.keepCenterInLine\n } = attribute;\n\n const buf = ignoreBuf ? 0 : this.guessLineHeightBuf(fontSize);\n const lineHeight = this.getLineHeight(attribute, textTheme, buf);\n\n if (whiteSpace === 'normal' || wrap) {\n return this.updateWrapAABBBounds(text);\n }\n if (!this.shouldUpdateShape() && this.cache?.layoutData) {\n const bbox = this.cache.layoutData.bbox;\n this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height);\n if (stroke) {\n this._AABBBounds.expand(lineWidth / 2);\n }\n return this._AABBBounds;\n }\n const textMeasure = application.graphicUtil.textMeasure;\n const layoutObj = new CanvasTextLayout(fontFamily, { fontSize, fontWeight, fontFamily, lineHeight }, textMeasure);\n const layoutData = layoutObj.GetLayoutByLines(\n text,\n textAlign,\n textBaseline as any,\n lineHeight,\n ellipsis === true ? (textTheme.ellipsis as string) : ellipsis || undefined,\n false,\n {\n lineWidth: maxLineWidth,\n suffixPosition,\n measureMode,\n keepCenterInLine\n }\n );\n const { bbox } = layoutData;\n this.cache.layoutData = layoutData;\n this.clearUpdateShapeTag();\n\n this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height);\n\n if (stroke) {\n this._AABBBounds.expand(lineWidth / 2);\n }\n\n return this._AABBBounds;\n }\n\n /**\n * 计算多行文字的bounds,缓存每行文字的布局位置\n * 自动折行params.text是数组,因此只重新updateMultilineAABBBounds\n * @param text\n */\n updateWrapAABBBounds(text: (number | string) | (number | string)[]) {\n const textTheme = this.getGraphicTheme();\n const {\n fontFamily = textTheme.fontFamily,\n textAlign = textTheme.textAlign,\n textBaseline = textTheme.textBaseline,\n fontSize = textTheme.fontSize,\n ellipsis = textTheme.ellipsis,\n maxLineWidth,\n stroke = textTheme.stroke,\n lineWidth = textTheme.lineWidth,\n wordBreak = textTheme.wordBreak,\n fontWeight = textTheme.fontWeight,\n // widthLimit,\n ignoreBuf = textTheme.ignoreBuf,\n measureMode = textTheme.measureMode,\n suffixPosition = textTheme.suffixPosition,\n heightLimit = 0,\n lineClamp,\n keepCenterInLine = textTheme.keepCenterInLine\n } = this.attribute;\n\n const buf = ignoreBuf ? 0 : this.guessLineHeightBuf(fontSize);\n const lineHeight = this.getLineHeight(this.attribute, textTheme, buf);\n\n if (!this.shouldUpdateShape() && this.cache?.layoutData) {\n const bbox = this.cache.layoutData.bbox;\n this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height);\n if (stroke) {\n this._AABBBounds.expand(lineWidth / 2);\n }\n return this._AABBBounds;\n }\n\n const textMeasure = application.graphicUtil.textMeasure;\n const textOptions = { fontSize, fontWeight, fontFamily, lineHeight };\n const layoutObj = new CanvasTextLayout(fontFamily, textOptions, textMeasure as any);\n\n // layoutObj内逻辑\n const lines = isArray(text) ? (text.map(l => l.toString()) as string[]) : [text.toString()];\n const linesLayout: LayoutItemType[] = [];\n const bboxWH: [number, number] = [0, 0];\n\n let lineCountLimit = Infinity;\n if (heightLimit > 0) {\n lineCountLimit = Math.max(Math.floor(heightLimit / lineHeight), 1);\n }\n if (lineClamp) {\n // 处理行数限制\n lineCountLimit = Math.min(lineCountLimit, lineClamp);\n }\n\n if (typeof maxLineWidth === 'number' && maxLineWidth !== Infinity) {\n // widthLimit > 0\n if (maxLineWidth > 0) {\n for (let i = 0; i < lines.length; i++) {\n const str = lines[i] as string;\n let needCut = true;\n\n // 判断是否超过高度限制\n if (i === lineCountLimit - 1) {\n // 当前行为最后一行,如果后面还有行,需要显示省略号\n const clip = textMeasure.clipTextWithSuffix(\n str,\n textOptions,\n maxLineWidth,\n ellipsis,\n false,\n suffixPosition,\n i !== lines.length - 1\n );\n const matrics = textMeasure.measureTextPixelADscentAndWidth(clip.str, textOptions, measureMode);\n linesLayout.push({\n str: clip.str,\n width: clip.width,\n ascent: matrics.ascent,\n descent: matrics.descent,\n keepCenterInLine\n });\n break; // 不处理后续行\n }\n\n // 测量截断位置\n const clip = textMeasure.clipText(\n str,\n textOptions,\n maxLineWidth,\n wordBreak !== 'break-all',\n wordBreak === 'keep-all'\n );\n if ((str !== '' && clip.str === '') || clip.wordBreaked) {\n if (ellipsis) {\n const clipEllipsis = textMeasure.clipTextWithSuffix(\n str,\n textOptions,\n maxLineWidth,\n ellipsis,\n false,\n suffixPosition\n );\n clip.str = clipEllipsis.str ?? '';\n clip.width = clipEllipsis.width ?? 0;\n } else {\n // 宽度限制不足一个字符,不显示\n clip.str = '';\n clip.width = 0;\n }\n needCut = false;\n }\n const matrics = textMeasure.measureTextPixelADscentAndWidth(clip.str, textOptions, measureMode);\n linesLayout.push({\n str: clip.str,\n width: clip.width,\n ascent: matrics.ascent,\n descent: matrics.descent,\n keepCenterInLine\n });\n let cutLength = clip.str.length;\n if (clip.wordBreaked && !(str !== '' && clip.str === '')) {\n needCut = true;\n cutLength = clip.wordBreaked;\n }\n if (clip.str.length === str.length) {\n // 不需要截断\n } else if (needCut) {\n let newStr = str.substring(cutLength);\n // 截断后,避免开头有空格很尬,去掉\n if (wordBreak === 'keep-all') {\n newStr = newStr.replace(/^\\s+/g, '');\n }\n lines.splice(i + 1, 0, newStr);\n }\n }\n }\n // bboxWH[0] = maxLineWidth;\n let maxWidth = 0;\n linesLayout.forEach(layout => {\n maxWidth = Math.max(maxWidth, layout.width);\n });\n bboxWH[0] = maxWidth;\n } else {\n // 使用所有行中最长的作为lineWidth\n let lineWidth = 0;\n let width: number;\n let text: string;\n for (let i = 0, len = lines.length; i < len; i++) {\n // 判断是否超过高度限制\n if (i === lineCountLimit - 1) {\n // 当前行为最后一行\n const clip = textMeasure.clipTextWithSuffix(\n lines[i],\n textOptions,\n maxLineWidth,\n ellipsis,\n false,\n suffixPosition\n );\n const matrics = textMeasure.measureTextPixelADscentAndWidth(clip.str, textOptions, measureMode);\n linesLayout.push({\n str: clip.str,\n width: clip.width,\n ascent: matrics.ascent,\n descent: matrics.descent,\n keepCenterInLine\n });\n lineWidth = Math.max(lineWidth, clip.width);\n break; // 不处理后续行\n }\n\n text = lines[i] as string;\n width = textMeasure.measureTextWidth(text, textOptions);\n lineWidth = Math.max(lineWidth, width);\n const matrics = textMeasure.measureTextPixelADscentAndWidth(text, textOptions, measureMode);\n linesLayout.push({ str: text, width, ascent: matrics.ascent, descent: matrics.descent, keepCenterInLine });\n }\n bboxWH[0] = lineWidth;\n }\n bboxWH[1] = linesLayout.length * lineHeight;\n\n const bbox = {\n xOffset: 0,\n yOffset: 0,\n width: bboxWH[0],\n height: bboxWH[1]\n };\n\n layoutObj.LayoutBBox(bbox, textAlign, textBaseline as any, linesLayout);\n\n const layoutData = layoutObj.layoutWithBBox(bbox, linesLayout, textAlign, textBaseline as any, lineHeight);\n\n this.cache.layoutData = layoutData;\n this.clearUpdateShapeTag();\n this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height);\n\n if (stroke) {\n this._AABBBounds.expand(lineWidth / 2);\n }\n\n return this._AABBBounds;\n }\n\n /**\n * 计算垂直布局的多行文字的bounds,可以缓存长度以及截取的文字\n * @param text\n */\n updateVerticalMultilineAABBBounds(text: (number | string)[]): IAABBBounds {\n const textTheme = this.getGraphicTheme();\n const textMeasure = application.graphicUtil.textMeasure;\n let width: number;\n const attribute = this.attribute;\n const {\n maxLineWidth = textTheme.maxLineWidth,\n ellipsis = textTheme.ellipsis,\n fontFamily = textTheme.fontFamily,\n fontSize = textTheme.fontSize,\n fontWeight = textTheme.fontWeight,\n stroke = textTheme.stroke,\n lineWidth = textTheme.lineWidth,\n // wordBreak = textTheme.wordBreak,\n verticalMode = textTheme.verticalMode,\n suffixPosition = textTheme.suffixPosition\n } = attribute;\n\n const lineHeight = this.getLineHeight(attribute, textTheme, 0);\n\n let { textAlign = textTheme.textAlign, textBaseline = textTheme.textBaseline } = attribute;\n if (!verticalMode) {\n const t = textAlign;\n textAlign = (Text.baselineMapAlign as any)[textBaseline] ?? 'left';\n textBaseline = (Text.alignMapBaseline as any)[t] ?? 'top';\n }\n width = 0;\n if (!this.shouldUpdateShape() && this.cache) {\n this.cache.verticalList.forEach(item => {\n const w = item.reduce((a, b) => a + b.width, 0);\n width = max(w, width);\n });\n const dx = textDrawOffsetX(textAlign, width);\n const height = this.cache.verticalList.length * lineHeight;\n const dy = textLayoutOffsetY(textBaseline, height, fontSize);\n this._AABBBounds.set(dy, dx, dy + height, dx + width);\n if (stroke) {\n this._AABBBounds.expand(lineWidth / 2);\n }\n return this._AABBBounds;\n }\n\n const verticalLists: { text: string; width?: number; direction: TextDirection }[][] = text.map(str => {\n return verticalLayout(str.toString());\n });\n verticalLists.forEach((verticalData, i) => {\n if (Number.isFinite(maxLineWidth)) {\n if (ellipsis) {\n const strEllipsis = (ellipsis === true ? textTheme.ellipsis : ellipsis) as string;\n const data = textMeasure.clipTextWithSuffixVertical(\n verticalData,\n { fontSize, fontWeight, fontFamily },\n maxLineWidth,\n strEllipsis,\n false,\n suffixPosition\n );\n verticalLists[i] = data.verticalList;\n width = data.width;\n } else {\n const data = textMeasure.clipTextVertical(\n verticalData,\n { fontSize, fontWeight, fontFamily },\n maxLineWidth,\n false\n );\n verticalLists[i] = data.verticalList;\n width = data.width;\n }\n // this.cache.clipedWidth = width;\n // todo 计算原本的宽度\n } else {\n width = 0;\n verticalData.forEach(t => {\n const w =\n t.direction === TextDirection.HORIZONTAL\n ? fontSize\n : textMeasure.measureTextWidth(t.text, { fontSize, fontWeight, fontFamily });\n\n width += w;\n t.width = w;\n });\n }\n });\n this.cache.verticalList = verticalLists;\n this.clearUpdateShapeTag();\n\n this.cache.verticalList.forEach(item => {\n const w = item.reduce((a, b) => a + b.width, 0);\n width = max(w, width);\n });\n\n const dx = textDrawOffsetX(textAlign, width);\n const height = this.cache.verticalList.length * lineHeight;\n const dy = textLayoutOffsetY(textBaseline, height, fontSize);\n this._AABBBounds.set(dy, dx, dy + height, dx + width);\n\n if (stroke) {\n this._AABBBounds.expand(lineWidth / 2);\n }\n\n return this._AABBBounds;\n }\n\n // /**\n // * 是否是简单文字\n // * 单行,横排\n // * @returns\n // */\n // protected isSinglelineAndHorizontal(): boolean {\n // return !this.isMultiLine && this.attribute.direction !== 'vertical';\n // }\n\n protected getMaxWidth(theme: ITextGraphicAttribute): number {\n // 传入了maxLineWidth就优先使用,否则使用maxWidth\n const attribute = this.attribute;\n return attribute.maxLineWidth ?? attribute.maxWidth ?? theme.maxWidth;\n }\n\n protected getLineHeight(attribute: ITextGraphicAttribute, textTheme: ITextGraphicAttribute, buf: number) {\n return (\n calculateLineHeight(attribute.lineHeight, attribute.fontSize || textTheme.fontSize) ??\n (attribute.fontSize || textTheme.fontSize) + buf\n );\n }\n\n protected needUpdateTags(keys: string[], k = TEXT_UPDATE_TAG_KEY): boolean {\n return super.needUpdateTags(keys, k);\n }\n protected needUpdateTag(key: string, k = TEXT_UPDATE_TAG_KEY): boolean {\n return super.needUpdateTag(key, k);\n }\n\n protected _interpolate(key: string, ratio: number, lastStepVal: any, nextStepVal: any, nextAttributes: any) {\n if (key === 'text') {\n nextAttributes.text = nextStepVal;\n }\n }\n\n clone(): Text {\n return new Text({ ...this.attribute });\n }\n\n getNoWorkAnimateAttr(): Record<string, number> {\n return Text.NOWORK_ANIMATE_ATTR;\n }\n\n /**\n * 用于垂直布局时align和baseline相互转换\n * @returns\n */\n getBaselineMapAlign(): Record<string, string> {\n return Text.baselineMapAlign;\n }\n\n /**\n * 用于垂直布局时align和baseline相互转换\n * @returns\n */\n getAlignMapBaseline(): Record<string, string> {\n return Text.alignMapBaseline;\n }\n\n static baselineMapAlign = {\n top: 'left',\n bottom: 'right',\n middle: 'center'\n };\n\n static alignMapBaseline = {\n left: 'top',\n right: 'bottom',\n center: 'middle'\n };\n}\n\nexport function createText(attributes: ITextGraphicAttribute): IText {\n return new Text(attributes);\n}\n\n// addAttributeToPrototype(DefaultLineStyle, Text, PURE_STYLE_KEY);\n"]}
@@ -14,6 +14,7 @@ const vutils_1 = require("@visactor/vutils"), config_1 = require("./config"), de
14
14
  text: config_1.DefaultTextAttribute,
15
15
  rect: config_1.DefaultRectAttribute,
16
16
  polygon: config_1.DefaultPolygonAttribute,
17
+ star: config_1.DefaultStarAttribute,
17
18
  richtext: config_1.DefaultRichTextAttribute,
18
19
  richtextIcon: config_1.DefaultRichTextIconAttribute,
19
20
  image: config_1.DefaultImageAttribute,
@@ -32,6 +33,7 @@ function newThemeObj() {
32
33
  text: Object.assign({}, defaultThemeObj.text),
33
34
  rect: Object.assign({}, defaultThemeObj.rect),
34
35
  polygon: Object.assign({}, defaultThemeObj.polygon),
36
+ star: Object.assign({}, defaultThemeObj.star),
35
37
  richtext: Object.assign({}, defaultThemeObj.richtext),
36
38
  richtextIcon: Object.assign({}, defaultThemeObj.richtextIcon),
37
39
  image: Object.assign({}, defaultThemeObj.image),
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/graphic/theme.ts"],"names":[],"mappings":";;;AAAA,6CAA0C;AAE1C,qCAekB;AAElB,MAAM,eAAe,GAAG;IACtB,GAAG,EAAE,4BAAmB;IACxB,IAAI,EAAE,6BAAoB;IAC1B,MAAM,EAAE,+BAAsB;IAC9B,IAAI,EAAE,6BAAoB;IAC1B,IAAI,EAAE,6BAAoB;IAC1B,MAAM,EAAE,+BAAsB;IAC9B,IAAI,EAAE,6BAAoB;IAC1B,IAAI,EAAE,6BAAoB;IAC1B,OAAO,EAAE,gCAAuB;IAChC,QAAQ,EAAE,iCAAwB;IAClC,YAAY,EAAE,qCAA4B;IAC1C,KAAK,EAAE,8BAAqB;IAC5B,KAAK,EAAE,8BAAqB;IAC5B,KAAK,EAAE,8BAAqB;CAC7B,CAAC;AAEF,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;AAE/C,SAAgB,WAAW;IACzB,OAAO;QACL,GAAG,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,eAAe,CAAC,GAAG,CAAC;QAC3C,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,eAAe,CAAC,IAAI,CAAC;QAC7C,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,eAAe,CAAC,MAAM,CAAC;QACjD,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,eAAe,CAAC,IAAI,CAAC;QAC7C,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,eAAe,CAAC,IAAI,CAAC;QAC7C,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,eAAe,CAAC,MAAM,CAAC;QACjD,IAAI,EAA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} from '@visactor/vutils';\nimport type { IFullThemeSpec, IGraphic, IGroup, ITheme, IThemeSpec } from '../interface';\nimport {\n DefaultArcAttribute,\n DefaultAreaAttribute,\n DefaultCircleAttribute,\n DefaultGlyphAttribute,\n DefaultGroupAttribute,\n DefaultImageAttribute,\n DefaultLineAttribute,\n DefaultPathAttribute,\n DefaultPolygonAttribute,\n DefaultRectAttribute,\n DefaultSymbolAttribute,\n DefaultTextAttribute,\n DefaultRichTextAttribute,\n DefaultRichTextIconAttribute\n} from './config';\n\nconst defaultThemeObj = {\n arc: DefaultArcAttribute,\n area: DefaultAreaAttribute,\n circle: DefaultCircleAttribute,\n line: DefaultLineAttribute,\n path: DefaultPathAttribute,\n symbol: DefaultSymbolAttribute,\n text: DefaultTextAttribute,\n rect: DefaultRectAttribute,\n polygon: DefaultPolygonAttribute,\n richtext: DefaultRichTextAttribute,\n richtextIcon: DefaultRichTextIconAttribute,\n image: DefaultImageAttribute,\n group: DefaultGroupAttribute,\n glyph: DefaultGlyphAttribute\n};\n\nconst themeKeys = Object.keys(defaultThemeObj);\n\nexport function newThemeObj(): IFullThemeSpec {\n return {\n arc: Object.assign({}, defaultThemeObj.arc),\n area: Object.assign({}, defaultThemeObj.area),\n circle: Object.assign({}, defaultThemeObj.circle),\n line: Object.assign({}, defaultThemeObj.line),\n path: Object.assign({}, defaultThemeObj.path),\n symbol: Object.assign({}, defaultThemeObj.symbol),\n text: Object.assign({}, defaultThemeObj.text),\n rect: Object.assign({}, defaultThemeObj.rect),\n polygon: Object.assign({}, defaultThemeObj.polygon),\n richtext: Object.assign({}, defaultThemeObj.richtext),\n richtextIcon: Object.assign({}, defaultThemeObj.richtextIcon),\n image: Object.assign({}, defaultThemeObj.image),\n group: Object.assign({}, defaultThemeObj.group),\n glyph: Object.assign({}, defaultThemeObj.glyph)\n };\n}\n\n// /**\n// * 将t合并到out中\n// * @param out\n// * @param t\n// * @param rewrite 是否重写out的属性\n// * @returns\n// */\n// function combineTheme(out: IThemeSpec, t: IThemeSpec, rewrite: boolean = true) {\n// if (!t) {\n// return;\n// }\n// if (rewrite) {\n// Object.keys(t).forEach(k => {\n// if (out[k]) {\n// Object.assign(out[k], t[k]);\n// } else {\n// out[k] = t[k];\n// }\n// });\n// } else {\n// Object.keys(t).forEach(k => {\n// if (out[k]) {\n// // Object.assign(out[k], t[k]);\n// const outItem = out[k];\n// const tItem = t[k];\n// Object.keys(t[k]).forEach(kItem => {\n// if (outItem[kItem] === undefined) {\n// outItem[kItem] = tItem[kItem];\n// }\n// });\n// } else {\n// out[k] = t[k];\n// }\n// });\n// }\n// }\n\nfunction combine(out: Record<string, any>, t: Record<string, any>) {\n Object.keys(t).forEach(k => {\n out[k] = t[k];\n });\n}\n\nconst globalThemeObj = newThemeObj();\n\n// // 性能优化,没有修改的theme都使用这个\n// const defaultCommontTheme = newThemeObj();\n\n// function combineTheme(out: IThemeSpec, userTheme: IThemeSpec, defaultTheme: IFullThemeSpec) {\n\n// }\n\n// 优先级:\n// 1. userTheme\n// 2. commonTheme\n// 3. parentTheme\n// 4. defaultTheme\n\n// 使用原型链来保存主题,避免大量的merge操作\nexport class Theme implements ITheme {\n // 当前的总theme,最终合并后的theme\n combinedTheme: IFullThemeSpec;\n // 记录累计应用的所有用户设置上的theme\n userTheme?: IThemeSpec;\n\n protected _defaultTheme: IFullThemeSpec;\n\n dirty: boolean;\n\n constructor() {\n this.initTheme();\n this.dirty = false;\n }\n\n initTheme() {\n this._defaultTheme = {} as any;\n themeKeys.forEach(key => {\n (this._defaultTheme as any)[key] = Object.create((globalThemeObj as any)[key]);\n });\n this.combinedTheme = this._defaultTheme;\n }\n\n /**\n * 获取group上应该有的主题配置\n * @param group\n * @returns\n */\n getTheme(group?: IGroup) {\n if (!group) {\n return this.combinedTheme;\n }\n if (!this.dirty) {\n return this.combinedTheme;\n }\n let parentTheme = {};\n const parentGroup = this.getParentWithTheme(group);\n if (parentGroup) {\n parentTheme = parentGroup.theme;\n }\n this.applyTheme(group, parentTheme);\n return this.combinedTheme;\n }\n\n // 获取具有主题的parent\n getParentWithTheme(group: IGroup) {\n while (group.parent) {\n group = group.parent;\n if (group.theme) {\n return group;\n }\n }\n return null;\n }\n\n // 应用主题,从根节点一直触发到当前节点(如果上层节点需要的话)\n applyTheme(group: IGroup, pt: IThemeSpec, force: boolean = false): IThemeSpec {\n if (this.dirty) {\n const parentGroup = this.getParentWithTheme(group);\n if (parentGroup) {\n const parentTheme = parentGroup.theme;\n if (parentTheme.dirty || force) {\n // 强制apply所有的上层\n parentTheme.applyTheme(parentGroup, pt, true);\n }\n }\n // 如果当前节点没有userTheme的话,直接复用上层的combinedTheme\n // 或者直接用默认的theme\n if (!this.userTheme) {\n if (parentGroup) {\n this.combinedTheme = parentGroup.theme.combinedTheme;\n } else {\n this.combinedTheme = this._defaultTheme;\n Logger.getInstance().warn('未知错误,走到不应该走的区域里');\n }\n this.dirty = false;\n } else {\n this.doCombine(parentGroup && parentGroup.theme.combinedTheme);\n }\n }\n\n return this.combinedTheme;\n }\n\n // 合并userTheme到combinedTheme\n protected doCombine(parentCombinedTheme?: IThemeSpec) {\n const userTheme = this.userTheme;\n const combinedTheme = this.combinedTheme;\n\n // 1. userTheme\n // 2. combinedTheme\n // 3. parentCombinedTheme\n // 4. defaultTheme\n themeKeys.forEach(k => {\n // init defaultTheme\n const obj = Object.create((globalThemeObj as any)[k]);\n // merge parentCombinedTheme\n if (parentCombinedTheme && (parentCombinedTheme as any)[k]) {\n combine(obj, (parentCombinedTheme as any)[k]);\n }\n // merge combinedTheme\n if ((combinedTheme as any)[k]) {\n combine(obj, (combinedTheme as any)[k]);\n }\n // merge userTheme\n if ((userTheme as any)[k]) {\n combine(obj, (userTheme as any)[k]);\n }\n (this.combinedTheme as any)[k] = obj;\n });\n if (userTheme.common) {\n themeKeys.forEach(k => {\n combine((this.combinedTheme as any)[k], userTheme.common);\n });\n }\n this.dirty = false;\n }\n\n setTheme(t: IThemeSpec, g: IGroup) {\n // 设置自己的nextTheme\n let userTheme = this.userTheme;\n if (userTheme) {\n Object.keys(t).forEach(k => {\n if ((userTheme as any)[k]) {\n Object.assign((userTheme as any)[k], (t as any)[k]);\n } else {\n // todo,这里调用次数不多,应该问题不大\n (userTheme as any)[k] = Object.assign({}, (t as any)[k]);\n }\n });\n } else {\n userTheme = t;\n }\n this.userTheme = userTheme;\n // 设置自己和子节点的theme都为dirty\n this.dirty = true;\n this.dirtyChildren(g);\n }\n\n resetTheme(t: IThemeSpec, g: IGroup) {\n this.userTheme = t;\n // 设置自己和子节点的theme都为dirty\n this.dirty = true;\n this.dirtyChildren(g);\n }\n\n dirtyChildren(g: IGroup) {\n g.forEachChildren(item => {\n if ((item as IGroup).isContainer) {\n if ((item as IGroup).theme) {\n (item as IGroup).theme.dirty = true;\n }\n this.dirtyChildren(item as IGroup);\n }\n });\n }\n}\n\nexport const globalTheme = new Theme();\n\nexport function getTheme(graphic: IGraphic, theme?: IFullThemeSpec): IFullThemeSpec {\n if (graphic.glyphHost) {\n return getTheme(graphic.glyphHost);\n }\n if (theme) {\n if (graphic.isContainer) {\n // 暂时不支持Group\n return theme;\n }\n return theme;\n }\n\n return (\n getThemeFromGroup(graphic) ||\n (graphic.attachedThemeGraphic && getTheme(graphic.attachedThemeGraphic as IGraphic)) ||\n globalTheme.getTheme()\n );\n}\n\nexport function getThemeFromGroup(graphic: IGraphic): IFullThemeSpec | null {\n let g: IGroup;\n if (graphic.isContainer) {\n // 找到存在theme的group\n g = graphic as IGroup;\n } else {\n g = graphic.parent;\n }\n\n if (g) {\n while (g) {\n if (g.theme) {\n break;\n }\n g = g.parent;\n }\n if (!g) {\n return globalTheme.getTheme();\n }\n if (!g.theme) {\n g.createTheme();\n }\n return g.theme.getTheme(g as IGroup);\n }\n return null;\n}\n"]}
1
+ {"version":3,"sources":["../src/graphic/theme.ts"],"names":[],"mappings":";;;AAAA,6CAA0C;AAE1C,qCAgBkB;AAElB,MAAM,eAAe,GAAG;IACtB,GAAG,EAAE,4BAAmB;IACxB,IA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KAAsB;IAChE,IAAI,OAAO,CAAC,SAAS,EAAE;QACrB,OAAO,QAAQ,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;KACpC;IACD,IAAI,KAAK,EAAE;QACT,IAAI,OAAO,CAAC,WAAW,EAAE;YAEvB,OAAO,KAAK,CAAC;SACd;QACD,OAAO,KAAK,CAAC;KACd;IAED,OAAO,CACL,iBAAiB,CAAC,OAAO,CAAC;QAC1B,CAAC,OAAO,CAAC,oBAAoB,IAAI,QAAQ,CAAC,OAAO,CAAC,oBAAgC,CAAC,CAAC;QACpF,mBAAW,CAAC,QAAQ,EAAE,CACvB,CAAC;AACJ,CAAC;AAjBD,4BAiBC;AAED,SAAgB,iBAAiB,CAAC,OAAiB;IACjD,IAAI,CAAS,CAAC;IACd,IAAI,OAAO,CAAC,WAAW,EAAE;QAEvB,CAAC,GAAG,OAAiB,CAAC;KACvB;SAAM;QACL,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC;KACpB;IAED,IAAI,CAAC,EAAE;QACL,OAAO,CAAC,EAAE;YACR,IAAI,CAAC,CAAC,KAAK,EAAE;gBACX,MAAM;aACP;YACD,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC;SACd;QACD,IAAI,CAAC,CAAC,EAAE;YACN,OAAO,mBAAW,CAAC,QAAQ,EAAE,CAAC;SAC/B;QACD,IAAI,CAAC,CAAC,CAAC,KAAK,EAAE;YACZ,CAAC,CAAC,WAAW,EAAE,CAAC;SACjB;QACD,OAAO,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAW,CAAC,CAAC;KACtC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAzBD,8CAyBC","file":"theme.js","sourcesContent":["import { Logger } from '@visactor/vutils';\nimport type { IFullThemeSpec, IGraphic, IGroup, ITheme, IThemeSpec } from '../interface';\nimport {\n DefaultArcAttribute,\n DefaultAreaAttribute,\n DefaultCircleAttribute,\n DefaultGlyphAttribute,\n DefaultGroupAttribute,\n DefaultImageAttribute,\n DefaultLineAttribute,\n DefaultPathAttribute,\n DefaultPolygonAttribute,\n DefaultRectAttribute,\n DefaultStarAttribute,\n DefaultSymbolAttribute,\n DefaultTextAttribute,\n DefaultRichTextAttribute,\n DefaultRichTextIconAttribute\n} from './config';\n\nconst defaultThemeObj = {\n arc: DefaultArcAttribute,\n area: DefaultAreaAttribute,\n circle: DefaultCircleAttribute,\n line: DefaultLineAttribute,\n path: DefaultPathAttribute,\n symbol: DefaultSymbolAttribute,\n text: DefaultTextAttribute,\n rect: DefaultRectAttribute,\n polygon: DefaultPolygonAttribute,\n star: DefaultStarAttribute,\n richtext: DefaultRichTextAttribute,\n richtextIcon: DefaultRichTextIconAttribute,\n image: DefaultImageAttribute,\n group: DefaultGroupAttribute,\n glyph: DefaultGlyphAttribute\n};\n\nconst themeKeys = Object.keys(defaultThemeObj);\n\nexport function newThemeObj(): IFullThemeSpec {\n return {\n arc: Object.assign({}, defaultThemeObj.arc),\n area: Object.assign({}, defaultThemeObj.area),\n circle: Object.assign({}, defaultThemeObj.circle),\n line: Object.assign({}, defaultThemeObj.line),\n path: Object.assign({}, defaultThemeObj.path),\n symbol: Object.assign({}, defaultThemeObj.symbol),\n text: Object.assign({}, defaultThemeObj.text),\n rect: Object.assign({}, defaultThemeObj.rect),\n polygon: Object.assign({}, defaultThemeObj.polygon),\n star: Object.assign({}, defaultThemeObj.star),\n richtext: Object.assign({}, defaultThemeObj.richtext),\n richtextIcon: Object.assign({}, defaultThemeObj.richtextIcon),\n image: Object.assign({}, defaultThemeObj.image),\n group: Object.assign({}, defaultThemeObj.group),\n glyph: Object.assign({}, defaultThemeObj.glyph)\n };\n}\n\n// /**\n// * 将t合并到out中\n// * @param out\n// * @param t\n// * @param rewrite 是否重写out的属性\n// * @returns\n// */\n// function combineTheme(out: IThemeSpec, t: IThemeSpec, rewrite: boolean = true) {\n// if (!t) {\n// return;\n// }\n// if (rewrite) {\n// Object.keys(t).forEach(k => {\n// if (out[k]) {\n// Object.assign(out[k], t[k]);\n// } else {\n// out[k] = t[k];\n// }\n// });\n// } else {\n// Object.keys(t).forEach(k => {\n// if (out[k]) {\n// // Object.assign(out[k], t[k]);\n// const outItem = out[k];\n// const tItem = t[k];\n// Object.keys(t[k]).forEach(kItem => {\n// if (outItem[kItem] === undefined) {\n// outItem[kItem] = tItem[kItem];\n// }\n// });\n// } else {\n// out[k] = t[k];\n// }\n// });\n// }\n// }\n\nfunction combine(out: Record<string, any>, t: Record<string, any>) {\n Object.keys(t).forEach(k => {\n out[k] = t[k];\n });\n}\n\nconst globalThemeObj = newThemeObj();\n\n// // 性能优化,没有修改的theme都使用这个\n// const defaultCommontTheme = newThemeObj();\n\n// function combineTheme(out: IThemeSpec, userTheme: IThemeSpec, defaultTheme: IFullThemeSpec) {\n\n// }\n\n// 优先级:\n// 1. userTheme\n// 2. commonTheme\n// 3. parentTheme\n// 4. defaultTheme\n\n// 使用原型链来保存主题,避免大量的merge操作\nexport class Theme implements ITheme {\n // 当前的总theme,最终合并后的theme\n combinedTheme: IFullThemeSpec;\n // 记录累计应用的所有用户设置上的theme\n userTheme?: IThemeSpec;\n\n protected _defaultTheme: IFullThemeSpec;\n\n dirty: boolean;\n\n constructor() {\n this.initTheme();\n this.dirty = false;\n }\n\n initTheme() {\n this._defaultTheme = {} as any;\n themeKeys.forEach(key => {\n (this._defaultTheme as any)[key] = Object.create((globalThemeObj as any)[key]);\n });\n this.combinedTheme = this._defaultTheme;\n }\n\n /**\n * 获取group上应该有的主题配置\n * @param group\n * @returns\n */\n getTheme(group?: IGroup) {\n if (!group) {\n return this.combinedTheme;\n }\n if (!this.dirty) {\n return this.combinedTheme;\n }\n let parentTheme = {};\n const parentGroup = this.getParentWithTheme(group);\n if (parentGroup) {\n parentTheme = parentGroup.theme;\n }\n this.applyTheme(group, parentTheme);\n return this.combinedTheme;\n }\n\n // 获取具有主题的parent\n getParentWithTheme(group: IGroup) {\n while (group.parent) {\n group = group.parent;\n if (group.theme) {\n return group;\n }\n }\n return null;\n }\n\n // 应用主题,从根节点一直触发到当前节点(如果上层节点需要的话)\n applyTheme(group: IGroup, pt: IThemeSpec, force: boolean = false): IThemeSpec {\n if (this.dirty) {\n const parentGroup = this.getParentWithTheme(group);\n if (parentGroup) {\n const parentTheme = parentGroup.theme;\n if (parentTheme.dirty || force) {\n // 强制apply所有的上层\n parentTheme.applyTheme(parentGroup, pt, true);\n }\n }\n // 如果当前节点没有userTheme的话,直接复用上层的combinedTheme\n // 或者直接用默认的theme\n if (!this.userTheme) {\n if (parentGroup) {\n this.combinedTheme = parentGroup.theme.combinedTheme;\n } else {\n this.combinedTheme = this._defaultTheme;\n Logger.getInstance().warn('未知错误,走到不应该走的区域里');\n }\n this.dirty = false;\n } else {\n this.doCombine(parentGroup && parentGroup.theme.combinedTheme);\n }\n }\n\n return this.combinedTheme;\n }\n\n // 合并userTheme到combinedTheme\n protected doCombine(parentCombinedTheme?: IThemeSpec) {\n const userTheme = this.userTheme;\n const combinedTheme = this.combinedTheme;\n\n // 1. userTheme\n // 2. combinedTheme\n // 3. parentCombinedTheme\n // 4. defaultTheme\n themeKeys.forEach(k => {\n // init defaultTheme\n const obj = Object.create((globalThemeObj as any)[k]);\n // merge parentCombinedTheme\n if (parentCombinedTheme && (parentCombinedTheme as any)[k]) {\n combine(obj, (parentCombinedTheme as any)[k]);\n }\n // merge combinedTheme\n if ((combinedTheme as any)[k]) {\n combine(obj, (combinedTheme as any)[k]);\n }\n // merge userTheme\n if ((userTheme as any)[k]) {\n combine(obj, (userTheme as any)[k]);\n }\n (this.combinedTheme as any)[k] = obj;\n });\n if (userTheme.common) {\n themeKeys.forEach(k => {\n combine((this.combinedTheme as any)[k], userTheme.common);\n });\n }\n this.dirty = false;\n }\n\n setTheme(t: IThemeSpec, g: IGroup) {\n // 设置自己的nextTheme\n let userTheme = this.userTheme;\n if (userTheme) {\n Object.keys(t).forEach(k => {\n if ((userTheme as any)[k]) {\n Object.assign((userTheme as any)[k], (t as any)[k]);\n } else {\n // todo,这里调用次数不多,应该问题不大\n (userTheme as any)[k] = Object.assign({}, (t as any)[k]);\n }\n });\n } else {\n userTheme = t;\n }\n this.userTheme = userTheme;\n // 设置自己和子节点的theme都为dirty\n this.dirty = true;\n this.dirtyChildren(g);\n }\n\n resetTheme(t: IThemeSpec, g: IGroup) {\n this.userTheme = t;\n // 设置自己和子节点的theme都为dirty\n this.dirty = true;\n this.dirtyChildren(g);\n }\n\n dirtyChildren(g: IGroup) {\n g.forEachChildren(item => {\n if ((item as IGroup).isContainer) {\n if ((item as IGroup).theme) {\n (item as IGroup).theme.dirty = true;\n }\n this.dirtyChildren(item as IGroup);\n }\n });\n }\n}\n\nexport const globalTheme = new Theme();\n\nexport function getTheme(graphic: IGraphic, theme?: IFullThemeSpec): IFullThemeSpec {\n if (graphic.glyphHost) {\n return getTheme(graphic.glyphHost);\n }\n if (theme) {\n if (graphic.isContainer) {\n // 暂时不支持Group\n return theme;\n }\n return theme;\n }\n\n return (\n getThemeFromGroup(graphic) ||\n (graphic.attachedThemeGraphic && getTheme(graphic.attachedThemeGraphic as IGraphic)) ||\n globalTheme.getTheme()\n );\n}\n\nexport function getThemeFromGroup(graphic: IGraphic): IFullThemeSpec | null {\n let g: IGroup;\n if (graphic.isContainer) {\n // 找到存在theme的group\n g = graphic as IGroup;\n } else {\n g = graphic.parent;\n }\n\n if (g) {\n while (g) {\n if (g.theme) {\n break;\n }\n g = g.parent;\n }\n if (!g) {\n return globalTheme.getTheme();\n }\n if (!g.theme) {\n g.createTheme();\n }\n return g.theme.getTheme(g as IGroup);\n }\n return null;\n}\n"]}
package/cjs/index.d.ts CHANGED
@@ -61,6 +61,7 @@ export * from './render/contributions/render/circle-module';
61
61
  export * from './render/contributions/render/text-module';
62
62
  export * from './render/contributions/render/path-module';
63
63
  export * from './render/contributions/render/polygon-module';
64
+ export * from './render/contributions/render/star-module';
64
65
  export * from './render/contributions/render/glyph-module';
65
66
  export * from './render/contributions/render/richtext-module';
66
67
  export * from './render/contributions/render/image-module';
@@ -77,6 +78,7 @@ export * from './register/register-image';
77
78
  export * from './register/register-line';
78
79
  export * from './register/register-path';
79
80
  export * from './register/register-polygon';
81
+ export * from './register/register-star';
80
82
  export * from './register/register-pyramid3d';
81
83
  export * from './register/register-rect';
82
84
  export * from './register/register-rect3d';
package/cjs/index.js CHANGED
@@ -62,7 +62,8 @@ __exportStar(require("./render/contributions/render/rect-module"), exports), __e
62
62
  __exportStar(require("./render/contributions/render/area-module"), exports), __exportStar(require("./render/contributions/render/symbol-module"), exports),
63
63
  __exportStar(require("./render/contributions/render/circle-module"), exports), __exportStar(require("./render/contributions/render/text-module"), exports),
64
64
  __exportStar(require("./render/contributions/render/path-module"), exports), __exportStar(require("./render/contributions/render/polygon-module"), exports),
65
- __exportStar(require("./render/contributions/render/glyph-module"), exports), __exportStar(require("./render/contributions/render/richtext-module"), exports),
65
+ __exportStar(require("./render/contributions/render/star-module"), exports), __exportStar(require("./render/contributions/render/glyph-module"), exports),
66
+ __exportStar(require("./render/contributions/render/richtext-module"), exports),
66
67
  __exportStar(require("./render/contributions/render/image-module"), exports), __exportStar(require("./render/contributions/render/rect3d-module"), exports),
67
68
  __exportStar(require("./render/contributions/render/arc3d-module"), exports), __exportStar(require("./render/contributions/render/pyramid3d-module"), exports),
68
69
  __exportStar(require("./register/register-arc"), exports), __exportStar(require("./register/register-arc3d"), exports),
@@ -70,11 +71,11 @@ __exportStar(require("./register/register-area"), exports), __exportStar(require
70
71
  __exportStar(require("./register/register-glyph"), exports), __exportStar(require("./register/register-group"), exports),
71
72
  __exportStar(require("./register/register-image"), exports), __exportStar(require("./register/register-line"), exports),
72
73
  __exportStar(require("./register/register-path"), exports), __exportStar(require("./register/register-polygon"), exports),
73
- __exportStar(require("./register/register-pyramid3d"), exports), __exportStar(require("./register/register-rect"), exports),
74
- __exportStar(require("./register/register-rect3d"), exports), __exportStar(require("./register/register-richtext"), exports),
75
- __exportStar(require("./register/register-symbol"), exports), __exportStar(require("./register/register-text"), exports),
76
- __exportStar(require("./register/register-shadowRoot"), exports), __exportStar(require("./register/register-wraptext"), exports),
77
- __exportStar(require("./plugins/builtin-plugin/html-attribute-plugin"), exports),
74
+ __exportStar(require("./register/register-star"), exports), __exportStar(require("./register/register-pyramid3d"), exports),
75
+ __exportStar(require("./register/register-rect"), exports), __exportStar(require("./register/register-rect3d"), exports),
76
+ __exportStar(require("./register/register-richtext"), exports), __exportStar(require("./register/register-symbol"), exports),
77
+ __exportStar(require("./register/register-text"), exports), __exportStar(require("./register/register-shadowRoot"), exports),
78
+ __exportStar(require("./register/register-wraptext"), exports), __exportStar(require("./plugins/builtin-plugin/html-attribute-plugin"), exports),
78
79
  __exportStar(require("./plugins/builtin-plugin/react-attribute-plugin"), exports),
79
80
  __exportStar(require("./plugins/builtin-plugin/3dview-transform-plugin"), exports),
80
81
  __exportStar(require("./plugins/builtin-plugin/flex-layout-plugin"), exports), __exportStar(require("./plugins/builtin-plugin/edit-module"), exports);
package/cjs/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACA,qBAAmB;AAEnB,8CAA4B;AAC5B,gDAA8B;AAC9B,4CAA0B;AAC1B,4CAA0B;AAC1B,2CAAyB;AACzB,0CAAwB;AACxB,8CAA4B;AAC5B,2CAAyB;AACzB,4EAA0D;AAC1D,2CAAyB;AACzB,yCAAuB;AACvB,+CAA6B;AAC7B,gDAA8B;AAC9B,2CAAyB;AACzB,2DAAyC;AACzC,iDAA+B;AAC/B,4CAA0B;AAG1B,gDAA8B;AAC9B,wDAAsC;AACtC,0DAAwC;AACxC,uDAAqC;AACrC,yDAAuC;AACvC,mDAAiC;AACjC,wDAAsC;AACtC,iEAA+C;AAC/C,qDAAmC;AACnC,iDAA+B;AAC/B,qDAAmC;AACnC,sDAAoC;AACpC,kDAAgC;AAChC,oDAAkC;AAClC,gDAA8B;AAE9B,oDAAkC;AAClC,wDAAsC;AACtC,uDAAqC;AACrC,+DAA6C;AAC7C,gDAA8B;AAC9B,0DAAwC;AACxC,sDAAoC;AACpC,iDAA+B;AAC/B,qDAAmC;AACnC,2DAAyC;AACzC,sDAAoC;AACpC,gFAA8D;AAC9D,8DAA4C;AAC5C,8DAA4C;AAC5C,+DAA6C;AAE7C,sCAAwD;AAA/C,kGAAA,UAAU,OAAA;AAAE,mGAAA,WAAW,OAAA;AAChC,+CAA6B;AAC7B,0DAAwC;AACxC,8CAA4B;AAC5B,gDAA8B;AAC9B,8CAA4B;AAE5B,2EAAyD;AACzD,4EAA0D;AAC1D,4EAA0D;AAC1D,4EAA0D;AAC1D,8EAA4D;AAC5D,8EAA4D;AAC5D,4EAA0D;AAC1D,4EAA0D;AAC1D,+EAA6D;AAC7D,6EAA2D;AAC3D,gFAA8D;AAC9D,6EAA2D;AAC3D,8EAA4D;AAC5D,6EAA2D;AAC3D,iFAA+D;AAE/D,0DAAwC;AACxC,4DAA0C;AAC1C,2DAAyC;AACzC,6DAA2C;AAC3C,4DAA0C;AAC1C,4DAA0C;AAC1C,4DAA0C;AAC1C,2DAAyC;AACzC,2DAAyC;AACzC,8DAA4C;AAC5C,gEAA8C;AAC9C,2DAAyC;AACzC,6DAA2C;AAC3C,+DAA6C;AAC7C,6DAA2C;AAC3C,2DAAyC;AACzC,iEAA+C;AAC/C,+DAA6C;AAG7C,iFAA+D;AAC/D,kFAAgE;AAChE,mFAAiE;AACjE,8EAA4D;AAE5D,uEAAqD","file":"index.js","sourcesContent":["// import 'core-js/proposals/reflect-metadata';\nimport './modules';\n\nexport * from './container';\nexport * from './core/global';\nexport * from './graphic';\nexport * from './modules';\nexport * from './create';\nexport * from './event';\nexport * from './interface';\nexport * from './render';\nexport * from './render/contributions/render/base-render';\nexport * from './canvas';\nexport * from './core';\nexport * from './core/light';\nexport * from './core/camera';\nexport * from './picker';\nexport * from './resource-loader/loader';\nexport * from './color-string';\nexport * from './factory';\n\n/* export common */\nexport * from './common/text';\nexport * from './common/bezier-utils';\nexport * from './common/bounds-context';\nexport * from './common/seg-context';\nexport * from './common/custom-path2d';\nexport * from './common/segment';\nexport * from './common/canvas-utils';\nexport * from './common/contribution-provider';\nexport * from './common/generator';\nexport * from './common/utils';\nexport * from './common/shape/arc';\nexport * from './common/shape/rect';\nexport * from './common/matrix';\nexport * from './common/simplify';\nexport * from './common/diff';\n\nexport * from './common/path-svg';\nexport * from './common/render-curve';\nexport * from './common/render-area';\nexport * from './common/render-command-list';\nexport * from './common/sort';\nexport * from './common/morphing-utils';\nexport * from './common/split-path';\nexport * from './common/enums';\nexport * from './common/generator';\nexport * from './common/performance-raf';\nexport * from './plugins/constants';\nexport * from './plugins/builtin-plugin/richtext-edit-plugin';\nexport * from './allocator/matrix-allocate';\nexport * from './allocator/canvas-allocate';\nexport * from './allocator/graphic-allocate';\n\nexport { wrapCanvas, wrapContext } from './canvas/util';\nexport * from './common/xml';\nexport * from './common/inversify-lite';\nexport * from './constants';\nexport * from './application';\nexport * from './env-check';\n\nexport * from './render/contributions/render/arc-module';\nexport * from './render/contributions/render/rect-module';\nexport * from './render/contributions/render/line-module';\nexport * from './render/contributions/render/area-module';\nexport * from './render/contributions/render/symbol-module';\nexport * from './render/contributions/render/circle-module';\nexport * from './render/contributions/render/text-module';\nexport * from './render/contributions/render/path-module';\nexport * from './render/contributions/render/polygon-module';\nexport * from './render/contributions/render/glyph-module';\nexport * from './render/contributions/render/richtext-module';\nexport * from './render/contributions/render/image-module';\nexport * from './render/contributions/render/rect3d-module';\nexport * from './render/contributions/render/arc3d-module';\nexport * from './render/contributions/render/pyramid3d-module';\n\nexport * from './register/register-arc';\nexport * from './register/register-arc3d';\nexport * from './register/register-area';\nexport * from './register/register-circle';\nexport * from './register/register-glyph';\nexport * from './register/register-group';\nexport * from './register/register-image';\nexport * from './register/register-line';\nexport * from './register/register-path';\nexport * from './register/register-polygon';\nexport * from './register/register-pyramid3d';\nexport * from './register/register-rect';\nexport * from './register/register-rect3d';\nexport * from './register/register-richtext';\nexport * from './register/register-symbol';\nexport * from './register/register-text';\nexport * from './register/register-shadowRoot';\nexport * from './register/register-wraptext';\n\n// plugin\nexport * from './plugins/builtin-plugin/html-attribute-plugin';\nexport * from './plugins/builtin-plugin/react-attribute-plugin';\nexport * from './plugins/builtin-plugin/3dview-transform-plugin';\nexport * from './plugins/builtin-plugin/flex-layout-plugin';\n\nexport * from './plugins/builtin-plugin/edit-module';\n\n// export const morphPath = {};\n// export const multiToOneMorph = {};\n// export const oneToMultiMorph = {};\n// export class ACustomAnimate {}\n// export const AnimateGroup = {};\n// export const Animate = {};\n// export const defaultTicker = {};\n"]}
1
+ {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACA,qBAAmB;AAEnB,8CAA4B;AAC5B,gDAA8B;AAC9B,4CAA0B;AAC1B,4CAA0B;AAC1B,2CAAyB;AACzB,0CAAwB;AACxB,8CAA4B;AAC5B,2CAAyB;AACzB,4EAA0D;AAC1D,2CAAyB;AACzB,yCAAuB;AACvB,+CAA6B;AAC7B,gDAA8B;AAC9B,2CAAyB;AACzB,2DAAyC;AACzC,iDAA+B;AAC/B,4CAA0B;AAG1B,gDAA8B;AAC9B,wDAAsC;AACtC,0DAAwC;AACxC,uDAAqC;AACrC,yDAAuC;AACvC,mDAAiC;AACjC,wDAAsC;AACtC,iEAA+C;AAC/C,qDAAmC;AACnC,iDAA+B;AAC/B,qDAAmC;AACnC,sDAAoC;AACpC,kDAAgC;AAChC,oDAAkC;AAClC,gDAA8B;AAE9B,oDAAkC;AAClC,wDAAsC;AACtC,uDAAqC;AACrC,+DAA6C;AAC7C,gDAA8B;AAC9B,0DAAwC;AACxC,sDAAoC;AACpC,iDAA+B;AAC/B,qDAAmC;AACnC,2DAAyC;AACzC,sDAAoC;AACpC,gFAA8D;AAC9D,8DAA4C;AAC5C,8DAA4C;AAC5C,+DAA6C;AAE7C,sCAAwD;AAA/C,kGAAA,UAAU,OAAA;AAAE,mGAAA,WAAW,OAAA;AAChC,+CAA6B;AAC7B,0DAAwC;AACxC,8CAA4B;AAC5B,gDAA8B;AAC9B,8CAA4B;AAE5B,2EAAyD;AACzD,4EAA0D;AAC1D,4EAA0D;AAC1D,4EAA0D;AAC1D,8EAA4D;AAC5D,8EAA4D;AAC5D,4EAA0D;AAC1D,4EAA0D;AAC1D,+EAA6D;AAC7D,4EAA0D;AAC1D,6EAA2D;AAC3D,gFAA8D;AAC9D,6EAA2D;AAC3D,8EAA4D;AAC5D,6EAA2D;AAC3D,iFAA+D;AAE/D,0DAAwC;AACxC,4DAA0C;AAC1C,2DAAyC;AACzC,6DAA2C;AAC3C,4DAA0C;AAC1C,4DAA0C;AAC1C,4DAA0C;AAC1C,2DAAyC;AACzC,2DAAyC;AACzC,8DAA4C;AAC5C,2DAAyC;AACzC,gEAA8C;AAC9C,2DAAyC;AACzC,6DAA2C;AAC3C,+DAA6C;AAC7C,6DAA2C;AAC3C,2DAAyC;AACzC,iEAA+C;AAC/C,+DAA6C;AAG7C,iFAA+D;AAC/D,kFAAgE;AAChE,mFAAiE;AACjE,8EAA4D;AAE5D,uEAAqD","file":"index.js","sourcesContent":["// import 'core-js/proposals/reflect-metadata';\nimport './modules';\n\nexport * from './container';\nexport * from './core/global';\nexport * from './graphic';\nexport * from './modules';\nexport * from './create';\nexport * from './event';\nexport * from './interface';\nexport * from './render';\nexport * from './render/contributions/render/base-render';\nexport * from './canvas';\nexport * from './core';\nexport * from './core/light';\nexport * from './core/camera';\nexport * from './picker';\nexport * from './resource-loader/loader';\nexport * from './color-string';\nexport * from './factory';\n\n/* export common */\nexport * from './common/text';\nexport * from './common/bezier-utils';\nexport * from './common/bounds-context';\nexport * from './common/seg-context';\nexport * from './common/custom-path2d';\nexport * from './common/segment';\nexport * from './common/canvas-utils';\nexport * from './common/contribution-provider';\nexport * from './common/generator';\nexport * from './common/utils';\nexport * from './common/shape/arc';\nexport * from './common/shape/rect';\nexport * from './common/matrix';\nexport * from './common/simplify';\nexport * from './common/diff';\n\nexport * from './common/path-svg';\nexport * from './common/render-curve';\nexport * from './common/render-area';\nexport * from './common/render-command-list';\nexport * from './common/sort';\nexport * from './common/morphing-utils';\nexport * from './common/split-path';\nexport * from './common/enums';\nexport * from './common/generator';\nexport * from './common/performance-raf';\nexport * from './plugins/constants';\nexport * from './plugins/builtin-plugin/richtext-edit-plugin';\nexport * from './allocator/matrix-allocate';\nexport * from './allocator/canvas-allocate';\nexport * from './allocator/graphic-allocate';\n\nexport { wrapCanvas, wrapContext } from './canvas/util';\nexport * from './common/xml';\nexport * from './common/inversify-lite';\nexport * from './constants';\nexport * from './application';\nexport * from './env-check';\n\nexport * from './render/contributions/render/arc-module';\nexport * from './render/contributions/render/rect-module';\nexport * from './render/contributions/render/line-module';\nexport * from './render/contributions/render/area-module';\nexport * from './render/contributions/render/symbol-module';\nexport * from './render/contributions/render/circle-module';\nexport * from './render/contributions/render/text-module';\nexport * from './render/contributions/render/path-module';\nexport * from './render/contributions/render/polygon-module';\nexport * from './render/contributions/render/star-module';\nexport * from './render/contributions/render/glyph-module';\nexport * from './render/contributions/render/richtext-module';\nexport * from './render/contributions/render/image-module';\nexport * from './render/contributions/render/rect3d-module';\nexport * from './render/contributions/render/arc3d-module';\nexport * from './render/contributions/render/pyramid3d-module';\n\nexport * from './register/register-arc';\nexport * from './register/register-arc3d';\nexport * from './register/register-area';\nexport * from './register/register-circle';\nexport * from './register/register-glyph';\nexport * from './register/register-group';\nexport * from './register/register-image';\nexport * from './register/register-line';\nexport * from './register/register-path';\nexport * from './register/register-polygon';\nexport * from './register/register-star';\nexport * from './register/register-pyramid3d';\nexport * from './register/register-rect';\nexport * from './register/register-rect3d';\nexport * from './register/register-richtext';\nexport * from './register/register-symbol';\nexport * from './register/register-text';\nexport * from './register/register-shadowRoot';\nexport * from './register/register-wraptext';\n\n// plugin\nexport * from './plugins/builtin-plugin/html-attribute-plugin';\nexport * from './plugins/builtin-plugin/react-attribute-plugin';\nexport * from './plugins/builtin-plugin/3dview-transform-plugin';\nexport * from './plugins/builtin-plugin/flex-layout-plugin';\n\nexport * from './plugins/builtin-plugin/edit-module';\n\n// export const morphPath = {};\n// export const multiToOneMorph = {};\n// export const oneToMultiMorph = {};\n// export class ACustomAnimate {}\n// export const AnimateGroup = {};\n// export const Animate = {};\n// export const defaultTicker = {};\n"]}
@@ -98,3 +98,20 @@ export interface IAnimateTarget {
98
98
  animates: Map<string | number, IAnimate>;
99
99
  [key: string]: any;
100
100
  }
101
+ export interface BaseAnimateConfig {
102
+ id?: number | string;
103
+ interpolate?: (key: string, ratio: number, from: any, to: any, nextAttributes: any) => boolean;
104
+ onStart?: () => void;
105
+ onFrame?: (step: IStep, ratio: number) => void;
106
+ onEnd?: () => void;
107
+ onRemove?: () => void;
108
+ }
109
+ export interface MorphingAnimateConfig extends Omit<BaseAnimateConfig, 'interpolate'> {
110
+ duration?: number;
111
+ easing?: EasingType;
112
+ delay?: number;
113
+ }
114
+ export interface MultiMorphingAnimateConfig extends MorphingAnimateConfig {
115
+ splitPath?: 'clone' | ((graphic: IGraphic, count: number, needAppend?: boolean) => IGraphic[]);
116
+ individualDelay?: (index: number, count: number, fromGraphic: IGraphic, toGraphic: IGraphic) => number;
117
+ }
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/interface/animation/animate.ts"],"names":[],"mappings":";;;AAsKA,IAAY,WAGX;AAHD,WAAY,WAAW;IACrB,iDAAe,CAAA;IACf,6EAA6B,CAAA;AAC/B,CAAC,EAHW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAGtB","file":"animate.js","sourcesContent":["import type { IGraphic } from '../graphic';\nimport type { EasingType, EasingTypeFunc } from './easing';\nimport type { AnimateStatus, IAnimateStepType } from './type';\nimport type { ITimeline } from './timeline';\n\nexport interface ICustomAnimate extends IStep {\n type: IAnimateStepType;\n}\n\nexport interface IStep {\n type: IAnimateStepType;\n prev?: IStep;\n // 持续时间\n duration: number;\n // 链表,下一个\n next?: IStep;\n // 属性\n props?: Record<string, any>;\n // 解析后的属性(用于性能优化,避免每次tick都解析)\n fromParsedProps?: Record<string, any>;\n toParsedProps?: Record<string, any>;\n fromProps?: Record<string, any>;\n // 解析后的属性列表(用于性能优化,避免每次tick都解析)\n propKeys?: string[];\n // 缓动函数\n easing?: EasingTypeFunc;\n\n // 添加一个\n append: (step: IStep) => void;\n // 获取上一个props,用于完成这次的fromValue 和 toValue的插值\n getLastProps: () => any;\n\n animate: IAnimate;\n\n // 设置持续时间\n setDuration: (duration: number, updateDownstream?: boolean) => void;\n // 获取持续时间\n getDuration: () => number;\n // 确定插值更新函数(在开始的时候就确定,避免每次tick都解析)\n determineInterpolateUpdateFunction: () => void;\n\n // 设置开始时间\n setStartTime: (time: number, updateDownstream?: boolean) => void;\n // 获取开始时间\n getStartTime: () => number;\n\n bind: (target: IGraphic, animate: IAnimate) => void;\n // 在第一次绑定到Animate的时候触发\n onBind: () => void;\n // 第一次执行的时候调用\n onFirstRun: () => void;\n // 开始执行的时候调用(如果有循环,那每个周期都会调用)\n onStart: () => void;\n // 结束执行的时候调用(如果有循环,那每个周期都会调用)\n onEnd: (cb?: (animate: IAnimate, step: IStep) => void) => void;\n // 更新执行的时候调用(如果有循环,那每个周期都会调用)\n update: (end: boolean, ratio: number, out: Record<string, any>) => void;\n onUpdate: (end: boolean, ratio: number, out: Record<string, any>) => void;\n\n getEndProps: () => Record<string, any> | void;\n getFromProps: () => Record<string, any> | void;\n getMergedEndProps: () => Record<string, any> | void;\n\n // 屏蔽自身属性,会直接从props等内容里删除掉\n deleteSelfAttr: (key: string) => void;\n\n // 停止\n stop: () => void;\n}\n\nexport interface IAnimate {\n readonly id: string | number;\n status: AnimateStatus;\n target: IGraphic;\n priority: number;\n interpolateUpdateFunction:\n | ((from: Record<string, any>, to: Record<string, any>, ratio: number, step: IStep, target: IGraphic) => void)\n | null;\n\n _onStart?: (() => void)[];\n _onFrame?: ((step: IStep, ratio: number) => void)[];\n _onEnd?: (() => void)[];\n _onRemove?: (() => void)[];\n\n getStartProps: () => Record<string, any>;\n getEndProps: () => Record<string, any>;\n\n // 设置timeline\n setTimeline: (timeline: ITimeline) => void;\n // 获取timeline\n getTimeline: () => ITimeline;\n readonly timeline: ITimeline;\n\n bind: (target: IGraphic) => this;\n to: (props: Record<string, any>, duration: number, easing: EasingType) => this;\n from: (props: Record<string, any>, duration: number, easing: EasingType) => this;\n pause: () => void;\n resume: () => void;\n onStart: (cb?: () => void) => void;\n onEnd: (cb?: () => void) => void;\n onFrame: (cb: (step: IStep, ratio: number) => void) => void;\n onRemove: (cb?: () => void) => void;\n // 屏蔽属性\n preventAttr: (key: string) => void;\n // 屏蔽属性\n preventAttrs: (key: string[]) => void;\n // 属性是否合法\n validAttr: (key: string) => boolean;\n\n runCb: (cb: (a: IAnimate, step: IStep) => void) => IAnimate;\n\n // 自定义插值,返回false表示没有匹配上\n customInterpolate: (\n key: string,\n ratio: number,\n from: any,\n to: any,\n target: IGraphic,\n ret: Record<string, any>\n ) => boolean;\n play: (customAnimate: ICustomAnimate) => this;\n\n getFromValue: () => Record<string, any>;\n getToValue: () => Record<string, any>;\n // 停止,可以设置停止后设置target的属性为开始的值(fromValue),还是结束的值(toValue)\n stop: (type?: 'start' | 'end' | Record<string, any>) => void;\n /** 打上END标志,下一帧被删除 */\n release: () => void;\n // 获取持续的时长\n getDuration: () => number;\n getTotalDuration: () => number;\n // 获取动画开始时间(注意并不是子动画的startAt)\n getStartTime: () => number;\n // 等待delay\n wait: (delay: number) => this;\n\n /* 动画编排 */\n // 所有动画结束后执行\n afterAll: (list: IAnimate[]) => this;\n // 在某个动画结束后执行\n after: (animate: IAnimate) => this;\n // 并行执行\n parallel: (animate: IAnimate) => this;\n\n getLoop: () => number;\n\n // 反转动画\n // reversed: (r: boolean) => IAnimate;\n // 循环动画\n loop: (n: number | boolean) => IAnimate;\n // 反弹动画\n bounce: (b: boolean) => IAnimate;\n\n advance: (delta: number) => void;\n\n // 设置开始时间(startAt之前是完全不会进入动画生命周期的)\n // 它和wait不一样,如果调用的是wait,wait过程中还算是一个动画阶段,只是空的阶段,而startAt之前是完全不会进入动画生命周期的\n startAt: (t: number) => IAnimate;\n\n // 重新同步和计算props,用于内部某些step发生了变更后,重新计算自身\n reSyncProps: () => void;\n\n // 更新duration\n updateDuration: () => void;\n}\n\nexport enum AnimateMode {\n NORMAL = 0b0000,\n SET_ATTR_IMMEDIATELY = 0b0001\n}\n\nexport interface IAnimateTarget {\n onAnimateBind?: (animte: IAnimate) => void;\n // 获取属性\n getComputedAttribute: (name: string) => any;\n // 获取默认属性\n getDefaultAttribute: (name: string) => any;\n onStop: (props?: Record<string, any>) => void;\n animates: Map<string | number, IAnimate>;\n [key: string]: any;\n}\n"]}
1
+ {"version":3,"sources":["../src/interface/animation/animate.ts"],"names":[],"mappings":";;;AAsKA,IAAY,WAGX;AAHD,WAAY,WAAW;IACrB,iDAAe,CAAA;IACf,6EAA6B,CAAA;AAC/B,CAAC,EAHW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAGtB","file":"animate.js","sourcesContent":["import type { IGraphic } from '../graphic';\nimport type { EasingType, EasingTypeFunc } from './easing';\nimport type { AnimateStatus, IAnimateStepType } from './type';\nimport type { ITimeline } from './timeline';\n\nexport interface ICustomAnimate extends IStep {\n type: IAnimateStepType;\n}\n\nexport interface IStep {\n type: IAnimateStepType;\n prev?: IStep;\n // 持续时间\n duration: number;\n // 链表,下一个\n next?: IStep;\n // 属性\n props?: Record<string, any>;\n // 解析后的属性(用于性能优化,避免每次tick都解析)\n fromParsedProps?: Record<string, any>;\n toParsedProps?: Record<string, any>;\n fromProps?: Record<string, any>;\n // 解析后的属性列表(用于性能优化,避免每次tick都解析)\n propKeys?: string[];\n // 缓动函数\n easing?: EasingTypeFunc;\n\n // 添加一个\n append: (step: IStep) => void;\n // 获取上一个props,用于完成这次的fromValue 和 toValue的插值\n getLastProps: () => any;\n\n animate: IAnimate;\n\n // 设置持续时间\n setDuration: (duration: number, updateDownstream?: boolean) => void;\n // 获取持续时间\n getDuration: () => number;\n // 确定插值更新函数(在开始的时候就确定,避免每次tick都解析)\n determineInterpolateUpdateFunction: () => void;\n\n // 设置开始时间\n setStartTime: (time: number, updateDownstream?: boolean) => void;\n // 获取开始时间\n getStartTime: () => number;\n\n bind: (target: IGraphic, animate: IAnimate) => void;\n // 在第一次绑定到Animate的时候触发\n onBind: () => void;\n // 第一次执行的时候调用\n onFirstRun: () => void;\n // 开始执行的时候调用(如果有循环,那每个周期都会调用)\n onStart: () => void;\n // 结束执行的时候调用(如果有循环,那每个周期都会调用)\n onEnd: (cb?: (animate: IAnimate, step: IStep) => void) => void;\n // 更新执行的时候调用(如果有循环,那每个周期都会调用)\n update: (end: boolean, ratio: number, out: Record<string, any>) => void;\n onUpdate: (end: boolean, ratio: number, out: Record<string, any>) => void;\n\n getEndProps: () => Record<string, any> | void;\n getFromProps: () => Record<string, any> | void;\n getMergedEndProps: () => Record<string, any> | void;\n\n // 屏蔽自身属性,会直接从props等内容里删除掉\n deleteSelfAttr: (key: string) => void;\n\n // 停止\n stop: () => void;\n}\n\nexport interface IAnimate {\n readonly id: string | number;\n status: AnimateStatus;\n target: IGraphic;\n priority: number;\n interpolateUpdateFunction:\n | ((from: Record<string, any>, to: Record<string, any>, ratio: number, step: IStep, target: IGraphic) => void)\n | null;\n\n _onStart?: (() => void)[];\n _onFrame?: ((step: IStep, ratio: number) => void)[];\n _onEnd?: (() => void)[];\n _onRemove?: (() => void)[];\n\n getStartProps: () => Record<string, any>;\n getEndProps: () => Record<string, any>;\n\n // 设置timeline\n setTimeline: (timeline: ITimeline) => void;\n // 获取timeline\n getTimeline: () => ITimeline;\n readonly timeline: ITimeline;\n\n bind: (target: IGraphic) => this;\n to: (props: Record<string, any>, duration: number, easing: EasingType) => this;\n from: (props: Record<string, any>, duration: number, easing: EasingType) => this;\n pause: () => void;\n resume: () => void;\n onStart: (cb?: () => void) => void;\n onEnd: (cb?: () => void) => void;\n onFrame: (cb: (step: IStep, ratio: number) => void) => void;\n onRemove: (cb?: () => void) => void;\n // 屏蔽属性\n preventAttr: (key: string) => void;\n // 屏蔽属性\n preventAttrs: (key: string[]) => void;\n // 属性是否合法\n validAttr: (key: string) => boolean;\n\n runCb: (cb: (a: IAnimate, step: IStep) => void) => IAnimate;\n\n // 自定义插值,返回false表示没有匹配上\n customInterpolate: (\n key: string,\n ratio: number,\n from: any,\n to: any,\n target: IGraphic,\n ret: Record<string, any>\n ) => boolean;\n play: (customAnimate: ICustomAnimate) => this;\n\n getFromValue: () => Record<string, any>;\n getToValue: () => Record<string, any>;\n // 停止,可以设置停止后设置target的属性为开始的值(fromValue),还是结束的值(toValue)\n stop: (type?: 'start' | 'end' | Record<string, any>) => void;\n /** 打上END标志,下一帧被删除 */\n release: () => void;\n // 获取持续的时长\n getDuration: () => number;\n getTotalDuration: () => number;\n // 获取动画开始时间(注意并不是子动画的startAt)\n getStartTime: () => number;\n // 等待delay\n wait: (delay: number) => this;\n\n /* 动画编排 */\n // 所有动画结束后执行\n afterAll: (list: IAnimate[]) => this;\n // 在某个动画结束后执行\n after: (animate: IAnimate) => this;\n // 并行执行\n parallel: (animate: IAnimate) => this;\n\n getLoop: () => number;\n\n // 反转动画\n // reversed: (r: boolean) => IAnimate;\n // 循环动画\n loop: (n: number | boolean) => IAnimate;\n // 反弹动画\n bounce: (b: boolean) => IAnimate;\n\n advance: (delta: number) => void;\n\n // 设置开始时间(startAt之前是完全不会进入动画生命周期的)\n // 它和wait不一样,如果调用的是wait,wait过程中还算是一个动画阶段,只是空的阶段,而startAt之前是完全不会进入动画生命周期的\n startAt: (t: number) => IAnimate;\n\n // 重新同步和计算props,用于内部某些step发生了变更后,重新计算自身\n reSyncProps: () => void;\n\n // 更新duration\n updateDuration: () => void;\n}\n\nexport enum AnimateMode {\n NORMAL = 0b0000,\n SET_ATTR_IMMEDIATELY = 0b0001\n}\n\nexport interface IAnimateTarget {\n onAnimateBind?: (animte: IAnimate) => void;\n // 获取属性\n getComputedAttribute: (name: string) => any;\n // 获取默认属性\n getDefaultAttribute: (name: string) => any;\n onStop: (props?: Record<string, any>) => void;\n animates: Map<string | number, IAnimate>;\n [key: string]: any;\n}\n\nexport interface BaseAnimateConfig {\n id?: number | string;\n interpolate?: (key: string, ratio: number, from: any, to: any, nextAttributes: any) => boolean;\n onStart?: () => void;\n onFrame?: (step: IStep, ratio: number) => void;\n onEnd?: () => void;\n onRemove?: () => void;\n}\n\nexport interface MorphingAnimateConfig extends Omit<BaseAnimateConfig, 'interpolate'> {\n duration?: number;\n easing?: EasingType; // 统一到easing\n delay?: number;\n}\n\nexport interface MultiMorphingAnimateConfig extends MorphingAnimateConfig {\n splitPath?: 'clone' | ((graphic: IGraphic, count: number, needAppend?: boolean) => IGraphic[]);\n individualDelay?: (index: number, count: number, fromGraphic: IGraphic, toGraphic: IGraphic) => number;\n}\n"]}
@@ -1,4 +1,4 @@
1
- export type ICurveType = 'basis' | 'basisClosed' | 'basisOpen' | 'bundle' | 'cardinal' | 'cardinalClosed' | 'cardinalOpen' | 'stepBefore' | 'stepAfter' | 'catmullRom' | 'catmullRomClosed' | 'catmullRomOpen' | 'linear' | 'linearClosed' | 'monotoneX' | 'monotoneY' | 'natural' | 'radial' | 'step';
1
+ export type ICurveType = 'basis' | 'basisClosed' | 'basisOpen' | 'bundle' | 'cardinal' | 'cardinalClosed' | 'cardinalOpen' | 'stepBefore' | 'stepAfter' | 'stepClosed' | 'catmullRom' | 'catmullRomClosed' | 'catmullRomOpen' | 'linear' | 'linearClosed' | 'monotoneX' | 'monotoneY' | 'natural' | 'radial' | 'step';
2
2
  export type MaybePromise<T> = T | PromiseLike<T>;
3
3
  export interface Releaseable {
4
4
  release: (...params: any) => void;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/interface/common.ts"],"names":[],"mappings":"","file":"common.js","sourcesContent":["export type ICurveType =\n | 'basis'\n | 'basisClosed'\n | 'basisOpen'\n | 'bundle'\n | 'cardinal'\n | 'cardinalClosed'\n | 'cardinalOpen'\n | 'stepBefore'\n | 'stepAfter'\n | 'catmullRom'\n | 'catmullRomClosed'\n | 'catmullRomOpen'\n | 'linear'\n | 'linearClosed'\n | 'monotoneX'\n | 'monotoneY'\n | 'natural'\n | 'radial'\n | 'step';\n\nexport type MaybePromise<T> = T | PromiseLike<T>;\n\n// 所有的接口都应当继承这个,避免内存没有释放\nexport interface Releaseable {\n release: (...params: any) => void;\n}\n\nexport interface IEventElement {\n // event接口\n addEventListener: (<K extends keyof DocumentEventMap>(\n type: K,\n listener: (this: Document, ev: DocumentEventMap[K]) => any,\n options?: boolean | AddEventListenerOptions\n ) => void) &\n ((type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions) => void);\n on: (<K extends keyof DocumentEventMap>(\n type: K,\n listener: (this: Document, ev: DocumentEventMap[K]) => any,\n options?: boolean | AddEventListenerOptions\n ) => void) &\n ((type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions) => void);\n once: (<K extends keyof DocumentEventMap>(\n type: K,\n listener: (this: Document, ev: DocumentEventMap[K]) => any,\n options?: boolean | AddEventListenerOptions\n ) => void) &\n ((type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions) => void);\n removeEventListener: (<K extends keyof DocumentEventMap>(\n type: K,\n listener: (this: Document, ev: DocumentEventMap[K]) => any,\n options?: boolean | AddEventListenerOptions\n ) => void) &\n ((type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions) => void);\n off: (<K extends keyof DocumentEventMap>(\n type: K,\n listener: (this: Document, ev: DocumentEventMap[K]) => any,\n options?: boolean | AddEventListenerOptions\n ) => void) &\n ((type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions) => void);\n removeAllListeners: (<K extends keyof DocumentEventMap>(type: K) => void) & ((type: string) => void);\n dispatchEvent: (event: any) => boolean;\n emit: (event: any, ...args: any) => boolean;\n}\n\nexport interface IDomRectLike {\n bottom: number;\n left: number;\n right: number;\n top: number;\n height: number;\n width: number;\n x: number;\n y: number;\n}\n\nexport type IDirection = 1 | 2;\n\nexport type AsArray<T> = T extends any[] ? T : [T];\n"]}
1
+ {"version":3,"sources":["../src/interface/common.ts"],"names":[],"mappings":"","file":"common.js","sourcesContent":["export type ICurveType =\n | 'basis'\n | 'basisClosed'\n | 'basisOpen'\n | 'bundle'\n | 'cardinal'\n | 'cardinalClosed'\n | 'cardinalOpen'\n | 'stepBefore'\n | 'stepAfter'\n | 'stepClosed'\n | 'catmullRom'\n | 'catmullRomClosed'\n | 'catmullRomOpen'\n | 'linear'\n | 'linearClosed'\n | 'monotoneX'\n | 'monotoneY'\n | 'natural'\n | 'radial'\n | 'step';\n\nexport type MaybePromise<T> = T | PromiseLike<T>;\n\n// 所有的接口都应当继承这个,避免内存没有释放\nexport interface Releaseable {\n release: (...params: any) => void;\n}\n\nexport interface IEventElement {\n // event接口\n addEventListener: (<K extends keyof DocumentEventMap>(\n type: K,\n listener: (this: Document, ev: DocumentEventMap[K]) => any,\n options?: boolean | AddEventListenerOptions\n ) => void) &\n ((type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions) => void);\n on: (<K extends keyof DocumentEventMap>(\n type: K,\n listener: (this: Document, ev: DocumentEventMap[K]) => any,\n options?: boolean | AddEventListenerOptions\n ) => void) &\n ((type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions) => void);\n once: (<K extends keyof DocumentEventMap>(\n type: K,\n listener: (this: Document, ev: DocumentEventMap[K]) => any,\n options?: boolean | AddEventListenerOptions\n ) => void) &\n ((type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions) => void);\n removeEventListener: (<K extends keyof DocumentEventMap>(\n type: K,\n listener: (this: Document, ev: DocumentEventMap[K]) => any,\n options?: boolean | AddEventListenerOptions\n ) => void) &\n ((type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions) => void);\n off: (<K extends keyof DocumentEventMap>(\n type: K,\n listener: (this: Document, ev: DocumentEventMap[K]) => any,\n options?: boolean | AddEventListenerOptions\n ) => void) &\n ((type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions) => void);\n removeAllListeners: (<K extends keyof DocumentEventMap>(type: K) => void) & ((type: string) => void);\n dispatchEvent: (event: any) => boolean;\n emit: (event: any, ...args: any) => boolean;\n}\n\nexport interface IDomRectLike {\n bottom: number;\n left: number;\n right: number;\n top: number;\n height: number;\n width: number;\n x: number;\n y: number;\n}\n\nexport type IDirection = 1 | 2;\n\nexport type AsArray<T> = T extends any[] ? T : [T];\n"]}
@@ -13,6 +13,7 @@ import type { IImage, IImageGraphicAttribute } from './graphic/image';
13
13
  import type { IPath, IPathGraphicAttribute } from './graphic/path';
14
14
  import type { IPolygon, IPolygonGraphicAttribute } from './graphic/polygon';
15
15
  import type { IRect, IRectGraphicAttribute } from './graphic/rect';
16
+ import type { IStar, IStarGraphicAttribute } from './graphic/star';
16
17
  import type { IStage } from './stage';
17
18
  import type { ICanvasLike } from './canvas';
18
19
  import type { IDrawContext } from './render';
@@ -31,6 +32,7 @@ export type IArcRenderContribution = IBaseRenderContribution<IArc, IArcGraphicAt
31
32
  export type ITextRenderContribution = IBaseRenderContribution<IText, ITextGraphicAttribute>;
32
33
  export type IAreaRenderContribution = IBaseRenderContribution<IArea, IAreaGraphicAttribute>;
33
34
  export type ICircleRenderContribution = IBaseRenderContribution<ICircle, ICircleGraphicAttribute>;
35
+ export type IStarRenderContribution = IBaseRenderContribution<IStar, IStarGraphicAttribute>;
34
36
  export type IGroupRenderContribution = IBaseRenderContribution<IGroup, IGroupGraphicAttribute>;
35
37
  export type IImageRenderContribution = IBaseRenderContribution<IImage, IImageGraphicAttribute>;
36
38
  export type IPathRenderContribution = IBaseRenderContribution<IPath, IPathGraphicAttribute>;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/interface/contribution.ts"],"names":[],"mappings":"","file":"contribution.js","sourcesContent":["import type { MaybePromise, Releaseable } from './common';\nimport type { IContext2d } from './context';\nimport type { IThemeAttribute, IMarkAttribute } from './graphic/creator';\nimport type { IGraphicAttribute } from './graphic';\nimport type { ISymbol, ISymbolGraphicAttribute } from './graphic/symbol';\nimport type { BaseRenderContributionTime } from '../common/enums';\nimport type { IArc, IArcGraphicAttribute } from './graphic/arc';\nimport type { IArea, IAreaGraphicAttribute } from './graphic/area';\nimport type { IText, ITextGraphicAttribute } from './graphic/text';\nimport type { ICircle, ICircleGraphicAttribute } from './graphic/circle';\nimport type { IGroup, IGroupGraphicAttribute } from './graphic/group';\nimport type { IImage, IImageGraphicAttribute } from './graphic/image';\nimport type { IPath, IPathGraphicAttribute } from './graphic/path';\nimport type { IPolygon, IPolygonGraphicAttribute } from './graphic/polygon';\nimport type { IRect, IRectGraphicAttribute } from './graphic/rect';\nimport type { IStage } from './stage';\nimport type { ICanvasLike } from './canvas';\nimport type { IDrawContext } from './render';\n\nexport interface IContribution<T> extends Releaseable {\n configure: (service: T, ...data: any) => void;\n}\n\nexport interface IBaseRenderContribution<GraphicType, AttributeType> {\n time: BaseRenderContributionTime;\n useStyle: boolean;\n order: number;\n supportedAppName?: string | string[];\n\n drawShape: (\n graphic: GraphicType,\n context: IContext2d,\n x: number,\n y: number,\n doFill: boolean,\n doStroke: boolean,\n fVisible: boolean,\n sVisible: boolean,\n graphicAttribute: Required<AttributeType>,\n drawContext: IDrawContext,\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 params?: any\n ) => void;\n}\n\nexport type ISymbolRenderContribution = IBaseRenderContribution<ISymbol, ISymbolGraphicAttribute>;\n\nexport type IArcRenderContribution = IBaseRenderContribution<IArc, IArcGraphicAttribute>;\n\nexport type ITextRenderContribution = IBaseRenderContribution<IText, ITextGraphicAttribute>;\n\nexport type IAreaRenderContribution = IBaseRenderContribution<IArea, IAreaGraphicAttribute>;\n\nexport type ICircleRenderContribution = IBaseRenderContribution<ICircle, ICircleGraphicAttribute>;\n\nexport type IGroupRenderContribution = IBaseRenderContribution<IGroup, IGroupGraphicAttribute>;\n\nexport type IImageRenderContribution = IBaseRenderContribution<IImage, IImageGraphicAttribute>;\n\nexport type IPathRenderContribution = IBaseRenderContribution<IPath, IPathGraphicAttribute>;\n\nexport type IPolygonRenderContribution = IBaseRenderContribution<IPolygon, IPolygonGraphicAttribute>;\n\nexport type IRectRenderContribution = IBaseRenderContribution<IRect, IRectGraphicAttribute>;\n\nexport interface IContributionProvider<T> {\n getContributions: () => T[];\n}\n\nexport interface IApplicationContribution {\n // 调用初始化函数\n initialize?: () => void;\n\n configure?: (stage: IStage) => MaybePromise<void>;\n\n onDestroy?: (stage: IStage) => MaybePromise<void>;\n}\n\nexport interface ITTCanvas extends ICanvasLike {\n width: number;\n height: number;\n offsetWidth: number;\n offsetHeight: number;\n getContext: () => any;\n // 构造 getBoundingClientRect 方法\n getBoundingClientRect: () => { width: number; height: number };\n id: string;\n}\n\nexport interface ILynxCanvas extends ICanvasLike {\n width: number;\n height: number;\n offsetWidth: number;\n offsetHeight: number;\n getContext: () => any;\n // 构造 getBoundingClientRect 方法\n getBoundingClientRect: () => { width: number; height: number };\n id: string;\n}\n\nexport interface IDomRef {\n id: string;\n width: number;\n height: number;\n left: number;\n top: number;\n right: number;\n bottom: number;\n x: number;\n y: number;\n\n requestAnimationFrame?: any;\n cancelAnimationFrame?: any;\n getBoundingClientRect?: () => { height: number; width: number };\n}\n"]}
1
+ {"version":3,"sources":["../src/interface/contribution.ts"],"names":[],"mappings":"","file":"contribution.js","sourcesContent":["import type { MaybePromise, Releaseable } from './common';\nimport type { IContext2d } from './context';\nimport type { IThemeAttribute, IMarkAttribute } from './graphic/creator';\nimport type { IGraphicAttribute } from './graphic';\nimport type { ISymbol, ISymbolGraphicAttribute } from './graphic/symbol';\nimport type { BaseRenderContributionTime } from '../common/enums';\nimport type { IArc, IArcGraphicAttribute } from './graphic/arc';\nimport type { IArea, IAreaGraphicAttribute } from './graphic/area';\nimport type { IText, ITextGraphicAttribute } from './graphic/text';\nimport type { ICircle, ICircleGraphicAttribute } from './graphic/circle';\nimport type { IGroup, IGroupGraphicAttribute } from './graphic/group';\nimport type { IImage, IImageGraphicAttribute } from './graphic/image';\nimport type { IPath, IPathGraphicAttribute } from './graphic/path';\nimport type { IPolygon, IPolygonGraphicAttribute } from './graphic/polygon';\nimport type { IRect, IRectGraphicAttribute } from './graphic/rect';\nimport type { IStar, IStarGraphicAttribute } from './graphic/star';\nimport type { IStage } from './stage';\nimport type { ICanvasLike } from './canvas';\nimport type { IDrawContext } from './render';\n\nexport interface IContribution<T> extends Releaseable {\n configure: (service: T, ...data: any) => void;\n}\n\nexport interface IBaseRenderContribution<GraphicType, AttributeType> {\n time: BaseRenderContributionTime;\n useStyle: boolean;\n order: number;\n supportedAppName?: string | string[];\n\n drawShape: (\n graphic: GraphicType,\n context: IContext2d,\n x: number,\n y: number,\n doFill: boolean,\n doStroke: boolean,\n fVisible: boolean,\n sVisible: boolean,\n graphicAttribute: Required<AttributeType>,\n drawContext: IDrawContext,\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 params?: any\n ) => void;\n}\n\nexport type ISymbolRenderContribution = IBaseRenderContribution<ISymbol, ISymbolGraphicAttribute>;\n\nexport type IArcRenderContribution = IBaseRenderContribution<IArc, IArcGraphicAttribute>;\n\nexport type ITextRenderContribution = IBaseRenderContribution<IText, ITextGraphicAttribute>;\n\nexport type IAreaRenderContribution = IBaseRenderContribution<IArea, IAreaGraphicAttribute>;\n\nexport type ICircleRenderContribution = IBaseRenderContribution<ICircle, ICircleGraphicAttribute>;\n\nexport type IStarRenderContribution = IBaseRenderContribution<IStar, IStarGraphicAttribute>;\n\nexport type IGroupRenderContribution = IBaseRenderContribution<IGroup, IGroupGraphicAttribute>;\n\nexport type IImageRenderContribution = IBaseRenderContribution<IImage, IImageGraphicAttribute>;\n\nexport type IPathRenderContribution = IBaseRenderContribution<IPath, IPathGraphicAttribute>;\n\nexport type IPolygonRenderContribution = IBaseRenderContribution<IPolygon, IPolygonGraphicAttribute>;\n\nexport type IRectRenderContribution = IBaseRenderContribution<IRect, IRectGraphicAttribute>;\n\nexport interface IContributionProvider<T> {\n getContributions: () => T[];\n}\n\nexport interface IApplicationContribution {\n // 调用初始化函数\n initialize?: () => void;\n\n configure?: (stage: IStage) => MaybePromise<void>;\n\n onDestroy?: (stage: IStage) => MaybePromise<void>;\n}\n\nexport interface ITTCanvas extends ICanvasLike {\n width: number;\n height: number;\n offsetWidth: number;\n offsetHeight: number;\n getContext: () => any;\n // 构造 getBoundingClientRect 方法\n getBoundingClientRect: () => { width: number; height: number };\n id: string;\n}\n\nexport interface ILynxCanvas extends ICanvasLike {\n width: number;\n height: number;\n offsetWidth: number;\n offsetHeight: number;\n getContext: () => any;\n // 构造 getBoundingClientRect 方法\n getBoundingClientRect: () => { width: number; height: number };\n id: string;\n}\n\nexport interface IDomRef {\n id: string;\n width: number;\n height: number;\n left: number;\n top: number;\n right: number;\n bottom: number;\n x: number;\n y: number;\n\n requestAnimationFrame?: any;\n cancelAnimationFrame?: any;\n getBoundingClientRect?: () => { height: number; width: number };\n}\n"]}
@@ -20,6 +20,7 @@ export * from './rect';
20
20
  export * from './rect3d';
21
21
  export * from './richText';
22
22
  export * from './shadow-root';
23
+ export * from './star';
23
24
  export * from './svg';
24
25
  export * from './symbol';
25
26
  export * from './text';
@@ -28,6 +28,7 @@ __exportStar(require("./path"), exports), __exportStar(require("./polygon"), exp
28
28
  __exportStar(require("./polyline"), exports), __exportStar(require("./pyramid3d"), exports),
29
29
  __exportStar(require("./rect"), exports), __exportStar(require("./rect3d"), exports),
30
30
  __exportStar(require("./richText"), exports), __exportStar(require("./shadow-root"), exports),
31
- __exportStar(require("./svg"), exports), __exportStar(require("./symbol"), exports),
32
- __exportStar(require("./text"), exports), __exportStar(require("./util"), exports);
31
+ __exportStar(require("./star"), exports), __exportStar(require("./svg"), exports),
32
+ __exportStar(require("./symbol"), exports), __exportStar(require("./text"), exports),
33
+ __exportStar(require("./util"), exports);
33
34
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/interface/graphic/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAA0B;AAC1B,0CAAwB;AACxB,wCAAsB;AACtB,0CAAwB;AACxB,yCAAuB;AACvB,2CAAyB;AACzB,2CAAyB;AACzB,4CAA0B;AAC1B,2CAAyB;AACzB,0CAAwB;AACxB,0CAAwB;AACxB,0CAAwB;AACxB,2CAAyB;AACzB,yCAAuB;AACvB,yCAAuB;AACvB,4CAA0B;AAC1B,6CAA2B;AAC3B,8CAA4B;AAC5B,yCAAuB;AACvB,2CAAyB;AACzB,6CAA2B;AAC3B,gDAA8B;AAC9B,wCAAsB;AACtB,2CAAyB;AACzB,yCAAuB;AACvB,yCAAuB","file":"index.js","sourcesContent":["export * from './creator';\nexport * from './theme';\nexport * from './arc';\nexport * from './arc3d';\nexport * from './area';\nexport * from './bounds';\nexport * from './circle';\nexport * from './ellipse';\nexport * from './face3d';\nexport * from './glyph';\nexport * from './group';\nexport * from './image';\nexport * from './isogon';\nexport * from './line';\nexport * from './path';\nexport * from './polygon';\nexport * from './polyline';\nexport * from './pyramid3d';\nexport * from './rect';\nexport * from './rect3d';\nexport * from './richText';\nexport * from './shadow-root';\nexport * from './svg';\nexport * from './symbol';\nexport * from './text';\nexport * from './util';\n"]}
1
+ {"version":3,"sources":["../src/interface/graphic/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAA0B;AAC1B,0CAAwB;AACxB,wCAAsB;AACtB,0CAAwB;AACxB,yCAAuB;AACvB,2CAAyB;AACzB,2CAAyB;AACzB,4CAA0B;AAC1B,2CAAyB;AACzB,0CAAwB;AACxB,0CAAwB;AACxB,0CAAwB;AACxB,2CAAyB;AACzB,yCAAuB;AACvB,yCAAuB;AACvB,4CAA0B;AAC1B,6CAA2B;AAC3B,8CAA4B;AAC5B,yCAAuB;AACvB,2CAAyB;AACzB,6CAA2B;AAC3B,gDAA8B;AAC9B,yCAAuB;AACvB,wCAAsB;AACtB,2CAAyB;AACzB,yCAAuB;AACvB,yCAAuB","file":"index.js","sourcesContent":["export * from './creator';\nexport * from './theme';\nexport * from './arc';\nexport * from './arc3d';\nexport * from './area';\nexport * from './bounds';\nexport * from './circle';\nexport * from './ellipse';\nexport * from './face3d';\nexport * from './glyph';\nexport * from './group';\nexport * from './image';\nexport * from './isogon';\nexport * from './line';\nexport * from './path';\nexport * from './polygon';\nexport * from './polyline';\nexport * from './pyramid3d';\nexport * from './rect';\nexport * from './rect3d';\nexport * from './richText';\nexport * from './shadow-root';\nexport * from './star';\nexport * from './svg';\nexport * from './symbol';\nexport * from './text';\nexport * from './util';\n"]}
@@ -0,0 +1,12 @@
1
+ import type { IPointLike } from '@visactor/vutils';
2
+ import type { IGraphicAttribute, IGraphic } from '../graphic';
3
+ export type IStarAttribute = {
4
+ width: number;
5
+ height: number;
6
+ spikes: number;
7
+ thickness: number;
8
+ };
9
+ export type IStarGraphicAttribute = Partial<IGraphicAttribute> & Partial<IStarAttribute>;
10
+ export type IStar = IGraphic<IStarGraphicAttribute> & {
11
+ getCachedPoints: () => IPointLike[];
12
+ };
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: !0
5
+ });
6
+ //# sourceMappingURL=star.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/interface/graphic/star.ts"],"names":[],"mappings":"","file":"star.js","sourcesContent":["import type { IPointLike } from '@visactor/vutils';\nimport type { IGraphicAttribute, IGraphic } from '../graphic';\n\nexport type IStarAttribute = {\n /**\n * Width of the star\n */\n width: number;\n\n /**\n * Height of the star\n */\n height: number;\n\n /**\n * Number of spikes/corners (must be >= 3)\n */\n spikes: number;\n\n /**\n * How much the corners protrude (0-1)\n * 0 means a regular polygon, 1 means maximum protrusion\n */\n thickness: number;\n};\n\nexport type IStarGraphicAttribute = Partial<IGraphicAttribute> & Partial<IStarAttribute>;\n\nexport type IStar = IGraphic<IStarGraphicAttribute> & {\n getCachedPoints: () => IPointLike[];\n};\n"]}