@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
@@ -5,14 +5,29 @@ import { Command } from '../stdlib/plugin/history/command';
5
5
  import { Hooks } from '../types/hook';
6
6
  import { CameraAnimationOptions } from './animate';
7
7
  import { BehaviorOptionsOf, BehaviorRegistry } from './behavior';
8
- import { ComboModel, ComboUserModel } from './combo';
8
+ import {
9
+ ComboDisplayModel,
10
+ ComboModel,
11
+ ComboShapesEncode,
12
+ ComboUserModel,
13
+ } from './combo';
9
14
  import { Padding, Point } from './common';
10
15
  import { GraphData } from './data';
11
- import { EdgeDisplayModel, EdgeModel, EdgeUserModel } from './edge';
16
+ import {
17
+ EdgeDisplayModel,
18
+ EdgeModel,
19
+ EdgeShapesEncode,
20
+ EdgeUserModel,
21
+ } from './edge';
12
22
  import type { StackType } from './history';
13
23
  import { ITEM_TYPE, SHAPE_TYPE, ShapeStyle } from './item';
14
24
  import { LayoutOptions } from './layout';
15
- import { NodeModel, NodeUserModel } from './node';
25
+ import {
26
+ NodeDisplayModel,
27
+ NodeModel,
28
+ NodeShapesEncode,
29
+ NodeUserModel,
30
+ } from './node';
16
31
  import { RendererName } from './render';
17
32
  import { ComboMapper, EdgeMapper, NodeMapper, Specification } from './spec';
18
33
  import { ThemeOptionsOf, ThemeRegistry } from './theme';
@@ -55,6 +70,32 @@ export interface IGraph<
55
70
  type: ITEM_TYPE,
56
71
  mapper: NodeMapper | EdgeMapper | ComboMapper,
57
72
  ) => void;
73
+ /**
74
+ * Updates the state configuration for the specified item type, corresponds to the nodeState, edgeState, or comboState on the graph spec.
75
+ * @param {string} itemType - The type of item (node, edge, or combo).
76
+ * @param {object} stateConfig - The state configuration to update.
77
+ * @param {string} updateType - The type of update ('mergeReplace' or 'replace'). Default is 'mergeReplace'.
78
+ **/
79
+ updateStateConfig: (
80
+ itemType: ITEM_TYPE,
81
+ stateConfig:
82
+ | {
83
+ [stateName: string]:
84
+ | ((data: NodeModel) => NodeDisplayModel)
85
+ | NodeShapesEncode;
86
+ }
87
+ | {
88
+ [stateName: string]:
89
+ | ((data: EdgeModel) => EdgeDisplayModel)
90
+ | EdgeShapesEncode;
91
+ }
92
+ | {
93
+ [stateName: string]:
94
+ | ((data: ComboModel) => ComboDisplayModel)
95
+ | ComboShapesEncode;
96
+ },
97
+ updateType?: 'mergeReplace' | 'replace',
98
+ ) => void;
58
99
  /**
59
100
  * Get the copy of specs(configurations).
60
101
  * @returns graph specs
@@ -118,9 +159,10 @@ export interface IGraph<
118
159
  direction?: 'in' | 'out' | 'both',
119
160
  ) => EdgeModel[];
120
161
  /**
121
- * Get nearby edges from a start node using quadtree collision detection.
162
+ * Get nearby edges from a start node using quad-tree collision detection.
122
163
  * @param nodeId id of the start node
123
164
  * @returns nearby edges' data array
165
+ * @group Data
124
166
  */
125
167
  getNearEdgesData: (
126
168
  nodeId: ID,
@@ -161,7 +203,7 @@ export interface IGraph<
161
203
  * Change graph data.
162
204
  * @param data new data
163
205
  * @param type the way to change data, 'replace' means discard the old data and use the new one; 'mergeReplace' means merge the common part, remove (old - new), add (new - old)
164
- * @param relayout whether relayout the nodes after data changing
206
+ * @param re-layout whether re-layout the nodes after data changing
165
207
  * @returns
166
208
  * @group Data
167
209
  */
@@ -173,6 +215,7 @@ export interface IGraph<
173
215
  /**
174
216
  * Clear the graph, means remove all the items on the graph.
175
217
  * @returns
218
+ * @group Data
176
219
  */
177
220
  clear: () => void;
178
221
  /**
@@ -194,7 +237,7 @@ export interface IGraph<
194
237
  * Add one or more node/edge/combo data to the graph.
195
238
  * @param itemType item type
196
239
  * @param model user data
197
- * @returns whehter success
240
+ * @returns whether success
198
241
  * @group Data
199
242
  */
200
243
  addData: (
@@ -217,7 +260,7 @@ export interface IGraph<
217
260
  * Remove one or more node/edge/combo data from the graph.
218
261
  * @param itemType the type the item(s) to be removed.
219
262
  * @param id the id or the ids' array of the items to be removed.
220
- * @returns whehter success
263
+ * @returns whether success
221
264
  * @group Data
222
265
  */
223
266
  removeData: (itemType: ITEM_TYPE, id: ID | ID[]) => void;
@@ -298,7 +341,7 @@ export interface IGraph<
298
341
  * @param dy the distance alone y-axis to move the combo.
299
342
  * @param upsertAncestors whether update the ancestors in the combo tree.
300
343
  * @param callback callback function after move combo done.
301
- * @group Data
344
+ * @group Combo
302
345
  */
303
346
  moveCombo: (
304
347
  ids: ID[],
@@ -318,6 +361,7 @@ export interface IGraph<
318
361
  * @param dx x of the relative vector
319
362
  * @param dy y of the relative vector
320
363
  * @param effectTiming animation configurations
364
+ * @group View
321
365
  */
322
366
  translate: (
323
367
  distance: Partial<{
@@ -331,6 +375,7 @@ export interface IGraph<
331
375
  * Move the graph and align to a point.
332
376
  * @param point position on the canvas to align
333
377
  * @param effectTiming animation configurations
378
+ * @group View
334
379
  */
335
380
  translateTo: (
336
381
  point: PointLike,
@@ -339,6 +384,7 @@ export interface IGraph<
339
384
  /**
340
385
  * Return the current zoom level of camera.
341
386
  * @returns current zoom
387
+ * @group View
342
388
  */
343
389
  getZoom: () => number;
344
390
  /**
@@ -346,6 +392,7 @@ export interface IGraph<
346
392
  * @param ratio relative ratio to zoom
347
393
  * @param center zoom center
348
394
  * @param effectTiming animation configurations
395
+ * @group View
349
396
  */
350
397
  zoom: (
351
398
  ratio: number,
@@ -357,6 +404,7 @@ export interface IGraph<
357
404
  * @param toRatio specified ratio
358
405
  * @param center zoom center
359
406
  * @param effectTiming animation configurations
407
+ * @group View
360
408
  */
361
409
  zoomTo: (
362
410
  toRatio: number,
@@ -368,6 +416,7 @@ export interface IGraph<
368
416
  * @param angle
369
417
  * @param center
370
418
  * @param effectTiming
419
+ * @group View
371
420
  */
372
421
  rotate: (
373
422
  angle: number,
@@ -379,6 +428,7 @@ export interface IGraph<
379
428
  * @param toAngle
380
429
  * @param center
381
430
  * @param effectTiming
431
+ * @group View
382
432
  */
383
433
  rotateTo: (
384
434
  toAngle: number,
@@ -390,6 +440,7 @@ export interface IGraph<
390
440
  * Transform the graph with a CSS-Transform-like syntax.
391
441
  * @param options
392
442
  * @param effectTiming
443
+ * @group View
393
444
  */
394
445
  transform: (
395
446
  options: GraphTransformOptions,
@@ -397,10 +448,12 @@ export interface IGraph<
397
448
  ) => Promise<void>;
398
449
  /**
399
450
  * Stop the current transition of transform immediately.
451
+ * @group View
400
452
  */
401
453
  stopTransformTransition: () => void;
402
454
  /**
403
455
  * Return the center of viewport, e.g. for a 500 * 500 canvas, its center is [250, 250].
456
+ * @group View
404
457
  */
405
458
  getViewportCenter: () => PointLike;
406
459
  /**
@@ -570,7 +623,7 @@ export interface IGraph<
570
623
  /**
571
624
  * Get the visibility for a node / edge / combo.
572
625
  * @param id the id for the node / edge / combo
573
- * @returns visibility for the item, false for invisible or unexistence for the item
626
+ * @returns visibility for the item, false for invisible or un-existence for the item
574
627
  */
575
628
  getItemVisible: (id: ID) => boolean;
576
629
 
@@ -585,7 +638,7 @@ export interface IGraph<
585
638
 
586
639
  /**
587
640
  * Add a new combo to the graph, and update the structure of the existed child in childrenIds to be the children of the new combo.
588
- * Different from addData with combo type, this API update the succeeds' combo tree strucutres in the same time.
641
+ * Different from addData with combo type, this API update the succeeds' combo tree structures in the same time.
589
642
  * @param model combo user data.
590
643
  * @param childrenIds the ids of the children nodes / combos to move into the new combo.
591
644
  * @returns whether success
@@ -609,6 +662,7 @@ export interface IGraph<
609
662
  // ===== layout =====
610
663
  /**
611
664
  * Layout the graph (with current configurations if cfg is not assigned).
665
+ * @group Layout
612
666
  */
613
667
  layout: (options?: LayoutOptions, disableAnimate?: boolean) => Promise<void>;
614
668
  stopLayout: () => void;
@@ -637,6 +691,7 @@ export interface IGraph<
637
691
  * @param behaviors behavior names or configs
638
692
  * @param modes mode names
639
693
  * @returns
694
+ * @group Interaction
640
695
  */
641
696
  addBehaviors: (
642
697
  behaviors: BehaviorOptionsOf<B> | BehaviorOptionsOf<B>[],
@@ -662,7 +717,7 @@ export interface IGraph<
662
717
  /**
663
718
  * Draw or update a G shape or group to the transient canvas.
664
719
  * @param type shape type or item type
665
- * @param id new shape id or updated shape id for a interation shape, node/edge/combo id for item interaction group drawing
720
+ * @param id new shape id or updated shape id for a interaction shape, node/edge/combo id for item interaction group drawing
666
721
  * @returns upserted shape or group
667
722
  * @group Interaction
668
723
  */
@@ -726,6 +781,7 @@ export interface IGraph<
726
781
 
727
782
  /**
728
783
  * Determine if history (redo/undo) is enabled.
784
+ * @group History
729
785
  */
730
786
  isHistoryEnabled: () => void;
731
787
 
@@ -733,56 +789,67 @@ export interface IGraph<
733
789
  * Push the operation(s) onto the specified stack
734
790
  * @param cmd commands to be pushed
735
791
  * @param stackType undo/redo stack
792
+ * @group History
736
793
  */
737
794
  pushStack: (cmd: Command[], stackType: StackType) => void;
738
795
  /**
739
796
  * Pause stacking operation.
797
+ * @group History
740
798
  */
741
799
  pauseStack: () => void;
742
800
  /**
743
801
  * Resume stacking operation.
802
+ * @group History
744
803
  */
745
804
  resumeStack: () => void;
746
805
  /**
747
806
  * Execute a callback without allowing any stacking operations.
748
807
  * @param callback
808
+ * @group History
749
809
  */
750
810
  executeWithNoStack: (callback: () => void) => void;
751
811
  /**
752
812
  * Retrieve the current redo stack which consists of operations that could be undone
813
+ * @group History
753
814
  */
754
815
  getUndoStack: () => void;
755
816
 
756
817
  /**
757
818
  * Retrieve the current undo stack which consists of operations that were undone
819
+ * @group History
758
820
  */
759
821
  getRedoStack: () => void;
760
822
 
761
823
  /**
762
824
  * Retrieve the complete history stack
763
825
  * @returns
826
+ * @group History
764
827
  */
765
828
  getStack: () => void;
766
829
 
767
830
  /**
768
831
  * Revert the last n operation(s) on the graph.
769
832
  * @returns
833
+ * @group History
770
834
  */
771
835
  undo: () => void;
772
836
 
773
837
  /**
774
838
  * Restore the operation that was last n reverted on the graph.
775
839
  * @returns
840
+ * @group History
776
841
  */
777
842
  redo: () => void;
778
843
 
779
844
  /**
780
845
  * Indicate whether there are any actions available in the undo stack.
846
+ * @group History
781
847
  */
782
848
  canUndo: () => void;
783
849
 
784
850
  /**
785
851
  * Indicate whether there are any actions available in the redo stack.
852
+ * @group History
786
853
  */
787
854
  canRedo: () => void;
788
855
 
@@ -790,6 +857,7 @@ export interface IGraph<
790
857
  * Begin a historyBatch operation.
791
858
  * Any operations performed between `startHistoryBatch` and `stopHistoryBatch` are grouped together.
792
859
  * treated as a single operation when undoing or redoing.
860
+ * @group History
793
861
  */
794
862
  startHistoryBatch: () => void;
795
863
 
@@ -797,6 +865,7 @@ export interface IGraph<
797
865
  * End a historyBatch operation.
798
866
  * Any operations performed between `startHistoryBatch` and `stopHistoryBatch` are grouped together.
799
867
  * treated as a single operation when undoing or redoing.
868
+ * @group History
800
869
  */
801
870
  stopHistoryBatch: () => void;
802
871
 
@@ -805,6 +874,7 @@ export interface IGraph<
805
874
  * All operations performed inside callback will be treated as a composite operation
806
875
  * more convenient way without manually invoking `startHistoryBatch` and `stopHistoryBatch`.
807
876
  * @param callback The func containing operations to be batched together.
877
+ * @group History
808
878
  */
809
879
  historyBatch: (callback: () => void) => void;
810
880
 
@@ -813,6 +883,7 @@ export interface IGraph<
813
883
  * All operations performed inside callback will be treated as a composite operation
814
884
  * more convenient way without manually invoking `startHistoryBatch` and `stopHistoryBatch`.
815
885
  * @param callback The func containing operations to be batched together.
886
+ * @group History
816
887
  */
817
888
  cleanHistory: (stackType?: StackType) => void;
818
889
  // ===== tree operations =====
package/src/types/hook.ts CHANGED
@@ -3,13 +3,23 @@ import { GraphChange, ID } from '@antv/graphlib';
3
3
  import { CameraAnimationOptions } from './animate';
4
4
  import { BehaviorOptionsOf } from './behavior';
5
5
  import { DataChangeType, DataConfig, GraphCore } from './data';
6
- import { EdgeModel, EdgeModelData } from './edge';
6
+ import {
7
+ EdgeDisplayModel,
8
+ EdgeModel,
9
+ EdgeModelData,
10
+ EdgeShapesEncode,
11
+ } from './edge';
7
12
  import { ITEM_TYPE, ShapeStyle, SHAPE_TYPE } from './item';
8
13
  import { LayoutOptions } from './layout';
9
- import { NodeModel, NodeModelData } from './node';
14
+ import {
15
+ NodeDisplayModel,
16
+ NodeModel,
17
+ NodeModelData,
18
+ NodeShapesEncode,
19
+ } from './node';
10
20
  import { ThemeSpecification } from './theme';
11
21
  import { GraphTransformOptions } from './view';
12
- import { ComboModel } from './combo';
22
+ import { ComboDisplayModel, ComboModel, ComboShapesEncode } from './combo';
13
23
  import { Plugin as PluginBase } from './plugin';
14
24
  import { ComboMapper, EdgeMapper, NodeMapper } from './spec';
15
25
 
@@ -83,6 +93,25 @@ export interface Hooks {
83
93
  enableStack?: boolean;
84
94
  changes?: any;
85
95
  }>;
96
+ itemstateconfigchange: IHook<{
97
+ itemType: ITEM_TYPE;
98
+ stateConfig:
99
+ | {
100
+ [stateName: string]:
101
+ | ((data: NodeModel) => NodeDisplayModel)
102
+ | NodeShapesEncode;
103
+ }
104
+ | {
105
+ [stateName: string]:
106
+ | ((data: EdgeModel) => EdgeDisplayModel)
107
+ | EdgeShapesEncode;
108
+ }
109
+ | {
110
+ [stateName: string]:
111
+ | ((data: ComboModel) => ComboDisplayModel)
112
+ | ComboShapesEncode;
113
+ };
114
+ }>;
86
115
  itemvisibilitychange: IHook<{
87
116
  ids: ID[];
88
117
  graphCore?: GraphCore;
@@ -1,6 +1,7 @@
1
1
  export type { ID } from '@antv/graphlib';
2
2
  export type { IAnimate, IAnimates, AnimateTiming, AnimateCfg } from './animate';
3
- export type { Behavior, BehaviorOptionsOf, BehaviorRegistry } from './behavior';
3
+ export { Behavior } from './behavior';
4
+ export type { BehaviorOptionsOf, BehaviorRegistry } from './behavior';
4
5
  export type {
5
6
  NodeDisplayModel,
6
7
  NodeModel,
package/src/types/item.ts CHANGED
@@ -1,26 +1,25 @@
1
- import { ID } from '@antv/graphlib';
2
1
  import {
3
2
  AABB,
4
3
  CircleStyleProps,
5
- RectStyleProps,
4
+ DisplayObject,
6
5
  EllipseStyleProps,
7
- PolygonStyleProps,
6
+ Group,
7
+ HTMLStyleProps,
8
+ IAnimation,
9
+ ImageStyleProps,
8
10
  LineStyleProps,
9
11
  PathStyleProps,
12
+ PolygonStyleProps,
10
13
  PolylineStyleProps,
14
+ RectStyleProps,
11
15
  TextStyleProps,
12
- ImageStyleProps,
13
- Group,
14
- DisplayObject,
15
- IAnimation,
16
- Shape,
17
16
  } from '@antv/g';
18
17
  import {
19
18
  CubeGeometryProps,
20
19
  PlaneGeometryProps,
21
20
  SphereGeometryProps,
22
- TorusGeometryProps,
23
21
  } from '@antv/g-plugin-3d';
22
+ import { ID } from '@antv/graphlib';
24
23
  import { AnimateCfg, IAnimates } from './animate';
25
24
  import {
26
25
  ComboDisplayModel,
@@ -58,6 +57,7 @@ export type GShapeStyle = CircleStyleProps &
58
57
  PathStyleProps &
59
58
  SphereGeometryProps &
60
59
  CubeGeometryProps &
60
+ HTMLStyleProps &
61
61
  PlaneGeometryProps & {
62
62
  interactive?: boolean;
63
63
  };
@@ -85,7 +85,6 @@ export interface Encode<T> {
85
85
 
86
86
  export interface ShapeAttrEncode {
87
87
  [shapeAttr: string]: unknown | Encode<unknown>;
88
- animates?: IAnimates | Encode<IAnimates>;
89
88
  }
90
89
 
91
90
  export interface LabelBackground {
@@ -101,8 +100,7 @@ export interface ShapesEncode {
101
100
  iconShape?: ShapeAttrEncode | Encode<ShapeStyle>;
102
101
  otherShapes?: {
103
102
  [shapeId: string]: {
104
- [shapeAtrr: string]: unknown | Encode<unknown>;
105
- animates: IAnimates | Encode<IAnimates>;
103
+ [shapeAttr: string]: unknown | Encode<unknown>;
106
104
  };
107
105
  };
108
106
  }
@@ -116,7 +114,8 @@ export type SHAPE_TYPE =
116
114
  | 'line'
117
115
  | 'path'
118
116
  | 'text'
119
- | 'group';
117
+ | 'group'
118
+ | 'html';
120
119
 
121
120
  export type SHAPE_TYPE_3D = 'sphere' | 'cube' | 'plane';
122
121
 
@@ -200,7 +199,7 @@ export interface IItem {
200
199
  displayModel: ItemDisplayModel;
201
200
  /** The style mapper configured at graph with field name 'node' / 'edge' / 'combo'. */
202
201
  mapper: DisplayMapper;
203
- /** The state sstyle mapper configured at traph with field name 'nodeState' / 'edgeState' / 'comboState'. */
202
+ /** The state style mapper configured at graph with field name 'nodeState' / 'edgeState' / 'comboState'. */
204
203
  stateMapper: {
205
204
  [stateName: string]: DisplayMapper;
206
205
  };
@@ -235,7 +234,7 @@ export interface IItem {
235
234
  lodLevels: LodLevelRanges;
236
235
  /** Last zoom ratio. */
237
236
  zoom: number;
238
- /** Cache the chaging states which are not consomed by draw */
237
+ /** Cache the changing states which are not consumed by draw */
239
238
  changedStates: string[];
240
239
  /** The listener for the animations frames. */
241
240
  onframe: Function;
@@ -334,7 +333,7 @@ export interface IItem {
334
333
  getBBox: () => AABB;
335
334
  /** Stop all the animations on the item. */
336
335
  stopAnimations: () => void;
337
- /** Animations' frame listemer. */
336
+ /** Animations' frame listener. */
338
337
  animateFrameListener: Function;
339
338
  /** Call render extension's onZoom to response the graph zooming. */
340
339
  updateZoom: (zoom: number) => void;
@@ -35,7 +35,7 @@ type Workerized = {
35
35
  workerEnabled?: boolean;
36
36
 
37
37
  /**
38
- * Iterations for iteratable layouts such as Force.
38
+ * Iterations for iterable layouts such as Force.
39
39
  */
40
40
  iterations?: number;
41
41
  };
package/src/types/node.ts CHANGED
@@ -154,39 +154,9 @@ export interface NodeShapeStyles extends ItemShapeStyles {
154
154
  };
155
155
  };
156
156
  anchorShapes?: ShapeStyle & {
157
- /**
158
- * Background color of the anchor.
159
- */
160
- color?: string;
161
- /**
162
- * Color of the text in anchor.
163
- */
164
- textColor?: string;
165
- /**
166
- * Size of the text in anchor.
167
- */
168
- size?: number;
169
- /**
170
- * The x-axis offset of the text relative to the current position
171
- */
172
- offsetX?: number;
173
- /**
174
- * The y-axis offset of the text relative to the current position
175
- */
176
- offsetY?: number;
177
- /**
178
- * The z-axis offset of the text relative to the current position
179
- */
180
- offsetZ?: number;
181
157
  // individual styles and their position
182
158
  [key: number]: ShapeStyle & {
183
- position?: BadgePosition;
184
- color?: string;
185
- textColor?: string;
186
- size?: number;
187
- offsetX?: number;
188
- offsetY?: number;
189
- offsetZ?: number;
159
+ position?: 'top' | 'left' | 'bottom' | 'right' | [number, number];
190
160
  };
191
161
  };
192
162
  }
@@ -45,7 +45,7 @@ export abstract class Plugin {
45
45
  }
46
46
 
47
47
  /**
48
- * Get the defualt options of the plugin.
48
+ * Get the default options of the plugin.
49
49
  */
50
50
  public getDefaultCfgs() {
51
51
  return {};
package/src/types/spec.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { Canvas } from '@antv/g';
2
2
  import { AnimateCfg, CameraAnimationOptions } from './animate';
3
3
  import { Padding, Point } from './common';
4
- import { DataConfig, TransformerFn } from './data';
4
+ import { DataConfig, DataLifecycleType, TransformerFn } from './data';
5
5
  import {
6
6
  EdgeDisplayModel,
7
7
  EdgeEncode,
@@ -42,6 +42,7 @@ export interface Specification<
42
42
  container?: string | HTMLElement;
43
43
  backgroundCanvas?: Canvas;
44
44
  canvas?: Canvas;
45
+ labelCanvas?: Canvas;
45
46
  transientCanvas?: Canvas;
46
47
  transientLabelCanvas?: Canvas;
47
48
  width?: number;
@@ -60,11 +61,11 @@ export interface Specification<
60
61
  tileFirstRender?: boolean | number;
61
62
  /** Tile size for first rendering. */
62
63
  tileFirstRenderSize?: number;
63
- /** Whether enable tile hiding / showing for behaivors, e.g. hiding shapes while drag-canvas, zoom-canvas. The enableOptimize in behavior configuration has higher priority. */
64
+ /** Whether enable tile hiding / showing for behaviors, e.g. hiding shapes while drag-canvas, zoom-canvas. The enableOptimize in behavior configuration has higher priority. */
64
65
  tileBehavior?: boolean | number;
65
66
  /** Tile size for shape optimizing by behaviors, e.g. hiding shapes while drag-canvas, zoom-canvas. The enableOptimize in behavior configuration has higher priority. */
66
67
  tileBehaviorSize?: number;
67
- /** Tile size for level of detial changing. */
68
+ /** Tile size for level of detail changing. */
68
69
  tileLodSize?: number;
69
70
  };
70
71
  autoFit?:
@@ -86,7 +87,6 @@ export interface Specification<
86
87
  alignment?: GraphAlignment;
87
88
  effectTiming?: CameraAnimationOptions;
88
89
  };
89
- optimizeThreshold?: number;
90
90
 
91
91
  /** data */
92
92
  data?: DataConfig;
@@ -94,7 +94,7 @@ export interface Specification<
94
94
  | string[]
95
95
  | {
96
96
  type: string;
97
- activeLifecycle: string | string[];
97
+ activeLifecycle: 'all' | DataLifecycleType | DataLifecycleType[];
98
98
  [param: string]: unknown; // TODO: generate by plugins
99
99
  }[]
100
100
  | TransformerFn[];
@@ -19,7 +19,7 @@ export abstract class Theme {
19
19
  destroy() {}
20
20
  }
21
21
 
22
- /** Theme regisry table.
22
+ /** Theme registry table.
23
23
  * @example { 'drag-node': DragNodeBehavior, 'my-drag-node': MyDragNodeBehavior }
24
24
  */
25
25
  export interface ThemeRegistry {
package/src/types/view.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export interface FitViewRules {
2
- /** Whehter fit it only when the graph is out of the viewport. */
2
+ /** Whether fit it only when the graph is out of the viewport. */
3
3
  onlyOutOfViewport?: boolean;
4
4
  /** Whether zoom the graph only when the graph is larger than the viewport. */
5
5
  onlyZoomAtLargerThanViewport?: boolean;
@@ -509,7 +509,7 @@ export const getAnimatesExcludePosition = (animates) => {
509
509
  };
510
510
 
511
511
  export const fadeIn = (id, shape, style, hiddenShape, animateConfig) => {
512
- // omit inexist shape and the shape which is not hidden by zoom changing
512
+ // omit in-existence shape and the shape which is not hidden by zoom changing
513
513
  if (!shape || !hiddenShape[id]) return;
514
514
  if (!shape?.isVisible()) {
515
515
  shape.style.opacity = 0;
@@ -22,6 +22,7 @@ export const createCanvas = (
22
22
  height: number,
23
23
  pixelRatio?: number,
24
24
  canvasConfig: Partial<CanvasConfig> = {},
25
+ unregisterPlugins: string[] = [],
25
26
  ): Canvas => {
26
27
  let renderer: any;
27
28
  switch (rendererType.toLowerCase()) {
@@ -46,6 +47,13 @@ export const createCanvas = (
46
47
  }),
47
48
  );
48
49
 
50
+ if (unregisterPlugins.length) {
51
+ unregisterPlugins.forEach((name) => {
52
+ const plugin = renderer.getPlugin(name);
53
+ renderer.unregisterPlugin(plugin);
54
+ });
55
+ }
56
+
49
57
  return new Canvas({
50
58
  container,
51
59
  width,