@visactor/vrender-core 0.17.19 → 0.18.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (293) hide show
  1. package/cjs/common/canvas-utils.js +2 -2
  2. package/cjs/common/canvas-utils.js.map +1 -1
  3. package/cjs/common/render-area.js +15 -3
  4. package/cjs/common/render-area.js.map +1 -1
  5. package/cjs/common/render-curve.js +16 -4
  6. package/cjs/common/render-curve.js.map +1 -1
  7. package/cjs/common/segment/basis.js +3 -2
  8. package/cjs/common/segment/basis.js.map +1 -1
  9. package/cjs/common/segment/common.d.ts +1 -4
  10. package/cjs/common/segment/common.js +3 -13
  11. package/cjs/common/segment/common.js.map +1 -1
  12. package/cjs/common/segment/linear-closed.d.ts +16 -2
  13. package/cjs/common/segment/linear-closed.js +34 -3
  14. package/cjs/common/segment/linear-closed.js.map +1 -1
  15. package/cjs/common/segment/linear.d.ts +1 -1
  16. package/cjs/common/segment/linear.js +3 -2
  17. package/cjs/common/segment/linear.js.map +1 -1
  18. package/cjs/common/segment/monotone.d.ts +2 -2
  19. package/cjs/common/segment/monotone.js +12 -10
  20. package/cjs/common/segment/monotone.js.map +1 -1
  21. package/cjs/common/sort.js +1 -2
  22. package/cjs/common/split-path.js +2 -2
  23. package/cjs/common/split-path.js.map +1 -1
  24. package/cjs/core/application.js +1 -1
  25. package/cjs/core/camera.js +1 -1
  26. package/cjs/core/constants.js +1 -1
  27. package/cjs/core/stage.js +1 -4
  28. package/cjs/core/stage.js.map +1 -1
  29. package/cjs/env-check.js +17 -17
  30. package/cjs/env-check.js.map +1 -1
  31. package/cjs/event/event-system.js +3 -3
  32. package/cjs/event/event-system.js.map +1 -1
  33. package/cjs/graphic/arc.js +1 -1
  34. package/cjs/graphic/arc.js.map +1 -1
  35. package/cjs/graphic/arc3d.js +1 -1
  36. package/cjs/graphic/arc3d.js.map +1 -1
  37. package/cjs/graphic/area.js +1 -1
  38. package/cjs/graphic/area.js.map +1 -1
  39. package/cjs/graphic/bounds.d.ts +2 -2
  40. package/cjs/graphic/bounds.js +1 -1
  41. package/cjs/graphic/bounds.js.map +1 -1
  42. package/cjs/graphic/circle.js +1 -1
  43. package/cjs/graphic/circle.js.map +1 -1
  44. package/cjs/graphic/config.js +0 -4
  45. package/cjs/graphic/config.js.map +1 -1
  46. package/cjs/graphic/glyph.js +1 -1
  47. package/cjs/graphic/glyph.js.map +1 -1
  48. package/cjs/graphic/graphic-service/graphic-service.js +11 -13
  49. package/cjs/graphic/graphic-service/graphic-service.js.map +1 -1
  50. package/cjs/graphic/graphic.js +2 -3
  51. package/cjs/graphic/graphic.js.map +1 -1
  52. package/cjs/graphic/group.js +1 -1
  53. package/cjs/graphic/group.js.map +1 -1
  54. package/cjs/graphic/image.d.ts +1 -3
  55. package/cjs/graphic/image.js +1 -7
  56. package/cjs/graphic/image.js.map +1 -1
  57. package/cjs/graphic/line.js +1 -1
  58. package/cjs/graphic/line.js.map +1 -1
  59. package/cjs/graphic/path.js +1 -1
  60. package/cjs/graphic/path.js.map +1 -1
  61. package/cjs/graphic/polygon.js +1 -1
  62. package/cjs/graphic/polygon.js.map +1 -1
  63. package/cjs/graphic/pyramid3d.js +1 -1
  64. package/cjs/graphic/pyramid3d.js.map +1 -1
  65. package/cjs/graphic/rect.js +7 -4
  66. package/cjs/graphic/rect.js.map +1 -1
  67. package/cjs/graphic/richtext.d.ts +1 -1
  68. package/cjs/graphic/richtext.js +6 -10
  69. package/cjs/graphic/richtext.js.map +1 -1
  70. package/cjs/graphic/symbol.js +1 -1
  71. package/cjs/graphic/symbol.js.map +1 -1
  72. package/cjs/graphic/text.js +4 -4
  73. package/cjs/graphic/text.js.map +1 -1
  74. package/cjs/interface/event.d.ts +0 -2
  75. package/cjs/interface/event.js.map +1 -1
  76. package/cjs/interface/graphic/richText.d.ts +1 -1
  77. package/cjs/interface/graphic/richText.js.map +1 -1
  78. package/cjs/interface/graphic/symbol.d.ts +1 -1
  79. package/cjs/interface/graphic/symbol.js.map +1 -1
  80. package/cjs/interface/graphic.d.ts +1 -14
  81. package/cjs/interface/graphic.js.map +1 -1
  82. package/cjs/interface/stage.d.ts +0 -4
  83. package/cjs/interface/stage.js.map +1 -1
  84. package/cjs/modules.d.ts +0 -3
  85. package/cjs/modules.js +10 -9
  86. package/cjs/modules.js.map +1 -1
  87. package/cjs/plugins/builtin-plugin/html-attribute-plugin.js +7 -6
  88. package/cjs/plugins/builtin-plugin/html-attribute-plugin.js.map +1 -1
  89. package/cjs/render/contributions/render/area-render.js +5 -5
  90. package/cjs/render/contributions/render/area-render.js.map +1 -1
  91. package/cjs/render/contributions/render/contributions/arc-contribution-render.d.ts +1 -1
  92. package/cjs/render/contributions/render/contributions/arc-contribution-render.js +2 -2
  93. package/cjs/render/contributions/render/contributions/arc-contribution-render.js.map +1 -1
  94. package/cjs/render/contributions/render/contributions/area-contribution-render.d.ts +9 -1
  95. package/cjs/render/contributions/render/contributions/area-contribution-render.js +55 -3
  96. package/cjs/render/contributions/render/contributions/area-contribution-render.js.map +1 -1
  97. package/cjs/render/contributions/render/contributions/base-contribution-render.d.ts +20 -2
  98. package/cjs/render/contributions/render/contributions/base-contribution-render.js +125 -25
  99. package/cjs/render/contributions/render/contributions/base-contribution-render.js.map +1 -1
  100. package/cjs/render/contributions/render/contributions/circle-contribution-render.d.ts +1 -1
  101. package/cjs/render/contributions/render/contributions/circle-contribution-render.js +2 -2
  102. package/cjs/render/contributions/render/contributions/circle-contribution-render.js.map +1 -1
  103. package/cjs/render/contributions/render/contributions/group-contribution-render.js +2 -2
  104. package/cjs/render/contributions/render/contributions/group-contribution-render.js.map +1 -1
  105. package/cjs/render/contributions/render/contributions/image-contribution-render.js +2 -3
  106. package/cjs/render/contributions/render/contributions/image-contribution-render.js.map +1 -1
  107. package/cjs/render/contributions/render/contributions/index.d.ts +0 -2
  108. package/cjs/render/contributions/render/contributions/index.js +1 -2
  109. package/cjs/render/contributions/render/contributions/index.js.map +1 -1
  110. package/cjs/render/contributions/render/contributions/path-contribution-render.d.ts +1 -1
  111. package/cjs/render/contributions/render/contributions/path-contribution-render.js +2 -2
  112. package/cjs/render/contributions/render/contributions/path-contribution-render.js.map +1 -1
  113. package/cjs/render/contributions/render/contributions/polygon-contribution-render.d.ts +1 -1
  114. package/cjs/render/contributions/render/contributions/polygon-contribution-render.js +2 -2
  115. package/cjs/render/contributions/render/contributions/polygon-contribution-render.js.map +1 -1
  116. package/cjs/render/contributions/render/contributions/rect-contribution-render.d.ts +1 -1
  117. package/cjs/render/contributions/render/contributions/rect-contribution-render.js +2 -2
  118. package/cjs/render/contributions/render/contributions/rect-contribution-render.js.map +1 -1
  119. package/cjs/render/contributions/render/contributions/symbol-contribution-render.d.ts +1 -1
  120. package/cjs/render/contributions/render/contributions/symbol-contribution-render.js +2 -2
  121. package/cjs/render/contributions/render/contributions/symbol-contribution-render.js.map +1 -1
  122. package/cjs/render/contributions/render/contributions/text-contribution-render.js +8 -23
  123. package/cjs/render/contributions/render/contributions/text-contribution-render.js.map +1 -1
  124. package/cjs/render/contributions/render/draw-contribution.js +2 -3
  125. package/cjs/render/contributions/render/draw-contribution.js.map +1 -1
  126. package/cjs/render/contributions/render/incremental-draw-contribution.d.ts +1 -0
  127. package/cjs/render/contributions/render/incremental-draw-contribution.js +5 -1
  128. package/cjs/render/contributions/render/incremental-draw-contribution.js.map +1 -1
  129. package/cjs/render/contributions/render/utils.d.ts +1 -1
  130. package/cjs/render/contributions/render/utils.js.map +1 -1
  131. package/dist/index.js +27707 -0
  132. package/dist/index.min.js +1 -0
  133. package/es/common/canvas-utils.js +1 -3
  134. package/es/common/canvas-utils.js.map +1 -1
  135. package/es/common/render-area.js +12 -2
  136. package/es/common/render-area.js.map +1 -1
  137. package/es/common/render-curve.js +15 -2
  138. package/es/common/render-curve.js.map +1 -1
  139. package/es/common/segment/basis.js +8 -2
  140. package/es/common/segment/basis.js.map +1 -1
  141. package/es/common/segment/common.d.ts +1 -4
  142. package/es/common/segment/common.js +0 -11
  143. package/es/common/segment/common.js.map +1 -1
  144. package/es/common/segment/linear-closed.d.ts +16 -2
  145. package/es/common/segment/linear-closed.js +38 -4
  146. package/es/common/segment/linear-closed.js.map +1 -1
  147. package/es/common/segment/linear.d.ts +1 -1
  148. package/es/common/segment/linear.js +8 -2
  149. package/es/common/segment/linear.js.map +1 -1
  150. package/es/common/segment/monotone.d.ts +2 -2
  151. package/es/common/segment/monotone.js +13 -7
  152. package/es/common/segment/monotone.js.map +1 -1
  153. package/es/common/sort.js +1 -2
  154. package/es/common/split-path.js +1 -3
  155. package/es/common/split-path.js.map +1 -1
  156. package/es/core/application.js +1 -1
  157. package/es/core/camera.js +1 -1
  158. package/es/core/constants.js +1 -1
  159. package/es/core/stage.js +1 -4
  160. package/es/core/stage.js.map +1 -1
  161. package/es/env-check.js +13 -12
  162. package/es/env-check.js.map +1 -1
  163. package/es/event/event-system.js +3 -3
  164. package/es/event/event-system.js.map +1 -1
  165. package/es/graphic/arc.js +1 -1
  166. package/es/graphic/arc.js.map +1 -1
  167. package/es/graphic/arc3d.js +1 -1
  168. package/es/graphic/arc3d.js.map +1 -1
  169. package/es/graphic/area.js +1 -1
  170. package/es/graphic/area.js.map +1 -1
  171. package/es/graphic/bounds.d.ts +2 -2
  172. package/es/graphic/bounds.js +1 -1
  173. package/es/graphic/bounds.js.map +1 -1
  174. package/es/graphic/circle.js +1 -1
  175. package/es/graphic/circle.js.map +1 -1
  176. package/es/graphic/config.js +0 -4
  177. package/es/graphic/config.js.map +1 -1
  178. package/es/graphic/glyph.js +1 -1
  179. package/es/graphic/glyph.js.map +1 -1
  180. package/es/graphic/graphic-service/graphic-service.js +11 -13
  181. package/es/graphic/graphic-service/graphic-service.js.map +1 -1
  182. package/es/graphic/graphic.js +2 -3
  183. package/es/graphic/graphic.js.map +1 -1
  184. package/es/graphic/group.js +1 -1
  185. package/es/graphic/group.js.map +1 -1
  186. package/es/graphic/image.d.ts +1 -3
  187. package/es/graphic/image.js +1 -7
  188. package/es/graphic/image.js.map +1 -1
  189. package/es/graphic/line.js +1 -1
  190. package/es/graphic/line.js.map +1 -1
  191. package/es/graphic/path.js +1 -1
  192. package/es/graphic/path.js.map +1 -1
  193. package/es/graphic/polygon.js +1 -1
  194. package/es/graphic/polygon.js.map +1 -1
  195. package/es/graphic/pyramid3d.js +1 -1
  196. package/es/graphic/pyramid3d.js.map +1 -1
  197. package/es/graphic/rect.js +7 -4
  198. package/es/graphic/rect.js.map +1 -1
  199. package/es/graphic/richtext.d.ts +1 -1
  200. package/es/graphic/richtext.js +5 -11
  201. package/es/graphic/richtext.js.map +1 -1
  202. package/es/graphic/symbol.js +1 -1
  203. package/es/graphic/symbol.js.map +1 -1
  204. package/es/graphic/text.js +4 -4
  205. package/es/graphic/text.js.map +1 -1
  206. package/es/interface/event.d.ts +0 -2
  207. package/es/interface/event.js.map +1 -1
  208. package/es/interface/graphic/richText.d.ts +1 -1
  209. package/es/interface/graphic/richText.js.map +1 -1
  210. package/es/interface/graphic/symbol.d.ts +1 -1
  211. package/es/interface/graphic/symbol.js.map +1 -1
  212. package/es/interface/graphic.d.ts +1 -14
  213. package/es/interface/graphic.js.map +1 -1
  214. package/es/interface/stage.d.ts +0 -4
  215. package/es/interface/stage.js.map +1 -1
  216. package/es/modules.d.ts +0 -3
  217. package/es/modules.js +6 -4
  218. package/es/modules.js.map +1 -1
  219. package/es/plugins/builtin-plugin/html-attribute-plugin.js +7 -6
  220. package/es/plugins/builtin-plugin/html-attribute-plugin.js.map +1 -1
  221. package/es/render/contributions/render/area-render.js +5 -5
  222. package/es/render/contributions/render/area-render.js.map +1 -1
  223. package/es/render/contributions/render/contributions/arc-contribution-render.d.ts +1 -1
  224. package/es/render/contributions/render/contributions/arc-contribution-render.js +1 -3
  225. package/es/render/contributions/render/contributions/arc-contribution-render.js.map +1 -1
  226. package/es/render/contributions/render/contributions/area-contribution-render.d.ts +9 -1
  227. package/es/render/contributions/render/contributions/area-contribution-render.js +51 -2
  228. package/es/render/contributions/render/contributions/area-contribution-render.js.map +1 -1
  229. package/es/render/contributions/render/contributions/base-contribution-render.d.ts +20 -2
  230. package/es/render/contributions/render/contributions/base-contribution-render.js +123 -23
  231. package/es/render/contributions/render/contributions/base-contribution-render.js.map +1 -1
  232. package/es/render/contributions/render/contributions/circle-contribution-render.d.ts +1 -1
  233. package/es/render/contributions/render/contributions/circle-contribution-render.js +1 -3
  234. package/es/render/contributions/render/contributions/circle-contribution-render.js.map +1 -1
  235. package/es/render/contributions/render/contributions/group-contribution-render.js +2 -2
  236. package/es/render/contributions/render/contributions/group-contribution-render.js.map +1 -1
  237. package/es/render/contributions/render/contributions/image-contribution-render.js +2 -3
  238. package/es/render/contributions/render/contributions/image-contribution-render.js.map +1 -1
  239. package/es/render/contributions/render/contributions/index.d.ts +0 -2
  240. package/es/render/contributions/render/contributions/index.js +0 -4
  241. package/es/render/contributions/render/contributions/index.js.map +1 -1
  242. package/es/render/contributions/render/contributions/path-contribution-render.d.ts +1 -1
  243. package/es/render/contributions/render/contributions/path-contribution-render.js +1 -3
  244. package/es/render/contributions/render/contributions/path-contribution-render.js.map +1 -1
  245. package/es/render/contributions/render/contributions/polygon-contribution-render.d.ts +1 -1
  246. package/es/render/contributions/render/contributions/polygon-contribution-render.js +1 -3
  247. package/es/render/contributions/render/contributions/polygon-contribution-render.js.map +1 -1
  248. package/es/render/contributions/render/contributions/rect-contribution-render.d.ts +1 -1
  249. package/es/render/contributions/render/contributions/rect-contribution-render.js +1 -3
  250. package/es/render/contributions/render/contributions/rect-contribution-render.js.map +1 -1
  251. package/es/render/contributions/render/contributions/symbol-contribution-render.d.ts +1 -1
  252. package/es/render/contributions/render/contributions/symbol-contribution-render.js +1 -3
  253. package/es/render/contributions/render/contributions/symbol-contribution-render.js.map +1 -1
  254. package/es/render/contributions/render/contributions/text-contribution-render.js +7 -28
  255. package/es/render/contributions/render/contributions/text-contribution-render.js.map +1 -1
  256. package/es/render/contributions/render/draw-contribution.js +2 -3
  257. package/es/render/contributions/render/draw-contribution.js.map +1 -1
  258. package/es/render/contributions/render/incremental-draw-contribution.d.ts +1 -0
  259. package/es/render/contributions/render/incremental-draw-contribution.js +5 -1
  260. package/es/render/contributions/render/incremental-draw-contribution.js.map +1 -1
  261. package/es/render/contributions/render/utils.d.ts +1 -1
  262. package/es/render/contributions/render/utils.js.map +1 -1
  263. package/package.json +4 -6
  264. package/cjs/common/color-utils.d.ts +0 -9
  265. package/cjs/common/color-utils.js +0 -231
  266. package/cjs/common/color-utils.js.map +0 -1
  267. package/cjs/common/rect-utils.d.ts +0 -7
  268. package/cjs/common/rect-utils.js +0 -27
  269. package/cjs/common/rect-utils.js.map +0 -1
  270. package/cjs/common/render-utils.d.ts +0 -10
  271. package/cjs/common/render-utils.js +0 -22
  272. package/cjs/common/render-utils.js.map +0 -1
  273. package/cjs/render/contributions/render/contributions/area-texture-contribution-render.d.ts +0 -9
  274. package/cjs/render/contributions/render/contributions/area-texture-contribution-render.js +0 -26
  275. package/cjs/render/contributions/render/contributions/area-texture-contribution-render.js.map +0 -1
  276. package/cjs/render/contributions/render/contributions/base-texture-contribution-render.d.ts +0 -21
  277. package/cjs/render/contributions/render/contributions/base-texture-contribution-render.js +0 -128
  278. package/cjs/render/contributions/render/contributions/base-texture-contribution-render.js.map +0 -1
  279. package/es/common/color-utils.d.ts +0 -9
  280. package/es/common/color-utils.js +0 -224
  281. package/es/common/color-utils.js.map +0 -1
  282. package/es/common/rect-utils.d.ts +0 -7
  283. package/es/common/rect-utils.js +0 -20
  284. package/es/common/rect-utils.js.map +0 -1
  285. package/es/common/render-utils.d.ts +0 -10
  286. package/es/common/render-utils.js +0 -14
  287. package/es/common/render-utils.js.map +0 -1
  288. package/es/render/contributions/render/contributions/area-texture-contribution-render.d.ts +0 -9
  289. package/es/render/contributions/render/contributions/area-texture-contribution-render.js +0 -18
  290. package/es/render/contributions/render/contributions/area-texture-contribution-render.js.map +0 -1
  291. package/es/render/contributions/render/contributions/base-texture-contribution-render.d.ts +0 -21
  292. package/es/render/contributions/render/contributions/base-texture-contribution-render.js +0 -124
  293. package/es/render/contributions/render/contributions/base-texture-contribution-render.js.map +0 -1
package/es/modules.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/modules.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,qBAAqB,CAAC;AAC7C,OAAO,YAAY,MAAM,yBAAyB,CAAC;AACnD,OAAO,UAAU,MAAM,uBAAuB,CAAC;AAE/C,OAAO,aAAa,MAAM,0CAA0C,CAAC;AACrE,OAAO,YAAY,MAAM,0BAA0B,CAAC;AACpD,OAAO,wBAAwB,MAAM,8BAA8B,CAAC;AACpE,OAAO,uBAAuB,MAAM,gCAAgC,CAAC;AAGrE,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAIhD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,MAAM,UAAU,gBAAgB;IAC9B,IAAI,gBAAgB,CAAC,QAAQ,EAAE;QAC7B,OAAO;KACR;IACD,gBAAgB,CAAC,QAAQ,GAAG,IAAI,CAAC;IACjC,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC3B,SAAS,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IAC9B,SAAS,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAC7B,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAE3B,SAAS,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAC7B,wBAAwB,CAAC,SAAS,CAAC,CAAC;IACpC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AACrC,CAAC;AAED,gBAAgB,CAAC,QAAQ,GAAG,KAAK,CAAC;AAElC,gBAAgB,EAAE,CAAC;AAKnB,MAAM,CAAC,MAAM,OAAO,GAAG,SAAS,CAAC,GAAG,CAAU,OAAO,CAAC,CAAC;AACvD,WAAW,CAAC,MAAM,GAAG,OAAO,CAAC;AAC7B,MAAM,CAAC,MAAM,WAAW,GAAG,SAAS,CAAC,GAAG,CAAe,WAAW,CAAC,CAAC;AACpE,WAAW,CAAC,WAAW,GAAG,WAAW,CAAC;AACtC,MAAM,CAAC,MAAM,aAAa,GAAG,SAAS,CAAC,GAAG,CAAiB,aAAa,CAAC,CAAC;AAC1E,WAAW,CAAC,aAAa,GAAG,aAAa,CAAC;AAC1C,MAAM,CAAC,MAAM,cAAc,GAAG,SAAS,CAAC,GAAG,CAAkB,cAAc,CAAC,CAAC;AAC7E,WAAW,CAAC,cAAc,GAAG,cAAc,CAAC;AAa5C,MAAM,CAAC,MAAM,YAAY,GAAG,SAAS,CAAC,GAAG,CAAgB,YAAY,CAAC,CAAC;AACvE,WAAW,CAAC,YAAY,GAAG,YAAY,CAAC","file":"modules.js","sourcesContent":["import coreModule from './core/core-modules';\nimport renderModule from './render/render-modules';\nimport pickModule from './picker/pick-modules';\n// import allocatorModule from './allocator/allocator-modules';\nimport graphicModule from './graphic/graphic-service/graphic-module';\nimport pluginModule from './plugins/plugin-modules';\nimport loadBuiltinContributions from './core/contributions/modules';\nimport loadRenderContributions from './render/contributions/modules';\n// import loadPickContributions from './picker/contributions/modules';\n// import loadCanvasContributions from './canvas/contributions/modules';\nimport { LayerService } from './core/constants';\n// import { IMat4Allocate, IMatrixAllocate, Mat4Allocate, MatrixAllocate } from './allocator/matrix-allocate';\n// import { GlobalPickerService } from './picker/constants';\nimport type { IGlobal, IGraphicService, IPickerService } from './interface';\nimport { application } from './application';\nimport type { IGraphicUtil, ILayerService, ITransformUtil } from './interface/core';\nimport { GraphicService } from './graphic/constants';\nimport { GraphicUtil, TransformUtil } from './core/constants';\nimport { container } from './container';\nimport { VGlobal } from './constants';\n\nexport function preLoadAllModule() {\n if (preLoadAllModule.__loaded) {\n return;\n }\n preLoadAllModule.__loaded = true;\n container.load(coreModule);\n container.load(graphicModule);\n container.load(renderModule);\n container.load(pickModule);\n // container.load(allocatorModule);\n container.load(pluginModule);\n loadBuiltinContributions(container);\n loadRenderContributions(container);\n}\n\npreLoadAllModule.__loaded = false;\n\npreLoadAllModule();\n// loadPickContributions(container);\n// loadCanvasContributions(container);\n\n// 全局变量\nexport const vglobal = container.get<IGlobal>(VGlobal);\napplication.global = vglobal;\nexport const graphicUtil = container.get<IGraphicUtil>(GraphicUtil);\napplication.graphicUtil = graphicUtil;\nexport const transformUtil = container.get<ITransformUtil>(TransformUtil);\napplication.transformUtil = transformUtil;\nexport const graphicService = container.get<IGraphicService>(GraphicService);\napplication.graphicService = graphicService;\n// export const matrixAllocate = container.get<IMatrixAllocate>(MatrixAllocate);\n// export const mat4Allocate = container.get<IMat4Allocate>(Mat4Allocate);\n// export const canvasAllocate = container.get<ICanvasAllocate>(CanvasAllocate);\n// export const arcAllocate = container.get<IArcAllocate>(ArcAllocate);\n// export const areaAllocate = container.get<IAreaAllocate>(AreaAllocate);\n// export const circleAllocate = container.get<ICircleAllocate>(CircleAllocate);\n// export const lineAllocate = container.get<ILineAllocate>(LineAllocate);\n// export const pathAllocate = container.get<IPathAllocate>(PathAllocate);\n// export const rectAllocate = container.get<IRectAllocate>(RectAllocate);\n// export const symbolAllocate = container.get<ISymbolAllocate>(SymbolAllocate);\n// export const textAllocate = container.get<ITextAllocate>(TextAllocate);\n// export const pickerService = container.get<IPickerService>(GlobalPickerService);\nexport const layerService = container.get<ILayerService>(LayerService);\napplication.layerService = layerService;\n"]}
1
+ {"version":3,"sources":["../src/modules.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,qBAAqB,CAAC;AAC7C,OAAO,YAAY,MAAM,yBAAyB,CAAC;AACnD,OAAO,UAAU,MAAM,uBAAuB,CAAC;AAE/C,O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AAG,SAAS,CAAC,GAAG,CAAiB,aAAa,CAAC,CAAC;AAC1E,WAAW,CAAC,aAAa,GAAG,aAAa,CAAC;AAC1C,MAAM,CAAC,MAAM,cAAc,GAAG,SAAS,CAAC,GAAG,CAAkB,cAAc,CAAC,CAAC;AAC7E,WAAW,CAAC,cAAc,GAAG,cAAc,CAAC;AAa5C,MAAM,CAAC,MAAM,YAAY,GAAG,SAAS,CAAC,GAAG,CAAgB,YAAY,CAAC,CAAC;AACvE,WAAW,CAAC,YAAY,GAAG,YAAY,CAAC","file":"modules.js","sourcesContent":["import coreModule from './core/core-modules';\nimport renderModule from './render/render-modules';\nimport pickModule from './picker/pick-modules';\n// import allocatorModule from './allocator/allocator-modules';\nimport graphicModule from './graphic/graphic-service/graphic-module';\nimport pluginModule from './plugins/plugin-modules';\nimport loadBuiltinContributions from './core/contributions/modules';\nimport loadRenderContributions from './render/contributions/modules';\n// import loadPickContributions from './picker/contributions/modules';\n// import loadCanvasContributions from './canvas/contributions/modules';\nimport { LayerService } from './core/constants';\n// import { IMat4Allocate, IMatrixAllocate, Mat4Allocate, MatrixAllocate } from './allocator/matrix-allocate';\n// import { GlobalPickerService } from './picker/constants';\nimport type { IGlobal, IGraphicService, IPickerService } from './interface';\nimport { application } from './application';\nimport type { IGraphicUtil, ILayerService, ITransformUtil } from './interface/core';\nimport { GraphicService } from './graphic/constants';\nimport { GraphicUtil, TransformUtil } from './core/constants';\nimport { container } from './container';\nimport { VGlobal } from './constants';\n\nlet loaded = false;\nexport function preLoadAllModule() {\n if (loaded) {\n return;\n }\n loaded = true;\n container.load(coreModule);\n container.load(graphicModule);\n container.load(renderModule);\n container.load(pickModule);\n // container.load(allocatorModule);\n container.load(pluginModule);\n loadBuiltinContributions(container);\n loadRenderContributions(container);\n}\n\npreLoadAllModule();\n// loadPickContributions(container);\n// loadCanvasContributions(container);\n\n// 全局变量\nexport const vglobal = container.get<IGlobal>(VGlobal);\napplication.global = vglobal;\nexport const graphicUtil = container.get<IGraphicUtil>(GraphicUtil);\napplication.graphicUtil = graphicUtil;\nexport const transformUtil = container.get<ITransformUtil>(TransformUtil);\napplication.transformUtil = transformUtil;\nexport const graphicService = container.get<IGraphicService>(GraphicService);\napplication.graphicService = graphicService;\n// export const matrixAllocate = container.get<IMatrixAllocate>(MatrixAllocate);\n// export const mat4Allocate = container.get<IMat4Allocate>(Mat4Allocate);\n// export const canvasAllocate = container.get<ICanvasAllocate>(CanvasAllocate);\n// export const arcAllocate = container.get<IArcAllocate>(ArcAllocate);\n// export const areaAllocate = container.get<IAreaAllocate>(AreaAllocate);\n// export const circleAllocate = container.get<ICircleAllocate>(CircleAllocate);\n// export const lineAllocate = container.get<ILineAllocate>(LineAllocate);\n// export const pathAllocate = container.get<IPathAllocate>(PathAllocate);\n// export const rectAllocate = container.get<IRectAllocate>(RectAllocate);\n// export const symbolAllocate = container.get<ISymbolAllocate>(SymbolAllocate);\n// export const textAllocate = container.get<ITextAllocate>(TextAllocate);\n// export const pickerService = container.get<IPickerService>(GlobalPickerService);\nexport const layerService = container.get<ILayerService>(LayerService);\napplication.layerService = layerService;\n"]}
@@ -51,8 +51,7 @@ export class HtmlAttributePlugin {
51
51
  let nativeDom, nativeContainer;
52
52
  graphic.bindDom.forEach((({wrapGroup: wrapGroup}) => {
53
53
  application.global.removeDom(wrapGroup);
54
- })), "string" == typeof dom ? (nativeDom = (new DOMParser).parseFromString(dom, "text/html").firstChild,
55
- nativeDom.lastChild && (nativeDom = nativeDom.lastChild.firstChild)) : nativeDom = dom;
54
+ })), nativeDom = "string" == typeof dom ? (new DOMParser).parseFromString(dom, "text/html").firstChild : dom;
56
55
  const _container = container || (!0 === stage.params.enableHtmlAttribute ? null : stage.params.enableHtmlAttribute);
57
56
  nativeContainer = _container ? "string" == typeof _container ? application.global.getElementById(_container) : _container : graphic.stage.window.getContainer();
58
57
  const wrapGroup = application.global.createDom({
@@ -69,11 +68,13 @@ export class HtmlAttributePlugin {
69
68
  })), wrapGroup.style.pointerEvents = "none", wrapGroup.style.position || (wrapGroup.style.position = "absolute",
70
69
  nativeContainer.style.position = "relative");
71
70
  let left = 0, top = 0;
72
- const b = graphic.globalAABBBounds;
73
- if ("position" === anchorType || b.empty()) {
74
- const matrix = graphic.globalTransMatrix;
71
+ if ("position" === anchorType) {
72
+ const matrix = graphic.transMatrix;
75
73
  left = matrix.e, top = matrix.f;
76
- } else left = b.x1, top = b.y1;
74
+ } else {
75
+ const b = graphic.AABBBounds;
76
+ left = b.x1, top = b.y1;
77
+ }
77
78
  const containerTL = application.global.getElementTopLeft(nativeContainer, !1), windowTL = stage.window.getTopLeft(!1), offsetX = left + windowTL.left - containerTL.left, offsetTop = top + windowTL.top - containerTL.top;
78
79
  wrapGroup.style.left = `${offsetX}px`, wrapGroup.style.top = `${offsetTop}px`;
79
80
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/plugins/builtin-plugin/html-attribute-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEjD,MAAM,OAAO,mBAAmB;IAAhC;QACE,SAAI,GAA0B,qBAAqB,CAAC;QACpD,gBAAW,GAAiB,YAAY,CAAC;QAEzC,SAAI,GAAW,SAAS,CAAC,kBAAkB,EAAE,CAAC;QAC9C,QAAG,GAAW,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;IA6ItC,CAAC;IA3IC,QAAQ,CAAC,OAAuB;QAC9B,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC;QAC7B,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE;YACpD,IAAI,CAAC,CAAC,KAAK,IAAI,KAAK,KAAK,IAAI,CAAC,aAAa,CAAC,KAAK,CAA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W,CAAC,IAAI,CAAC;QACxD,MAAM,SAAS,GAAG,GAAG,GAAG,QAAQ,CAAC,GAAG,GAAG,WAAW,CAAC,GAAG,CAAC;QAEvD,SAAS,CAAC,KAAK,CAAC,IAAI,GAAG,GAAG,OAAO,IAAI,CAAC;QACtC,SAAS,CAAC,KAAK,CAAC,GAAG,GAAG,GAAG,SAAS,IAAI,CAAC;IACzC,CAAC;CACF","file":"html-attribute-plugin.js","sourcesContent":["import { Generator } from '../../common/generator';\nimport type { IGraphic, IPlugin, IPluginService, IRenderService, IDrawContext, IGroup } from '../../interface';\nimport { application } from '../../application';\nimport { DefaultAttribute } from '../../graphic';\n\nexport class HtmlAttributePlugin implements IPlugin {\n name: 'HtmlAttributePlugin' = 'HtmlAttributePlugin';\n activeEvent: 'onRegister' = 'onRegister';\n pluginService: IPluginService;\n _uid: number = Generator.GenAutoIncrementId();\n key: string = this.name + this._uid;\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 this.drawHTML(context.stage.renderService);\n });\n application.graphicService.hooks.onRelease.tap(this.key, graphic => {\n this.removeDom(graphic);\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 }\n\n protected drawHTML(renderService: IRenderService) {\n if (application.global.env === 'browser') {\n renderService.renderTreeRoots\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 }\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 removeDom(graphic: IGraphic) {\n if (graphic.bindDom && graphic.bindDom.size) {\n // 删除dom\n graphic.bindDom.forEach(item => {\n item.dom && item.dom.parentElement.removeChild(item.dom);\n });\n graphic.bindDom.clear();\n }\n }\n\n renderGraphicHTML(graphic: IGraphic) {\n const { html } = graphic.attribute;\n if (!html) {\n if (graphic.bindDom && graphic.bindDom.size) {\n // 删除dom\n graphic.bindDom.forEach(item => {\n item.dom && item.dom.parentElement.removeChild(item.dom);\n });\n graphic.bindDom.clear();\n }\n return;\n }\n const stage = graphic.stage;\n if (!stage) {\n return;\n }\n const { dom, container, width, height, style, anchorType = 'boundsLeftTop' } = html;\n if (!graphic.bindDom) {\n graphic.bindDom = new Map();\n }\n const lastDom = graphic.bindDom.get(dom);\n // 如果存在了(dom存在,且container没有变化),就跳过\n if (lastDom && !(container && container !== lastDom.container)) {\n return;\n }\n // 清除上一次的dom\n graphic.bindDom.forEach(({ wrapGroup }) => {\n application.global.removeDom(wrapGroup);\n });\n // 转化这个dom为nativeDOM\n let nativeDom: HTMLElement;\n if (typeof dom === 'string') {\n nativeDom = new DOMParser().parseFromString(dom, 'text/html').firstChild as any;\n if ((nativeDom as any).lastChild) {\n nativeDom = (nativeDom as any).lastChild.firstChild;\n }\n } else {\n nativeDom = dom;\n }\n // 获取container的dom,默认为window的container\n let nativeContainer;\n const _container =\n container || (stage.params.enableHtmlAttribute === true ? null : stage.params.enableHtmlAttribute);\n if (_container) {\n if (typeof _container === 'string') {\n nativeContainer = application.global.getElementById(_container);\n } else {\n nativeContainer = _container;\n }\n } else {\n // nativeContainer = application.global.getRootElement();\n nativeContainer = graphic.stage.window.getContainer();\n }\n // 创建wrapGroup\n const wrapGroup = application.global.createDom({ tagName: 'div', width, height, style, parent: nativeContainer });\n if (wrapGroup) {\n wrapGroup.appendChild(nativeDom);\n graphic.bindDom.set(dom, { dom: nativeDom, container, wrapGroup: wrapGroup as any });\n }\n // 事件穿透\n wrapGroup.style.pointerEvents = 'none';\n // 定位wrapGroup\n if (!wrapGroup.style.position) {\n wrapGroup.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 if (anchorType === 'position' || b.empty()) {\n const matrix = graphic.globalTransMatrix;\n left = matrix.e;\n top = matrix.f;\n } else {\n left = b.x1;\n top = b.y1;\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 offsetX = left + windowTL.left - containerTL.left;\n const offsetTop = top + windowTL.top - containerTL.top;\n // wrapGroup.style.transform = `translate(${offsetX}px, ${offsetTop}px)`;\n wrapGroup.style.left = `${offsetX}px`;\n wrapGroup.style.top = `${offsetTop}px`;\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/plugins/builtin-plugin/html-attribute-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEjD,MAAM,OAAO,mBAAmB;IAAhC;QACE,SAAI,GAA0B,qBAAqB,CAAC;QACpD,gBAAW,GAAiB,YAAY,CAAC;QAEzC,SAAI,GAAW,SAAS,CAAC,kBAAkB,EAAE,CAAC;QAC9C,QAAG,GAAW,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;IA0ItC,CAAC;IAxIC,QAAQ,CAAC,OAAuB;QAC9B,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC;QAC7B,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE;YACpD,IAAI,CAAC,CAAC,KAAK,IAAI,KAAK,KAAK,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,EAAE;gBAClD,OAAO;aACR;YAED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AAI,CAAC;QACtC,SAAS,CAAC,KAAK,CAAC,GAAG,GAAG,GAAG,SAAS,IAAI,CAAC;IACzC,CAAC;CACF","file":"html-attribute-plugin.js","sourcesContent":["import { Generator } from '../../common/generator';\nimport type { IGraphic, IPlugin, IPluginService, IRenderService, IDrawContext, IGroup } from '../../interface';\nimport { application } from '../../application';\nimport { DefaultAttribute } from '../../graphic';\n\nexport class HtmlAttributePlugin implements IPlugin {\n name: 'HtmlAttributePlugin' = 'HtmlAttributePlugin';\n activeEvent: 'onRegister' = 'onRegister';\n pluginService: IPluginService;\n _uid: number = Generator.GenAutoIncrementId();\n key: string = this.name + this._uid;\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 this.drawHTML(context.stage.renderService);\n });\n application.graphicService.hooks.onRelease.tap(this.key, graphic => {\n this.removeDom(graphic);\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 }\n\n protected drawHTML(renderService: IRenderService) {\n if (application.global.env === 'browser') {\n renderService.renderTreeRoots\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 }\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 removeDom(graphic: IGraphic) {\n if (graphic.bindDom && graphic.bindDom.size) {\n // 删除dom\n graphic.bindDom.forEach(item => {\n item.dom && item.dom.parentElement.removeChild(item.dom);\n });\n graphic.bindDom.clear();\n }\n }\n\n renderGraphicHTML(graphic: IGraphic) {\n const { html } = graphic.attribute;\n if (!html) {\n if (graphic.bindDom && graphic.bindDom.size) {\n // 删除dom\n graphic.bindDom.forEach(item => {\n item.dom && item.dom.parentElement.removeChild(item.dom);\n });\n graphic.bindDom.clear();\n }\n return;\n }\n const stage = graphic.stage;\n if (!stage) {\n return;\n }\n const { dom, container, width, height, style, anchorType = 'boundsLeftTop' } = html;\n if (!graphic.bindDom) {\n graphic.bindDom = new Map();\n }\n const lastDom = graphic.bindDom.get(dom);\n // 如果存在了(dom存在,且container没有变化),就跳过\n if (lastDom && !(container && container !== lastDom.container)) {\n return;\n }\n // 清除上一次的dom\n graphic.bindDom.forEach(({ wrapGroup }) => {\n application.global.removeDom(wrapGroup);\n });\n // 转化这个dom为nativeDOM\n let nativeDom: HTMLElement;\n if (typeof dom === 'string') {\n nativeDom = new DOMParser().parseFromString(dom, 'text/html').firstChild as any;\n } else {\n nativeDom = dom;\n }\n // 获取container的dom,默认为window的container\n let nativeContainer;\n const _container =\n container || (stage.params.enableHtmlAttribute === true ? null : stage.params.enableHtmlAttribute);\n if (_container) {\n if (typeof _container === 'string') {\n nativeContainer = application.global.getElementById(_container);\n } else {\n nativeContainer = _container;\n }\n } else {\n // nativeContainer = application.global.getRootElement();\n nativeContainer = graphic.stage.window.getContainer();\n }\n // 创建wrapGroup\n const wrapGroup = application.global.createDom({ tagName: 'div', width, height, style, parent: nativeContainer });\n if (wrapGroup) {\n wrapGroup.appendChild(nativeDom);\n graphic.bindDom.set(dom, { dom: nativeDom, container, wrapGroup: wrapGroup as any });\n }\n // 事件穿透\n wrapGroup.style.pointerEvents = 'none';\n // 定位wrapGroup\n if (!wrapGroup.style.position) {\n wrapGroup.style.position = 'absolute';\n nativeContainer.style.position = 'relative';\n }\n let left: number = 0;\n let top: number = 0;\n if (anchorType === 'position') {\n const matrix = graphic.transMatrix;\n left = matrix.e;\n top = matrix.f;\n } else {\n const b = graphic.AABBBounds;\n left = b.x1;\n top = b.y1;\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 offsetX = left + windowTL.left - containerTL.left;\n const offsetTop = top + windowTL.top - containerTL.top;\n // wrapGroup.style.transform = `translate(${offsetX}px, ${offsetTop}px)`;\n wrapGroup.style.left = `${offsetX}px`;\n wrapGroup.style.top = `${offsetTop}px`;\n }\n}\n"]}
@@ -88,9 +88,7 @@ let DefaultCanvasAreaRender = class extends BaseRender {
88
88
  });
89
89
  const {x: originX = 0, x: originY = 0} = area.attribute;
90
90
  if (!1 !== fill && (fillCb ? fillCb(context, area.attribute, areaAttribute) : fillOpacity && (context.setCommonStyle(area, area.attribute, originX - offsetX, originY - offsetY, areaAttribute),
91
- context.fill())), this.afterRenderStep(area, context, offsetX, offsetY, !!fillOpacity, !1, fill, !1, areaAttribute, drawContext, fillCb, null, {
92
- attribute: area.attribute
93
- }), stroke) {
91
+ context.fill())), stroke) {
94
92
  const {stroke: stroke = areaAttribute && areaAttribute.stroke} = area.attribute;
95
93
  if (isArray(stroke) && (stroke[0] || stroke[2]) && !1 === stroke[1]) if (context.beginPath(),
96
94
  stroke[0]) {
@@ -107,8 +105,10 @@ let DefaultCanvasAreaRender = class extends BaseRender {
107
105
  context.lineTo((null !== (_d = p.x1) && void 0 !== _d ? _d : p.x) + offsetX, (null !== (_e = p.y1) && void 0 !== _e ? _e : p.y) + offsetY, z);
108
106
  }
109
107
  }
110
- strokeCb ? strokeCb(context, area.attribute, areaAttribute) : (context.setStrokeStyle(area, area.attribute, originX - offsetX, originY - offsetY, areaAttribute),
111
- context.stroke());
108
+ context.setStrokeStyle(area, area.attribute, originX - offsetX, originY - offsetY, areaAttribute),
109
+ context.stroke(), this.afterRenderStep(area, context, offsetX, offsetY, !!fillOpacity, !1, fill, !1, areaAttribute, drawContext, fillCb, null, {
110
+ attribute: area.attribute
111
+ });
112
112
  }
113
113
  }
114
114
  drawShape(area, context, x, y, drawContext, params, fillCb, strokeCb) {
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KAAK,CAAC,sBAAsB,CAAC,CAAA;;GANrB,uBAAuB,CA0nBnC;SA1nBY,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 ICurveType,\n IMarkAttribute,\n IThemeAttribute,\n ISegPath2D,\n IDirection,\n IAreaRenderContribution,\n IDrawContext,\n IRenderService,\n IGraphicRender,\n IGraphicRenderDrawParams,\n IContributionProvider,\n IStrokeType\n} from '../../../interface';\n// eslint-disable-next-line @typescript-eslint/consistent-type-imports\nimport { ContributionProvider } from '../../../common/contribution-provider';\nimport {\n genLinearSegments,\n genBasisSegments,\n genMonotoneXSegments,\n genMonotoneYSegments,\n genStepSegments,\n genLinearClosedSegments\n} from '../../../common/segment';\n\nimport { getTheme } from '../../../graphic/theme';\nimport { drawPathProxy, fillVisible, runFill, runStroke, strokeVisible } from './utils';\nimport { AreaRenderContribution } from './contributions/constants';\nimport { BaseRenderContributionTime, 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';\nimport { segments } from '../../../common/shape/arc';\n\nfunction calcLineCache(\n points: IPointLike[],\n curveType: ICurveType,\n params?: { direction?: IDirection; startPoint?: IPointLike }\n): ISegPath2D | null {\n switch (curveType) {\n case 'linear':\n return genLinearSegments(points, params);\n case 'basis':\n return genBasisSegments(points, params);\n case 'monotoneX':\n return genMonotoneXSegments(points, params);\n case 'monotoneY':\n return genMonotoneYSegments(points, params);\n case 'step':\n return genStepSegments(points, 0.5, params);\n case 'stepBefore':\n return genStepSegments(points, 0, params);\n case 'stepAfter':\n return genStepSegments(points, 1, params);\n case 'linearClosed':\n return genLinearClosedSegments(points, params);\n default:\n return genLinearSegments(points, params);\n }\n}\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 context.beginPath();\n\n const z = this.z ?? 0;\n const { points } = area.attribute;\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 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 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\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 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 } = area.attribute;\n\n const data = this.valid(area, areaAttribute, fillCb, strokeCb);\n if (!data) {\n return;\n }\n const { doFill, doStroke } = data;\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 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(seg.points, curveType, {\n startPoint\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 bottomPoints,\n curveType === 'stepBefore' ? 'stepAfter' : curveType === 'stepAfter' ? 'stepBefore' : curveType\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 = 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 const topCache = calcLineCache(topPoints, curveType);\n const bottomCache = calcLineCache(\n bottomPoints,\n curveType === 'stepBefore' ? 'stepAfter' : curveType === 'stepAfter' ? 'stepBefore' : curveType\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 let ret = false;\n ret =\n ret ||\n 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 false,\n fillCb,\n strokeCb\n );\n ret =\n ret ||\n 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 true,\n fillCb,\n strokeCb\n );\n return ret;\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 connect: boolean,\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 // 绘制connect区域\n let { connectedType, connectedX, connectedY, connectedStyle } = attribute;\n const da = [];\n if (connect) {\n if (isArray(defaultAttribute)) {\n connectedType = connectedType ?? defaultAttribute[0].connectedType ?? defaultAttribute[1].connectedType;\n connectedX = connectedX ?? defaultAttribute[0].connectedX ?? defaultAttribute[1].connectedX;\n connectedY = connectedY ?? defaultAttribute[0].connectedY ?? defaultAttribute[1].connectedY;\n connectedStyle = connectedStyle ?? defaultAttribute[0].connectedStyle ?? defaultAttribute[1].connectedStyle;\n } else {\n connectedType = connectedType ?? defaultAttribute.connectedType;\n connectedX = connectedX ?? defaultAttribute.connectedX;\n connectedY = connectedY ?? defaultAttribute.connectedY;\n connectedStyle = connectedStyle ?? defaultAttribute.connectedStyle;\n }\n\n // 如果有非法值就是none\n if (connectedType !== 'connect' && connectedType !== 'zero') {\n connectedType = 'none';\n }\n\n if (isArray(defaultAttribute)) {\n defaultAttribute.forEach(i => da.push(i));\n } else {\n da.push(defaultAttribute);\n }\n da.push(attribute);\n }\n\n if (connect && connectedType === 'none') {\n return false;\n }\n\n if (!cache) {\n return;\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 direction = xTotalLength > yTotalLength ? Direction.ROW : Direction.COLUMN;\n drawAreaSegments(context.camera ? context : context.nativeContext, cache, clipRange, {\n offsetX,\n offsetY,\n offsetZ,\n direction,\n drawConnect: connect,\n mode: connectedType,\n zeroX: connectedX,\n zeroY: connectedY\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 if (fill !== false) {\n if (fillCb) {\n fillCb(context, attribute, defaultAttribute);\n } else if (fillOpacity) {\n context.setCommonStyle(\n area,\n connect ? connectedStyle : attribute,\n originX - offsetX,\n originY - offsetY,\n connect ? da : defaultAttribute\n );\n context.fill();\n }\n }\n\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\n if (stroke !== false) {\n if (strokeCb) {\n strokeCb(context, attribute, defaultAttribute);\n } else {\n const { stroke = defaultAttribute && defaultAttribute[1] && defaultAttribute[1].stroke } = 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 drawConnect: connect,\n mode: connectedType,\n zeroX: connectedX,\n zeroY: connectedY\n }\n );\n }\n context.setStrokeStyle(\n area,\n connect ? connectedStyle : attribute,\n originX - offsetX,\n originY - offsetY,\n connect ? da : defaultAttribute\n );\n context.stroke();\n }\n }\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;AAqB3E,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,oBAAoB,EACpB,oBAAoB,EACpB,eAAe,EACf,uBAAuB,EACxB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAElD,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAA8B,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAC9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CA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O,CAAC,cAAc,CACpB,IAAI,EACJ,OAAO,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,SAAS,EACpC,OAAO,GAAG,OAAO,EACjB,OAAO,GAAG,OAAO,EACjB,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,gBAAgB,CAChC,CAAC;gBACF,OAAO,CAAC,MAAM,EAAE,CAAC;aAClB;SACF;QAED,OAAO,GAAG,CAAC;IACb,CAAC;CACF,CAAA;AAtnBY,uBAAuB;IADnC,UAAU,EAAE;IAMR,WAAA,MAAM,CAAC,oBAAoB,CAAC,CAAA;IAC5B,WAAA,KAAK,CAAC,sBAAsB,CAAC,CAAA;;GANrB,uBAAuB,CAsnBnC;SAtnBY,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 ICurveType,\n IMarkAttribute,\n IThemeAttribute,\n ISegPath2D,\n IDirection,\n IAreaRenderContribution,\n IDrawContext,\n IRenderService,\n IGraphicRender,\n IGraphicRenderDrawParams,\n IContributionProvider,\n IStrokeType\n} from '../../../interface';\n// eslint-disable-next-line @typescript-eslint/consistent-type-imports\nimport { ContributionProvider } from '../../../common/contribution-provider';\nimport {\n genLinearSegments,\n genBasisSegments,\n genMonotoneXSegments,\n genMonotoneYSegments,\n genStepSegments,\n genLinearClosedSegments\n} from '../../../common/segment';\n\nimport { getTheme } from '../../../graphic/theme';\nimport { drawPathProxy, fillVisible, runFill, runStroke, strokeVisible } from './utils';\nimport { AreaRenderContribution } from './contributions/constants';\nimport { BaseRenderContributionTime, 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';\nimport { segments } from '../../../common/shape/arc';\n\nfunction calcLineCache(\n points: IPointLike[],\n curveType: ICurveType,\n params?: { direction?: IDirection; startPoint?: IPointLike }\n): ISegPath2D | null {\n switch (curveType) {\n case 'linear':\n return genLinearSegments(points, params);\n case 'basis':\n return genBasisSegments(points, params);\n case 'monotoneX':\n return genMonotoneXSegments(points, params);\n case 'monotoneY':\n return genMonotoneYSegments(points, params);\n case 'step':\n return genStepSegments(points, 0.5, params);\n case 'stepBefore':\n return genStepSegments(points, 0, params);\n case 'stepAfter':\n return genStepSegments(points, 1, params);\n case 'linearClosed':\n return genLinearClosedSegments(points, params);\n default:\n return genLinearSegments(points, params);\n }\n}\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 context.beginPath();\n\n const z = this.z ?? 0;\n const { points } = area.attribute;\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 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 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 context.setStrokeStyle(area, area.attribute, originX - offsetX, originY - offsetY, areaAttribute);\n context.stroke();\n\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 }\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 } = area.attribute;\n\n const data = this.valid(area, areaAttribute, fillCb, strokeCb);\n if (!data) {\n return;\n }\n const { doFill, doStroke } = data;\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 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(seg.points, curveType, {\n startPoint\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 bottomPoints,\n curveType === 'stepBefore' ? 'stepAfter' : curveType === 'stepAfter' ? 'stepBefore' : curveType\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 = 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 const topCache = calcLineCache(topPoints, curveType);\n const bottomCache = calcLineCache(\n bottomPoints,\n curveType === 'stepBefore' ? 'stepAfter' : curveType === 'stepAfter' ? 'stepBefore' : curveType\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 let ret = false;\n ret =\n ret ||\n 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 false,\n fillCb,\n strokeCb\n );\n ret =\n ret ||\n 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 true,\n fillCb,\n strokeCb\n );\n return ret;\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 connect: boolean,\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 // 绘制connect区域\n let { connectedType, connectedX, connectedY, connectedStyle } = attribute;\n const da = [];\n if (connect) {\n if (isArray(defaultAttribute)) {\n connectedType = connectedType ?? defaultAttribute[0].connectedType ?? defaultAttribute[1].connectedType;\n connectedX = connectedX ?? defaultAttribute[0].connectedX ?? defaultAttribute[1].connectedX;\n connectedY = connectedY ?? defaultAttribute[0].connectedY ?? defaultAttribute[1].connectedY;\n connectedStyle = connectedStyle ?? defaultAttribute[0].connectedStyle ?? defaultAttribute[1].connectedStyle;\n } else {\n connectedType = connectedType ?? defaultAttribute.connectedType;\n connectedX = connectedX ?? defaultAttribute.connectedX;\n connectedY = connectedY ?? defaultAttribute.connectedY;\n connectedStyle = connectedStyle ?? defaultAttribute.connectedStyle;\n }\n\n // 如果有非法值就是none\n if (connectedType !== 'connect' && connectedType !== 'zero') {\n connectedType = 'none';\n }\n\n if (isArray(defaultAttribute)) {\n defaultAttribute.forEach(i => da.push(i));\n } else {\n da.push(defaultAttribute);\n }\n da.push(attribute);\n }\n\n if (connect && connectedType === 'none') {\n return false;\n }\n\n if (!cache) {\n return;\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 direction = xTotalLength > yTotalLength ? Direction.ROW : Direction.COLUMN;\n drawAreaSegments(context.camera ? context : context.nativeContext, cache, clipRange, {\n offsetX,\n offsetY,\n offsetZ,\n direction,\n drawConnect: connect,\n mode: connectedType,\n zeroX: connectedX,\n zeroY: connectedY\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 if (fill !== false) {\n if (fillCb) {\n fillCb(context, attribute, defaultAttribute);\n } else if (fillOpacity) {\n context.setCommonStyle(\n area,\n connect ? connectedStyle : attribute,\n originX - offsetX,\n originY - offsetY,\n connect ? da : defaultAttribute\n );\n context.fill();\n }\n }\n\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\n if (stroke !== false) {\n if (strokeCb) {\n strokeCb(context, attribute, defaultAttribute);\n } else {\n const { stroke = defaultAttribute && defaultAttribute[1] && defaultAttribute[1].stroke } = 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 drawConnect: connect,\n mode: connectedType,\n zeroX: connectedX,\n zeroY: connectedY\n }\n );\n }\n context.setStrokeStyle(\n area,\n connect ? connectedStyle : attribute,\n originX - offsetX,\n originY - offsetY,\n connect ? da : defaultAttribute\n );\n context.stroke();\n }\n }\n\n return ret;\n }\n}\n"]}
@@ -7,5 +7,5 @@ export declare class DefaultArcRenderContribution implements IArcRenderContribut
7
7
  drawShape(arc: IArc, context: IContext2d, x: number, y: number, doFill: boolean, doStroke: boolean, fVisible: boolean, sVisible: boolean, arcAttribute: Required<IArcGraphicAttribute>, drawContext: IDrawContext, fillCb?: (ctx: IContext2d, markAttribute: Partial<IMarkAttribute & IGraphicAttribute>, themeAttribute: IThemeAttribute) => boolean, strokeCb?: (ctx: IContext2d, markAttribute: Partial<IMarkAttribute & IGraphicAttribute>, themeAttribute: IThemeAttribute) => boolean): void;
8
8
  }
9
9
  export declare const defaultArcRenderContribution: DefaultArcRenderContribution;
10
- export declare const defaultArcTextureRenderContribution: import("./base-texture-contribution-render").DefaultBaseTextureRenderContribution;
10
+ export declare const defaultArcTextureRenderContribution: import("./base-contribution-render").DefaultBaseTextureRenderContribution;
11
11
  export declare const defaultArcBackgroundRenderContribution: import("./base-contribution-render").DefaultBaseBackgroundRenderContribution;
@@ -1,13 +1,11 @@
1
1
  import { getScaledStroke } from "../../../../common/canvas-utils";
2
2
 
3
- import { defaultBaseBackgroundRenderContribution } from "./base-contribution-render";
3
+ import { defaultBaseBackgroundRenderContribution, defaultBaseTextureRenderContribution } from "./base-contribution-render";
4
4
 
5
5
  import { drawArcPath } from "../utils";
6
6
 
7
7
  import { BaseRenderContributionTime } from "../../../../common/enums";
8
8
 
9
- import { defaultBaseTextureRenderContribution } from "./base-texture-contribution-render";
10
-
11
9
  export class DefaultArcRenderContribution {
12
10
  constructor() {
13
11
  this.time = BaseRenderContributionTime.afterFillStroke, this.useStyle = !0, this.order = 0;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/render/contributions/render/contributions/arc-contribution-render.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,uCAAuC,EAAE,MAAM,4BAA4B,CAAC;AACrF,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AACtE,OAAO,EAAE,oCAAoC,EAAE,MAAM,oCAAoC,CAAC;AAE1F,MAAM,OAAO,4BAA4B;IAAzC;QACE,SAAI,GAA+B,0BAA0B,CAAC,eAAe,CAAC;QAC9E,aAAQ,GAAY,IAAI,CAAC;QACzB,UAAK,GAAW,CAAC,CAAC;IAiHpB,CAAC;IAhHC,SAAS,CACP,GAAS,EACT,OAAmB,EACnB,CAAS,EACT,CAAS,EACT,MAAe,EACf,QAAiB,EACjB,QAAiB,EACjB,QAAiB,EACjB,Y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AAC,MAAM,sCAAsC,GAAG,uCAAuC,CAAC","file":"arc-contribution-render.js","sourcesContent":["import type {\n IGraphicAttribute,\n IContext2d,\n IMarkAttribute,\n IArc,\n IArcGraphicAttribute,\n IThemeAttribute,\n IArcRenderContribution,\n IDrawContext\n} from '../../../../interface';\nimport { getScaledStroke } from '../../../../common/canvas-utils';\nimport { defaultBaseBackgroundRenderContribution } from './base-contribution-render';\nimport { drawArcPath } from '../utils';\nimport { BaseRenderContributionTime } from '../../../../common/enums';\nimport { defaultBaseTextureRenderContribution } from './base-texture-contribution-render';\n\nexport class DefaultArcRenderContribution implements IArcRenderContribution {\n time: BaseRenderContributionTime = BaseRenderContributionTime.afterFillStroke;\n useStyle: boolean = true;\n order: number = 0;\n drawShape(\n arc: IArc,\n context: IContext2d,\n x: number,\n y: number,\n doFill: boolean,\n doStroke: boolean,\n fVisible: boolean,\n sVisible: boolean,\n arcAttribute: Required<IArcGraphicAttribute>,\n drawContext: IDrawContext,\n fillCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean\n ) {\n const { outerBorder, innerBorder } = arc.attribute;\n const doOuterBorder = outerBorder && outerBorder.visible !== false;\n const doInnerBorder = innerBorder && innerBorder.visible !== false;\n if (!(doOuterBorder || doInnerBorder)) {\n return;\n }\n const {\n innerRadius = arcAttribute.innerRadius,\n outerRadius = arcAttribute.outerRadius,\n startAngle = arcAttribute.startAngle,\n endAngle = arcAttribute.endAngle,\n opacity = arcAttribute.opacity,\n x: originX = arcAttribute.x,\n y: originY = arcAttribute.y,\n scaleX = arcAttribute.scaleX,\n scaleY = arcAttribute.scaleY\n } = arc.attribute;\n const doStrokeOuter = !!(outerBorder && outerBorder.stroke);\n const doStrokeInner = !!(innerBorder && innerBorder.stroke);\n\n if (doOuterBorder) {\n const { distance = arcAttribute.outerBorder.distance } = outerBorder;\n const d = getScaledStroke(context, distance as number, context.dpr);\n const deltaAngle = (distance as number) / outerRadius;\n arc.setAttributes({\n outerRadius: outerRadius + d,\n innerRadius: innerRadius - d,\n startAngle: startAngle - deltaAngle,\n endAngle: endAngle + deltaAngle\n } as any);\n context.beginPath();\n drawArcPath(arc, context, x, y, outerRadius + d, innerRadius - d);\n // shadow\n context.setShadowBlendStyle && context.setShadowBlendStyle(arc, arc.attribute, arcAttribute);\n\n if (strokeCb) {\n strokeCb(context, outerBorder, arcAttribute.outerBorder);\n } else if (doStrokeOuter) {\n // 存在stroke\n const lastOpacity = (arcAttribute.outerBorder as any).opacity;\n (arcAttribute.outerBorder as any).opacity = opacity;\n context.setStrokeStyle(\n arc,\n outerBorder,\n (originX - x) / scaleX,\n (originY - y) / scaleY,\n arcAttribute.outerBorder as any\n );\n (arcAttribute.outerBorder as any).opacity = lastOpacity;\n context.stroke();\n }\n }\n\n if (doInnerBorder) {\n const { distance = arcAttribute.innerBorder.distance } = innerBorder;\n const d = getScaledStroke(context, distance as number, context.dpr);\n const deltaAngle = (distance as number) / outerRadius;\n arc.setAttributes({\n outerRadius: outerRadius - d,\n innerRadius: innerRadius + d,\n startAngle: startAngle + deltaAngle,\n endAngle: endAngle - deltaAngle\n } as any);\n context.beginPath();\n drawArcPath(arc, context, x, y, outerRadius - d, innerRadius + d);\n // arc.setAttributes({ outerRadius: outerRadius, innerRadius: innerRadius });\n\n // shadow\n context.setShadowBlendStyle && context.setShadowBlendStyle(arc, arc.attribute, arcAttribute);\n\n if (strokeCb) {\n strokeCb(context, innerBorder, arcAttribute.innerBorder);\n } else if (doStrokeInner) {\n // 存在stroke\n const lastOpacity = (arcAttribute.innerBorder as any).opacity;\n (arcAttribute.innerBorder as any).opacity = opacity;\n context.setStrokeStyle(\n arc,\n innerBorder,\n (originX - x) / scaleX,\n (originY - y) / scaleY,\n arcAttribute.innerBorder as any\n );\n (arcAttribute.innerBorder as any).opacity = lastOpacity;\n context.stroke();\n }\n }\n\n arc.setAttributes({ outerRadius: outerRadius, innerRadius: innerRadius, startAngle, endAngle } as any);\n }\n}\n\nexport const defaultArcRenderContribution = new DefaultArcRenderContribution();\nexport const defaultArcTextureRenderContribution = defaultBaseTextureRenderContribution;\nexport const defaultArcBackgroundRenderContribution = defaultBaseBackgroundRenderContribution;\n"]}
1
+ {"version":3,"sources":["../src/render/contributions/render/contributions/arc-contribution-render.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EACL,uCAAuC,EACvC,oCAAoC,EACrC,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AAEtE,MAAM,OAAO,4BAA4B;IAAzC;QACE,SAAI,GAA+B,0BAA0B,CAAC,eAAe,CAAC;QAC9E,aAAQ,GAAY,IAAI,CAAC;QACzB,UAAK,GAAW,CAAC,CAAC;IAiHpB,CAAC;IAhHC,SAAS,CACP,GAAS,EACT,OAAmB,EACnB,CAAS,EACT,CAAS,EACT,MAAe,EACf,QAAiB,EACjB,QAAiB,EACjB,QAAiB,EACjB,YAA4C,EAC5C,WAAyB,EACzB,MAIY,EACZ,QAIY;QAEZ,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,GAAG,GAAG,CAAC,SAAS,CAAC;QACnD,MAAM,aAAa,GAAG,WAAW,IAAI,WAAW,CAAC,OAAO,KAAK,KAAK,CAAC;QACnE,MAAM,aAAa,GAAG,WAAW,IAAI,WAAW,CAAC,OAAO,KAAK,KAAK,CAAC;QACnE,IAAI,CAAC,CAAC,aAAa,IAAI,aAAa,CAAC,EAAE;YACrC,OAAO;SACR;QACD,MAAM,EACJ,WAAW,GAAG,YAAY,CAAC,WAAW,EACtC,WAAW,GAAG,YAAY,CAAC,WAAW,EACtC,UAAU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AE7F,IAAI,QAAQ,EAAE;gBACZ,QAAQ,CAAC,OAAO,EAAE,WAAW,EAAE,YAAY,CAAC,WAAW,CAAC,CAAC;aAC1D;iBAAM,IAAI,aAAa,EAAE;gBAExB,MAAM,WAAW,GAAI,YAAY,CAAC,WAAmB,CAAC,OAAO,CAAC;gBAC7D,YAAY,CAAC,WAAmB,CAAC,OAAO,GAAG,OAAO,CAAC;gBACpD,OAAO,CAAC,cAAc,CACpB,GAAG,EACH,WAAW,EACX,CAAC,OAAO,GAAG,CAAC,CAAC,GAAG,MAAM,EACtB,CAAC,OAAO,GAAG,CAAC,CAAC,GAAG,MAAM,EACtB,YAAY,CAAC,WAAkB,CAChC,CAAC;gBACD,YAAY,CAAC,WAAmB,CAAC,OAAO,GAAG,WAAW,CAAC;gBACxD,OAAO,CAAC,MAAM,EAAE,CAAC;aAClB;SACF;QAED,GAAG,CAAC,aAAa,CAAC,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAS,CAAC,CAAC;IACzG,CAAC;CACF;AAED,MAAM,CAAC,MAAM,4BAA4B,GAAG,IAAI,4BAA4B,EAAE,CAAC;AAC/E,MAAM,CAAC,MAAM,mCAAmC,GAAG,oCAAoC,CAAC;AACxF,MAAM,CAAC,MAAM,sCAAsC,GAAG,uCAAuC,CAAC","file":"arc-contribution-render.js","sourcesContent":["import { injectable } from '../../../../common/inversify-lite';\nimport type {\n IGraphicAttribute,\n IContext2d,\n IMarkAttribute,\n IArc,\n IArcGraphicAttribute,\n IThemeAttribute,\n IArcRenderContribution,\n IDrawContext\n} from '../../../../interface';\nimport { getScaledStroke } from '../../../../common/canvas-utils';\nimport {\n defaultBaseBackgroundRenderContribution,\n defaultBaseTextureRenderContribution\n} from './base-contribution-render';\nimport { drawArcPath } from '../utils';\nimport { BaseRenderContributionTime } from '../../../../common/enums';\n\nexport class DefaultArcRenderContribution implements IArcRenderContribution {\n time: BaseRenderContributionTime = BaseRenderContributionTime.afterFillStroke;\n useStyle: boolean = true;\n order: number = 0;\n drawShape(\n arc: IArc,\n context: IContext2d,\n x: number,\n y: number,\n doFill: boolean,\n doStroke: boolean,\n fVisible: boolean,\n sVisible: boolean,\n arcAttribute: Required<IArcGraphicAttribute>,\n drawContext: IDrawContext,\n fillCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean\n ) {\n const { outerBorder, innerBorder } = arc.attribute;\n const doOuterBorder = outerBorder && outerBorder.visible !== false;\n const doInnerBorder = innerBorder && innerBorder.visible !== false;\n if (!(doOuterBorder || doInnerBorder)) {\n return;\n }\n const {\n innerRadius = arcAttribute.innerRadius,\n outerRadius = arcAttribute.outerRadius,\n startAngle = arcAttribute.startAngle,\n endAngle = arcAttribute.endAngle,\n opacity = arcAttribute.opacity,\n x: originX = arcAttribute.x,\n y: originY = arcAttribute.y,\n scaleX = arcAttribute.scaleX,\n scaleY = arcAttribute.scaleY\n } = arc.attribute;\n const doStrokeOuter = !!(outerBorder && outerBorder.stroke);\n const doStrokeInner = !!(innerBorder && innerBorder.stroke);\n\n if (doOuterBorder) {\n const { distance = arcAttribute.outerBorder.distance } = outerBorder;\n const d = getScaledStroke(context, distance as number, context.dpr);\n const deltaAngle = (distance as number) / outerRadius;\n arc.setAttributes({\n outerRadius: outerRadius + d,\n innerRadius: innerRadius - d,\n startAngle: startAngle - deltaAngle,\n endAngle: endAngle + deltaAngle\n } as any);\n context.beginPath();\n drawArcPath(arc, context, x, y, outerRadius + d, innerRadius - d);\n // shadow\n context.setShadowBlendStyle && context.setShadowBlendStyle(arc, arc.attribute, arcAttribute);\n\n if (strokeCb) {\n strokeCb(context, outerBorder, arcAttribute.outerBorder);\n } else if (doStrokeOuter) {\n // 存在stroke\n const lastOpacity = (arcAttribute.outerBorder as any).opacity;\n (arcAttribute.outerBorder as any).opacity = opacity;\n context.setStrokeStyle(\n arc,\n outerBorder,\n (originX - x) / scaleX,\n (originY - y) / scaleY,\n arcAttribute.outerBorder as any\n );\n (arcAttribute.outerBorder as any).opacity = lastOpacity;\n context.stroke();\n }\n }\n\n if (doInnerBorder) {\n const { distance = arcAttribute.innerBorder.distance } = innerBorder;\n const d = getScaledStroke(context, distance as number, context.dpr);\n const deltaAngle = (distance as number) / outerRadius;\n arc.setAttributes({\n outerRadius: outerRadius - d,\n innerRadius: innerRadius + d,\n startAngle: startAngle + deltaAngle,\n endAngle: endAngle - deltaAngle\n } as any);\n context.beginPath();\n drawArcPath(arc, context, x, y, outerRadius - d, innerRadius + d);\n // arc.setAttributes({ outerRadius: outerRadius, innerRadius: innerRadius });\n\n // shadow\n context.setShadowBlendStyle && context.setShadowBlendStyle(arc, arc.attribute, arcAttribute);\n\n if (strokeCb) {\n strokeCb(context, innerBorder, arcAttribute.innerBorder);\n } else if (doStrokeInner) {\n // 存在stroke\n const lastOpacity = (arcAttribute.innerBorder as any).opacity;\n (arcAttribute.innerBorder as any).opacity = opacity;\n context.setStrokeStyle(\n arc,\n innerBorder,\n (originX - x) / scaleX,\n (originY - y) / scaleY,\n arcAttribute.innerBorder as any\n );\n (arcAttribute.innerBorder as any).opacity = lastOpacity;\n context.stroke();\n }\n }\n\n arc.setAttributes({ outerRadius: outerRadius, innerRadius: innerRadius, startAngle, endAngle } as any);\n }\n}\n\nexport const defaultArcRenderContribution = new DefaultArcRenderContribution();\nexport const defaultArcTextureRenderContribution = defaultBaseTextureRenderContribution;\nexport const defaultArcBackgroundRenderContribution = defaultBaseBackgroundRenderContribution;\n"]}
@@ -1,3 +1,11 @@
1
- import { DefaultAreaTextureRenderContribution } from './area-texture-contribution-render';
1
+ import type { IGraphicAttribute, IContext2d, IThemeAttribute, IArea, IAreaGraphicAttribute, IAreaRenderContribution, IDrawContext } from '../../../../interface';
2
+ import { DefaultBaseTextureRenderContribution } from './base-contribution-render';
3
+ import { BaseRenderContributionTime } from '../../../../common/enums';
4
+ export declare class DefaultAreaTextureRenderContribution extends DefaultBaseTextureRenderContribution implements IAreaRenderContribution {
5
+ time: BaseRenderContributionTime;
6
+ drawShape(graphic: IArea, context: IContext2d, x: number, y: number, doFill: boolean, doStroke: boolean, fVisible: boolean, sVisible: boolean, graphicAttribute: Required<IGraphicAttribute>, drawContext: IDrawContext, fillCb?: (ctx: IContext2d, markAttribute: Partial<IGraphicAttribute>, themeAttribute: IThemeAttribute) => boolean, strokeCb?: (ctx: IContext2d, markAttribute: Partial<IGraphicAttribute>, themeAttribute: IThemeAttribute) => boolean, options?: {
7
+ attribute?: Partial<IAreaGraphicAttribute>;
8
+ }): void;
9
+ }
2
10
  export declare const defaultAreaTextureRenderContribution: DefaultAreaTextureRenderContribution;
3
11
  export declare const defaultAreaBackgroundRenderContribution: import("./base-contribution-render").DefaultBaseBackgroundRenderContribution;
@@ -1,6 +1,55 @@
1
- import { defaultBaseBackgroundRenderContribution } from "./base-contribution-render";
1
+ import { DefaultBaseTextureRenderContribution, defaultBaseBackgroundRenderContribution } from "./base-contribution-render";
2
2
 
3
- import { DefaultAreaTextureRenderContribution } from "./area-texture-contribution-render";
3
+ import { getAttributeFromDefaultAttrList } from "../../../../common/utils";
4
+
5
+ import { BaseRenderContributionTime } from "../../../../common/enums";
6
+
7
+ export class DefaultAreaTextureRenderContribution extends DefaultBaseTextureRenderContribution {
8
+ constructor() {
9
+ super(...arguments), this.time = BaseRenderContributionTime.afterFillStroke;
10
+ }
11
+ drawShape(graphic, context, x, y, doFill, doStroke, fVisible, sVisible, graphicAttribute, drawContext, fillCb, strokeCb, options) {
12
+ var _a, _b, _c, _d;
13
+ this.textureMap || this.initTextureMap(context, graphic.stage);
14
+ const {attribute: attribute = graphic.attribute} = options || {}, {texture: texture = (null !== (_a = graphic.attribute.texture) && void 0 !== _a ? _a : getAttributeFromDefaultAttrList(graphicAttribute, "texture")), textureColor: textureColor = (null !== (_b = graphic.attribute.textureColor) && void 0 !== _b ? _b : getAttributeFromDefaultAttrList(graphicAttribute, "textureColor")), textureSize: textureSize = (null !== (_c = graphic.attribute.textureSize) && void 0 !== _c ? _c : getAttributeFromDefaultAttrList(graphicAttribute, "textureSize")), texturePadding: texturePadding = (null !== (_d = graphic.attribute.texturePadding) && void 0 !== _d ? _d : getAttributeFromDefaultAttrList(graphicAttribute, "texturePadding"))} = attribute;
15
+ if (!texture) return;
16
+ let pattern = this.textureMap.get(texture);
17
+ if (!pattern) switch (texture) {
18
+ case "circle":
19
+ pattern = this.createCirclePattern(textureSize, texturePadding, textureColor, context);
20
+ break;
21
+
22
+ case "diamond":
23
+ pattern = this.createDiamondPattern(textureSize, texturePadding, textureColor, context);
24
+ break;
25
+
26
+ case "rect":
27
+ pattern = this.createRectPattern(textureSize, texturePadding, textureColor, context);
28
+ break;
29
+
30
+ case "vertical-line":
31
+ pattern = this.createVerticalLinePattern(textureSize, texturePadding, textureColor, context);
32
+ break;
33
+
34
+ case "horizontal-line":
35
+ pattern = this.createHorizontalLinePattern(textureSize, texturePadding, textureColor, context);
36
+ break;
37
+
38
+ case "bias-lr":
39
+ pattern = this.createBiasLRLinePattern(textureSize, texturePadding, textureColor, context);
40
+ break;
41
+
42
+ case "bias-rl":
43
+ pattern = this.createBiasRLLinePattern(textureSize, texturePadding, textureColor, context);
44
+ break;
45
+
46
+ case "grid":
47
+ pattern = this.createGridPattern(textureSize, texturePadding, textureColor, context);
48
+ }
49
+ pattern && (context.highPerformanceSave(), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute),
50
+ context.fillStyle = pattern, context.fill(), context.highPerformanceRestore());
51
+ }
52
+ }
4
53
 
5
54
  export const defaultAreaTextureRenderContribution = new DefaultAreaTextureRenderContribution;
6
55
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/render/contributions/render/contributions/area-contribution-render.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uCAAuC,EAAE,MAAM,4BAA4B,CAAC;AAErF,OAAO,EAAE,oCAAoC,EAAE,MAAM,oCAAoC,CAAC;AAE1F,MAAM,CAAC,MAAM,oCAAoC,GAAG,IAAI,oCAAoC,EAAE,CAAC;AAC/F,MAAM,CAAC,MAAM,uCAAuC,GAAG,uCAAuC,CAAC","file":"area-contribution-render.js","sourcesContent":["import { defaultBaseBackgroundRenderContribution } from './base-contribution-render';\n\nimport { DefaultAreaTextureRenderContribution } from './area-texture-contribution-render';\n\nexport const defaultAreaTextureRenderContribution = new DefaultAreaTextureRenderContribution();\nexport const defaultAreaBackgroundRenderContribution = defaultBaseBackgroundRenderContribution;\n"]}
1
+ {"version":3,"sources":["../src/render/contributions/render/contributions/area-contribution-render.ts"],"names":[],"mappings":"AAWA,OAAO,EACL,oCAAoC,EACpC,uCAAuC,EACxC,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,+BAA+B,EAAE,MAAM,0BAA0B,CAAC;AAC3E,OAAO,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AAEtE,MAAM,OAAO,oCACX,SAAQ,oCAAoC;IAD9C;;QAIE,SAAI,GAA+B,0BAA0B,CAAC,eAAe,CAAC;IA0EhF,CAAC;IAxEC,SAAS,CACP,OAAc,EACd,OAAmB,EACnB,CAAS,EACT,CAAS,EACT,MAAe,EACf,QAAiB,EACjB,QAAiB,EACjB,QAAiB,EACjB,gBAA6C,EAC7C,WAAyB,EACzB,MAAiH,EACjH,QAAmH,EACnH,OAEC;;QAED,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE;YACpB,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;SAC7C;QAED,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC,SAAS,EAAE,GAAG,OAAO,IAAI,EAAE,CAAC;QAExD,MAAM,EACJ,OAAO,GAAG,MAAA,OAAO,CAAC,SAAS,CAAC,OAAO,mCAAI,+BAA+B,CAAC,gBA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AAG,IAAI,CAAC,uBAAuB,CAAC,WAAW,EAAE,cAAc,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC;oBAC3F,MAAM;gBACR,KAAK,SAAS;oBACZ,OAAO,GAAG,IAAI,CAAC,uBAAuB,CAAC,WAAW,EAAE,cAAc,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC;oBAC3F,MAAM;gBACR,KAAK,MAAM;oBACT,OAAO,GAAG,IAAI,CAAC,iBAAiB,CAAC,WAAW,EAAE,cAAc,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC;oBACrF,MAAM;aACT;SACF;QAED,IAAI,OAAO,EAAE;YACX,OAAO,CAAC,mBAAmB,EAAE,CAAC;YAC9B,OAAO,CAAC,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,SAAS,EAAE,CAAC,EAAE,CAAC,EAAE,gBAAgB,CAAC,CAAC;YAC3E,OAAO,CAAC,SAAS,GAAG,OAAO,CAAC;YAC5B,OAAO,CAAC,IAAI,EAAE,CAAC;YACf,OAAO,CAAC,sBAAsB,EAAE,CAAC;SAClC;IACH,CAAC;CACF;AAED,MAAM,CAAC,MAAM,oCAAoC,GAAG,IAAI,oCAAoC,EAAE,CAAC;AAC/F,MAAM,CAAC,MAAM,uCAAuC,GAAG,uCAAuC,CAAC","file":"area-contribution-render.js","sourcesContent":["import { injectable } from '../../../../common/inversify-lite';\nimport type {\n IGraphicAttribute,\n IContext2d,\n IMarkAttribute,\n IThemeAttribute,\n IArea,\n IAreaGraphicAttribute,\n IAreaRenderContribution,\n IDrawContext\n} from '../../../../interface';\nimport {\n DefaultBaseTextureRenderContribution,\n defaultBaseBackgroundRenderContribution\n} from './base-contribution-render';\nimport { getAttributeFromDefaultAttrList } from '../../../../common/utils';\nimport { BaseRenderContributionTime } from '../../../../common/enums';\n\nexport class DefaultAreaTextureRenderContribution\n extends DefaultBaseTextureRenderContribution\n implements IAreaRenderContribution\n{\n time: BaseRenderContributionTime = BaseRenderContributionTime.afterFillStroke;\n\n drawShape(\n graphic: IArea,\n context: IContext2d,\n x: number,\n y: number,\n doFill: boolean,\n doStroke: boolean,\n fVisible: boolean,\n sVisible: boolean,\n graphicAttribute: Required<IGraphicAttribute>,\n drawContext: IDrawContext,\n fillCb?: (ctx: IContext2d, markAttribute: Partial<IGraphicAttribute>, themeAttribute: IThemeAttribute) => boolean,\n strokeCb?: (ctx: IContext2d, markAttribute: Partial<IGraphicAttribute>, themeAttribute: IThemeAttribute) => boolean,\n options?: {\n attribute?: Partial<IAreaGraphicAttribute>;\n }\n ) {\n if (!this.textureMap) {\n this.initTextureMap(context, graphic.stage);\n }\n\n const { attribute = graphic.attribute } = options || {};\n\n const {\n texture = graphic.attribute.texture ?? getAttributeFromDefaultAttrList(graphicAttribute, 'texture'),\n textureColor = graphic.attribute.textureColor ??\n getAttributeFromDefaultAttrList(graphicAttribute, 'textureColor'),\n textureSize = graphic.attribute.textureSize ?? getAttributeFromDefaultAttrList(graphicAttribute, 'textureSize'),\n texturePadding = graphic.attribute.texturePadding ??\n getAttributeFromDefaultAttrList(graphicAttribute, 'texturePadding')\n } = attribute;\n if (!texture) {\n return;\n }\n let pattern: CanvasPattern = this.textureMap.get(texture);\n if (!pattern) {\n switch (texture) {\n case 'circle':\n pattern = this.createCirclePattern(textureSize, texturePadding, textureColor, context);\n break;\n case 'diamond':\n pattern = this.createDiamondPattern(textureSize, texturePadding, textureColor, context);\n break;\n case 'rect':\n pattern = this.createRectPattern(textureSize, texturePadding, textureColor, context);\n break;\n case 'vertical-line':\n pattern = this.createVerticalLinePattern(textureSize, texturePadding, textureColor, context);\n break;\n case 'horizontal-line':\n pattern = this.createHorizontalLinePattern(textureSize, texturePadding, textureColor, context);\n break;\n case 'bias-lr':\n pattern = this.createBiasLRLinePattern(textureSize, texturePadding, textureColor, context);\n break;\n case 'bias-rl':\n pattern = this.createBiasRLLinePattern(textureSize, texturePadding, textureColor, context);\n break;\n case 'grid':\n pattern = this.createGridPattern(textureSize, texturePadding, textureColor, context);\n break;\n }\n }\n\n if (pattern) {\n context.highPerformanceSave();\n context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute);\n context.fillStyle = pattern;\n context.fill();\n context.highPerformanceRestore();\n }\n }\n}\n\nexport const defaultAreaTextureRenderContribution = new DefaultAreaTextureRenderContribution();\nexport const defaultAreaBackgroundRenderContribution = defaultBaseBackgroundRenderContribution;\n"]}
@@ -1,4 +1,4 @@
1
- import type { IGraphicAttribute, IContext2d, IGraphic, IThemeAttribute, IBaseRenderContribution, IContributionProvider, IDrawContext } from '../../../../interface';
1
+ import type { IGraphicAttribute, IContext2d, IGraphic, IStage, IThemeAttribute, IBaseRenderContribution, IContributionProvider, IDrawContext } from '../../../../interface';
2
2
  import type { IBounds } from '@visactor/vutils';
3
3
  import { BaseRenderContributionTime } from '../../../../common/enums';
4
4
  export declare class DefaultBaseBackgroundRenderContribution implements IBaseRenderContribution<IGraphic, IGraphicAttribute> {
@@ -6,7 +6,7 @@ export declare class DefaultBaseBackgroundRenderContribution implements IBaseRen
6
6
  useStyle: boolean;
7
7
  order: number;
8
8
  drawShape(graphic: IGraphic, context: IContext2d, x: number, y: number, doFill: boolean, doStroke: boolean, fVisible: boolean, sVisible: boolean, graphicAttribute: Required<IGraphicAttribute>, drawContext: IDrawContext, fillCb?: (ctx: IContext2d, markAttribute: Partial<IGraphicAttribute>, themeAttribute: IThemeAttribute) => boolean, strokeCb?: (ctx: IContext2d, markAttribute: Partial<IGraphicAttribute>, themeAttribute: IThemeAttribute) => boolean, options?: any): void;
9
- protected doDrawImage(context: IContext2d, data: any, b: IBounds, backgroundMode: 'repeat' | 'repeat-x' | 'repeat-y' | 'no-repeat', backgroundFit: boolean): void;
9
+ protected doDrawImage(context: IContext2d, data: any, b: IBounds, backgroundMode: 'repeat' | 'repeat-x' | 'repeat-y' | 'no-repeat'): void;
10
10
  }
11
11
  export declare const defaultBaseBackgroundRenderContribution: DefaultBaseBackgroundRenderContribution;
12
12
  export interface IInteractiveSubRenderContribution {
@@ -21,3 +21,21 @@ export declare class DefaultBaseInteractiveRenderContribution implements IBaseRe
21
21
  constructor(subRenderContribitions: IContributionProvider<IInteractiveSubRenderContribution>);
22
22
  drawShape(graphic: IGraphic, context: IContext2d, x: number, y: number, doFill: boolean, doStroke: boolean, fVisible: boolean, sVisible: boolean, graphicAttribute: Required<IGraphicAttribute>, drawContext: IDrawContext, fillCb?: (ctx: IContext2d, markAttribute: Partial<IGraphicAttribute>, themeAttribute: IThemeAttribute) => boolean, strokeCb?: (ctx: IContext2d, markAttribute: Partial<IGraphicAttribute>, themeAttribute: IThemeAttribute) => boolean, options?: any): void;
23
23
  }
24
+ export declare class DefaultBaseTextureRenderContribution implements IBaseRenderContribution<IGraphic, IGraphicAttribute> {
25
+ time: BaseRenderContributionTime;
26
+ useStyle: boolean;
27
+ textureMap?: Map<string, CanvasPattern>;
28
+ order: number;
29
+ createCommonPattern(size: number, padding: number, color: string, targetContext: IContext2d, cb: (r: number, targetContext: IContext2d) => void): CanvasPattern;
30
+ createCirclePattern(size: number, padding: number, color: string, targetContext: IContext2d): CanvasPattern;
31
+ createDiamondPattern(size: number, padding: number, color: string, targetContext: IContext2d): CanvasPattern;
32
+ createRectPattern(size: number, padding: number, color: string, targetContext: IContext2d): CanvasPattern;
33
+ createVerticalLinePattern(size: number, padding: number, color: string, targetContext: IContext2d): CanvasPattern;
34
+ createHorizontalLinePattern(size: number, padding: number, color: string, targetContext: IContext2d): CanvasPattern;
35
+ createBiasLRLinePattern(size: number, padding: number, color: string, targetContext: IContext2d): CanvasPattern;
36
+ createBiasRLLinePattern(size: number, padding: number, color: string, targetContext: IContext2d): CanvasPattern;
37
+ createGridPattern(size: number, padding: number, color: string, targetContext: IContext2d): CanvasPattern;
38
+ initTextureMap(ctx: IContext2d, stage: IStage): void;
39
+ drawShape(graphic: IGraphic, context: IContext2d, x: number, y: number, doFill: boolean, doStroke: boolean, fVisible: boolean, sVisible: boolean, graphicAttribute: Required<IGraphicAttribute>, drawContext: IDrawContext, fillCb?: (ctx: IContext2d, markAttribute: Partial<IGraphicAttribute>, themeAttribute: IThemeAttribute) => boolean, strokeCb?: (ctx: IContext2d, markAttribute: Partial<IGraphicAttribute>, themeAttribute: IThemeAttribute) => boolean, options?: any): void;
40
+ }
41
+ export declare const defaultBaseTextureRenderContribution: DefaultBaseTextureRenderContribution;