@visactor/vrender-core 0.20.0-alpha.1 → 0.20.0-alpha.2

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 (410) hide show
  1. package/cjs/animate/Ticker/default-ticker.d.ts +2 -53
  2. package/cjs/animate/Ticker/default-ticker.js +17 -130
  3. package/cjs/animate/Ticker/default-ticker.js.map +1 -1
  4. package/cjs/animate/Ticker/index.d.ts +4 -0
  5. package/cjs/animate/Ticker/index.js +3 -1
  6. package/cjs/animate/Ticker/index.js.map +1 -1
  7. package/cjs/animate/Ticker/manual-ticker-handler.d.ts +15 -0
  8. package/cjs/animate/Ticker/manual-ticker-handler.js +36 -0
  9. package/cjs/animate/Ticker/manual-ticker-handler.js.map +1 -0
  10. package/cjs/animate/Ticker/manual-ticker.d.ts +19 -0
  11. package/cjs/animate/Ticker/manual-ticker.js +37 -0
  12. package/cjs/animate/Ticker/manual-ticker.js.map +1 -0
  13. package/cjs/animate/Ticker/raf-tick-handler.d.ts +9 -0
  14. package/cjs/animate/Ticker/raf-tick-handler.js +30 -0
  15. package/cjs/animate/Ticker/raf-tick-handler.js.map +1 -0
  16. package/cjs/animate/Ticker/timeout-tick-handler.d.ts +9 -0
  17. package/cjs/animate/Ticker/timeout-tick-handler.js +28 -0
  18. package/cjs/animate/Ticker/timeout-tick-handler.js.map +1 -0
  19. package/cjs/animate/Ticker/type.d.ts +6 -0
  20. package/cjs/animate/Ticker/type.js +11 -0
  21. package/cjs/animate/Ticker/type.js.map +1 -0
  22. package/cjs/canvas/conical-gradient.js.map +1 -1
  23. package/cjs/canvas/contributions/base-canvas.js +4 -13
  24. package/cjs/canvas/contributions/base-canvas.js.map +1 -1
  25. package/cjs/common/3d-interceptor.js +1 -2
  26. package/cjs/common/bounds-context.js +2 -1
  27. package/cjs/common/morphing-utils.js +1 -1
  28. package/cjs/common/path-svg.js +1 -1
  29. package/cjs/common/polygon.js +2 -2
  30. package/cjs/common/rect-utils.js +1 -1
  31. package/cjs/common/render-area.js +1 -1
  32. package/cjs/common/render-command-list.js +1 -2
  33. package/cjs/common/render-curve.js +1 -1
  34. package/cjs/common/render-utils.js +1 -1
  35. package/cjs/common/seg-context.js +1 -1
  36. package/cjs/common/segment/catmull-rom-close.d.ts +41 -0
  37. package/cjs/common/segment/catmull-rom-close.js +81 -0
  38. package/cjs/common/segment/catmull-rom-close.js.map +1 -0
  39. package/cjs/common/segment/catmull-rom.d.ts +38 -0
  40. package/cjs/common/segment/catmull-rom.js +97 -0
  41. package/cjs/common/segment/catmull-rom.js.map +1 -0
  42. package/cjs/common/segment/index.d.ts +5 -2
  43. package/cjs/common/segment/index.js +8 -1
  44. package/cjs/common/segment/index.js.map +1 -1
  45. package/cjs/common/simplify.js +1 -1
  46. package/cjs/common/sort.js +1 -1
  47. package/cjs/common/split-path.js +1 -1
  48. package/cjs/common/store.js +1 -1
  49. package/cjs/common/text.js +4 -3
  50. package/cjs/common/text.js.map +1 -1
  51. package/cjs/core/application.js +2 -1
  52. package/cjs/core/camera.js +1 -1
  53. package/cjs/core/constants.js +1 -1
  54. package/cjs/core/contributions/layerHandler/modules.js +2 -5
  55. package/cjs/core/contributions/layerHandler/modules.js.map +1 -1
  56. package/cjs/core/core-modules.js +1 -1
  57. package/cjs/core/global-module.js +2 -0
  58. package/cjs/core/global.js +1 -1
  59. package/cjs/core/graphic-utils.js +1 -1
  60. package/cjs/core/index.js +1 -1
  61. package/cjs/core/layer-service.js +1 -1
  62. package/cjs/core/layer.js +1 -1
  63. package/cjs/core/light.js +1 -1
  64. package/cjs/core/stage.d.ts +2 -2
  65. package/cjs/core/stage.js +10 -4
  66. package/cjs/core/stage.js.map +1 -1
  67. package/cjs/core/window.js +1 -1
  68. package/cjs/event/federated-event/base-event.js +12 -2
  69. package/cjs/event/federated-event/base-event.js.map +1 -1
  70. package/cjs/graphic/arc.d.ts +6 -4
  71. package/cjs/graphic/arc.js +46 -17
  72. package/cjs/graphic/arc.js.map +1 -1
  73. package/cjs/graphic/arc3d.d.ts +2 -2
  74. package/cjs/graphic/arc3d.js +8 -9
  75. package/cjs/graphic/arc3d.js.map +1 -1
  76. package/cjs/graphic/area.d.ts +5 -3
  77. package/cjs/graphic/area.js +27 -12
  78. package/cjs/graphic/area.js.map +1 -1
  79. package/cjs/graphic/builtin-symbol/index.d.ts +1 -1
  80. package/cjs/graphic/builtin-symbol/thin-triangle.d.ts +2 -2
  81. package/cjs/graphic/builtin-symbol/thin-triangle.js +2 -2
  82. package/cjs/graphic/builtin-symbol/thin-triangle.js.map +1 -1
  83. package/cjs/graphic/builtin-symbol/triangle-down.d.ts +1 -2
  84. package/cjs/graphic/builtin-symbol/triangle-down.js +4 -9
  85. package/cjs/graphic/builtin-symbol/triangle-down.js.map +1 -1
  86. package/cjs/graphic/builtin-symbol/triangle-left.d.ts +0 -1
  87. package/cjs/graphic/builtin-symbol/triangle-left.js +3 -8
  88. package/cjs/graphic/builtin-symbol/triangle-left.js.map +1 -1
  89. package/cjs/graphic/builtin-symbol/triangle-right.d.ts +1 -2
  90. package/cjs/graphic/builtin-symbol/triangle-right.js +4 -9
  91. package/cjs/graphic/builtin-symbol/triangle-right.js.map +1 -1
  92. package/cjs/graphic/builtin-symbol/triangle-up.d.ts +1 -2
  93. package/cjs/graphic/builtin-symbol/triangle-up.js +4 -9
  94. package/cjs/graphic/builtin-symbol/triangle-up.js.map +1 -1
  95. package/cjs/graphic/builtin-symbol/triangle.d.ts +1 -2
  96. package/cjs/graphic/builtin-symbol/triangle.js +1 -3
  97. package/cjs/graphic/builtin-symbol/triangle.js.map +1 -1
  98. package/cjs/graphic/circle.d.ts +5 -3
  99. package/cjs/graphic/circle.js +20 -12
  100. package/cjs/graphic/circle.js.map +1 -1
  101. package/cjs/graphic/config.js +6 -3
  102. package/cjs/graphic/config.js.map +1 -1
  103. package/cjs/graphic/glyph.d.ts +4 -2
  104. package/cjs/graphic/glyph.js +9 -2
  105. package/cjs/graphic/glyph.js.map +1 -1
  106. package/cjs/graphic/graphic-creator.js.map +1 -1
  107. package/cjs/graphic/graphic-service/common-outer-boder-bounds.d.ts +3 -0
  108. package/cjs/graphic/graphic-service/common-outer-boder-bounds.js +17 -0
  109. package/cjs/graphic/graphic-service/common-outer-boder-bounds.js.map +1 -0
  110. package/cjs/graphic/graphic-service/graphic-service.d.ts +7 -36
  111. package/cjs/graphic/graphic-service/graphic-service.js +11 -296
  112. package/cjs/graphic/graphic-service/graphic-service.js.map +1 -1
  113. package/cjs/graphic/graphic-service/symbol-outer-border-bounds.d.ts +3 -0
  114. package/cjs/graphic/graphic-service/symbol-outer-border-bounds.js +17 -0
  115. package/cjs/graphic/graphic-service/symbol-outer-border-bounds.js.map +1 -0
  116. package/cjs/graphic/graphic.d.ts +12 -9
  117. package/cjs/graphic/graphic.js +17 -2
  118. package/cjs/graphic/graphic.js.map +1 -1
  119. package/cjs/graphic/group.d.ts +7 -3
  120. package/cjs/graphic/group.js +34 -22
  121. package/cjs/graphic/group.js.map +1 -1
  122. package/cjs/graphic/image.d.ts +3 -2
  123. package/cjs/graphic/image.js +14 -9
  124. package/cjs/graphic/image.js.map +1 -1
  125. package/cjs/graphic/line.d.ts +5 -3
  126. package/cjs/graphic/line.js +24 -11
  127. package/cjs/graphic/line.js.map +1 -1
  128. package/cjs/graphic/node-tree.js.map +1 -1
  129. package/cjs/graphic/path.d.ts +3 -3
  130. package/cjs/graphic/path.js +17 -13
  131. package/cjs/graphic/path.js.map +1 -1
  132. package/cjs/graphic/polygon.d.ts +4 -3
  133. package/cjs/graphic/polygon.js +16 -11
  134. package/cjs/graphic/polygon.js.map +1 -1
  135. package/cjs/graphic/pyramid3d.d.ts +2 -2
  136. package/cjs/graphic/pyramid3d.js +10 -9
  137. package/cjs/graphic/pyramid3d.js.map +1 -1
  138. package/cjs/graphic/rect.d.ts +3 -3
  139. package/cjs/graphic/rect.js +16 -12
  140. package/cjs/graphic/rect.js.map +1 -1
  141. package/cjs/graphic/rect3d.js +2 -2
  142. package/cjs/graphic/rect3d.js.map +1 -1
  143. package/cjs/graphic/richtext/icon.d.ts +2 -2
  144. package/cjs/graphic/richtext/icon.js.map +1 -1
  145. package/cjs/graphic/richtext.d.ts +3 -3
  146. package/cjs/graphic/richtext.js +44 -12
  147. package/cjs/graphic/richtext.js.map +1 -1
  148. package/cjs/graphic/shadow-root.d.ts +2 -2
  149. package/cjs/graphic/shadow-root.js.map +1 -1
  150. package/cjs/graphic/symbol.d.ts +5 -3
  151. package/cjs/graphic/symbol.js +25 -12
  152. package/cjs/graphic/symbol.js.map +1 -1
  153. package/cjs/graphic/text.d.ts +10 -10
  154. package/cjs/graphic/text.js +26 -20
  155. package/cjs/graphic/text.js.map +1 -1
  156. package/cjs/graphic/theme.js.map +1 -1
  157. package/cjs/graphic/wrap-text.d.ts +1 -1
  158. package/cjs/graphic/wrap-text.js +2 -2
  159. package/cjs/graphic/wrap-text.js.map +1 -1
  160. package/cjs/index.d.ts +2 -0
  161. package/cjs/index.js +3 -1
  162. package/cjs/index.js.map +1 -1
  163. package/cjs/interface/graphic/arc.d.ts +2 -2
  164. package/cjs/interface/graphic/arc.js.map +1 -1
  165. package/cjs/interface/graphic/arc3d.d.ts +1 -1
  166. package/cjs/interface/graphic/arc3d.js.map +1 -1
  167. package/cjs/interface/graphic/area.d.ts +1 -0
  168. package/cjs/interface/graphic/area.js.map +1 -1
  169. package/cjs/interface/graphic/line.d.ts +1 -0
  170. package/cjs/interface/graphic/line.js.map +1 -1
  171. package/cjs/interface/graphic-service.d.ts +10 -17
  172. package/cjs/interface/graphic-service.js.map +1 -1
  173. package/cjs/interface/graphic.d.ts +2 -0
  174. package/cjs/interface/graphic.js.map +1 -1
  175. package/cjs/picker/pick-interceptor.js +5 -3
  176. package/cjs/picker/pick-interceptor.js.map +1 -1
  177. package/cjs/plugins/builtin-plugin/3dview-transform-plugin.d.ts +1 -0
  178. package/cjs/plugins/builtin-plugin/3dview-transform-plugin.js +8 -2
  179. package/cjs/plugins/builtin-plugin/3dview-transform-plugin.js.map +1 -1
  180. package/cjs/plugins/builtin-plugin/flex-layout-plugin.d.ts +1 -0
  181. package/cjs/plugins/builtin-plugin/flex-layout-plugin.js +8 -2
  182. package/cjs/plugins/builtin-plugin/flex-layout-plugin.js.map +1 -1
  183. package/cjs/plugins/builtin-plugin/html-attribute-plugin.js +1 -1
  184. package/cjs/plugins/builtin-plugin/html-attribute-plugin.js.map +1 -1
  185. package/cjs/render/contributions/render/arc-render.js +15 -28
  186. package/cjs/render/contributions/render/arc-render.js.map +1 -1
  187. package/cjs/render/contributions/render/area-render.js +11 -6
  188. package/cjs/render/contributions/render/area-render.js.map +1 -1
  189. package/cjs/render/contributions/render/base-render.d.ts +1 -1
  190. package/cjs/render/contributions/render/base-render.js.map +1 -1
  191. package/cjs/render/contributions/render/index.d.ts +1 -0
  192. package/cjs/render/contributions/render/index.js +3 -3
  193. package/cjs/render/contributions/render/index.js.map +1 -1
  194. package/cjs/render/contributions/render/line-render.js +6 -3
  195. package/cjs/render/contributions/render/line-render.js.map +1 -1
  196. package/cjs/render/contributions/render/utils.d.ts +24 -0
  197. package/cjs/render/contributions/render/utils.js +56 -23
  198. package/cjs/render/contributions/render/utils.js.map +1 -1
  199. package/dist/index.es.js +6920 -7087
  200. package/es/animate/Ticker/default-ticker.d.ts +2 -53
  201. package/es/animate/Ticker/default-ticker.js +3 -106
  202. package/es/animate/Ticker/default-ticker.js.map +1 -1
  203. package/es/animate/Ticker/index.d.ts +4 -0
  204. package/es/animate/Ticker/index.js +8 -0
  205. package/es/animate/Ticker/index.js.map +1 -1
  206. package/es/animate/Ticker/manual-ticker-handler.d.ts +15 -0
  207. package/es/animate/Ticker/manual-ticker-handler.js +28 -0
  208. package/es/animate/Ticker/manual-ticker-handler.js.map +1 -0
  209. package/es/animate/Ticker/manual-ticker.d.ts +19 -0
  210. package/es/animate/Ticker/manual-ticker.js +31 -0
  211. package/es/animate/Ticker/manual-ticker.js.map +1 -0
  212. package/es/animate/Ticker/raf-tick-handler.d.ts +9 -0
  213. package/es/animate/Ticker/raf-tick-handler.js +22 -0
  214. package/es/animate/Ticker/raf-tick-handler.js.map +1 -0
  215. package/es/animate/Ticker/timeout-tick-handler.d.ts +9 -0
  216. package/es/animate/Ticker/timeout-tick-handler.js +20 -0
  217. package/es/animate/Ticker/timeout-tick-handler.js.map +1 -0
  218. package/es/animate/Ticker/type.d.ts +6 -0
  219. package/es/animate/Ticker/type.js +7 -0
  220. package/es/animate/Ticker/type.js.map +1 -0
  221. package/es/canvas/conical-gradient.js.map +1 -1
  222. package/es/canvas/contributions/base-canvas.js +3 -15
  223. package/es/canvas/contributions/base-canvas.js.map +1 -1
  224. package/es/common/3d-interceptor.js +1 -2
  225. package/es/common/bounds-context.js +2 -1
  226. package/es/common/morphing-utils.js +1 -1
  227. package/es/common/path-svg.js +1 -1
  228. package/es/common/polygon.js +1 -1
  229. package/es/common/rect-utils.js +1 -1
  230. package/es/common/render-area.js +1 -1
  231. package/es/common/render-command-list.js +1 -2
  232. package/es/common/render-curve.js +1 -1
  233. package/es/common/render-utils.js +1 -1
  234. package/es/common/seg-context.js +1 -1
  235. package/es/common/segment/catmull-rom-close.d.ts +41 -0
  236. package/es/common/segment/catmull-rom-close.js +74 -0
  237. package/es/common/segment/catmull-rom-close.js.map +1 -0
  238. package/es/common/segment/catmull-rom.d.ts +38 -0
  239. package/es/common/segment/catmull-rom.js +92 -0
  240. package/es/common/segment/catmull-rom.js.map +1 -0
  241. package/es/common/segment/index.d.ts +5 -2
  242. package/es/common/segment/index.js +11 -0
  243. package/es/common/segment/index.js.map +1 -1
  244. package/es/common/simplify.js +1 -1
  245. package/es/common/sort.js +1 -1
  246. package/es/common/split-path.js +1 -1
  247. package/es/common/store.js +1 -1
  248. package/es/common/text.js +5 -4
  249. package/es/common/text.js.map +1 -1
  250. package/es/core/application.js +2 -1
  251. package/es/core/camera.js +1 -1
  252. package/es/core/constants.js +1 -1
  253. package/es/core/contributions/layerHandler/modules.js +2 -9
  254. package/es/core/contributions/layerHandler/modules.js.map +1 -1
  255. package/es/core/core-modules.js +1 -1
  256. package/es/core/global-module.js +2 -0
  257. package/es/core/global.js +1 -1
  258. package/es/core/graphic-utils.js +1 -1
  259. package/es/core/index.js +1 -1
  260. package/es/core/layer-service.js +1 -1
  261. package/es/core/layer.js +1 -1
  262. package/es/core/light.js +1 -1
  263. package/es/core/stage.d.ts +2 -2
  264. package/es/core/stage.js +9 -7
  265. package/es/core/stage.js.map +1 -1
  266. package/es/core/window.js +1 -1
  267. package/es/event/federated-event/base-event.js +12 -2
  268. package/es/event/federated-event/base-event.js.map +1 -1
  269. package/es/graphic/arc.d.ts +6 -4
  270. package/es/graphic/arc.js +47 -16
  271. package/es/graphic/arc.js.map +1 -1
  272. package/es/graphic/arc3d.d.ts +2 -2
  273. package/es/graphic/arc3d.js +7 -10
  274. package/es/graphic/arc3d.js.map +1 -1
  275. package/es/graphic/area.d.ts +5 -3
  276. package/es/graphic/area.js +28 -11
  277. package/es/graphic/area.js.map +1 -1
  278. package/es/graphic/builtin-symbol/index.d.ts +1 -1
  279. package/es/graphic/builtin-symbol/thin-triangle.d.ts +2 -2
  280. package/es/graphic/builtin-symbol/thin-triangle.js +2 -2
  281. package/es/graphic/builtin-symbol/thin-triangle.js.map +1 -1
  282. package/es/graphic/builtin-symbol/triangle-down.d.ts +1 -2
  283. package/es/graphic/builtin-symbol/triangle-down.js +2 -7
  284. package/es/graphic/builtin-symbol/triangle-down.js.map +1 -1
  285. package/es/graphic/builtin-symbol/triangle-left.d.ts +0 -1
  286. package/es/graphic/builtin-symbol/triangle-left.js +1 -6
  287. package/es/graphic/builtin-symbol/triangle-left.js.map +1 -1
  288. package/es/graphic/builtin-symbol/triangle-right.d.ts +1 -2
  289. package/es/graphic/builtin-symbol/triangle-right.js +2 -7
  290. package/es/graphic/builtin-symbol/triangle-right.js.map +1 -1
  291. package/es/graphic/builtin-symbol/triangle-up.d.ts +1 -2
  292. package/es/graphic/builtin-symbol/triangle-up.js +2 -7
  293. package/es/graphic/builtin-symbol/triangle-up.js.map +1 -1
  294. package/es/graphic/builtin-symbol/triangle.d.ts +1 -2
  295. package/es/graphic/builtin-symbol/triangle.js +1 -3
  296. package/es/graphic/builtin-symbol/triangle.js.map +1 -1
  297. package/es/graphic/circle.d.ts +5 -3
  298. package/es/graphic/circle.js +23 -9
  299. package/es/graphic/circle.js.map +1 -1
  300. package/es/graphic/config.js +6 -3
  301. package/es/graphic/config.js.map +1 -1
  302. package/es/graphic/glyph.d.ts +4 -2
  303. package/es/graphic/glyph.js +9 -1
  304. package/es/graphic/glyph.js.map +1 -1
  305. package/es/graphic/graphic-creator.js.map +1 -1
  306. package/es/graphic/graphic-service/common-outer-boder-bounds.d.ts +3 -0
  307. package/es/graphic/graphic-service/common-outer-boder-bounds.js +9 -0
  308. package/es/graphic/graphic-service/common-outer-boder-bounds.js.map +1 -0
  309. package/es/graphic/graphic-service/graphic-service.d.ts +7 -36
  310. package/es/graphic/graphic-service/graphic-service.js +11 -297
  311. package/es/graphic/graphic-service/graphic-service.js.map +1 -1
  312. package/es/graphic/graphic-service/symbol-outer-border-bounds.d.ts +3 -0
  313. package/es/graphic/graphic-service/symbol-outer-border-bounds.js +11 -0
  314. package/es/graphic/graphic-service/symbol-outer-border-bounds.js.map +1 -0
  315. package/es/graphic/graphic.d.ts +12 -9
  316. package/es/graphic/graphic.js +20 -3
  317. package/es/graphic/graphic.js.map +1 -1
  318. package/es/graphic/group.d.ts +7 -3
  319. package/es/graphic/group.js +32 -22
  320. package/es/graphic/group.js.map +1 -1
  321. package/es/graphic/image.d.ts +3 -2
  322. package/es/graphic/image.js +15 -8
  323. package/es/graphic/image.js.map +1 -1
  324. package/es/graphic/line.d.ts +5 -3
  325. package/es/graphic/line.js +25 -10
  326. package/es/graphic/line.js.map +1 -1
  327. package/es/graphic/node-tree.js.map +1 -1
  328. package/es/graphic/path.d.ts +3 -3
  329. package/es/graphic/path.js +18 -12
  330. package/es/graphic/path.js.map +1 -1
  331. package/es/graphic/polygon.d.ts +4 -3
  332. package/es/graphic/polygon.js +17 -10
  333. package/es/graphic/polygon.js.map +1 -1
  334. package/es/graphic/pyramid3d.d.ts +2 -2
  335. package/es/graphic/pyramid3d.js +8 -10
  336. package/es/graphic/pyramid3d.js.map +1 -1
  337. package/es/graphic/rect.d.ts +3 -3
  338. package/es/graphic/rect.js +16 -10
  339. package/es/graphic/rect.js.map +1 -1
  340. package/es/graphic/rect3d.js +1 -3
  341. package/es/graphic/rect3d.js.map +1 -1
  342. package/es/graphic/richtext/icon.d.ts +2 -2
  343. package/es/graphic/richtext/icon.js.map +1 -1
  344. package/es/graphic/richtext.d.ts +3 -3
  345. package/es/graphic/richtext.js +43 -11
  346. package/es/graphic/richtext.js.map +1 -1
  347. package/es/graphic/shadow-root.d.ts +2 -2
  348. package/es/graphic/shadow-root.js.map +1 -1
  349. package/es/graphic/symbol.d.ts +5 -3
  350. package/es/graphic/symbol.js +26 -11
  351. package/es/graphic/symbol.js.map +1 -1
  352. package/es/graphic/text.d.ts +10 -10
  353. package/es/graphic/text.js +27 -22
  354. package/es/graphic/text.js.map +1 -1
  355. package/es/graphic/theme.js.map +1 -1
  356. package/es/graphic/wrap-text.d.ts +1 -1
  357. package/es/graphic/wrap-text.js +1 -3
  358. package/es/graphic/wrap-text.js.map +1 -1
  359. package/es/index.d.ts +2 -0
  360. package/es/index.js +4 -0
  361. package/es/index.js.map +1 -1
  362. package/es/interface/graphic/arc.d.ts +2 -2
  363. package/es/interface/graphic/arc.js.map +1 -1
  364. package/es/interface/graphic/arc3d.d.ts +1 -1
  365. package/es/interface/graphic/arc3d.js.map +1 -1
  366. package/es/interface/graphic/area.d.ts +1 -0
  367. package/es/interface/graphic/area.js.map +1 -1
  368. package/es/interface/graphic/line.d.ts +1 -0
  369. package/es/interface/graphic/line.js.map +1 -1
  370. package/es/interface/graphic-service.d.ts +10 -17
  371. package/es/interface/graphic-service.js.map +1 -1
  372. package/es/interface/graphic.d.ts +2 -0
  373. package/es/interface/graphic.js.map +1 -1
  374. package/es/picker/pick-interceptor.js +6 -2
  375. package/es/picker/pick-interceptor.js.map +1 -1
  376. package/es/plugins/builtin-plugin/3dview-transform-plugin.d.ts +1 -0
  377. package/es/plugins/builtin-plugin/3dview-transform-plugin.js +6 -0
  378. package/es/plugins/builtin-plugin/3dview-transform-plugin.js.map +1 -1
  379. package/es/plugins/builtin-plugin/flex-layout-plugin.d.ts +1 -0
  380. package/es/plugins/builtin-plugin/flex-layout-plugin.js +6 -0
  381. package/es/plugins/builtin-plugin/flex-layout-plugin.js.map +1 -1
  382. package/es/plugins/builtin-plugin/html-attribute-plugin.js +1 -1
  383. package/es/plugins/builtin-plugin/html-attribute-plugin.js.map +1 -1
  384. package/es/render/contributions/render/arc-render.js +10 -16
  385. package/es/render/contributions/render/arc-render.js.map +1 -1
  386. package/es/render/contributions/render/area-render.js +11 -5
  387. package/es/render/contributions/render/area-render.js.map +1 -1
  388. package/es/render/contributions/render/base-render.d.ts +1 -1
  389. package/es/render/contributions/render/base-render.js.map +1 -1
  390. package/es/render/contributions/render/index.d.ts +1 -0
  391. package/es/render/contributions/render/index.js +2 -0
  392. package/es/render/contributions/render/index.js.map +1 -1
  393. package/es/render/contributions/render/line-render.js +6 -3
  394. package/es/render/contributions/render/line-render.js.map +1 -1
  395. package/es/render/contributions/render/utils.d.ts +24 -0
  396. package/es/render/contributions/render/utils.js +46 -15
  397. package/es/render/contributions/render/utils.js.map +1 -1
  398. package/package.json +4 -4
  399. package/cjs/graphic/graphic-service/common-contribution.d.ts +0 -5
  400. package/cjs/graphic/graphic-service/common-contribution.js +0 -19
  401. package/cjs/graphic/graphic-service/common-contribution.js.map +0 -1
  402. package/cjs/graphic/graphic-service/symbol-contribution.d.ts +0 -6
  403. package/cjs/graphic/graphic-service/symbol-contribution.js +0 -21
  404. package/cjs/graphic/graphic-service/symbol-contribution.js.map +0 -1
  405. package/es/graphic/graphic-service/common-contribution.d.ts +0 -5
  406. package/es/graphic/graphic-service/common-contribution.js +0 -11
  407. package/es/graphic/graphic-service/common-contribution.js.map +0 -1
  408. package/es/graphic/graphic-service/symbol-contribution.d.ts +0 -6
  409. package/es/graphic/graphic-service/symbol-contribution.js +0 -15
  410. package/es/graphic/graphic-service/symbol-contribution.js.map +0 -1
@@ -1,11 +1,6 @@
1
1
  import { BaseSymbol } from "./base";
2
2
 
3
- export function trianglRight(ctx, r, x, y) {
4
- return ctx.moveTo(x - r, r + y), ctx.lineTo(r + x, y), ctx.lineTo(x - r, y - r),
5
- ctx.closePath(), !0;
6
- }
7
-
8
- export function trianglRightOffset(ctx, r, x, y, offset) {
3
+ export function trianglRightOffset(ctx, r, x, y, offset = 0) {
9
4
  return ctx.moveTo(x - r - offset, r + y + 2 * offset), ctx.lineTo(r + x + 2 * offset, y),
10
5
  ctx.lineTo(x - r - offset, y - r - 2 * offset), ctx.closePath(), !0;
11
6
  }
@@ -15,7 +10,7 @@ export class TriangleRightSymbol extends BaseSymbol {
15
10
  super(...arguments), this.type = "triangleRight", this.pathStr = "M-0.5,0.5 L0.5,0 L-0.5,-0.5 Z";
16
11
  }
17
12
  draw(ctx, size, x, y) {
18
- return trianglRight(ctx, size / 2, x, y);
13
+ return trianglRightOffset(ctx, size / 2, x, y);
19
14
  }
20
15
  drawOffset(ctx, size, x, y, offset) {
21
16
  return trianglRightOffset(ctx, size / 2, x, y, offset);
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/graphic/builtin-symbol/triangle-right.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAqBpC,MAAM,UAAU,YAAY,CAAC,GAAe,EAAE,CAAS,EAAE,CAAS,EAAE,CAAS;IAC3E,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACzB,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;IACrB,GAAG,CAAC,MAAM,CAAC,CAAC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ounds } from '@visactor/vutils';\nimport type { IContext2d, SymbolType, ISymbolClass } from '../../interface';\nimport { BaseSymbol } from './base';\n\n/**\n * \n *Copyright 2010-2021 Mike Bostock\n\n Permission to use, copy, modify, and/or distribute this software for any purpose\n with or without fee is hereby granted, provided that the above copyright notice\n and this permission notice appear in all copies.\n\n THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND\n FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS\n OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER\n TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF\n THIS SOFTWARE.\n */\n// 借鉴自d3\n// https://github.com/d3/d3-shape/blob/main/src/symbol/triangle.js\n\nexport function trianglRight(ctx: IContext2d, r: number, x: number, y: number) {\n ctx.moveTo(x - r, r + y);\n ctx.lineTo(r + x, y);\n ctx.lineTo(x - r, y - r);\n ctx.closePath();\n return true;\n}\n\nexport function trianglRightOffset(ctx: IContext2d, r: number, x: number, y: number, offset: number) {\n ctx.moveTo(x - r - offset, r + y + 2 * offset);\n ctx.lineTo(r + x + 2 * offset, y);\n ctx.lineTo(x - r - offset, y - r - 2 * offset);\n ctx.closePath();\n return true;\n}\n\n// 以中心为锚点,size为circle外接正方形的面积\nexport class TriangleRightSymbol extends BaseSymbol implements ISymbolClass {\n type: SymbolType = 'triangleRight';\n pathStr: string = 'M-0.5,0.5 L0.5,0 L-0.5,-0.5 Z';\n\n draw(ctx: IContext2d, size: number, x: number, y: number) {\n const r = size / 2;\n return trianglRight(ctx, r, x, y);\n }\n\n drawOffset(ctx: IContext2d, size: number, x: number, y: number, offset: number) {\n const r = size / 2;\n return trianglRightOffset(ctx, r, x, y, offset);\n }\n}\n\nexport default new TriangleRightSymbol();\n"]}
1
+ {"version":3,"sources":["../src/graphic/builtin-symbol/triangle-right.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAqBpC,MAAM,UAAU,kBAAkB,CAAC,GAAe,EAAE,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,SAAiB,CAAC;IACrG,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,CAAC;IAC/C,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,MAAM,EAAE,CAAC,CAAC,CAAC;IAClC,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,CAAC;IAC/C,GAAG,CAAC,SAAS,EAAE,CAAC;IAChB,OAAO,IAAI,CAAC;AACd,CAAC;AAGD,MAAM,OAAO,mBAAoB,SAAQ,UAAU;IAAnD;;QACE,SAAI,GAAe,eAAe,CAAC;QACnC,YAAO,GAAW,+BAA+B,CAAC;IAWpD,CAAC;IATC,IAAI,CAAC,GAAe,EAAE,IAAY,EAAE,CAAS,EAAE,CAAS;QACtD,MAAM,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC;QACnB,OAAO,kBAAkB,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAC1C,CAAC;IAED,UAAU,CAAC,GAAe,EAAE,IAAY,EAAE,CAAS,EAAE,CAAS,EAAE,MAAc;QAC5E,MAAM,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC;QACnB,OAAO,kBAAkB,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC;IAClD,CAAC;CACF;AAED,eAAe,IAAI,mBAAmB,EAAE,CAAC","file":"triangle-right.js","sourcesContent":["import type { IBounds } from '@visactor/vutils';\nimport type { IContext2d, SymbolType, ISymbolClass } from '../../interface';\nimport { BaseSymbol } from './base';\n\n/**\n * \n *Copyright 2010-2021 Mike Bostock\n\n Permission to use, copy, modify, and/or distribute this software for any purpose\n with or without fee is hereby granted, provided that the above copyright notice\n and this permission notice appear in all copies.\n\n THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND\n FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS\n OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER\n TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF\n THIS SOFTWARE.\n */\n// 借鉴自d3\n// https://github.com/d3/d3-shape/blob/main/src/symbol/triangle.js\n\nexport function trianglRightOffset(ctx: IContext2d, r: number, x: number, y: number, offset: number = 0) {\n ctx.moveTo(x - r - offset, r + y + 2 * offset);\n ctx.lineTo(r + x + 2 * offset, y);\n ctx.lineTo(x - r - offset, y - r - 2 * offset);\n ctx.closePath();\n return true;\n}\n\n// 以中心为锚点,size为circle外接正方形的面积\nexport class TriangleRightSymbol extends BaseSymbol implements ISymbolClass {\n type: SymbolType = 'triangleRight';\n pathStr: string = 'M-0.5,0.5 L0.5,0 L-0.5,-0.5 Z';\n\n draw(ctx: IContext2d, size: number, x: number, y: number) {\n const r = size / 2;\n return trianglRightOffset(ctx, r, x, y);\n }\n\n drawOffset(ctx: IContext2d, size: number, x: number, y: number, offset: number) {\n const r = size / 2;\n return trianglRightOffset(ctx, r, x, y, offset);\n }\n}\n\nexport default new TriangleRightSymbol();\n"]}
@@ -1,7 +1,6 @@
1
1
  import type { IContext2d, SymbolType, ISymbolClass } from '../../interface';
2
2
  import { BaseSymbol } from './base';
3
- export declare function trianglUp(ctx: IContext2d, r: number, x: number, y: number): boolean;
4
- export declare function trianglUpOffset(ctx: IContext2d, r: number, x: number, y: number, offset: number): boolean;
3
+ export declare function trianglUpOffset(ctx: IContext2d, r: number, x: number, y: number, offset?: number): boolean;
5
4
  export declare class TriangleUpSymbol extends BaseSymbol implements ISymbolClass {
6
5
  type: SymbolType;
7
6
  pathStr: string;
@@ -1,11 +1,6 @@
1
1
  import { BaseSymbol } from "./base";
2
2
 
3
- export function trianglUp(ctx, r, x, y) {
4
- return ctx.moveTo(x + r, r + y), ctx.lineTo(x - r, r + y), ctx.lineTo(x, y - r),
5
- ctx.closePath(), !0;
6
- }
7
-
8
- export function trianglUpOffset(ctx, r, x, y, offset) {
3
+ export function trianglUpOffset(ctx, r, x, y, offset = 0) {
9
4
  return ctx.moveTo(x + r + 2 * offset, r + y + offset), ctx.lineTo(x - r - 2 * offset, r + y + offset),
10
5
  ctx.lineTo(x, y - r - 2 * offset), ctx.closePath(), !0;
11
6
  }
@@ -15,7 +10,7 @@ export class TriangleUpSymbol extends BaseSymbol {
15
10
  super(...arguments), this.type = "triangleUp", this.pathStr = "M0.5,0.5 L-0.5,0.5 L0,-0.5 Z";
16
11
  }
17
12
  draw(ctx, size, x, y) {
18
- return trianglUp(ctx, size / 2, x, y);
13
+ return trianglUpOffset(ctx, size / 2, x, y);
19
14
  }
20
15
  drawOffset(ctx, size, x, y, offset) {
21
16
  return trianglUpOffset(ctx, size / 2, x, y, offset);
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/graphic/builtin-symbol/triangle-up.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAqBpC,MAAM,UAAU,SAAS,CAAC,GAAe,EAAE,CAA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AAM,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC;QACnB,OAAO,eAAe,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC;IAC/C,CAAC;CACF;AAED,eAAe,IAAI,gBAAgB,EAAE,CAAC","file":"triangle-up.js","sourcesContent":["import type { IBounds } from '@visactor/vutils';\nimport type { IContext2d, SymbolType, ISymbolClass } from '../../interface';\nimport { BaseSymbol } from './base';\n\n/**\n * \n *Copyright 2010-2021 Mike Bostock\n\n Permission to use, copy, modify, and/or distribute this software for any purpose\n with or without fee is hereby granted, provided that the above copyright notice\n and this permission notice appear in all copies.\n\n THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND\n FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS\n OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER\n TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF\n THIS SOFTWARE.\n */\n// 借鉴自d3\n// https://github.com/d3/d3-shape/blob/main/src/symbol/triangle.js\n\nexport function trianglUp(ctx: IContext2d, r: number, x: number, y: number) {\n ctx.moveTo(x + r, r + y);\n ctx.lineTo(x - r, r + y);\n ctx.lineTo(x, y - r);\n ctx.closePath();\n return true;\n}\n\nexport function trianglUpOffset(ctx: IContext2d, r: number, x: number, y: number, offset: number) {\n ctx.moveTo(x + r + offset * 2, r + y + offset);\n ctx.lineTo(x - r - offset * 2, r + y + offset);\n ctx.lineTo(x, y - r - offset * 2);\n ctx.closePath();\n return true;\n}\n\n// 以中心为锚点,size为circle外接正方形的面积\nexport class TriangleUpSymbol extends BaseSymbol implements ISymbolClass {\n type: SymbolType = 'triangleUp';\n pathStr: string = 'M0.5,0.5 L-0.5,0.5 L0,-0.5 Z';\n\n draw(ctx: IContext2d, size: number, x: number, y: number) {\n const r = size / 2;\n return trianglUp(ctx, r, x, y);\n }\n\n drawOffset(ctx: IContext2d, size: number, x: number, y: number, offset: number) {\n const r = size / 2;\n return trianglUpOffset(ctx, r, x, y, offset);\n }\n}\n\nexport default new TriangleUpSymbol();\n"]}
1
+ {"version":3,"sources":["../src/graphic/builtin-symbol/triangle-up.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAqBpC,MAAM,UAAU,eAAe,CAAC,GAAe,EAAE,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,SAAiB,CAAC;IAClG,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,MAAM,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,CAAC;IAC/C,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,MAAM,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,CAAC;IAC/C,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,MAAM,GAAG,CAAC,CAAC,CAAC;IAClC,GAAG,CAAC,SAAS,EAAE,CAAC;IAChB,OAAO,IAAI,CAAC;AACd,CAAC;AAGD,MAAM,OAAO,gBAAiB,SAAQ,UAAU;IAAhD;;QACE,SAAI,GAAe,YAAY,CAAC;QAChC,YAAO,GAAW,8BAA8B,CAAC;IAWnD,CAAC;IATC,IAAI,CAAC,GAAe,EAAE,IAAY,EAAE,CAAS,EAAE,CAAS;QACtD,MAAM,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC;QACnB,OAAO,eAAe,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IACvC,CAAC;IAED,UAAU,CAAC,GAAe,EAAE,IAAY,EAAE,CAAS,EAAE,CAAS,EAAE,MAAc;QAC5E,MAAM,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC;QACnB,OAAO,eAAe,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC;IAC/C,CAAC;CACF;AAED,eAAe,IAAI,gBAAgB,EAAE,CAAC","file":"triangle-up.js","sourcesContent":["import type { IBounds } from '@visactor/vutils';\nimport type { IContext2d, SymbolType, ISymbolClass } from '../../interface';\nimport { BaseSymbol } from './base';\n\n/**\n * \n *Copyright 2010-2021 Mike Bostock\n\n Permission to use, copy, modify, and/or distribute this software for any purpose\n with or without fee is hereby granted, provided that the above copyright notice\n and this permission notice appear in all copies.\n\n THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND\n FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS\n OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER\n TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF\n THIS SOFTWARE.\n */\n// 借鉴自d3\n// https://github.com/d3/d3-shape/blob/main/src/symbol/triangle.js\n\nexport function trianglUpOffset(ctx: IContext2d, r: number, x: number, y: number, offset: number = 0) {\n ctx.moveTo(x + r + offset * 2, r + y + offset);\n ctx.lineTo(x - r - offset * 2, r + y + offset);\n ctx.lineTo(x, y - r - offset * 2);\n ctx.closePath();\n return true;\n}\n\n// 以中心为锚点,size为circle外接正方形的面积\nexport class TriangleUpSymbol extends BaseSymbol implements ISymbolClass {\n type: SymbolType = 'triangleUp';\n pathStr: string = 'M0.5,0.5 L-0.5,0.5 L0,-0.5 Z';\n\n draw(ctx: IContext2d, size: number, x: number, y: number) {\n const r = size / 2;\n return trianglUpOffset(ctx, r, x, y);\n }\n\n drawOffset(ctx: IContext2d, size: number, x: number, y: number, offset: number) {\n const r = size / 2;\n return trianglUpOffset(ctx, r, x, y, offset);\n }\n}\n\nexport default new TriangleUpSymbol();\n"]}
@@ -1,6 +1,5 @@
1
1
  import type { SymbolType, ISymbolClass } from '../../interface';
2
- import { trianglUp, TriangleUpSymbol } from './triangle-up';
3
- export declare const triangle: typeof trianglUp;
2
+ import { TriangleUpSymbol } from './triangle-up';
4
3
  export declare class TriangleSymbol extends TriangleUpSymbol implements ISymbolClass {
5
4
  type: SymbolType;
6
5
  }
@@ -1,6 +1,4 @@
1
- import { trianglUp, TriangleUpSymbol } from "./triangle-up";
2
-
3
- export const triangle = trianglUp;
1
+ import { TriangleUpSymbol } from "./triangle-up";
4
2
 
5
3
  export class TriangleSymbol extends TriangleUpSymbol {
6
4
  constructor() {
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/graphic/builtin-symbol/triangle.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAgC5D,MAAM,CAAC,MAAM,QAAQ,GAAG,SAAS,CAAC;AAGlC,MAAM,OAAO,cAAe,SAAQ,gBAAgB;IAApD;;QACE,SAAI,GAAe,UAAU,CAAC;IAChC,CAAC;CAAA;AAoBD,eAAe,IAAI,cAAc,EAAE,CAAC","file":"triangle.js","sourcesContent":["// import { IBounds, sqrt } from '@visactor/vutils';\nimport type { SymbolType, ISymbolClass } from '../../interface';\nimport { trianglUp, TriangleUpSymbol } from './triangle-up';\n\n/**\n * \n *Copyright 2010-2021 Mike Bostock\n\n Permission to use, copy, modify, and/or distribute this software for any purpose\n with or without fee is hereby granted, provided that the above copyright notice\n and this permission notice appear in all copies.\n\n THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND\n FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS\n OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER\n TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF\n THIS SOFTWARE.\n */\n// 借鉴自d3\n// https://github.com/d3/d3-shape/blob/main/src/symbol/triangle.js\n\n// const sqrt3 = sqrt(3);\n\n// export function triangle(ctx: IContext2d, r: number, x: number, y: number) {\n// const h = r * sqrt3;\n// ctx.moveTo(x, y + (-h / 3) * 2);\n// ctx.lineTo(r + x, y + h);\n// ctx.lineTo(x - r, y + h);\n// ctx.closePath();\n// return true;\n// }\n\nexport const triangle = trianglUp;\n\n// 以中心为锚点,size为circle外接正方形的面积\nexport class TriangleSymbol extends TriangleUpSymbol implements ISymbolClass {\n type: SymbolType = 'triangle';\n}\n\n// export class TriangleSymbol extends TriangleUpSymbol implements ISymbolClass {\n// type: SymbolType = 'triangle';\n// pathStr: string = 'M0,-0.5773502691896257L-0.5,0.28867513459481287L0.5,0.28867513459481287Z';\n\n// draw(ctx: IContext2d, size: number, x: number, y: number) {\n// const r = size / 2 / sqrt3;\n// return triangle(ctx, r, x, y);\n// }\n\n// bounds(size: number, bounds: IBounds) {\n// const r = size / 2;\n// bounds.x1 = -r;\n// bounds.x2 = r;\n// bounds.y1 = -r;\n// bounds.y2 = r;\n// }\n// }\n\nexport default new TriangleSymbol();\n"]}
1
+ {"version":3,"sources":["../src/graphic/builtin-symbol/triangle.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAiCjD,MAAM,OAAO,cAAe,SAAQ,gBAAgB;IAApD;;QACE,SAAI,GAAe,UAAU,CAAC;IAChC,CAAC;CAAA;AAED,eAAe,IAAI,cAAc,EAAE,CAAC","file":"triangle.js","sourcesContent":["// import { IBounds, sqrt } from '@visactor/vutils';\nimport type { SymbolType, ISymbolClass } from '../../interface';\nimport { TriangleUpSymbol } from './triangle-up';\n\n/**\n * \n *Copyright 2010-2021 Mike Bostock\n\n Permission to use, copy, modify, and/or distribute this software for any purpose\n with or without fee is hereby granted, provided that the above copyright notice\n and this permission notice appear in all copies.\n\n THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND\n FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS\n OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER\n TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF\n THIS SOFTWARE.\n */\n// 借鉴自d3\n// https://github.com/d3/d3-shape/blob/main/src/symbol/triangle.js\n\n// const sqrt3 = sqrt(3);\n\n// export function triangle(ctx: IContext2d, r: number, x: number, y: number) {\n// const h = r * sqrt3;\n// ctx.moveTo(x, y + (-h / 3) * 2);\n// ctx.lineTo(r + x, y + h);\n// ctx.lineTo(x - r, y + h);\n// ctx.closePath();\n// return true;\n// }\n\n// 以中心为锚点,size为circle外接正方形的面积\nexport class TriangleSymbol extends TriangleUpSymbol implements ISymbolClass {\n type: SymbolType = 'triangle';\n}\n\nexport default new TriangleSymbol();\n"]}
@@ -1,4 +1,4 @@
1
- import type { AABBBounds } from '@visactor/vutils';
1
+ import { type IAABBBounds } from '@visactor/vutils';
2
2
  import type { ICircle, ICircleGraphicAttribute } from '../interface/graphic/circle';
3
3
  import { Graphic } from './graphic';
4
4
  import { CustomPath2D } from '../common/custom-path2d';
@@ -37,8 +37,10 @@ export declare class Circle extends Graphic<ICircleGraphicAttribute> implements
37
37
  constructor(params?: ICircleGraphicAttribute);
38
38
  isValid(): boolean;
39
39
  private _isValid;
40
- protected doUpdateAABBBounds(full?: boolean): AABBBounds;
41
- getDefaultAttribute(name: string): any;
40
+ getGraphicTheme(): Required<ICircleGraphicAttribute>;
41
+ protected updateAABBBounds(attribute: ICircleGraphicAttribute, circleTheme: Required<ICircleGraphicAttribute>, aabbBounds: IAABBBounds, full?: boolean): import("@visactor/vutils").IBounds;
42
+ protected updateCircleAABBBoundsImprecise(attribute: ICircleGraphicAttribute, circleTheme: Required<ICircleGraphicAttribute>, aabbBounds: IAABBBounds): IAABBBounds;
43
+ protected updateCircleAABBBoundsAccurate(attribute: ICircleGraphicAttribute, circleTheme: Required<ICircleGraphicAttribute>, aabbBounds: IAABBBounds): IAABBBounds;
42
44
  protected needUpdateTags(keys: string[]): boolean;
43
45
  protected needUpdateTag(key: string): boolean;
44
46
  toCustomPath(): CustomPath2D;
@@ -1,8 +1,10 @@
1
+ import { epsilon, pi2 } from "@visactor/vutils";
2
+
1
3
  import { Graphic, GRAPHIC_UPDATE_TAG_KEY, NOWORK_ANIMATE_ATTR } from "./graphic";
2
4
 
3
5
  import { CustomPath2D } from "../common/custom-path2d";
4
6
 
5
- import { parsePadding } from "../common/utils";
7
+ import { circleBounds } from "../common/utils";
6
8
 
7
9
  import { getTheme } from "./theme";
8
10
 
@@ -10,6 +12,8 @@ import { application } from "../application";
10
12
 
11
13
  import { CIRCLE_NUMBER_TYPE } from "./constants";
12
14
 
15
+ import { updateBoundsOfCommonOuterBorder } from "./graphic-service/common-outer-boder-bounds";
16
+
13
17
  const CIRCLE_UPDATE_TAG_KEY = [ "radius", "startAngle", "endAngle", ...GRAPHIC_UPDATE_TAG_KEY ];
14
18
 
15
19
  export class Circle extends Graphic {
@@ -25,15 +29,25 @@ export class Circle extends Graphic {
25
29
  const {startAngle: startAngle, endAngle: endAngle, radius: radius} = this.attribute;
26
30
  return this._validNumber(startAngle) && this._validNumber(endAngle) && this._validNumber(radius);
27
31
  }
28
- doUpdateAABBBounds(full) {
29
- const circleTheme = getTheme(this).circle;
30
- this._AABBBounds.clear();
31
- const attribute = this.attribute, bounds = application.graphicService.updateCircleAABBBounds(attribute, getTheme(this).circle, this._AABBBounds, full, this), {boundsPadding: boundsPadding = circleTheme.boundsPadding} = attribute, paddingArray = parsePadding(boundsPadding);
32
- return paddingArray && bounds.expand(paddingArray), this.clearUpdateBoundTag(),
33
- bounds;
32
+ getGraphicTheme() {
33
+ return getTheme(this).circle;
34
+ }
35
+ updateAABBBounds(attribute, circleTheme, aabbBounds, full) {
36
+ if (!application.graphicService.validCheck(attribute, circleTheme, aabbBounds, this)) return aabbBounds;
37
+ this.updatePathProxyAABBBounds(aabbBounds) || (full ? this.updateCircleAABBBoundsImprecise(attribute, circleTheme, aabbBounds) : this.updateCircleAABBBoundsAccurate(attribute, circleTheme, aabbBounds));
38
+ const {tb1: tb1, tb2: tb2} = application.graphicService.updateTempAABBBounds(aabbBounds);
39
+ return updateBoundsOfCommonOuterBorder(attribute, circleTheme, tb1), aabbBounds.union(tb1),
40
+ tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2), application.graphicService.transformAABBBounds(attribute, aabbBounds, circleTheme, !1, this),
41
+ aabbBounds;
42
+ }
43
+ updateCircleAABBBoundsImprecise(attribute, circleTheme, aabbBounds) {
44
+ const {radius: radius = circleTheme.radius} = attribute;
45
+ return aabbBounds.set(-radius, -radius, radius, radius), aabbBounds;
34
46
  }
35
- getDefaultAttribute(name) {
36
- return getTheme(this).circle[name];
47
+ updateCircleAABBBoundsAccurate(attribute, circleTheme, aabbBounds) {
48
+ const {startAngle: startAngle = circleTheme.startAngle, endAngle: endAngle = circleTheme.endAngle, radius: radius = circleTheme.radius} = attribute;
49
+ return endAngle - startAngle > pi2 - epsilon ? aabbBounds.set(-radius, -radius, radius, radius) : circleBounds(startAngle, endAngle, radius, aabbBounds),
50
+ aabbBounds;
37
51
  }
38
52
  needUpdateTags(keys) {
39
53
  return super.needUpdateTags(keys, CIRCLE_UPDATE_TAG_KEY);
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/graphic/circle.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEjD,MAAM,qBAAqB,GAAG,CAAC,QAAQ,EAAE,YAAY,EAAE,UAAU,EAAE,GAAG,sBAAsB,CAAC,CAAC;AAM9F,MAAM,OAAO,MAAO,SAAQ,OAAgC;IAK1D,YAAY,SAAkC,EAAE,MAAM,EAAE,CAAC,EAAE;QACzD,KAAK,CAAC,MAAM,CAAC,CAAC;QALhB,SAAI,GAAa,QAAQ,CAAC;QAMxB,IAAI,CAAC,UAAU,GAAG,kBAAkB,CAAC;IACvC,CAAC;IAED,OAAO;QACL,OAAO,KAAK,CAAC,OAAO,EAAE,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;IAC5C,CAAC;IACO,QAAQ;QACd,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC;QACxD,OAAO,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,IAAI,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,IAAI,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;IACnG,CAAC;I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C;QACtE,MAAM,UAAU,GAAG,MAAA,SAAS,CAAC,UAAU,mCAAI,IAAI,CAAC,mBAAmB,CAAC,YAAY,CAAC,CAAC;QAClF,MAAM,QAAQ,GAAG,MAAA,SAAS,CAAC,QAAQ,mCAAI,IAAI,CAAC,mBAAmB,CAAC,UAAU,CAAC,CAAC;QAE5E,MAAM,IAAI,GAAG,IAAI,YAAY,EAAE,CAAC;QAEhC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC;QAE7C,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK;QACH,OAAO,IAAI,MAAM,mBAAM,IAAI,CAAC,SAAS,EAAG,CAAC;IAC3C,CAAC;IAED,oBAAoB;QAClB,OAAO,MAAM,CAAC,mBAAmB,CAAC;IACpC,CAAC;;AAvEM,0BAAmB,GAAG,mBAAmB,CAAC;AA0EnD,MAAM,UAAU,YAAY,CAAC,UAAmC;IAC9D,OAAO,IAAI,MAAM,CAAC,UAAU,CAAC,CAAC;AAChC,CAAC","file":"circle.js","sourcesContent":["import type { AABBBounds } from '@visactor/vutils';\nimport type { ICircle, ICircleGraphicAttribute } from '../interface/graphic/circle';\nimport { Graphic, GRAPHIC_UPDATE_TAG_KEY, NOWORK_ANIMATE_ATTR } from './graphic';\nimport { CustomPath2D } from '../common/custom-path2d';\nimport { parsePadding } from '../common/utils';\nimport { getTheme } from './theme';\nimport { application } from '../application';\nimport { CIRCLE_NUMBER_TYPE } from './constants';\n\nconst CIRCLE_UPDATE_TAG_KEY = ['radius', 'startAngle', 'endAngle', ...GRAPHIC_UPDATE_TAG_KEY];\n\n/**\n * 圆形图元\n * 默认顺时针绘制\n */\nexport class Circle extends Graphic<ICircleGraphicAttribute> implements ICircle {\n type: 'circle' = 'circle';\n\n static NOWORK_ANIMATE_ATTR = NOWORK_ANIMATE_ATTR;\n\n constructor(params: ICircleGraphicAttribute = { radius: 1 }) {\n super(params);\n this.numberType = CIRCLE_NUMBER_TYPE;\n }\n\n isValid(): boolean {\n return super.isValid() && this._isValid();\n }\n private _isValid(): boolean {\n const { startAngle, endAngle, radius } = this.attribute;\n return this._validNumber(startAngle) && this._validNumber(endAngle) && this._validNumber(radius);\n }\n\n protected doUpdateAABBBounds(full?: boolean): AABBBounds {\n const circleTheme = getTheme(this).circle;\n this._AABBBounds.clear();\n const attribute = this.attribute;\n const bounds = application.graphicService.updateCircleAABBBounds(\n attribute,\n getTheme(this).circle,\n this._AABBBounds,\n full,\n this\n );\n\n const { boundsPadding = circleTheme.boundsPadding } = attribute;\n const paddingArray = parsePadding(boundsPadding);\n if (paddingArray) {\n (bounds as AABBBounds).expand(paddingArray);\n }\n\n this.clearUpdateBoundTag();\n return bounds as AABBBounds;\n }\n\n getDefaultAttribute(name: string) {\n const circleTheme = getTheme(this).circle;\n return circleTheme[name];\n }\n\n protected needUpdateTags(keys: string[]): boolean {\n return super.needUpdateTags(keys, CIRCLE_UPDATE_TAG_KEY);\n }\n protected needUpdateTag(key: string): boolean {\n return super.needUpdateTag(key, CIRCLE_UPDATE_TAG_KEY);\n }\n\n toCustomPath() {\n const x = 0;\n const y = 0;\n\n const attribute = this.attribute;\n const radius = attribute.radius ?? this.getDefaultAttribute('radius');\n const startAngle = attribute.startAngle ?? this.getDefaultAttribute('startAngle');\n const endAngle = attribute.endAngle ?? this.getDefaultAttribute('endAngle');\n\n const path = new CustomPath2D();\n\n path.arc(x, y, radius, startAngle, endAngle);\n\n return path;\n }\n\n clone() {\n return new Circle({ ...this.attribute });\n }\n\n getNoWorkAnimateAttr(): Record<string, number> {\n return Circle.NOWORK_ANIMATE_ATTR;\n }\n}\n\nexport function createCircle(attributes: ICircleGraphicAttribute): ICircle {\n return new Circle(attributes);\n}\n\n// addAttributeToPrototype(DefaultCircleStyle, Circle, PURE_STYLE_KEY);\n"]}
1
+ {"version":3,"sources":["../src/graphic/circle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,E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AK;QACH,OAAO,IAAI,MAAM,mBAAM,IAAI,CAAC,SAAS,EAAG,CAAC;IAC3C,CAAC;IAED,oBAAoB;QAClB,OAAO,MAAM,CAAC,mBAAmB,CAAC;IACpC,CAAC;;AAxGM,0BAAmB,GAAG,mBAAmB,CAAC;AA2GnD,MAAM,UAAU,YAAY,CAAC,UAAmC;IAC9D,OAAO,IAAI,MAAM,CAAC,UAAU,CAAC,CAAC;AAChC,CAAC","file":"circle.js","sourcesContent":["import { epsilon, pi2, type IAABBBounds } from '@visactor/vutils';\nimport type { ICircle, ICircleGraphicAttribute } from '../interface/graphic/circle';\nimport { Graphic, GRAPHIC_UPDATE_TAG_KEY, NOWORK_ANIMATE_ATTR } from './graphic';\nimport { CustomPath2D } from '../common/custom-path2d';\nimport { circleBounds } from '../common/utils';\nimport { getTheme } from './theme';\nimport { application } from '../application';\nimport { CIRCLE_NUMBER_TYPE } from './constants';\nimport { updateBoundsOfCommonOuterBorder } from './graphic-service/common-outer-boder-bounds';\n\nconst CIRCLE_UPDATE_TAG_KEY = ['radius', 'startAngle', 'endAngle', ...GRAPHIC_UPDATE_TAG_KEY];\n\n/**\n * 圆形图元\n * 默认顺时针绘制\n */\nexport class Circle extends Graphic<ICircleGraphicAttribute> implements ICircle {\n type: 'circle' = 'circle';\n\n static NOWORK_ANIMATE_ATTR = NOWORK_ANIMATE_ATTR;\n\n constructor(params: ICircleGraphicAttribute = { radius: 1 }) {\n super(params);\n this.numberType = CIRCLE_NUMBER_TYPE;\n }\n\n isValid(): boolean {\n return super.isValid() && this._isValid();\n }\n private _isValid(): boolean {\n const { startAngle, endAngle, radius } = this.attribute;\n return this._validNumber(startAngle) && this._validNumber(endAngle) && this._validNumber(radius);\n }\n\n getGraphicTheme(): Required<ICircleGraphicAttribute> {\n return getTheme(this).circle;\n }\n\n protected updateAABBBounds(\n attribute: ICircleGraphicAttribute,\n circleTheme: Required<ICircleGraphicAttribute>,\n aabbBounds: IAABBBounds,\n full?: boolean\n ) {\n if (!application.graphicService.validCheck(attribute, circleTheme, aabbBounds, this)) {\n return aabbBounds;\n }\n if (!this.updatePathProxyAABBBounds(aabbBounds)) {\n full\n ? this.updateCircleAABBBoundsImprecise(attribute, circleTheme, aabbBounds)\n : this.updateCircleAABBBoundsAccurate(attribute, circleTheme, aabbBounds);\n }\n\n const { tb1, tb2 } = application.graphicService.updateTempAABBBounds(aabbBounds);\n\n updateBoundsOfCommonOuterBorder(attribute, circleTheme, tb1);\n aabbBounds.union(tb1);\n tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2);\n\n application.graphicService.transformAABBBounds(attribute, aabbBounds, circleTheme, false, this);\n\n return aabbBounds;\n }\n\n protected updateCircleAABBBoundsImprecise(\n attribute: ICircleGraphicAttribute,\n circleTheme: Required<ICircleGraphicAttribute>,\n aabbBounds: IAABBBounds\n ): IAABBBounds {\n const { radius = circleTheme.radius } = attribute;\n aabbBounds.set(-radius, -radius, radius, radius);\n\n return aabbBounds;\n }\n protected updateCircleAABBBoundsAccurate(\n attribute: ICircleGraphicAttribute,\n circleTheme: Required<ICircleGraphicAttribute>,\n aabbBounds: IAABBBounds\n ): IAABBBounds {\n const {\n startAngle = circleTheme.startAngle,\n endAngle = circleTheme.endAngle,\n radius = circleTheme.radius\n } = attribute;\n\n if (endAngle - startAngle > pi2 - epsilon) {\n aabbBounds.set(-radius, -radius, radius, radius);\n } else {\n circleBounds(startAngle, endAngle, radius, aabbBounds);\n }\n\n return aabbBounds;\n }\n\n protected needUpdateTags(keys: string[]): boolean {\n return super.needUpdateTags(keys, CIRCLE_UPDATE_TAG_KEY);\n }\n protected needUpdateTag(key: string): boolean {\n return super.needUpdateTag(key, CIRCLE_UPDATE_TAG_KEY);\n }\n\n toCustomPath() {\n const x = 0;\n const y = 0;\n\n const attribute = this.attribute;\n const radius = attribute.radius ?? this.getDefaultAttribute('radius');\n const startAngle = attribute.startAngle ?? this.getDefaultAttribute('startAngle');\n const endAngle = attribute.endAngle ?? this.getDefaultAttribute('endAngle');\n\n const path = new CustomPath2D();\n\n path.arc(x, y, radius, startAngle, endAngle);\n\n return path;\n }\n\n clone() {\n return new Circle({ ...this.attribute });\n }\n\n getNoWorkAnimateAttr(): Record<string, number> {\n return Circle.NOWORK_ANIMATE_ATTR;\n }\n}\n\nexport function createCircle(attributes: ICircleGraphicAttribute): ICircle {\n return new Circle(attributes);\n}\n\n// addAttributeToPrototype(DefaultCircleStyle, Circle, PURE_STYLE_KEY);\n"]}
@@ -140,7 +140,8 @@ export const DefaultAttribute = Object.assign(Object.assign(Object.assign({
140
140
  shadowRootIdx: 1,
141
141
  globalZIndex: 1,
142
142
  globalCompositeOperation: "",
143
- overflow: "hidden"
143
+ overflow: "hidden",
144
+ shadowPickMode: "graphic"
144
145
  }, DefaultDebugAttribute), DefaultStyle), DefaultTransform);
145
146
 
146
147
  export function addAttributeToPrototype(obj, c, keys) {
@@ -172,7 +173,8 @@ export const DefaultAreaAttribute = Object.assign(Object.assign(Object.assign({}
172
173
  segments: [],
173
174
  curveType: "linear",
174
175
  clipRange: 1,
175
- closePath: !1
176
+ closePath: !1,
177
+ curveTension: 1
176
178
  });
177
179
 
178
180
  export const DefaultCircleAttribute = Object.assign(Object.assign({}, DefaultAttribute), {
@@ -211,7 +213,8 @@ export const DefaultLineAttribute = Object.assign(Object.assign(Object.assign({}
211
213
  curveType: "linear",
212
214
  clipRange: 1,
213
215
  clipRangeByDimension: "default",
214
- closePath: !1
216
+ closePath: !1,
217
+ curveTension: 1
215
218
  });
216
219
 
217
220
  export const DefaultPathAttribute = Object.assign(Object.assign({}, DefaultAttribute), {
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/graphic/config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAiCvD,MAAM,CAAC,MAAM,aAAa,GAAY;IACpC,SAAS,EAAE,M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AE,YAAiC,EAC5C,iBAAiB,EAAE,KAAkC,EACrD,SAAS,EAAE,MAAiC,EAC5C,YAAY,EAAE,KAAmC,EACjD,eAAe,EAAE,YAAY,EAC7B,UAAU,EAAE,EAAE,EACd,mBAAmB,EAAE,KAAK,EAC1B,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,SAAS,EACnB,UAAU,EAAE,KAAK,GAClB,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,iCAChC,OAAO,EAAE,WAAW,EACpB,OAAO,EAAE,WAAW,EACpB,KAAK,EAAE,EAAE,EACT,KAAK,EAAE,CAAC,EACR,MAAM,EAAE,CAAC,IACN,gBAAgB,KACnB,IAAI,EAAE,IAAI,EACV,YAAY,EAAE,CAAC,GAChB,CAAC;AAEF,MAAM,CAAC,MAAM,4BAA4B,mCACpC,qBAAqB,KACxB,kBAAkB,EAAE,OAAO,EAC3B,eAAe,EAAE,CAAC,EAClB,gBAAgB,EAAE,CAAC,EACnB,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,QAAQ,EACtB,SAAS,EAAE,YAAY,EACvB,MAAM,EAAE,CAAC,EACT,EAAE,EAAE,EAAE,EAEN,KAAK,EAAE,EAAE,EACT,MAAM,EAAE,EAAE,EACV,cAAc,EAAE,0BAA0B,EAC1C,qBAAqB,EAAE,CAAC,EACxB,gBAAgB,EAAE,KAAK,EACvB,uBAAuB,EAAE,CAAC,EAC1B,gBAAgB,EAAE,CAAC,EACnB,OAAO,EAAE,CAAC,GACX,CAAC","file":"config.js","sourcesContent":["// 存放公共属性\nimport { Logger, Matrix, pi2 } from '@visactor/vutils';\nimport { CustomPath2D } from '../common/custom-path2d';\nimport type {\n IArcGraphicAttribute,\n IAreaGraphicAttribute,\n IGraphicAttribute,\n ICircleGraphicAttribute,\n IFillStyle,\n IGlyphGraphicAttribute,\n IGroupGraphicAttribute,\n IImageGraphicAttribute,\n ILineGraphicAttribute,\n IPathGraphicAttribute,\n IPolygonGraphicAttribute,\n IRect3dGraphicAttribute,\n IRectGraphicAttribute,\n IStrokeStyle,\n IGraphicStyle,\n ISymbolGraphicAttribute,\n ITextAttribute,\n ITextGraphicAttribute,\n IRichTextGraphicAttribute,\n ITransform,\n RichTextWordBreak,\n RichTextVerticalDirection,\n RichTextGlobalAlignType,\n RichTextGlobalBaselineType,\n IRichTextIconGraphicAttribute,\n IConnectedStyle,\n ILayout,\n IDebugType,\n IPickStyle\n} from '../interface';\n\nexport const DefaultLayout: ILayout = {\n alignSelf: 'auto'\n};\n\nexport const DefaultTransform: ITransform = {\n x: 0,\n y: 0,\n z: 0,\n dx: 0,\n dy: 0,\n dz: 0,\n scrollX: 0,\n scrollY: 0,\n scaleX: 1,\n scaleY: 1,\n scaleZ: 1,\n angle: 0,\n alpha: 0,\n beta: 0,\n scaleCenter: [0, 0],\n anchor: [0, 0],\n anchor3d: [0, 0],\n postMatrix: new Matrix()\n};\n\nexport const DefaultFillStyle: IFillStyle = {\n fillOpacity: 1,\n fill: false,\n shadowBlur: 0,\n shadowColor: 'black',\n shadowOffsetX: 0,\n shadowOffsetY: 0\n};\n\nconst commonStroke: Omit<IStrokeStyle, 'outerBorder' | 'innerBorder'> = {\n strokeOpacity: 1,\n lineDash: [],\n lineDashOffset: 0,\n lineWidth: 1,\n lineCap: 'butt',\n lineJoin: 'miter',\n miterLimit: 10,\n strokeBoundsBuffer: 2,\n stroke: false\n};\n\nexport const DefaultStrokeStyle: IStrokeStyle = {\n outerBorder: { ...commonStroke, distance: 0 },\n innerBorder: { ...commonStroke, distance: 0 },\n ...commonStroke\n};\n\nexport const DefaultTextStyle: Required<ITextAttribute> = {\n text: '',\n maxLineWidth: Infinity,\n textAlign: 'left',\n textBaseline: 'alphabetic',\n fontSize: 16,\n // @ts-ignore\n fontFamily: `PingFang SC,Microsoft Yahei,system-ui,-apple-system,segoe ui,\n Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol`,\n fontWeight: '',\n ellipsis: '…',\n fontVariant: '',\n fontStyle: '',\n lineHeight: undefined,\n underline: 0,\n lineThrough: 0,\n scaleIn3d: false,\n direction: 'horizontal',\n wordBreak: 'break-all',\n ignoreBuf: false,\n verticalMode: 0,\n wrap: false,\n whiteSpace: 'no-wrap',\n heightLimit: Infinity,\n lineClamp: Infinity,\n suffixPosition: 'end',\n underlineDash: [],\n underlineOffset: 0,\n disableAutoClipedPoptip: undefined\n};\n\nexport const DefaultPickStyle: IPickStyle = {\n pickStrokeBuffer: 0\n};\n\nexport const DefaultStyle: IGraphicStyle = {\n forceBoundsWidth: undefined,\n forceBoundsHeight: undefined,\n opacity: 1,\n background: null,\n backgroundOpacity: 1,\n backgroundCornerRadius: 0,\n texture: null,\n textureColor: 'black',\n textureSize: 10,\n texturePadding: 2,\n backgroundMode: 'no-repeat',\n backgroundFit: true,\n blur: 0,\n cursor: null,\n html: null,\n react: null,\n ...DefaultFillStyle,\n ...DefaultStrokeStyle,\n ...DefaultLayout,\n ...DefaultPickStyle\n};\n\nexport const DefaultConnectAttribute: Required<IConnectedStyle> = {\n connectedType: 'none',\n // connectedStyle: {\n // stroke: DefaultStrokeStyle.stroke,\n // strokeOpacity: DefaultStrokeStyle.strokeOpacity,\n // lineDash: DefaultStrokeStyle.lineDash,\n // lineDashOffset: DefaultStrokeStyle.lineDashOffset,\n // lineCap: DefaultStrokeStyle.lineCap,\n // lineJoin: DefaultStrokeStyle.lineJoin,\n // lineWidth: DefaultStrokeStyle.lineWidth,\n // fill: DefaultFillStyle.fill,\n // fillOpacity: DefaultFillStyle.fillOpacity\n // },\n connectedStyle: {}, // 默认全都继承父属性\n connectedX: NaN,\n connectedY: NaN\n} as IConnectedStyle;\n\nexport const DefaultDebugAttribute: Required<IDebugType> = {\n _debug_bounds: false\n};\n\nexport const DefaultAttribute: Required<IGraphicAttribute> = {\n strokeSeg: null,\n renderable: true,\n pickable: true,\n shadowGraphic: undefined,\n childrenPickable: true,\n fillPickable: true,\n strokePickable: true,\n visible: true,\n zIndex: 0,\n layout: null,\n boundsPadding: 0,\n renderStyle: 'default',\n pickMode: 'accurate',\n customPickShape: null,\n boundsMode: 'accurate',\n keepDirIn3d: true,\n shadowRootIdx: 1,\n globalZIndex: 1,\n globalCompositeOperation: '',\n overflow: 'hidden',\n ...DefaultDebugAttribute,\n ...DefaultStyle,\n ...DefaultTransform\n};\n\nexport function addAttributeToPrototype(obj: Record<string, any>, c: any, keys: string[]) {\n keys.forEach(key => {\n c.prototype[key] = obj[key];\n });\n}\nexport function rewriteProto(obj: Record<string, any>, c: Record<string, any>) {\n Object.setPrototypeOf(obj, c);\n}\n\nexport const DefaultArcAttribute: Required<IArcGraphicAttribute> = {\n ...DefaultAttribute,\n startAngle: 0,\n endAngle: pi2,\n innerRadius: 0,\n outerRadius: 1,\n innerPadding: 0,\n outerPadding: 0,\n cornerRadius: 0,\n padRadius: 0,\n padAngle: 0,\n cap: false,\n forceShowCap: false\n};\n\nexport const DefaultAreaAttribute: Required<IAreaGraphicAttribute> = {\n ...DefaultAttribute,\n ...DefaultConnectAttribute,\n points: [],\n segments: [],\n curveType: 'linear',\n clipRange: 1,\n closePath: false\n};\n\nexport const DefaultCircleAttribute: Required<ICircleGraphicAttribute> = {\n ...DefaultAttribute,\n radius: 1,\n startAngle: 0,\n endAngle: pi2\n};\n\nexport const DefaultGroupAttribute: Required<IGroupGraphicAttribute> = {\n ...DefaultAttribute,\n width: 0,\n height: 0,\n cornerRadius: 0,\n path: [],\n clip: false,\n visibleAll: true,\n display: 'relative',\n flexDirection: 'row',\n flexWrap: 'wrap',\n justifyContent: 'flex-start',\n alignItems: 'flex-start',\n alignContent: 'flex-start',\n baseOpacity: 1\n};\n\nexport const DefaultGlyphAttribute: Required<IGlyphGraphicAttribute> = {\n ...DefaultAttribute,\n path: '',\n width: 0,\n height: 0,\n cornerRadius: 0,\n clip: false\n};\n\nexport const DefaultLineAttribute: Required<ILineGraphicAttribute> = {\n ...DefaultAttribute,\n ...DefaultConnectAttribute,\n points: [],\n segments: [],\n curveType: 'linear',\n clipRange: 1,\n clipRangeByDimension: 'default',\n closePath: false\n};\n\nexport const DefaultPathAttribute: Required<IPathGraphicAttribute> = {\n ...DefaultAttribute,\n path: new CustomPath2D(),\n customPath: () => {\n Logger.getInstance().warn('空函数');\n }\n};\n\nexport const DefaultPolygonAttribute: Required<IPolygonGraphicAttribute> = {\n ...DefaultAttribute,\n points: [],\n cornerRadius: 0,\n closePath: true\n};\n\nexport const DefaultRectAttribute: Required<IRectGraphicAttribute> = {\n ...DefaultAttribute,\n width: 0,\n height: 0,\n x1: 0,\n y1: 0,\n strokeBoundsBuffer: 0,\n cornerRadius: 0\n};\n\nexport const DefaultRect3dAttribute: Required<IRect3dGraphicAttribute> = {\n ...DefaultAttribute,\n width: 0,\n height: 0,\n x1: 0,\n y1: 0,\n cornerRadius: 0,\n length: 0\n};\n\nexport const DefaultSymbolAttribute: Required<ISymbolGraphicAttribute> = {\n ...DefaultAttribute,\n symbolType: 'circle',\n size: 10, // 外接**正方形**的边长\n keepDirIn3d: true\n};\n\nexport const DefaultTextAttribute: Required<ITextGraphicAttribute> = {\n ...DefaultAttribute,\n ...DefaultTextStyle,\n strokeBoundsBuffer: 0,\n keepDirIn3d: true\n};\n\nexport const DefaultRichTextAttribute: Required<IRichTextGraphicAttribute> = {\n ...DefaultAttribute,\n ...DefaultTextStyle,\n editable: false,\n width: 300,\n height: 300,\n ellipsis: true,\n wordBreak: 'break-word' as RichTextWordBreak,\n verticalDirection: 'top' as RichTextVerticalDirection,\n textAlign: 'left' as RichTextGlobalAlignType,\n textBaseline: 'top' as RichTextGlobalBaselineType,\n layoutDirection: 'horizontal',\n textConfig: [],\n disableAutoWrapLine: false,\n maxHeight: undefined,\n maxWidth: undefined,\n singleLine: false\n};\n\nexport const DefaultImageAttribute: Required<IImageGraphicAttribute> = {\n repeatX: 'no-repeat',\n repeatY: 'no-repeat',\n image: '',\n width: 0,\n height: 0,\n ...DefaultAttribute,\n fill: true,\n cornerRadius: 0\n};\n\nexport const DefaultRichTextIconAttribute: Required<IRichTextIconGraphicAttribute> = {\n ...DefaultImageAttribute,\n backgroundShowMode: 'never',\n backgroundWidth: 0,\n backgroundHeight: 0,\n textAlign: 'left',\n textBaseline: 'middle',\n direction: 'horizontal',\n margin: 0,\n id: '',\n\n width: 20,\n height: 20,\n backgroundFill: 'rgba(101, 117, 168, 0.1)',\n backgroundFillOpacity: 1,\n backgroundStroke: false,\n backgroundStrokeOpacity: 1,\n backgroundRadius: 4,\n opacity: 1\n};\n"]}
1
+ {"version":3,"sources":["../src/graphic/config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAiCvD,MAAM,CAAC,MAAM,aAAa,GAAY;IACpC,SAAS,EAAE,MAAM;CAClB,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAe;IAC1C,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,EAAE,EAAE,CAAC;IACL,EAAE,EAAE,CAAC;IACL,EAAE,EAAE,CAAC;IACL,OAAO,EAAE,CAAC;IACV,OAAO,EAAE,CAAC;IACV,MAAM,EAAE,CAAC;IACT,MAAM,EAAE,CAAC;IACT,MAAM,EAAE,CAAC;IACT,KAAK,EAAE,CAAC;IACR,KAAK,EAAE,CAAC;IACR,IAAI,EAAE,CAAC;IACP,WAAW,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;IACnB,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;IACd,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;IAChB,UAAU,EAAE,IAAI,MAAM,EAAE;CACzB,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAe;IAC1C,WAAW,EAAE,CAAC;IACd,IAAI,EAAE,KAAK;IACX,UAAU,EAAE,CAAC;IACb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S,EAAE,MAAM,EACjB,YAAY,EAAE,QAAQ,EACtB,SAAS,EAAE,YAAY,EACvB,MAAM,EAAE,CAAC,EACT,EAAE,EAAE,EAAE,EAEN,KAAK,EAAE,EAAE,EACT,MAAM,EAAE,EAAE,EACV,cAAc,EAAE,0BAA0B,EAC1C,qBAAqB,EAAE,CAAC,EACxB,gBAAgB,EAAE,KAAK,EACvB,uBAAuB,EAAE,CAAC,EAC1B,gBAAgB,EAAE,CAAC,EACnB,OAAO,EAAE,CAAC,GACX,CAAC","file":"config.js","sourcesContent":["// 存放公共属性\nimport { Logger, Matrix, pi2 } from '@visactor/vutils';\nimport { CustomPath2D } from '../common/custom-path2d';\nimport type {\n IArcGraphicAttribute,\n IAreaGraphicAttribute,\n IGraphicAttribute,\n ICircleGraphicAttribute,\n IFillStyle,\n IGlyphGraphicAttribute,\n IGroupGraphicAttribute,\n IImageGraphicAttribute,\n ILineGraphicAttribute,\n IPathGraphicAttribute,\n IPolygonGraphicAttribute,\n IRect3dGraphicAttribute,\n IRectGraphicAttribute,\n IStrokeStyle,\n IGraphicStyle,\n ISymbolGraphicAttribute,\n ITextAttribute,\n ITextGraphicAttribute,\n IRichTextGraphicAttribute,\n ITransform,\n RichTextWordBreak,\n RichTextVerticalDirection,\n RichTextGlobalAlignType,\n RichTextGlobalBaselineType,\n IRichTextIconGraphicAttribute,\n IConnectedStyle,\n ILayout,\n IDebugType,\n IPickStyle\n} from '../interface';\n\nexport const DefaultLayout: ILayout = {\n alignSelf: 'auto'\n};\n\nexport const DefaultTransform: ITransform = {\n x: 0,\n y: 0,\n z: 0,\n dx: 0,\n dy: 0,\n dz: 0,\n scrollX: 0,\n scrollY: 0,\n scaleX: 1,\n scaleY: 1,\n scaleZ: 1,\n angle: 0,\n alpha: 0,\n beta: 0,\n scaleCenter: [0, 0],\n anchor: [0, 0],\n anchor3d: [0, 0],\n postMatrix: new Matrix()\n};\n\nexport const DefaultFillStyle: IFillStyle = {\n fillOpacity: 1,\n fill: false,\n shadowBlur: 0,\n shadowColor: 'black',\n shadowOffsetX: 0,\n shadowOffsetY: 0\n};\n\nconst commonStroke: Omit<IStrokeStyle, 'outerBorder' | 'innerBorder'> = {\n strokeOpacity: 1,\n lineDash: [],\n lineDashOffset: 0,\n lineWidth: 1,\n lineCap: 'butt',\n lineJoin: 'miter',\n miterLimit: 10,\n strokeBoundsBuffer: 2,\n stroke: false\n};\n\nexport const DefaultStrokeStyle: IStrokeStyle = {\n outerBorder: { ...commonStroke, distance: 0 },\n innerBorder: { ...commonStroke, distance: 0 },\n ...commonStroke\n};\n\nexport const DefaultTextStyle: Required<ITextAttribute> = {\n text: '',\n maxLineWidth: Infinity,\n textAlign: 'left',\n textBaseline: 'alphabetic',\n fontSize: 16,\n // @ts-ignore\n fontFamily: `PingFang SC,Microsoft Yahei,system-ui,-apple-system,segoe ui,\n Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol`,\n fontWeight: '',\n ellipsis: '…',\n fontVariant: '',\n fontStyle: '',\n lineHeight: undefined,\n underline: 0,\n lineThrough: 0,\n scaleIn3d: false,\n direction: 'horizontal',\n wordBreak: 'break-all',\n ignoreBuf: false,\n verticalMode: 0,\n wrap: false,\n whiteSpace: 'no-wrap',\n heightLimit: Infinity,\n lineClamp: Infinity,\n suffixPosition: 'end',\n underlineDash: [],\n underlineOffset: 0,\n disableAutoClipedPoptip: undefined\n};\n\nexport const DefaultPickStyle: IPickStyle = {\n pickStrokeBuffer: 0\n};\n\nexport const DefaultStyle: IGraphicStyle = {\n forceBoundsWidth: undefined,\n forceBoundsHeight: undefined,\n opacity: 1,\n background: null,\n backgroundOpacity: 1,\n backgroundCornerRadius: 0,\n texture: null,\n textureColor: 'black',\n textureSize: 10,\n texturePadding: 2,\n backgroundMode: 'no-repeat',\n backgroundFit: true,\n blur: 0,\n cursor: null,\n html: null,\n react: null,\n ...DefaultFillStyle,\n ...DefaultStrokeStyle,\n ...DefaultLayout,\n ...DefaultPickStyle\n};\n\nexport const DefaultConnectAttribute: Required<IConnectedStyle> = {\n connectedType: 'none',\n // connectedStyle: {\n // stroke: DefaultStrokeStyle.stroke,\n // strokeOpacity: DefaultStrokeStyle.strokeOpacity,\n // lineDash: DefaultStrokeStyle.lineDash,\n // lineDashOffset: DefaultStrokeStyle.lineDashOffset,\n // lineCap: DefaultStrokeStyle.lineCap,\n // lineJoin: DefaultStrokeStyle.lineJoin,\n // lineWidth: DefaultStrokeStyle.lineWidth,\n // fill: DefaultFillStyle.fill,\n // fillOpacity: DefaultFillStyle.fillOpacity\n // },\n connectedStyle: {}, // 默认全都继承父属性\n connectedX: NaN,\n connectedY: NaN\n} as IConnectedStyle;\n\nexport const DefaultDebugAttribute: Required<IDebugType> = {\n _debug_bounds: false\n};\n\nexport const DefaultAttribute: Required<IGraphicAttribute> = {\n strokeSeg: null,\n renderable: true,\n pickable: true,\n shadowGraphic: undefined,\n childrenPickable: true,\n fillPickable: true,\n strokePickable: true,\n visible: true,\n zIndex: 0,\n layout: null,\n boundsPadding: 0,\n renderStyle: 'default',\n pickMode: 'accurate',\n customPickShape: null,\n boundsMode: 'accurate',\n keepDirIn3d: true,\n shadowRootIdx: 1,\n globalZIndex: 1,\n globalCompositeOperation: '',\n overflow: 'hidden',\n shadowPickMode: 'graphic',\n ...DefaultDebugAttribute,\n ...DefaultStyle,\n ...DefaultTransform\n};\n\nexport function addAttributeToPrototype(obj: Record<string, any>, c: any, keys: string[]) {\n keys.forEach(key => {\n c.prototype[key] = obj[key];\n });\n}\nexport function rewriteProto(obj: Record<string, any>, c: Record<string, any>) {\n Object.setPrototypeOf(obj, c);\n}\n\nexport const DefaultArcAttribute: Required<IArcGraphicAttribute> = {\n ...DefaultAttribute,\n startAngle: 0,\n endAngle: pi2,\n innerRadius: 0,\n outerRadius: 1,\n innerPadding: 0,\n outerPadding: 0,\n cornerRadius: 0,\n padRadius: 0,\n padAngle: 0,\n cap: false,\n forceShowCap: false\n};\n\nexport const DefaultAreaAttribute: Required<IAreaGraphicAttribute> = {\n ...DefaultAttribute,\n ...DefaultConnectAttribute,\n points: [],\n segments: [],\n curveType: 'linear',\n clipRange: 1,\n closePath: false,\n curveTension: 1\n};\n\nexport const DefaultCircleAttribute: Required<ICircleGraphicAttribute> = {\n ...DefaultAttribute,\n radius: 1,\n startAngle: 0,\n endAngle: pi2\n};\n\nexport const DefaultGroupAttribute: Required<IGroupGraphicAttribute> = {\n ...DefaultAttribute,\n width: 0,\n height: 0,\n cornerRadius: 0,\n path: [],\n clip: false,\n visibleAll: true,\n display: 'relative',\n flexDirection: 'row',\n flexWrap: 'wrap',\n justifyContent: 'flex-start',\n alignItems: 'flex-start',\n alignContent: 'flex-start',\n baseOpacity: 1\n};\n\nexport const DefaultGlyphAttribute: Required<IGlyphGraphicAttribute> = {\n ...DefaultAttribute,\n path: '',\n width: 0,\n height: 0,\n cornerRadius: 0,\n clip: false\n};\n\nexport const DefaultLineAttribute: Required<ILineGraphicAttribute> = {\n ...DefaultAttribute,\n ...DefaultConnectAttribute,\n points: [],\n segments: [],\n curveType: 'linear',\n clipRange: 1,\n clipRangeByDimension: 'default',\n closePath: false,\n curveTension: 1\n};\n\nexport const DefaultPathAttribute: Required<IPathGraphicAttribute> = {\n ...DefaultAttribute,\n path: new CustomPath2D(),\n customPath: () => {\n Logger.getInstance().warn('空函数');\n }\n};\n\nexport const DefaultPolygonAttribute: Required<IPolygonGraphicAttribute> = {\n ...DefaultAttribute,\n points: [],\n cornerRadius: 0,\n closePath: true\n};\n\nexport const DefaultRectAttribute: Required<IRectGraphicAttribute> = {\n ...DefaultAttribute,\n width: 0,\n height: 0,\n x1: 0,\n y1: 0,\n strokeBoundsBuffer: 0,\n cornerRadius: 0\n};\n\nexport const DefaultRect3dAttribute: Required<IRect3dGraphicAttribute> = {\n ...DefaultAttribute,\n width: 0,\n height: 0,\n x1: 0,\n y1: 0,\n cornerRadius: 0,\n length: 0\n};\n\nexport const DefaultSymbolAttribute: Required<ISymbolGraphicAttribute> = {\n ...DefaultAttribute,\n symbolType: 'circle',\n size: 10, // 外接**正方形**的边长\n keepDirIn3d: true\n};\n\nexport const DefaultTextAttribute: Required<ITextGraphicAttribute> = {\n ...DefaultAttribute,\n ...DefaultTextStyle,\n strokeBoundsBuffer: 0,\n keepDirIn3d: true\n};\n\nexport const DefaultRichTextAttribute: Required<IRichTextGraphicAttribute> = {\n ...DefaultAttribute,\n ...DefaultTextStyle,\n editable: false,\n width: 300,\n height: 300,\n ellipsis: true,\n wordBreak: 'break-word' as RichTextWordBreak,\n verticalDirection: 'top' as RichTextVerticalDirection,\n textAlign: 'left' as RichTextGlobalAlignType,\n textBaseline: 'top' as RichTextGlobalBaselineType,\n layoutDirection: 'horizontal',\n textConfig: [],\n disableAutoWrapLine: false,\n maxHeight: undefined,\n maxWidth: undefined,\n singleLine: false\n};\n\nexport const DefaultImageAttribute: Required<IImageGraphicAttribute> = {\n repeatX: 'no-repeat',\n repeatY: 'no-repeat',\n image: '',\n width: 0,\n height: 0,\n ...DefaultAttribute,\n fill: true,\n cornerRadius: 0\n};\n\nexport const DefaultRichTextIconAttribute: Required<IRichTextIconGraphicAttribute> = {\n ...DefaultImageAttribute,\n backgroundShowMode: 'never',\n backgroundWidth: 0,\n backgroundHeight: 0,\n textAlign: 'left',\n textBaseline: 'middle',\n direction: 'horizontal',\n margin: 0,\n id: '',\n\n width: 20,\n height: 20,\n backgroundFill: 'rgba(101, 117, 168, 0.1)',\n backgroundFillOpacity: 1,\n backgroundStroke: false,\n backgroundStrokeOpacity: 1,\n backgroundRadius: 4,\n opacity: 1\n};\n"]}
@@ -1,4 +1,4 @@
1
- import type { AABBBounds, IPointLike } from '@visactor/vutils';
1
+ import type { AABBBounds, IAABBBounds, IPointLike } from '@visactor/vutils';
2
2
  import { Graphic } from './graphic';
3
3
  import type { GraphicType, IGraphic, IGlyph, IGlyphGraphicAttribute, IGraphicAttribute, ISetAttributeContext } from '../interface';
4
4
  export declare class Glyph extends Graphic<IGlyphGraphicAttribute> implements IGlyph {
@@ -59,12 +59,14 @@ export declare class Glyph extends Graphic<IGlyphGraphicAttribute> implements IG
59
59
  scaleTo(scaleX: number, scaleY: number): this;
60
60
  rotate(angle: number): this;
61
61
  rotateTo(angle: number): this;
62
+ getGraphicTheme(): Required<IGlyphGraphicAttribute>;
63
+ protected updateAABBBounds(attribute: IGlyphGraphicAttribute, theme: Required<IGlyphGraphicAttribute>, aabbBounds: IAABBBounds): import("@visactor/vutils").IBounds;
62
64
  protected doUpdateAABBBounds(): AABBBounds;
63
65
  protected needUpdateTags(keys: string[]): boolean;
64
66
  protected needUpdateTag(key: string): boolean;
65
67
  useStates(states: string[], hasAnimation?: boolean): void;
66
68
  clearStates(hasAnimation?: boolean): void;
67
- clone(): Graphic<Partial<IGlyphGraphicAttribute>>;
69
+ clone(): IGraphic<Partial<IGlyphGraphicAttribute>>;
68
70
  getNoWorkAnimateAttr(): Record<string, number>;
69
71
  }
70
72
  export declare function createGlyph(attributes: IGlyphGraphicAttribute): IGlyph;
@@ -73,9 +73,17 @@ export class Glyph extends Graphic {
73
73
  g.addUpdatePositionTag(), g.addUpdateBoundTag();
74
74
  })), this;
75
75
  }
76
+ getGraphicTheme() {
77
+ return getTheme(this).glyph;
78
+ }
79
+ updateAABBBounds(attribute, theme, aabbBounds) {
80
+ return application.graphicService.validCheck(attribute, theme, aabbBounds, this) ? (this.getSubGraphic().forEach((node => {
81
+ aabbBounds.union(node.AABBBounds);
82
+ })), aabbBounds) : aabbBounds;
83
+ }
76
84
  doUpdateAABBBounds() {
77
85
  this._AABBBounds.clear();
78
- const bounds = application.graphicService.updateGlyphAABBBounds(this.attribute, getTheme(this).glyph, this._AABBBounds, this);
86
+ const bounds = this.updateAABBBounds(this.attribute, this.getGraphicTheme(), this._AABBBounds);
79
87
  return this.clearUpdateBoundTag(), bounds;
80
88
  }
81
89
  needUpdateTags(keys) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/graphic/glyph.ts"],"names":[],"mappings":"AACA,OAAO,E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AAC,OAAO,CAAC,WAAW,EAAE,IAAI,CAAC,aAAa,EAAE,YAAY,EAAE,IAAI,CAAC,CAAC;gBACrF,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC;YAC7B,CAAC,CAAC,CAAC;YACH,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,aAAa,EAAE,YAAY,EAAE,IAAI,CAAC,CAAC;SAChF;aAAM;YACL,IAAI,CAAC,aAAa,GAAG,EAAE,CAAC;SACzB;QACD,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;IAC1B,CAAC;IAED,KAAK;QACH,MAAM,KAAK,GAAG,IAAI,KAAK,mBAAM,IAAI,CAAC,SAAS,EAAG,CAAC;QAC/C,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;QACzD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,oBAAoB;QAClB,OAAO,KAAK,CAAC,mBAAmB,CAAC;IACnC,CAAC;;AA/MM,yBAAmB,GAAG,mBAAmB,CAAC;AAkNnD,MAAM,UAAU,WAAW,CAAC,UAAkC;IAC5D,OAAO,IAAI,KAAK,CAAC,UAAU,CAAC,CAAC;AAC/B,CAAC","file":"glyph.js","sourcesContent":["import type { AABBBounds, IPointLike } from '@visactor/vutils';\nimport { Graphic, NOWORK_ANIMATE_ATTR } from './graphic';\nimport type {\n GraphicType,\n IGraphic,\n IGlyph,\n IGlyphGraphicAttribute,\n IGraphicAttribute,\n ISetAttributeContext\n} from '../interface';\nimport { getTheme } from './theme';\nimport { application } from '../application';\nimport { GLYPH_NUMBER_TYPE } from './constants';\n\nexport class Glyph extends Graphic<IGlyphGraphicAttribute> implements IGlyph {\n type: GraphicType = 'glyph';\n declare _onInit: (g: IGlyph) => void;\n declare _onUpdate: (g: IGlyph) => void;\n declare glyphStates?: Record<\n string,\n {\n attributes: Partial<IGlyphGraphicAttribute>;\n subAttributes: Partial<IGraphicAttribute>[];\n }\n >;\n declare glyphStateProxy?: (\n stateName: string,\n targetStates?: string[]\n ) => {\n attributes: Partial<IGlyphGraphicAttribute>;\n subAttributes: Partial<IGraphicAttribute>[];\n };\n protected declare subGraphic: IGraphic[];\n\n static NOWORK_ANIMATE_ATTR = NOWORK_ANIMATE_ATTR;\n\n constructor(params: Partial<IGlyphGraphicAttribute>) {\n super(params);\n this.numberType = GLYPH_NUMBER_TYPE;\n this.subGraphic = [];\n this._onInit && this._onInit(this);\n this.valid = this.isValid();\n }\n\n setSubGraphic(subGraphic: IGraphic[]) {\n this.detachSubGraphic();\n this.subGraphic = subGraphic;\n subGraphic.forEach(g => {\n g.glyphHost = this;\n Object.setPrototypeOf(g.attribute, this.attribute);\n });\n this.valid = this.isValid();\n this.addUpdateBoundTag();\n }\n\n protected detachSubGraphic() {\n this.subGraphic.forEach(g => {\n g.glyphHost = null;\n Object.setPrototypeOf(g.attribute, {});\n });\n }\n\n getSubGraphic() {\n return this.subGraphic;\n }\n\n onInit(cb: (g: this) => void): void {\n this._onInit = cb;\n }\n\n onUpdate(cb: (g: this) => void): void {\n this._onUpdate = cb;\n }\n\n isValid(): boolean {\n return true;\n }\n\n setAttribute(key: string, value: any, forceUpdateTag?: boolean, context?: ISetAttributeContext) {\n super.setAttribute(key, value, forceUpdateTag, context);\n this.subGraphic.forEach(g => {\n g.addUpdateShapeAndBoundsTag();\n g.addUpdatePositionTag();\n });\n }\n\n setAttributes(\n params: Partial<IGlyphGraphicAttribute>,\n forceUpdateTag: boolean = false,\n context?: ISetAttributeContext\n ) {\n super.setAttributes(params, forceUpdateTag, context);\n this.subGraphic.forEach(g => {\n g.addUpdateShapeAndBoundsTag();\n g.addUpdatePositionTag();\n });\n }\n\n translate(x: number, y: number) {\n super.translate(x, y);\n\n this.subGraphic.forEach(g => {\n g.addUpdatePositionTag();\n g.addUpdateBoundTag();\n });\n return this;\n }\n\n translateTo(x: number, y: number) {\n super.translateTo(x, y);\n\n this.subGraphic.forEach(g => {\n g.addUpdatePositionTag();\n g.addUpdateBoundTag();\n });\n return this;\n }\n\n scale(scaleX: number, scaleY: number, scaleCenter?: IPointLike) {\n super.scale(scaleX, scaleY, scaleCenter);\n\n this.subGraphic.forEach(g => {\n g.addUpdatePositionTag();\n g.addUpdateBoundTag();\n });\n return this;\n }\n\n scaleTo(scaleX: number, scaleY: number) {\n super.scaleTo(scaleX, scaleY);\n\n this.subGraphic.forEach(g => {\n g.addUpdatePositionTag();\n g.addUpdateBoundTag();\n });\n return this;\n }\n\n rotate(angle: number) {\n super.rotate(angle);\n\n this.subGraphic.forEach(g => {\n g.addUpdatePositionTag();\n g.addUpdateBoundTag();\n });\n return this;\n }\n\n rotateTo(angle: number) {\n super.rotate(angle);\n\n this.subGraphic.forEach(g => {\n g.addUpdatePositionTag();\n g.addUpdateBoundTag();\n });\n return this;\n }\n\n protected doUpdateAABBBounds(): AABBBounds {\n this._AABBBounds.clear();\n const bounds = application.graphicService.updateGlyphAABBBounds(\n this.attribute,\n getTheme(this).glyph,\n this._AABBBounds,\n this\n ) as AABBBounds;\n this.clearUpdateBoundTag();\n return bounds;\n }\n\n protected needUpdateTags(keys: string[]): boolean {\n return false;\n }\n protected needUpdateTag(key: string): boolean {\n return false;\n }\n\n useStates(states: string[], hasAnimation?: boolean): void {\n if (!states.length) {\n this.clearStates(hasAnimation);\n return;\n }\n\n const isChange =\n this.currentStates?.length !== states.length ||\n states.some((stateName, index) => this.currentStates[index] !== stateName);\n if (!isChange) {\n return;\n }\n\n this.stopStateAnimates();\n\n const stateAttrs = {};\n const subAttrs = this.subGraphic.map(() => ({}));\n states.forEach(stateName => {\n const attrs = this.glyphStateProxy ? this.glyphStateProxy(stateName, states) : this.glyphStates[stateName];\n\n if (attrs) {\n Object.assign(stateAttrs, attrs.attributes);\n\n if (attrs.subAttributes?.length) {\n subAttrs.forEach((subAttrs, index) => {\n Object.assign(subAttrs, attrs.subAttributes[index]);\n });\n }\n }\n });\n\n this.subGraphic.forEach((graphic, index) => {\n graphic.updateNormalAttrs(subAttrs[index]);\n graphic.applyStateAttrs(subAttrs[index], states, hasAnimation);\n });\n\n this.updateNormalAttrs(stateAttrs);\n this.currentStates = states;\n this.applyStateAttrs(stateAttrs, states, hasAnimation);\n }\n\n clearStates(hasAnimation?: boolean) {\n this.stopStateAnimates();\n if (this.hasState() && this.normalAttrs) {\n this.currentStates = [];\n this.subGraphic.forEach(graphic => {\n graphic.applyStateAttrs(graphic.normalAttrs, this.currentStates, hasAnimation, true);\n graphic.normalAttrs = null;\n });\n this.applyStateAttrs(this.normalAttrs, this.currentStates, hasAnimation, true);\n } else {\n this.currentStates = [];\n }\n this.normalAttrs = null;\n }\n\n clone(): Graphic<Partial<IGlyphGraphicAttribute>> {\n const glyph = new Glyph({ ...this.attribute });\n glyph.setSubGraphic(this.subGraphic.map(g => g.clone()));\n return glyph;\n }\n\n getNoWorkAnimateAttr(): Record<string, number> {\n return Glyph.NOWORK_ANIMATE_ATTR;\n }\n}\n\nexport function createGlyph(attributes: IGlyphGraphicAttribute): IGlyph {\n return new Glyph(attributes);\n}\n"]}
1
+ {"version":3,"sources":["../src/graphic/glyph.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AASzD,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,MAAM,OAAO,KAAM,SAAQ,OAA+B;IAsBxD,YAAY,MAAuC;QACjD,KAAK,CAAC,MAAM,CAAC,CAAC;QAtBhB,SAAI,GAAgB,OAAO,CAAC;QAuB1B,IAAI,CAAC,UAAU,GAAG,iBAAiB,CAAC;QACpC,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;QACrB,IAAI,CAAC,OAAO,IA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WAAW,EAAE,IAAI,CAAC,aAAa,EAAE,YAAY,EAAE,IAAI,CAAC,CAAC;gBACrF,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC;YAC7B,CAAC,CAAC,CAAC;YACH,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,aAAa,EAAE,YAAY,EAAE,IAAI,CAAC,CAAC;SAChF;aAAM;YACL,IAAI,CAAC,aAAa,GAAG,EAAE,CAAC;SACzB;QACD,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;IAC1B,CAAC;IAED,KAAK;QACH,MAAM,KAAK,GAAG,IAAI,KAAK,mBAAM,IAAI,CAAC,SAAS,EAAG,CAAC;QAC/C,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;QACzD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,oBAAoB;QAClB,OAAO,KAAK,CAAC,mBAAmB,CAAC;IACnC,CAAC;;AAhOM,yBAAmB,GAAG,mBAAmB,CAAC;AAmOnD,MAAM,UAAU,WAAW,CAAC,UAAkC;IAC5D,OAAO,IAAI,KAAK,CAAC,UAAU,CAAC,CAAC;AAC/B,CAAC","file":"glyph.js","sourcesContent":["import type { AABBBounds, IAABBBounds, IPointLike } from '@visactor/vutils';\nimport { Graphic, NOWORK_ANIMATE_ATTR } from './graphic';\nimport type {\n GraphicType,\n IGraphic,\n IGlyph,\n IGlyphGraphicAttribute,\n IGraphicAttribute,\n ISetAttributeContext\n} from '../interface';\nimport { getTheme } from './theme';\nimport { application } from '../application';\nimport { GLYPH_NUMBER_TYPE } from './constants';\n\nexport class Glyph extends Graphic<IGlyphGraphicAttribute> implements IGlyph {\n type: GraphicType = 'glyph';\n declare _onInit: (g: IGlyph) => void;\n declare _onUpdate: (g: IGlyph) => void;\n declare glyphStates?: Record<\n string,\n {\n attributes: Partial<IGlyphGraphicAttribute>;\n subAttributes: Partial<IGraphicAttribute>[];\n }\n >;\n declare glyphStateProxy?: (\n stateName: string,\n targetStates?: string[]\n ) => {\n attributes: Partial<IGlyphGraphicAttribute>;\n subAttributes: Partial<IGraphicAttribute>[];\n };\n protected declare subGraphic: IGraphic[];\n\n static NOWORK_ANIMATE_ATTR = NOWORK_ANIMATE_ATTR;\n\n constructor(params: Partial<IGlyphGraphicAttribute>) {\n super(params);\n this.numberType = GLYPH_NUMBER_TYPE;\n this.subGraphic = [];\n this._onInit && this._onInit(this);\n this.valid = this.isValid();\n }\n\n setSubGraphic(subGraphic: IGraphic[]) {\n this.detachSubGraphic();\n this.subGraphic = subGraphic;\n subGraphic.forEach(g => {\n g.glyphHost = this;\n Object.setPrototypeOf(g.attribute, this.attribute);\n });\n this.valid = this.isValid();\n this.addUpdateBoundTag();\n }\n\n protected detachSubGraphic() {\n this.subGraphic.forEach(g => {\n g.glyphHost = null;\n Object.setPrototypeOf(g.attribute, {});\n });\n }\n\n getSubGraphic() {\n return this.subGraphic;\n }\n\n onInit(cb: (g: this) => void): void {\n this._onInit = cb;\n }\n\n onUpdate(cb: (g: this) => void): void {\n this._onUpdate = cb;\n }\n\n isValid(): boolean {\n return true;\n }\n\n setAttribute(key: string, value: any, forceUpdateTag?: boolean, context?: ISetAttributeContext) {\n super.setAttribute(key, value, forceUpdateTag, context);\n this.subGraphic.forEach(g => {\n g.addUpdateShapeAndBoundsTag();\n g.addUpdatePositionTag();\n });\n }\n\n setAttributes(\n params: Partial<IGlyphGraphicAttribute>,\n forceUpdateTag: boolean = false,\n context?: ISetAttributeContext\n ) {\n super.setAttributes(params, forceUpdateTag, context);\n this.subGraphic.forEach(g => {\n g.addUpdateShapeAndBoundsTag();\n g.addUpdatePositionTag();\n });\n }\n\n translate(x: number, y: number) {\n super.translate(x, y);\n\n this.subGraphic.forEach(g => {\n g.addUpdatePositionTag();\n g.addUpdateBoundTag();\n });\n return this;\n }\n\n translateTo(x: number, y: number) {\n super.translateTo(x, y);\n\n this.subGraphic.forEach(g => {\n g.addUpdatePositionTag();\n g.addUpdateBoundTag();\n });\n return this;\n }\n\n scale(scaleX: number, scaleY: number, scaleCenter?: IPointLike) {\n super.scale(scaleX, scaleY, scaleCenter);\n\n this.subGraphic.forEach(g => {\n g.addUpdatePositionTag();\n g.addUpdateBoundTag();\n });\n return this;\n }\n\n scaleTo(scaleX: number, scaleY: number) {\n super.scaleTo(scaleX, scaleY);\n\n this.subGraphic.forEach(g => {\n g.addUpdatePositionTag();\n g.addUpdateBoundTag();\n });\n return this;\n }\n\n rotate(angle: number) {\n super.rotate(angle);\n\n this.subGraphic.forEach(g => {\n g.addUpdatePositionTag();\n g.addUpdateBoundTag();\n });\n return this;\n }\n\n rotateTo(angle: number) {\n super.rotate(angle);\n\n this.subGraphic.forEach(g => {\n g.addUpdatePositionTag();\n g.addUpdateBoundTag();\n });\n return this;\n }\n\n getGraphicTheme(): Required<IGlyphGraphicAttribute> {\n return getTheme(this as IGraphic).glyph;\n }\n\n protected updateAABBBounds(\n attribute: IGlyphGraphicAttribute,\n theme: Required<IGlyphGraphicAttribute>,\n aabbBounds: IAABBBounds\n ) {\n if (!application.graphicService.validCheck(attribute, theme, aabbBounds, this)) {\n return aabbBounds;\n }\n // 添加子节点\n this.getSubGraphic().forEach((node: IGraphic) => {\n aabbBounds.union(node.AABBBounds);\n });\n\n // glyph不需要计算AABBBounds\n // this.transformAABBBounds(attribute, aabbBounds, theme, graphic);\n return aabbBounds;\n }\n\n protected doUpdateAABBBounds(): AABBBounds {\n this._AABBBounds.clear();\n const bounds = this.updateAABBBounds(this.attribute, this.getGraphicTheme(), this._AABBBounds) as AABBBounds;\n this.clearUpdateBoundTag();\n return bounds;\n }\n\n protected needUpdateTags(keys: string[]): boolean {\n return false;\n }\n protected needUpdateTag(key: string): boolean {\n return false;\n }\n\n useStates(states: string[], hasAnimation?: boolean): void {\n if (!states.length) {\n this.clearStates(hasAnimation);\n return;\n }\n\n const isChange =\n this.currentStates?.length !== states.length ||\n states.some((stateName, index) => this.currentStates[index] !== stateName);\n if (!isChange) {\n return;\n }\n\n this.stopStateAnimates();\n\n const stateAttrs = {};\n const subAttrs = this.subGraphic.map(() => ({}));\n states.forEach(stateName => {\n const attrs = this.glyphStateProxy ? this.glyphStateProxy(stateName, states) : this.glyphStates[stateName];\n\n if (attrs) {\n Object.assign(stateAttrs, attrs.attributes);\n\n if (attrs.subAttributes?.length) {\n subAttrs.forEach((subAttrs, index) => {\n Object.assign(subAttrs, attrs.subAttributes[index]);\n });\n }\n }\n });\n\n this.subGraphic.forEach((graphic, index) => {\n graphic.updateNormalAttrs(subAttrs[index]);\n graphic.applyStateAttrs(subAttrs[index], states, hasAnimation);\n });\n\n this.updateNormalAttrs(stateAttrs);\n this.currentStates = states;\n this.applyStateAttrs(stateAttrs, states, hasAnimation);\n }\n\n clearStates(hasAnimation?: boolean) {\n this.stopStateAnimates();\n if (this.hasState() && this.normalAttrs) {\n this.currentStates = [];\n this.subGraphic.forEach(graphic => {\n graphic.applyStateAttrs(graphic.normalAttrs, this.currentStates, hasAnimation, true);\n graphic.normalAttrs = null;\n });\n this.applyStateAttrs(this.normalAttrs, this.currentStates, hasAnimation, true);\n } else {\n this.currentStates = [];\n }\n this.normalAttrs = null;\n }\n\n clone(): IGraphic<Partial<IGlyphGraphicAttribute>> {\n const glyph = new Glyph({ ...this.attribute });\n glyph.setSubGraphic(this.subGraphic.map(g => g.clone()));\n return glyph;\n }\n\n getNoWorkAnimateAttr(): Record<string, number> {\n return Glyph.NOWORK_ANIMATE_ATTR;\n }\n}\n\nexport function createGlyph(attributes: IGlyphGraphicAttribute): IGlyph {\n return new Glyph(attributes);\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/graphic/graphic-creator.ts"],"names":[],"mappings":"AA8IA,MAAM,cAAc;IAiBlB;QACE,IAAI,CAAC,KAAK,GAAG,IAAI,GAAG,EAAE,CAAC;IACzB,CAAC;IAED,sBAAsB,CAAC,IAAY,EAAE,EAAO;QAC1C,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QACzB,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;IAClB,CAAC;IAED,aAAa,CAAC,IAAY,EAAE,MAAW;QACrC,MAAM,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAChC,IAAI,CAAC,EAAE,EAAE;YACP,OAAO,IAAI,CAAC;SACb;QACD,OAAO,EAAE,CAAC,MAAM,CAAC,CAAC;IACpB,CAAC;CACF;AAED,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,cAAc,EAAE,CAAC","file":"graphic-creator.js","sourcesContent":["// import type {\n// IArc,\n// IArcGraphicAttribute,\n// IArea,\n// IAreaGraphicAttribute,\n// ICircle,\n// ICircleGraphicAttribute,\n// IGroup,\n// IGroupGraphicAttribute,\n// IImageGraphicAttribute,\n// ILine,\n// ILineGraphicAttribute,\n// IPath,\n// IPathGraphicAttribute,\n// IPolygonGraphicAttribute,\n// IRect,\n// IRectGraphicAttribute,\n// ISymbolGraphicAttribute,\n// IText,\n// ITextGraphicAttribute,\n// ISymbol,\n// IImage,\n// IPolygon,\n// IShadowRoot,\n// IGraphic,\n// IRichTextGraphicAttribute,\n// IRichText,\n// IGlyph,\n// IGlyphGraphicAttribute,\n// IRect3d,\n// IRect3dGraphicAttribute,\n// IArc3dGraphicAttribute,\n// IPyramid3dGraphicAttribute,\n// IPyramid3d,\n// IWrapTextGraphicAttribute\n// } from '../interface';\n// import { Arc } from './arc';\n// import { Area } from './area';\n// import { Circle } from './circle';\n// import { Group } from './group';\n// import { Image } from './image';\n// import { Line } from './line';\n// import { Path } from './path';\n// import { Polygon } from './polygon';\n// import { Rect } from './rect';\n// // 这里git会将Symbol强行转成小写symbol,先重命名一下\n// import { Symbol as MarkSymbol } from './symbol';\n// import { ShadowRoot as MarkShadowRoot } from './shadow-root';\n// import { Text } from './text';\n// import { RichText } from './richtext';\n// import { Glyph } from './glyph';\n// import { Rect3d } from './rect3d';\n// import { Arc3d } from './arc3d';\n// import { Pyramid3d } from './pyramid3d';\n// import { WrapText } from './wrap-text';\n\nimport type {\n IArc,\n IArcGraphicAttribute,\n IArea,\n IAreaGraphicAttribute,\n ICircle,\n ICircleGraphicAttribute,\n IGroup,\n IGroupGraphicAttribute,\n IImage,\n IImageGraphicAttribute,\n ILine,\n ILineGraphicAttribute,\n IPath,\n IPathGraphicAttribute,\n IPolygon,\n IPolygonGraphicAttribute,\n IRect,\n IRect3d,\n IRect3dGraphicAttribute,\n IRectGraphicAttribute,\n IRichText,\n IRichTextGraphicAttribute,\n IShadowRoot,\n ISymbol,\n ISymbolGraphicAttribute,\n IText,\n ITextGraphicAttribute,\n IWrapTextGraphicAttribute\n} from '../interface';\n\n// export function createArc(attributes: IArcGraphicAttribute): IArc {\n// return new Arc(attributes);\n// }\n// export function createArc3d(attributes: IArc3dGraphicAttribute): IArc {\n// return new Arc3d(attributes);\n// }\n// export function createPyramid3d(attributes: IPyramid3dGraphicAttribute): IPyramid3d {\n// return new Pyramid3d(attributes);\n// }\n// export function createArea(attributes: IAreaGraphicAttribute): IArea {\n// return new Area(attributes);\n// }\n// export function createCircle(attributes: ICircleGraphicAttribute): ICircle {\n// return new Circle(attributes);\n// }\n// export function createGroup(attributes: IGroupGraphicAttribute): IGroup {\n// return new Group(attributes);\n// }\n// export function createLine(attributes: ILineGraphicAttribute): ILine {\n// return new Line(attributes);\n// }\n// export function createPath(attributes: IPathGraphicAttribute): IPath {\n// return new Path(attributes);\n// }\n// export function createRect(attributes: IRectGraphicAttribute): IRect {\n// return new Rect(attributes);\n// }\n// export function createRect3d(attributes: IRect3dGraphicAttribute): IRect3d {\n// return new Rect3d(attributes);\n// }\n// export function createGlyph(attributes: IGlyphGraphicAttribute): IGlyph {\n// return new Glyph(attributes);\n// }\n// export function createText(attributes: ITextGraphicAttribute): IText {\n// return new Text(attributes);\n// }\n// export function createWrapText(attributes: IWrapTextGraphicAttribute): IText {\n// return new WrapText(attributes);\n// }\n// export function createSymbol(attributes: ISymbolGraphicAttribute): ISymbol {\n// return new MarkSymbol(attributes);\n// }\n// export function createImage(attributes: IImageGraphicAttribute): IImage {\n// return new Image(attributes);\n// }\n// export function createPolygon(attributes: IPolygonGraphicAttribute): IPolygon {\n// return new Polygon(attributes);\n// }\n// export function createShadowRoot(graphic?: IGraphic): IShadowRoot {\n// return new MarkShadowRoot(graphic);\n// }\n// export function createRichText(attributes: IRichTextGraphicAttribute): IRichText {\n// return new RichText(attributes);\n// }\n\nclass GraphicCreator {\n declare store: Map<string, any>;\n declare arc?: (attribute: IArcGraphicAttribute) => IArc;\n declare area?: (attribute: IAreaGraphicAttribute) => IArea;\n declare circle?: (attribute: ICircleGraphicAttribute) => ICircle;\n declare group?: (attribute: IGroupGraphicAttribute) => IGroup;\n declare image?: (attribute: IImageGraphicAttribute) => IImage;\n declare line?: (attribute: ILineGraphicAttribute) => ILine;\n declare path?: (attribute: IPathGraphicAttribute) => IPath;\n declare rect?: (attribute: IRectGraphicAttribute) => IRect;\n declare rect3d?: (attribute: IRect3dGraphicAttribute) => IRect3d;\n declare symbol?: (attribute: ISymbolGraphicAttribute) => ISymbol;\n declare text?: (attribute: ITextGraphicAttribute) => IText;\n declare richtext?: (attribute: IRichTextGraphicAttribute) => IRichText;\n declare polygon?: (attribute: IPolygonGraphicAttribute) => IPolygon;\n declare shadowRoot?: (attribute: IGroupGraphicAttribute) => IShadowRoot;\n declare wraptext?: (attribute: IWrapTextGraphicAttribute) => IText;\n constructor() {\n this.store = new Map();\n }\n\n RegisterGraphicCreator(name: string, cb: any) {\n this.store.set(name, cb);\n this[name] = cb;\n }\n\n CreateGraphic(name: string, params: any) {\n const cb = this.store.get(name);\n if (!cb) {\n return null;\n }\n return cb(params);\n }\n}\n\nexport const graphicCreator = new GraphicCreator();\n\n// export const graphicCreator = {\n// arc: createArc,\n// area: createArea,\n// circle: createCircle,\n// group: createGroup,\n// image: createImage,\n// line: createLine,\n// path: createPath,\n// rect: createRect,\n// rect3d: createRect3d,\n// symbol: createSymbol,\n// text: createText,\n// richtext: createRichText,\n// polygon: createPolygon,\n// shadowRoot: createShadowRoot,\n// wrapText: createWrapText\n// };\n"]}
1
+ {"version":3,"sources":["../src/graphic/graphic-creator.ts"],"names":[],"mappings":"AA8IA,MAAM,cAAc;IAiBlB;QACE,IAAI,CAAC,KAAK,GAAG,IAAI,GAAG,EAAE,CAAC;IACzB,CAAC;IAED,sBAAsB,CAAC,IAAY,EAAE,EAAO;QAC1C,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QACxB,IAAY,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;IAC3B,CAAC;IAED,aAAa,CAAC,IAAY,EAAE,MAAW;QACrC,MAAM,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAChC,IAAI,CAAC,EAAE,EAAE;YACP,OAAO,IAAI,CAAC;SACb;QACD,OAAO,EAAE,CAAC,MAAM,CAAC,CAAC;IACpB,CAAC;CACF;AAED,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,cAAc,EAAE,CAAC","file":"graphic-creator.js","sourcesContent":["// import type {\n// IArc,\n// IArcGraphicAttribute,\n// IArea,\n// IAreaGraphicAttribute,\n// ICircle,\n// ICircleGraphicAttribute,\n// IGroup,\n// IGroupGraphicAttribute,\n// IImageGraphicAttribute,\n// ILine,\n// ILineGraphicAttribute,\n// IPath,\n// IPathGraphicAttribute,\n// IPolygonGraphicAttribute,\n// IRect,\n// IRectGraphicAttribute,\n// ISymbolGraphicAttribute,\n// IText,\n// ITextGraphicAttribute,\n// ISymbol,\n// IImage,\n// IPolygon,\n// IShadowRoot,\n// IGraphic,\n// IRichTextGraphicAttribute,\n// IRichText,\n// IGlyph,\n// IGlyphGraphicAttribute,\n// IRect3d,\n// IRect3dGraphicAttribute,\n// IArc3dGraphicAttribute,\n// IPyramid3dGraphicAttribute,\n// IPyramid3d,\n// IWrapTextGraphicAttribute\n// } from '../interface';\n// import { Arc } from './arc';\n// import { Area } from './area';\n// import { Circle } from './circle';\n// import { Group } from './group';\n// import { Image } from './image';\n// import { Line } from './line';\n// import { Path } from './path';\n// import { Polygon } from './polygon';\n// import { Rect } from './rect';\n// // 这里git会将Symbol强行转成小写symbol,先重命名一下\n// import { Symbol as MarkSymbol } from './symbol';\n// import { ShadowRoot as MarkShadowRoot } from './shadow-root';\n// import { Text } from './text';\n// import { RichText } from './richtext';\n// import { Glyph } from './glyph';\n// import { Rect3d } from './rect3d';\n// import { Arc3d } from './arc3d';\n// import { Pyramid3d } from './pyramid3d';\n// import { WrapText } from './wrap-text';\n\nimport type {\n IArc,\n IArcGraphicAttribute,\n IArea,\n IAreaGraphicAttribute,\n ICircle,\n ICircleGraphicAttribute,\n IGroup,\n IGroupGraphicAttribute,\n IImage,\n IImageGraphicAttribute,\n ILine,\n ILineGraphicAttribute,\n IPath,\n IPathGraphicAttribute,\n IPolygon,\n IPolygonGraphicAttribute,\n IRect,\n IRect3d,\n IRect3dGraphicAttribute,\n IRectGraphicAttribute,\n IRichText,\n IRichTextGraphicAttribute,\n IShadowRoot,\n ISymbol,\n ISymbolGraphicAttribute,\n IText,\n ITextGraphicAttribute,\n IWrapTextGraphicAttribute\n} from '../interface';\n\n// export function createArc(attributes: IArcGraphicAttribute): IArc {\n// return new Arc(attributes);\n// }\n// export function createArc3d(attributes: IArc3dGraphicAttribute): IArc {\n// return new Arc3d(attributes);\n// }\n// export function createPyramid3d(attributes: IPyramid3dGraphicAttribute): IPyramid3d {\n// return new Pyramid3d(attributes);\n// }\n// export function createArea(attributes: IAreaGraphicAttribute): IArea {\n// return new Area(attributes);\n// }\n// export function createCircle(attributes: ICircleGraphicAttribute): ICircle {\n// return new Circle(attributes);\n// }\n// export function createGroup(attributes: IGroupGraphicAttribute): IGroup {\n// return new Group(attributes);\n// }\n// export function createLine(attributes: ILineGraphicAttribute): ILine {\n// return new Line(attributes);\n// }\n// export function createPath(attributes: IPathGraphicAttribute): IPath {\n// return new Path(attributes);\n// }\n// export function createRect(attributes: IRectGraphicAttribute): IRect {\n// return new Rect(attributes);\n// }\n// export function createRect3d(attributes: IRect3dGraphicAttribute): IRect3d {\n// return new Rect3d(attributes);\n// }\n// export function createGlyph(attributes: IGlyphGraphicAttribute): IGlyph {\n// return new Glyph(attributes);\n// }\n// export function createText(attributes: ITextGraphicAttribute): IText {\n// return new Text(attributes);\n// }\n// export function createWrapText(attributes: IWrapTextGraphicAttribute): IText {\n// return new WrapText(attributes);\n// }\n// export function createSymbol(attributes: ISymbolGraphicAttribute): ISymbol {\n// return new MarkSymbol(attributes);\n// }\n// export function createImage(attributes: IImageGraphicAttribute): IImage {\n// return new Image(attributes);\n// }\n// export function createPolygon(attributes: IPolygonGraphicAttribute): IPolygon {\n// return new Polygon(attributes);\n// }\n// export function createShadowRoot(graphic?: IGraphic): IShadowRoot {\n// return new MarkShadowRoot(graphic);\n// }\n// export function createRichText(attributes: IRichTextGraphicAttribute): IRichText {\n// return new RichText(attributes);\n// }\n\nclass GraphicCreator {\n declare store: Map<string, any>;\n declare arc?: (attribute: IArcGraphicAttribute) => IArc;\n declare area?: (attribute: IAreaGraphicAttribute) => IArea;\n declare circle?: (attribute: ICircleGraphicAttribute) => ICircle;\n declare group?: (attribute: IGroupGraphicAttribute) => IGroup;\n declare image?: (attribute: IImageGraphicAttribute) => IImage;\n declare line?: (attribute: ILineGraphicAttribute) => ILine;\n declare path?: (attribute: IPathGraphicAttribute) => IPath;\n declare rect?: (attribute: IRectGraphicAttribute) => IRect;\n declare rect3d?: (attribute: IRect3dGraphicAttribute) => IRect3d;\n declare symbol?: (attribute: ISymbolGraphicAttribute) => ISymbol;\n declare text?: (attribute: ITextGraphicAttribute) => IText;\n declare richtext?: (attribute: IRichTextGraphicAttribute) => IRichText;\n declare polygon?: (attribute: IPolygonGraphicAttribute) => IPolygon;\n declare shadowRoot?: (attribute: IGroupGraphicAttribute) => IShadowRoot;\n declare wraptext?: (attribute: IWrapTextGraphicAttribute) => IText;\n constructor() {\n this.store = new Map();\n }\n\n RegisterGraphicCreator(name: string, cb: any) {\n this.store.set(name, cb);\n (this as any)[name] = cb;\n }\n\n CreateGraphic(name: string, params: any) {\n const cb = this.store.get(name);\n if (!cb) {\n return null;\n }\n return cb(params);\n }\n}\n\nexport const graphicCreator = new GraphicCreator();\n\n// export const graphicCreator = {\n// arc: createArc,\n// area: createArea,\n// circle: createCircle,\n// group: createGroup,\n// image: createImage,\n// line: createLine,\n// path: createPath,\n// rect: createRect,\n// rect3d: createRect3d,\n// symbol: createSymbol,\n// text: createText,\n// richtext: createRichText,\n// polygon: createPolygon,\n// shadowRoot: createShadowRoot,\n// wrapText: createWrapText\n// };\n"]}
@@ -0,0 +1,3 @@
1
+ import type { IAABBBounds } from '@visactor/vutils';
2
+ import type { IGraphicAttribute } from '../../interface';
3
+ export declare const updateBoundsOfCommonOuterBorder: (attribute: Partial<IGraphicAttribute>, theme: Required<IGraphicAttribute>, aabbBounds: IAABBBounds) => import("@visactor/vutils").IBounds;
@@ -0,0 +1,9 @@
1
+ export const updateBoundsOfCommonOuterBorder = (attribute, theme, aabbBounds) => {
2
+ const {outerBorder: outerBorder, shadowBlur: shadowBlur = theme.shadowBlur} = attribute;
3
+ if (outerBorder) {
4
+ const defaultOuterBorder = theme.outerBorder, {distance: distance = defaultOuterBorder.distance, lineWidth: lineWidth = defaultOuterBorder.lineWidth} = outerBorder;
5
+ aabbBounds.expand(distance + (shadowBlur + lineWidth) / 2);
6
+ }
7
+ return aabbBounds;
8
+ };
9
+ //# sourceMappingURL=common-outer-boder-bounds.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/graphic/graphic-service/common-outer-boder-bounds.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAC7C,SAAqC,EACrC,KAAkC,EAClC,UAAuB,EACvB,EAAE;IACF,MAAM,EAAE,WAAW,EAAE,UAAU,GAAG,KAAK,CAAC,UAAU,EAAE,GAAG,SAAS,CAAC;IACjE,IAAI,WAAW,EAAE;QACf,MAAM,kBAAkB,GAAG,KAAK,CAAC,WAAW,CAAC;QAC7C,MAAM,EAAE,QAAQ,GAAG,kBAAkB,CAAC,QAAQ,EAAE,SAAS,GAAG,kBAAkB,CAAC,SAAS,EAAE,GAAG,WAAW,CAAC;QAGzG,UAAU,CAAC,MAAM,CAAE,QAAmB,GAAG,CAAC,UAAU,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;KACxE;IACD,OAAO,UAAU,CAAC;AACpB,CAAC,CAAC","file":"common-outer-boder-bounds.js","sourcesContent":["import type { IAABBBounds } from '@visactor/vutils';\nimport type { IGraphicAttribute } from '../../interface';\n\nexport const updateBoundsOfCommonOuterBorder = (\n attribute: Partial<IGraphicAttribute>,\n theme: Required<IGraphicAttribute>,\n aabbBounds: IAABBBounds\n) => {\n const { outerBorder, shadowBlur = theme.shadowBlur } = attribute;\n if (outerBorder) {\n const defaultOuterBorder = theme.outerBorder;\n const { distance = defaultOuterBorder.distance, lineWidth = defaultOuterBorder.lineWidth } = outerBorder;\n\n // rect的distance一定是number\n aabbBounds.expand((distance as number) + (shadowBlur + lineWidth) / 2);\n }\n return aabbBounds;\n};\n"]}
@@ -1,6 +1,6 @@
1
- import type { IAABBBounds, IBounds } from '@visactor/vutils';
1
+ import type { IAABBBounds } from '@visactor/vutils';
2
2
  import { AABBBounds } from '@visactor/vutils';
3
- import type { mat4, IArc, IArcGraphicAttribute, IArea, IAreaGraphicAttribute, IGraphicAttribute, ICircle, ICircleGraphicAttribute, IGraphic, IGroup, IGroupGraphicAttribute, ILine, ILineGraphicAttribute, IPath, IPathGraphicAttribute, IPolygon, IPolygonGraphicAttribute, IRectGraphicAttribute, IStage, ISymbol, ISymbolGraphicAttribute, IText, ITextGraphicAttribute, IGlyph, IGlyphGraphicAttribute, IRichTextGraphicAttribute, IRichText, IPyramid3dGraphicAttribute, IPyramid3d, IArc3dGraphicAttribute, IArc3d, IImageGraphicAttribute, ITransform, IGraphicService, IGraphicCreator, ISyncHook, IRectBoundsContribution, ISymbolBoundsContribution, ICircleBoundsContribution, IArcBoundsContribution, IPathBoundsContribution, IImageBoundsContribution } from '../../interface';
3
+ import type { mat4, IGraphicAttribute, IGraphic, IGroup, IStage, IText, ITextGraphicAttribute, ITransform, IGraphicService, IGraphicCreator, ISyncHook } from '../../interface';
4
4
  export declare function getExtraModelMatrix(dx: number, dy: number, graphic: IGraphic): mat4 | null;
5
5
  export declare function getModelMatrix(out: mat4, graphic: IGraphic, theme: ITransform): void;
6
6
  export declare function shouldUseMat4(graphic: IGraphic): number;
@@ -18,12 +18,6 @@ export declare class DefaultGraphicService implements IGraphicService {
18
18
  globalAABBBounds: IAABBBounds;
19
19
  }, boolean]>;
20
20
  };
21
- protected _rectBoundsContribitions: IRectBoundsContribution[];
22
- protected _symbolBoundsContribitions: ISymbolBoundsContribution[];
23
- protected _imageBoundsContribitions: IImageBoundsContribution[];
24
- protected _circleBoundsContribitions: ICircleBoundsContribution[];
25
- protected _arcBoundsContribitions: IArcBoundsContribution[];
26
- protected _pathBoundsContribitions: IPathBoundsContribution[];
27
21
  protected tempAABBBounds1: AABBBounds;
28
22
  protected tempAABBBounds2: AABBBounds;
29
23
  constructor(creator: IGraphicCreator);
@@ -38,35 +32,12 @@ export declare class DefaultGraphicService implements IGraphicService {
38
32
  globalAABBBounds: IAABBBounds;
39
33
  }, selfChange: boolean): void;
40
34
  updatePathProxyAABBBounds(aabbBounds: IAABBBounds, graphic?: IGraphic): boolean;
41
- updateRectAABBBounds(attribute: IRectGraphicAttribute, rectTheme: Required<IRectGraphicAttribute>, aabbBounds: IAABBBounds, graphic?: IGraphic): IBounds;
42
- updateGroupAABBBounds(attribute: IGroupGraphicAttribute, groupTheme: Required<IGroupGraphicAttribute>, aabbBounds: IAABBBounds, graphic?: IGroup): IBounds;
43
- updateGlyphAABBBounds(attribute: IGlyphGraphicAttribute, theme: Required<IGlyphGraphicAttribute>, aabbBounds: IAABBBounds, graphic?: IGlyph): IBounds;
44
35
  updateHTMLTextAABBBounds(attribute: ITextGraphicAttribute, textTheme: Required<ITextGraphicAttribute>, aabbBounds: IAABBBounds, graphic?: IText): void;
45
- updateRichTextAABBBounds(attribute: IRichTextGraphicAttribute, richtextTheme: Required<IRichTextGraphicAttribute>, aabbBounds: IAABBBounds, graphic?: IRichText): IBounds;
46
- updateTextAABBBounds(attribute: ITextGraphicAttribute, textTheme: Required<ITextGraphicAttribute>, aabbBounds: IAABBBounds, graphic?: IText): IBounds;
47
- updatePathAABBBounds(attribute: IPathGraphicAttribute, pathTheme: Required<IPathGraphicAttribute>, aabbBounds: IAABBBounds, graphic?: IPath): IBounds;
48
- protected updatePathAABBBoundsImprecise(attribute: IPathGraphicAttribute, pathTheme: Required<IPathGraphicAttribute>, aabbBounds: IAABBBounds, graphic?: IPath): IAABBBounds;
49
- updatePyramid3dAABBBounds(attribute: IPyramid3dGraphicAttribute, polygonTheme: Required<IPyramid3dGraphicAttribute>, aabbBounds: IBounds, graphic?: IPyramid3d): IBounds;
50
- updateArc3dAABBBounds(attribute: IArc3dGraphicAttribute, arcTheme: Required<IArc3dGraphicAttribute>, aabbBounds: IBounds, graphic?: IArc3d): IBounds;
51
- updatePolygonAABBBounds(attribute: IPolygonGraphicAttribute, polygonTheme: Required<IPolygonGraphicAttribute>, aabbBounds: IAABBBounds, graphic?: IPolygon): IBounds;
52
- protected updatePolygonAABBBoundsImprecise(attribute: IPolygonGraphicAttribute, polygonTheme: Required<IPolygonGraphicAttribute>, aabbBounds: IAABBBounds, graphic?: IPolygon): IAABBBounds;
53
- updateLineAABBBounds(attribute: ILineGraphicAttribute, lineTheme: Required<ILineGraphicAttribute>, aabbBounds: IAABBBounds, graphic?: ILine): IBounds;
54
- protected updateLineAABBBoundsByPoints(attribute: ILineGraphicAttribute, lineTheme: Required<ILineGraphicAttribute>, aabbBounds: IAABBBounds, graphic?: ILine): IAABBBounds;
55
- protected updateLineAABBBoundsBySegments(attribute: ILineGraphicAttribute, lineTheme: Required<ILineGraphicAttribute>, aabbBounds: IAABBBounds, graphic?: ILine): IAABBBounds;
56
- updateAreaAABBBounds(attribute: IAreaGraphicAttribute, areaTheme: Required<IAreaGraphicAttribute>, aabbBounds: IAABBBounds, graphic?: IArea): IBounds;
57
- protected updateAreaAABBBoundsByPoints(attribute: IAreaGraphicAttribute, areaTheme: Required<IAreaGraphicAttribute>, aabbBounds: IAABBBounds, graphic?: IArea): IAABBBounds;
58
- protected updateAreaAABBBoundsBySegments(attribute: IAreaGraphicAttribute, areaTheme: Required<IAreaGraphicAttribute>, aabbBounds: IAABBBounds, graphic?: IArea): IAABBBounds;
59
- updateCircleAABBBounds(attribute: ICircleGraphicAttribute, circleTheme: Required<ICircleGraphicAttribute>, aabbBounds: IAABBBounds, full?: boolean, graphic?: ICircle): IBounds;
60
- protected updateCircleAABBBoundsImprecise(attribute: ICircleGraphicAttribute, circleTheme: Required<ICircleGraphicAttribute>, aabbBounds: IAABBBounds, graphic?: IGraphic): IAABBBounds;
61
- protected updateCircleAABBBoundsAccurate(attribute: ICircleGraphicAttribute, circleTheme: Required<ICircleGraphicAttribute>, aabbBounds: IAABBBounds, graphic?: IGraphic): IAABBBounds;
62
- updateArcAABBBounds(attribute: IArcGraphicAttribute, arcTheme: Required<IArcGraphicAttribute>, aabbBounds: IAABBBounds, full?: boolean, graphic?: IArc): IBounds;
63
- protected updateArcAABBBoundsImprecise(attribute: IArcGraphicAttribute, arcTheme: Required<IArcGraphicAttribute>, aabbBounds: IAABBBounds, graphic?: IGraphic): IAABBBounds;
64
- protected updateArcAABBBoundsAccurate(attribute: IArcGraphicAttribute, arcTheme: Required<IArcGraphicAttribute>, aabbBounds: IAABBBounds, graphic?: IGraphic): IAABBBounds;
65
- updateSymbolAABBBounds(attribute: ISymbolGraphicAttribute, symbolTheme: Required<ISymbolGraphicAttribute>, aabbBounds: IAABBBounds, full?: boolean, graphic?: ISymbol): IBounds;
66
- protected updateSymbolAABBBoundsImprecise(attribute: ISymbolGraphicAttribute, symbolTheme: Required<ISymbolGraphicAttribute>, aabbBounds: IAABBBounds, graphic?: IGraphic): IAABBBounds;
67
- protected updateSymbolAABBBoundsAccurate(attribute: ISymbolGraphicAttribute, symbolTheme: Required<ISymbolGraphicAttribute>, aabbBounds: IAABBBounds, graphic?: ISymbol): IAABBBounds;
68
- updateImageAABBBounds(attribute: IImageGraphicAttribute, imageTheme: Required<IImageGraphicAttribute>, aabbBounds: IAABBBounds, graphic?: IGraphic): IBounds;
69
36
  combindShadowAABBBounds(bounds: IAABBBounds, graphic?: IGraphic): void;
70
37
  transformAABBBounds(attribute: Partial<IGraphicAttribute>, aabbBounds: IAABBBounds, theme: Required<IGraphicAttribute>, miter: boolean, graphic?: IGraphic): void;
71
- protected _validCheck(attribute: Partial<IGraphicAttribute>, theme: Required<IGraphicAttribute>, aabbBounds: IAABBBounds, graphic?: IGraphic): boolean;
38
+ validCheck(attribute: Partial<IGraphicAttribute>, theme: Required<IGraphicAttribute>, aabbBounds: IAABBBounds, graphic?: IGraphic): boolean;
39
+ updateTempAABBBounds(aabbBounds: IAABBBounds): {
40
+ tb1: AABBBounds;
41
+ tb2: AABBBounds;
42
+ };
72
43
  }