@antv/g6 5.0.0-beta.27 → 5.0.0-beta.28

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 (464) hide show
  1. package/LICENSE +21 -0
  2. package/dist/g6.min.js +2 -2
  3. package/esm/constant/shape.d.ts +1 -1
  4. package/esm/index.d.ts +4 -2
  5. package/esm/index.js +1 -1
  6. package/esm/index.js.map +1 -1
  7. package/esm/item/combo.js +3 -1
  8. package/esm/item/combo.js.map +1 -1
  9. package/esm/item/edge.js +7 -2
  10. package/esm/item/edge.js.map +1 -1
  11. package/esm/item/item.d.ts +2 -2
  12. package/esm/item/item.js +13 -6
  13. package/esm/item/item.js.map +1 -1
  14. package/esm/item/node.d.ts +1 -0
  15. package/esm/item/node.js +12 -2
  16. package/esm/item/node.js.map +1 -1
  17. package/esm/runtime/controller/data.js +15 -10
  18. package/esm/runtime/controller/data.js.map +1 -1
  19. package/esm/runtime/controller/interaction.js +4 -3
  20. package/esm/runtime/controller/interaction.js.map +1 -1
  21. package/esm/runtime/controller/item.d.ts +3 -2
  22. package/esm/runtime/controller/item.js +45 -22
  23. package/esm/runtime/controller/item.js.map +1 -1
  24. package/esm/runtime/controller/layout.js +7 -10
  25. package/esm/runtime/controller/layout.js.map +1 -1
  26. package/esm/runtime/controller/plugin.js +1 -1
  27. package/esm/runtime/controller/plugin.js.map +1 -1
  28. package/esm/runtime/graph.d.ts +19 -6
  29. package/esm/runtime/graph.js +62 -27
  30. package/esm/runtime/graph.js.map +1 -1
  31. package/esm/runtime/hooks.d.ts +2 -2
  32. package/esm/runtime/hooks.js +2 -2
  33. package/esm/stdlib/behavior/create-edge.d.ts +1 -1
  34. package/esm/stdlib/behavior/drag-canvas.d.ts +1 -1
  35. package/esm/stdlib/behavior/drag-node.d.ts +1 -1
  36. package/esm/stdlib/behavior/drag-node.js +1 -1
  37. package/esm/stdlib/behavior/drag-node.js.map +1 -1
  38. package/esm/stdlib/behavior/hover-activate.d.ts +1 -1
  39. package/esm/stdlib/behavior/orbit-canvas-3d.d.ts +1 -1
  40. package/esm/stdlib/behavior/rotate-canvas-3d.d.ts +2 -2
  41. package/esm/stdlib/behavior/scroll-canvas.js +5 -5
  42. package/esm/stdlib/behavior/scroll-canvas.js.map +1 -1
  43. package/esm/stdlib/behavior/track-canvas-3d.d.ts +1 -1
  44. package/esm/stdlib/behavior/zoom-canvas-3d.d.ts +1 -1
  45. package/esm/stdlib/behavior/zoom-canvas.d.ts +16 -0
  46. package/esm/stdlib/behavior/zoom-canvas.js +107 -5
  47. package/esm/stdlib/behavior/zoom-canvas.js.map +1 -1
  48. package/esm/stdlib/data/transformV4Data.js +12 -6
  49. package/esm/stdlib/data/transformV4Data.js.map +1 -1
  50. package/esm/stdlib/index.d.ts +6 -4
  51. package/esm/stdlib/index.js +8 -6
  52. package/esm/stdlib/index.js.map +1 -1
  53. package/esm/stdlib/item/combo/circle.js +12 -7
  54. package/esm/stdlib/item/combo/circle.js.map +1 -1
  55. package/esm/stdlib/item/combo/rect.js +12 -7
  56. package/esm/stdlib/item/combo/rect.js.map +1 -1
  57. package/esm/stdlib/item/edge/base.d.ts +22 -5
  58. package/esm/stdlib/item/edge/base.js +48 -16
  59. package/esm/stdlib/item/edge/base.js.map +1 -1
  60. package/esm/stdlib/item/edge/cubic.js +11 -6
  61. package/esm/stdlib/item/edge/cubic.js.map +1 -1
  62. package/esm/stdlib/item/edge/line.js +12 -7
  63. package/esm/stdlib/item/edge/line.js.map +1 -1
  64. package/esm/stdlib/item/edge/loop.js +6 -1
  65. package/esm/stdlib/item/edge/loop.js.map +1 -1
  66. package/esm/stdlib/item/edge/polyline.js +11 -6
  67. package/esm/stdlib/item/edge/polyline.js.map +1 -1
  68. package/esm/stdlib/item/edge/quadratic.js +11 -6
  69. package/esm/stdlib/item/edge/quadratic.js.map +1 -1
  70. package/esm/stdlib/item/node/base.d.ts +24 -13
  71. package/esm/stdlib/item/node/base.js +90 -48
  72. package/esm/stdlib/item/node/base.js.map +1 -1
  73. package/esm/stdlib/item/node/base3d.d.ts +11 -2
  74. package/esm/stdlib/item/node/base3d.js +14 -3
  75. package/esm/stdlib/item/node/base3d.js.map +1 -1
  76. package/esm/stdlib/item/node/circle.js +13 -7
  77. package/esm/stdlib/item/node/circle.js.map +1 -1
  78. package/esm/stdlib/item/node/cube.d.ts +0 -2
  79. package/esm/stdlib/item/node/cube.js +12 -9
  80. package/esm/stdlib/item/node/cube.js.map +1 -1
  81. package/esm/stdlib/item/node/diamond.js +20 -11
  82. package/esm/stdlib/item/node/diamond.js.map +1 -1
  83. package/esm/stdlib/item/node/donut.js +18 -8
  84. package/esm/stdlib/item/node/donut.js.map +1 -1
  85. package/esm/stdlib/item/node/ellipse.js +11 -6
  86. package/esm/stdlib/item/node/ellipse.js.map +1 -1
  87. package/esm/stdlib/item/node/hexagon.js +12 -7
  88. package/esm/stdlib/item/node/hexagon.js.map +1 -1
  89. package/esm/stdlib/item/node/image.js +13 -3
  90. package/esm/stdlib/item/node/image.js.map +1 -1
  91. package/esm/stdlib/item/node/index.d.ts +1 -0
  92. package/esm/stdlib/item/node/index.js +1 -0
  93. package/esm/stdlib/item/node/index.js.map +1 -1
  94. package/esm/stdlib/item/node/modelRect.d.ts +33 -1
  95. package/esm/stdlib/item/node/modelRect.js +135 -78
  96. package/esm/stdlib/item/node/modelRect.js.map +1 -1
  97. package/esm/stdlib/item/node/plane.d.ts +38 -0
  98. package/esm/stdlib/item/node/plane.js +62 -0
  99. package/esm/stdlib/item/node/plane.js.map +1 -0
  100. package/esm/stdlib/item/node/rect.js +12 -7
  101. package/esm/stdlib/item/node/rect.js.map +1 -1
  102. package/esm/stdlib/item/node/sphere.js +12 -7
  103. package/esm/stdlib/item/node/sphere.js.map +1 -1
  104. package/esm/stdlib/item/node/star.d.ts +1 -3
  105. package/esm/stdlib/item/node/star.js +16 -10
  106. package/esm/stdlib/item/node/star.js.map +1 -1
  107. package/esm/stdlib/item/node/triangle.js +17 -7
  108. package/esm/stdlib/item/node/triangle.js.map +1 -1
  109. package/esm/stdlib/plugin/edgeBundling/index.d.ts +75 -0
  110. package/esm/stdlib/plugin/edgeBundling/index.js +364 -0
  111. package/esm/stdlib/plugin/edgeBundling/index.js.map +1 -0
  112. package/esm/stdlib/plugin/hull/bubbleset.d.ts +1 -1
  113. package/esm/stdlib/plugin/hull/bubbleset.js +13 -13
  114. package/esm/stdlib/plugin/hull/bubbleset.js.map +1 -1
  115. package/esm/stdlib/plugin/hull/index.js +4 -4
  116. package/esm/stdlib/plugin/hull/util.js +1 -1
  117. package/esm/stdlib/plugin/hull/util.js.map +1 -1
  118. package/esm/stdlib/plugin/index.d.ts +1 -0
  119. package/esm/stdlib/plugin/index.js +1 -0
  120. package/esm/stdlib/plugin/index.js.map +1 -1
  121. package/esm/stdlib/plugin/legend/index.d.ts +2 -2
  122. package/esm/stdlib/plugin/legend/index.js +10 -10
  123. package/esm/stdlib/plugin/legend/index.js.map +1 -1
  124. package/esm/stdlib/plugin/lodController/index.js +10 -8
  125. package/esm/stdlib/plugin/lodController/index.js.map +1 -1
  126. package/esm/stdlib/plugin/menu/index.js +1 -1
  127. package/esm/stdlib/plugin/menu/index.js.map +1 -1
  128. package/esm/stdlib/plugin/snapline/index.d.ts +2 -2
  129. package/esm/stdlib/plugin/snapline/index.js +2 -2
  130. package/esm/stdlib/plugin/snapline/index.js.map +1 -1
  131. package/esm/stdlib/plugin/tooltip/index.d.ts +1 -1
  132. package/esm/stdlib/plugin/tooltip/index.js +3 -3
  133. package/esm/stdlib/plugin/tooltip/index.js.map +1 -1
  134. package/esm/stdlib/plugin/{watermaker → watermarker}/index.d.ts +1 -1
  135. package/esm/stdlib/plugin/{watermaker → watermarker}/index.js +7 -7
  136. package/esm/stdlib/plugin/watermarker/index.js.map +1 -0
  137. package/esm/stdlib/selector/lasso.js +3 -3
  138. package/esm/stdlib/selector/lasso.js.map +1 -1
  139. package/esm/stdlib/theme/dark.js +1 -1
  140. package/esm/stdlib/theme/dark.js.map +1 -1
  141. package/esm/stdlib/theme/light.js +4 -1
  142. package/esm/stdlib/theme/light.js.map +1 -1
  143. package/esm/stdlib/themeSolver/spec.js +3 -3
  144. package/esm/stdlib/themeSolver/subject.d.ts +1 -1
  145. package/esm/stdlib/themeSolver/subject.js +1 -1
  146. package/esm/types/animate.d.ts +1 -1
  147. package/esm/types/data.d.ts +3 -1
  148. package/esm/types/graph.d.ts +54 -11
  149. package/esm/types/hook.d.ts +13 -3
  150. package/esm/types/index.d.ts +2 -1
  151. package/esm/types/index.js +1 -0
  152. package/esm/types/index.js.map +1 -1
  153. package/esm/types/item.d.ts +8 -10
  154. package/esm/types/item.js.map +1 -1
  155. package/esm/types/layout.d.ts +1 -1
  156. package/esm/types/node.d.ts +1 -31
  157. package/esm/types/plugin.d.ts +1 -1
  158. package/esm/types/plugin.js +1 -1
  159. package/esm/types/spec.d.ts +5 -5
  160. package/esm/types/theme.d.ts +1 -1
  161. package/esm/types/view.d.ts +1 -1
  162. package/esm/util/animate.js +1 -1
  163. package/esm/util/animate.js.map +1 -1
  164. package/esm/util/canvas.d.ts +1 -1
  165. package/esm/util/canvas.js +7 -1
  166. package/esm/util/canvas.js.map +1 -1
  167. package/esm/util/data.d.ts +10 -10
  168. package/esm/util/data.js +10 -9
  169. package/esm/util/data.js.map +1 -1
  170. package/esm/util/extend.js +1 -1
  171. package/esm/util/extend.js.map +1 -1
  172. package/esm/util/item.js +1 -1
  173. package/esm/util/item.js.map +1 -1
  174. package/esm/util/math.d.ts +1 -1
  175. package/esm/util/math.js +1 -1
  176. package/esm/util/path.d.ts +1 -1
  177. package/esm/util/path.js +1 -1
  178. package/esm/util/polyline.d.ts +2 -2
  179. package/esm/util/polyline.js +3 -3
  180. package/esm/util/polyline.js.map +1 -1
  181. package/esm/util/router.js +7 -7
  182. package/esm/util/router.js.map +1 -1
  183. package/esm/util/shape.d.ts +25 -13
  184. package/esm/util/shape.js +29 -20
  185. package/esm/util/shape.js.map +1 -1
  186. package/esm/util/shape3d.d.ts +2 -2
  187. package/esm/util/shape3d.js +9 -12
  188. package/esm/util/shape3d.js.map +1 -1
  189. package/lib/constant/shape.d.ts +1 -1
  190. package/lib/index.d.ts +4 -2
  191. package/lib/index.js +1 -1
  192. package/lib/index.js.map +1 -1
  193. package/lib/item/combo.js +3 -1
  194. package/lib/item/combo.js.map +1 -1
  195. package/lib/item/edge.js +7 -2
  196. package/lib/item/edge.js.map +1 -1
  197. package/lib/item/item.d.ts +2 -2
  198. package/lib/item/item.js +13 -6
  199. package/lib/item/item.js.map +1 -1
  200. package/lib/item/node.d.ts +1 -0
  201. package/lib/item/node.js +12 -2
  202. package/lib/item/node.js.map +1 -1
  203. package/lib/runtime/controller/data.js +14 -9
  204. package/lib/runtime/controller/data.js.map +1 -1
  205. package/lib/runtime/controller/interaction.js +3 -2
  206. package/lib/runtime/controller/interaction.js.map +1 -1
  207. package/lib/runtime/controller/item.d.ts +3 -2
  208. package/lib/runtime/controller/item.js +44 -21
  209. package/lib/runtime/controller/item.js.map +1 -1
  210. package/lib/runtime/controller/layout.js +7 -33
  211. package/lib/runtime/controller/layout.js.map +1 -1
  212. package/lib/runtime/controller/plugin.js +1 -1
  213. package/lib/runtime/controller/plugin.js.map +1 -1
  214. package/lib/runtime/graph.d.ts +19 -6
  215. package/lib/runtime/graph.js +62 -27
  216. package/lib/runtime/graph.js.map +1 -1
  217. package/lib/runtime/hooks.d.ts +2 -2
  218. package/lib/runtime/hooks.js +2 -2
  219. package/lib/stdlib/behavior/create-edge.d.ts +1 -1
  220. package/lib/stdlib/behavior/drag-canvas.d.ts +1 -1
  221. package/lib/stdlib/behavior/drag-node.d.ts +1 -1
  222. package/lib/stdlib/behavior/drag-node.js +1 -1
  223. package/lib/stdlib/behavior/drag-node.js.map +1 -1
  224. package/lib/stdlib/behavior/hover-activate.d.ts +1 -1
  225. package/lib/stdlib/behavior/orbit-canvas-3d.d.ts +1 -1
  226. package/lib/stdlib/behavior/rotate-canvas-3d.d.ts +2 -2
  227. package/lib/stdlib/behavior/scroll-canvas.js +5 -5
  228. package/lib/stdlib/behavior/scroll-canvas.js.map +1 -1
  229. package/lib/stdlib/behavior/track-canvas-3d.d.ts +1 -1
  230. package/lib/stdlib/behavior/zoom-canvas-3d.d.ts +1 -1
  231. package/lib/stdlib/behavior/zoom-canvas.d.ts +16 -0
  232. package/lib/stdlib/behavior/zoom-canvas.js +106 -4
  233. package/lib/stdlib/behavior/zoom-canvas.js.map +1 -1
  234. package/lib/stdlib/data/transformV4Data.js +12 -6
  235. package/lib/stdlib/data/transformV4Data.js.map +1 -1
  236. package/lib/stdlib/index.d.ts +6 -4
  237. package/lib/stdlib/index.js +10 -8
  238. package/lib/stdlib/index.js.map +1 -1
  239. package/lib/stdlib/item/combo/circle.js +12 -7
  240. package/lib/stdlib/item/combo/circle.js.map +1 -1
  241. package/lib/stdlib/item/combo/rect.js +12 -7
  242. package/lib/stdlib/item/combo/rect.js.map +1 -1
  243. package/lib/stdlib/item/edge/base.d.ts +22 -5
  244. package/lib/stdlib/item/edge/base.js +48 -16
  245. package/lib/stdlib/item/edge/base.js.map +1 -1
  246. package/lib/stdlib/item/edge/cubic.js +11 -6
  247. package/lib/stdlib/item/edge/cubic.js.map +1 -1
  248. package/lib/stdlib/item/edge/line.js +12 -7
  249. package/lib/stdlib/item/edge/line.js.map +1 -1
  250. package/lib/stdlib/item/edge/loop.js +6 -1
  251. package/lib/stdlib/item/edge/loop.js.map +1 -1
  252. package/lib/stdlib/item/edge/polyline.js +11 -6
  253. package/lib/stdlib/item/edge/polyline.js.map +1 -1
  254. package/lib/stdlib/item/edge/quadratic.js +11 -6
  255. package/lib/stdlib/item/edge/quadratic.js.map +1 -1
  256. package/lib/stdlib/item/node/base.d.ts +24 -13
  257. package/lib/stdlib/item/node/base.js +90 -48
  258. package/lib/stdlib/item/node/base.js.map +1 -1
  259. package/lib/stdlib/item/node/base3d.d.ts +11 -2
  260. package/lib/stdlib/item/node/base3d.js +14 -3
  261. package/lib/stdlib/item/node/base3d.js.map +1 -1
  262. package/lib/stdlib/item/node/circle.js +13 -7
  263. package/lib/stdlib/item/node/circle.js.map +1 -1
  264. package/lib/stdlib/item/node/cube.d.ts +0 -2
  265. package/lib/stdlib/item/node/cube.js +12 -9
  266. package/lib/stdlib/item/node/cube.js.map +1 -1
  267. package/lib/stdlib/item/node/diamond.js +20 -11
  268. package/lib/stdlib/item/node/diamond.js.map +1 -1
  269. package/lib/stdlib/item/node/donut.js +18 -8
  270. package/lib/stdlib/item/node/donut.js.map +1 -1
  271. package/lib/stdlib/item/node/ellipse.js +11 -6
  272. package/lib/stdlib/item/node/ellipse.js.map +1 -1
  273. package/lib/stdlib/item/node/hexagon.js +12 -7
  274. package/lib/stdlib/item/node/hexagon.js.map +1 -1
  275. package/lib/stdlib/item/node/image.js +13 -3
  276. package/lib/stdlib/item/node/image.js.map +1 -1
  277. package/lib/stdlib/item/node/index.d.ts +1 -0
  278. package/lib/stdlib/item/node/index.js +1 -0
  279. package/lib/stdlib/item/node/index.js.map +1 -1
  280. package/lib/stdlib/item/node/modelRect.d.ts +33 -1
  281. package/lib/stdlib/item/node/modelRect.js +135 -78
  282. package/lib/stdlib/item/node/modelRect.js.map +1 -1
  283. package/lib/stdlib/item/node/plane.d.ts +38 -0
  284. package/lib/stdlib/item/node/plane.js +66 -0
  285. package/lib/stdlib/item/node/plane.js.map +1 -0
  286. package/lib/stdlib/item/node/rect.js +12 -7
  287. package/lib/stdlib/item/node/rect.js.map +1 -1
  288. package/lib/stdlib/item/node/sphere.js +12 -7
  289. package/lib/stdlib/item/node/sphere.js.map +1 -1
  290. package/lib/stdlib/item/node/star.d.ts +1 -3
  291. package/lib/stdlib/item/node/star.js +16 -10
  292. package/lib/stdlib/item/node/star.js.map +1 -1
  293. package/lib/stdlib/item/node/triangle.js +17 -7
  294. package/lib/stdlib/item/node/triangle.js.map +1 -1
  295. package/lib/stdlib/plugin/edgeBundling/index.d.ts +75 -0
  296. package/lib/stdlib/plugin/edgeBundling/index.js +368 -0
  297. package/lib/stdlib/plugin/edgeBundling/index.js.map +1 -0
  298. package/lib/stdlib/plugin/hull/bubbleset.d.ts +1 -1
  299. package/lib/stdlib/plugin/hull/bubbleset.js +13 -13
  300. package/lib/stdlib/plugin/hull/bubbleset.js.map +1 -1
  301. package/lib/stdlib/plugin/hull/index.js +4 -4
  302. package/lib/stdlib/plugin/hull/util.js +1 -1
  303. package/lib/stdlib/plugin/hull/util.js.map +1 -1
  304. package/lib/stdlib/plugin/index.d.ts +1 -0
  305. package/lib/stdlib/plugin/index.js +1 -0
  306. package/lib/stdlib/plugin/index.js.map +1 -1
  307. package/lib/stdlib/plugin/legend/index.d.ts +2 -2
  308. package/lib/stdlib/plugin/legend/index.js +10 -10
  309. package/lib/stdlib/plugin/legend/index.js.map +1 -1
  310. package/lib/stdlib/plugin/lodController/index.js +10 -8
  311. package/lib/stdlib/plugin/lodController/index.js.map +1 -1
  312. package/lib/stdlib/plugin/menu/index.js +1 -1
  313. package/lib/stdlib/plugin/menu/index.js.map +1 -1
  314. package/lib/stdlib/plugin/snapline/index.d.ts +2 -2
  315. package/lib/stdlib/plugin/snapline/index.js +2 -2
  316. package/lib/stdlib/plugin/snapline/index.js.map +1 -1
  317. package/lib/stdlib/plugin/tooltip/index.d.ts +1 -1
  318. package/lib/stdlib/plugin/tooltip/index.js +3 -3
  319. package/lib/stdlib/plugin/tooltip/index.js.map +1 -1
  320. package/lib/stdlib/plugin/{watermaker → watermarker}/index.d.ts +1 -1
  321. package/lib/stdlib/plugin/{watermaker → watermarker}/index.js +7 -7
  322. package/lib/stdlib/plugin/watermarker/index.js.map +1 -0
  323. package/lib/stdlib/selector/lasso.js +3 -3
  324. package/lib/stdlib/selector/lasso.js.map +1 -1
  325. package/lib/stdlib/theme/dark.js +1 -1
  326. package/lib/stdlib/theme/dark.js.map +1 -1
  327. package/lib/stdlib/theme/light.js +4 -1
  328. package/lib/stdlib/theme/light.js.map +1 -1
  329. package/lib/stdlib/themeSolver/spec.js +3 -3
  330. package/lib/stdlib/themeSolver/subject.d.ts +1 -1
  331. package/lib/stdlib/themeSolver/subject.js +1 -1
  332. package/lib/types/animate.d.ts +1 -1
  333. package/lib/types/data.d.ts +3 -1
  334. package/lib/types/graph.d.ts +54 -11
  335. package/lib/types/hook.d.ts +13 -3
  336. package/lib/types/index.d.ts +2 -1
  337. package/lib/types/index.js +3 -1
  338. package/lib/types/index.js.map +1 -1
  339. package/lib/types/item.d.ts +8 -10
  340. package/lib/types/item.js.map +1 -1
  341. package/lib/types/layout.d.ts +1 -1
  342. package/lib/types/node.d.ts +1 -31
  343. package/lib/types/plugin.d.ts +1 -1
  344. package/lib/types/plugin.js +1 -1
  345. package/lib/types/spec.d.ts +5 -5
  346. package/lib/types/theme.d.ts +1 -1
  347. package/lib/types/view.d.ts +1 -1
  348. package/lib/util/animate.js +1 -1
  349. package/lib/util/animate.js.map +1 -1
  350. package/lib/util/canvas.d.ts +1 -1
  351. package/lib/util/canvas.js +7 -1
  352. package/lib/util/canvas.js.map +1 -1
  353. package/lib/util/data.d.ts +10 -10
  354. package/lib/util/data.js +12 -11
  355. package/lib/util/data.js.map +1 -1
  356. package/lib/util/extend.js +4 -7
  357. package/lib/util/extend.js.map +1 -1
  358. package/lib/util/item.js +1 -1
  359. package/lib/util/item.js.map +1 -1
  360. package/lib/util/math.d.ts +1 -1
  361. package/lib/util/math.js +1 -1
  362. package/lib/util/path.d.ts +1 -1
  363. package/lib/util/path.js +1 -1
  364. package/lib/util/polyline.d.ts +2 -2
  365. package/lib/util/polyline.js +3 -3
  366. package/lib/util/polyline.js.map +1 -1
  367. package/lib/util/router.js +7 -7
  368. package/lib/util/router.js.map +1 -1
  369. package/lib/util/shape.d.ts +25 -13
  370. package/lib/util/shape.js +28 -19
  371. package/lib/util/shape.js.map +1 -1
  372. package/lib/util/shape3d.d.ts +2 -2
  373. package/lib/util/shape3d.js +9 -12
  374. package/lib/util/shape3d.js.map +1 -1
  375. package/package.json +37 -53
  376. package/src/index.ts +1 -1
  377. package/src/item/combo.ts +2 -1
  378. package/src/item/edge.ts +9 -2
  379. package/src/item/item.ts +21 -10
  380. package/src/item/node.ts +22 -6
  381. package/src/runtime/controller/data.ts +16 -14
  382. package/src/runtime/controller/interaction.ts +5 -4
  383. package/src/runtime/controller/item.ts +78 -36
  384. package/src/runtime/controller/layout.ts +7 -9
  385. package/src/runtime/controller/plugin.ts +1 -1
  386. package/src/runtime/graph.ts +128 -71
  387. package/src/runtime/hooks.ts +2 -2
  388. package/src/stdlib/behavior/create-edge.ts +1 -1
  389. package/src/stdlib/behavior/drag-canvas.ts +1 -1
  390. package/src/stdlib/behavior/drag-node.ts +1 -1
  391. package/src/stdlib/behavior/hover-activate.ts +1 -1
  392. package/src/stdlib/behavior/orbit-canvas-3d.ts +1 -1
  393. package/src/stdlib/behavior/rotate-canvas-3d.ts +2 -2
  394. package/src/stdlib/behavior/scroll-canvas.ts +5 -5
  395. package/src/stdlib/behavior/track-canvas-3d.ts +1 -1
  396. package/src/stdlib/behavior/zoom-canvas-3d.ts +1 -1
  397. package/src/stdlib/behavior/zoom-canvas.ts +134 -13
  398. package/src/stdlib/data/transformV4Data.ts +27 -3
  399. package/src/stdlib/index.ts +8 -4
  400. package/src/stdlib/item/combo/circle.ts +26 -11
  401. package/src/stdlib/item/combo/rect.ts +26 -11
  402. package/src/stdlib/item/edge/base.ts +45 -24
  403. package/src/stdlib/item/edge/cubic.ts +26 -4
  404. package/src/stdlib/item/edge/line.ts +27 -5
  405. package/src/stdlib/item/edge/loop.ts +6 -1
  406. package/src/stdlib/item/edge/polyline.ts +26 -4
  407. package/src/stdlib/item/edge/quadratic.ts +26 -4
  408. package/src/stdlib/item/node/base.ts +74 -48
  409. package/src/stdlib/item/node/base3d.ts +19 -3
  410. package/src/stdlib/item/node/circle.ts +29 -8
  411. package/src/stdlib/item/node/cube.ts +26 -12
  412. package/src/stdlib/item/node/diamond.ts +35 -11
  413. package/src/stdlib/item/node/donut.ts +32 -18
  414. package/src/stdlib/item/node/ellipse.ts +25 -11
  415. package/src/stdlib/item/node/hexagon.ts +27 -7
  416. package/src/stdlib/item/node/image.ts +13 -5
  417. package/src/stdlib/item/node/index.ts +1 -0
  418. package/src/stdlib/item/node/modelRect.ts +230 -136
  419. package/src/stdlib/item/node/plane.ts +121 -0
  420. package/src/stdlib/item/node/rect.ts +27 -7
  421. package/src/stdlib/item/node/sphere.ts +26 -10
  422. package/src/stdlib/item/node/star.ts +32 -11
  423. package/src/stdlib/item/node/triangle.ts +32 -9
  424. package/src/stdlib/plugin/edgeBundling/index.ts +529 -0
  425. package/src/stdlib/plugin/hull/bubbleset.ts +14 -14
  426. package/src/stdlib/plugin/hull/index.ts +4 -4
  427. package/src/stdlib/plugin/hull/util.ts +1 -1
  428. package/src/stdlib/plugin/index.ts +1 -0
  429. package/src/stdlib/plugin/legend/index.ts +11 -12
  430. package/src/stdlib/plugin/lodController/index.ts +9 -8
  431. package/src/stdlib/plugin/menu/index.ts +1 -1
  432. package/src/stdlib/plugin/snapline/index.ts +3 -3
  433. package/src/stdlib/plugin/tooltip/index.ts +4 -4
  434. package/src/stdlib/plugin/{watermaker → watermarker}/index.ts +8 -8
  435. package/src/stdlib/selector/lasso.ts +3 -3
  436. package/src/stdlib/theme/dark.ts +0 -1
  437. package/src/stdlib/theme/light.ts +3 -1
  438. package/src/stdlib/themeSolver/spec.ts +3 -3
  439. package/src/stdlib/themeSolver/subject.ts +1 -1
  440. package/src/types/animate.ts +2 -2
  441. package/src/types/data.ts +5 -1
  442. package/src/types/graph.ts +82 -11
  443. package/src/types/hook.ts +32 -3
  444. package/src/types/index.ts +2 -1
  445. package/src/types/item.ts +15 -16
  446. package/src/types/layout.ts +1 -1
  447. package/src/types/node.ts +1 -31
  448. package/src/types/plugin.ts +1 -1
  449. package/src/types/spec.ts +5 -5
  450. package/src/types/theme.ts +1 -1
  451. package/src/types/view.ts +1 -1
  452. package/src/util/animate.ts +1 -1
  453. package/src/util/canvas.ts +8 -0
  454. package/src/util/data.ts +12 -10
  455. package/src/util/extend.ts +1 -1
  456. package/src/util/item.ts +1 -1
  457. package/src/util/math.ts +1 -1
  458. package/src/util/path.ts +1 -1
  459. package/src/util/polyline.ts +3 -3
  460. package/src/util/router.ts +7 -7
  461. package/src/util/shape.ts +70 -33
  462. package/src/util/shape3d.ts +16 -10
  463. package/esm/stdlib/plugin/watermaker/index.js.map +0 -1
  464. package/lib/stdlib/plugin/watermaker/index.js.map +0 -1
@@ -51,14 +51,25 @@ export class CubicEdge extends BaseEdge {
51
51
  targetPoint,
52
52
  shapeMap,
53
53
  diffData,
54
+ diffState,
54
55
  );
55
56
 
56
57
  if (data.haloShape) {
57
- shapes.haloShape = this.drawHaloShape(model, shapeMap, diffData);
58
+ shapes.haloShape = this.drawHaloShape(
59
+ model,
60
+ shapeMap,
61
+ diffData,
62
+ diffState,
63
+ );
58
64
  }
59
65
 
60
66
  if (data.labelShape) {
61
- shapes.labelShape = this.drawLabelShape(model, shapeMap, diffData);
67
+ shapes.labelShape = this.drawLabelShape(
68
+ model,
69
+ shapeMap,
70
+ diffData,
71
+ diffState,
72
+ );
62
73
  }
63
74
 
64
75
  // labelBackgroundShape
@@ -67,11 +78,17 @@ export class CubicEdge extends BaseEdge {
67
78
  model,
68
79
  shapeMap,
69
80
  diffData,
81
+ diffState,
70
82
  );
71
83
  }
72
84
 
73
85
  if (data.iconShape) {
74
- shapes.iconShape = this.drawIconShape(model, shapeMap, diffData);
86
+ shapes.iconShape = this.drawIconShape(
87
+ model,
88
+ shapeMap,
89
+ diffData,
90
+ diffState,
91
+ );
75
92
  }
76
93
 
77
94
  // TODO: other shapes
@@ -115,7 +132,12 @@ export class CubicEdge extends BaseEdge {
115
132
  this.upsertArrow('start', startArrow, others, model, lineStyle);
116
133
  this.upsertArrow('end', endArrow, others, model, lineStyle);
117
134
 
118
- return this.upsertShape('path', 'keyShape', lineStyle, shapeMap, model);
135
+ return this.upsertShape('path', 'keyShape', lineStyle, {
136
+ model,
137
+ shapeMap,
138
+ diffData,
139
+ diffState,
140
+ });
119
141
  }
120
142
 
121
143
  /**
@@ -43,14 +43,25 @@ export class LineEdge extends BaseEdge {
43
43
  targetPoint,
44
44
  shapeMap,
45
45
  diffData,
46
+ diffState,
46
47
  );
47
48
 
48
49
  if (data.haloShape) {
49
- shapes.haloShape = this.drawHaloShape(model, shapeMap, diffData);
50
+ shapes.haloShape = this.drawHaloShape(
51
+ model,
52
+ shapeMap,
53
+ diffData,
54
+ diffState,
55
+ );
50
56
  }
51
57
 
52
58
  if (data.labelShape) {
53
- shapes.labelShape = this.drawLabelShape(model, shapeMap, diffData);
59
+ shapes.labelShape = this.drawLabelShape(
60
+ model,
61
+ shapeMap,
62
+ diffData,
63
+ diffState,
64
+ );
54
65
  }
55
66
 
56
67
  // labelBackgroundShape
@@ -59,18 +70,24 @@ export class LineEdge extends BaseEdge {
59
70
  model,
60
71
  shapeMap,
61
72
  diffData,
73
+ diffState,
62
74
  );
63
75
  }
64
76
 
65
77
  if (data.iconShape) {
66
- shapes.iconShape = this.drawIconShape(model, shapeMap, diffData);
78
+ shapes.iconShape = this.drawIconShape(
79
+ model,
80
+ shapeMap,
81
+ diffData,
82
+ diffState,
83
+ );
67
84
  }
68
85
 
69
86
  // otherShapes
70
87
  if (data.otherShapes) {
71
88
  shapes = {
72
89
  ...shapes,
73
- ...this.drawOtherShapes(model, shapeMap, diffData),
90
+ ...this.drawOtherShapes(model, shapeMap, diffData, diffState),
74
91
  };
75
92
  }
76
93
 
@@ -98,6 +115,11 @@ export class LineEdge extends BaseEdge {
98
115
  };
99
116
  this.upsertArrow('start', startArrow, others, model, lineStyle);
100
117
  this.upsertArrow('end', endArrow, others, model, lineStyle);
101
- return this.upsertShape('line', 'keyShape', lineStyle, shapeMap, model);
118
+ return this.upsertShape('line', 'keyShape', lineStyle, {
119
+ model,
120
+ shapeMap,
121
+ diffData,
122
+ diffState,
123
+ });
102
124
  }
103
125
  }
@@ -75,7 +75,12 @@ export class LoopEdge extends CubicEdge {
75
75
 
76
76
  this.upsertArrow('start', startArrow, others, model, lineStyle);
77
77
  this.upsertArrow('end', endArrow, others, model, lineStyle);
78
- return this.upsertShape('path', 'keyShape', lineStyle, shapeMap, model);
78
+ return this.upsertShape('path', 'keyShape', lineStyle, {
79
+ model,
80
+ shapeMap,
81
+ diffData,
82
+ diffState,
83
+ });
79
84
  }
80
85
 
81
86
  private getPathPoints(
@@ -47,14 +47,25 @@ export class PolylineEdge extends LineEdge {
47
47
  targetPoint,
48
48
  shapeMap,
49
49
  diffData,
50
+ diffState,
50
51
  );
51
52
 
52
53
  if (data.haloShape) {
53
- shapes.haloShape = this.drawHaloShape(model, shapeMap, diffData);
54
+ shapes.haloShape = this.drawHaloShape(
55
+ model,
56
+ shapeMap,
57
+ diffData,
58
+ diffState,
59
+ );
54
60
  }
55
61
 
56
62
  if (data.labelShape) {
57
- shapes.labelShape = this.drawLabelShape(model, shapeMap, diffData);
63
+ shapes.labelShape = this.drawLabelShape(
64
+ model,
65
+ shapeMap,
66
+ diffData,
67
+ diffState,
68
+ );
58
69
  }
59
70
 
60
71
  // labelBackgroundShape
@@ -63,11 +74,17 @@ export class PolylineEdge extends LineEdge {
63
74
  model,
64
75
  shapeMap,
65
76
  diffData,
77
+ diffState,
66
78
  );
67
79
  }
68
80
 
69
81
  if (data.iconShape) {
70
- shapes.iconShape = this.drawIconShape(model, shapeMap, diffData);
82
+ shapes.iconShape = this.drawIconShape(
83
+ model,
84
+ shapeMap,
85
+ diffData,
86
+ diffState,
87
+ );
71
88
  }
72
89
 
73
90
  // TODO: other shapes
@@ -158,6 +175,11 @@ export class PolylineEdge extends LineEdge {
158
175
  };
159
176
  this.upsertArrow('start', startArrow, others, model, lineStyle);
160
177
  this.upsertArrow('end', endArrow, others, model, lineStyle);
161
- return this.upsertShape('path', 'keyShape', lineStyle, shapeMap, model);
178
+ return this.upsertShape('path', 'keyShape', lineStyle, {
179
+ model,
180
+ shapeMap,
181
+ diffData,
182
+ diffState,
183
+ });
162
184
  }
163
185
  }
@@ -41,14 +41,25 @@ export class QuadraticEdge extends BaseEdge {
41
41
  targetPoint,
42
42
  shapeMap,
43
43
  diffData,
44
+ diffState,
44
45
  );
45
46
 
46
47
  if (data.haloShape) {
47
- shapes.haloShape = this.drawHaloShape(model, shapeMap, diffData);
48
+ shapes.haloShape = this.drawHaloShape(
49
+ model,
50
+ shapeMap,
51
+ diffData,
52
+ diffState,
53
+ );
48
54
  }
49
55
 
50
56
  if (data.labelShape) {
51
- shapes.labelShape = this.drawLabelShape(model, shapeMap, diffData);
57
+ shapes.labelShape = this.drawLabelShape(
58
+ model,
59
+ shapeMap,
60
+ diffData,
61
+ diffState,
62
+ );
52
63
  }
53
64
 
54
65
  // labelBackgroundShape
@@ -57,11 +68,17 @@ export class QuadraticEdge extends BaseEdge {
57
68
  model,
58
69
  shapeMap,
59
70
  diffData,
71
+ diffState,
60
72
  );
61
73
  }
62
74
 
63
75
  if (data.iconShape) {
64
- shapes.iconShape = this.drawIconShape(model, shapeMap, diffData);
76
+ shapes.iconShape = this.drawIconShape(
77
+ model,
78
+ shapeMap,
79
+ diffData,
80
+ diffState,
81
+ );
65
82
  }
66
83
 
67
84
  // TODO: other shapes
@@ -95,7 +112,12 @@ export class QuadraticEdge extends BaseEdge {
95
112
  };
96
113
  this.upsertArrow('start', startArrow, others, model, lineStyle);
97
114
  this.upsertArrow('end', endArrow, others, model, lineStyle);
98
- return this.upsertShape('path', 'keyShape', lineStyle, shapeMap, model);
115
+ return this.upsertShape('path', 'keyShape', lineStyle, {
116
+ model,
117
+ shapeMap,
118
+ diffData,
119
+ diffState,
120
+ });
99
121
  }
100
122
 
101
123
  /**
@@ -8,6 +8,7 @@ import {
8
8
  ShapeStyle,
9
9
  State,
10
10
  LodLevelRanges,
11
+ ItemModelData,
11
12
  } from '../../../types/item';
12
13
  import {
13
14
  NodeModelData,
@@ -27,11 +28,13 @@ import {
27
28
  mergeStyles,
28
29
  upsertShape,
29
30
  } from '../../../util/shape';
31
+ import type { IGraph } from '../../../types/graph';
30
32
  import { getWordWrapWidthByBox } from '../../../util/text';
31
33
  import { convertToNumber } from '../../../util/type';
32
34
 
33
35
  export abstract class BaseNode {
34
36
  type: string;
37
+ graph: IGraph;
35
38
  defaultStyles: NodeShapeStyles | ComboShapeStyles;
36
39
  themeStyles: NodeShapeStyles | ComboShapeStyles;
37
40
  mergedStyles: NodeShapeStyles | ComboShapeStyles;
@@ -39,14 +42,9 @@ export abstract class BaseNode {
39
42
  enableBalanceShape?: boolean;
40
43
  //vertex coordinate
41
44
 
42
- /**
43
- * Cache the scale transform calculated by balancing size, for restoring.
44
- */
45
- protected scaleTransformCache = '';
46
-
47
- // cache the zoom level infomations
48
- protected zoomCache: {
49
- // last responsed zoom ratio.
45
+ // cache the zoom level information
46
+ #zoomCache: {
47
+ // last response zoom ratio.
50
48
  zoom: number;
51
49
  // wordWrapWidth of labelShape according to the maxWidth
52
50
  wordWrapWidth: number;
@@ -56,11 +54,13 @@ export abstract class BaseNode {
56
54
  };
57
55
 
58
56
  constructor(props) {
59
- const { themeStyles, lodLevels, enableBalanceShape, zoom } = props;
57
+ const { graph, themeStyles, lodLevels, enableBalanceShape, zoom } = props;
58
+
60
59
  if (themeStyles) this.themeStyles = themeStyles;
60
+ this.graph = graph;
61
61
  this.lodLevels = lodLevels;
62
62
  this.enableBalanceShape = enableBalanceShape;
63
- this.zoomCache.zoom = zoom;
63
+ this.#zoomCache.zoom = zoom;
64
64
  }
65
65
 
66
66
  /**
@@ -132,7 +132,7 @@ export abstract class BaseNode {
132
132
  public updateCache(shapeMap) {
133
133
  if (shapeMap.labelShape) {
134
134
  const { maxWidth = '200%' } = this.mergedStyles.labelShape || {};
135
- this.zoomCache.wordWrapWidth = getWordWrapWidthByBox(
135
+ this.#zoomCache.wordWrapWidth = getWordWrapWidthByBox(
136
136
  shapeMap.keyShape.getLocalBounds(),
137
137
  maxWidth,
138
138
  1,
@@ -173,7 +173,12 @@ export abstract class BaseNode {
173
173
  public afterDraw(
174
174
  model: NodeDisplayModel | ComboDisplayModel,
175
175
  shapeMap: { [shapeId: string]: DisplayObject },
176
- shapesChanged?: string[],
176
+ // shapesChanged?: string[],
177
+ diffData?: {
178
+ previous: NodeModelData | ComboModelData;
179
+ current: NodeModelData | ComboModelData;
180
+ },
181
+ diffState?: { previous: State[]; current: State[] },
177
182
  ): { [otherShapeId: string]: DisplayObject } {
178
183
  return {};
179
184
  }
@@ -249,7 +254,7 @@ export abstract class BaseNode {
249
254
  const wordWrapWidth = getWordWrapWidthByBox(
250
255
  keyShapeBox as AABB,
251
256
  maxWidth,
252
- this.zoomCache.zoom,
257
+ this.#zoomCache.zoom,
253
258
  this.enableBalanceShape,
254
259
  );
255
260
 
@@ -288,7 +293,8 @@ export abstract class BaseNode {
288
293
  positionPreset.textBaseline = 'middle';
289
294
  positionPreset.offsetX = 4;
290
295
  break;
291
- default: // at bottom by default
296
+ default:
297
+ // at bottom by default
292
298
  positionPreset.offsetY = 2;
293
299
  break;
294
300
  }
@@ -314,7 +320,12 @@ export abstract class BaseNode {
314
320
  if (angle) {
315
321
  style.transform = `rotate(${angle}rad)`;
316
322
  }
317
- return this.upsertShape('text', 'labelShape', style, shapeMap, model);
323
+ return this.upsertShape('text', 'labelShape', style, {
324
+ model,
325
+ shapeMap,
326
+ diffData,
327
+ diffState,
328
+ });
318
329
  }
319
330
 
320
331
  /**
@@ -332,11 +343,11 @@ export abstract class BaseNode {
332
343
  previous: NodeModelData | ComboModelData;
333
344
  current: NodeModelData | ComboModelData;
334
345
  },
335
- diffState?: { oldState: State[]; newState: State[] },
346
+ diffState?: { previous: State[]; current: State[] },
336
347
  ): DisplayObject {
337
348
  const { labelShape } = shapeMap;
338
349
  if (!labelShape || !labelShape.style.text || !model.data.labelShape) return;
339
- // label's local bounds, will take scale into acount
350
+ // label's local bounds, will take scale into account
340
351
  const textBBoxGeo = labelShape.getGeometryBounds();
341
352
  const height = textBBoxGeo.max[1] - textBBoxGeo.min[1];
342
353
  const width = Math.min(
@@ -355,13 +366,12 @@ export abstract class BaseNode {
355
366
  width: width + padding[1] + padding[3],
356
367
  height: height + padding[0] + padding[2],
357
368
  };
358
- const bgShape = this.upsertShape(
359
- 'rect',
360
- 'labelBackgroundShape',
361
- bgStyle,
362
- shapeMap,
369
+ const bgShape = this.upsertShape('rect', 'labelBackgroundShape', bgStyle, {
363
370
  model,
364
- );
371
+ shapeMap,
372
+ diffData,
373
+ diffState,
374
+ });
365
375
 
366
376
  return bgShape;
367
377
  }
@@ -412,8 +422,12 @@ export abstract class BaseNode {
412
422
  iconShapeType,
413
423
  'iconShape',
414
424
  shapeStyle as GShapeStyle,
415
- shapeMap,
416
- model,
425
+ {
426
+ shapeMap,
427
+ model,
428
+ diffData,
429
+ diffState,
430
+ },
417
431
  );
418
432
  }
419
433
 
@@ -450,13 +464,12 @@ export abstract class BaseNode {
450
464
  batchKey: 'halo',
451
465
  };
452
466
  delete s.fillOpacity;
453
- const shape = this.upsertShape(
454
- nodeName as SHAPE_TYPE,
455
- 'haloShape',
456
- s,
457
- shapeMap,
467
+ const shape = this.upsertShape(nodeName as SHAPE_TYPE, 'haloShape', s, {
458
468
  model,
459
- );
469
+ shapeMap,
470
+ diffData,
471
+ diffState,
472
+ });
460
473
  return shape;
461
474
  }
462
475
 
@@ -490,7 +503,7 @@ export abstract class BaseNode {
490
503
  const anchorPositionMap = this.calculateAnchorPosition(keyShapeStyle);
491
504
  individualConfigs.forEach((config, i) => {
492
505
  const { position, fill = keyShapeStyle.fill, ...style } = config;
493
- const [cx, cy] = this.getAnchorPosition(
506
+ const [cx, cy] = this.#getAnchorPosition(
494
507
  position,
495
508
  anchorPositionMap,
496
509
  shapeMap,
@@ -506,14 +519,18 @@ export abstract class BaseNode {
506
519
  ...commonStyle,
507
520
  ...style,
508
521
  } as GShapeStyle,
509
- shapeMap,
510
- model,
522
+ {
523
+ shapeMap,
524
+ model,
525
+ diffData,
526
+ diffState,
527
+ },
511
528
  );
512
529
  });
513
530
  return shapes;
514
531
  }
515
532
 
516
- private getAnchorPosition(
533
+ #getAnchorPosition(
517
534
  position: string | [number, number],
518
535
  anchorPositionMap: IAnchorPositionMap,
519
536
  shapeMap: NodeShapeMap | ComboShapeMap,
@@ -687,8 +704,12 @@ export abstract class BaseNode {
687
704
  textBaseline: 'middle',
688
705
  zIndex: (zIndex as number) + 1,
689
706
  } as GShapeStyle,
690
- shapeMap,
691
- model,
707
+ {
708
+ shapeMap,
709
+ model,
710
+ diffData,
711
+ diffState,
712
+ },
692
713
  );
693
714
  const bbox = shapes[id].getLocalBounds();
694
715
 
@@ -711,8 +732,12 @@ export abstract class BaseNode {
711
732
  y: bbox.center[1] - bgHeight / 2,
712
733
  ...otherStyles,
713
734
  } as GShapeStyle,
714
- shapeMap,
715
- model,
735
+ {
736
+ shapeMap,
737
+ model,
738
+ diffData,
739
+ diffState,
740
+ },
716
741
  );
717
742
  });
718
743
 
@@ -765,15 +790,16 @@ export abstract class BaseNode {
765
790
  type: SHAPE_TYPE | SHAPE_TYPE_3D,
766
791
  id: string,
767
792
  style: ShapeStyle,
768
- shapeMap: NodeShapeMap | ComboShapeMap,
769
- model: NodeDisplayModel | ComboDisplayModel,
793
+ config: {
794
+ model: NodeDisplayModel | ComboDisplayModel;
795
+ shapeMap: NodeShapeMap | ComboShapeMap;
796
+ diffData?: {
797
+ previous: NodeModelData | ComboModelData;
798
+ current: NodeModelData | ComboModelData;
799
+ };
800
+ diffState?: { previous: State[]; current: State[] };
801
+ },
770
802
  ): DisplayObject {
771
- return upsertShape(
772
- type as SHAPE_TYPE,
773
- id,
774
- style as GShapeStyle,
775
- shapeMap,
776
- model,
777
- );
803
+ return upsertShape(type as SHAPE_TYPE, id, style as GShapeStyle, config);
778
804
  }
779
805
  }
@@ -107,7 +107,12 @@ export abstract class BaseNode3D extends BaseNode {
107
107
  ...otherStyle,
108
108
  };
109
109
 
110
- return this.upsertShape('text', 'labelShape', style, shapeMap);
110
+ return this.upsertShape('text', 'labelShape', style, {
111
+ model,
112
+ shapeMap,
113
+ diffData,
114
+ diffState,
115
+ });
111
116
  }
112
117
 
113
118
  /**
@@ -146,7 +151,12 @@ export abstract class BaseNode3D extends BaseNode {
146
151
  stroke: attributes.fill,
147
152
  ...haloShapeStyle,
148
153
  },
149
- shapeMap,
154
+ {
155
+ model,
156
+ shapeMap,
157
+ diffData,
158
+ diffState,
159
+ },
150
160
  );
151
161
  }
152
162
 
@@ -195,8 +205,14 @@ export abstract class BaseNode3D extends BaseNode {
195
205
  type: SHAPE_TYPE_3D | SHAPE_TYPE,
196
206
  id: string,
197
207
  style: ShapeStyle,
198
- shapeMap: { [shapeId: string]: DisplayObject },
208
+ config: {
209
+ model: NodeDisplayModel;
210
+ shapeMap: NodeShapeMap;
211
+ diffData?: { previous: NodeModelData; current: NodeModelData };
212
+ diffState?: { previous: State[]; current: State[] };
213
+ },
199
214
  ): DisplayObject {
215
+ const { shapeMap } = config;
200
216
  return upsertShape3D(type, id, style as GShapeStyle, shapeMap, this.device);
201
217
  }
202
218
 
@@ -32,16 +32,26 @@ export class CircleNode extends BaseNode {
32
32
  let shapes: NodeShapeMap = { keyShape: undefined };
33
33
 
34
34
  // keyShape
35
- shapes.keyShape = this.drawKeyShape(model, shapeMap, diffData);
35
+ shapes.keyShape = this.drawKeyShape(model, shapeMap, diffData, diffState);
36
36
 
37
37
  // haloShape
38
38
  if (data.haloShape && this.drawHaloShape) {
39
- shapes.haloShape = this.drawHaloShape(model, shapeMap, diffData);
39
+ shapes.haloShape = this.drawHaloShape(
40
+ model,
41
+ shapeMap,
42
+ diffData,
43
+ diffState,
44
+ );
40
45
  }
41
46
 
42
47
  // labelShape
43
48
  if (data.labelShape && this.drawLabelShape) {
44
- shapes.labelShape = this.drawLabelShape(model, shapeMap, diffData);
49
+ shapes.labelShape = this.drawLabelShape(
50
+ model,
51
+ shapeMap,
52
+ diffData,
53
+ diffState,
54
+ );
45
55
  }
46
56
 
47
57
  // labelBackgroundShape
@@ -50,6 +60,7 @@ export class CircleNode extends BaseNode {
50
60
  model,
51
61
  shapeMap,
52
62
  diffData,
63
+ diffState,
53
64
  );
54
65
  }
55
66
 
@@ -69,7 +80,12 @@ export class CircleNode extends BaseNode {
69
80
 
70
81
  // iconShape
71
82
  if (data.iconShape && this.drawIconShape) {
72
- shapes.iconShape = this.drawIconShape(model, shapeMap, diffData);
83
+ shapes.iconShape = this.drawIconShape(
84
+ model,
85
+ shapeMap,
86
+ diffData,
87
+ diffState,
88
+ );
73
89
  }
74
90
 
75
91
  // badgeShape
@@ -90,7 +106,7 @@ export class CircleNode extends BaseNode {
90
106
  if (data.otherShapes && this.drawOtherShapes) {
91
107
  shapes = {
92
108
  ...shapes,
93
- ...this.drawOtherShapes(model, shapeMap, diffData),
109
+ ...this.drawOtherShapes(model, shapeMap, diffData, diffState),
94
110
  };
95
111
  }
96
112
  return shapes;
@@ -102,12 +118,17 @@ export class CircleNode extends BaseNode {
102
118
  diffData?: { previous: NodeModelData; current: NodeModelData },
103
119
  diffState?: { previous: State[]; current: State[] },
104
120
  ): DisplayObject {
105
- return this.upsertShape(
121
+ const shape = this.upsertShape(
106
122
  'circle',
107
123
  'keyShape',
108
124
  this.mergedStyles.keyShape,
109
- shapeMap,
110
- model,
125
+ {
126
+ model,
127
+ shapeMap,
128
+ diffData,
129
+ diffState,
130
+ },
111
131
  );
132
+ return shape;
112
133
  }
113
134
  }