@visactor/vrender 0.15.0-alpha.16 → 0.15.0-alpha.17

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 (375) hide show
  1. package/cjs/animate/animate.d.ts +1 -0
  2. package/cjs/animate/animate.js +3 -0
  3. package/cjs/animate/animate.js.map +1 -1
  4. package/cjs/animate/timeline.d.ts +1 -1
  5. package/cjs/animate/timeline.js +2 -2
  6. package/cjs/animate/timeline.js.map +1 -1
  7. package/cjs/canvas/contributions/browser/context.d.ts +1 -0
  8. package/cjs/common/contribution-provider.d.ts +1 -0
  9. package/cjs/common/contribution-provider.js +7 -2
  10. package/cjs/common/contribution-provider.js.map +1 -1
  11. package/cjs/common/enums.d.ts +4 -2
  12. package/cjs/common/enums.js +3 -2
  13. package/cjs/common/enums.js.map +1 -1
  14. package/cjs/core/contributions/env/base-contribution.d.ts +11 -1
  15. package/cjs/core/contributions/env/base-contribution.js +22 -1
  16. package/cjs/core/contributions/env/base-contribution.js.map +1 -1
  17. package/cjs/core/contributions/env/browser-contribution.d.ts +11 -2
  18. package/cjs/core/contributions/env/browser-contribution.js +66 -0
  19. package/cjs/core/contributions/env/browser-contribution.js.map +1 -1
  20. package/cjs/core/contributions/textMeasure/layout.js +1 -1
  21. package/cjs/core/contributions/textMeasure/layout.js.map +1 -1
  22. package/cjs/core/contributions/window/base-contribution.d.ts +11 -5
  23. package/cjs/core/contributions/window/base-contribution.js +10 -0
  24. package/cjs/core/contributions/window/base-contribution.js.map +1 -1
  25. package/cjs/core/contributions/window/browser-contribution.d.ts +11 -0
  26. package/cjs/core/contributions/window/browser-contribution.js +33 -2
  27. package/cjs/core/contributions/window/browser-contribution.js.map +1 -1
  28. package/cjs/core/global.d.ts +11 -1
  29. package/cjs/core/global.js +18 -0
  30. package/cjs/core/global.js.map +1 -1
  31. package/cjs/core/graphic-utils.d.ts +2 -0
  32. package/cjs/core/graphic-utils.js +13 -0
  33. package/cjs/core/graphic-utils.js.map +1 -1
  34. package/cjs/core/layer.js +6 -6
  35. package/cjs/core/layer.js.map +1 -1
  36. package/cjs/core/stage.d.ts +13 -4
  37. package/cjs/core/stage.js +54 -25
  38. package/cjs/core/stage.js.map +1 -1
  39. package/cjs/core/window.d.ts +6 -0
  40. package/cjs/core/window.js +10 -1
  41. package/cjs/core/window.js.map +1 -1
  42. package/cjs/event/event-manager.js +8 -8
  43. package/cjs/event/event-manager.js.map +1 -1
  44. package/cjs/event/event-system.js.map +1 -1
  45. package/cjs/event/federated-event/pointer-event.d.ts +1 -0
  46. package/cjs/event/federated-event/pointer-event.js.map +1 -1
  47. package/cjs/graphic/builtin-symbol/arrow2-down.d.ts +12 -0
  48. package/cjs/graphic/builtin-symbol/arrow2-down.js +30 -0
  49. package/cjs/graphic/builtin-symbol/arrow2-down.js.map +1 -0
  50. package/cjs/graphic/builtin-symbol/arrow2-left.js +1 -1
  51. package/cjs/graphic/builtin-symbol/arrow2-left.js.map +1 -1
  52. package/cjs/graphic/builtin-symbol/arrow2-right.js +1 -1
  53. package/cjs/graphic/builtin-symbol/arrow2-right.js.map +1 -1
  54. package/cjs/graphic/builtin-symbol/arrow2-up.d.ts +12 -0
  55. package/cjs/graphic/builtin-symbol/arrow2-up.js +30 -0
  56. package/cjs/graphic/builtin-symbol/arrow2-up.js.map +1 -0
  57. package/cjs/graphic/builtin-symbol/close.d.ts +13 -0
  58. package/cjs/graphic/builtin-symbol/close.js +33 -0
  59. package/cjs/graphic/builtin-symbol/close.js.map +1 -0
  60. package/cjs/graphic/builtin-symbol/index.d.ts +1 -1
  61. package/cjs/graphic/builtin-symbol/index.js +2 -2
  62. package/cjs/graphic/builtin-symbol/index.js.map +1 -1
  63. package/cjs/graphic/builtin-symbol/line-h.d.ts +13 -0
  64. package/cjs/graphic/builtin-symbol/line-h.js +32 -0
  65. package/cjs/graphic/builtin-symbol/line-h.js.map +1 -0
  66. package/cjs/graphic/builtin-symbol/line-v.d.ts +13 -0
  67. package/cjs/graphic/builtin-symbol/line-v.js +32 -0
  68. package/cjs/graphic/builtin-symbol/line-v.js.map +1 -0
  69. package/cjs/graphic/builtin-symbol/utils.d.ts +13 -5
  70. package/cjs/graphic/builtin-symbol/utils.js +23 -9
  71. package/cjs/graphic/builtin-symbol/utils.js.map +1 -1
  72. package/cjs/graphic/config.js +8 -4
  73. package/cjs/graphic/config.js.map +1 -1
  74. package/cjs/graphic/constants.d.ts +22 -0
  75. package/cjs/graphic/constants.js +20 -2
  76. package/cjs/graphic/constants.js.map +1 -1
  77. package/cjs/graphic/graphic.d.ts +4 -1
  78. package/cjs/graphic/graphic.js +49 -21
  79. package/cjs/graphic/graphic.js.map +1 -1
  80. package/cjs/graphic/group.js +1 -1
  81. package/cjs/graphic/group.js.map +1 -1
  82. package/cjs/graphic/index.d.ts +1 -0
  83. package/cjs/graphic/index.js +13 -13
  84. package/cjs/graphic/index.js.map +1 -1
  85. package/cjs/graphic/richtext/utils.d.ts +1 -1
  86. package/cjs/graphic/richtext/utils.js +1 -1
  87. package/cjs/graphic/richtext/utils.js.map +1 -1
  88. package/cjs/graphic/symbol.d.ts +2 -1
  89. package/cjs/graphic/symbol.js +27 -4
  90. package/cjs/graphic/symbol.js.map +1 -1
  91. package/cjs/graphic/text.js +33 -23
  92. package/cjs/graphic/text.js.map +1 -1
  93. package/cjs/graphic/tools.d.ts +3 -2
  94. package/cjs/graphic/tools.js +58 -3
  95. package/cjs/graphic/tools.js.map +1 -1
  96. package/cjs/graphic/wrap-text.js +10 -8
  97. package/cjs/graphic/wrap-text.js.map +1 -1
  98. package/cjs/index.d.ts +3 -1
  99. package/cjs/index.js +3 -3
  100. package/cjs/index.js.map +1 -1
  101. package/cjs/interface/animate.d.ts +3 -1
  102. package/cjs/interface/animate.js.map +1 -1
  103. package/cjs/interface/core.d.ts +1 -0
  104. package/cjs/interface/core.js.map +1 -1
  105. package/cjs/interface/global.d.ts +25 -1
  106. package/cjs/interface/global.js.map +1 -1
  107. package/cjs/interface/graphic/image.d.ts +1 -0
  108. package/cjs/interface/graphic/image.js.map +1 -1
  109. package/cjs/interface/graphic/symbol.d.ts +3 -2
  110. package/cjs/interface/graphic/symbol.js.map +1 -1
  111. package/cjs/interface/graphic/text.d.ts +1 -0
  112. package/cjs/interface/graphic/text.js.map +1 -1
  113. package/cjs/interface/graphic.d.ts +27 -3
  114. package/cjs/interface/graphic.js.map +1 -1
  115. package/cjs/interface/picker.d.ts +9 -1
  116. package/cjs/interface/picker.js.map +1 -1
  117. package/cjs/interface/render.d.ts +1 -0
  118. package/cjs/interface/render.js.map +1 -1
  119. package/cjs/interface/stage.d.ts +10 -3
  120. package/cjs/interface/stage.js.map +1 -1
  121. package/cjs/interface/window.d.ts +12 -0
  122. package/cjs/interface/window.js.map +1 -1
  123. package/cjs/jsx/graphicType.d.ts +172 -0
  124. package/cjs/jsx/graphicType.js +133 -0
  125. package/cjs/jsx/graphicType.js.map +1 -0
  126. package/cjs/jsx/index.d.ts +2 -0
  127. package/cjs/jsx/index.js +21 -0
  128. package/cjs/jsx/index.js.map +1 -0
  129. package/cjs/jsx/jsx-classic.d.ts +3 -0
  130. package/cjs/jsx/jsx-classic.js +58 -0
  131. package/cjs/jsx/jsx-classic.js.map +1 -0
  132. package/cjs/picker/canvas-picker-service.d.ts +2 -2
  133. package/cjs/picker/canvas-picker-service.js +20 -3
  134. package/cjs/picker/canvas-picker-service.js.map +1 -1
  135. package/cjs/picker/contributions/canvas-picker/glyph-picker.js +1 -1
  136. package/cjs/picker/contributions/canvas-picker/glyph-picker.js.map +1 -1
  137. package/cjs/picker/contributions/canvas-picker/group-picker.d.ts +7 -0
  138. package/cjs/picker/contributions/canvas-picker/group-picker.js +26 -0
  139. package/cjs/picker/contributions/canvas-picker/group-picker.js.map +1 -0
  140. package/cjs/picker/contributions/canvas-picker/module.js +3 -1
  141. package/cjs/picker/contributions/canvas-picker/module.js.map +1 -1
  142. package/cjs/picker/contributions/canvas-picker/symbol-picker.js +4 -2
  143. package/cjs/picker/contributions/canvas-picker/symbol-picker.js.map +1 -1
  144. package/cjs/picker/contributions/constants.d.ts +1 -0
  145. package/cjs/picker/contributions/constants.js +9 -8
  146. package/cjs/picker/contributions/constants.js.map +1 -1
  147. package/cjs/picker/contributions/math-picker/glyph-picker.js +1 -1
  148. package/cjs/picker/contributions/math-picker/glyph-picker.js.map +1 -1
  149. package/cjs/picker/global-picker-service.d.ts +1 -1
  150. package/cjs/picker/global-picker-service.js +12 -5
  151. package/cjs/picker/global-picker-service.js.map +1 -1
  152. package/cjs/picker/math-picker-service.d.ts +2 -2
  153. package/cjs/picker/math-picker-service.js +1 -1
  154. package/cjs/picker/math-picker-service.js.map +1 -1
  155. package/cjs/picker/pick-interceptor.d.ts +12 -0
  156. package/cjs/picker/pick-interceptor.js +32 -5
  157. package/cjs/picker/pick-interceptor.js.map +1 -1
  158. package/cjs/picker/pick-modules.js +2 -0
  159. package/cjs/picker/pick-modules.js.map +1 -1
  160. package/cjs/picker/picker-service.d.ts +1 -1
  161. package/cjs/picker/picker-service.js +15 -6
  162. package/cjs/picker/picker-service.js.map +1 -1
  163. package/cjs/plugins/builtin-plugin/flex-layout-plugin.d.ts +2 -0
  164. package/cjs/plugins/builtin-plugin/flex-layout-plugin.js +42 -21
  165. package/cjs/plugins/builtin-plugin/flex-layout-plugin.js.map +1 -1
  166. package/cjs/plugins/builtin-plugin/html-attribute-plugin.d.ts +13 -0
  167. package/cjs/plugins/builtin-plugin/html-attribute-plugin.js +79 -0
  168. package/cjs/plugins/builtin-plugin/html-attribute-plugin.js.map +1 -0
  169. package/cjs/plugins/plugin-modules.js +1 -1
  170. package/cjs/plugins/plugin-modules.js.map +1 -1
  171. package/cjs/render/contributions/render/contributions/image-contribution-render.js +23 -1
  172. package/cjs/render/contributions/render/contributions/image-contribution-render.js.map +1 -1
  173. package/cjs/render/contributions/render/draw-contribution.d.ts +3 -1
  174. package/cjs/render/contributions/render/draw-contribution.js +3 -1
  175. package/cjs/render/contributions/render/draw-contribution.js.map +1 -1
  176. package/cjs/render/contributions/render/draw-interceptor.d.ts +2 -0
  177. package/cjs/render/contributions/render/draw-interceptor.js +8 -0
  178. package/cjs/render/contributions/render/draw-interceptor.js.map +1 -1
  179. package/cjs/render/contributions/render/image-render.js +7 -3
  180. package/cjs/render/contributions/render/image-render.js.map +1 -1
  181. package/cjs/render/contributions/render/symbol-render.js +12 -5
  182. package/cjs/render/contributions/render/symbol-render.js.map +1 -1
  183. package/cjs/render/contributions/render/utils.d.ts +2 -2
  184. package/cjs/render/contributions/render/utils.js.map +1 -1
  185. package/cjs/render/render-service.js +3 -1
  186. package/cjs/render/render-service.js.map +1 -1
  187. package/dist/index.js +3686 -428
  188. package/dist/index.min.js +1 -1
  189. package/es/animate/animate.d.ts +1 -0
  190. package/es/animate/animate.js +3 -0
  191. package/es/animate/animate.js.map +1 -1
  192. package/es/animate/timeline.d.ts +1 -1
  193. package/es/animate/timeline.js +2 -2
  194. package/es/animate/timeline.js.map +1 -1
  195. package/es/canvas/contributions/browser/context.d.ts +1 -0
  196. package/es/common/contribution-provider.d.ts +1 -0
  197. package/es/common/contribution-provider.js +4 -0
  198. package/es/common/contribution-provider.js.map +1 -1
  199. package/es/common/enums.d.ts +4 -2
  200. package/es/common/enums.js +3 -2
  201. package/es/common/enums.js.map +1 -1
  202. package/es/core/contributions/env/base-contribution.d.ts +11 -1
  203. package/es/core/contributions/env/base-contribution.js +23 -0
  204. package/es/core/contributions/env/base-contribution.js.map +1 -1
  205. package/es/core/contributions/env/browser-contribution.d.ts +11 -2
  206. package/es/core/contributions/env/browser-contribution.js +67 -1
  207. package/es/core/contributions/env/browser-contribution.js.map +1 -1
  208. package/es/core/contributions/textMeasure/layout.js +1 -1
  209. package/es/core/contributions/textMeasure/layout.js.map +1 -1
  210. package/es/core/contributions/window/base-contribution.d.ts +11 -5
  211. package/es/core/contributions/window/base-contribution.js +10 -0
  212. package/es/core/contributions/window/base-contribution.js.map +1 -1
  213. package/es/core/contributions/window/browser-contribution.d.ts +11 -0
  214. package/es/core/contributions/window/browser-contribution.js +33 -2
  215. package/es/core/contributions/window/browser-contribution.js.map +1 -1
  216. package/es/core/global.d.ts +11 -1
  217. package/es/core/global.js +18 -0
  218. package/es/core/global.js.map +1 -1
  219. package/es/core/graphic-utils.d.ts +2 -0
  220. package/es/core/graphic-utils.js +13 -0
  221. package/es/core/graphic-utils.js.map +1 -1
  222. package/es/core/layer.js +6 -6
  223. package/es/core/layer.js.map +1 -1
  224. package/es/core/stage.d.ts +13 -4
  225. package/es/core/stage.js +57 -24
  226. package/es/core/stage.js.map +1 -1
  227. package/es/core/window.d.ts +6 -0
  228. package/es/core/window.js +10 -1
  229. package/es/core/window.js.map +1 -1
  230. package/es/event/event-manager.js +8 -8
  231. package/es/event/event-manager.js.map +1 -1
  232. package/es/event/event-system.js.map +1 -1
  233. package/es/event/federated-event/pointer-event.d.ts +1 -0
  234. package/es/event/federated-event/pointer-event.js.map +1 -1
  235. package/es/graphic/builtin-symbol/arrow2-down.d.ts +12 -0
  236. package/es/graphic/builtin-symbol/arrow2-down.js +24 -0
  237. package/es/graphic/builtin-symbol/arrow2-down.js.map +1 -0
  238. package/es/graphic/builtin-symbol/arrow2-left.js +1 -1
  239. package/es/graphic/builtin-symbol/arrow2-left.js.map +1 -1
  240. package/es/graphic/builtin-symbol/arrow2-right.js +1 -1
  241. package/es/graphic/builtin-symbol/arrow2-right.js.map +1 -1
  242. package/es/graphic/builtin-symbol/arrow2-up.d.ts +12 -0
  243. package/es/graphic/builtin-symbol/arrow2-up.js +24 -0
  244. package/es/graphic/builtin-symbol/arrow2-up.js.map +1 -0
  245. package/es/graphic/builtin-symbol/close.d.ts +13 -0
  246. package/es/graphic/builtin-symbol/close.js +27 -0
  247. package/es/graphic/builtin-symbol/close.js.map +1 -0
  248. package/es/graphic/builtin-symbol/index.d.ts +1 -1
  249. package/es/graphic/builtin-symbol/index.js +11 -1
  250. package/es/graphic/builtin-symbol/index.js.map +1 -1
  251. package/es/graphic/builtin-symbol/line-h.d.ts +13 -0
  252. package/es/graphic/builtin-symbol/line-h.js +26 -0
  253. package/es/graphic/builtin-symbol/line-h.js.map +1 -0
  254. package/es/graphic/builtin-symbol/line-v.d.ts +13 -0
  255. package/es/graphic/builtin-symbol/line-v.js +26 -0
  256. package/es/graphic/builtin-symbol/line-v.js.map +1 -0
  257. package/es/graphic/builtin-symbol/utils.d.ts +13 -5
  258. package/es/graphic/builtin-symbol/utils.js +25 -7
  259. package/es/graphic/builtin-symbol/utils.js.map +1 -1
  260. package/es/graphic/config.js +8 -4
  261. package/es/graphic/config.js.map +1 -1
  262. package/es/graphic/constants.d.ts +22 -0
  263. package/es/graphic/constants.js +26 -0
  264. package/es/graphic/constants.js.map +1 -1
  265. package/es/graphic/graphic.d.ts +4 -1
  266. package/es/graphic/graphic.js +48 -21
  267. package/es/graphic/graphic.js.map +1 -1
  268. package/es/graphic/group.js +1 -1
  269. package/es/graphic/group.js.map +1 -1
  270. package/es/graphic/index.d.ts +1 -0
  271. package/es/graphic/index.js +2 -0
  272. package/es/graphic/index.js.map +1 -1
  273. package/es/graphic/richtext/utils.d.ts +1 -1
  274. package/es/graphic/richtext/utils.js +1 -1
  275. package/es/graphic/richtext/utils.js.map +1 -1
  276. package/es/graphic/symbol.d.ts +2 -1
  277. package/es/graphic/symbol.js +28 -1
  278. package/es/graphic/symbol.js.map +1 -1
  279. package/es/graphic/text.js +33 -23
  280. package/es/graphic/text.js.map +1 -1
  281. package/es/graphic/tools.d.ts +3 -2
  282. package/es/graphic/tools.js +59 -0
  283. package/es/graphic/tools.js.map +1 -1
  284. package/es/graphic/wrap-text.js +10 -8
  285. package/es/graphic/wrap-text.js.map +1 -1
  286. package/es/index.d.ts +3 -1
  287. package/es/index.js +5 -1
  288. package/es/index.js.map +1 -1
  289. package/es/interface/animate.d.ts +3 -1
  290. package/es/interface/animate.js.map +1 -1
  291. package/es/interface/core.d.ts +1 -0
  292. package/es/interface/core.js.map +1 -1
  293. package/es/interface/global.d.ts +25 -1
  294. package/es/interface/global.js.map +1 -1
  295. package/es/interface/graphic/image.d.ts +1 -0
  296. package/es/interface/graphic/image.js.map +1 -1
  297. package/es/interface/graphic/symbol.d.ts +3 -2
  298. package/es/interface/graphic/symbol.js.map +1 -1
  299. package/es/interface/graphic/text.d.ts +1 -0
  300. package/es/interface/graphic/text.js.map +1 -1
  301. package/es/interface/graphic.d.ts +27 -3
  302. package/es/interface/graphic.js.map +1 -1
  303. package/es/interface/picker.d.ts +9 -1
  304. package/es/interface/picker.js.map +1 -1
  305. package/es/interface/render.d.ts +1 -0
  306. package/es/interface/render.js.map +1 -1
  307. package/es/interface/stage.d.ts +10 -3
  308. package/es/interface/stage.js.map +1 -1
  309. package/es/interface/window.d.ts +12 -0
  310. package/es/interface/window.js.map +1 -1
  311. package/es/jsx/graphicType.d.ts +172 -0
  312. package/es/jsx/graphicType.js +126 -0
  313. package/es/jsx/graphicType.js.map +1 -0
  314. package/es/jsx/index.d.ts +2 -0
  315. package/es/jsx/index.js +4 -0
  316. package/es/jsx/index.js.map +1 -0
  317. package/es/jsx/jsx-classic.d.ts +3 -0
  318. package/es/jsx/jsx-classic.js +56 -0
  319. package/es/jsx/jsx-classic.js.map +1 -0
  320. package/es/picker/canvas-picker-service.d.ts +2 -2
  321. package/es/picker/canvas-picker-service.js +20 -3
  322. package/es/picker/canvas-picker-service.js.map +1 -1
  323. package/es/picker/contributions/canvas-picker/glyph-picker.js +1 -1
  324. package/es/picker/contributions/canvas-picker/glyph-picker.js.map +1 -1
  325. package/es/picker/contributions/canvas-picker/group-picker.d.ts +7 -0
  326. package/es/picker/contributions/canvas-picker/group-picker.js +23 -0
  327. package/es/picker/contributions/canvas-picker/group-picker.js.map +1 -0
  328. package/es/picker/contributions/canvas-picker/module.js +6 -2
  329. package/es/picker/contributions/canvas-picker/module.js.map +1 -1
  330. package/es/picker/contributions/canvas-picker/symbol-picker.js +6 -1
  331. package/es/picker/contributions/canvas-picker/symbol-picker.js.map +1 -1
  332. package/es/picker/contributions/constants.d.ts +1 -0
  333. package/es/picker/contributions/constants.js +2 -0
  334. package/es/picker/contributions/constants.js.map +1 -1
  335. package/es/picker/contributions/math-picker/glyph-picker.js +1 -1
  336. package/es/picker/contributions/math-picker/glyph-picker.js.map +1 -1
  337. package/es/picker/global-picker-service.d.ts +1 -1
  338. package/es/picker/global-picker-service.js +12 -5
  339. package/es/picker/global-picker-service.js.map +1 -1
  340. package/es/picker/math-picker-service.d.ts +2 -2
  341. package/es/picker/math-picker-service.js +1 -1
  342. package/es/picker/math-picker-service.js.map +1 -1
  343. package/es/picker/pick-interceptor.d.ts +12 -0
  344. package/es/picker/pick-interceptor.js +34 -4
  345. package/es/picker/pick-interceptor.js.map +1 -1
  346. package/es/picker/pick-modules.js +4 -2
  347. package/es/picker/pick-modules.js.map +1 -1
  348. package/es/picker/picker-service.d.ts +1 -1
  349. package/es/picker/picker-service.js +15 -6
  350. package/es/picker/picker-service.js.map +1 -1
  351. package/es/plugins/builtin-plugin/flex-layout-plugin.d.ts +2 -0
  352. package/es/plugins/builtin-plugin/flex-layout-plugin.js +47 -20
  353. package/es/plugins/builtin-plugin/flex-layout-plugin.js.map +1 -1
  354. package/es/plugins/builtin-plugin/html-attribute-plugin.d.ts +13 -0
  355. package/es/plugins/builtin-plugin/html-attribute-plugin.js +75 -0
  356. package/es/plugins/builtin-plugin/html-attribute-plugin.js.map +1 -0
  357. package/es/plugins/plugin-modules.js +2 -2
  358. package/es/plugins/plugin-modules.js.map +1 -1
  359. package/es/render/contributions/render/contributions/image-contribution-render.js +27 -0
  360. package/es/render/contributions/render/contributions/image-contribution-render.js.map +1 -1
  361. package/es/render/contributions/render/draw-contribution.d.ts +3 -1
  362. package/es/render/contributions/render/draw-contribution.js +4 -0
  363. package/es/render/contributions/render/draw-contribution.js.map +1 -1
  364. package/es/render/contributions/render/draw-interceptor.d.ts +2 -0
  365. package/es/render/contributions/render/draw-interceptor.js +8 -0
  366. package/es/render/contributions/render/draw-interceptor.js.map +1 -1
  367. package/es/render/contributions/render/image-render.js +10 -2
  368. package/es/render/contributions/render/image-render.js.map +1 -1
  369. package/es/render/contributions/render/symbol-render.js +12 -5
  370. package/es/render/contributions/render/symbol-render.js.map +1 -1
  371. package/es/render/contributions/render/utils.d.ts +2 -2
  372. package/es/render/contributions/render/utils.js.map +1 -1
  373. package/es/render/render-service.js +3 -1
  374. package/es/render/render-service.js.map +1 -1
  375. package/package.json +11 -14
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/core/graphic-utils.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAGtD,OAAO,EAAE,uBAAuB,EAAE,MAAM,sDAAsD,CAAC;AAE/F,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAErD,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAGhC,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAM7B,YAGqB,aAAkD,EACpC,MAAe;QAD7B,kBAAa,GAAb,aAAa,CAAqC;QACpC,WAAM,GAAN,MAAM,CAAS;QAEhD,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;QACxB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,cAAc,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE;YACtE,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;YACxB,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAC9B,CAAC,CAAC,CAAC;IACL,CAAC;IAED,IAAI,WAAW;QACb,IAAI,CAAC,IAAI,CAA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,CAAC,IAAI,KAAK,aAAa,CAAC,MAAM,EAAE;YACtC,OAAO,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;SACpC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IACO,cAAc,CAAC,MAAqB;QAkB1C,OAAO,IAAI,CAAC;IACd,CAAC;CACF,CAAA;AApHY,oBAAoB;IADhC,UAAU,EAAE;;GACA,oBAAoB,CAoHhC;SApHY,oBAAoB","file":"graphic-utils.js","sourcesContent":["import { injectable, inject, named } from 'inversify';\nimport type { ICanvas, IContext2d, EnvType, IGlobal, ITextAttribute, IContributionProvider } from '../interface';\nimport type { ITextMeasure, TextOptionsType } from '../interface/text';\nimport { TextMeasureContribution } from './contributions/textMeasure/textMeasure-contribution';\n// eslint-disable-next-line @typescript-eslint/consistent-type-imports\nimport { ContributionProvider } from '../common/contribution-provider';\nimport { wrapCanvas } from '../canvas/util';\nimport { DefaultTextStyle } from '../graphic/config';\nimport type { IMatrix, IPointLike, ITextMeasureOption } from '@visactor/vutils';\nimport { Matrix, TextMeasure } from '@visactor/vutils';\nimport type { IGraphicUtil, ITransformUtil, TransformType } from '../interface/core';\nimport { VGlobal } from '../constants';\n\n@injectable()\nexport class DefaultGraphicUtil implements IGraphicUtil {\n canvas?: ICanvas;\n context?: IContext2d | null;\n _textMeasure: ITextMeasure;\n configured: boolean;\n\n constructor(\n @inject(ContributionProvider)\n @named(TextMeasureContribution)\n protected readonly contributions: IContributionProvider<ITextMeasure>,\n @inject(VGlobal) public readonly global: IGlobal\n ) {\n this.configured = false;\n this.global.hooks.onSetEnv.tap('graphic-util', (lastEnv, env, global) => {\n this.configured = false;\n this.configure(global, env);\n });\n }\n\n get textMeasure(): ITextMeasure {\n if (!this._textMeasure) {\n this.configure(this.global, this.global.env);\n }\n return this._textMeasure;\n }\n\n configure(global: IGlobal, env: EnvType) {\n if (this.configured) {\n return;\n }\n const canvas = wrapCanvas({\n nativeCanvas: global.createCanvas({ width: 100, height: 100 })\n });\n this.canvas = canvas;\n this.context = canvas.getContext('2d');\n this.contributions.getContributions().forEach(contribution => {\n contribution.configure(this, env);\n });\n this.configured = true;\n }\n\n bindTextMeasure(tm: ITextMeasure) {\n this._textMeasure = tm;\n }\n\n measureText(\n text: string,\n tc: TextOptionsType,\n method: 'native' | 'simple' | 'quick' = 'native'\n ): { width: number; height: number } {\n this.configure(this.global, this.global.env);\n const m = this.global.measureTextMethod;\n this.global.measureTextMethod = method;\n const data = {\n width: this._textMeasure.measureTextWidth(text, tc),\n height: tc.fontSize ?? DefaultTextStyle.fontSize\n };\n this.global.measureTextMethod = m;\n return data;\n }\n\n createTextMeasureInstance(\n textSpec?: Partial<ITextAttribute>,\n option?: Partial<ITextMeasureOption>,\n getCanvasForMeasure?: () => any\n ) {\n this.configure(this.global, this.global.env);\n return new TextMeasure<ITextAttribute>(\n {\n defaultFontParams: {\n fontFamily: DefaultTextStyle.fontFamily,\n fontSize: DefaultTextStyle.fontSize\n },\n getCanvasForMeasure: getCanvasForMeasure || (() => this.canvas),\n getTextBounds: undefined,\n specialCharSet: '-/: .,@%\\'\"~' + TextMeasure.ALPHABET_CHAR_SET + TextMeasure.ALPHABET_CHAR_SET.toUpperCase(),\n ...(option ?? {})\n },\n textSpec\n );\n }\n}\n\nenum TransformMode {\n transform = 0,\n matrix = 1\n}\n\nconst _matrix = new Matrix();\n\n@injectable()\nexport class DefaultTransformUtil implements ITransformUtil {\n private matrix: IMatrix;\n private originTransform: TransformType;\n\n private outSourceMatrix: IMatrix;\n private outTargetMatrix: IMatrix;\n\n private mode: TransformMode;\n constructor() {\n this.matrix = new Matrix();\n }\n init(origin: TransformType): this {\n this.mode = TransformMode.transform;\n this.originTransform = origin;\n this.matrix.reset();\n return this;\n }\n fromMatrix(source: IMatrix, target: IMatrix): this {\n this.mode = TransformMode.matrix;\n this.outSourceMatrix = source;\n this.outTargetMatrix = target;\n return this;\n }\n\n // translate: (x: number, y: number) => Transform;\n // translateTo: (x: number, y: number) => Transform;\n private scaleMatrix(sx: number, sy: number, center?: IPointLike): this {\n // if (this.outSourceMatrix !== this.outTargetMatrix) {\n // // copy\n // const m = this.outSourceMatrix;\n // this.outTargetMatrix.setValue(m.a, m.b, m.c, m.d, m.e, m.f);\n // }\n const sMatrix = this.outSourceMatrix;\n _matrix.setValue(sMatrix.a, sMatrix.b, sMatrix.c, sMatrix.d, sMatrix.e, sMatrix.f);\n this.outTargetMatrix.reset();\n if (center) {\n const { x, y } = center;\n this.outTargetMatrix.translate(x, y);\n this.outTargetMatrix.scale(sx, sy);\n this.outTargetMatrix.translate(-x, -y);\n } else {\n this.outTargetMatrix.scale(sx, sy);\n }\n\n // _matrix.reset();\n // if (center) {\n // const { x, y } = center;\n // _matrix.translate(x, y);\n // _matrix.scale(sx, sy);\n // _matrix.translate(-x, -y);\n // } else {\n // _matrix.scale(sx, sy);\n // }\n this.outTargetMatrix.multiply(_matrix.a, _matrix.b, _matrix.c, _matrix.d, _matrix.e, _matrix.f);\n return this;\n }\n scale(sx: number, sy: number, center?: IPointLike): this {\n if (this.mode === TransformMode.matrix) {\n return this.scaleMatrix(sx, sy, center);\n }\n return this;\n }\n private translateMatrix(dx: number, dy: number): this {\n // if (this.outSourceMatrix !== this.outTargetMatrix) {\n // // copy\n // const m = this.outSourceMatrix;\n // this.outTargetMatrix.setValue(m.a, m.b, m.c, m.d, m.e, m.f);\n // }\n const sMatrix = this.outSourceMatrix;\n _matrix.setValue(sMatrix.a, sMatrix.b, sMatrix.c, sMatrix.d, sMatrix.e, sMatrix.f);\n this.outTargetMatrix.reset();\n this.outTargetMatrix.translate(dx, dy);\n\n this.outTargetMatrix.multiply(_matrix.a, _matrix.b, _matrix.c, _matrix.d, _matrix.e, _matrix.f);\n return this;\n }\n translate(dx: number, dy: number): this {\n if (this.mode === TransformMode.matrix) {\n return this.translateMatrix(dx, dy);\n }\n return this;\n }\n // scaleTo: (sx: number, sy: number, center: IPointLike) => Transform;\n // rotate: (rx: number, ry: number, center: IPointLike) => Transform;\n // rotateTo: (rx: number, ry: number, center: IPointLike) => Transform;\n // 语法糖\n // interactive: (dx: number, dy: number, dsx: number, dsy: number, drx: number, dry: number) => Transform;\n // // 扩展padding像素,用于外描边,内描边\n // extend: (origin: TransformType, padding: number) => Transform;\n // 将所有的transform生成为一次的transform\n simplify(target: TransformType): this {\n if (this.mode === TransformMode.matrix) {\n return this.simplifyMatrix(target);\n }\n return this;\n }\n private simplifyMatrix(target: TransformType): this {\n // let { a, b, c, d, e, f } = this.outTargetMatrix;\n // if (a === 0 || d === 0) return this;\n // const { dx=0, dy=0 } = target;\n // // 不处理dx和dy\n // e -= dx;\n // f -= dy;\n // const tanTheta = b / a;\n // const angle = Math.atan(tanTheta);\n // const cosTheta = cos(angle);\n // const sinTheta = sin(angle);\n // const sx = cosTheta !== 0 ? (a / cosTheta) : (b / sinTheta);\n // const sy = sinTheta !== 0 ? (-c / sinTheta) : (d / cosTheta);\n // const x = e;\n // const y = f;\n // target.x = x;\n // target.y = y;\n // target.dx = dx;\n return this;\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/core/graphic-utils.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAGtD,OAAO,EAAE,uBAAuB,EAAE,MAAM,sDAAsD,CAAC;AAE/F,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAErD,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAGhC,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAM7B,YAGqB,aAAkD,EACpC,MAAe;QAD7B,kBAAa,GAAb,aAAa,CAAqC;QACpC,WAAM,GAAN,M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d,CAAC;IACD,SAAS,CAAC,EAAU,EAAE,EAAU;QAC9B,IAAI,IAAI,CAAC,IAAI,KAAK,aAAa,CAAC,MAAM,EAAE;YACtC,OAAO,IAAI,CAAC,eAAe,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;SACrC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IASD,QAAQ,CAAC,MAAqB;QAC5B,IAAI,IAAI,CAAC,IAAI,KAAK,aAAa,CAAC,MAAM,EAAE;YACtC,OAAO,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;SACpC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IACO,cAAc,CAAC,MAAqB;QAkB1C,OAAO,IAAI,CAAC;IACd,CAAC;CACF,CAAA;AA3IY,oBAAoB;IADhC,UAAU,EAAE;;GACA,oBAAoB,CA2IhC;SA3IY,oBAAoB","file":"graphic-utils.js","sourcesContent":["import { injectable, inject, named } from 'inversify';\nimport type { ICanvas, IContext2d, EnvType, IGlobal, ITextAttribute, IContributionProvider } from '../interface';\nimport type { ITextMeasure, TextOptionsType } from '../interface/text';\nimport { TextMeasureContribution } from './contributions/textMeasure/textMeasure-contribution';\n// eslint-disable-next-line @typescript-eslint/consistent-type-imports\nimport { ContributionProvider } from '../common/contribution-provider';\nimport { wrapCanvas } from '../canvas/util';\nimport { DefaultTextStyle } from '../graphic/config';\nimport type { IMatrix, IPointLike, ITextMeasureOption } from '@visactor/vutils';\nimport { Matrix, TextMeasure } from '@visactor/vutils';\nimport type { IGraphicUtil, ITransformUtil, TransformType } from '../interface/core';\nimport { VGlobal } from '../constants';\n\n@injectable()\nexport class DefaultGraphicUtil implements IGraphicUtil {\n canvas?: ICanvas;\n context?: IContext2d | null;\n _textMeasure: ITextMeasure;\n configured: boolean;\n\n constructor(\n @inject(ContributionProvider)\n @named(TextMeasureContribution)\n protected readonly contributions: IContributionProvider<ITextMeasure>,\n @inject(VGlobal) public readonly global: IGlobal\n ) {\n this.configured = false;\n this.global.hooks.onSetEnv.tap('graphic-util', (lastEnv, env, global) => {\n this.configured = false;\n this.configure(global, env);\n });\n }\n\n get textMeasure(): ITextMeasure {\n if (!this._textMeasure) {\n this.configure(this.global, this.global.env);\n }\n return this._textMeasure;\n }\n\n configure(global: IGlobal, env: EnvType) {\n if (this.configured) {\n return;\n }\n const canvas = wrapCanvas({\n nativeCanvas: global.createCanvas({ width: 100, height: 100 })\n });\n this.canvas = canvas;\n this.context = canvas.getContext('2d');\n this.contributions.getContributions().forEach(contribution => {\n contribution.configure(this, env);\n });\n this.configured = true;\n }\n\n bindTextMeasure(tm: ITextMeasure) {\n this._textMeasure = tm;\n }\n\n measureText(\n text: string,\n tc: TextOptionsType,\n method: 'native' | 'simple' | 'quick' = 'native'\n ): { width: number; height: number } {\n this.configure(this.global, this.global.env);\n const m = this.global.measureTextMethod;\n this.global.measureTextMethod = method;\n const data = {\n width: this._textMeasure.measureTextWidth(text, tc),\n height: tc.fontSize ?? DefaultTextStyle.fontSize\n };\n this.global.measureTextMethod = m;\n return data;\n }\n\n createTextMeasureInstance(\n textSpec?: Partial<ITextAttribute>,\n option?: Partial<ITextMeasureOption>,\n getCanvasForMeasure?: () => any\n ) {\n this.configure(this.global, this.global.env);\n return new TextMeasure<ITextAttribute>(\n {\n defaultFontParams: {\n fontFamily: DefaultTextStyle.fontFamily,\n fontSize: DefaultTextStyle.fontSize\n },\n getCanvasForMeasure: getCanvasForMeasure || (() => this.canvas),\n getTextBounds: undefined,\n specialCharSet: '-/: .,@%\\'\"~' + TextMeasure.ALPHABET_CHAR_SET + TextMeasure.ALPHABET_CHAR_SET.toUpperCase(),\n ...(option ?? {})\n },\n textSpec\n );\n }\n}\n\nenum TransformMode {\n transform = 0,\n matrix = 1\n}\n\nconst _matrix = new Matrix();\n\n@injectable()\nexport class DefaultTransformUtil implements ITransformUtil {\n private matrix: IMatrix;\n private originTransform: TransformType;\n\n private outSourceMatrix: IMatrix;\n private outTargetMatrix: IMatrix;\n\n private mode: TransformMode;\n constructor() {\n this.matrix = new Matrix();\n }\n init(origin: TransformType): this {\n this.mode = TransformMode.transform;\n this.originTransform = origin;\n this.matrix.reset();\n return this;\n }\n fromMatrix(source: IMatrix, target: IMatrix): this {\n this.mode = TransformMode.matrix;\n this.outSourceMatrix = source;\n this.outTargetMatrix = target;\n return this;\n }\n\n // translate: (x: number, y: number) => Transform;\n // translateTo: (x: number, y: number) => Transform;\n private scaleMatrix(sx: number, sy: number, center?: IPointLike): this {\n // if (this.outSourceMatrix !== this.outTargetMatrix) {\n // // copy\n // const m = this.outSourceMatrix;\n // this.outTargetMatrix.setValue(m.a, m.b, m.c, m.d, m.e, m.f);\n // }\n const sMatrix = this.outSourceMatrix;\n _matrix.setValue(sMatrix.a, sMatrix.b, sMatrix.c, sMatrix.d, sMatrix.e, sMatrix.f);\n this.outTargetMatrix.reset();\n if (center) {\n const { x, y } = center;\n this.outTargetMatrix.translate(x, y);\n this.outTargetMatrix.scale(sx, sy);\n this.outTargetMatrix.translate(-x, -y);\n } else {\n this.outTargetMatrix.scale(sx, sy);\n }\n\n // _matrix.reset();\n // if (center) {\n // const { x, y } = center;\n // _matrix.translate(x, y);\n // _matrix.scale(sx, sy);\n // _matrix.translate(-x, -y);\n // } else {\n // _matrix.scale(sx, sy);\n // }\n this.outTargetMatrix.multiply(_matrix.a, _matrix.b, _matrix.c, _matrix.d, _matrix.e, _matrix.f);\n return this;\n }\n\n private rotateMatrix(angle: number, center?: IPointLike): this {\n const sMatrix = this.outSourceMatrix;\n _matrix.setValue(sMatrix.a, sMatrix.b, sMatrix.c, sMatrix.d, sMatrix.e, sMatrix.f);\n this.outTargetMatrix.reset();\n if (center) {\n const { x, y } = center;\n this.outTargetMatrix.translate(x, y);\n this.outTargetMatrix.rotate(angle);\n this.outTargetMatrix.translate(-x, -y);\n } else {\n this.outTargetMatrix.rotate(angle);\n }\n\n this.outTargetMatrix.multiply(_matrix.a, _matrix.b, _matrix.c, _matrix.d, _matrix.e, _matrix.f);\n return this;\n }\n scale(sx: number, sy: number, center?: IPointLike): this {\n if (this.mode === TransformMode.matrix) {\n return this.scaleMatrix(sx, sy, center);\n }\n return this;\n }\n rotate(angle: number, center?: IPointLike): this {\n if (this.mode === TransformMode.matrix) {\n return this.rotateMatrix(angle, center);\n }\n return this;\n }\n private translateMatrix(dx: number, dy: number): this {\n // if (this.outSourceMatrix !== this.outTargetMatrix) {\n // // copy\n // const m = this.outSourceMatrix;\n // this.outTargetMatrix.setValue(m.a, m.b, m.c, m.d, m.e, m.f);\n // }\n const sMatrix = this.outSourceMatrix;\n _matrix.setValue(sMatrix.a, sMatrix.b, sMatrix.c, sMatrix.d, sMatrix.e, sMatrix.f);\n this.outTargetMatrix.reset();\n this.outTargetMatrix.translate(dx, dy);\n\n this.outTargetMatrix.multiply(_matrix.a, _matrix.b, _matrix.c, _matrix.d, _matrix.e, _matrix.f);\n return this;\n }\n translate(dx: number, dy: number): this {\n if (this.mode === TransformMode.matrix) {\n return this.translateMatrix(dx, dy);\n }\n return this;\n }\n // scaleTo: (sx: number, sy: number, center: IPointLike) => Transform;\n // rotate: (rx: number, ry: number, center: IPointLike) => Transform;\n // rotateTo: (rx: number, ry: number, center: IPointLike) => Transform;\n // 语法糖\n // interactive: (dx: number, dy: number, dsx: number, dsy: number, drx: number, dry: number) => Transform;\n // // 扩展padding像素,用于外描边,内描边\n // extend: (origin: TransformType, padding: number) => Transform;\n // 将所有的transform生成为一次的transform\n simplify(target: TransformType): this {\n if (this.mode === TransformMode.matrix) {\n return this.simplifyMatrix(target);\n }\n return this;\n }\n private simplifyMatrix(target: TransformType): this {\n // let { a, b, c, d, e, f } = this.outTargetMatrix;\n // if (a === 0 || d === 0) return this;\n // const { dx=0, dy=0 } = target;\n // // 不处理dx和dy\n // e -= dx;\n // f -= dy;\n // const tanTheta = b / a;\n // const angle = Math.atan(tanTheta);\n // const cosTheta = cos(angle);\n // const sinTheta = sin(angle);\n // const sx = cosTheta !== 0 ? (a / cosTheta) : (b / sinTheta);\n // const sy = sinTheta !== 0 ? (-c / sinTheta) : (d / cosTheta);\n // const x = e;\n // const y = f;\n // target.x = x;\n // target.y = y;\n // target.dx = dx;\n return this;\n }\n}\n"]}
package/es/core/layer.js CHANGED
@@ -95,12 +95,12 @@ export class Layer extends Group {
95
95
  }
96
96
  prepare(dirtyBounds, params) {}
97
97
  combineTo(target, params) {
98
- var _a;
98
+ var _a, _b, _c;
99
99
  this.offscreen && (this.layerHandler.drawTo(target, [ this ], Object.assign({
100
100
  background: null !== (_a = params.background) && void 0 !== _a ? _a : this.background,
101
101
  renderService: params.renderService,
102
- x: this.stage.x,
103
- y: this.stage.y,
102
+ x: null !== (_b = params.x) && void 0 !== _b ? _b : this.stage.x,
103
+ y: null !== (_c = params.y) && void 0 !== _c ? _c : this.stage.y,
104
104
  width: this.viewWidth,
105
105
  height: this.viewHeight,
106
106
  stage: this.stage,
@@ -113,12 +113,12 @@ export class Layer extends Group {
113
113
  }));
114
114
  }
115
115
  drawTo(target, params) {
116
- var _a;
116
+ var _a, _b, _c;
117
117
  this.layerHandler.drawTo(target, [ this ], Object.assign({
118
118
  background: null !== (_a = params.background) && void 0 !== _a ? _a : this.background,
119
119
  renderService: params.renderService,
120
- x: this.stage.x,
121
- y: this.stage.y,
120
+ x: null !== (_b = params.x) && void 0 !== _b ? _b : this.stage.x,
121
+ y: null !== (_c = params.y) && void 0 !== _c ? _c : this.stage.y,
122
122
  width: this.viewWidth,
123
123
  height: this.viewHeight,
124
124
  stage: this.stage,
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/core/layer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAgBzC,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAEzC,MAAM,CAAC,MAAM,wBAAwB,GAAG,MAAM,CAAC,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C,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;SACzC;IACH,CAAC;IAED,OAAO;QACL,KAAK,CAAC,OAAO,EAAE,CAAC;QAChB,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,CAAC;QAC5B,IAAI,IAAI,CAAC,SAAS,EAAE;YAClB,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;gBAEzB,WAAW,CAAC,YAAY,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC;YAC7D,CAAC,CAAC,CAAC;SACJ;IACH,CAAC;IAED,MAAM,CAAC,MAAe,EAAE,MAAqB;;QAC3C,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,kBAErC,UAAU,EAAE,MAAA,MAAM,CAAC,UAAU,mCAAI,IAAI,CAAC,UAAU,EAChD,aAAa,EAAE,MAAM,CAAC,aAAa,EACnC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,EACf,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,EACf,KAAK,EAAE,IAAI,CAAC,SAAS,EACrB,MAAM,EAAE,IAAI,CAAC,UAAU,EACvB,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,KAAK,EAAE,IAAI,IACR,MAAM,EACT,CAAC;QACH,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;IAC1C,CAAC;CACF","file":"layer.js","sourcesContent":["import type { AABBBounds, IBoundsLike } from '@visactor/vutils';\nimport { application } from '../application';\nimport { container } from '../container';\nimport type {\n IDrawToParams,\n IGraphic,\n IGroup,\n ILayer,\n ILayerDrawParams,\n IStage,\n IGlobal,\n ILayerHandlerContribution,\n IDrawContext,\n ILayerHandlerDrawParams,\n IDrawContribution,\n IWindow,\n ILayerParams\n} from '../interface';\nimport { Theme } from '../graphic/theme';\nimport { Group } from '../graphic/group';\n\nexport const LayerHandlerContribution = Symbol.for('LayerHandlerContribution');\n\ntype BlendMode = 'normal';\n\n// layer需要有多个,对于Canvas来说,layer可以绑定一个canvas或一个ImageData\n// 对于WebGL来说,layer对应一个FrameBuffer\n// 对于Native来说,layer保留一个FrameBufferHandler\nexport class Layer extends Group implements ILayer {\n declare parent: any;\n\n declare _dpr: number;\n declare main: boolean;\n\n declare readonly virtual: boolean;\n declare afterDrawCbs: ((l: this) => void)[];\n\n declare imageData?: ImageData;\n // 混合模式,用于多图层混合\n declare blendMode: BlendMode;\n\n declare background: string;\n declare opacity: number;\n\n declare layer: this;\n declare subLayers: Map<\n number,\n { layer: ILayer; group?: IGroup; zIndex: number; drawContribution?: IDrawContribution }\n >;\n\n get offscreen(): boolean {\n return this.layerHandler.offscreen;\n }\n\n // stage控制\n // width: number;\n // height: number;\n get width(): number {\n if (!this.stage) {\n return 0;\n }\n return this.stage.width;\n }\n get height(): number {\n if (!this.stage) {\n return 0;\n }\n return this.stage.height;\n }\n get viewWidth(): number {\n if (!this.stage) {\n return 0;\n }\n return this.stage.viewWidth;\n }\n get viewHeight(): number {\n if (!this.stage) {\n return 0;\n }\n return this.stage.viewHeight;\n }\n declare pickable: boolean;\n\n get dirtyBound(): AABBBounds {\n // this.getRootNode<any>();\n throw new Error('暂不支持');\n }\n\n get dpr(): number {\n return this._dpr;\n }\n\n declare stage?: IStage;\n protected declare global: IGlobal;\n protected declare window: IWindow;\n protected declare layerHandler: ILayerHandlerContribution;\n\n constructor(stage: IStage, global: IGlobal, window: IWindow, params: ILayerParams) {\n super({});\n this.stage = stage;\n this.global = global;\n this.window = window;\n this.main = params.main;\n this.layerHandler = container.get<ILayerHandlerContribution>(LayerHandlerContribution);\n this.layerHandler.init(this, window, {\n main: params.main,\n canvasId: params.canvasId,\n width: this.viewWidth,\n height: this.viewHeight,\n zIndex: params.zIndex ?? 0\n });\n this.layer = this;\n this.subLayers = new Map();\n this.theme = new Theme();\n this.background = 'rgba(0, 0, 0, 0)';\n this.virtual = !!params.virtual;\n this.afterDrawCbs = [];\n }\n\n combineSubLayer(removeIncrementalKey: boolean = true) {\n const subLayers = Array.from(this.subLayers.values()).sort((a, b) => {\n return a.zIndex - b.zIndex;\n });\n this.layerHandler.merge(\n subLayers.map(l => {\n if (l.layer.subLayers.size) {\n l.layer.combineSubLayer(removeIncrementalKey);\n }\n return l.layer.getNativeHandler();\n })\n );\n if (removeIncrementalKey) {\n subLayers.forEach(l => {\n l.group && (l.group.incremental = 0);\n });\n }\n subLayers.forEach(l => {\n // l.layer.release();\n application.layerService.releaseLayer(this.stage, l.layer);\n });\n this.subLayers.clear();\n }\n\n getNativeHandler(): ILayerHandlerContribution {\n return this.layerHandler;\n }\n\n setStage(stage?: IStage, layer?: ILayer) {\n super.setStage(stage, this);\n }\n\n // 选中图层中的节点\n pick(x: number, y: number): { graphic?: IGraphic; group?: IGroup } | false {\n throw new Error('暂不支持');\n }\n // 绘制图层\n render(params: ILayerDrawParams, userParams?: Partial<IDrawContext>) {\n const stage = this.stage;\n this.layerHandler.render(\n [this],\n {\n renderService: params.renderService,\n x: stage.x,\n y: stage.y,\n width: this.viewWidth,\n height: this.viewHeight,\n stage: this.stage,\n layer: this,\n // TODO: 多图层时不应该再用默认background\n background: params.background ?? this.background,\n updateBounds: params.updateBounds\n },\n userParams\n );\n this.afterDrawCbs.forEach(c => c(this));\n }\n resize(w: number, h: number) {\n this.layerHandler.resize(w, h);\n }\n resizeView(w: number, h: number) {\n this.layerHandler.resizeView(w, h);\n }\n setDpr(dpr: number) {\n this.layerHandler.setDpr(dpr);\n }\n afterDraw(cb: (l: this) => void) {\n this.afterDrawCbs.push(cb);\n }\n\n // 动画相关\n startAnimate(t: number) {\n throw new Error('暂不支持');\n }\n\n setToFrame(t: number) {\n throw new Error('暂不支持');\n }\n\n prepare(dirtyBounds: IBoundsLike, params: ILayerHandlerDrawParams) {\n return;\n }\n\n // 合并到某个target上\n combineTo(target: IWindow, params: IDrawToParams) {\n if (this.offscreen) {\n this.layerHandler.drawTo(target, [this], {\n // TODO: 多图层时不应该再用默认background\n background: params.background ?? this.background,\n renderService: params.renderService,\n x: this.stage.x,\n y: this.stage.y,\n width: this.viewWidth,\n height: this.viewHeight,\n stage: this.stage,\n layer: this,\n ...params\n });\n this.afterDrawCbs.forEach(c => c(this));\n }\n }\n\n release(): void {\n super.release();\n this.layerHandler.release();\n if (this.subLayers) {\n this.subLayers.forEach(l => {\n // l.layer.release();\n application.layerService.releaseLayer(this.stage, l.layer);\n });\n }\n }\n\n drawTo(target: IWindow, params: IDrawToParams) {\n this.layerHandler.drawTo(target, [this], {\n // TODO: 多图层时不应该再用默认background\n background: params.background ?? this.background,\n renderService: params.renderService,\n x: this.stage.x,\n y: this.stage.y,\n width: this.viewWidth,\n height: this.viewHeight,\n stage: this.stage,\n layer: this,\n ...params\n });\n this.afterDrawCbs.forEach(c => c(this));\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/core/layer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAgBzC,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAEzC,MAAM,CAAC,MAAM,wBAAwB,GAAG,MAAM,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;AAO/E,MAAM,OAAO,KAAM,SAAQ,KAAK;IAsB9B,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC;IACrC,CAAC;IAKD,IAAI,KAAK;QACP,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE;YACf,OAAO,CAAC,CAAC;SACV;QACD,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;IAC1B,CAAC;IACD,IAAI,MAAM;QACR,I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CAAC,EAAE;gBAEzB,WAAW,CAAC,YAAY,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC;YAC7D,CAAC,CAAC,CAAC;SACJ;IACH,CAAC;IAED,MAAM,CAAC,MAAe,EAAE,MAAqB;;QAC3C,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,kBAErC,UAAU,EAAE,MAAA,MAAM,CAAC,UAAU,mCAAI,IAAI,CAAC,UAAU,EAChD,aAAa,EAAE,MAAM,CAAC,aAAa,EACnC,CAAC,EAAE,MAAA,MAAM,CAAC,CAAC,mCAAI,IAAI,CAAC,KAAK,CAAC,CAAC,EAC3B,CAAC,EAAE,MAAA,MAAM,CAAC,CAAC,mCAAI,IAAI,CAAC,KAAK,CAAC,CAAC,EAC3B,KAAK,EAAE,IAAI,CAAC,SAAS,EACrB,MAAM,EAAE,IAAI,CAAC,UAAU,EACvB,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,KAAK,EAAE,IAAI,IACR,MAAM,EACT,CAAC;QACH,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;IAC1C,CAAC;CACF","file":"layer.js","sourcesContent":["import type { AABBBounds, IBoundsLike } from '@visactor/vutils';\nimport { application } from '../application';\nimport { container } from '../container';\nimport type {\n IDrawToParams,\n IGraphic,\n IGroup,\n ILayer,\n ILayerDrawParams,\n IStage,\n IGlobal,\n ILayerHandlerContribution,\n IDrawContext,\n ILayerHandlerDrawParams,\n IDrawContribution,\n IWindow,\n ILayerParams\n} from '../interface';\nimport { Theme } from '../graphic/theme';\nimport { Group } from '../graphic/group';\n\nexport const LayerHandlerContribution = Symbol.for('LayerHandlerContribution');\n\ntype BlendMode = 'normal';\n\n// layer需要有多个,对于Canvas来说,layer可以绑定一个canvas或一个ImageData\n// 对于WebGL来说,layer对应一个FrameBuffer\n// 对于Native来说,layer保留一个FrameBufferHandler\nexport class Layer extends Group implements ILayer {\n declare parent: any;\n\n declare _dpr: number;\n declare main: boolean;\n\n declare readonly virtual: boolean;\n declare afterDrawCbs: ((l: this) => void)[];\n\n declare imageData?: ImageData;\n // 混合模式,用于多图层混合\n declare blendMode: BlendMode;\n\n declare background: string;\n declare opacity: number;\n\n declare layer: this;\n declare subLayers: Map<\n number,\n { layer: ILayer; group?: IGroup; zIndex: number; drawContribution?: IDrawContribution }\n >;\n\n get offscreen(): boolean {\n return this.layerHandler.offscreen;\n }\n\n // stage控制\n // width: number;\n // height: number;\n get width(): number {\n if (!this.stage) {\n return 0;\n }\n return this.stage.width;\n }\n get height(): number {\n if (!this.stage) {\n return 0;\n }\n return this.stage.height;\n }\n get viewWidth(): number {\n if (!this.stage) {\n return 0;\n }\n return this.stage.viewWidth;\n }\n get viewHeight(): number {\n if (!this.stage) {\n return 0;\n }\n return this.stage.viewHeight;\n }\n declare pickable: boolean;\n\n get dirtyBound(): AABBBounds {\n // this.getRootNode<any>();\n throw new Error('暂不支持');\n }\n\n get dpr(): number {\n return this._dpr;\n }\n\n declare stage?: IStage;\n protected declare global: IGlobal;\n protected declare window: IWindow;\n protected declare layerHandler: ILayerHandlerContribution;\n\n constructor(stage: IStage, global: IGlobal, window: IWindow, params: ILayerParams) {\n super({});\n this.stage = stage;\n this.global = global;\n this.window = window;\n this.main = params.main;\n this.layerHandler = container.get<ILayerHandlerContribution>(LayerHandlerContribution);\n this.layerHandler.init(this, window, {\n main: params.main,\n canvasId: params.canvasId,\n width: this.viewWidth,\n height: this.viewHeight,\n zIndex: params.zIndex ?? 0\n });\n this.layer = this;\n this.subLayers = new Map();\n this.theme = new Theme();\n this.background = 'rgba(0, 0, 0, 0)';\n this.virtual = !!params.virtual;\n this.afterDrawCbs = [];\n }\n\n combineSubLayer(removeIncrementalKey: boolean = true) {\n const subLayers = Array.from(this.subLayers.values()).sort((a, b) => {\n return a.zIndex - b.zIndex;\n });\n this.layerHandler.merge(\n subLayers.map(l => {\n if (l.layer.subLayers.size) {\n l.layer.combineSubLayer(removeIncrementalKey);\n }\n return l.layer.getNativeHandler();\n })\n );\n if (removeIncrementalKey) {\n subLayers.forEach(l => {\n l.group && (l.group.incremental = 0);\n });\n }\n subLayers.forEach(l => {\n // l.layer.release();\n application.layerService.releaseLayer(this.stage, l.layer);\n });\n this.subLayers.clear();\n }\n\n getNativeHandler(): ILayerHandlerContribution {\n return this.layerHandler;\n }\n\n setStage(stage?: IStage, layer?: ILayer) {\n super.setStage(stage, this);\n }\n\n // 选中图层中的节点\n pick(x: number, y: number): { graphic?: IGraphic; group?: IGroup } | false {\n throw new Error('暂不支持');\n }\n // 绘制图层\n render(params: ILayerDrawParams, userParams?: Partial<IDrawContext>) {\n const stage = this.stage;\n this.layerHandler.render(\n [this],\n {\n renderService: params.renderService,\n x: stage.x,\n y: stage.y,\n width: this.viewWidth,\n height: this.viewHeight,\n stage: this.stage,\n layer: this,\n // TODO: 多图层时不应该再用默认background\n background: params.background ?? this.background,\n updateBounds: params.updateBounds\n },\n userParams\n );\n this.afterDrawCbs.forEach(c => c(this));\n }\n resize(w: number, h: number) {\n this.layerHandler.resize(w, h);\n }\n resizeView(w: number, h: number) {\n this.layerHandler.resizeView(w, h);\n }\n setDpr(dpr: number) {\n this.layerHandler.setDpr(dpr);\n }\n afterDraw(cb: (l: this) => void) {\n this.afterDrawCbs.push(cb);\n }\n\n // 动画相关\n startAnimate(t: number) {\n throw new Error('暂不支持');\n }\n\n setToFrame(t: number) {\n throw new Error('暂不支持');\n }\n\n prepare(dirtyBounds: IBoundsLike, params: ILayerHandlerDrawParams) {\n return;\n }\n\n // 合并到某个target上\n combineTo(target: IWindow, params: IDrawToParams) {\n if (this.offscreen) {\n this.layerHandler.drawTo(target, [this], {\n // TODO: 多图层时不应该再用默认background\n background: params.background ?? this.background,\n renderService: params.renderService,\n x: params.x ?? this.stage.x,\n y: params.y ?? this.stage.y,\n width: this.viewWidth,\n height: this.viewHeight,\n stage: this.stage,\n layer: this,\n ...params\n });\n this.afterDrawCbs.forEach(c => c(this));\n }\n }\n\n release(): void {\n super.release();\n this.layerHandler.release();\n if (this.subLayers) {\n this.subLayers.forEach(l => {\n // l.layer.release();\n application.layerService.releaseLayer(this.stage, l.layer);\n });\n }\n }\n\n drawTo(target: IWindow, params: IDrawToParams) {\n this.layerHandler.drawTo(target, [this], {\n // TODO: 多图层时不应该再用默认background\n background: params.background ?? this.background,\n renderService: params.renderService,\n x: params.x ?? this.stage.x,\n y: params.y ?? this.stage.y,\n width: this.viewWidth,\n height: this.viewHeight,\n stage: this.stage,\n layer: this,\n ...params\n });\n this.afterDrawCbs.forEach(c => c(this));\n }\n}\n"]}
@@ -1,6 +1,6 @@
1
- import type { IBounds, IBoundsLike, IMatrix } from '@visactor/vutils';
1
+ import type { IAABBBounds, IBounds, IBoundsLike, IMatrix } from '@visactor/vutils';
2
2
  import { AABBBounds } from '@visactor/vutils';
3
- import type { IGraphic, IGroup, IExportType, IStage, IStageParams, ILayer, IColor, IOption3D, ICamera, vec3, IDirectionLight, ITicker, IRenderService, IPickerService, IPluginService, ISyncHook, IDrawContext, IWindow, ILayerService } from '../interface';
3
+ import type { IGraphic, IGroup, IExportType, IStage, IStageParams, ILayer, IColor, IOption3D, ICamera, vec3, IDirectionLight, ITicker, IRenderService, IPickerService, IPluginService, ISyncHook, IDrawContext, IWindow, ILayerService, ITimeline, IOptimizeType } from '../interface';
4
4
  import type { Layer } from './layer';
5
5
  import { Group } from '../graphic';
6
6
  export declare class Stage extends Group implements IStage {
@@ -43,6 +43,7 @@ export declare class Stage extends Group implements IStage {
43
43
  ticker: ITicker;
44
44
  autoRender: boolean;
45
45
  _enableLayout: boolean;
46
+ htmlAttribute: boolean | string | any;
46
47
  increaseAutoRender: boolean;
47
48
  view3dTranform: boolean;
48
49
  readonly window: IWindow;
@@ -54,11 +55,17 @@ export declare class Stage extends Group implements IStage {
54
55
  private readonly eventSystem?;
55
56
  protected _beforeRender?: (stage: IStage) => void;
56
57
  protected _afterRender?: (stage: IStage) => void;
58
+ protected _skipRender?: number;
57
59
  protected _afterNextRenderCbs?: ((stage: IStage) => void)[];
58
60
  protected lastRenderparams?: Partial<IDrawContext>;
59
61
  protected interactiveLayer?: ILayer;
60
62
  protected supportInteractiveLayer: boolean;
63
+ protected timeline: ITimeline;
64
+ params: Partial<IStageParams>;
61
65
  constructor(params: Partial<IStageParams>);
66
+ optmize(params?: IOptimizeType): void;
67
+ protected optmizeRender(skipRenderWithOutRange?: boolean): void;
68
+ getTimeline(): ITimeline;
62
69
  get3dOptions(options: IOption3D): {
63
70
  center: {
64
71
  x?: number;
@@ -97,6 +104,8 @@ export declare class Stage extends Group implements IStage {
97
104
  disableDirtyBounds(): void;
98
105
  enableLayout(): void;
99
106
  disableLayout(): void;
107
+ enableHtmlAttribute(container?: any): void;
108
+ disableHtmlAttribute(): void;
100
109
  protected tryUpdateAABBBounds(): AABBBounds;
101
110
  combineLayer(ILayer1: ILayer, ILayer2: ILayer): ILayer;
102
111
  createLayer(canvasId?: string): ILayer;
@@ -132,8 +141,8 @@ export declare class Stage extends Group implements IStage {
132
141
  width: number;
133
142
  height: number;
134
143
  }): void;
135
- renderToNewWindow(fullImage?: boolean): IWindow;
136
- toCanvas(fullImage?: boolean): HTMLCanvasElement | null;
144
+ renderToNewWindow(fullImage?: boolean, viewBox?: IAABBBounds): IWindow;
145
+ toCanvas(fullImage?: boolean, viewBox?: IAABBBounds): HTMLCanvasElement | null;
137
146
  setCursor(mode?: string): void;
138
147
  getCursor(): string;
139
148
  }
package/es/core/stage.js CHANGED
@@ -20,6 +20,8 @@ import { ViewTransform3dPlugin } from "../plugins/builtin-plugin/3dview-transfor
20
20
 
21
21
  import { IncrementalAutoRenderPlugin } from "../plugins/builtin-plugin/incremental-auto-render-plugin";
22
22
 
23
+ import { HtmlAttributePlugin } from "../plugins/builtin-plugin/html-attribute-plugin";
24
+
23
25
  import { DirtyBoundsPlugin } from "../plugins/builtin-plugin/dirty-bounds-plugin";
24
26
 
25
27
  import { FlexLayoutPlugin } from "../plugins/builtin-plugin/flex-layout-plugin";
@@ -36,6 +38,8 @@ import { VGlobal } from "../constants";
36
38
 
37
39
  import { LayerService } from "./constants";
38
40
 
41
+ import { DefaultTimeline } from "../animate";
42
+
39
43
  const DefaultConfig = {
40
44
  WIDTH: 500,
41
45
  HEIGHT: 500,
@@ -110,7 +114,7 @@ export class Stage extends Group {
110
114
  }, this.afterRender = stage => {
111
115
  this.renderCount++, this._afterRender && this._afterRender(stage), this._afterNextRenderCbs && this._afterNextRenderCbs.forEach((cb => cb(stage))),
112
116
  this._afterNextRenderCbs = null;
113
- }, this.theme = new Theme, this.hooks = {
117
+ }, this.params = params, this.theme = new Theme, this.hooks = {
114
118
  beforeRender: new SyncHook([ "stage" ]),
115
119
  afterRender: new SyncHook([ "stage" ])
116
120
  }, this.global = container.get(VGlobal), this.window = container.get(VWindow), this.renderService = container.get(RenderService),
@@ -151,10 +155,24 @@ export class Stage extends Group {
151
155
  }
152
156
  }
153
157
  })), params.autoRender && this.enableAutoRender(), !1 === params.disableDirtyBounds && this.enableDirtyBounds(),
158
+ params.enableHtmlAttribute && this.enableHtmlAttribute(params.enableHtmlAttribute),
154
159
  params.enableLayout && this.enableLayout(), this.hooks.beforeRender.tap("constructor", this.beforeRender),
155
160
  this.hooks.afterRender.tap("constructor", this.afterRender), this._beforeRender = params.beforeRender,
156
161
  this._afterRender = params.afterRender, this.ticker = params.ticker || defaultTicker,
157
- this.supportInteractiveLayer = !1 !== params.interactiveLayer;
162
+ this.supportInteractiveLayer = !1 !== params.interactiveLayer, this.timeline = new DefaultTimeline,
163
+ this.ticker.addTimeline(this.timeline), this.timeline.pause(), this.optmize(params.optimize);
164
+ }
165
+ optmize(params) {
166
+ this.optmizeRender(null == params ? void 0 : params.skipRenderWithOutRange);
167
+ }
168
+ optmizeRender(skipRenderWithOutRange = !0) {
169
+ skipRenderWithOutRange && (this._skipRender = this.window.isVisible() ? 0 : 1, this.window.onVisibleChange((visible => {
170
+ visible ? (this.dirtyBounds && this.dirtyBounds.setValue(0, 0, this._viewBox.width(), this._viewBox.height()),
171
+ this._skipRender > 1 && this.renderNextFrame(), this._skipRender = 0) : this._skipRender = 1;
172
+ })));
173
+ }
174
+ getTimeline() {
175
+ return this.timeline;
158
176
  }
159
177
  get3dOptions(options) {
160
178
  const {center: center = {
@@ -251,6 +269,14 @@ export class Stage extends Group {
251
269
  plugin.deactivate(this.pluginService);
252
270
  })));
253
271
  }
272
+ enableHtmlAttribute(container) {
273
+ this.htmlAttribute || (this.htmlAttribute = container, this.pluginService.register(new HtmlAttributePlugin));
274
+ }
275
+ disableHtmlAttribute() {
276
+ this.htmlAttribute && (this.htmlAttribute = !1, this.pluginService.findPluginsByName("HtmlAttributePlugin").forEach((plugin => {
277
+ plugin.deactivate(this.pluginService);
278
+ })));
279
+ }
254
280
  tryUpdateAABBBounds() {
255
281
  const viewBox = this._viewBox;
256
282
  return this._AABBBounds.setValue(viewBox.x1, viewBox.y1, viewBox.x2, viewBox.y2),
@@ -277,14 +303,14 @@ export class Stage extends Group {
277
303
  }
278
304
  tryInitInteractiveLayer() {
279
305
  this.supportInteractiveLayer && !this.interactiveLayer && (this.interactiveLayer = this.createLayer(),
280
- this.interactiveLayer.name = "_builtin_interactive");
306
+ this.interactiveLayer.name = "_builtin_interactive", this.nextFrameRenderLayerSet.add(this.interactiveLayer));
281
307
  }
282
308
  clearViewBox(color) {
283
309
  this.window.clearViewBox(this._viewBox, color);
284
310
  }
285
311
  render(layers, params) {
286
- this.ticker.start(), this.lastRenderparams = params, this.hooks.beforeRender.call(this),
287
- (layers || this).forEach(((layer, i) => {
312
+ this.ticker.start(), this.timeline.resume(), this._skipRender || (this.lastRenderparams = params,
313
+ this.hooks.beforeRender.call(this), (layers || this).forEach(((layer, i) => {
288
314
  layer.render({
289
315
  renderService: this.renderService,
290
316
  background: layer === this.defaultLayer ? this.background : void 0,
@@ -292,7 +318,8 @@ export class Stage extends Group {
292
318
  }, Object.assign({
293
319
  renderStyle: this.renderStyle
294
320
  }, params));
295
- })), this.combineLayersToWindow(), this.nextFrameRenderLayerSet.clear(), this.hooks.afterRender.call(this);
321
+ })), this.combineLayersToWindow(), this.nextFrameRenderLayerSet.clear(), this.hooks.afterRender.call(this)),
322
+ this._skipRender && this._skipRender++;
296
323
  }
297
324
  combineLayersToWindow() {
298
325
  this.forEach(((layer, i) => {
@@ -316,7 +343,7 @@ export class Stage extends Group {
316
343
  })));
317
344
  }
318
345
  _doRenderInThisFrame() {
319
- this.nextFrameRenderLayerSet.size && (this.ticker.start(), this.hooks.beforeRender.call(this),
346
+ this.timeline.resume(), this.ticker.start(), this.nextFrameRenderLayerSet.size && !this._skipRender && (this.hooks.beforeRender.call(this),
320
347
  this.forEach((layer => {
321
348
  this.nextFrameRenderLayerSet.has(layer) && layer.render({
322
349
  renderService: this.renderService,
@@ -325,7 +352,8 @@ export class Stage extends Group {
325
352
  }, Object.assign({
326
353
  renderStyle: this.renderStyle
327
354
  }, this.lastRenderparams || {}));
328
- })), this.combineLayersToWindow(), this.hooks.afterRender.call(this), this.nextFrameRenderLayerSet.clear());
355
+ })), this.combineLayersToWindow(), this.hooks.afterRender.call(this), this.nextFrameRenderLayerSet.clear()),
356
+ this._skipRender && this._skipRender++;
329
357
  }
330
358
  resizeWindow(w, h, rerender = !0) {
331
359
  this.window.resize(w, h), rerender && this.render();
@@ -399,31 +427,36 @@ export class Stage extends Group {
399
427
  }));
400
428
  }));
401
429
  }
402
- renderToNewWindow(fullImage = !0) {
430
+ renderToNewWindow(fullImage = !0, viewBox) {
403
431
  const window = container.get(VWindow);
404
- return fullImage ? window.create({
432
+ if (fullImage) window.create({
405
433
  width: this.viewWidth,
406
434
  height: this.viewHeight,
407
435
  dpr: this.window.dpr,
408
436
  canvasControled: !0,
409
437
  offscreen: !0,
410
438
  title: ""
411
- }) : window.create({
412
- width: Math.min(this.viewWidth, this.window.width - this.x),
413
- height: Math.min(this.viewHeight, this.window.height - this.y),
414
- dpr: this.window.dpr,
415
- canvasControled: !0,
416
- offscreen: !0,
417
- title: ""
418
- }), this.renderTo(window, {
419
- x: 0,
420
- y: 0,
421
- width: window.width,
422
- height: window.height
439
+ }); else {
440
+ const width = viewBox ? viewBox.width() : Math.min(this.viewWidth, this.window.width - this.x), height = viewBox ? viewBox.height() : Math.min(this.viewHeight, this.window.height - this.y);
441
+ window.create({
442
+ width: width,
443
+ height: height,
444
+ dpr: this.window.dpr,
445
+ canvasControled: !0,
446
+ offscreen: !0,
447
+ title: ""
448
+ });
449
+ }
450
+ const x = viewBox ? -viewBox.x1 : 0, y = viewBox ? -viewBox.y1 : 0;
451
+ return this.renderTo(window, {
452
+ x: x,
453
+ y: y,
454
+ width: viewBox ? viewBox.x2 : window.width,
455
+ height: viewBox ? viewBox.y2 : window.height
423
456
  }), window;
424
457
  }
425
- toCanvas(fullImage = !0) {
426
- const c = this.renderToNewWindow(fullImage).getNativeHandler();
458
+ toCanvas(fullImage = !0, viewBox) {
459
+ const c = this.renderToNewWindow(fullImage, viewBox).getNativeHandler();
427
460
  return c.nativeCanvas ? c.nativeCanvas : null;
428
461
  }
429
462
  setCursor(mode) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/core/stage.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAyB7D,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAEnC,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,s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,GAAG;gBACpB,eAAe,EAAE,IAAI;gBACrB,SAAS,EAAE,IAAI;gBACf,KAAK,EAAE,EAAE;aACV,CAAC,CAAC;SACJ;QAED,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE;YACpB,CAAC,EAAE,CAAC;YACJ,CAAC,EAAE,CAAC;YACJ,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,MAAM,EAAE,MAAM,CAAC,MAAM;SACtB,CAAC,CAAC;QACH,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,QAAQ,CAAC,YAAqB,IAAI;QAChC,MAAM,MAAM,GAAG,IAAI,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC;QACjD,MAAM,CAAC,GAAG,MAAM,CAAC,gBAAgB,EAAE,CAAC;QACpC,IAAI,CAAC,CAAC,YAAY,EAAE;YAClB,OAAO,CAAC,CAAC,YAAY,CAAC;SACvB;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,SAAS,CAAC,IAAa;QACrB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACpB,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC;IAED,SAAS;QACP,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;CACF","file":"stage.js","sourcesContent":["import type { IBounds, IBoundsLike, IMatrix } from '@visactor/vutils';\nimport { AABBBounds, Bounds, Point } from '@visactor/vutils';\nimport type {\n IGraphic,\n IGroup,\n IExportType,\n IStage,\n IStageParams,\n ILayer,\n IColor,\n IGlobal,\n IOption3D,\n ICamera,\n vec3,\n IDirectionLight,\n ITicker,\n IRenderService,\n IPickerService,\n IPluginService,\n ISyncHook,\n IDrawContext,\n IWindow,\n IPlugin,\n IContributionProvider,\n ILayerService\n} from '../interface';\nimport { VWindow } from './window';\nimport type { Layer } from './layer';\nimport { EventSystem } from '../event';\nimport { container } from '../container';\nimport { RenderService } from '../render';\nimport { Group, Theme } from '../graphic';\nimport { PickerService } from '../picker/picker-service';\nimport { PluginService } from '../plugins/constants';\nimport { AutoRenderPlugin } from '../plugins/builtin-plugin/auto-render-plugin';\nimport { ViewTransform3dPlugin } from '../plugins/builtin-plugin/3dview-transform-plugin';\nimport { IncrementalAutoRenderPlugin } from '../plugins/builtin-plugin/incremental-auto-render-plugin';\nimport { DirtyBoundsPlugin } from '../plugins/builtin-plugin/dirty-bounds-plugin';\nimport { FlexLayoutPlugin } from '../plugins/builtin-plugin/flex-layout-plugin';\nimport { defaultTicker } from '../animate/default-ticker';\nimport { SyncHook } from '../tapable';\nimport { DirectionalLight } from './light';\nimport { OrthoCamera } from './camera';\nimport { VGlobal } from '../constants';\nimport { LayerService } from './constants';\n\nconst DefaultConfig = {\n WIDTH: 500,\n HEIGHT: 500,\n X: 0,\n Y: 0,\n BACKGROUND: 'white'\n};\n\n/**\n * Stage是一个舞台或一个视口,并不直接对应一个或多个Canvas,逻辑上和Canvas无关\n *\n * 1. Stage对应一个Canvas的整体,Stage的宽高即为Canvas的宽高\n * 2. Stage小于Canvas,Stage作为Canvas某个区域的视口,只管理这个区域\n * 3. 多图层时Stage的多个图层对应多个Canvas\n *\n * 原生环境下Stage可以拥有一个Window或者使用Window的一块区域\n *\n * 【注】如果希望获取完整的Canvas或窗口或者调整窗口信息,请使用Window模块\n */\nexport class Stage extends Group implements IStage {\n declare parent: IStage | null;\n\n // protected _x: number;\n // protected _y: number;\n // // 窗口的宽高\n // private _width: number;\n // private _height: number;\n // 视口的宽高\n // private _viewWidth: number;\n // private _viewHeight: number;\n protected _viewBox: AABBBounds;\n private _background: string | IColor;\n private _subView: boolean; // 是否是存在子视图\n protected nextFrameRenderLayerSet: Set<Layer>;\n protected willNextFrameRender: boolean;\n protected _cursor: string;\n renderCount: number;\n dirtyBounds: IBounds | null;\n option3d?: IOption3D;\n declare light?: IDirectionLight;\n declare camera?: ICamera;\n declare renderStyle?: string;\n\n declare hooks: {\n beforeRender: ISyncHook<[IStage]>;\n afterRender: ISyncHook<[IStage]>;\n };\n\n set viewBox(b: IBoundsLike) {\n this._viewBox.setValue(b.x1, b.y1, b.x2, b.y2);\n }\n get viewBox(): AABBBounds {\n return this._viewBox;\n }\n\n get x(): number {\n return this._viewBox.x1;\n }\n set x(x: number) {\n this._viewBox.translate(x - this._viewBox.x1, 0);\n }\n get y(): number {\n return this._viewBox.y1;\n }\n set y(y: number) {\n this._viewBox.translate(0, y - this._viewBox.y1);\n }\n get width(): number {\n return this.window.width;\n }\n set width(w: number) {\n this.resize(w, this.height);\n }\n get viewWidth(): number {\n return this._viewBox.width();\n }\n set viewWidth(w: number) {\n this.resizeView(w, this.viewHeight);\n }\n get viewHeight(): number {\n return this._viewBox.height();\n }\n set viewHeight(h: number) {\n this.resizeView(this.viewWidth, h);\n }\n get height(): number {\n return this.window.height;\n }\n set height(h: number) {\n this.resize(this.width, h);\n }\n get dpr(): number {\n return this.window.dpr;\n }\n set dpr(r: number) {\n this.setDpr(r);\n }\n get background(): string | IColor {\n return this._background ?? DefaultConfig.BACKGROUND;\n }\n set background(b: string | IColor) {\n this._background = b;\n }\n get defaultLayer(): ILayer {\n return this.at(0) as unknown as ILayer;\n }\n\n ticker: ITicker;\n\n autoRender: boolean;\n _enableLayout: boolean;\n increaseAutoRender: boolean;\n view3dTranform: boolean;\n readonly window: IWindow;\n private readonly global: IGlobal;\n readonly renderService: IRenderService;\n readonly pickerService: IPickerService;\n readonly pluginService: IPluginService;\n readonly layerService: ILayerService;\n private readonly eventSystem?: EventSystem;\n\n protected _beforeRender?: (stage: IStage) => void;\n protected _afterRender?: (stage: IStage) => void;\n protected _afterNextRenderCbs?: ((stage: IStage) => void)[];\n protected lastRenderparams?: Partial<IDrawContext>;\n\n protected interactiveLayer?: ILayer;\n protected supportInteractiveLayer: boolean;\n\n /**\n * 所有属性都具有默认值。\n * Canvas为字符串或者Canvas元素,那么默认图层就会绑定到这个Canvas上\n * 如果不传入Canvas,那么会新建一个Canvas,用户可以通过Window模块管理这个Canvas\n * 1. 如果没有传入宽高,那么默认为canvas宽高,如果传入了宽高则stage使用传入宽高作为视口宽高\n * @param params\n */\n constructor(params: Partial<IStageParams>) {\n super({});\n this.theme = new Theme();\n this.hooks = {\n beforeRender: new SyncHook(['stage']),\n afterRender: new SyncHook(['stage'])\n };\n this.global = container.get<IGlobal>(VGlobal);\n this.window = container.get<IWindow>(VWindow);\n this.renderService = container.get<IRenderService>(RenderService);\n this.pickerService = container.get<IPickerService>(PickerService);\n this.pluginService = container.get<IPluginService>(PluginService);\n this.layerService = container.get<ILayerService>(LayerService);\n this.pluginService.active(this, params);\n\n this.window.create({\n width: params.width,\n height: params.height,\n container: params.container,\n dpr: params.dpr || this.global.devicePixelRatio,\n canvasControled: params.canvasControled !== false,\n title: params.title || '',\n canvas: params.canvas\n });\n\n this._viewBox = new AABBBounds();\n if (params.viewBox) {\n this._viewBox.setValue(params.viewBox.x1, params.viewBox.y1, params.viewBox.x2, params.viewBox.y2);\n } else {\n this._viewBox.setValue(0, 0, this.width, this.height);\n }\n\n this.renderCount = 0;\n\n // // 没有传入xy就默认为0\n // this._x = params.x ?? DefaultConfig.X;\n // this._y = params.y ?? DefaultConfig.Y;\n // // 没有传入view的宽高则默认为window的宽高\n // this._viewWidth = params.viewWidth ?? this.window.width;\n // this._viewHeight = params.viewHeight ?? this.window.height;\n this._subView = !(this._viewBox.width() === this.width && this._viewBox.height() === this.height);\n // this._AABBBounds.set(this._x, this._y, this._viewWidth + this._x, this._viewHeight + this._y);\n // 背景色默认为纯白色\n this._background = params.background ?? DefaultConfig.BACKGROUND;\n\n // 创建一个默认layer图层\n // this.appendChild(new Layer(this, this.global, this.window, { main: true }));\n this.appendChild(this.layerService.createLayer(this, { main: true }));\n\n this.nextFrameRenderLayerSet = new Set();\n this.willNextFrameRender = false;\n this.stage = this;\n this.renderStyle = params.renderStyle;\n\n if (this.global.supportEvent) {\n this.eventSystem = new EventSystem({\n targetElement: this.window,\n resolution: this.window.dpr || this.global.devicePixelRatio,\n rootNode: this as any,\n global: this.global,\n viewport: {\n viewBox: this._viewBox,\n get x(): number {\n return this.viewBox.x1;\n },\n get y(): number {\n return this.viewBox.y1;\n },\n get width(): number {\n return this.viewBox.width();\n },\n get height(): number {\n return this.viewBox.height();\n }\n }\n });\n }\n\n // this.autoRender = params.autoRender;\n if (params.autoRender) {\n this.enableAutoRender();\n }\n // 默认不开启dirtyBounds\n if (params.disableDirtyBounds === false) {\n this.enableDirtyBounds();\n }\n\n params.enableLayout && this.enableLayout();\n this.hooks.beforeRender.tap('constructor', this.beforeRender);\n this.hooks.afterRender.tap('constructor', this.afterRender);\n this._beforeRender = params.beforeRender;\n this._afterRender = params.afterRender;\n this.ticker = params.ticker || defaultTicker;\n this.supportInteractiveLayer = params.interactiveLayer !== false;\n }\n\n get3dOptions(options: IOption3D) {\n const {\n center = { x: this.width / 2, y: this.height / 2, z: 0, dx: 0, dy: 0, dz: 0 },\n light = {},\n alpha = 0,\n beta = 0,\n camera,\n fieldRatio = 1,\n fieldDepth\n } = options;\n\n return {\n ...options,\n center,\n light,\n alpha,\n beta,\n camera,\n fieldRatio,\n fieldDepth\n };\n }\n\n set3dOptions(options: IOption3D) {\n this.option3d = options;\n const options3d = this.get3dOptions(options);\n const { light, center, camera, alpha, beta, fieldRatio, fieldDepth } = options3d;\n const { dir = [1, 1, -1], color = 'white', ambient } = light;\n\n const centerX = (center.x ?? this.width / 2) + (center.dx ?? 0);\n const centerY = (center.y ?? this.height / 2) + (center.dy ?? 0);\n const centerZ = (center.z ?? 0) + (center.dz ?? 0);\n const centerVec3: vec3 = [centerX, centerY, centerZ];\n const z = 1;\n let cameraX = 0;\n let cameraY = 0;\n let cameraZ = 0;\n if (!camera) {\n cameraX = Math.sin(alpha) + centerX;\n cameraY = Math.sin(beta) + centerY;\n cameraZ = Math.cos(alpha) * Math.cos(beta) * z;\n }\n\n this.light = new DirectionalLight(dir, color, ambient);\n const cameraParams = {\n left: 0,\n right: this.width,\n top: 0,\n bottom: this.height,\n fieldRatio: fieldRatio,\n fieldDepth,\n viewParams: {\n pos: [cameraX, cameraY, cameraZ] as vec3,\n center: centerVec3,\n up: [0, 1, 0] as vec3\n }\n };\n if (this.camera) {\n this.camera.params = cameraParams;\n } else {\n this.camera = new OrthoCamera(cameraParams);\n }\n\n if (options.enableView3dTransform) {\n this.enableView3dTransform();\n }\n }\n\n protected beforeRender = (stage: IStage) => {\n this._beforeRender && this._beforeRender(stage);\n };\n\n protected afterRender = (stage: IStage) => {\n this.renderCount++;\n this._afterRender && this._afterRender(stage);\n this._afterNextRenderCbs && this._afterNextRenderCbs.forEach(cb => cb(stage));\n this._afterNextRenderCbs = null;\n };\n\n setBeforeRender(cb: (stage: IStage) => void) {\n this._beforeRender = cb;\n }\n\n setAfterRender(cb: (stage: IStage) => void) {\n this._afterRender = cb;\n }\n\n afterNextRender(cb: (stage: IStage) => void) {\n if (!this._afterNextRenderCbs) {\n this._afterNextRenderCbs = [];\n }\n this._afterNextRenderCbs.push(cb);\n }\n\n enableView3dTransform() {\n if (this.view3dTranform) {\n return;\n }\n this.view3dTranform = true;\n this.pluginService.register(new ViewTransform3dPlugin());\n }\n\n disableView3dTranform() {\n if (!this.view3dTranform) {\n return;\n }\n this.view3dTranform = false;\n this.pluginService.findPluginsByName('ViewTransform3dPlugin').forEach(plugin => {\n plugin.deactivate(this.pluginService);\n });\n }\n\n enableAutoRender() {\n if (this.autoRender) {\n return;\n }\n this.autoRender = true;\n this.pluginService.register(new AutoRenderPlugin());\n }\n disableAutoRender() {\n if (!this.autoRender) {\n return;\n }\n this.autoRender = false;\n this.pluginService.findPluginsByName('AutoRenderPlugin').forEach(plugin => {\n plugin.deactivate(this.pluginService);\n });\n }\n enableIncrementalAutoRender() {\n if (this.increaseAutoRender) {\n return;\n }\n this.increaseAutoRender = true;\n this.pluginService.register(new IncrementalAutoRenderPlugin());\n }\n disableIncrementalAutoRender() {\n if (!this.increaseAutoRender) {\n return;\n }\n this.increaseAutoRender = false;\n this.pluginService.findPluginsByName('IncrementalAutoRenderPlugin').forEach(plugin => {\n plugin.deactivate(this.pluginService);\n });\n }\n enableDirtyBounds() {\n if (this.dirtyBounds) {\n return;\n }\n this.dirtyBounds = new Bounds();\n let plugin = this.pluginService.findPluginsByName('DirtyBoundsPlugin')[0];\n if (!plugin) {\n plugin = new DirtyBoundsPlugin();\n this.pluginService.register(plugin);\n }\n plugin.activate(this.pluginService);\n }\n disableDirtyBounds() {\n if (!this.dirtyBounds) {\n return;\n }\n this.dirtyBounds = null;\n this.pluginService.findPluginsByName('DirtyBoundsPlugin').forEach(plugin => {\n plugin.deactivate(this.pluginService);\n });\n }\n enableLayout() {\n if (this._enableLayout) {\n return;\n }\n this._enableLayout = true;\n this.pluginService.register(new FlexLayoutPlugin());\n }\n disableLayout() {\n if (!this._enableLayout) {\n return;\n }\n this._enableLayout = false;\n this.pluginService.findPluginsByName('FlexLayoutPlugin').forEach(plugin => {\n plugin.deactivate(this.pluginService);\n });\n }\n\n // /**\n // * stage的appendChild,add\n // * @param node\n // * @returns\n // */\n // appendChild<T extends Node>(node: T): T | null {\n // const layer = this.at(0);\n // if (!layer) {\n // return null;\n // }\n // return layer.appendChild<T>(node);\n // }\n\n protected tryUpdateAABBBounds(): AABBBounds {\n const viewBox = this._viewBox;\n this._AABBBounds.setValue(viewBox.x1, viewBox.y1, viewBox.x2, viewBox.y2);\n return this._AABBBounds;\n }\n\n combineLayer(ILayer1: ILayer, ILayer2: ILayer): ILayer {\n throw new Error('暂不支持');\n }\n // 如果传入CanvasId,如果存在相同Id,说明这两个图层使用相同的Canvas绘制\n // 但需要注意的是依然是两个图层(用于解决Table嵌入ChartSpace不影响Table的绘制)\n createLayer(canvasId?: string): ILayer {\n // 创建一个默认layer图层\n const layer = this.layerService.createLayer(this, {\n main: false,\n canvasId\n });\n this.appendChild(layer);\n return layer;\n // const layer = new Layer(this, this.global, this.window, {\n // main: false,\n // canvasId\n // });\n // this.appendChild(layer);\n // return layer;\n }\n sortLayer(cb: (ILayer1: ILayer, layer2: ILayer) => number): void {\n const children = this.children;\n children.sort(cb);\n this.removeAllChild();\n children.forEach(c => {\n this.appendChild(c);\n });\n }\n removeLayer(ILayerId: number): ILayer | false {\n return this.removeChild(this.findChildByUid(ILayerId) as IGraphic) as ILayer;\n }\n tryInitInteractiveLayer() {\n // TODO:顺序可能会存在问题\n // 支持交互层,且没有创建过,那就创建\n if (this.supportInteractiveLayer && !this.interactiveLayer) {\n this.interactiveLayer = this.createLayer();\n this.interactiveLayer.name = '_builtin_interactive';\n }\n // this.interactiveLayer.afterDraw(l => {\n // l.removeAllChild();\n // });\n }\n\n clearViewBox(color?: string) {\n this.window.clearViewBox(this._viewBox, color);\n }\n\n render(layers?: ILayer[], params?: Partial<IDrawContext>): void {\n this.ticker.start();\n this.lastRenderparams = params;\n this.hooks.beforeRender.call(this);\n (layers || this).forEach<ILayer>((layer, i) => {\n layer.render(\n {\n renderService: this.renderService,\n background: layer === this.defaultLayer ? this.background : undefined,\n updateBounds: !!this.dirtyBounds\n },\n { renderStyle: this.renderStyle, ...params }\n );\n });\n this.combineLayersToWindow();\n this.nextFrameRenderLayerSet.clear();\n this.hooks.afterRender.call(this);\n }\n\n protected combineLayersToWindow() {\n this.forEach<ILayer>((layer, i) => {\n layer.combineTo(this.window, {\n clear: i === 0,\n x: this.x,\n y: this.y,\n width: this.viewWidth,\n height: this.viewHeight,\n renderService: this.renderService,\n background: layer === this.defaultLayer ? this.background : undefined,\n updateBounds: !!this.dirtyBounds\n });\n });\n }\n\n renderNextFrame(layers?: ILayer[]): void {\n // 性能优化,避免重复add\n if (this.nextFrameRenderLayerSet.size !== this.childrenCount) {\n (layers || this).forEach<ILayer>((layer: any) => {\n this.nextFrameRenderLayerSet.add(layer);\n });\n }\n if (!this.willNextFrameRender) {\n this.willNextFrameRender = true;\n this.global.getRequestAnimationFrame()(() => {\n this._doRenderInThisFrame(), (this.willNextFrameRender = false);\n });\n }\n }\n\n _doRenderInThisFrame() {\n if (this.nextFrameRenderLayerSet.size) {\n this.ticker.start();\n this.hooks.beforeRender.call(this);\n this.forEach((layer: Layer) => {\n if (this.nextFrameRenderLayerSet.has(layer)) {\n layer.render(\n {\n renderService: this.renderService,\n background: layer === this.defaultLayer ? this.background : undefined,\n updateBounds: !!this.dirtyBounds\n },\n { renderStyle: this.renderStyle, ...(this.lastRenderparams || {}) }\n );\n }\n });\n this.combineLayersToWindow();\n this.hooks.afterRender.call(this);\n this.nextFrameRenderLayerSet.clear();\n }\n }\n\n resizeWindow(w: number, h: number, rerender: boolean = true) {\n this.window.resize(w, h);\n rerender && this.render();\n }\n\n /**\n * 语法糖,如果viewBox和window宽高一样的话,那么会同时缩放window和viewBox\n * @param w\n * @param h\n * @param rerender\n */\n resize(w: number, h: number, rerender: boolean = true): void {\n this.window.resize(w, h);\n this.forEachChildren<ILayer>(c => {\n c.resize(w, h);\n });\n // 如果不是子图的stage,那么认为用户也想要resize view\n if (!this._subView) {\n this.viewBox.setValue(this.viewBox.x1, this.viewBox.y1, this.viewBox.x1 + w, this.viewBox.y1 + h);\n }\n // 设置camera\n // this.camera && (this.camera.params = { ...this.camera.params, right: this.width, bottom: this.height });\n this.camera && this.option3d && this.set3dOptions(this.option3d);\n rerender && this.render();\n }\n resizeView(w: number, h: number, rerender: boolean = true) {\n this.viewBox.setValue(this.viewBox.x1, this.viewBox.y1, this.viewBox.x1 + w, this.viewBox.y1 + h);\n this.forEachChildren<ILayer>(c => {\n c.resizeView(w, h);\n });\n // 设置camera\n this.camera && (this.camera.params = { ...this.camera.params, right: this.width, bottom: this.height });\n rerender && this.render();\n }\n setViewBox(viewBox: IBoundsLike, rerender: boolean): void;\n setViewBox(x: number, y: number, w: number, h: number, rerender: boolean): void;\n setViewBox(x: number | IBoundsLike, y: number | boolean, w?: number, h?: number, rerender?: boolean): void {\n let isRerender: boolean = true;\n\n if (typeof x === 'object') {\n this.viewBox.setValue(x.x1, x.y1, x.x2, x.y2);\n if (y === false) {\n isRerender = false;\n }\n } else {\n this.viewBox.setValue(x, y as number, x + w, (y as number) + h);\n\n if (rerender === false) {\n isRerender = false;\n }\n }\n\n this.forEachChildren<ILayer>(c => {\n c.resizeView(this.viewBox.width(), this.viewBox.height());\n });\n isRerender && this.render();\n }\n setDpr(dpr: number, rerender: boolean = true): void {\n // this.window.setDpr(dpr);\n this.forEachChildren<ILayer>(c => {\n c.setDpr(dpr);\n });\n\n rerender && this.render();\n }\n setOrigin(x: number, y: number): void {\n throw new Error('暂不支持');\n }\n export(type: IExportType): HTMLCanvasElement | ImageData {\n throw new Error('暂不支持');\n }\n pick(x: number, y: number): { graphic: IGraphic | null; group: IGroup | null } | false {\n // 暂时不提供layer的pick\n const result = this.pickerService.pick(this.children as unknown as IGraphic[], new Point(x, y), {\n bounds: this.AABBBounds\n });\n if (result?.graphic || result?.group) {\n return result;\n }\n return false;\n }\n\n // 动画相关\n startAnimate(t: number): void {\n throw new Error('暂不支持');\n }\n setToFrame(t: number): void {\n throw new Error('暂不支持');\n }\n\n release() {\n super.release();\n this.eventSystem && this.eventSystem.release();\n this.pluginService.release();\n this.forEach(layer => {\n layer.release();\n });\n this.interactiveLayer && this.interactiveLayer.release();\n this.window.release();\n }\n\n setStage(stage?: IStage) {\n return;\n // this.stage = this;\n // this.forEachChildren(item => {\n // (item as Layer).setStage(this);\n // });\n }\n\n /**\n * 添加dirty区域,会修改参数b\n * @param b\n * @param matrix\n */\n dirty(b: IBounds, matrix?: IMatrix) {\n if (matrix) {\n b.transformWithMatrix(matrix);\n }\n if (this.dirtyBounds.empty()) {\n this.dirtyBounds.setValue(b.x1, b.y1, b.x2, b.y2);\n }\n this.dirtyBounds.union(b);\n }\n\n getLayer(name: string): undefined | ILayer {\n const layer = this.children.filter(layer => layer.name === name);\n return layer[0] as ILayer;\n }\n\n renderTo(window: IWindow, params: { x: number; y: number; width: number; height: number }) {\n this.forEachChildren<ILayer>((layer, i) => {\n layer.drawTo(window, {\n ...params,\n renderService: this.renderService,\n background: layer === this.defaultLayer ? this.background : undefined,\n clear: i === 0, // 第一个layer需要clear\n updateBounds: !!this.dirtyBounds\n });\n });\n }\n\n /**\n * 渲染到新的window上去\n * @param fullImage 是否是全量的image,因为可能之前的window有一部分场景树超过window的帧缓冲了\n * @returns\n */\n renderToNewWindow(fullImage: boolean = true): IWindow {\n const window = container.get<IWindow>(VWindow);\n if (fullImage) {\n window.create({\n width: this.viewWidth,\n height: this.viewHeight,\n dpr: this.window.dpr,\n canvasControled: true,\n offscreen: true,\n title: ''\n });\n } else {\n window.create({\n width: Math.min(this.viewWidth, this.window.width - this.x),\n height: Math.min(this.viewHeight, this.window.height - this.y),\n dpr: this.window.dpr,\n canvasControled: true,\n offscreen: true,\n title: ''\n });\n }\n\n this.renderTo(window, {\n x: 0,\n y: 0,\n width: window.width,\n height: window.height\n });\n return window;\n }\n\n toCanvas(fullImage: boolean = true): HTMLCanvasElement | null {\n const window = this.renderToNewWindow(fullImage);\n const c = window.getNativeHandler();\n if (c.nativeCanvas) {\n return c.nativeCanvas;\n }\n return null;\n }\n\n setCursor(mode?: string): void {\n this._cursor = mode;\n this.eventSystem.setCursor(mode);\n }\n\n getCursor() {\n return this._cursor;\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/core/stage.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AA2B7D,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAEnC,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,8CAA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SAAS,EAAE,IAAI;gBACf,KAAK,EAAE,EAAE;aACV,CAAC,CAAC;SACJ;QAED,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QACpC,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QACpC,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE;YACpB,CAAC;YACD,CAAC;YACD,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK;YAC1C,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM;SAC7C,CAAC,CAAC;QACH,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,QAAQ,CAAC,YAAqB,IAAI,EAAE,OAAqB;QACvD,MAAM,MAAM,GAAG,IAAI,CAAC,iBAAiB,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QAC1D,MAAM,CAAC,GAAG,MAAM,CAAC,gBAAgB,EAAE,CAAC;QACpC,IAAI,CAAC,CAAC,YAAY,EAAE;YAClB,OAAO,CAAC,CAAC,YAAY,CAAC;SACvB;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,SAAS,CAAC,IAAa;QACrB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACpB,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC;IAED,SAAS;QACP,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;CACF","file":"stage.js","sourcesContent":["import type { IAABBBounds, IBounds, IBoundsLike, IMatrix } from '@visactor/vutils';\nimport { AABBBounds, Bounds, Point } from '@visactor/vutils';\nimport type {\n IGraphic,\n IGroup,\n IExportType,\n IStage,\n IStageParams,\n ILayer,\n IColor,\n IGlobal,\n IOption3D,\n ICamera,\n vec3,\n IDirectionLight,\n ITicker,\n IRenderService,\n IPickerService,\n IPluginService,\n ISyncHook,\n IDrawContext,\n IWindow,\n IPlugin,\n IContributionProvider,\n ILayerService,\n ITimeline,\n IOptimizeType\n} from '../interface';\nimport { VWindow } from './window';\nimport type { Layer } from './layer';\nimport { EventSystem } from '../event';\nimport { container } from '../container';\nimport { RenderService } from '../render';\nimport { Group, Theme } from '../graphic';\nimport { PickerService } from '../picker/picker-service';\nimport { PluginService } from '../plugins/constants';\nimport { AutoRenderPlugin } from '../plugins/builtin-plugin/auto-render-plugin';\nimport { ViewTransform3dPlugin } from '../plugins/builtin-plugin/3dview-transform-plugin';\nimport { IncrementalAutoRenderPlugin } from '../plugins/builtin-plugin/incremental-auto-render-plugin';\nimport { HtmlAttributePlugin } from '../plugins/builtin-plugin/html-attribute-plugin';\nimport { DirtyBoundsPlugin } from '../plugins/builtin-plugin/dirty-bounds-plugin';\nimport { FlexLayoutPlugin } from '../plugins/builtin-plugin/flex-layout-plugin';\nimport { defaultTicker } from '../animate/default-ticker';\nimport { SyncHook } from '../tapable';\nimport { DirectionalLight } from './light';\nimport { OrthoCamera } from './camera';\nimport { VGlobal } from '../constants';\nimport { LayerService } from './constants';\nimport { DefaultTimeline } from '../animate';\n\nconst DefaultConfig = {\n WIDTH: 500,\n HEIGHT: 500,\n X: 0,\n Y: 0,\n BACKGROUND: 'white'\n};\n\n/**\n * Stage是一个舞台或一个视口,并不直接对应一个或多个Canvas,逻辑上和Canvas无关\n *\n * 1. Stage对应一个Canvas的整体,Stage的宽高即为Canvas的宽高\n * 2. Stage小于Canvas,Stage作为Canvas某个区域的视口,只管理这个区域\n * 3. 多图层时Stage的多个图层对应多个Canvas\n *\n * 原生环境下Stage可以拥有一个Window或者使用Window的一块区域\n *\n * 【注】如果希望获取完整的Canvas或窗口或者调整窗口信息,请使用Window模块\n */\nexport class Stage extends Group implements IStage {\n declare parent: IStage | null;\n\n protected _viewBox: AABBBounds;\n private _background: string | IColor;\n private _subView: boolean; // 是否是存在子视图\n protected nextFrameRenderLayerSet: Set<Layer>;\n protected willNextFrameRender: boolean;\n protected _cursor: string;\n renderCount: number;\n dirtyBounds: IBounds | null;\n option3d?: IOption3D;\n declare light?: IDirectionLight;\n declare camera?: ICamera;\n declare renderStyle?: string;\n\n declare hooks: {\n beforeRender: ISyncHook<[IStage]>;\n afterRender: ISyncHook<[IStage]>;\n };\n\n set viewBox(b: IBoundsLike) {\n this._viewBox.setValue(b.x1, b.y1, b.x2, b.y2);\n }\n get viewBox(): AABBBounds {\n return this._viewBox;\n }\n\n get x(): number {\n return this._viewBox.x1;\n }\n set x(x: number) {\n this._viewBox.translate(x - this._viewBox.x1, 0);\n }\n get y(): number {\n return this._viewBox.y1;\n }\n set y(y: number) {\n this._viewBox.translate(0, y - this._viewBox.y1);\n }\n get width(): number {\n return this.window.width;\n }\n set width(w: number) {\n this.resize(w, this.height);\n }\n get viewWidth(): number {\n return this._viewBox.width();\n }\n set viewWidth(w: number) {\n this.resizeView(w, this.viewHeight);\n }\n get viewHeight(): number {\n return this._viewBox.height();\n }\n set viewHeight(h: number) {\n this.resizeView(this.viewWidth, h);\n }\n get height(): number {\n return this.window.height;\n }\n set height(h: number) {\n this.resize(this.width, h);\n }\n get dpr(): number {\n return this.window.dpr;\n }\n set dpr(r: number) {\n this.setDpr(r);\n }\n get background(): string | IColor {\n return this._background ?? DefaultConfig.BACKGROUND;\n }\n set background(b: string | IColor) {\n this._background = b;\n }\n get defaultLayer(): ILayer {\n return this.at(0) as unknown as ILayer;\n }\n\n ticker: ITicker;\n\n autoRender: boolean;\n _enableLayout: boolean;\n htmlAttribute: boolean | string | any;\n increaseAutoRender: boolean;\n view3dTranform: boolean;\n readonly window: IWindow;\n private readonly global: IGlobal;\n readonly renderService: IRenderService;\n readonly pickerService: IPickerService;\n readonly pluginService: IPluginService;\n readonly layerService: ILayerService;\n private readonly eventSystem?: EventSystem;\n\n protected _beforeRender?: (stage: IStage) => void;\n protected _afterRender?: (stage: IStage) => void;\n protected _skipRender?: number;\n protected _afterNextRenderCbs?: ((stage: IStage) => void)[];\n protected lastRenderparams?: Partial<IDrawContext>;\n\n protected interactiveLayer?: ILayer;\n protected supportInteractiveLayer: boolean;\n protected timeline: ITimeline;\n\n declare params: Partial<IStageParams>;\n\n /**\n * 所有属性都具有默认值。\n * Canvas为字符串或者Canvas元素,那么默认图层就会绑定到这个Canvas上\n * 如果不传入Canvas,那么会新建一个Canvas,用户可以通过Window模块管理这个Canvas\n * 1. 如果没有传入宽高,那么默认为canvas宽高,如果传入了宽高则stage使用传入宽高作为视口宽高\n * @param params\n */\n constructor(params: Partial<IStageParams>) {\n super({});\n this.params = params;\n this.theme = new Theme();\n this.hooks = {\n beforeRender: new SyncHook(['stage']),\n afterRender: new SyncHook(['stage'])\n };\n this.global = container.get<IGlobal>(VGlobal);\n this.window = container.get<IWindow>(VWindow);\n this.renderService = container.get<IRenderService>(RenderService);\n this.pickerService = container.get<IPickerService>(PickerService);\n this.pluginService = container.get<IPluginService>(PluginService);\n this.layerService = container.get<ILayerService>(LayerService);\n this.pluginService.active(this, params);\n\n this.window.create({\n width: params.width,\n height: params.height,\n container: params.container,\n dpr: params.dpr || this.global.devicePixelRatio,\n canvasControled: params.canvasControled !== false,\n title: params.title || '',\n canvas: params.canvas\n });\n\n this._viewBox = new AABBBounds();\n if (params.viewBox) {\n this._viewBox.setValue(params.viewBox.x1, params.viewBox.y1, params.viewBox.x2, params.viewBox.y2);\n } else {\n this._viewBox.setValue(0, 0, this.width, this.height);\n }\n\n this.renderCount = 0;\n\n // // 没有传入xy就默认为0\n // this._x = params.x ?? DefaultConfig.X;\n // this._y = params.y ?? DefaultConfig.Y;\n // // 没有传入view的宽高则默认为window的宽高\n // this._viewWidth = params.viewWidth ?? this.window.width;\n // this._viewHeight = params.viewHeight ?? this.window.height;\n this._subView = !(this._viewBox.width() === this.width && this._viewBox.height() === this.height);\n // this._AABBBounds.set(this._x, this._y, this._viewWidth + this._x, this._viewHeight + this._y);\n // 背景色默认为纯白色\n this._background = params.background ?? DefaultConfig.BACKGROUND;\n\n // 创建一个默认layer图层\n // this.appendChild(new Layer(this, this.global, this.window, { main: true }));\n this.appendChild(this.layerService.createLayer(this, { main: true }));\n\n this.nextFrameRenderLayerSet = new Set();\n this.willNextFrameRender = false;\n this.stage = this;\n this.renderStyle = params.renderStyle;\n\n if (this.global.supportEvent) {\n this.eventSystem = new EventSystem({\n targetElement: this.window,\n resolution: this.window.dpr || this.global.devicePixelRatio,\n rootNode: this as any,\n global: this.global,\n viewport: {\n viewBox: this._viewBox,\n get x(): number {\n return this.viewBox.x1;\n },\n get y(): number {\n return this.viewBox.y1;\n },\n get width(): number {\n return this.viewBox.width();\n },\n get height(): number {\n return this.viewBox.height();\n }\n }\n });\n }\n\n // this.autoRender = params.autoRender;\n if (params.autoRender) {\n this.enableAutoRender();\n }\n // 默认不开启dirtyBounds\n if (params.disableDirtyBounds === false) {\n this.enableDirtyBounds();\n }\n\n if (params.enableHtmlAttribute) {\n this.enableHtmlAttribute(params.enableHtmlAttribute);\n }\n\n params.enableLayout && this.enableLayout();\n this.hooks.beforeRender.tap('constructor', this.beforeRender);\n this.hooks.afterRender.tap('constructor', this.afterRender);\n this._beforeRender = params.beforeRender;\n this._afterRender = params.afterRender;\n this.ticker = params.ticker || defaultTicker;\n this.supportInteractiveLayer = params.interactiveLayer !== false;\n this.timeline = new DefaultTimeline();\n this.ticker.addTimeline(this.timeline);\n this.timeline.pause();\n this.optmize(params.optimize);\n }\n\n // 优化策略\n optmize(params?: IOptimizeType) {\n this.optmizeRender(params?.skipRenderWithOutRange);\n }\n\n // 优化渲染\n protected optmizeRender(skipRenderWithOutRange: boolean = true) {\n if (!skipRenderWithOutRange) {\n return;\n }\n // 不在视口内的时候,跳过渲染\n this._skipRender = this.window.isVisible() ? 0 : 1;\n this.window.onVisibleChange(visible => {\n if (visible) {\n if (this.dirtyBounds) {\n this.dirtyBounds.setValue(0, 0, this._viewBox.width(), this._viewBox.height());\n }\n if (this._skipRender > 1) {\n this.renderNextFrame();\n }\n this._skipRender = 0;\n } else {\n this._skipRender = 1;\n }\n });\n }\n\n getTimeline() {\n return this.timeline;\n }\n\n get3dOptions(options: IOption3D) {\n const {\n center = { x: this.width / 2, y: this.height / 2, z: 0, dx: 0, dy: 0, dz: 0 },\n light = {},\n alpha = 0,\n beta = 0,\n camera,\n fieldRatio = 1,\n fieldDepth\n } = options;\n\n return {\n ...options,\n center,\n light,\n alpha,\n beta,\n camera,\n fieldRatio,\n fieldDepth\n };\n }\n\n set3dOptions(options: IOption3D) {\n this.option3d = options;\n const options3d = this.get3dOptions(options);\n const { light, center, camera, alpha, beta, fieldRatio, fieldDepth } = options3d;\n const { dir = [1, 1, -1], color = 'white', ambient } = light;\n\n const centerX = (center.x ?? this.width / 2) + (center.dx ?? 0);\n const centerY = (center.y ?? this.height / 2) + (center.dy ?? 0);\n const centerZ = (center.z ?? 0) + (center.dz ?? 0);\n const centerVec3: vec3 = [centerX, centerY, centerZ];\n const z = 1;\n let cameraX = 0;\n let cameraY = 0;\n let cameraZ = 0;\n if (!camera) {\n cameraX = Math.sin(alpha) + centerX;\n cameraY = Math.sin(beta) + centerY;\n cameraZ = Math.cos(alpha) * Math.cos(beta) * z;\n }\n\n this.light = new DirectionalLight(dir, color, ambient);\n const cameraParams = {\n left: 0,\n right: this.width,\n top: 0,\n bottom: this.height,\n fieldRatio: fieldRatio,\n fieldDepth,\n viewParams: {\n pos: [cameraX, cameraY, cameraZ] as vec3,\n center: centerVec3,\n up: [0, 1, 0] as vec3\n }\n };\n if (this.camera) {\n this.camera.params = cameraParams;\n } else {\n this.camera = new OrthoCamera(cameraParams);\n }\n\n if (options.enableView3dTransform) {\n this.enableView3dTransform();\n }\n }\n\n protected beforeRender = (stage: IStage) => {\n this._beforeRender && this._beforeRender(stage);\n };\n\n protected afterRender = (stage: IStage) => {\n this.renderCount++;\n this._afterRender && this._afterRender(stage);\n this._afterNextRenderCbs && this._afterNextRenderCbs.forEach(cb => cb(stage));\n this._afterNextRenderCbs = null;\n };\n\n setBeforeRender(cb: (stage: IStage) => void) {\n this._beforeRender = cb;\n }\n\n setAfterRender(cb: (stage: IStage) => void) {\n this._afterRender = cb;\n }\n\n afterNextRender(cb: (stage: IStage) => void) {\n if (!this._afterNextRenderCbs) {\n this._afterNextRenderCbs = [];\n }\n this._afterNextRenderCbs.push(cb);\n }\n\n enableView3dTransform() {\n if (this.view3dTranform) {\n return;\n }\n this.view3dTranform = true;\n this.pluginService.register(new ViewTransform3dPlugin());\n }\n\n disableView3dTranform() {\n if (!this.view3dTranform) {\n return;\n }\n this.view3dTranform = false;\n this.pluginService.findPluginsByName('ViewTransform3dPlugin').forEach(plugin => {\n plugin.deactivate(this.pluginService);\n });\n }\n\n enableAutoRender() {\n if (this.autoRender) {\n return;\n }\n this.autoRender = true;\n this.pluginService.register(new AutoRenderPlugin());\n }\n disableAutoRender() {\n if (!this.autoRender) {\n return;\n }\n this.autoRender = false;\n this.pluginService.findPluginsByName('AutoRenderPlugin').forEach(plugin => {\n plugin.deactivate(this.pluginService);\n });\n }\n enableIncrementalAutoRender() {\n if (this.increaseAutoRender) {\n return;\n }\n this.increaseAutoRender = true;\n this.pluginService.register(new IncrementalAutoRenderPlugin());\n }\n disableIncrementalAutoRender() {\n if (!this.increaseAutoRender) {\n return;\n }\n this.increaseAutoRender = false;\n this.pluginService.findPluginsByName('IncrementalAutoRenderPlugin').forEach(plugin => {\n plugin.deactivate(this.pluginService);\n });\n }\n enableDirtyBounds() {\n if (this.dirtyBounds) {\n return;\n }\n this.dirtyBounds = new Bounds();\n let plugin = this.pluginService.findPluginsByName('DirtyBoundsPlugin')[0];\n if (!plugin) {\n plugin = new DirtyBoundsPlugin();\n this.pluginService.register(plugin);\n }\n plugin.activate(this.pluginService);\n }\n disableDirtyBounds() {\n if (!this.dirtyBounds) {\n return;\n }\n this.dirtyBounds = null;\n this.pluginService.findPluginsByName('DirtyBoundsPlugin').forEach(plugin => {\n plugin.deactivate(this.pluginService);\n });\n }\n enableLayout() {\n if (this._enableLayout) {\n return;\n }\n this._enableLayout = true;\n this.pluginService.register(new FlexLayoutPlugin());\n }\n disableLayout() {\n if (!this._enableLayout) {\n return;\n }\n this._enableLayout = false;\n this.pluginService.findPluginsByName('FlexLayoutPlugin').forEach(plugin => {\n plugin.deactivate(this.pluginService);\n });\n }\n enableHtmlAttribute(container?: any) {\n if (this.htmlAttribute) {\n return;\n }\n this.htmlAttribute = container;\n this.pluginService.register(new HtmlAttributePlugin());\n }\n disableHtmlAttribute() {\n if (!this.htmlAttribute) {\n return;\n }\n this.htmlAttribute = false;\n this.pluginService.findPluginsByName('HtmlAttributePlugin').forEach(plugin => {\n plugin.deactivate(this.pluginService);\n });\n }\n\n // /**\n // * stage的appendChild,add\n // * @param node\n // * @returns\n // */\n // appendChild<T extends Node>(node: T): T | null {\n // const layer = this.at(0);\n // if (!layer) {\n // return null;\n // }\n // return layer.appendChild<T>(node);\n // }\n\n protected tryUpdateAABBBounds(): AABBBounds {\n const viewBox = this._viewBox;\n this._AABBBounds.setValue(viewBox.x1, viewBox.y1, viewBox.x2, viewBox.y2);\n return this._AABBBounds;\n }\n\n combineLayer(ILayer1: ILayer, ILayer2: ILayer): ILayer {\n throw new Error('暂不支持');\n }\n // 如果传入CanvasId,如果存在相同Id,说明这两个图层使用相同的Canvas绘制\n // 但需要注意的是依然是两个图层(用于解决Table嵌入ChartSpace不影响Table的绘制)\n createLayer(canvasId?: string): ILayer {\n // 创建一个默认layer图层\n const layer = this.layerService.createLayer(this, {\n main: false,\n canvasId\n });\n this.appendChild(layer);\n return layer;\n // const layer = new Layer(this, this.global, this.window, {\n // main: false,\n // canvasId\n // });\n // this.appendChild(layer);\n // return layer;\n }\n sortLayer(cb: (ILayer1: ILayer, layer2: ILayer) => number): void {\n const children = this.children;\n children.sort(cb);\n this.removeAllChild();\n children.forEach(c => {\n this.appendChild(c);\n });\n }\n removeLayer(ILayerId: number): ILayer | false {\n return this.removeChild(this.findChildByUid(ILayerId) as IGraphic) as ILayer;\n }\n tryInitInteractiveLayer() {\n // TODO:顺序可能会存在问题\n // 支持交互层,且没有创建过,那就创建\n if (this.supportInteractiveLayer && !this.interactiveLayer) {\n this.interactiveLayer = this.createLayer();\n this.interactiveLayer.name = '_builtin_interactive';\n this.nextFrameRenderLayerSet.add(this.interactiveLayer as any); // to be fixed\n }\n // this.interactiveLayer.afterDraw(l => {\n // l.removeAllChild();\n // });\n }\n\n clearViewBox(color?: string) {\n this.window.clearViewBox(this._viewBox, color);\n }\n\n render(layers?: ILayer[], params?: Partial<IDrawContext>): void {\n this.ticker.start();\n this.timeline.resume();\n if (!this._skipRender) {\n this.lastRenderparams = params;\n this.hooks.beforeRender.call(this);\n (layers || this).forEach<ILayer>((layer, i) => {\n layer.render(\n {\n renderService: this.renderService,\n background: layer === this.defaultLayer ? this.background : undefined,\n updateBounds: !!this.dirtyBounds\n },\n { renderStyle: this.renderStyle, ...params }\n );\n });\n this.combineLayersToWindow();\n this.nextFrameRenderLayerSet.clear();\n this.hooks.afterRender.call(this);\n }\n this._skipRender && this._skipRender++;\n }\n\n protected combineLayersToWindow() {\n this.forEach<ILayer>((layer, i) => {\n layer.combineTo(this.window, {\n clear: i === 0,\n x: this.x,\n y: this.y,\n width: this.viewWidth,\n height: this.viewHeight,\n renderService: this.renderService,\n background: layer === this.defaultLayer ? this.background : undefined,\n updateBounds: !!this.dirtyBounds\n });\n });\n }\n\n renderNextFrame(layers?: ILayer[]): void {\n // 性能优化,避免重复add\n if (this.nextFrameRenderLayerSet.size !== this.childrenCount) {\n (layers || this).forEach<ILayer>((layer: any) => {\n this.nextFrameRenderLayerSet.add(layer);\n });\n }\n if (!this.willNextFrameRender) {\n this.willNextFrameRender = true;\n this.global.getRequestAnimationFrame()(() => {\n this._doRenderInThisFrame(), (this.willNextFrameRender = false);\n });\n }\n }\n\n _doRenderInThisFrame() {\n this.timeline.resume();\n this.ticker.start();\n if (this.nextFrameRenderLayerSet.size && !this._skipRender) {\n this.hooks.beforeRender.call(this);\n this.forEach((layer: Layer) => {\n if (this.nextFrameRenderLayerSet.has(layer)) {\n layer.render(\n {\n renderService: this.renderService,\n background: layer === this.defaultLayer ? this.background : undefined,\n updateBounds: !!this.dirtyBounds\n },\n { renderStyle: this.renderStyle, ...(this.lastRenderparams || {}) }\n );\n }\n });\n this.combineLayersToWindow();\n this.hooks.afterRender.call(this);\n this.nextFrameRenderLayerSet.clear();\n }\n this._skipRender && this._skipRender++;\n }\n\n resizeWindow(w: number, h: number, rerender: boolean = true) {\n this.window.resize(w, h);\n rerender && this.render();\n }\n\n /**\n * 语法糖,如果viewBox和window宽高一样的话,那么会同时缩放window和viewBox\n * @param w\n * @param h\n * @param rerender\n */\n resize(w: number, h: number, rerender: boolean = true): void {\n this.window.resize(w, h);\n this.forEachChildren<ILayer>(c => {\n c.resize(w, h);\n });\n // 如果不是子图的stage,那么认为用户也想要resize view\n if (!this._subView) {\n this.viewBox.setValue(this.viewBox.x1, this.viewBox.y1, this.viewBox.x1 + w, this.viewBox.y1 + h);\n }\n // 设置camera\n // this.camera && (this.camera.params = { ...this.camera.params, right: this.width, bottom: this.height });\n this.camera && this.option3d && this.set3dOptions(this.option3d);\n rerender && this.render();\n }\n resizeView(w: number, h: number, rerender: boolean = true) {\n this.viewBox.setValue(this.viewBox.x1, this.viewBox.y1, this.viewBox.x1 + w, this.viewBox.y1 + h);\n this.forEachChildren<ILayer>(c => {\n c.resizeView(w, h);\n });\n // 设置camera\n this.camera && (this.camera.params = { ...this.camera.params, right: this.width, bottom: this.height });\n rerender && this.render();\n }\n setViewBox(viewBox: IBoundsLike, rerender: boolean): void;\n setViewBox(x: number, y: number, w: number, h: number, rerender: boolean): void;\n setViewBox(x: number | IBoundsLike, y: number | boolean, w?: number, h?: number, rerender?: boolean): void {\n let isRerender: boolean = true;\n\n if (typeof x === 'object') {\n this.viewBox.setValue(x.x1, x.y1, x.x2, x.y2);\n if (y === false) {\n isRerender = false;\n }\n } else {\n this.viewBox.setValue(x, y as number, x + w, (y as number) + h);\n\n if (rerender === false) {\n isRerender = false;\n }\n }\n\n this.forEachChildren<ILayer>(c => {\n c.resizeView(this.viewBox.width(), this.viewBox.height());\n });\n isRerender && this.render();\n }\n setDpr(dpr: number, rerender: boolean = true): void {\n // this.window.setDpr(dpr);\n this.forEachChildren<ILayer>(c => {\n c.setDpr(dpr);\n });\n\n rerender && this.render();\n }\n setOrigin(x: number, y: number): void {\n throw new Error('暂不支持');\n }\n export(type: IExportType): HTMLCanvasElement | ImageData {\n throw new Error('暂不支持');\n }\n pick(x: number, y: number): { graphic: IGraphic | null; group: IGroup | null } | false {\n // 暂时不提供layer的pick\n const result = this.pickerService.pick(this.children as unknown as IGraphic[], new Point(x, y), {\n bounds: this.AABBBounds\n });\n if (result?.graphic || result?.group) {\n return result;\n }\n return false;\n }\n\n // 动画相关\n startAnimate(t: number): void {\n throw new Error('暂不支持');\n }\n setToFrame(t: number): void {\n throw new Error('暂不支持');\n }\n\n release() {\n super.release();\n this.eventSystem && this.eventSystem.release();\n this.pluginService.release();\n this.forEach(layer => {\n layer.release();\n });\n this.interactiveLayer && this.interactiveLayer.release();\n this.window.release();\n }\n\n setStage(stage?: IStage) {\n return;\n // this.stage = this;\n // this.forEachChildren(item => {\n // (item as Layer).setStage(this);\n // });\n }\n\n /**\n * 添加dirty区域,会修改参数b\n * @param b\n * @param matrix\n */\n dirty(b: IBounds, matrix?: IMatrix) {\n if (matrix) {\n b.transformWithMatrix(matrix);\n }\n if (this.dirtyBounds.empty()) {\n this.dirtyBounds.setValue(b.x1, b.y1, b.x2, b.y2);\n }\n this.dirtyBounds.union(b);\n }\n\n getLayer(name: string): undefined | ILayer {\n const layer = this.children.filter(layer => layer.name === name);\n return layer[0] as ILayer;\n }\n\n renderTo(window: IWindow, params: { x: number; y: number; width: number; height: number }) {\n this.forEachChildren<ILayer>((layer, i) => {\n layer.drawTo(window, {\n ...params,\n renderService: this.renderService,\n background: layer === this.defaultLayer ? this.background : undefined,\n clear: i === 0, // 第一个layer需要clear\n updateBounds: !!this.dirtyBounds\n });\n });\n }\n\n /**\n * 渲染到新的window上去\n * @param fullImage 是否是全量的image,因为可能之前的window有一部分场景树超过window的帧缓冲了\n * @returns\n */\n renderToNewWindow(fullImage: boolean = true, viewBox?: IAABBBounds): IWindow {\n const window = container.get<IWindow>(VWindow);\n if (fullImage) {\n window.create({\n width: this.viewWidth,\n height: this.viewHeight,\n dpr: this.window.dpr,\n canvasControled: true,\n offscreen: true,\n title: ''\n });\n } else {\n const width = viewBox ? viewBox.width() : Math.min(this.viewWidth, this.window.width - this.x);\n const height = viewBox ? viewBox.height() : Math.min(this.viewHeight, this.window.height - this.y);\n window.create({\n width,\n height,\n dpr: this.window.dpr,\n canvasControled: true,\n offscreen: true,\n title: ''\n });\n }\n\n const x = viewBox ? -viewBox.x1 : 0;\n const y = viewBox ? -viewBox.y1 : 0;\n this.renderTo(window, {\n x,\n y,\n width: viewBox ? viewBox.x2 : window.width,\n height: viewBox ? viewBox.y2 : window.height\n });\n return window;\n }\n\n toCanvas(fullImage: boolean = true, viewBox?: IAABBBounds): HTMLCanvasElement | null {\n const window = this.renderToNewWindow(fullImage, viewBox);\n const c = window.getNativeHandler();\n if (c.nativeCanvas) {\n return c.nativeCanvas;\n }\n return null;\n }\n\n setCursor(mode?: string): void {\n this._cursor = mode;\n this.eventSystem.setCursor(mode);\n }\n\n getCursor() {\n return this._cursor;\n }\n}\n"]}