@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/plugins/builtin-plugin/flex-layout-plugin.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAE/C,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,MAAM,WAAW,GAAG,IAAI,UAAU,EAAE,CAAC;AAQrC,MAAM,OAAO,gBAAgB;IAA7B;QACE,SAAI,GAAuB,kBAAkB,CAAC;QAC9C,gBAAW,GAAiB,YAAY,CAAC;QAEzC,OAAE,GAAW,SAAS,CAAC,kBAAkB,EAAE,CAAC;QAC5C,QAAG,GAAW,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,EAAE,CAAC;QAClC,eAAU,GAAe,IAAI,UAAU,EAAE,CAAC;IA0f5C,CAAC;IAtfC,WAAW,CAAC,CAAU;QACpB,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;IACjB,CAAC;IAED,iBAAiB,CAAC,OAAiB;QACjC,IAAI,OAAO,CAAC,UAAU,EAAE;YACtB,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,UAAsB,CAAC,CAAC;SAChD;IACH,CAAC;IAED,SAAS,CAAC,OAAiB,EAAE,QAAiB,IAAI;QAChD,IAAI,IAAI,CAAC,KAAK,EAAE;YACd,OAAO;SACR;QACD,MAAM,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CAAC,cAAc,CAAC,KAAK,CAAC,qBAAqB,CAAC,IAAI;YACzD,WAAW,CAAC,cAAc,CAAC,KAAK,CAAC,qBAAqB,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;gBACxE,OAAO,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,GAAG,CAAC;YAChC,CAAC,CAAC,CAAC;QACL,WAAW,CAAC,cAAc,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,GAAG,WAAW,CAAC,cAAc,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;YAChH,OAAO,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,GAAG,CAAC;QAChC,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAED,SAAS,UAAU,CAAC,OAAiB,EAAE,KAAa;IAclD,OAAO,CAAC,CAAC;AACX,CAAC;AAED,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAG,EAAE;IAC3C,OAAO,CAAC,cAAc,CAAC,kBAAkB,EAAE,gBAAgB,CAAC,CAAC;AAC/D,CAAC,CAAC","file":"flex-layout-plugin.js","sourcesContent":["import type { IGraphic, IGroup, IGroupAttribute, IStage } from '../../interface';\nimport { getTheme } from '../../graphic/theme';\nimport type { IPlugin, IPluginService } from '../../interface';\nimport { Generator } from '../../common/generator';\nimport type { IAABBBounds } from '@visactor/vutils';\nimport { AABBBounds } from '@visactor/vutils';\nimport { application } from '../../application';\nimport { Factory } from '../../factory';\n\nconst _tempBounds = new AABBBounds();\n\ntype IAnchorPosMap = {\n 'flex-start': number;\n 'flex-end': number;\n center: number;\n};\n\nexport class FlexLayoutPlugin implements IPlugin {\n name: 'FlexLayoutPlugin' = 'FlexLayoutPlugin';\n activeEvent: 'onRegister' = 'onRegister';\n pluginService: IPluginService;\n id: number = Generator.GenAutoIncrementId();\n key: string = this.name + this.id;\n tempBounds: AABBBounds = new AABBBounds();\n pause: boolean;\n skipBoundsTrigger: boolean;\n\n pauseLayout(p: boolean) {\n this.pause = p;\n }\n\n tryLayoutChildren(graphic: IGraphic) {\n if (graphic.firstChild) {\n this.tryLayout(graphic.firstChild as IGraphic);\n }\n }\n\n tryLayout(graphic: IGraphic, force: boolean = true) {\n if (this.pause) {\n return;\n }\n const p = graphic.parent;\n if (!(force || (p && graphic.needUpdateLayout()))) {\n return;\n }\n const theme = getTheme(p).group;\n const { display = theme.display } = p.attribute;\n if (display !== 'flex') {\n return;\n }\n const {\n // width,\n // height,\n flexDirection = theme.flexDirection,\n flexWrap = theme.flexWrap,\n alignItems = theme.alignItems,\n clip = theme.clip\n } = p.attribute;\n const { alignContent = alignItems ?? theme.alignContent } = p.attribute;\n // if (!(width && height)) {\n // return;\n // }\n\n let { width, height, justifyContent = theme.justifyContent } = p.attribute;\n const children = p.getChildren() as IGraphic[];\n if (width == null || height == null) {\n // 计算子节点flex排列后的宽高\n let childrenWidth = 0;\n let childrenHeight = 0;\n let boundsLegal = 0;\n children.forEach((child: IGraphic) => {\n const bounds = this.getAABBBounds(child);\n if (bounds.empty()) {\n return;\n }\n if (flexDirection === 'column' || flexDirection === 'column-reverse') {\n childrenHeight += bounds.height();\n childrenWidth = Math.max(childrenWidth, bounds.width());\n } else {\n childrenWidth += bounds.width();\n childrenHeight = Math.max(childrenHeight, bounds.height());\n }\n boundsLegal += bounds.x1;\n boundsLegal += bounds.y1;\n boundsLegal += bounds.x2;\n boundsLegal += bounds.y2;\n });\n // judgement children bounds legal\n if (!isFinite(boundsLegal)) {\n return;\n }\n width = childrenWidth;\n height = childrenHeight;\n }\n\n if (p.attribute.width == null) {\n p.attribute.width = width;\n } else {\n width = p.attribute.width;\n }\n if (p.attribute.height == null) {\n p.attribute.height = height;\n } else {\n height = p.attribute.height;\n }\n\n // 这里使用p._AABBBounds可能会将非布局造成的bounds更新也会触发重新布局\n // TODO: 增加layout前预处理,在非递归布局前将子节点及其全部父节点_AABBBounds更新\n this.tempBounds.copy(p._AABBBounds);\n const result = {\n main: { len: width, field: 'x' },\n cross: { len: height, field: 'y' }\n };\n const main = result.main;\n const cross = result.cross;\n if (flexDirection === 'column' || flexDirection === 'column-reverse') {\n main.len = height;\n cross.len = width;\n main.field = 'y';\n cross.field = 'x';\n }\n if (flexDirection === 'row-reverse' || flexDirection === 'column-reverse') {\n if (justifyContent === 'flex-start') {\n justifyContent = 'flex-end';\n } else if (justifyContent === 'flex-end') {\n justifyContent = 'flex-start';\n } else {\n children.reverse();\n }\n }\n\n // 计算宽度\n let mainLen = 0;\n let crossLen = 0;\n const mianLenArray: { mainLen: number; crossLen: number }[] = [];\n children.forEach((c: IGraphic) => {\n const b = this.getAABBBounds(c);\n if (b.empty()) {\n return;\n }\n const ml = main.field === 'x' ? b.width() : b.height();\n const cl = cross.field === 'x' ? b.width() : b.height();\n mianLenArray.push({ mainLen: ml, crossLen: cl });\n mainLen += ml;\n crossLen = Math.max(crossLen, cl);\n });\n // 解析main\n const mainList: { idx: number; mainLen: number; crossLen: number }[] = [];\n if (mainLen > main.len && flexWrap === 'wrap') {\n let tempMainL = 0;\n let tempCrossL = 0;\n mianLenArray.forEach(({ mainLen, crossLen }, i) => {\n if (tempMainL + mainLen > main.len) {\n if (tempMainL === 0) {\n mainList.push({ idx: i, mainLen: tempMainL + mainLen, crossLen });\n tempMainL = 0;\n tempCrossL = 0;\n } else {\n mainList.push({ idx: i - 1, mainLen: tempMainL, crossLen: tempCrossL });\n tempMainL = mainLen;\n tempCrossL = crossLen;\n }\n } else {\n tempMainL += mainLen;\n tempCrossL = Math.max(tempCrossL, crossLen);\n }\n });\n mainList.push({ idx: mianLenArray.length - 1, mainLen: tempMainL, crossLen: tempCrossL });\n } else {\n mainList.push({ idx: mianLenArray.length - 1, mainLen: mainLen, crossLen });\n }\n\n // 布局main\n let lastIdx: number = 0;\n mainList.forEach(s => {\n this.layoutMain(p, children, justifyContent, main, mianLenArray, lastIdx, s);\n lastIdx = s.idx + 1;\n });\n\n crossLen = mainList.reduce((a, b) => a + b.crossLen, 0);\n\n // 布局cross\n\n if (mainList.length === 1) {\n const anchorPosMap: IAnchorPosMap = {\n 'flex-start': 0,\n 'flex-end': cross.len,\n center: cross.len / 2\n };\n this.layoutCross(children, alignItems, cross, anchorPosMap, mianLenArray, mainList[0], 0);\n } else {\n if (alignContent === 'flex-start') {\n lastIdx = 0;\n let anchorPos = 0;\n mainList.forEach((s, i) => {\n const anchorPosMap: IAnchorPosMap = {\n 'flex-start': anchorPos,\n 'flex-end': anchorPos + s.crossLen,\n center: anchorPos + s.crossLen / 2\n };\n this.layoutCross(children, 'flex-start', cross, anchorPosMap, mianLenArray, mainList[i], lastIdx);\n lastIdx = s.idx + 1;\n anchorPos += s.crossLen;\n });\n } else if (alignContent === 'center') {\n lastIdx = 0;\n const padding = Math.max(0, (cross.len - crossLen) / 2);\n let anchorPos = padding;\n mainList.forEach((s, i) => {\n const anchorPosMap: IAnchorPosMap = {\n 'flex-start': anchorPos,\n 'flex-end': anchorPos + s.crossLen,\n center: anchorPos + s.crossLen / 2\n };\n this.layoutCross(children, 'center', cross, anchorPosMap, mianLenArray, mainList[i], lastIdx);\n lastIdx = s.idx + 1;\n anchorPos += s.crossLen;\n });\n } else if (alignContent === 'space-around') {\n lastIdx = 0;\n const padding = Math.max(0, (cross.len - crossLen) / mainList.length / 2);\n let anchorPos = padding;\n mainList.forEach((s, i) => {\n const anchorPosMap: IAnchorPosMap = {\n 'flex-start': anchorPos,\n 'flex-end': anchorPos + s.crossLen,\n center: anchorPos + s.crossLen / 2\n };\n this.layoutCross(children, 'flex-start', cross, anchorPosMap, mianLenArray, mainList[i], lastIdx);\n lastIdx = s.idx + 1;\n anchorPos += s.crossLen + padding * 2;\n });\n } else if (alignContent === 'space-between') {\n lastIdx = 0;\n const padding = Math.max(0, (cross.len - crossLen) / (mainList.length * 2 - 2));\n let anchorPos = 0;\n mainList.forEach((s, i) => {\n const anchorPosMap: IAnchorPosMap = {\n 'flex-start': anchorPos,\n 'flex-end': anchorPos + s.crossLen,\n center: anchorPos + s.crossLen / 2\n };\n this.layoutCross(children, 'flex-start', cross, anchorPosMap, mianLenArray, mainList[i], lastIdx);\n lastIdx = s.idx + 1;\n anchorPos += s.crossLen + padding * 2;\n });\n }\n }\n\n // update children\n children.forEach((child, idx) => {\n child.addUpdateBoundTag();\n child.addUpdatePositionTag();\n child.clearUpdateLayoutTag();\n });\n\n p.addUpdateLayoutTag();\n // 更新父级元素的layout,直到存在clip\n const b = this.getAABBBounds(p);\n if (!clip && !this.tempBounds.equals(b)) {\n // 判断父元素包围盒是否发生变化\n this.tryLayout(p, false);\n }\n }\n\n // 避免获取bounds的时候递归进行布局\n getAABBBounds(graphic: IGraphic) {\n this.skipBoundsTrigger = true;\n const b = graphic.AABBBounds;\n this.skipBoundsTrigger = false;\n return b;\n }\n\n // 锚点并不一定总在左上角,根据位置和bounds的偏移进行定位\n private updateChildPos(posBaseLeftTop: number, lastP: number | undefined, lastBP: number): number {\n return posBaseLeftTop + (lastP ?? 0) - lastBP;\n }\n\n layoutMain(\n p: IGroup,\n children: IGraphic[],\n justifyContent: IGroupAttribute['justifyContent'],\n main: { len: number; field: string },\n mianLenArray: { mainLen: number; crossLen: number }[],\n lastIdx: number,\n currSeg: { idx: number; mainLen: number; crossLen: number }\n ) {\n if (justifyContent === 'flex-start') {\n let pos = 0;\n for (let i = lastIdx; i <= currSeg.idx; i++) {\n const posBaseLeftTop = pos + getPadding(children[i], main.field);\n const b = this.getAABBBounds(children[i]);\n !b.empty() &&\n (children[i].attribute[main.field] = this.updateChildPos(\n posBaseLeftTop,\n children[i].attribute[main.field],\n b[`${main.field}1`]\n ));\n pos += mianLenArray[i].mainLen;\n }\n } else if (justifyContent === 'flex-end') {\n let pos = main.len;\n for (let i = currSeg.idx; i >= lastIdx; i--) {\n pos -= mianLenArray[i].mainLen;\n const posBaseLeftTop = pos + getPadding(children[i], main.field);\n const b = this.getAABBBounds(children[i]);\n !b.empty() &&\n (children[i].attribute[main.field] = this.updateChildPos(\n posBaseLeftTop,\n children[i].attribute[main.field],\n b[`${main.field}1`]\n ));\n }\n } else if (justifyContent === 'space-around') {\n if (currSeg.mainLen >= main.len) {\n let pos = 0;\n for (let i = lastIdx; i <= currSeg.idx; i++) {\n const posBaseLeftTop = pos + getPadding(children[i], main.field);\n const b = this.getAABBBounds(children[i]);\n !b.empty() &&\n (children[i].attribute[main.field] = this.updateChildPos(\n posBaseLeftTop,\n children[i].attribute[main.field],\n b[`${main.field}1`]\n ));\n pos += mianLenArray[i].mainLen;\n }\n } else {\n const size = currSeg.idx - lastIdx + 1;\n const padding = (main.len - currSeg.mainLen) / size / 2;\n let pos = padding;\n for (let i = lastIdx; i <= currSeg.idx; i++) {\n const posBaseLeftTop = pos + getPadding(children[i], main.field);\n const b = this.getAABBBounds(children[i]);\n !b.empty() &&\n (children[i].attribute[main.field] = this.updateChildPos(\n posBaseLeftTop,\n children[i].attribute[main.field],\n b[`${main.field}1`]\n ));\n pos += mianLenArray[i].mainLen + padding * 2;\n }\n }\n } else if (justifyContent === 'space-between') {\n if (currSeg.mainLen >= main.len) {\n let pos = 0;\n for (let i = lastIdx; i <= currSeg.idx; i++) {\n const posBaseLeftTop = pos + getPadding(children[i], main.field);\n const b = this.getAABBBounds(children[i]);\n !b.empty() &&\n (children[i].attribute[main.field] = this.updateChildPos(\n posBaseLeftTop,\n children[i].attribute[main.field],\n b[`${main.field}1`]\n ));\n pos += mianLenArray[i].mainLen;\n }\n } else {\n const size = currSeg.idx - lastIdx + 1;\n const padding = (main.len - currSeg.mainLen) / (size * 2 - 2);\n let pos = 0;\n for (let i = lastIdx; i <= currSeg.idx; i++) {\n const posBaseLeftTop = pos + getPadding(children[i], main.field);\n const b = this.getAABBBounds(children[i]);\n !b.empty() &&\n (children[i].attribute[main.field] = this.updateChildPos(\n posBaseLeftTop,\n children[i].attribute[main.field],\n b[`${main.field}1`]\n ));\n pos += mianLenArray[i].mainLen + padding * 2;\n }\n }\n } else if (justifyContent === 'center') {\n let pos = (main.len - currSeg.mainLen) / 2;\n for (let i = lastIdx; i <= currSeg.idx; i++) {\n const posBaseLeftTop = pos + getPadding(children[i], main.field);\n const b = this.getAABBBounds(children[i]);\n !b.empty() &&\n (children[i].attribute[main.field] = this.updateChildPos(\n posBaseLeftTop,\n children[i].attribute[main.field],\n b[`${main.field}1`]\n ));\n pos += mianLenArray[i].mainLen;\n }\n }\n }\n\n layoutCross(\n children: IGraphic[],\n alignItem: IGroupAttribute['alignItems'],\n cross: { len: number; field: string },\n anchorPosMap: IAnchorPosMap,\n lenArray: { mainLen: number; crossLen: number }[],\n currSeg: { idx: number; mainLen: number; crossLen: number },\n lastIdx: number\n ) {\n for (let i = lastIdx; i <= currSeg.idx; i++) {\n const child = children[i];\n let { alignSelf } = child.attribute;\n if (!alignSelf || alignSelf === 'auto') {\n alignSelf = alignItem;\n }\n const b = this.getAABBBounds(child);\n const anchorPos = anchorPosMap[alignSelf] ?? anchorPosMap['flex-start'];\n if (alignSelf === 'flex-end') {\n !b.empty() &&\n (child.attribute[cross.field] = this.updateChildPos(\n anchorPos - lenArray[i].crossLen + getPadding(child, cross.field),\n child.attribute[cross.field],\n b[`${cross.field}1`]\n ));\n } else if (alignSelf === 'center') {\n !b.empty() &&\n (child.attribute[cross.field] = this.updateChildPos(\n anchorPos - lenArray[i].crossLen / 2 + getPadding(child, cross.field),\n child.attribute[cross.field],\n b[`${cross.field}1`]\n ));\n } else {\n !b.empty() &&\n (child.attribute[cross.field] = this.updateChildPos(\n anchorPos + getPadding(child, cross.field),\n child.attribute[cross.field],\n b[`${cross.field}1`]\n ));\n }\n }\n // if (alignItem === 'flex-end') {\n // for (let i = lastIdx; i <= currSeg.idx; i++) {\n // children[i].attribute[cross.field] = this.updateChildPos(\n // anchorPos - lenArray[i].crossLen + getPadding(children[i], cross.field),\n // children[i].attribute[cross.field],\n // children[i].AABBBounds[`${cross.field}1`]\n // );\n // }\n // } else if (alignItem === 'center') {\n // for (let i = lastIdx; i <= currSeg.idx; i++) {\n // children[i].attribute[cross.field] = this.updateChildPos(\n // anchorPos - lenArray[i].crossLen / 2 + getPadding(children[i], cross.field),\n // children[i].attribute[cross.field],\n // children[i].AABBBounds[`${cross.field}1`]\n // );\n // }\n // } else {\n // for (let i = lastIdx; i <= currSeg.idx; i++) {\n // children[i].attribute[cross.field] = this.updateChildPos(\n // anchorPos + getPadding(children[i], cross.field),\n // children[i].attribute[cross.field],\n // children[i].AABBBounds[`${cross.field}1`]\n // );\n // }\n // }\n }\n\n activate(context: IPluginService): void {\n this.pluginService = context;\n // 属性更新\n application.graphicService.hooks.onAttributeUpdate.tap(this.key, graphic => {\n if (graphic.glyphHost) {\n graphic = graphic.glyphHost;\n }\n if (!(graphic.stage && graphic.stage === this.pluginService.stage)) {\n return;\n }\n this.tryLayout(graphic, false);\n });\n // 包围盒更新(如果包围盒发生变化,就重新布局\n application.graphicService.hooks.beforeUpdateAABBBounds.tap(\n this.key,\n (graphic: IGraphic, stage: IStage, willUpdate: boolean, bounds: IAABBBounds) => {\n if (graphic.glyphHost) {\n graphic = graphic.glyphHost;\n }\n if (!(stage && stage === this.pluginService.stage)) {\n return;\n }\n if (!graphic.isContainer || this.skipBoundsTrigger) {\n return;\n }\n _tempBounds.copy(bounds);\n }\n );\n application.graphicService.hooks.afterUpdateAABBBounds.tap(\n this.key,\n (\n graphic: IGraphic,\n stage: IStage,\n bounds: IAABBBounds,\n params: { globalAABBBounds: IAABBBounds },\n selfChange: boolean\n ) => {\n if (!(stage && stage === this.pluginService.stage)) {\n return;\n }\n if (!graphic.isContainer || this.skipBoundsTrigger) {\n return;\n }\n if (!_tempBounds.equals(bounds)) {\n this.tryLayout(graphic, false);\n }\n }\n );\n // 添加到场景树\n application.graphicService.hooks.onSetStage.tap(this.key, graphic => {\n if (graphic.glyphHost) {\n graphic = graphic.glyphHost;\n }\n this.tryLayout(graphic, false);\n });\n }\n deactivate(context: IPluginService): void {\n application.graphicService.hooks.onAttributeUpdate.taps =\n application.graphicService.hooks.onAttributeUpdate.taps.filter(item => {\n return item.name !== this.key;\n });\n application.graphicService.hooks.beforeUpdateAABBBounds.taps =\n application.graphicService.hooks.beforeUpdateAABBBounds.taps.filter(item => {\n return item.name !== this.key;\n });\n application.graphicService.hooks.afterUpdateAABBBounds.taps =\n application.graphicService.hooks.afterUpdateAABBBounds.taps.filter(item => {\n return item.name !== this.key;\n });\n application.graphicService.hooks.onSetStage.taps = application.graphicService.hooks.onSetStage.taps.filter(item => {\n return item.name !== this.key;\n });\n }\n}\n\nfunction getPadding(graphic: IGraphic, field: string): number {\n // if (!graphic.attribute.boundsPadding) {\n // return 0;\n // } else if (isNumber(graphic.attribute.boundsPadding)) {\n // return graphic.attribute.boundsPadding as number;\n // } else if (isArray(graphic.attribute.boundsPadding) && graphic.attribute.boundsPadding.length === 1) {\n // return graphic.attribute.boundsPadding[0];\n // }\n // const paddingArray = parsePadding(graphic.attribute.boundsPadding);\n // if (field === 'x') {\n // return paddingArray[3];\n // } else if (field === 'y') {\n // return paddingArray[0];\n // }\n return 0;\n}\n\nexport const registerFlexLayoutPlugin = () => {\n Factory.registerPlugin('FlexLayoutPlugin', FlexLayoutPlugin);\n};\n"]}
1
+ {"version":3,"sources":["../src/plugins/builtin-plugin/flex-layout-plugin.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAE/C,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,MAAM,WAAW,GAAG,IAAI,UAAU,EAAE,CAAC;AAQrC,MAAM,OAAO,gBAAgB;IAA7B;QACE,SAAI,GAAuB,kBAAkB,CAAC;QAC9C,gBAAW,GAAiB,YAAY,CAAC;QAEzC,OAAE,GAAW,SAAS,CAAC,kBAAkB,EAAE,CAAC;QAC5C,QAAG,GAAW,IAAI,CAAC,IAAI,GAA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;IAC3C,OAAO,CAAC,cAAc,CAAC,kBAAkB,EAAE,gBAAgB,CAAC,CAAC;AAC/D,CAAC,CAAC","file":"flex-layout-plugin.js","sourcesContent":["import type { IGraphic, IGroup, IGroupAttribute, IStage } from '../../interface';\nimport { getTheme } from '../../graphic/theme';\nimport type { IPlugin, IPluginService } from '../../interface';\nimport { Generator } from '../../common/generator';\nimport type { IAABBBounds } from '@visactor/vutils';\nimport { AABBBounds } from '@visactor/vutils';\nimport { application } from '../../application';\nimport { Factory } from '../../factory';\n\nconst _tempBounds = new AABBBounds();\n\ntype IAnchorPosMap = {\n 'flex-start': number;\n 'flex-end': number;\n center: number;\n};\n\nexport class FlexLayoutPlugin implements IPlugin {\n name: 'FlexLayoutPlugin' = 'FlexLayoutPlugin';\n activeEvent: 'onRegister' = 'onRegister';\n pluginService: IPluginService;\n id: number = Generator.GenAutoIncrementId();\n key: string = this.name + this.id;\n tempBounds: AABBBounds = new AABBBounds();\n pause: boolean;\n skipBoundsTrigger: boolean;\n\n pauseLayout(p: boolean) {\n this.pause = p;\n }\n\n tryLayoutChildren(graphic: IGraphic) {\n if (graphic.firstChild) {\n this.tryLayout(graphic.firstChild as IGraphic);\n }\n }\n\n tryLayout(graphic: IGraphic, force: boolean = true) {\n if (this.pause) {\n return;\n }\n const p = graphic.parent;\n if (!(force || (p && graphic.needUpdateLayout()))) {\n return;\n }\n const theme = getTheme(p).group;\n const { display = theme.display } = p.attribute;\n if (display !== 'flex') {\n return;\n }\n const {\n // width,\n // height,\n flexDirection = theme.flexDirection,\n flexWrap = theme.flexWrap,\n alignItems = theme.alignItems,\n clip = theme.clip\n } = p.attribute;\n const { alignContent = alignItems ?? theme.alignContent } = p.attribute;\n // if (!(width && height)) {\n // return;\n // }\n\n let { width, height, justifyContent = theme.justifyContent } = p.attribute;\n const children = p.getChildren() as IGraphic[];\n if (width == null || height == null) {\n // 计算子节点flex排列后的宽高\n let childrenWidth = 0;\n let childrenHeight = 0;\n let boundsLegal = 0;\n children.forEach((child: IGraphic) => {\n const bounds = this.getAABBBounds(child);\n if (bounds.empty()) {\n return;\n }\n if (flexDirection === 'column' || flexDirection === 'column-reverse') {\n childrenHeight += bounds.height();\n childrenWidth = Math.max(childrenWidth, bounds.width());\n } else {\n childrenWidth += bounds.width();\n childrenHeight = Math.max(childrenHeight, bounds.height());\n }\n boundsLegal += bounds.x1;\n boundsLegal += bounds.y1;\n boundsLegal += bounds.x2;\n boundsLegal += bounds.y2;\n });\n // judgement children bounds legal\n if (!isFinite(boundsLegal)) {\n return;\n }\n width = childrenWidth;\n height = childrenHeight;\n }\n\n if (p.attribute.width == null) {\n p.attribute.width = width;\n } else {\n width = p.attribute.width;\n }\n if (p.attribute.height == null) {\n p.attribute.height = height;\n } else {\n height = p.attribute.height;\n }\n\n // 这里使用p._AABBBounds可能会将非布局造成的bounds更新也会触发重新布局\n // TODO: 增加layout前预处理,在非递归布局前将子节点及其全部父节点_AABBBounds更新\n this.tempBounds.copy(p._AABBBounds);\n const result = {\n main: { len: width, field: 'x' },\n cross: { len: height, field: 'y' }\n };\n const main = result.main;\n const cross = result.cross;\n if (flexDirection === 'column' || flexDirection === 'column-reverse') {\n main.len = height;\n cross.len = width;\n main.field = 'y';\n cross.field = 'x';\n }\n if (flexDirection === 'row-reverse' || flexDirection === 'column-reverse') {\n if (justifyContent === 'flex-start') {\n justifyContent = 'flex-end';\n } else if (justifyContent === 'flex-end') {\n justifyContent = 'flex-start';\n } else {\n children.reverse();\n }\n }\n\n // 计算宽度\n let mainLen = 0;\n let crossLen = 0;\n const mianLenArray: { mainLen: number; crossLen: number }[] = [];\n children.forEach((c: IGraphic) => {\n const b = this.getAABBBounds(c);\n if (b.empty()) {\n return;\n }\n const ml = main.field === 'x' ? b.width() : b.height();\n const cl = cross.field === 'x' ? b.width() : b.height();\n mianLenArray.push({ mainLen: ml, crossLen: cl });\n mainLen += ml;\n crossLen = Math.max(crossLen, cl);\n });\n // 解析main\n const mainList: { idx: number; mainLen: number; crossLen: number }[] = [];\n if (mainLen > main.len && flexWrap === 'wrap') {\n let tempMainL = 0;\n let tempCrossL = 0;\n mianLenArray.forEach(({ mainLen, crossLen }, i) => {\n if (tempMainL + mainLen > main.len) {\n if (tempMainL === 0) {\n mainList.push({ idx: i, mainLen: tempMainL + mainLen, crossLen });\n tempMainL = 0;\n tempCrossL = 0;\n } else {\n mainList.push({ idx: i - 1, mainLen: tempMainL, crossLen: tempCrossL });\n tempMainL = mainLen;\n tempCrossL = crossLen;\n }\n } else {\n tempMainL += mainLen;\n tempCrossL = Math.max(tempCrossL, crossLen);\n }\n });\n mainList.push({ idx: mianLenArray.length - 1, mainLen: tempMainL, crossLen: tempCrossL });\n } else {\n mainList.push({ idx: mianLenArray.length - 1, mainLen: mainLen, crossLen });\n }\n\n // 布局main\n let lastIdx: number = 0;\n mainList.forEach(s => {\n this.layoutMain(p, children, justifyContent, main, mianLenArray, lastIdx, s);\n lastIdx = s.idx + 1;\n });\n\n crossLen = mainList.reduce((a, b) => a + b.crossLen, 0);\n\n // 布局cross\n\n if (mainList.length === 1) {\n const anchorPosMap: IAnchorPosMap = {\n 'flex-start': 0,\n 'flex-end': cross.len,\n center: cross.len / 2\n };\n this.layoutCross(children, alignItems, cross, anchorPosMap, mianLenArray, mainList[0], 0);\n } else {\n if (alignContent === 'flex-start') {\n lastIdx = 0;\n let anchorPos = 0;\n mainList.forEach((s, i) => {\n const anchorPosMap: IAnchorPosMap = {\n 'flex-start': anchorPos,\n 'flex-end': anchorPos + s.crossLen,\n center: anchorPos + s.crossLen / 2\n };\n this.layoutCross(children, 'flex-start', cross, anchorPosMap, mianLenArray, mainList[i], lastIdx);\n lastIdx = s.idx + 1;\n anchorPos += s.crossLen;\n });\n } else if (alignContent === 'center') {\n lastIdx = 0;\n const padding = Math.max(0, (cross.len - crossLen) / 2);\n let anchorPos = padding;\n mainList.forEach((s, i) => {\n const anchorPosMap: IAnchorPosMap = {\n 'flex-start': anchorPos,\n 'flex-end': anchorPos + s.crossLen,\n center: anchorPos + s.crossLen / 2\n };\n this.layoutCross(children, 'center', cross, anchorPosMap, mianLenArray, mainList[i], lastIdx);\n lastIdx = s.idx + 1;\n anchorPos += s.crossLen;\n });\n } else if (alignContent === 'space-around') {\n lastIdx = 0;\n const padding = Math.max(0, (cross.len - crossLen) / mainList.length / 2);\n let anchorPos = padding;\n mainList.forEach((s, i) => {\n const anchorPosMap: IAnchorPosMap = {\n 'flex-start': anchorPos,\n 'flex-end': anchorPos + s.crossLen,\n center: anchorPos + s.crossLen / 2\n };\n this.layoutCross(children, 'flex-start', cross, anchorPosMap, mianLenArray, mainList[i], lastIdx);\n lastIdx = s.idx + 1;\n anchorPos += s.crossLen + padding * 2;\n });\n } else if (alignContent === 'space-between') {\n lastIdx = 0;\n const padding = Math.max(0, (cross.len - crossLen) / (mainList.length * 2 - 2));\n let anchorPos = 0;\n mainList.forEach((s, i) => {\n const anchorPosMap: IAnchorPosMap = {\n 'flex-start': anchorPos,\n 'flex-end': anchorPos + s.crossLen,\n center: anchorPos + s.crossLen / 2\n };\n this.layoutCross(children, 'flex-start', cross, anchorPosMap, mianLenArray, mainList[i], lastIdx);\n lastIdx = s.idx + 1;\n anchorPos += s.crossLen + padding * 2;\n });\n }\n }\n\n // update children\n children.forEach((child, idx) => {\n child.addUpdateBoundTag();\n child.addUpdatePositionTag();\n child.clearUpdateLayoutTag();\n });\n\n p.addUpdateLayoutTag();\n // 更新父级元素的layout,直到存在clip\n const b = this.getAABBBounds(p);\n if (!clip && !this.tempBounds.equals(b)) {\n // 判断父元素包围盒是否发生变化\n this.tryLayout(p, false);\n }\n }\n\n // 避免获取bounds的时候递归进行布局\n getAABBBounds(graphic: IGraphic) {\n this.skipBoundsTrigger = true;\n const b = graphic.AABBBounds;\n this.skipBoundsTrigger = false;\n return b;\n }\n\n // 锚点并不一定总在左上角,根据位置和bounds的偏移进行定位\n private updateChildPos(posBaseLeftTop: number, lastP: number | undefined, lastBP: number): number {\n return posBaseLeftTop + (lastP ?? 0) - lastBP;\n }\n\n layoutMain(\n p: IGroup,\n children: IGraphic[],\n justifyContent: IGroupAttribute['justifyContent'],\n main: { len: number; field: string },\n mianLenArray: { mainLen: number; crossLen: number }[],\n lastIdx: number,\n currSeg: { idx: number; mainLen: number; crossLen: number }\n ) {\n if (justifyContent === 'flex-start') {\n let pos = 0;\n for (let i = lastIdx; i <= currSeg.idx; i++) {\n const posBaseLeftTop = pos + getPadding(children[i], main.field);\n const b = this.getAABBBounds(children[i]);\n !b.empty() &&\n (children[i].attribute[main.field] = this.updateChildPos(\n posBaseLeftTop,\n children[i].attribute[main.field],\n b[`${main.field}1`]\n ));\n pos += mianLenArray[i].mainLen;\n }\n } else if (justifyContent === 'flex-end') {\n let pos = main.len;\n for (let i = currSeg.idx; i >= lastIdx; i--) {\n pos -= mianLenArray[i].mainLen;\n const posBaseLeftTop = pos + getPadding(children[i], main.field);\n const b = this.getAABBBounds(children[i]);\n !b.empty() &&\n (children[i].attribute[main.field] = this.updateChildPos(\n posBaseLeftTop,\n children[i].attribute[main.field],\n b[`${main.field}1`]\n ));\n }\n } else if (justifyContent === 'space-around') {\n if (currSeg.mainLen >= main.len) {\n let pos = 0;\n for (let i = lastIdx; i <= currSeg.idx; i++) {\n const posBaseLeftTop = pos + getPadding(children[i], main.field);\n const b = this.getAABBBounds(children[i]);\n !b.empty() &&\n (children[i].attribute[main.field] = this.updateChildPos(\n posBaseLeftTop,\n children[i].attribute[main.field],\n b[`${main.field}1`]\n ));\n pos += mianLenArray[i].mainLen;\n }\n } else {\n const size = currSeg.idx - lastIdx + 1;\n const padding = (main.len - currSeg.mainLen) / size / 2;\n let pos = padding;\n for (let i = lastIdx; i <= currSeg.idx; i++) {\n const posBaseLeftTop = pos + getPadding(children[i], main.field);\n const b = this.getAABBBounds(children[i]);\n !b.empty() &&\n (children[i].attribute[main.field] = this.updateChildPos(\n posBaseLeftTop,\n children[i].attribute[main.field],\n b[`${main.field}1`]\n ));\n pos += mianLenArray[i].mainLen + padding * 2;\n }\n }\n } else if (justifyContent === 'space-between') {\n if (currSeg.mainLen >= main.len) {\n let pos = 0;\n for (let i = lastIdx; i <= currSeg.idx; i++) {\n const posBaseLeftTop = pos + getPadding(children[i], main.field);\n const b = this.getAABBBounds(children[i]);\n !b.empty() &&\n (children[i].attribute[main.field] = this.updateChildPos(\n posBaseLeftTop,\n children[i].attribute[main.field],\n b[`${main.field}1`]\n ));\n pos += mianLenArray[i].mainLen;\n }\n } else {\n const size = currSeg.idx - lastIdx + 1;\n const padding = (main.len - currSeg.mainLen) / (size * 2 - 2);\n let pos = 0;\n for (let i = lastIdx; i <= currSeg.idx; i++) {\n const posBaseLeftTop = pos + getPadding(children[i], main.field);\n const b = this.getAABBBounds(children[i]);\n !b.empty() &&\n (children[i].attribute[main.field] = this.updateChildPos(\n posBaseLeftTop,\n children[i].attribute[main.field],\n b[`${main.field}1`]\n ));\n pos += mianLenArray[i].mainLen + padding * 2;\n }\n }\n } else if (justifyContent === 'center') {\n let pos = (main.len - currSeg.mainLen) / 2;\n for (let i = lastIdx; i <= currSeg.idx; i++) {\n const posBaseLeftTop = pos + getPadding(children[i], main.field);\n const b = this.getAABBBounds(children[i]);\n !b.empty() &&\n (children[i].attribute[main.field] = this.updateChildPos(\n posBaseLeftTop,\n children[i].attribute[main.field],\n b[`${main.field}1`]\n ));\n pos += mianLenArray[i].mainLen;\n }\n }\n }\n\n layoutCross(\n children: IGraphic[],\n alignItem: IGroupAttribute['alignItems'],\n cross: { len: number; field: string },\n anchorPosMap: IAnchorPosMap,\n lenArray: { mainLen: number; crossLen: number }[],\n currSeg: { idx: number; mainLen: number; crossLen: number },\n lastIdx: number\n ) {\n for (let i = lastIdx; i <= currSeg.idx; i++) {\n const child = children[i];\n let { alignSelf } = child.attribute;\n if (!alignSelf || alignSelf === 'auto') {\n alignSelf = alignItem;\n }\n const b = this.getAABBBounds(child);\n const anchorPos = anchorPosMap[alignSelf] ?? anchorPosMap['flex-start'];\n if (alignSelf === 'flex-end') {\n !b.empty() &&\n (child.attribute[cross.field] = this.updateChildPos(\n anchorPos - lenArray[i].crossLen + getPadding(child, cross.field),\n child.attribute[cross.field],\n b[`${cross.field}1`]\n ));\n } else if (alignSelf === 'center') {\n !b.empty() &&\n (child.attribute[cross.field] = this.updateChildPos(\n anchorPos - lenArray[i].crossLen / 2 + getPadding(child, cross.field),\n child.attribute[cross.field],\n b[`${cross.field}1`]\n ));\n } else {\n !b.empty() &&\n (child.attribute[cross.field] = this.updateChildPos(\n anchorPos + getPadding(child, cross.field),\n child.attribute[cross.field],\n b[`${cross.field}1`]\n ));\n }\n }\n // if (alignItem === 'flex-end') {\n // for (let i = lastIdx; i <= currSeg.idx; i++) {\n // children[i].attribute[cross.field] = this.updateChildPos(\n // anchorPos - lenArray[i].crossLen + getPadding(children[i], cross.field),\n // children[i].attribute[cross.field],\n // children[i].AABBBounds[`${cross.field}1`]\n // );\n // }\n // } else if (alignItem === 'center') {\n // for (let i = lastIdx; i <= currSeg.idx; i++) {\n // children[i].attribute[cross.field] = this.updateChildPos(\n // anchorPos - lenArray[i].crossLen / 2 + getPadding(children[i], cross.field),\n // children[i].attribute[cross.field],\n // children[i].AABBBounds[`${cross.field}1`]\n // );\n // }\n // } else {\n // for (let i = lastIdx; i <= currSeg.idx; i++) {\n // children[i].attribute[cross.field] = this.updateChildPos(\n // anchorPos + getPadding(children[i], cross.field),\n // children[i].attribute[cross.field],\n // children[i].AABBBounds[`${cross.field}1`]\n // );\n // }\n // }\n }\n\n activate(context: IPluginService): void {\n this.pluginService = context;\n const stage = this.pluginService.stage;\n if (!stage) {\n return;\n }\n // 属性更新\n stage.graphicService.hooks.onAttributeUpdate.tap(this.key, graphic => {\n if (graphic.glyphHost) {\n graphic = graphic.glyphHost;\n }\n if (!(graphic.stage && graphic.stage === this.pluginService.stage)) {\n return;\n }\n this.tryLayout(graphic, false);\n });\n // 包围盒更新(如果包围盒发生变化,就重新布局\n stage.graphicService.hooks.beforeUpdateAABBBounds.tap(\n this.key,\n (graphic: IGraphic, stage: IStage, willUpdate: boolean, bounds: IAABBBounds) => {\n if (graphic.glyphHost) {\n graphic = graphic.glyphHost;\n }\n if (!(stage && stage === this.pluginService.stage)) {\n return;\n }\n if (!graphic.isContainer || this.skipBoundsTrigger) {\n return;\n }\n _tempBounds.copy(bounds);\n }\n );\n stage.graphicService.hooks.afterUpdateAABBBounds.tap(\n this.key,\n (\n graphic: IGraphic,\n stage: IStage,\n bounds: IAABBBounds,\n params: { globalAABBBounds: IAABBBounds },\n selfChange: boolean\n ) => {\n if (!(stage && stage === this.pluginService.stage)) {\n return;\n }\n if (!graphic.isContainer || this.skipBoundsTrigger) {\n return;\n }\n if (!_tempBounds.equals(bounds)) {\n this.tryLayout(graphic, false);\n }\n }\n );\n // 添加到场景树\n stage.graphicService.hooks.onSetStage.tap(this.key, graphic => {\n if (graphic.glyphHost) {\n graphic = graphic.glyphHost;\n }\n this.tryLayout(graphic, false);\n });\n }\n deactivate(context: IPluginService): void {\n const stage = this.pluginService.stage;\n if (!stage) {\n return;\n }\n stage.graphicService.hooks.onAttributeUpdate.taps = stage.graphicService.hooks.onAttributeUpdate.taps.filter(\n item => {\n return item.name !== this.key;\n }\n );\n stage.graphicService.hooks.beforeUpdateAABBBounds.taps =\n stage.graphicService.hooks.beforeUpdateAABBBounds.taps.filter(item => {\n return item.name !== this.key;\n });\n stage.graphicService.hooks.afterUpdateAABBBounds.taps =\n stage.graphicService.hooks.afterUpdateAABBBounds.taps.filter(item => {\n return item.name !== this.key;\n });\n stage.graphicService.hooks.onSetStage.taps = stage.graphicService.hooks.onSetStage.taps.filter(item => {\n return item.name !== this.key;\n });\n }\n}\n\nfunction getPadding(graphic: IGraphic, field: string): number {\n // if (!graphic.attribute.boundsPadding) {\n // return 0;\n // } else if (isNumber(graphic.attribute.boundsPadding)) {\n // return graphic.attribute.boundsPadding as number;\n // } else if (isArray(graphic.attribute.boundsPadding) && graphic.attribute.boundsPadding.length === 1) {\n // return graphic.attribute.boundsPadding[0];\n // }\n // const paddingArray = parsePadding(graphic.attribute.boundsPadding);\n // if (field === 'x') {\n // return paddingArray[3];\n // } else if (field === 'y') {\n // return paddingArray[0];\n // }\n return 0;\n}\n\nexport const registerFlexLayoutPlugin = () => {\n Factory.registerPlugin('FlexLayoutPlugin', FlexLayoutPlugin);\n};\n"]}
@@ -31,7 +31,6 @@ export class HtmlAttributePlugin {
31
31
  }
32
32
  deactivate(context) {
33
33
  context.stage.hooks.afterRender.taps = context.stage.hooks.afterRender.taps.filter((item => item.name !== this.key)),
34
- application.graphicService.hooks.onRemove.unTap(this.key), application.graphicService.hooks.onRelease.unTap(this.key),
35
34
  this.release();
36
35
  }
37
36
  getWrapContainer(stage, userContainer, domParams) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/plugins/builtin-plugin/html-attribute-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAcnD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AACvH,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,MAAM,OAAO,mBAAmB;IAAhC;QACE,SAAI,GAAW,qBAAqB,CAAC;QACrC,gBAAW,GAAiB,YAAY,CAAC;QAEzC,SAAI,GAAW,SAAS,CAAC,kBAAkB,EAAE,CAAC;QAC9C,QAAG,GAAW,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QAEpC,YAAO,GAQH,EAAE,CAAC;QACP,aAAQ,GAAW,CAAC,CAAC;Q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AAC","file":"html-attribute-plugin.js","sourcesContent":["import { Generator } from '../../common/generator';\nimport type {\n IGraphic,\n IPlugin,\n IPluginService,\n IRenderService,\n IGroup,\n IStage,\n CreateDOMParamsType,\n CommonDomOptions,\n SimpleDomStyleOptions,\n IText,\n ILayer\n} from '../../interface';\nimport { application } from '../../application';\nimport { getTheme } from '../../graphic/theme';\nimport { DefaultAttribute } from '../../graphic/config';\nimport { textAttributesToStyle } from '../../common/text';\nimport { isFunction, isNil, isObject, isString, styleStringToObject, calculateAnchorOfBounds } from '@visactor/vutils';\nimport { Factory } from '../../factory';\n\nexport class HtmlAttributePlugin implements IPlugin {\n name: string = 'HtmlAttributePlugin';\n activeEvent: 'onRegister' = 'onRegister';\n pluginService: IPluginService;\n _uid: number = Generator.GenAutoIncrementId();\n key: string = this.name + this._uid;\n\n htmlMap: Record<\n string,\n {\n wrapContainer: HTMLElement;\n nativeContainer: HTMLElement;\n container: string | HTMLElement | null;\n renderId: number;\n }\n > = {};\n renderId: number = 0;\n\n activate(context: IPluginService): void {\n this.pluginService = context;\n context.stage.hooks.afterRender.tap(this.key, stage => {\n if (!(stage && stage === this.pluginService.stage)) {\n return;\n }\n\n // 全量查找,因为可能会有只渲染交互层的情况\n this.drawHTML([...(context.stage.getChildren() as any)]);\n });\n }\n deactivate(context: IPluginService): void {\n context.stage.hooks.afterRender.taps = context.stage.hooks.afterRender.taps.filter(item => {\n return item.name !== this.key;\n });\n application.graphicService.hooks.onRemove.unTap(this.key);\n application.graphicService.hooks.onRelease.unTap(this.key);\n this.release();\n }\n\n getWrapContainer(stage: IStage, userContainer?: string | HTMLElement | null, domParams?: CreateDOMParamsType) {\n let nativeContainer;\n if (userContainer) {\n if (typeof userContainer === 'string') {\n nativeContainer = application.global.getElementById(userContainer);\n } else {\n nativeContainer = userContainer;\n }\n } else {\n nativeContainer = stage.window.getContainer();\n }\n // 创建wrapGroup\n return {\n wrapContainer: application.global.createDom({ tagName: 'div', parent: nativeContainer, ...domParams }),\n nativeContainer\n };\n }\n\n parseDefaultStyleFromGraphic(graphic: IGraphic) {\n const attrs: any = graphic.type === 'text' && graphic.attribute ? graphic.attribute : getTheme(graphic).text;\n\n return textAttributesToStyle(attrs);\n }\n\n getTransformOfText(graphic: IText) {\n const textTheme = getTheme(graphic).text;\n const { textAlign = textTheme.textAlign, textBaseline = textTheme.textBaseline } = graphic.attribute;\n const matrix = graphic.globalTransMatrix;\n const cssAttrs = matrix.toTransformAttrs();\n const { rotateDeg, scaleX, scaleY } = cssAttrs;\n const translateMap: any = {\n left: '0',\n start: '0',\n end: '-100%',\n center: '-50%',\n right: '-100%',\n top: '0',\n middle: '-50%',\n bottom: '-100%',\n alphabetic: '-79%'\n };\n const originMap: any = {\n left: '0',\n start: '0',\n end: '100%',\n center: '50%',\n right: '100%',\n top: '0',\n middle: '50%',\n bottom: '100%',\n alphabetic: '79%'\n };\n\n return {\n textAlign,\n // textBaseline,\n transform: `translate(${translateMap[textAlign]},${translateMap[textBaseline]}) rotate(${rotateDeg}deg) scaleX(${scaleX}) scaleY(${scaleY})`,\n transformOrigin: `${originMap[textAlign]} ${originMap[textBaseline]}`\n };\n }\n\n onWheel = (ev: Event) => {\n try {\n const newEvent = new (ev as any).constructor(ev.type, ev);\n const canvas = this.pluginService.stage.window.getContext().getCanvas().nativeCanvas;\n canvas.dispatchEvent(newEvent);\n } catch (err) {\n return;\n // console.log(err);\n }\n };\n\n updateStyleOfWrapContainer(\n graphic: IGraphic,\n stage: IStage,\n wrapContainer: HTMLElement,\n nativeContainer: HTMLElement,\n options: SimpleDomStyleOptions & CommonDomOptions\n ) {\n const { pointerEvents, penetrateEventList = [] } = options;\n let calculateStyle = this.parseDefaultStyleFromGraphic(graphic);\n\n calculateStyle.display = graphic.attribute.visible !== false ? 'block' : 'none';\n // 事件穿透\n calculateStyle.pointerEvents = pointerEvents === true ? 'all' : pointerEvents ? pointerEvents : 'none';\n if (calculateStyle.pointerEvents !== 'none') {\n // 删除所有的事件\n this.removeWrapContainerEventListener(wrapContainer);\n // 监听所有的事件\n penetrateEventList.forEach(event => {\n if (event === 'wheel') {\n wrapContainer.addEventListener('wheel', this.onWheel);\n }\n });\n }\n\n // 定位wrapGroup\n if (!wrapContainer.style.position) {\n wrapContainer.style.position = 'absolute';\n nativeContainer.style.position = 'relative';\n }\n let left: number = 0;\n let top: number = 0;\n const b = graphic.globalAABBBounds;\n\n let anchorType = options.anchorType;\n\n if (isNil(anchorType)) {\n anchorType = graphic.type === 'text' ? 'position' : 'boundsLeftTop';\n }\n\n if (anchorType === 'boundsLeftTop') {\n // 兼容老的配置,统一配置\n anchorType = 'top-left';\n }\n if (anchorType === 'position' || b.empty()) {\n const matrix = graphic.globalTransMatrix;\n left = matrix.e;\n top = matrix.f;\n } else {\n const anchor = calculateAnchorOfBounds(b, anchorType);\n\n left = anchor.x;\n top = anchor.y;\n }\n\n // 查看wrapGroup的位置\n // const wrapGroupTL = application.global.getElementTopLeft(wrapGroup, false);\n const containerTL = application.global.getElementTopLeft(nativeContainer, false);\n const windowTL = stage.window.getTopLeft(false);\n const viewBox = stage.viewBox;\n const offsetX = left + windowTL.left - containerTL.left + viewBox.x1;\n const offsetTop = top + windowTL.top - containerTL.top + viewBox.y1;\n // wrapGroup.style.transform = `translate(${offsetX}px, ${offsetTop}px)`;\n calculateStyle.left = `${offsetX}px`;\n calculateStyle.top = `${offsetTop}px`;\n\n if (graphic.type === 'text' && anchorType === 'position') {\n calculateStyle = {\n ...calculateStyle,\n ...this.getTransformOfText(graphic as IText)\n };\n }\n\n if (isFunction(options.style)) {\n const userStyle = options.style(\n { top: offsetTop, left: offsetX, width: b.width(), height: b.height() },\n graphic,\n wrapContainer\n );\n\n if (userStyle) {\n calculateStyle = { ...calculateStyle, ...userStyle };\n }\n } else if (isObject(options.style)) {\n calculateStyle = { ...calculateStyle, ...options.style };\n } else if (isString(options.style) && options.style) {\n calculateStyle = { ...calculateStyle, ...styleStringToObject(options.style as string) };\n }\n\n // 更新样式\n application.global.updateDom(wrapContainer, {\n width: options.width,\n height: options.height,\n style: calculateStyle\n });\n }\n\n protected clearCacheContainer() {\n if (this.htmlMap) {\n Object.keys(this.htmlMap).forEach(key => {\n if (this.htmlMap[key] && this.htmlMap[key].renderId !== this.renderId) {\n this.removeElement(key);\n }\n });\n }\n\n this.renderId += 1;\n }\n\n protected drawHTML(layers: ILayer[]) {\n if (application.global.env === 'browser') {\n layers\n .sort((a, b) => {\n return (a.attribute.zIndex ?? DefaultAttribute.zIndex) - (b.attribute.zIndex ?? DefaultAttribute.zIndex);\n })\n .forEach(group => {\n this.renderGroupHTML(group as IGroup);\n });\n\n this.clearCacheContainer();\n }\n }\n\n renderGroupHTML(group: IGroup) {\n this.renderGraphicHTML(group);\n group.forEachChildren((g: IGraphic) => {\n if (g.isContainer) {\n this.renderGroupHTML(g as IGroup);\n } else {\n this.renderGraphicHTML(g);\n }\n });\n }\n\n removeElement(id: string) {\n if (!this.htmlMap || !this.htmlMap[id]) {\n return;\n }\n\n const { wrapContainer } = this.htmlMap[id];\n if (wrapContainer) {\n application.global.removeDom(wrapContainer);\n }\n\n this.htmlMap[id] = null;\n }\n\n removeWrapContainerEventListener(wrapContainer: HTMLElement) {\n wrapContainer.removeEventListener('wheel', this.onWheel);\n }\n\n renderGraphicHTML(graphic: IGraphic) {\n const { html } = graphic.attribute;\n if (!html) {\n return;\n }\n const stage = graphic.stage;\n if (!stage) {\n return;\n }\n const { dom, container } = html;\n\n if (!dom) {\n return;\n }\n const id = isNil(html.id) ? `${graphic.id ?? graphic._uid}_react` : html.id;\n\n if (this.htmlMap && this.htmlMap[id] && container && container !== this.htmlMap[id].container) {\n this.removeElement(id);\n }\n\n if (!this.htmlMap || !this.htmlMap[id]) {\n // createa a wrapper contianer to be the root of react element\n const { wrapContainer, nativeContainer } = this.getWrapContainer(stage, container);\n\n if (wrapContainer) {\n // init append\n if (typeof dom === 'string') {\n wrapContainer.innerHTML = dom;\n } else {\n wrapContainer.appendChild(dom);\n }\n\n if (!this.htmlMap) {\n this.htmlMap = {};\n }\n\n this.htmlMap[id] = { wrapContainer, nativeContainer, container, renderId: this.renderId };\n }\n } else {\n if (typeof dom === 'string') {\n this.htmlMap[id].wrapContainer.innerHTML = dom;\n } else {\n if (dom !== this.htmlMap[id].wrapContainer.firstChild) {\n this.htmlMap[id].wrapContainer.removeChild(this.htmlMap[id].wrapContainer.firstChild);\n this.htmlMap[id].wrapContainer.appendChild(dom);\n }\n }\n }\n\n if (!this.htmlMap || !this.htmlMap[id]) {\n return;\n }\n\n const { wrapContainer, nativeContainer } = this.htmlMap[id];\n\n this.updateStyleOfWrapContainer(graphic, stage, wrapContainer, nativeContainer, html);\n this.htmlMap[id].renderId = this.renderId;\n }\n\n release() {\n if (application.global.env === 'browser') {\n this.removeAllDom(this.pluginService.stage.defaultLayer);\n }\n }\n removeAllDom(g: IGraphic) {\n if (this.htmlMap) {\n Object.keys(this.htmlMap).forEach(key => {\n this.removeElement(key);\n });\n\n this.htmlMap = null;\n }\n }\n}\n\nexport const registerHtmlAttributePlugin = () => {\n Factory.registerPlugin('HtmlAttributePlugin', HtmlAttributePlugin);\n};\n"]}
1
+ {"version":3,"sources":["../src/plugins/builtin-plugin/html-attribute-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAcnD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AACvH,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,MAAM,OAAO,mBAAmB;IAAhC;QACE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BAAqB,EAAE,mBAAmB,CAAC,CAAC;AACrE,CAAC,CAAC","file":"html-attribute-plugin.js","sourcesContent":["import { Generator } from '../../common/generator';\nimport type {\n IGraphic,\n IPlugin,\n IPluginService,\n IRenderService,\n IGroup,\n IStage,\n CreateDOMParamsType,\n CommonDomOptions,\n SimpleDomStyleOptions,\n IText,\n ILayer\n} from '../../interface';\nimport { application } from '../../application';\nimport { getTheme } from '../../graphic/theme';\nimport { DefaultAttribute } from '../../graphic/config';\nimport { textAttributesToStyle } from '../../common/text';\nimport { isFunction, isNil, isObject, isString, styleStringToObject, calculateAnchorOfBounds } from '@visactor/vutils';\nimport { Factory } from '../../factory';\n\nexport class HtmlAttributePlugin implements IPlugin {\n name: string = 'HtmlAttributePlugin';\n activeEvent: 'onRegister' = 'onRegister';\n pluginService: IPluginService;\n _uid: number = Generator.GenAutoIncrementId();\n key: string = this.name + this._uid;\n\n htmlMap: Record<\n string,\n {\n wrapContainer: HTMLElement;\n nativeContainer: HTMLElement;\n container: string | HTMLElement | null;\n renderId: number;\n }\n > = {};\n renderId: number = 0;\n\n activate(context: IPluginService): void {\n this.pluginService = context;\n context.stage.hooks.afterRender.tap(this.key, stage => {\n if (!(stage && stage === this.pluginService.stage)) {\n return;\n }\n\n // 全量查找,因为可能会有只渲染交互层的情况\n this.drawHTML([...(context.stage.getChildren() as any)]);\n });\n }\n deactivate(context: IPluginService): void {\n context.stage.hooks.afterRender.taps = context.stage.hooks.afterRender.taps.filter(item => {\n return item.name !== this.key;\n });\n // application.graphicService.hooks.onRemove.unTap(this.key);\n // application.graphicService.hooks.onRelease.unTap(this.key);\n this.release();\n }\n\n getWrapContainer(stage: IStage, userContainer?: string | HTMLElement | null, domParams?: CreateDOMParamsType) {\n let nativeContainer;\n if (userContainer) {\n if (typeof userContainer === 'string') {\n nativeContainer = application.global.getElementById(userContainer);\n } else {\n nativeContainer = userContainer;\n }\n } else {\n nativeContainer = stage.window.getContainer();\n }\n // 创建wrapGroup\n return {\n wrapContainer: application.global.createDom({ tagName: 'div', parent: nativeContainer, ...domParams }),\n nativeContainer\n };\n }\n\n parseDefaultStyleFromGraphic(graphic: IGraphic) {\n const attrs: any = graphic.type === 'text' && graphic.attribute ? graphic.attribute : getTheme(graphic).text;\n\n return textAttributesToStyle(attrs);\n }\n\n getTransformOfText(graphic: IText) {\n const textTheme = getTheme(graphic).text;\n const { textAlign = textTheme.textAlign, textBaseline = textTheme.textBaseline } = graphic.attribute;\n const matrix = graphic.globalTransMatrix;\n const cssAttrs = matrix.toTransformAttrs();\n const { rotateDeg, scaleX, scaleY } = cssAttrs;\n const translateMap: any = {\n left: '0',\n start: '0',\n end: '-100%',\n center: '-50%',\n right: '-100%',\n top: '0',\n middle: '-50%',\n bottom: '-100%',\n alphabetic: '-79%'\n };\n const originMap: any = {\n left: '0',\n start: '0',\n end: '100%',\n center: '50%',\n right: '100%',\n top: '0',\n middle: '50%',\n bottom: '100%',\n alphabetic: '79%'\n };\n\n return {\n textAlign,\n // textBaseline,\n transform: `translate(${translateMap[textAlign]},${translateMap[textBaseline]}) rotate(${rotateDeg}deg) scaleX(${scaleX}) scaleY(${scaleY})`,\n transformOrigin: `${originMap[textAlign]} ${originMap[textBaseline]}`\n };\n }\n\n onWheel = (ev: Event) => {\n try {\n const newEvent = new (ev as any).constructor(ev.type, ev);\n const canvas = this.pluginService.stage.window.getContext().getCanvas().nativeCanvas;\n canvas.dispatchEvent(newEvent);\n } catch (err) {\n return;\n // console.log(err);\n }\n };\n\n updateStyleOfWrapContainer(\n graphic: IGraphic,\n stage: IStage,\n wrapContainer: HTMLElement,\n nativeContainer: HTMLElement,\n options: SimpleDomStyleOptions & CommonDomOptions\n ) {\n const { pointerEvents, penetrateEventList = [] } = options;\n let calculateStyle = this.parseDefaultStyleFromGraphic(graphic);\n\n calculateStyle.display = graphic.attribute.visible !== false ? 'block' : 'none';\n // 事件穿透\n calculateStyle.pointerEvents = pointerEvents === true ? 'all' : pointerEvents ? pointerEvents : 'none';\n if (calculateStyle.pointerEvents !== 'none') {\n // 删除所有的事件\n this.removeWrapContainerEventListener(wrapContainer);\n // 监听所有的事件\n penetrateEventList.forEach(event => {\n if (event === 'wheel') {\n wrapContainer.addEventListener('wheel', this.onWheel);\n }\n });\n }\n\n // 定位wrapGroup\n if (!wrapContainer.style.position) {\n wrapContainer.style.position = 'absolute';\n nativeContainer.style.position = 'relative';\n }\n let left: number = 0;\n let top: number = 0;\n const b = graphic.globalAABBBounds;\n\n let anchorType = options.anchorType;\n\n if (isNil(anchorType)) {\n anchorType = graphic.type === 'text' ? 'position' : 'boundsLeftTop';\n }\n\n if (anchorType === 'boundsLeftTop') {\n // 兼容老的配置,统一配置\n anchorType = 'top-left';\n }\n if (anchorType === 'position' || b.empty()) {\n const matrix = graphic.globalTransMatrix;\n left = matrix.e;\n top = matrix.f;\n } else {\n const anchor = calculateAnchorOfBounds(b, anchorType);\n\n left = anchor.x;\n top = anchor.y;\n }\n\n // 查看wrapGroup的位置\n // const wrapGroupTL = application.global.getElementTopLeft(wrapGroup, false);\n const containerTL = application.global.getElementTopLeft(nativeContainer, false);\n const windowTL = stage.window.getTopLeft(false);\n const viewBox = stage.viewBox;\n const offsetX = left + windowTL.left - containerTL.left + viewBox.x1;\n const offsetTop = top + windowTL.top - containerTL.top + viewBox.y1;\n // wrapGroup.style.transform = `translate(${offsetX}px, ${offsetTop}px)`;\n calculateStyle.left = `${offsetX}px`;\n calculateStyle.top = `${offsetTop}px`;\n\n if (graphic.type === 'text' && anchorType === 'position') {\n calculateStyle = {\n ...calculateStyle,\n ...this.getTransformOfText(graphic as IText)\n };\n }\n\n if (isFunction(options.style)) {\n const userStyle = options.style(\n { top: offsetTop, left: offsetX, width: b.width(), height: b.height() },\n graphic,\n wrapContainer\n );\n\n if (userStyle) {\n calculateStyle = { ...calculateStyle, ...userStyle };\n }\n } else if (isObject(options.style)) {\n calculateStyle = { ...calculateStyle, ...options.style };\n } else if (isString(options.style) && options.style) {\n calculateStyle = { ...calculateStyle, ...styleStringToObject(options.style as string) };\n }\n\n // 更新样式\n application.global.updateDom(wrapContainer, {\n width: options.width,\n height: options.height,\n style: calculateStyle\n });\n }\n\n protected clearCacheContainer() {\n if (this.htmlMap) {\n Object.keys(this.htmlMap).forEach(key => {\n if (this.htmlMap[key] && this.htmlMap[key].renderId !== this.renderId) {\n this.removeElement(key);\n }\n });\n }\n\n this.renderId += 1;\n }\n\n protected drawHTML(layers: ILayer[]) {\n if (application.global.env === 'browser') {\n layers\n .sort((a, b) => {\n return (a.attribute.zIndex ?? DefaultAttribute.zIndex) - (b.attribute.zIndex ?? DefaultAttribute.zIndex);\n })\n .forEach(group => {\n this.renderGroupHTML(group as IGroup);\n });\n\n this.clearCacheContainer();\n }\n }\n\n renderGroupHTML(group: IGroup) {\n this.renderGraphicHTML(group);\n group.forEachChildren((g: IGraphic) => {\n if (g.isContainer) {\n this.renderGroupHTML(g as IGroup);\n } else {\n this.renderGraphicHTML(g);\n }\n });\n }\n\n removeElement(id: string) {\n if (!this.htmlMap || !this.htmlMap[id]) {\n return;\n }\n\n const { wrapContainer } = this.htmlMap[id];\n if (wrapContainer) {\n application.global.removeDom(wrapContainer);\n }\n\n this.htmlMap[id] = null;\n }\n\n removeWrapContainerEventListener(wrapContainer: HTMLElement) {\n wrapContainer.removeEventListener('wheel', this.onWheel);\n }\n\n renderGraphicHTML(graphic: IGraphic) {\n const { html } = graphic.attribute;\n if (!html) {\n return;\n }\n const stage = graphic.stage;\n if (!stage) {\n return;\n }\n const { dom, container } = html;\n\n if (!dom) {\n return;\n }\n const id = isNil(html.id) ? `${graphic.id ?? graphic._uid}_react` : html.id;\n\n if (this.htmlMap && this.htmlMap[id] && container && container !== this.htmlMap[id].container) {\n this.removeElement(id);\n }\n\n if (!this.htmlMap || !this.htmlMap[id]) {\n // createa a wrapper contianer to be the root of react element\n const { wrapContainer, nativeContainer } = this.getWrapContainer(stage, container);\n\n if (wrapContainer) {\n // init append\n if (typeof dom === 'string') {\n wrapContainer.innerHTML = dom;\n } else {\n wrapContainer.appendChild(dom);\n }\n\n if (!this.htmlMap) {\n this.htmlMap = {};\n }\n\n this.htmlMap[id] = { wrapContainer, nativeContainer, container, renderId: this.renderId };\n }\n } else {\n if (typeof dom === 'string') {\n this.htmlMap[id].wrapContainer.innerHTML = dom;\n } else {\n if (dom !== this.htmlMap[id].wrapContainer.firstChild) {\n this.htmlMap[id].wrapContainer.removeChild(this.htmlMap[id].wrapContainer.firstChild);\n this.htmlMap[id].wrapContainer.appendChild(dom);\n }\n }\n }\n\n if (!this.htmlMap || !this.htmlMap[id]) {\n return;\n }\n\n const { wrapContainer, nativeContainer } = this.htmlMap[id];\n\n this.updateStyleOfWrapContainer(graphic, stage, wrapContainer, nativeContainer, html);\n this.htmlMap[id].renderId = this.renderId;\n }\n\n release() {\n if (application.global.env === 'browser') {\n this.removeAllDom(this.pluginService.stage.defaultLayer);\n }\n }\n removeAllDom(g: IGraphic) {\n if (this.htmlMap) {\n Object.keys(this.htmlMap).forEach(key => {\n this.removeElement(key);\n });\n\n this.htmlMap = null;\n }\n }\n}\n\nexport const registerHtmlAttributePlugin = () => {\n Factory.registerPlugin('HtmlAttributePlugin', HtmlAttributePlugin);\n};\n"]}
@@ -9,17 +9,20 @@ export class IncrementalAutoRenderPlugin {
9
9
  this.key = this.name + this._uid;
10
10
  }
11
11
  activate(context) {
12
- this.pluginService = context, application.graphicService.hooks.onAddIncremental.tap(this.key, ((graphic, group, stage) => {
12
+ this.pluginService = context;
13
+ const stage = this.pluginService.stage;
14
+ stage && (stage.graphicService.hooks.onAddIncremental.tap(this.key, ((graphic, group, stage) => {
13
15
  graphic.glyphHost && (graphic = graphic.glyphHost), graphic.stage === context.stage && null != graphic.stage && (this.nextUserParams.startAtId = group._uid,
14
16
  this.renderNextFrame(group));
15
- })), application.graphicService.hooks.onClearIncremental.tap(this.key, ((group, stage) => {
17
+ })), stage.graphicService.hooks.onClearIncremental.tap(this.key, ((group, stage) => {
16
18
  group.stage === context.stage && null != group.stage && (this.nextUserParams.startAtId = group._uid,
17
19
  this.nextUserParams.restartIncremental = !0, this.renderNextFrame(group));
18
- }));
20
+ })));
19
21
  }
20
22
  deactivate(context) {
21
- application.graphicService.hooks.onAddIncremental.taps = application.graphicService.hooks.onAddIncremental.taps.filter((item => item.name !== this.key)),
22
- application.graphicService.hooks.onClearIncremental.taps = application.graphicService.hooks.onClearIncremental.taps.filter((item => item.name !== this.key));
23
+ const stage = this.pluginService.stage;
24
+ stage && (stage.graphicService.hooks.onAddIncremental.taps = stage.graphicService.hooks.onAddIncremental.taps.filter((item => item.name !== this.key)),
25
+ stage.graphicService.hooks.onClearIncremental.taps = stage.graphicService.hooks.onClearIncremental.taps.filter((item => item.name !== this.key)));
23
26
  }
24
27
  renderNextFrame(group) {
25
28
  this.nextFrameRenderGroupSet.add(group), this.willNextFrameRender || (this.willNextFrameRender = !0,
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/plugins/builtin-plugin/incremental-auto-render-plugin.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD,MAAM,OAAO,2BAA2B;IAAxC;QACE,SAAI,GAAkC,6BAA6B,CAAC;QACpE,gBAAW,GAAiB,YAAY,CAAC;QAE/B,4BAAuB,GAAgB,IAAI,GAAG,EAAE,CAAC;QACjD,wBAAmB,GAAY,KAAK,CAAC;QAC/C,mBAAc,GAA0B,EAAE,CAAC;QAC3C,SAAI,GAAW,SAAS,CAAC,kBAAkB,EAAE,CAAC;QAC9C,QAAG,GAAW,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;IAyEtC,CAAC;IAvEC,QAAQ,CAAC,OAAuB;QAC9B,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC;QAC7B,WAAW,CAAC,cAAc,CAAC,KAAK,CAAC,gBAAgB,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,EA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ACpB,aAAa,EAAE,KAAK,CAAC,aAAa,EAClC,YAAY,EAAE,KAAK,EACnB,SAAS,EAAE,KAAK,CAAC,IAAI,EACrB,OAAO,EAAE,QAAQ,CAAC,KAAK,CAAC,gBAAgB,EAAE,CAAC,UAAU,EAAE,IACpD,IAAI,CAAC,cAAc,EACtB,CAAC;YACL,CAAC,CAAC,CAAC;YACH,IAAI,CAAC,cAAc,GAAG,EAAE,CAAC;YACzB,IAAI,CAAC,uBAAuB,CAAC,KAAK,EAAE,CAAC;SACtC;IACH,CAAC;CACF","file":"incremental-auto-render-plugin.js","sourcesContent":["import type { IGroup, IPlugin, IPluginService, IDrawContext } from '../../interface';\nimport { application } from '../../application';\nimport { Generator } from '../../common/generator';\n\nexport class IncrementalAutoRenderPlugin implements IPlugin {\n name: 'IncrementalAutoRenderPlugin' = 'IncrementalAutoRenderPlugin';\n activeEvent: 'onRegister' = 'onRegister';\n pluginService: IPluginService;\n protected nextFrameRenderGroupSet: Set<IGroup> = new Set();\n protected willNextFrameRender: boolean = false;\n nextUserParams: Partial<IDrawContext> = {};\n _uid: number = Generator.GenAutoIncrementId();\n key: string = this.name + this._uid;\n\n activate(context: IPluginService): void {\n this.pluginService = context;\n application.graphicService.hooks.onAddIncremental.tap(this.key, (graphic, group, stage) => {\n if (graphic.glyphHost) {\n graphic = graphic.glyphHost;\n }\n if (graphic.stage === context.stage && graphic.stage != null) {\n this.nextUserParams.startAtId = group._uid;\n this.renderNextFrame(group);\n }\n });\n application.graphicService.hooks.onClearIncremental.tap(this.key, (group, stage) => {\n if (group.stage === context.stage && group.stage != null) {\n this.nextUserParams.startAtId = group._uid;\n this.nextUserParams.restartIncremental = true;\n this.renderNextFrame(group);\n }\n });\n }\n deactivate(context: IPluginService): void {\n application.graphicService.hooks.onAddIncremental.taps =\n application.graphicService.hooks.onAddIncremental.taps.filter(item => {\n return item.name !== this.key;\n });\n application.graphicService.hooks.onClearIncremental.taps =\n application.graphicService.hooks.onClearIncremental.taps.filter(item => {\n return item.name !== this.key;\n });\n }\n\n renderNextFrame(group: IGroup): void {\n this.nextFrameRenderGroupSet.add(group);\n if (!this.willNextFrameRender) {\n this.willNextFrameRender = true;\n application.global.getRequestAnimationFrame()(() => {\n this._doRenderInThisFrame();\n this.willNextFrameRender = false;\n });\n }\n }\n\n _doRenderInThisFrame() {\n const stage = this.pluginService.stage;\n if (this.nextFrameRenderGroupSet.size) {\n this.nextFrameRenderGroupSet.forEach(group => {\n const layer = group.layer;\n if (!layer || !group.layer.subLayers) {\n return;\n }\n const subLayer = group.layer.subLayers.get(group._uid);\n if (!subLayer || !subLayer.drawContribution) {\n return;\n }\n subLayer.drawContribution.draw(stage.renderService, {\n stage,\n layer,\n viewBox: stage.window.getViewBox(),\n transMatrix: stage.window.getViewBoxTransform(),\n // TODO: 多图层时不应该再用默认background\n clear: 'transparent',\n renderService: stage.renderService,\n updateBounds: false,\n startAtId: group._uid,\n context: subLayer.layer.getNativeHandler().getContext(),\n ...this.nextUserParams\n });\n });\n this.nextUserParams = {};\n this.nextFrameRenderGroupSet.clear();\n }\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/plugins/builtin-plugin/incremental-auto-render-plugin.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD,MAAM,OAAO,2BAA2B;IAAxC;QACE,SAAI,GAAkC,6BAA6B,CAAC;QACpE,gBAAW,GAAiB,YAAY,CAAC;QAE/B,4BAAuB,GAAgB,IAAI,GAAG,EAAE,CAAC;QACjD,wBAAmB,GAAY,KAAK,CAAC;QAC/C,mBAAc,GAA0B,EAAE,CAAC;QAC3C,SAAI,GAAW,SAAS,CAAC,kBAAkB,EAAE,CAAC;QAC9C,QAAG,GAAW,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;IAiFtC,CAAC;IA/EC,QAAQ,CAAC,OAAuB;QAC9B,IA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C,IAAI,CAAC,CAAC;gBACvD,IAAI,CAAC,QAAQ,IAAI,CAAC,QAAQ,CAAC,gBAAgB,EAAE;oBAC3C,OAAO;iBACR;gBACD,QAAQ,CAAC,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,aAAa,kBAChD,KAAK;oBACL,KAAK,EACL,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,UAAU,EAAE,EAClC,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,mBAAmB,EAAE,EAE/C,KAAK,EAAE,aAAa,EACpB,aAAa,EAAE,KAAK,CAAC,aAAa,EAClC,YAAY,EAAE,KAAK,EACnB,SAAS,EAAE,KAAK,CAAC,IAAI,EACrB,OAAO,EAAE,QAAQ,CAAC,KAAK,CAAC,gBAAgB,EAAE,CAAC,UAAU,EAAE,IACpD,IAAI,CAAC,cAAc,EACtB,CAAC;YACL,CAAC,CAAC,CAAC;YACH,IAAI,CAAC,cAAc,GAAG,EAAE,CAAC;YACzB,IAAI,CAAC,uBAAuB,CAAC,KAAK,EAAE,CAAC;SACtC;IACH,CAAC;CACF","file":"incremental-auto-render-plugin.js","sourcesContent":["import type { IGroup, IPlugin, IPluginService, IDrawContext } from '../../interface';\nimport { application } from '../../application';\nimport { Generator } from '../../common/generator';\n\nexport class IncrementalAutoRenderPlugin implements IPlugin {\n name: 'IncrementalAutoRenderPlugin' = 'IncrementalAutoRenderPlugin';\n activeEvent: 'onRegister' = 'onRegister';\n pluginService: IPluginService;\n protected nextFrameRenderGroupSet: Set<IGroup> = new Set();\n protected willNextFrameRender: boolean = false;\n nextUserParams: Partial<IDrawContext> = {};\n _uid: number = Generator.GenAutoIncrementId();\n key: string = this.name + this._uid;\n\n activate(context: IPluginService): void {\n this.pluginService = context;\n const stage = this.pluginService.stage;\n if (!stage) {\n return;\n }\n stage.graphicService.hooks.onAddIncremental.tap(this.key, (graphic, group, stage) => {\n if (graphic.glyphHost) {\n graphic = graphic.glyphHost;\n }\n if (graphic.stage === context.stage && graphic.stage != null) {\n this.nextUserParams.startAtId = group._uid;\n this.renderNextFrame(group);\n }\n });\n stage.graphicService.hooks.onClearIncremental.tap(this.key, (group, stage) => {\n if (group.stage === context.stage && group.stage != null) {\n this.nextUserParams.startAtId = group._uid;\n this.nextUserParams.restartIncremental = true;\n this.renderNextFrame(group);\n }\n });\n }\n deactivate(context: IPluginService): void {\n const stage = this.pluginService.stage;\n if (!stage) {\n return;\n }\n stage.graphicService.hooks.onAddIncremental.taps = stage.graphicService.hooks.onAddIncremental.taps.filter(item => {\n return item.name !== this.key;\n });\n stage.graphicService.hooks.onClearIncremental.taps = stage.graphicService.hooks.onClearIncremental.taps.filter(\n item => {\n return item.name !== this.key;\n }\n );\n }\n\n renderNextFrame(group: IGroup): void {\n this.nextFrameRenderGroupSet.add(group);\n if (!this.willNextFrameRender) {\n this.willNextFrameRender = true;\n application.global.getRequestAnimationFrame()(() => {\n this._doRenderInThisFrame();\n this.willNextFrameRender = false;\n });\n }\n }\n\n _doRenderInThisFrame() {\n const stage = this.pluginService.stage;\n if (this.nextFrameRenderGroupSet.size) {\n this.nextFrameRenderGroupSet.forEach(group => {\n const layer = group.layer;\n if (!layer || !group.layer.subLayers) {\n return;\n }\n const subLayer = group.layer.subLayers.get(group._uid);\n if (!subLayer || !subLayer.drawContribution) {\n return;\n }\n subLayer.drawContribution.draw(stage.renderService, {\n stage,\n layer,\n viewBox: stage.window.getViewBox(),\n transMatrix: stage.window.getViewBoxTransform(),\n // TODO: 多图层时不应该再用默认background\n clear: 'transparent',\n renderService: stage.renderService,\n updateBounds: false,\n startAtId: group._uid,\n context: subLayer.layer.getNativeHandler().getContext(),\n ...this.nextUserParams\n });\n });\n this.nextUserParams = {};\n this.nextFrameRenderGroupSet.clear();\n }\n }\n}\n"]}
@@ -0,0 +1 @@
1
+ export declare function registerStarGraphic(): void;
@@ -0,0 +1,8 @@
1
+ import { createStar } from "../graphic/star";
2
+
3
+ import { graphicCreator } from "../graphic/graphic-creator";
4
+
5
+ export function registerStarGraphic() {
6
+ graphicCreator.RegisterGraphicCreator("star", createStar);
7
+ }
8
+ //# sourceMappingURL=register-star.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/register/register-star.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5D,MAAM,UAAU,mBAAmB;IACjC,cAAc,CAAC,sBAAsB,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;AAC5D,CAAC","file":"register-star.js","sourcesContent":["import { createStar } from '../graphic/star';\nimport { graphicCreator } from '../graphic/graphic-creator';\n\nexport function registerStarGraphic() {\n graphicCreator.RegisterGraphicCreator('star', createStar);\n}\n"]}
@@ -195,7 +195,7 @@ let DefaultCanvasAreaRender = class extends BaseRender {
195
195
  } else startP = points[0], endP = points[points.length - 1];
196
196
  const xTotalLength = abs(endP.x - startP.x), yTotalLength = abs(endP.y - startP.y);
197
197
  direction = null == endP.x1 ? Direction.ROW : null == endP.y1 ? Direction.COLUMN : Number.isFinite(xTotalLength + yTotalLength) ? xTotalLength > yTotalLength ? Direction.ROW : Direction.COLUMN : Direction.ROW,
198
- drawAreaSegments(context.camera ? context : context.nativeContext, cache, clipRange, {
198
+ drawAreaSegments(context, cache, clipRange, {
199
199
  offsetX: offsetX,
200
200
  offsetY: offsetY,
201
201
  offsetZ: offsetZ,
@@ -211,7 +211,7 @@ let DefaultCanvasAreaRender = class extends BaseRender {
211
211
  if (!1 !== stroke) if (strokeCb) strokeCb(context, attribute, defaultAttribute); else {
212
212
  const {stroke: stroke = defaultAttribute && defaultAttribute[1] && defaultAttribute[1].stroke} = attribute;
213
213
  isArray(stroke) && (stroke[0] || stroke[2]) && !1 === stroke[1] && (context.beginPath(),
214
- drawSegments(context.camera ? context : context.nativeContext, stroke[0] ? cache.top : cache.bottom, clipRange, direction === Direction.ROW ? "x" : "y", {
214
+ drawSegments(context, stroke[0] ? cache.top : cache.bottom, clipRange, direction === Direction.ROW ? "x" : "y", {
215
215
  offsetX: offsetX,
216
216
  offsetY: offsetY,
217
217
  offsetZ: offsetZ
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/render/contributions/render/area-render.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AAkB3E,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EACL,uCAAuC,EACvC,oCAAoC,EACrC,MAAM,0CAA0C,CAAC;AAG3C,IAAM,uBAAuB,GAA7B,MAAM,uBAAwB,SAAQ,UAAiB;IAI5D,YAGqB,uBAAuE;QAE1F,KAAK,EAAE,CAAC;QAFW,4BAAuB,GAAvB,uBAAuB,CAAgD;QAL5F,eAAU,GAAW,gBAAgB,CAAC;QAQpC,IAAI,CAAC,oBAAoB,GAAG,CAAC,oCAAoC,EAAE,uCAAuC,CAAC,CAAC;QAC5G,IAAI,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC;IACrC,CAAC;IAED,6BAA6B,CAC3B,IAAW,EACX,OAAmB,E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AO,CAAC,aAAa,EAChD,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,EACpC,SAAS,EACT,SAAS,KAAK,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EACvC;4BACE,OAAO;4BACP,OAAO;4BACP,OAAO;yBACR,CACF,CAAC;qBACH;oBACD,OAAO,CAAC,cAAc,CAAC,IAAI,EAAE,SAAS,EAAE,OAAO,GAAG,OAAO,EAAE,OAAO,GAAG,OAAO,EAAE,gBAAgB,CAAC,CAAC;oBAChG,OAAO,CAAC,MAAM,EAAE,CAAC;iBAClB;aACF;QACH,CAAC,CAAC;QAEF,QAAQ,EAAE,CAAC;QACX,IAAI,CAAC,eAAe,CAClB,IAAI,EACJ,OAAO,EACP,OAAO,EACP,OAAO,EACP,CAAC,CAAC,WAAW,EACb,KAAK,EACL,IAAI,EACJ,KAAK,EACL,gBAAuB,EACvB,WAAW,EACX,MAAM,EACN,IAAI,EACJ,EAAE,SAAS,EAAE,CACd,CAAC;QACF,UAAU,EAAE,CAAC;QAEb,OAAO,GAAG,CAAC;IACb,CAAC;CACF,CAAA;AA1lBY,uBAAuB;IADnC,UAAU,EAAE;IAMR,WAAA,MAAM,CAAC,oBAAoB,CAAC,CAAA;IAC5B,WAAA,KAAK,CAAC,sBAAsB,CAAC,CAAA;;GANrB,uBAAuB,CA0lBnC;SA1lBY,uBAAuB","file":"area-render.js","sourcesContent":["import type { IPointLike } from '@visactor/vutils';\nimport { abs, isArray, min } from '@visactor/vutils';\nimport { inject, injectable, named } from '../../../common/inversify-lite';\nimport type {\n IArea,\n IAreaCacheItem,\n IAreaGraphicAttribute,\n IGraphicAttribute,\n IContext2d,\n IMarkAttribute,\n IThemeAttribute,\n ISegPath2D,\n IAreaRenderContribution,\n IDrawContext,\n IRenderService,\n IGraphicRender,\n IGraphicRenderDrawParams,\n IContributionProvider\n} from '../../../interface';\n// eslint-disable-next-line @typescript-eslint/consistent-type-imports\nimport { ContributionProvider } from '../../../common/contribution-provider';\nimport { calcLineCache } from '../../../common/segment';\n\nimport { getTheme } from '../../../graphic/theme';\nimport { AreaRenderContribution } from './contributions/constants';\nimport { Direction } from '../../../common/enums';\nimport { drawAreaSegments } from '../../../common/render-area';\nimport { AREA_NUMBER_TYPE } from '../../../graphic/constants';\nimport { drawSegments } from '../../../common/render-curve';\nimport { BaseRender } from './base-render';\nimport {\n defaultAreaBackgroundRenderContribution,\n defaultAreaTextureRenderContribution\n} from './contributions/area-contribution-render';\n\n@injectable()\nexport class DefaultCanvasAreaRender extends BaseRender<IArea> implements IGraphicRender {\n type: 'area';\n numberType: number = AREA_NUMBER_TYPE;\n\n constructor(\n @inject(ContributionProvider)\n @named(AreaRenderContribution)\n protected readonly areaRenderContribitions: IContributionProvider<IAreaRenderContribution>\n ) {\n super();\n this.builtinContributions = [defaultAreaTextureRenderContribution, defaultAreaBackgroundRenderContribution];\n this.init(areaRenderContribitions);\n }\n\n drawLinearAreaHighPerformance(\n area: IArea,\n context: IContext2d,\n fill: boolean,\n stroke: boolean,\n fillOpacity: number,\n strokeOpacity: number,\n offsetX: number,\n offsetY: number,\n areaAttribute: Required<IAreaGraphicAttribute>,\n drawContext: IDrawContext,\n params?: IGraphicRenderDrawParams,\n fillCb?: (\n ctx: IContext2d,\n lineAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n lineAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean\n ) {\n const { points } = area.attribute;\n if (points.length < 2) {\n return;\n }\n context.beginPath();\n\n const z = this.z ?? 0;\n const startP = points[0];\n\n context.moveTo(startP.x + offsetX, startP.y + offsetY, z);\n for (let i = 1; i < points.length; i++) {\n const p = points[i];\n context.lineTo(p.x + offsetX, p.y + offsetY, z);\n }\n for (let i = points.length - 1; i >= 0; i--) {\n const p = points[i];\n context.lineTo((p.x1 ?? p.x) + offsetX, (p.y1 ?? p.y) + offsetY, z);\n }\n context.closePath();\n\n // shadow\n context.setShadowBlendStyle && context.setShadowBlendStyle(area, area.attribute, areaAttribute);\n\n this.beforeRenderStep(\n area,\n context,\n offsetX,\n offsetY,\n !!fillOpacity,\n false,\n fill,\n false,\n areaAttribute as any,\n drawContext,\n fillCb,\n null,\n { attribute: area.attribute }\n );\n\n const { x: originX = 0, x: originY = 0 } = area.attribute;\n const _runFill = () => {\n if (fill !== false) {\n if (fillCb) {\n fillCb(context, area.attribute, areaAttribute);\n } else if (fillOpacity) {\n context.setCommonStyle(area, area.attribute, originX - offsetX, originY - offsetY, areaAttribute);\n context.fill();\n }\n }\n };\n\n const _runStroke = () => {\n if (stroke) {\n const { stroke = areaAttribute && areaAttribute.stroke } = area.attribute;\n if (isArray(stroke) && (stroke[0] || stroke[2]) && stroke[1] === false) {\n context.beginPath();\n if (stroke[0]) {\n context.moveTo(startP.x + offsetX, startP.y + offsetY, z);\n for (let i = 1; i < points.length; i++) {\n const p = points[i];\n context.lineTo(p.x + offsetX, p.y + offsetY, z);\n }\n } else if (stroke[2]) {\n const endP = points[points.length - 1];\n context.moveTo(endP.x + offsetX, endP.y + offsetY, z);\n for (let i = points.length - 2; i >= 0; i--) {\n const p = points[i];\n context.lineTo((p.x1 ?? p.x) + offsetX, (p.y1 ?? p.y) + offsetY, z);\n }\n }\n }\n if (strokeCb) {\n strokeCb(context, area.attribute, areaAttribute);\n } else {\n context.setStrokeStyle(area, area.attribute, originX - offsetX, originY - offsetY, areaAttribute);\n context.stroke();\n }\n }\n };\n\n _runFill();\n this.afterRenderStep(\n area,\n context,\n offsetX,\n offsetY,\n !!fillOpacity,\n false,\n fill,\n false,\n areaAttribute as any,\n drawContext,\n fillCb,\n null,\n { attribute: area.attribute }\n );\n _runStroke();\n }\n\n drawShape(\n area: IArea,\n context: IContext2d,\n x: number,\n y: number,\n drawContext: IDrawContext,\n params?: IGraphicRenderDrawParams,\n fillCb?: (\n ctx: IContext2d,\n lineAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean\n ) {\n const areaAttribute = getTheme(area, params?.theme).area;\n const {\n fill = areaAttribute.fill,\n stroke = areaAttribute.stroke,\n fillOpacity = areaAttribute.fillOpacity,\n z = areaAttribute.z,\n strokeOpacity = areaAttribute.strokeOpacity,\n curveTension = areaAttribute.curveTension,\n connectedType = areaAttribute.connectedType\n } = area.attribute;\n\n const data = this.valid(area, areaAttribute, fillCb, strokeCb);\n if (!data) {\n return;\n }\n const { doFill } = data;\n const doStroke = data.doStroke && data.sVisible;\n\n const { clipRange = areaAttribute.clipRange, closePath, points, segments } = area.attribute;\n let { curveType = areaAttribute.curveType } = area.attribute;\n if (closePath && curveType === 'linear') {\n curveType = 'linearClosed';\n }\n\n function parsePoint(points: IPointLike[], connectedType: 'none' | 'connect') {\n if (connectedType !== 'connect') {\n return points;\n }\n return points.filter(p => p.defined !== false);\n }\n\n if (clipRange === 1 && !segments && !points.some(p => p.defined === false) && curveType === 'linear') {\n return this.drawLinearAreaHighPerformance(\n area,\n context,\n !!fill,\n doStroke,\n fillOpacity,\n strokeOpacity,\n x,\n y,\n areaAttribute,\n drawContext,\n params,\n fillCb,\n strokeCb\n );\n }\n\n // 更新cache\n if (area.shouldUpdateShape()) {\n if (segments && segments.length) {\n let startPoint: IPointLike;\n let lastTopSeg: { endX: number; endY: number };\n const topCaches = segments\n .map((seg, index) => {\n if (seg.points.length <= 1) {\n // 第一个点的话,直接设置lastTopSeg\n if (index === 0) {\n seg.points[0] && (lastTopSeg = { endX: seg.points[0].x, endY: seg.points[0].y });\n return null;\n }\n }\n // 添加上一个segment结束的点作为这个segment的起始点\n if (index === 1) {\n startPoint = { x: lastTopSeg.endX, y: lastTopSeg.endY };\n } else if (index > 1) {\n startPoint.x = lastTopSeg.endX;\n startPoint.y = lastTopSeg.endY;\n }\n const data = calcLineCache(parsePoint(seg.points, connectedType), curveType, {\n startPoint,\n curveTension\n });\n lastTopSeg = data;\n return data;\n })\n .filter(item => !!item);\n let lastBottomSeg: ISegPath2D;\n const bottomCaches = [];\n for (let i = segments.length - 1; i >= 0; i--) {\n const points = segments[i].points;\n const bottomPoints: IPointLike[] = [];\n for (let i = points.length - 1; i >= 0; i--) {\n bottomPoints.push({\n x: points[i].x1 ?? points[i].x,\n y: points[i].y1 ?? points[i].y\n });\n }\n // 处理一下bottom的segments,bottom的segments需要手动添加endPoints\n if (i !== 0) {\n const lastSegmentPoints = segments[i - 1].points;\n const endPoint = lastSegmentPoints[lastSegmentPoints.length - 1];\n endPoint &&\n bottomPoints.push({\n x: endPoint.x1 ?? endPoint.x,\n y: endPoint.y1 ?? endPoint.y\n });\n }\n if (bottomPoints.length > 1) {\n lastBottomSeg = calcLineCache(\n parsePoint(bottomPoints, connectedType),\n curveType === 'stepBefore' ? 'stepAfter' : curveType === 'stepAfter' ? 'stepBefore' : curveType,\n { curveTension }\n );\n bottomCaches.unshift(lastBottomSeg);\n }\n }\n area.cacheArea = bottomCaches.map((item, index) => ({\n top: topCaches[index],\n bottom: item\n }));\n } else if (points && points.length) {\n // 转换points\n const topPoints = parsePoint(points, connectedType);\n const bottomPoints: IPointLike[] = [];\n for (let i = topPoints.length - 1; i >= 0; i--) {\n bottomPoints.push({\n x: topPoints[i].x1 ?? topPoints[i].x,\n y: topPoints[i].y1 ?? topPoints[i].y\n });\n }\n const topCache = calcLineCache(topPoints, curveType, { curveTension });\n const bottomCache = calcLineCache(\n bottomPoints,\n curveType === 'stepBefore' ? 'stepAfter' : curveType === 'stepAfter' ? 'stepBefore' : curveType,\n { curveTension }\n );\n\n area.cacheArea = { top: topCache, bottom: bottomCache };\n } else {\n area.cacheArea = null;\n area.clearUpdateShapeTag();\n return;\n }\n area.clearUpdateShapeTag();\n }\n\n if (Array.isArray(area.cacheArea)) {\n const segments = area.attribute.segments.filter(item => item.points.length);\n // 如果第一个seg只有一个点,那么shift出去\n if (segments[0].points.length === 1) {\n segments.shift();\n }\n if (clipRange === 1) {\n let skip = false;\n // 性能优化,不需要clip的线段不需要计算长度\n area.cacheArea.forEach((cache, index) => {\n if (skip) {\n return;\n }\n skip = this.drawSegmentItem(\n context,\n cache,\n doFill,\n fillOpacity,\n doStroke,\n strokeOpacity,\n segments[index],\n [areaAttribute, area.attribute],\n clipRange,\n x,\n y,\n z,\n area,\n drawContext,\n fillCb,\n strokeCb\n );\n });\n } else {\n // 如果是segments的话,每个clipRange需要重新计算\n // 整个线段的总长度\n const totalLength = area.cacheArea.reduce((l, c) => l + c.top.getLength(), 0);\n // 总需要绘制的长度\n const totalDrawLength = clipRange * totalLength;\n // 直到上次绘制的长度\n let drawedLengthUntilLast = 0;\n let skip = false;\n area.cacheArea.forEach((cache, index) => {\n if (skip) {\n return;\n }\n const curSegLength = cache.top.getLength();\n const _cr = (totalDrawLength - drawedLengthUntilLast) / curSegLength;\n drawedLengthUntilLast += curSegLength;\n if (_cr > 0) {\n skip = this.drawSegmentItem(\n context,\n cache,\n doFill,\n fillOpacity,\n doStroke,\n strokeOpacity,\n segments[index],\n [areaAttribute, area.attribute],\n min(_cr, 1),\n x,\n y,\n z,\n area,\n drawContext,\n fillCb,\n strokeCb\n );\n }\n });\n }\n } else {\n this.drawSegmentItem(\n context,\n area.cacheArea as IAreaCacheItem,\n doFill,\n fillOpacity,\n doStroke,\n strokeOpacity,\n area.attribute,\n areaAttribute,\n clipRange,\n x,\n y,\n z,\n area,\n drawContext,\n fillCb,\n strokeCb\n );\n }\n }\n\n draw(area: IArea, renderService: IRenderService, drawContext: IDrawContext, params?: IGraphicRenderDrawParams) {\n const areaAttribute = getTheme(area, params?.theme).area;\n this._draw(area, areaAttribute, false, drawContext, params);\n }\n\n /**\n * 绘制segment\n * @param context\n * @param cache\n * @param fill\n * @param stroke\n * @param attribute\n * @param defaultAttribute\n * @param clipRange\n * @param offsetX\n * @param offsetY\n * @param fillCb\n * @param strokeCb\n * @returns 返回true代表跳过后续绘制\n */\n protected drawSegmentItem(\n context: IContext2d,\n cache: IAreaCacheItem,\n fill: boolean,\n fillOpacity: number,\n stroke: boolean,\n strokeOpacity: number,\n attribute: Partial<IAreaGraphicAttribute>,\n defaultAttribute: Required<IAreaGraphicAttribute> | Partial<IAreaGraphicAttribute>[],\n clipRange: number,\n offsetX: number,\n offsetY: number,\n offsetZ: number,\n area: IArea,\n drawContext: IDrawContext,\n fillCb?: (\n ctx: IContext2d,\n lineAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute | IThemeAttribute[]\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n lineAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute | IThemeAttribute[]\n ) => boolean\n ): boolean {\n return this._drawSegmentItem(\n context,\n cache,\n fill,\n fillOpacity,\n stroke,\n strokeOpacity,\n attribute,\n defaultAttribute,\n clipRange,\n offsetX,\n offsetY,\n offsetZ,\n area,\n drawContext,\n fillCb,\n strokeCb\n );\n }\n\n protected _drawSegmentItem(\n context: IContext2d,\n cache: IAreaCacheItem,\n fill: boolean,\n fillOpacity: number,\n stroke: boolean,\n strokeOpacity: number,\n attribute: Partial<IAreaGraphicAttribute>,\n defaultAttribute: Required<IAreaGraphicAttribute> | Partial<IAreaGraphicAttribute>[],\n clipRange: number,\n offsetX: number,\n offsetY: number,\n offsetZ: number,\n area: IArea,\n drawContext: IDrawContext,\n fillCb?: (\n ctx: IContext2d,\n lineAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute | IThemeAttribute[]\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n lineAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute | IThemeAttribute[]\n ) => boolean\n ) {\n if (\n !(\n cache &&\n cache.top &&\n cache.bottom &&\n cache.top.curves &&\n cache.top.curves.length &&\n cache.bottom.curves &&\n cache.bottom.curves.length\n )\n ) {\n return;\n }\n\n context.beginPath();\n\n const ret: boolean = false;\n const { points, segments } = area.attribute;\n let direction = Direction.ROW;\n let endP: IPointLike;\n let startP: IPointLike;\n if (segments) {\n const endSeg = segments[segments.length - 1];\n const startSeg = segments[0];\n startP = startSeg.points[0];\n endP = endSeg.points[endSeg.points.length - 1];\n } else {\n startP = points[0];\n endP = points[points.length - 1];\n }\n const xTotalLength = abs(endP.x - startP.x);\n const yTotalLength = abs(endP.y - startP.y);\n if (endP.x1 == null) {\n direction = Direction.ROW;\n } else if (endP.y1 == null) {\n direction = Direction.COLUMN;\n } else if (!Number.isFinite(xTotalLength + yTotalLength)) {\n direction = Direction.ROW;\n } else {\n direction = xTotalLength > yTotalLength ? Direction.ROW : Direction.COLUMN;\n }\n drawAreaSegments(context.camera ? context : context.nativeContext, cache, clipRange, {\n offsetX,\n offsetY,\n offsetZ,\n direction\n });\n\n this.beforeRenderStep(\n area,\n context,\n offsetX,\n offsetY,\n !!fillOpacity,\n false,\n fill,\n false,\n defaultAttribute as any,\n drawContext,\n fillCb,\n null,\n { attribute }\n );\n\n // shadow\n context.setShadowBlendStyle && context.setShadowBlendStyle(area, attribute, defaultAttribute);\n\n const { x: originX = 0, x: originY = 0 } = attribute;\n const _runFill = () => {\n if (fill !== false) {\n if (fillCb) {\n fillCb(context, attribute, defaultAttribute);\n } else if (fillOpacity) {\n context.setCommonStyle(area, attribute, originX - offsetX, originY - offsetY, defaultAttribute);\n context.fill();\n }\n }\n };\n\n const _runStroke = () => {\n if (stroke !== false) {\n if (strokeCb) {\n strokeCb(context, attribute, defaultAttribute);\n } else {\n const { stroke = defaultAttribute && (defaultAttribute as any)[1] && (defaultAttribute as any)[1].stroke } =\n attribute;\n if (isArray(stroke) && (stroke[0] || stroke[2]) && stroke[1] === false) {\n context.beginPath();\n drawSegments(\n context.camera ? context : context.nativeContext,\n stroke[0] ? cache.top : cache.bottom,\n clipRange,\n direction === Direction.ROW ? 'x' : 'y',\n {\n offsetX,\n offsetY,\n offsetZ\n }\n );\n }\n context.setStrokeStyle(area, attribute, originX - offsetX, originY - offsetY, defaultAttribute);\n context.stroke();\n }\n }\n };\n\n _runFill();\n this.afterRenderStep(\n area,\n context,\n offsetX,\n offsetY,\n !!fillOpacity,\n false,\n fill,\n false,\n defaultAttribute as any,\n drawContext,\n fillCb,\n null,\n { attribute }\n );\n _runStroke();\n\n return ret;\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/render/contributions/render/area-render.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AAkB3E,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EACL,uCAAuC,EACvC,oCAAoC,EACrC,MAAM,0CAA0C,CAAC;AAG3C,IAAM,uBAAuB,GAA7B,MAAM,uBAAwB,SAAQ,UAAiB;IAI5D,YAGqB,uBAAuE;QAE1F,KAAK,EAAE,CA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AC,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,KAAK,KAAK,EAAE;wBACtE,OAAO,CAAC,SAAS,EAAE,CAAC;wBACpB,YAAY,CACV,OAAO,EACP,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,EACpC,SAAS,EACT,SAAS,KAAK,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EACvC;4BACE,OAAO;4BACP,OAAO;4BACP,OAAO;yBACR,CACF,CAAC;qBACH;oBACD,OAAO,CAAC,cAAc,CAAC,IAAI,EAAE,SAAS,EAAE,OAAO,GAAG,OAAO,EAAE,OAAO,GAAG,OAAO,EAAE,gBAAgB,CAAC,CAAC;oBAChG,OAAO,CAAC,MAAM,EAAE,CAAC;iBAClB;aACF;QACH,CAAC,CAAC;QAEF,QAAQ,EAAE,CAAC;QACX,IAAI,CAAC,eAAe,CAClB,IAAI,EACJ,OAAO,EACP,OAAO,EACP,OAAO,EACP,CAAC,CAAC,WAAW,EACb,KAAK,EACL,IAAI,EACJ,KAAK,EACL,gBAAuB,EACvB,WAAW,EACX,MAAM,EACN,IAAI,EACJ,EAAE,SAAS,EAAE,CACd,CAAC;QACF,UAAU,EAAE,CAAC;QAEb,OAAO,GAAG,CAAC;IACb,CAAC;CACF,CAAA;AA1lBY,uBAAuB;IADnC,UAAU,EAAE;IAMR,WAAA,MAAM,CAAC,oBAAoB,CAAC,CAAA;IAC5B,WAAA,KAAK,CAAC,sBAAsB,CAAC,CAAA;;GANrB,uBAAuB,CA0lBnC;SA1lBY,uBAAuB","file":"area-render.js","sourcesContent":["import type { IPointLike } from '@visactor/vutils';\nimport { abs, isArray, min } from '@visactor/vutils';\nimport { inject, injectable, named } from '../../../common/inversify-lite';\nimport type {\n IArea,\n IAreaCacheItem,\n IAreaGraphicAttribute,\n IGraphicAttribute,\n IContext2d,\n IMarkAttribute,\n IThemeAttribute,\n ISegPath2D,\n IAreaRenderContribution,\n IDrawContext,\n IRenderService,\n IGraphicRender,\n IGraphicRenderDrawParams,\n IContributionProvider\n} from '../../../interface';\n// eslint-disable-next-line @typescript-eslint/consistent-type-imports\nimport { ContributionProvider } from '../../../common/contribution-provider';\nimport { calcLineCache } from '../../../common/segment';\n\nimport { getTheme } from '../../../graphic/theme';\nimport { AreaRenderContribution } from './contributions/constants';\nimport { Direction } from '../../../common/enums';\nimport { drawAreaSegments } from '../../../common/render-area';\nimport { AREA_NUMBER_TYPE } from '../../../graphic/constants';\nimport { drawSegments } from '../../../common/render-curve';\nimport { BaseRender } from './base-render';\nimport {\n defaultAreaBackgroundRenderContribution,\n defaultAreaTextureRenderContribution\n} from './contributions/area-contribution-render';\n\n@injectable()\nexport class DefaultCanvasAreaRender extends BaseRender<IArea> implements IGraphicRender {\n type: 'area';\n numberType: number = AREA_NUMBER_TYPE;\n\n constructor(\n @inject(ContributionProvider)\n @named(AreaRenderContribution)\n protected readonly areaRenderContribitions: IContributionProvider<IAreaRenderContribution>\n ) {\n super();\n this.builtinContributions = [defaultAreaTextureRenderContribution, defaultAreaBackgroundRenderContribution];\n this.init(areaRenderContribitions);\n }\n\n drawLinearAreaHighPerformance(\n area: IArea,\n context: IContext2d,\n fill: boolean,\n stroke: boolean,\n fillOpacity: number,\n strokeOpacity: number,\n offsetX: number,\n offsetY: number,\n areaAttribute: Required<IAreaGraphicAttribute>,\n drawContext: IDrawContext,\n params?: IGraphicRenderDrawParams,\n fillCb?: (\n ctx: IContext2d,\n lineAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n lineAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean\n ) {\n const { points } = area.attribute;\n if (points.length < 2) {\n return;\n }\n context.beginPath();\n\n const z = this.z ?? 0;\n const startP = points[0];\n\n context.moveTo(startP.x + offsetX, startP.y + offsetY, z);\n for (let i = 1; i < points.length; i++) {\n const p = points[i];\n context.lineTo(p.x + offsetX, p.y + offsetY, z);\n }\n for (let i = points.length - 1; i >= 0; i--) {\n const p = points[i];\n context.lineTo((p.x1 ?? p.x) + offsetX, (p.y1 ?? p.y) + offsetY, z);\n }\n context.closePath();\n\n // shadow\n context.setShadowBlendStyle && context.setShadowBlendStyle(area, area.attribute, areaAttribute);\n\n this.beforeRenderStep(\n area,\n context,\n offsetX,\n offsetY,\n !!fillOpacity,\n false,\n fill,\n false,\n areaAttribute as any,\n drawContext,\n fillCb,\n null,\n { attribute: area.attribute }\n );\n\n const { x: originX = 0, x: originY = 0 } = area.attribute;\n const _runFill = () => {\n if (fill !== false) {\n if (fillCb) {\n fillCb(context, area.attribute, areaAttribute);\n } else if (fillOpacity) {\n context.setCommonStyle(area, area.attribute, originX - offsetX, originY - offsetY, areaAttribute);\n context.fill();\n }\n }\n };\n\n const _runStroke = () => {\n if (stroke) {\n const { stroke = areaAttribute && areaAttribute.stroke } = area.attribute;\n if (isArray(stroke) && (stroke[0] || stroke[2]) && stroke[1] === false) {\n context.beginPath();\n if (stroke[0]) {\n context.moveTo(startP.x + offsetX, startP.y + offsetY, z);\n for (let i = 1; i < points.length; i++) {\n const p = points[i];\n context.lineTo(p.x + offsetX, p.y + offsetY, z);\n }\n } else if (stroke[2]) {\n const endP = points[points.length - 1];\n context.moveTo(endP.x + offsetX, endP.y + offsetY, z);\n for (let i = points.length - 2; i >= 0; i--) {\n const p = points[i];\n context.lineTo((p.x1 ?? p.x) + offsetX, (p.y1 ?? p.y) + offsetY, z);\n }\n }\n }\n if (strokeCb) {\n strokeCb(context, area.attribute, areaAttribute);\n } else {\n context.setStrokeStyle(area, area.attribute, originX - offsetX, originY - offsetY, areaAttribute);\n context.stroke();\n }\n }\n };\n\n _runFill();\n this.afterRenderStep(\n area,\n context,\n offsetX,\n offsetY,\n !!fillOpacity,\n false,\n fill,\n false,\n areaAttribute as any,\n drawContext,\n fillCb,\n null,\n { attribute: area.attribute }\n );\n _runStroke();\n }\n\n drawShape(\n area: IArea,\n context: IContext2d,\n x: number,\n y: number,\n drawContext: IDrawContext,\n params?: IGraphicRenderDrawParams,\n fillCb?: (\n ctx: IContext2d,\n lineAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean\n ) {\n const areaAttribute = getTheme(area, params?.theme).area;\n const {\n fill = areaAttribute.fill,\n stroke = areaAttribute.stroke,\n fillOpacity = areaAttribute.fillOpacity,\n z = areaAttribute.z,\n strokeOpacity = areaAttribute.strokeOpacity,\n curveTension = areaAttribute.curveTension,\n connectedType = areaAttribute.connectedType\n } = area.attribute;\n\n const data = this.valid(area, areaAttribute, fillCb, strokeCb);\n if (!data) {\n return;\n }\n const { doFill } = data;\n const doStroke = data.doStroke && data.sVisible;\n\n const { clipRange = areaAttribute.clipRange, closePath, points, segments } = area.attribute;\n let { curveType = areaAttribute.curveType } = area.attribute;\n if (closePath && curveType === 'linear') {\n curveType = 'linearClosed';\n }\n\n function parsePoint(points: IPointLike[], connectedType: 'none' | 'connect') {\n if (connectedType !== 'connect') {\n return points;\n }\n return points.filter(p => p.defined !== false);\n }\n\n if (clipRange === 1 && !segments && !points.some(p => p.defined === false) && curveType === 'linear') {\n return this.drawLinearAreaHighPerformance(\n area,\n context,\n !!fill,\n doStroke,\n fillOpacity,\n strokeOpacity,\n x,\n y,\n areaAttribute,\n drawContext,\n params,\n fillCb,\n strokeCb\n );\n }\n\n // 更新cache\n if (area.shouldUpdateShape()) {\n if (segments && segments.length) {\n let startPoint: IPointLike;\n let lastTopSeg: { endX: number; endY: number };\n const topCaches = segments\n .map((seg, index) => {\n if (seg.points.length <= 1) {\n // 第一个点的话,直接设置lastTopSeg\n if (index === 0) {\n seg.points[0] && (lastTopSeg = { endX: seg.points[0].x, endY: seg.points[0].y });\n return null;\n }\n }\n // 添加上一个segment结束的点作为这个segment的起始点\n if (index === 1) {\n startPoint = { x: lastTopSeg.endX, y: lastTopSeg.endY };\n } else if (index > 1) {\n startPoint.x = lastTopSeg.endX;\n startPoint.y = lastTopSeg.endY;\n }\n const data = calcLineCache(parsePoint(seg.points, connectedType), curveType, {\n startPoint,\n curveTension\n });\n lastTopSeg = data;\n return data;\n })\n .filter(item => !!item);\n let lastBottomSeg: ISegPath2D;\n const bottomCaches = [];\n for (let i = segments.length - 1; i >= 0; i--) {\n const points = segments[i].points;\n const bottomPoints: IPointLike[] = [];\n for (let i = points.length - 1; i >= 0; i--) {\n bottomPoints.push({\n x: points[i].x1 ?? points[i].x,\n y: points[i].y1 ?? points[i].y\n });\n }\n // 处理一下bottom的segments,bottom的segments需要手动添加endPoints\n if (i !== 0) {\n const lastSegmentPoints = segments[i - 1].points;\n const endPoint = lastSegmentPoints[lastSegmentPoints.length - 1];\n endPoint &&\n bottomPoints.push({\n x: endPoint.x1 ?? endPoint.x,\n y: endPoint.y1 ?? endPoint.y\n });\n }\n if (bottomPoints.length > 1) {\n lastBottomSeg = calcLineCache(\n parsePoint(bottomPoints, connectedType),\n curveType === 'stepBefore' ? 'stepAfter' : curveType === 'stepAfter' ? 'stepBefore' : curveType,\n { curveTension }\n );\n bottomCaches.unshift(lastBottomSeg);\n }\n }\n area.cacheArea = bottomCaches.map((item, index) => ({\n top: topCaches[index],\n bottom: item\n }));\n } else if (points && points.length) {\n // 转换points\n const topPoints = parsePoint(points, connectedType);\n const bottomPoints: IPointLike[] = [];\n for (let i = topPoints.length - 1; i >= 0; i--) {\n bottomPoints.push({\n x: topPoints[i].x1 ?? topPoints[i].x,\n y: topPoints[i].y1 ?? topPoints[i].y\n });\n }\n const topCache = calcLineCache(topPoints, curveType, { curveTension });\n const bottomCache = calcLineCache(\n bottomPoints,\n curveType === 'stepBefore' ? 'stepAfter' : curveType === 'stepAfter' ? 'stepBefore' : curveType,\n { curveTension }\n );\n\n area.cacheArea = { top: topCache, bottom: bottomCache };\n } else {\n area.cacheArea = null;\n area.clearUpdateShapeTag();\n return;\n }\n area.clearUpdateShapeTag();\n }\n\n if (Array.isArray(area.cacheArea)) {\n const segments = area.attribute.segments.filter(item => item.points.length);\n // 如果第一个seg只有一个点,那么shift出去\n if (segments[0].points.length === 1) {\n segments.shift();\n }\n if (clipRange === 1) {\n let skip = false;\n // 性能优化,不需要clip的线段不需要计算长度\n area.cacheArea.forEach((cache, index) => {\n if (skip) {\n return;\n }\n skip = this.drawSegmentItem(\n context,\n cache,\n doFill,\n fillOpacity,\n doStroke,\n strokeOpacity,\n segments[index],\n [areaAttribute, area.attribute],\n clipRange,\n x,\n y,\n z,\n area,\n drawContext,\n fillCb,\n strokeCb\n );\n });\n } else {\n // 如果是segments的话,每个clipRange需要重新计算\n // 整个线段的总长度\n const totalLength = area.cacheArea.reduce((l, c) => l + c.top.getLength(), 0);\n // 总需要绘制的长度\n const totalDrawLength = clipRange * totalLength;\n // 直到上次绘制的长度\n let drawedLengthUntilLast = 0;\n let skip = false;\n area.cacheArea.forEach((cache, index) => {\n if (skip) {\n return;\n }\n const curSegLength = cache.top.getLength();\n const _cr = (totalDrawLength - drawedLengthUntilLast) / curSegLength;\n drawedLengthUntilLast += curSegLength;\n if (_cr > 0) {\n skip = this.drawSegmentItem(\n context,\n cache,\n doFill,\n fillOpacity,\n doStroke,\n strokeOpacity,\n segments[index],\n [areaAttribute, area.attribute],\n min(_cr, 1),\n x,\n y,\n z,\n area,\n drawContext,\n fillCb,\n strokeCb\n );\n }\n });\n }\n } else {\n this.drawSegmentItem(\n context,\n area.cacheArea as IAreaCacheItem,\n doFill,\n fillOpacity,\n doStroke,\n strokeOpacity,\n area.attribute,\n areaAttribute,\n clipRange,\n x,\n y,\n z,\n area,\n drawContext,\n fillCb,\n strokeCb\n );\n }\n }\n\n draw(area: IArea, renderService: IRenderService, drawContext: IDrawContext, params?: IGraphicRenderDrawParams) {\n const areaAttribute = getTheme(area, params?.theme).area;\n this._draw(area, areaAttribute, false, drawContext, params);\n }\n\n /**\n * 绘制segment\n * @param context\n * @param cache\n * @param fill\n * @param stroke\n * @param attribute\n * @param defaultAttribute\n * @param clipRange\n * @param offsetX\n * @param offsetY\n * @param fillCb\n * @param strokeCb\n * @returns 返回true代表跳过后续绘制\n */\n protected drawSegmentItem(\n context: IContext2d,\n cache: IAreaCacheItem,\n fill: boolean,\n fillOpacity: number,\n stroke: boolean,\n strokeOpacity: number,\n attribute: Partial<IAreaGraphicAttribute>,\n defaultAttribute: Required<IAreaGraphicAttribute> | Partial<IAreaGraphicAttribute>[],\n clipRange: number,\n offsetX: number,\n offsetY: number,\n offsetZ: number,\n area: IArea,\n drawContext: IDrawContext,\n fillCb?: (\n ctx: IContext2d,\n lineAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute | IThemeAttribute[]\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n lineAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute | IThemeAttribute[]\n ) => boolean\n ): boolean {\n return this._drawSegmentItem(\n context,\n cache,\n fill,\n fillOpacity,\n stroke,\n strokeOpacity,\n attribute,\n defaultAttribute,\n clipRange,\n offsetX,\n offsetY,\n offsetZ,\n area,\n drawContext,\n fillCb,\n strokeCb\n );\n }\n\n protected _drawSegmentItem(\n context: IContext2d,\n cache: IAreaCacheItem,\n fill: boolean,\n fillOpacity: number,\n stroke: boolean,\n strokeOpacity: number,\n attribute: Partial<IAreaGraphicAttribute>,\n defaultAttribute: Required<IAreaGraphicAttribute> | Partial<IAreaGraphicAttribute>[],\n clipRange: number,\n offsetX: number,\n offsetY: number,\n offsetZ: number,\n area: IArea,\n drawContext: IDrawContext,\n fillCb?: (\n ctx: IContext2d,\n lineAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute | IThemeAttribute[]\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n lineAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute | IThemeAttribute[]\n ) => boolean\n ) {\n if (\n !(\n cache &&\n cache.top &&\n cache.bottom &&\n cache.top.curves &&\n cache.top.curves.length &&\n cache.bottom.curves &&\n cache.bottom.curves.length\n )\n ) {\n return;\n }\n\n context.beginPath();\n\n const ret: boolean = false;\n const { points, segments } = area.attribute;\n let direction = Direction.ROW;\n let endP: IPointLike;\n let startP: IPointLike;\n if (segments) {\n const endSeg = segments[segments.length - 1];\n const startSeg = segments[0];\n startP = startSeg.points[0];\n endP = endSeg.points[endSeg.points.length - 1];\n } else {\n startP = points[0];\n endP = points[points.length - 1];\n }\n const xTotalLength = abs(endP.x - startP.x);\n const yTotalLength = abs(endP.y - startP.y);\n if (endP.x1 == null) {\n direction = Direction.ROW;\n } else if (endP.y1 == null) {\n direction = Direction.COLUMN;\n } else if (!Number.isFinite(xTotalLength + yTotalLength)) {\n direction = Direction.ROW;\n } else {\n direction = xTotalLength > yTotalLength ? Direction.ROW : Direction.COLUMN;\n }\n drawAreaSegments(context, cache, clipRange, {\n offsetX,\n offsetY,\n offsetZ,\n direction\n });\n\n this.beforeRenderStep(\n area,\n context,\n offsetX,\n offsetY,\n !!fillOpacity,\n false,\n fill,\n false,\n defaultAttribute as any,\n drawContext,\n fillCb,\n null,\n { attribute }\n );\n\n // shadow\n context.setShadowBlendStyle && context.setShadowBlendStyle(area, attribute, defaultAttribute);\n\n const { x: originX = 0, x: originY = 0 } = attribute;\n const _runFill = () => {\n if (fill !== false) {\n if (fillCb) {\n fillCb(context, attribute, defaultAttribute);\n } else if (fillOpacity) {\n context.setCommonStyle(area, attribute, originX - offsetX, originY - offsetY, defaultAttribute);\n context.fill();\n }\n }\n };\n\n const _runStroke = () => {\n if (stroke !== false) {\n if (strokeCb) {\n strokeCb(context, attribute, defaultAttribute);\n } else {\n const { stroke = defaultAttribute && (defaultAttribute as any)[1] && (defaultAttribute as any)[1].stroke } =\n attribute;\n if (isArray(stroke) && (stroke[0] || stroke[2]) && stroke[1] === false) {\n context.beginPath();\n drawSegments(\n context,\n stroke[0] ? cache.top : cache.bottom,\n clipRange,\n direction === Direction.ROW ? 'x' : 'y',\n {\n offsetX,\n offsetY,\n offsetZ\n }\n );\n }\n context.setStrokeStyle(area, attribute, originX - offsetX, originY - offsetY, defaultAttribute);\n context.stroke();\n }\n }\n };\n\n _runFill();\n this.afterRenderStep(\n area,\n context,\n offsetX,\n offsetY,\n !!fillOpacity,\n false,\n fill,\n false,\n defaultAttribute as any,\n drawContext,\n fillCb,\n null,\n { attribute }\n );\n _runStroke();\n\n return ret;\n }\n}\n"]}
@@ -8,5 +8,6 @@ export declare const PolygonRenderContribution: unique symbol;
8
8
  export declare const RectRenderContribution: unique symbol;
9
9
  export declare const SymbolRenderContribution: unique symbol;
10
10
  export declare const TextRenderContribution: unique symbol;
11
+ export declare const StarRenderContribution: unique symbol;
11
12
  export declare const CommonRenderContribution: unique symbol;
12
13
  export declare const InteractiveSubRenderContribution: unique symbol;
@@ -18,6 +18,8 @@ export const SymbolRenderContribution = Symbol.for("SymbolRenderContribution");
18
18
 
19
19
  export const TextRenderContribution = Symbol.for("TextRenderContribution");
20
20
 
21
+ export const StarRenderContribution = Symbol.for("StarRenderContribution");
22
+
21
23
  export const CommonRenderContribution = Symbol.for("CommonRenderContribution");
22
24
 
23
25
  export const InteractiveSubRenderContribution = Symbol.for("InteractiveSubRenderContribution");