@antv/g6 5.0.0-beta.37 → 5.0.0-beta.38

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 (466) hide show
  1. package/dist/g6.min.js +2 -2
  2. package/dist/lib/animations/executor.d.ts +4 -5
  3. package/dist/lib/animations/index.d.ts +22 -8
  4. package/dist/lib/animations/types.d.ts +78 -20
  5. package/dist/lib/behaviors/collapse-expand.d.ts +10 -1
  6. package/dist/lib/behaviors/drag-canvas.d.ts +1 -0
  7. package/dist/lib/behaviors/hover-element.d.ts +2 -0
  8. package/dist/lib/constants/animation.d.ts +3 -2
  9. package/dist/lib/constants/events/animation.d.ts +2 -0
  10. package/dist/lib/constants/events/graph.d.ts +0 -12
  11. package/dist/lib/elements/base-element.d.ts +35 -0
  12. package/dist/lib/elements/combos/base-combo.d.ts +8 -32
  13. package/dist/lib/elements/combos/circle.d.ts +1 -2
  14. package/dist/lib/elements/edges/base-edge.d.ts +21 -30
  15. package/dist/lib/elements/nodes/base-node.d.ts +7 -27
  16. package/dist/lib/elements/nodes/html.d.ts +2 -1
  17. package/dist/lib/elements/shapes/badge.d.ts +1 -1
  18. package/dist/lib/elements/shapes/base-shape.d.ts +6 -0
  19. package/dist/lib/exports.d.ts +3 -2
  20. package/dist/lib/layouts/types.d.ts +1 -1
  21. package/dist/lib/plugins/background/index.d.ts +38 -0
  22. package/dist/lib/plugins/{contextmenu.d.ts → contextmenu/index.d.ts} +5 -5
  23. package/dist/lib/plugins/index.d.ts +2 -0
  24. package/{lib/plugins/watermark.d.ts → dist/lib/plugins/watermark/index.d.ts} +3 -3
  25. package/dist/lib/runtime/animation.d.ts +54 -0
  26. package/dist/lib/runtime/canvas.d.ts +0 -2
  27. package/dist/lib/runtime/data.d.ts +4 -4
  28. package/dist/lib/runtime/element.d.ts +26 -40
  29. package/dist/lib/runtime/graph.d.ts +1 -0
  30. package/dist/lib/runtime/layout.d.ts +7 -0
  31. package/dist/lib/runtime/transform.d.ts +1 -0
  32. package/dist/lib/runtime/types.d.ts +7 -0
  33. package/dist/lib/spec/data.d.ts +14 -0
  34. package/dist/lib/spec/element/animation.d.ts +3 -9
  35. package/dist/lib/spec/element/combo.d.ts +4 -3
  36. package/dist/lib/spec/element/edge.d.ts +4 -3
  37. package/dist/lib/spec/element/node.d.ts +4 -3
  38. package/dist/lib/transforms/base-transform.d.ts +2 -1
  39. package/dist/lib/transforms/collapse-expand-combo.d.ts +4 -3
  40. package/dist/lib/transforms/collapse-expand-node.d.ts +12 -0
  41. package/dist/lib/transforms/get-edge-actual-ends.d.ts +13 -0
  42. package/dist/lib/transforms/index.d.ts +2 -0
  43. package/dist/lib/transforms/process-parallel-edges.d.ts +6 -4
  44. package/dist/lib/transforms/types.d.ts +2 -2
  45. package/dist/lib/transforms/update-related-edge.d.ts +2 -1
  46. package/dist/lib/transforms/utils.d.ts +13 -0
  47. package/dist/lib/types/animation.d.ts +1 -2
  48. package/dist/lib/types/node.d.ts +12 -0
  49. package/dist/lib/utils/animation.d.ts +17 -29
  50. package/dist/lib/utils/collapsibility.d.ts +9 -0
  51. package/dist/lib/utils/element.d.ts +19 -2
  52. package/dist/lib/utils/theme.d.ts +9 -0
  53. package/dist/lib/utils/transform.d.ts +14 -0
  54. package/esm/animations/executor.d.ts +4 -5
  55. package/esm/animations/executor.js +31 -48
  56. package/esm/animations/executor.js.map +1 -1
  57. package/esm/animations/index.d.ts +22 -8
  58. package/esm/animations/index.js +10 -12
  59. package/esm/animations/index.js.map +1 -1
  60. package/esm/animations/types.d.ts +78 -20
  61. package/esm/behaviors/collapse-expand.d.ts +10 -1
  62. package/esm/behaviors/collapse-expand.js +15 -6
  63. package/esm/behaviors/collapse-expand.js.map +1 -1
  64. package/esm/behaviors/create-edge.js +2 -2
  65. package/esm/behaviors/create-edge.js.map +1 -1
  66. package/esm/behaviors/drag-canvas.d.ts +1 -0
  67. package/esm/behaviors/drag-canvas.js +5 -1
  68. package/esm/behaviors/drag-canvas.js.map +1 -1
  69. package/esm/behaviors/drag-element.js +2 -2
  70. package/esm/behaviors/drag-element.js.map +1 -1
  71. package/esm/behaviors/hover-element.d.ts +2 -0
  72. package/esm/behaviors/hover-element.js +12 -2
  73. package/esm/behaviors/hover-element.js.map +1 -1
  74. package/esm/constants/animation.d.ts +3 -2
  75. package/esm/constants/animation.js.map +1 -1
  76. package/esm/constants/events/animation.d.ts +2 -0
  77. package/esm/constants/events/animation.js +2 -0
  78. package/esm/constants/events/animation.js.map +1 -1
  79. package/esm/constants/events/graph.d.ts +0 -12
  80. package/esm/constants/events/graph.js +0 -12
  81. package/esm/constants/events/graph.js.map +1 -1
  82. package/esm/elements/base-element.d.ts +35 -0
  83. package/esm/elements/base-element.js +42 -0
  84. package/esm/elements/base-element.js.map +1 -0
  85. package/esm/elements/combos/base-combo.d.ts +8 -32
  86. package/esm/elements/combos/base-combo.js +53 -55
  87. package/esm/elements/combos/base-combo.js.map +1 -1
  88. package/esm/elements/combos/circle.d.ts +1 -2
  89. package/esm/elements/combos/circle.js +1 -12
  90. package/esm/elements/combos/circle.js.map +1 -1
  91. package/esm/elements/combos/rect.js +1 -2
  92. package/esm/elements/combos/rect.js.map +1 -1
  93. package/esm/elements/edges/base-edge.d.ts +21 -30
  94. package/esm/elements/edges/base-edge.js +38 -35
  95. package/esm/elements/edges/base-edge.js.map +1 -1
  96. package/esm/elements/edges/polyline.js +8 -4
  97. package/esm/elements/edges/polyline.js.map +1 -1
  98. package/esm/elements/nodes/base-node.d.ts +7 -27
  99. package/esm/elements/nodes/base-node.js +16 -38
  100. package/esm/elements/nodes/base-node.js.map +1 -1
  101. package/esm/elements/nodes/html.d.ts +2 -1
  102. package/esm/elements/nodes/html.js +8 -1
  103. package/esm/elements/nodes/html.js.map +1 -1
  104. package/esm/elements/shapes/badge.d.ts +1 -1
  105. package/esm/elements/shapes/base-shape.d.ts +6 -0
  106. package/esm/elements/shapes/base-shape.js +23 -6
  107. package/esm/elements/shapes/base-shape.js.map +1 -1
  108. package/esm/exports.d.ts +3 -2
  109. package/esm/layouts/types.d.ts +1 -1
  110. package/esm/plugins/background/index.d.ts +38 -0
  111. package/esm/plugins/background/index.js +49 -0
  112. package/esm/plugins/background/index.js.map +1 -0
  113. package/esm/plugins/{contextmenu.d.ts → contextmenu/index.d.ts} +5 -5
  114. package/esm/plugins/{contextmenu.js → contextmenu/index.js} +4 -4
  115. package/esm/plugins/contextmenu/index.js.map +1 -0
  116. package/esm/{utils/contextmenu.js → plugins/contextmenu/util.js} +1 -1
  117. package/esm/{utils/contextmenu.js.map → plugins/contextmenu/util.js.map} +1 -1
  118. package/esm/plugins/history/index.js +1 -1
  119. package/esm/plugins/history/index.js.map +1 -1
  120. package/esm/plugins/history/{utils.js → util.js} +1 -1
  121. package/esm/plugins/history/util.js.map +1 -0
  122. package/esm/plugins/index.d.ts +2 -0
  123. package/esm/plugins/index.js +1 -0
  124. package/esm/plugins/index.js.map +1 -1
  125. package/esm/plugins/timebar.js +1 -1
  126. package/esm/plugins/timebar.js.map +1 -1
  127. package/{dist/lib/plugins/watermark.d.ts → esm/plugins/watermark/index.d.ts} +3 -3
  128. package/esm/plugins/{watermark.js → watermark/index.js} +4 -4
  129. package/esm/plugins/watermark/index.js.map +1 -0
  130. package/esm/{utils/watermark.js → plugins/watermark/util.js} +1 -1
  131. package/esm/plugins/watermark/util.js.map +1 -0
  132. package/esm/registry/build-in.js +14 -6
  133. package/esm/registry/build-in.js.map +1 -1
  134. package/esm/runtime/animation.d.ts +54 -0
  135. package/esm/runtime/animation.js +139 -0
  136. package/esm/runtime/animation.js.map +1 -0
  137. package/esm/runtime/canvas.d.ts +0 -2
  138. package/esm/runtime/canvas.js +0 -21
  139. package/esm/runtime/canvas.js.map +1 -1
  140. package/esm/runtime/data.d.ts +4 -4
  141. package/esm/runtime/data.js +16 -17
  142. package/esm/runtime/data.js.map +1 -1
  143. package/esm/runtime/element.d.ts +26 -40
  144. package/esm/runtime/element.js +218 -179
  145. package/esm/runtime/element.js.map +1 -1
  146. package/esm/runtime/graph.d.ts +1 -0
  147. package/esm/runtime/graph.js +44 -11
  148. package/esm/runtime/graph.js.map +1 -1
  149. package/esm/runtime/layout.d.ts +7 -0
  150. package/esm/runtime/layout.js +44 -3
  151. package/esm/runtime/layout.js.map +1 -1
  152. package/esm/runtime/transform.d.ts +1 -0
  153. package/esm/runtime/transform.js +9 -2
  154. package/esm/runtime/transform.js.map +1 -1
  155. package/esm/runtime/types.d.ts +7 -0
  156. package/esm/runtime/viewport.js +2 -2
  157. package/esm/runtime/viewport.js.map +1 -1
  158. package/esm/spec/data.d.ts +14 -0
  159. package/esm/spec/element/animation.d.ts +3 -9
  160. package/esm/spec/element/combo.d.ts +4 -3
  161. package/esm/spec/element/edge.d.ts +4 -3
  162. package/esm/spec/element/node.d.ts +4 -3
  163. package/esm/themes/base.js +14 -10
  164. package/esm/themes/base.js.map +1 -1
  165. package/esm/transforms/base-transform.d.ts +2 -1
  166. package/esm/transforms/base-transform.js +1 -1
  167. package/esm/transforms/base-transform.js.map +1 -1
  168. package/esm/transforms/collapse-expand-combo.d.ts +4 -3
  169. package/esm/transforms/collapse-expand-combo.js +9 -25
  170. package/esm/transforms/collapse-expand-combo.js.map +1 -1
  171. package/esm/transforms/collapse-expand-node.d.ts +12 -0
  172. package/esm/transforms/collapse-expand-node.js +91 -0
  173. package/esm/transforms/collapse-expand-node.js.map +1 -0
  174. package/esm/transforms/get-edge-actual-ends.d.ts +13 -0
  175. package/esm/transforms/get-edge-actual-ends.js +36 -0
  176. package/esm/transforms/get-edge-actual-ends.js.map +1 -0
  177. package/esm/transforms/index.d.ts +2 -0
  178. package/esm/transforms/index.js +2 -0
  179. package/esm/transforms/index.js.map +1 -1
  180. package/esm/transforms/process-parallel-edges.d.ts +6 -4
  181. package/esm/transforms/process-parallel-edges.js +42 -27
  182. package/esm/transforms/process-parallel-edges.js.map +1 -1
  183. package/esm/transforms/types.d.ts +2 -2
  184. package/esm/transforms/types.js +1 -10
  185. package/esm/transforms/types.js.map +1 -1
  186. package/esm/transforms/update-related-edge.d.ts +2 -1
  187. package/esm/transforms/update-related-edge.js +4 -1
  188. package/esm/transforms/update-related-edge.js.map +1 -1
  189. package/esm/transforms/utils.d.ts +13 -0
  190. package/esm/transforms/utils.js +25 -0
  191. package/esm/transforms/utils.js.map +1 -0
  192. package/esm/types/animation.d.ts +1 -2
  193. package/esm/types/node.d.ts +12 -0
  194. package/esm/utils/animation.d.ts +17 -29
  195. package/esm/utils/animation.js +64 -54
  196. package/esm/utils/animation.js.map +1 -1
  197. package/esm/utils/cache.js +0 -1
  198. package/esm/utils/cache.js.map +1 -1
  199. package/esm/utils/collapsibility.d.ts +9 -0
  200. package/esm/utils/collapsibility.js +11 -0
  201. package/esm/utils/collapsibility.js.map +1 -0
  202. package/esm/utils/dom.js +1 -2
  203. package/esm/utils/dom.js.map +1 -1
  204. package/esm/utils/edge.js +2 -1
  205. package/esm/utils/edge.js.map +1 -1
  206. package/esm/utils/element.d.ts +19 -2
  207. package/esm/utils/element.js +24 -3
  208. package/esm/utils/element.js.map +1 -1
  209. package/esm/utils/theme.d.ts +9 -0
  210. package/esm/utils/theme.js +17 -0
  211. package/esm/utils/theme.js.map +1 -0
  212. package/esm/utils/transform.d.ts +14 -0
  213. package/esm/utils/transform.js +24 -0
  214. package/esm/utils/transform.js.map +1 -1
  215. package/lib/animations/executor.d.ts +4 -5
  216. package/lib/animations/executor.js +30 -47
  217. package/lib/animations/executor.js.map +1 -1
  218. package/lib/animations/index.d.ts +22 -8
  219. package/lib/animations/index.js +12 -14
  220. package/lib/animations/index.js.map +1 -1
  221. package/lib/animations/types.d.ts +78 -20
  222. package/lib/behaviors/collapse-expand.d.ts +10 -1
  223. package/lib/behaviors/collapse-expand.js +15 -6
  224. package/lib/behaviors/collapse-expand.js.map +1 -1
  225. package/lib/behaviors/create-edge.js +2 -2
  226. package/lib/behaviors/create-edge.js.map +1 -1
  227. package/lib/behaviors/drag-canvas.d.ts +1 -0
  228. package/lib/behaviors/drag-canvas.js +5 -1
  229. package/lib/behaviors/drag-canvas.js.map +1 -1
  230. package/lib/behaviors/drag-element.js +2 -2
  231. package/lib/behaviors/drag-element.js.map +1 -1
  232. package/lib/behaviors/hover-element.d.ts +2 -0
  233. package/lib/behaviors/hover-element.js +12 -2
  234. package/lib/behaviors/hover-element.js.map +1 -1
  235. package/lib/constants/animation.d.ts +3 -2
  236. package/lib/constants/animation.js.map +1 -1
  237. package/lib/constants/events/animation.d.ts +2 -0
  238. package/lib/constants/events/animation.js +2 -0
  239. package/lib/constants/events/animation.js.map +1 -1
  240. package/lib/constants/events/graph.d.ts +0 -12
  241. package/lib/constants/events/graph.js +0 -12
  242. package/lib/constants/events/graph.js.map +1 -1
  243. package/lib/elements/base-element.d.ts +35 -0
  244. package/lib/elements/base-element.js +46 -0
  245. package/lib/elements/base-element.js.map +1 -0
  246. package/lib/elements/combos/base-combo.d.ts +8 -32
  247. package/lib/elements/combos/base-combo.js +52 -54
  248. package/lib/elements/combos/base-combo.js.map +1 -1
  249. package/lib/elements/combos/circle.d.ts +1 -2
  250. package/lib/elements/combos/circle.js +1 -12
  251. package/lib/elements/combos/circle.js.map +1 -1
  252. package/lib/elements/combos/rect.js +1 -2
  253. package/lib/elements/combos/rect.js.map +1 -1
  254. package/lib/elements/edges/base-edge.d.ts +21 -30
  255. package/lib/elements/edges/base-edge.js +38 -35
  256. package/lib/elements/edges/base-edge.js.map +1 -1
  257. package/lib/elements/edges/polyline.js +8 -4
  258. package/lib/elements/edges/polyline.js.map +1 -1
  259. package/lib/elements/nodes/base-node.d.ts +7 -27
  260. package/lib/elements/nodes/base-node.js +15 -37
  261. package/lib/elements/nodes/base-node.js.map +1 -1
  262. package/lib/elements/nodes/html.d.ts +2 -1
  263. package/lib/elements/nodes/html.js +8 -1
  264. package/lib/elements/nodes/html.js.map +1 -1
  265. package/lib/elements/shapes/badge.d.ts +1 -1
  266. package/lib/elements/shapes/base-shape.d.ts +6 -0
  267. package/lib/elements/shapes/base-shape.js +23 -6
  268. package/lib/elements/shapes/base-shape.js.map +1 -1
  269. package/lib/exports.d.ts +3 -2
  270. package/lib/layouts/types.d.ts +1 -1
  271. package/lib/plugins/background/index.d.ts +38 -0
  272. package/lib/plugins/background/index.js +53 -0
  273. package/lib/plugins/background/index.js.map +1 -0
  274. package/lib/plugins/{contextmenu.d.ts → contextmenu/index.d.ts} +5 -5
  275. package/lib/plugins/{contextmenu.js → contextmenu/index.js} +6 -6
  276. package/lib/plugins/{contextmenu.js.map → contextmenu/index.js.map} +1 -1
  277. package/lib/{utils/contextmenu.js → plugins/contextmenu/util.js} +1 -1
  278. package/lib/{utils/contextmenu.js.map → plugins/contextmenu/util.js.map} +1 -1
  279. package/lib/plugins/history/index.js +2 -2
  280. package/lib/plugins/history/index.js.map +1 -1
  281. package/lib/plugins/history/{utils.js → util.js} +1 -1
  282. package/lib/plugins/history/util.js.map +1 -0
  283. package/lib/plugins/index.d.ts +2 -0
  284. package/lib/plugins/index.js +3 -1
  285. package/lib/plugins/index.js.map +1 -1
  286. package/lib/plugins/timebar.js +1 -1
  287. package/lib/plugins/timebar.js.map +1 -1
  288. package/{esm/plugins/watermark.d.ts → lib/plugins/watermark/index.d.ts} +3 -3
  289. package/lib/plugins/{watermark.js → watermark/index.js} +6 -6
  290. package/lib/plugins/watermark/index.js.map +1 -0
  291. package/lib/{utils/watermark.js → plugins/watermark/util.js} +1 -1
  292. package/lib/plugins/watermark/util.js.map +1 -0
  293. package/lib/registry/build-in.js +11 -3
  294. package/lib/registry/build-in.js.map +1 -1
  295. package/lib/runtime/animation.d.ts +54 -0
  296. package/lib/runtime/animation.js +143 -0
  297. package/lib/runtime/animation.js.map +1 -0
  298. package/lib/runtime/canvas.d.ts +0 -2
  299. package/lib/runtime/canvas.js +0 -21
  300. package/lib/runtime/canvas.js.map +1 -1
  301. package/lib/runtime/data.d.ts +4 -4
  302. package/lib/runtime/data.js +15 -16
  303. package/lib/runtime/data.js.map +1 -1
  304. package/lib/runtime/element.d.ts +26 -40
  305. package/lib/runtime/element.js +215 -176
  306. package/lib/runtime/element.js.map +1 -1
  307. package/lib/runtime/graph.d.ts +1 -0
  308. package/lib/runtime/graph.js +44 -11
  309. package/lib/runtime/graph.js.map +1 -1
  310. package/lib/runtime/layout.d.ts +7 -0
  311. package/lib/runtime/layout.js +43 -2
  312. package/lib/runtime/layout.js.map +1 -1
  313. package/lib/runtime/transform.d.ts +1 -0
  314. package/lib/runtime/transform.js +9 -2
  315. package/lib/runtime/transform.js.map +1 -1
  316. package/lib/runtime/types.d.ts +7 -0
  317. package/lib/runtime/viewport.js +1 -1
  318. package/lib/runtime/viewport.js.map +1 -1
  319. package/lib/spec/data.d.ts +14 -0
  320. package/lib/spec/element/animation.d.ts +3 -9
  321. package/lib/spec/element/combo.d.ts +4 -3
  322. package/lib/spec/element/edge.d.ts +4 -3
  323. package/lib/spec/element/node.d.ts +4 -3
  324. package/lib/themes/base.js +14 -10
  325. package/lib/themes/base.js.map +1 -1
  326. package/lib/transforms/base-transform.d.ts +2 -1
  327. package/lib/transforms/base-transform.js +1 -1
  328. package/lib/transforms/base-transform.js.map +1 -1
  329. package/lib/transforms/collapse-expand-combo.d.ts +4 -3
  330. package/lib/transforms/collapse-expand-combo.js +13 -29
  331. package/lib/transforms/collapse-expand-combo.js.map +1 -1
  332. package/lib/transforms/collapse-expand-node.d.ts +12 -0
  333. package/lib/transforms/collapse-expand-node.js +95 -0
  334. package/lib/transforms/collapse-expand-node.js.map +1 -0
  335. package/lib/transforms/get-edge-actual-ends.d.ts +13 -0
  336. package/lib/transforms/get-edge-actual-ends.js +41 -0
  337. package/lib/transforms/get-edge-actual-ends.js.map +1 -0
  338. package/lib/transforms/index.d.ts +2 -0
  339. package/lib/transforms/index.js +5 -1
  340. package/lib/transforms/index.js.map +1 -1
  341. package/lib/transforms/process-parallel-edges.d.ts +6 -4
  342. package/lib/transforms/process-parallel-edges.js +41 -26
  343. package/lib/transforms/process-parallel-edges.js.map +1 -1
  344. package/lib/transforms/types.d.ts +2 -2
  345. package/lib/transforms/types.js +0 -12
  346. package/lib/transforms/types.js.map +1 -1
  347. package/lib/transforms/update-related-edge.d.ts +2 -1
  348. package/lib/transforms/update-related-edge.js +4 -1
  349. package/lib/transforms/update-related-edge.js.map +1 -1
  350. package/lib/transforms/utils.d.ts +13 -0
  351. package/lib/transforms/utils.js +29 -0
  352. package/lib/transforms/utils.js.map +1 -0
  353. package/lib/types/animation.d.ts +1 -2
  354. package/lib/types/node.d.ts +12 -0
  355. package/lib/utils/animation.d.ts +17 -29
  356. package/lib/utils/animation.js +65 -56
  357. package/lib/utils/animation.js.map +1 -1
  358. package/lib/utils/cache.js +0 -1
  359. package/lib/utils/cache.js.map +1 -1
  360. package/lib/utils/collapsibility.d.ts +9 -0
  361. package/lib/utils/collapsibility.js +15 -0
  362. package/lib/utils/collapsibility.js.map +1 -0
  363. package/lib/utils/dom.js +1 -2
  364. package/lib/utils/dom.js.map +1 -1
  365. package/lib/utils/edge.js +2 -1
  366. package/lib/utils/edge.js.map +1 -1
  367. package/lib/utils/element.d.ts +19 -2
  368. package/lib/utils/element.js +26 -3
  369. package/lib/utils/element.js.map +1 -1
  370. package/lib/utils/theme.d.ts +9 -0
  371. package/lib/utils/theme.js +21 -0
  372. package/lib/utils/theme.js.map +1 -0
  373. package/lib/utils/transform.d.ts +14 -0
  374. package/lib/utils/transform.js +26 -1
  375. package/lib/utils/transform.js.map +1 -1
  376. package/package.json +6 -6
  377. package/src/animations/executor.ts +39 -61
  378. package/src/animations/index.ts +19 -15
  379. package/src/animations/types.ts +82 -27
  380. package/src/behaviors/collapse-expand.ts +25 -9
  381. package/src/behaviors/create-edge.ts +2 -2
  382. package/src/behaviors/drag-canvas.ts +6 -1
  383. package/src/behaviors/drag-element.ts +2 -2
  384. package/src/behaviors/hover-element.ts +17 -3
  385. package/src/constants/animation.ts +4 -2
  386. package/src/constants/events/animation.ts +2 -0
  387. package/src/constants/events/graph.ts +0 -12
  388. package/src/elements/base-element.ts +52 -0
  389. package/src/elements/combos/base-combo.ts +66 -74
  390. package/src/elements/combos/circle.ts +2 -20
  391. package/src/elements/combos/rect.ts +1 -2
  392. package/src/elements/edges/base-edge.ts +57 -45
  393. package/src/elements/edges/polyline.ts +8 -4
  394. package/src/elements/nodes/base-node.ts +20 -47
  395. package/src/elements/nodes/html.ts +9 -1
  396. package/src/elements/shapes/base-shape.ts +24 -9
  397. package/src/exports.ts +3 -2
  398. package/src/layouts/types.ts +1 -1
  399. package/src/plugins/background/index.ts +65 -0
  400. package/src/plugins/{contextmenu.ts → contextmenu/index.ts} +7 -7
  401. package/src/plugins/history/index.ts +1 -1
  402. package/src/plugins/index.ts +2 -0
  403. package/src/plugins/timebar.ts +1 -1
  404. package/src/plugins/{watermark.ts → watermark/index.ts} +5 -5
  405. package/src/registry/build-in.ts +21 -5
  406. package/src/runtime/animation.ts +186 -0
  407. package/src/runtime/canvas.ts +0 -24
  408. package/src/runtime/data.ts +16 -19
  409. package/src/runtime/element.ts +289 -255
  410. package/src/runtime/graph.ts +44 -11
  411. package/src/runtime/layout.ts +51 -4
  412. package/src/runtime/transform.ts +10 -2
  413. package/src/runtime/types.ts +7 -0
  414. package/src/runtime/viewport.ts +2 -2
  415. package/src/spec/data.ts +14 -1
  416. package/src/spec/element/animation.ts +3 -13
  417. package/src/spec/element/combo.ts +4 -3
  418. package/src/spec/element/edge.ts +4 -3
  419. package/src/spec/element/node.ts +4 -3
  420. package/src/themes/base.ts +14 -10
  421. package/src/transforms/base-transform.ts +2 -1
  422. package/src/transforms/collapse-expand-combo.ts +11 -32
  423. package/src/transforms/collapse-expand-node.ts +107 -0
  424. package/src/transforms/get-edge-actual-ends.ts +45 -0
  425. package/src/transforms/index.ts +2 -0
  426. package/src/transforms/process-parallel-edges.ts +50 -36
  427. package/src/transforms/types.ts +5 -5
  428. package/src/transforms/update-related-edge.ts +5 -1
  429. package/src/transforms/utils.ts +31 -0
  430. package/src/types/animation.ts +1 -3
  431. package/src/types/node.ts +12 -0
  432. package/src/utils/animation.ts +73 -63
  433. package/src/utils/cache.ts +0 -1
  434. package/src/utils/collapsibility.ts +12 -0
  435. package/src/utils/dom.ts +1 -2
  436. package/src/utils/edge.ts +2 -1
  437. package/src/utils/element.ts +28 -3
  438. package/src/utils/theme.ts +18 -0
  439. package/src/utils/transform.ts +33 -0
  440. package/dist/lib/utils/combo.d.ts +0 -34
  441. package/esm/plugins/contextmenu.js.map +0 -1
  442. package/esm/plugins/history/utils.js.map +0 -1
  443. package/esm/plugins/watermark.js.map +0 -1
  444. package/esm/utils/combo.d.ts +0 -34
  445. package/esm/utils/combo.js +0 -111
  446. package/esm/utils/combo.js.map +0 -1
  447. package/esm/utils/watermark.js.map +0 -1
  448. package/lib/plugins/history/utils.js.map +0 -1
  449. package/lib/plugins/watermark.js.map +0 -1
  450. package/lib/utils/combo.d.ts +0 -34
  451. package/lib/utils/combo.js +0 -117
  452. package/lib/utils/combo.js.map +0 -1
  453. package/lib/utils/watermark.js.map +0 -1
  454. package/src/utils/combo.ts +0 -134
  455. /package/dist/lib/{utils/contextmenu.d.ts → plugins/contextmenu/util.d.ts} +0 -0
  456. /package/dist/lib/plugins/history/{utils.d.ts → util.d.ts} +0 -0
  457. /package/dist/lib/{utils/watermark.d.ts → plugins/watermark/util.d.ts} +0 -0
  458. /package/esm/{utils/contextmenu.d.ts → plugins/contextmenu/util.d.ts} +0 -0
  459. /package/esm/plugins/history/{utils.d.ts → util.d.ts} +0 -0
  460. /package/esm/{utils/watermark.d.ts → plugins/watermark/util.d.ts} +0 -0
  461. /package/lib/{utils/contextmenu.d.ts → plugins/contextmenu/util.d.ts} +0 -0
  462. /package/lib/plugins/history/{utils.d.ts → util.d.ts} +0 -0
  463. /package/lib/{utils/watermark.d.ts → plugins/watermark/util.d.ts} +0 -0
  464. /package/src/{utils/contextmenu.ts → plugins/contextmenu/util.ts} +0 -0
  465. /package/src/plugins/history/{utils.ts → util.ts} +0 -0
  466. /package/src/{utils/watermark.ts → plugins/watermark/util.ts} +0 -0
@@ -1,12 +1,11 @@
1
1
  import type { AnimationExecutor } from './types';
2
2
  /**
3
- * <zh/> 动画 Spec 执行器
3
+ * <zh/> 动画语法执行器
4
4
  *
5
- * <en/> Animation Spec Executor
5
+ * <en/> Animation syntax executor
6
6
  * @param element - <zh/> 要执行动画的图形 | <en/> shape to execute animation
7
- * @param animation - <zh/> 动画 Spec | <en/> animation specification
8
- * @param commonEffectTiming - <zh/> 动画公共配置 | <en/> common animation configuration
9
- * @param context - <zh/> 动画执行上下文 | <en/> animation execution context
7
+ * @param keyframes - <zh/> 动画关键帧 | <en/> animation keyframes
8
+ * @param options - <zh/> 动画语法 | <en/> animation syntax
10
9
  * @returns <zh/> 动画实例 | <en/> animation instance
11
10
  */
12
11
  export declare const executor: AnimationExecutor;
@@ -1,18 +1,32 @@
1
- export { executor } from './executor';
2
1
  /**
3
2
  * <zh/> 内置的动画元素。
4
3
  * <en/> Built-in animations.
5
4
  */
6
- export declare const fade: {
5
+ export { executor } from './executor';
6
+ export declare const Fade: {
7
+ fields: string[];
8
+ }[];
9
+ export declare const Translate: {
10
+ fields: string[];
11
+ }[];
12
+ export declare const NodeCollapse: {
13
+ fields: string[];
14
+ }[];
15
+ export declare const NodeExpand: {
16
+ fields: string[];
17
+ }[];
18
+ export declare const PathIn: {
7
19
  fields: string[];
8
20
  }[];
9
- export declare const translate: {
21
+ export declare const PathOut: {
10
22
  fields: string[];
11
23
  }[];
12
- export declare const comboCollapseExpand: ({
24
+ export declare const ComboCollapse: {
13
25
  fields: string[];
14
- shape?: undefined;
15
- } | {
26
+ }[];
27
+ export declare const ComboExpand: {
16
28
  fields: string[];
17
- shape: string;
18
- })[];
29
+ }[];
30
+ export declare const ComboCollapseExpand: {
31
+ fields: string[];
32
+ }[];
@@ -1,18 +1,51 @@
1
- import type { IAnimation, IAnimationEffectTiming } from '@antv/g';
2
- import type { Element, State } from '../types';
1
+ import type { IAnimation } from '@antv/g';
2
+ import type { AnimationStage } from '../spec/element/animation';
3
+ import type { Element, ElementType, State } from '../types';
4
+ export type STDAnimation = AnimationOptions[];
3
5
  /**
4
- * <zh/> 为 string 时,会从注册的动画中获取
6
+ * <zh/> 元素动画选项
5
7
  *
6
- * <en/> When it is a string, it will be obtained from the registered animation
8
+ * <en/> Element animation options
7
9
  */
8
- export type Animation = false | string | STDAnimation;
9
- export type STDAnimation = ConfigurableAnimationOptions[];
10
- interface ConfigurableAnimationOptions extends AnimationEffectTiming {
10
+ export interface AnimationOptions extends AnimationEffectTiming {
11
+ /**
12
+ * <zh/> 执行动画的字段(样式)名
13
+ *
14
+ * <en/> Field (style) name of the animation
15
+ */
11
16
  fields: string[];
17
+ /**
18
+ * <zh/> 执行动画的图形,默认为当前元素
19
+ *
20
+ * <en/> Shape of the animation, default is the current element
21
+ */
12
22
  shape?: string;
23
+ /**
24
+ * <zh/> 参与动画的状态
25
+ *
26
+ * <en/> States involved in the animation
27
+ */
13
28
  states?: State[];
14
29
  }
15
30
  export interface AnimationContext {
31
+ /**
32
+ * <zh/> 执行动画的元素
33
+ *
34
+ * <en/> Element to execute animation
35
+ */
36
+ element: Element;
37
+ /**
38
+ * <zh/> 元素类型
39
+ *
40
+ * <en/> Element type
41
+ */
42
+ elementType: ElementType;
43
+ /**
44
+ * <zh/> 动画阶段
45
+ *
46
+ * <en/> Animation stage
47
+ */
48
+ stage: AnimationStage;
16
49
  /**
17
50
  * <zh/> 动画的源样式
18
51
  *
@@ -32,24 +65,49 @@ export interface AnimationContext {
32
65
  *
33
66
  * <en/> For example, before the element is destroyed, the final state opacity of the element needs to be set to 0
34
67
  */
35
- modifiedStyle?: Record<string, unknown>;
68
+ modifiedStyle: Record<string, unknown>;
69
+ }
70
+ /**
71
+ * <zh/> 动画效果时序
72
+ *
73
+ * <en/> Animation effect timing
74
+ */
75
+ export interface AnimationEffectTiming {
36
76
  /**
37
- * <zh/> 动画配置过滤
77
+ * <zh/> 动画延迟时间
38
78
  *
39
- * <en/> Animation configuration filter
40
- * @remarks
41
- * <zh/> 某些情况下,需要过滤掉一些动画配置,例如位移动画只会作用于元素根节点图形,不会作用于子图形。这项配置通常用于优化动画性能,避免不必要的动画执行
79
+ * <en/> Animation delay time
80
+ */
81
+ delay?: number;
82
+ /**
83
+ * <zh/> 动画方向
84
+ *
85
+ * <en/> Animation direction
86
+ */
87
+ direction?: PlaybackDirection;
88
+ /**
89
+ * <zh/> 动画持续时间
90
+ *
91
+ * <en/> Animation duration
92
+ */
93
+ duration?: number;
94
+ /**
95
+ * <zh/> 动画缓动函数
96
+ *
97
+ * <en/> Animation easing function
98
+ */
99
+ easing?: string;
100
+ /**
101
+ * <zh/> 动画结束后的填充模式
42
102
  *
43
- * <en/> In some cases, it is necessary to filter out some animation configurations. For example, the displacement animation will only affect the root node shape of the element, not the child shape. This configuration is usually used to optimize animation performance and avoid unnecessary animation execution
103
+ * <en/> Fill mode after the animation ends
44
104
  */
45
- animationsFilter?: (animation: ConfigurableAnimationOptions) => boolean;
105
+ fill?: FillMode;
46
106
  /**
47
- * <zh/> 元素状态
107
+ * <zh/> 动画迭代次数
48
108
  *
49
- * <en/> Element states
109
+ * <en/> Number of iterations of the animation
50
110
  */
51
- states: State[];
111
+ iterations?: number;
52
112
  }
53
- export type AnimationEffectTiming = Partial<Pick<IAnimationEffectTiming, 'duration' | 'delay' | 'easing' | 'iterations' | 'direction' | 'fill'>>;
54
- export type AnimationExecutor = (shape: Element, animation: Animation | false, baseEffectTiming: AnimationEffectTiming, context: AnimationContext) => IAnimation | null;
55
- export {};
113
+ export type AnimationExecutor = (element: Element, keyframes: [Record<string, unknown>, Record<string, unknown>], options: STDAnimation) => IAnimation | null;
@@ -1,9 +1,10 @@
1
+ import { CommonEvent } from '../constants';
1
2
  import type { RuntimeContext } from '../runtime/types';
2
3
  import type { ID, IPointerEvent } from '../types';
3
4
  import type { BaseBehaviorOptions } from './base-behavior';
4
5
  import { BaseBehavior } from './base-behavior';
5
6
  /**
6
- * <zh/> 展开/收起组合元素交互配置项
7
+ * <zh/> 展开/收起元素交互配置项
7
8
  *
8
9
  * <en/> Collapse/Expand combo behavior options
9
10
  */
@@ -22,6 +23,13 @@ export interface CollapseExpandOptions extends BaseBehaviorOptions {
22
23
  * @defaultValue true
23
24
  */
24
25
  enable?: boolean | ((event: IPointerEvent) => boolean);
26
+ /**
27
+ * <zh/> 触发方式
28
+ *
29
+ * <en/> Trigger method
30
+ * @defaultValue 'dblclick'
31
+ */
32
+ trigger?: CommonEvent.CLICK | CommonEvent.DBLCLICK;
25
33
  /**
26
34
  * <zh/> 完成收起时的回调
27
35
  *
@@ -47,6 +55,7 @@ export interface CollapseExpandOptions extends BaseBehaviorOptions {
47
55
  export declare class CollapseExpand extends BaseBehavior<CollapseExpandOptions> {
48
56
  static defaultOptions: Partial<CollapseExpandOptions>;
49
57
  constructor(context: RuntimeContext, options: CollapseExpandOptions);
58
+ update(options: Partial<CollapseExpandOptions>): void;
50
59
  private bindEvents;
51
60
  private unbindEvents;
52
61
  private onCollapseExpand;
@@ -78,5 +78,6 @@ export declare class DragCanvas extends BaseBehavior<DragCanvasOptions> {
78
78
  */
79
79
  protected translate(offset: Vector2, animation?: ViewportAnimationEffectTiming): Promise<void>;
80
80
  private validate;
81
+ private unbindEvents;
81
82
  destroy(): void;
82
83
  }
@@ -70,7 +70,9 @@ export interface HoverElementOptions extends BaseBehaviorOptions {
70
70
  */
71
71
  export declare class HoverElement extends BaseBehavior<HoverElementOptions> {
72
72
  static defaultOptions: Partial<HoverElementOptions>;
73
+ private isFrozen;
73
74
  constructor(context: RuntimeContext, options: HoverElementOptions);
75
+ private toggleFrozen;
74
76
  private bindEvents;
75
77
  private hoverElement;
76
78
  private hoverEndElement;
@@ -1,2 +1,3 @@
1
- export declare const DEFAULT_ANIMATION_OPTIONS: KeyframeAnimationOptions;
2
- export declare const DEFAULT_ELEMENTS_ANIMATION_OPTIONS: KeyframeAnimationOptions;
1
+ import type { AnimationEffectTiming } from '../animations/types';
2
+ export declare const DEFAULT_ANIMATION_OPTIONS: AnimationEffectTiming;
3
+ export declare const DEFAULT_ELEMENTS_ANIMATION_OPTIONS: AnimationEffectTiming;
@@ -1,4 +1,6 @@
1
1
  export declare enum AnimationType {
2
2
  DRAW = "draw",
3
+ COLLAPSE = "collapse",
4
+ EXPAND = "expand",
3
5
  TRANSFORM = "transform"
4
6
  }
@@ -131,18 +131,6 @@ export declare enum GraphEvent {
131
131
  * <en/> After the visible area changes
132
132
  */
133
133
  AFTER_TRANSFORM = "aftertransform",
134
- /**
135
- * <zh/> 状态变化之前
136
- *
137
- * <en/> Before the state changes
138
- */
139
- BEFORE_ELEMENT_STATE_CHANGE = "beforeelementstatechange",
140
- /**
141
- * <zh/> 状态变化之后
142
- *
143
- * <en/> After the state changes
144
- */
145
- AFTER_ELEMENT_STATE_CHANGE = "afterelementstatechange",
146
134
  /**
147
135
  * <zh/> 批处理开始
148
136
  *
@@ -0,0 +1,35 @@
1
+ import { IAnimation } from '@antv/g';
2
+ import { Keyframe } from '../types';
3
+ import type { BaseShapeStyleProps } from './shapes';
4
+ import { BaseShape } from './shapes';
5
+ export declare abstract class BaseElement<T extends BaseShapeStyleProps> extends BaseShape<T> {
6
+ get parsedAttributes(): Required<T>;
7
+ /**
8
+ * <zh/> 动画帧执行函数
9
+ *
10
+ * <en/> Animation frame execution function
11
+ */
12
+ protected onframe(): void;
13
+ animate(keyframes: Keyframe[], options?: number | KeyframeAnimationOptions | undefined): IAnimation | null;
14
+ /**
15
+ * <zh/> 在元素完成创建并执行完入场动画后调用
16
+ *
17
+ * <en/> Called after the element is created and the entrance animation is completed
18
+ * @override
19
+ */
20
+ onCreate(): void;
21
+ /**
22
+ * <zh/> 在元素更新并执行完过渡动画后调用
23
+ *
24
+ * <en/> Called after the element is updated and the transition animation is completed
25
+ * @override
26
+ */
27
+ onUpdate(): void;
28
+ /**
29
+ * <zh/> 在元素完成退场动画并销毁后调用
30
+ *
31
+ * <en/> Called after the element completes the exit animation and is destroyed
32
+ * @override
33
+ */
34
+ onDestroy(): void;
35
+ }
@@ -1,5 +1,5 @@
1
- import type { AABB, BaseStyleProps, DisplayObject, DisplayObjectConfig, Group } from '@antv/g';
2
- import type { CollapsedMarkerStyleProps, Combo, Node, NodeLikeData, Padding, Placement, Position, Prefix, STDSize, Size } from '../../types';
1
+ import { AABB, BaseStyleProps, DisplayObject, DisplayObjectConfig, Group } from '@antv/g';
2
+ import type { CollapsedMarkerStyleProps, ID, NodeLikeData, Padding, Position, Prefix, STDSize, Size } from '../../types';
3
3
  import type { BaseNodeStyleProps } from '../nodes';
4
4
  import { BaseNode } from '../nodes';
5
5
  import { IconStyleProps } from '../shapes';
@@ -21,18 +21,12 @@ export interface BaseComboStyleProps extends BaseNodeStyleProps, Prefix<'collaps
21
21
  * <en/> The default size of combo when collapsed
22
22
  */
23
23
  collapsedSize?: Size;
24
- /**
25
- * <zh/> 组合收起时的原点
26
- *
27
- * <en/> The origin of combo when collapsed
28
- */
29
- collapsedOrigin?: Placement;
30
24
  /**
31
25
  * <zh/> 组合的子元素,可以是节点或者组合
32
26
  *
33
27
  * <en/> The children of combo, which can be nodes or combos
34
28
  */
35
- childrenNode?: (Node | Combo)[];
29
+ childrenNode?: ID[];
36
30
  /**
37
31
  * <zh/> 组合的子元素数据
38
32
  *
@@ -73,8 +67,6 @@ export declare abstract class BaseCombo<S extends BaseComboStyleProps = BaseComb
73
67
  * Draw the key shape of combo
74
68
  */
75
69
  protected abstract drawKeyShape(attributes: Required<S>, container: Group): DisplayObject | undefined;
76
- protected calculatePosition(attributes: Required<S>): Position;
77
- protected getCollapsedOriginPosition(attributes: Required<S>): Position;
78
70
  protected getKeySize(attributes: Required<S>): STDSize;
79
71
  protected getEmptyKeySize(attributes: Required<S>): STDSize;
80
72
  protected getCollapsedKeySize(attributes: Required<S>): STDSize;
@@ -84,32 +76,16 @@ export declare abstract class BaseCombo<S extends BaseComboStyleProps = BaseComb
84
76
  protected getCollapsedMarkerStyle(attributes: Required<S>): IconStyleProps | false;
85
77
  protected getCollapsedMarkerText(type: CollapsedMarkerStyleProps['type'], attributes: Required<S>): string;
86
78
  protected getComboZIndex(attributes: Required<S>): number;
79
+ getComboPosition(attributes: Required<S>): Position;
87
80
  protected getComboStyle(attributes: Required<S>): {
88
81
  x: number;
89
82
  y: number;
90
83
  transform: string;
91
84
  zIndex: number;
92
85
  };
86
+ protected updateComboPosition(attributes: Required<S>): void;
93
87
  render(attributes: Required<S>, container?: Group): void;
94
- /**
95
- * <zh/> 在元素完成创建并执行完入场动画后调用
96
- *
97
- * <en/> Called after the element is created and the entrance animation is completed
98
- * @override
99
- */
100
- onCreate(): void;
101
- /**
102
- * <zh/> 在元素更新并执行完过渡动画后调用
103
- *
104
- * <en/> Called after the element is updated and the transition animation is completed
105
- * @override
106
- */
107
- onUpdate(): void;
108
- /**
109
- * <zh/> 在元素完成退场动画并销毁后调用
110
- *
111
- * <en/> Called after the element completes the exit animation and is destroyed
112
- * @override
113
- */
114
- onDestroy(): void;
88
+ protected hostingAnimation: boolean;
89
+ protected onframe(): void;
90
+ animate(keyframes: Keyframe[], options?: number | KeyframeAnimationOptions): import("@antv/g").IAnimation | null;
115
91
  }
@@ -1,6 +1,6 @@
1
1
  import type { DisplayObjectConfig, CircleStyleProps as GCircleStyleProps } from '@antv/g';
2
2
  import { Circle as GCircle, Group } from '@antv/g';
3
- import type { Point, Position, STDSize } from '../../types';
3
+ import type { Point, STDSize } from '../../types';
4
4
  import type { BaseComboStyleProps } from './base-combo';
5
5
  import { BaseCombo } from './base-combo';
6
6
  /**
@@ -21,6 +21,5 @@ export declare class CircleCombo extends BaseCombo<CircleComboStyleProps> {
21
21
  protected getKeyStyle(attributes: Required<CircleComboStyleProps>): GCircleStyleProps;
22
22
  protected getCollapsedKeySize(attributes: Required<CircleComboStyleProps>): STDSize;
23
23
  protected getExpandedKeySize(attributes: Required<CircleComboStyleProps>): STDSize;
24
- protected getCollapsedOriginPosition(attributes: Required<CircleComboStyleProps>): Position;
25
24
  getIntersectPoint(point: Point): Point;
26
25
  }
@@ -1,9 +1,9 @@
1
1
  import type { DisplayObject, DisplayObjectConfig, Group, PathStyleProps } from '@antv/g';
2
2
  import { Path } from '@antv/g';
3
3
  import type { PathArray } from '@antv/util';
4
- import type { BaseElementStyleProps, EdgeArrowStyleProps, EdgeLabelStyleProps, Keyframe, LoopStyleProps, Node, Point, Prefix } from '../../types';
4
+ import type { BaseElementStyleProps, EdgeArrowStyleProps, EdgeLabelStyleProps, ID, Keyframe, LoopStyleProps, Node, Point, Prefix } from '../../types';
5
+ import { BaseElement } from '../base-element';
5
6
  import type { LabelStyleProps } from '../shapes';
6
- import { BaseShape } from '../shapes/base-shape';
7
7
  /**
8
8
  * <zh/> 边的通用样式属性
9
9
  *
@@ -17,6 +17,13 @@ export interface BaseEdgeStyleProps extends BaseElementStyleProps, Prefix<'label
17
17
  * @defaultValue true
18
18
  */
19
19
  label?: boolean;
20
+ /**
21
+ * <zh/> 是否启用自环边
22
+ *
23
+ * <en/> Whether to enable self-loop edge
24
+ * @defaultValue true
25
+ */
26
+ loop?: boolean;
20
27
  /**
21
28
  * <zh/> 是否显示边的光晕
22
29
  *
@@ -51,19 +58,21 @@ export interface BaseEdgeStyleProps extends BaseElementStyleProps, Prefix<'label
51
58
  */
52
59
  endArrowOffset?: number;
53
60
  /**
54
- * <zh/> 边的起点 shape
61
+ * <zh/> 边的起点 ID
55
62
  *
56
- * <en/> The source shape. Represents the start of the edge
57
- * @internal
63
+ * <en/> The ID of the source node
64
+ * @remarks
65
+ * <zh/> 该属性指向物理意义上的起点,由 G6 内部维护,用户无需过多关注。通常情况下,`sourceNode` 与上一级的 `source` 属性一致。但在某些情况下,`sourceNode` 可能会被 G6 内部转换,例如在 Combo 收起时内部节点上的边会自动连接到父 Combo,此时 `sourceNode` 会变更为父 Combo 的 ID。
66
+ *
67
+ * <en/> This property concerning the physical origin, maintained internally by G6. In general, `sourceNode` corresponds to the `source` attribute of the parent level. However, in certain cases, such as when a Combo is collapsed and internal nodes are destroyed, corresponding edges will automatically connect to the parent Combo. At this point, `sourceNode` will be changed to the ID of the parent Combo
58
68
  */
59
- sourceNode: Node;
69
+ sourceNode: ID;
60
70
  /**
61
71
  * <zh/> 边的终点 shape
62
72
  *
63
73
  * <en/> The source shape. Represents the start of the edge
64
- * @internal
65
74
  */
66
- targetNode: Node;
75
+ targetNode: ID;
67
76
  /**
68
77
  * <zh/> 边起始连接的 port
69
78
  *
@@ -122,10 +131,12 @@ type ParsedBaseEdgeStyleProps = Required<BaseEdgeStyleProps>;
122
131
  *
123
132
  * <en/> Base class of the edge
124
133
  */
125
- export declare abstract class BaseEdge extends BaseShape<BaseEdgeStyleProps> {
134
+ export declare abstract class BaseEdge extends BaseElement<BaseEdgeStyleProps> {
126
135
  type: string;
127
136
  static defaultStyleProps: Partial<BaseEdgeStyleProps>;
128
137
  constructor(options: DisplayObjectConfig<BaseEdgeStyleProps>);
138
+ protected get sourceNode(): Node;
139
+ protected get targetNode(): Node;
129
140
  protected getKeyStyle(attributes: ParsedBaseEdgeStyleProps): PathStyleProps;
130
141
  protected abstract getKeyPath(attributes: ParsedBaseEdgeStyleProps): PathArray;
131
142
  protected getLoopPath(attributes: ParsedBaseEdgeStyleProps): PathArray;
@@ -138,27 +149,7 @@ export declare abstract class BaseEdge extends BaseShape<BaseEdgeStyleProps> {
138
149
  protected drawHaloShape(attributes: ParsedBaseEdgeStyleProps, container: Group): void;
139
150
  protected drawKeyShape(attributes: ParsedBaseEdgeStyleProps, container: Group): Path | undefined;
140
151
  render(attributes?: Required<BaseEdgeStyleProps>, container?: Group): void;
141
- /**
142
- * <zh/> 在元素完成创建并执行完入场动画后调用
143
- *
144
- * <en/> Called after the element is created and the entrance animation is completed
145
- * @override
146
- */
147
- onCreate(): void;
148
- /**
149
- * <zh/> 在元素更新并执行完过渡动画后调用
150
- *
151
- * <en/> Called after the element is updated and the transition animation is completed
152
- * @override
153
- */
154
- onUpdate(): void;
155
- /**
156
- * <zh/> 在元素完成退场动画并销毁后调用
157
- *
158
- * <en/> Called after the element completes the exit animation and is destroyed
159
- * @override
160
- */
161
- onDestroy(): void;
152
+ protected onframe(): void;
162
153
  animate(keyframes: Keyframe[], options?: number | KeyframeAnimationOptions): import("@antv/g").IAnimation | null;
163
154
  }
164
155
  export {};
@@ -1,9 +1,9 @@
1
1
  import type { BaseStyleProps, DisplayObject, DisplayObjectConfig, Group } from '@antv/g';
2
2
  import type { CategoricalPalette } from '../../palettes/types';
3
3
  import type { NodeData } from '../../spec';
4
- import type { BaseElementStyleProps, Keyframe, Node, NodeBadgeStyleProps, NodeLabelStyleProps, NodePortStyleProps, Point, Port, PortStyleProps, Prefix, Size } from '../../types';
4
+ import type { BaseElementStyleProps, ID, NodeBadgeStyleProps, NodeLabelStyleProps, NodePortStyleProps, Point, Port, PortStyleProps, Prefix, Size } from '../../types';
5
+ import { BaseElement } from '../base-element';
5
6
  import type { BadgeStyleProps, IconStyleProps, LabelStyleProps } from '../shapes';
6
- import { BaseShape } from '../shapes';
7
7
  /**
8
8
  * <zh/> 节点通用样式配置项
9
9
  *
@@ -53,7 +53,7 @@ export interface BaseNodeStyleProps extends BaseElementStyleProps, Prefix<'label
53
53
  *
54
54
  * <en/> Only valid in the tree graph
55
55
  */
56
- childrenNode?: Node[];
56
+ childrenNode?: ID[];
57
57
  /**
58
58
  * <zh/> 子节点数据
59
59
  *
@@ -153,11 +153,10 @@ export interface BaseNodeStyleProps extends BaseElementStyleProps, Prefix<'label
153
153
  *
154
154
  * <en/> Design document: https://www.yuque.com/antv/g6/gl1iof1xpzg6ed98
155
155
  */
156
- export declare abstract class BaseNode<S extends BaseNodeStyleProps = BaseNodeStyleProps> extends BaseShape<S> {
156
+ export declare abstract class BaseNode<S extends BaseNodeStyleProps = BaseNodeStyleProps> extends BaseElement<S> {
157
157
  type: string;
158
158
  static defaultStyleProps: Partial<BaseNodeStyleProps>;
159
159
  constructor(options: DisplayObjectConfig<S>);
160
- get parsedAttributes(): Required<S>;
161
160
  protected getSize(attributes?: S & import("@antv/g").BaseCustomElementStyleProps): import("../../types").Vector3;
162
161
  protected getKeyStyle(attributes: Required<S>): any;
163
162
  protected getLabelStyle(attributes: Required<S>): false | LabelStyleProps;
@@ -189,30 +188,11 @@ export declare abstract class BaseNode<S extends BaseNodeStyleProps = BaseNodeSt
189
188
  */
190
189
  getIntersectPoint(point: Point): Point;
191
190
  protected drawHaloShape(attributes: Required<S>, container: Group): void;
191
+ protected drawIconShape(attributes: Required<S>, container: Group): void;
192
192
  protected drawBadgeShapes(attributes: Required<S>, container: Group): void;
193
193
  protected drawPortShapes(attributes: Required<S>, container: Group): void;
194
+ protected drawLabelShape(attributes: Required<S>, container: Group): void;
194
195
  protected abstract drawKeyShape(attributes: Required<S>, container: Group): DisplayObject | undefined;
195
196
  render(attributes?: Required<S>, container?: Group): void;
196
- /**
197
- * <zh/> 在元素完成创建并执行完入场动画后调用
198
- *
199
- * <en/> Called after the element is created and the entrance animation is completed
200
- * @override
201
- */
202
- onCreate(): void;
203
- /**
204
- * <zh/> 在元素更新并执行完过渡动画后调用
205
- *
206
- * <en/> Called after the element is updated and the transition animation is completed
207
- * @override
208
- */
209
- onUpdate(): void;
210
- /**
211
- * <zh/> 在元素完成退场动画并销毁后调用
212
- *
213
- * <en/> Called after the element completes the exit animation and is destroyed
214
- * @override
215
- */
216
- onDestroy(): void;
217
- animate(keyframes: Keyframe[], options?: number | KeyframeAnimationOptions): import("@antv/g").IAnimation | null;
197
+ protected onframe(): void;
218
198
  }
@@ -31,10 +31,11 @@ export declare class HTML extends BaseNode<HTMLStyleProps> {
31
31
  protected drawKeyShape(attributes: Required<HTMLStyleProps>, container: Group): any;
32
32
  connectedCallback(): void;
33
33
  attributeChangedCallback(name: any, oldValue: any, newValue: any): void;
34
- onDestroy(): void;
34
+ destroy(): void;
35
35
  private forwardEvents;
36
36
  private normalizeToPointerEvent;
37
37
  private transferMouseData;
38
38
  private bootstrapEvent;
39
39
  private getViewportXY;
40
+ protected onframe(): void;
40
41
  }
@@ -8,7 +8,7 @@ type BadgeOptions = DisplayObjectConfig<BadgeStyleProps>;
8
8
  export declare class Badge extends BaseShape<BadgeStyleProps> {
9
9
  static defaultStyleProps: Partial<BadgeStyleProps>;
10
10
  constructor(options: BadgeOptions);
11
- protected getBadgeStyle(attributes: ParsedBadgeStyleProps): Omit<Required<BadgeStyleProps>, "transform" | "x" | "y" | "z" | "transformOrigin" | "zIndex" | "context" | "className">;
11
+ protected getBadgeStyle(attributes: ParsedBadgeStyleProps): Omit<Required<BadgeStyleProps>, "x" | "y" | "z" | "zIndex" | "transform" | "transformOrigin" | "context" | "className">;
12
12
  render(attributes?: ParsedBadgeStyleProps, container?: Group): void;
13
13
  connectedCallback(): void;
14
14
  }
@@ -50,6 +50,12 @@ export declare abstract class BaseShape<StyleProps extends BaseShapeStyleProps>
50
50
  * @returns <zh/> 仅包含样式属性的对象 | <en/> An object containing only the style properties.
51
51
  */
52
52
  getGraphicStyle<T extends Record<string, any>>(attributes: T): Omit<T, 'x' | 'y' | 'z' | 'transform' | 'transformOrigin' | 'className' | 'context' | 'zIndex'>;
53
+ /**
54
+ * Get the prefix pairs for composite shapes used to handle animation
55
+ * @returns tuples array where each tuple contains a key corresponding to a method `get${key}Style` and its shape prefix
56
+ */
57
+ protected get compositeShapes(): [string, string][];
58
+ protected hostingAnimation: boolean;
53
59
  animate(keyframes: Keyframe[], options?: number | KeyframeAnimationOptions): IAnimation | null;
54
60
  getShape(key: string): DisplayObject | undefined;
55
61
  private setVisibility;
@@ -18,19 +18,20 @@ export { treeToGraphData } from './utils/tree';
18
18
  export type { BaseStyleProps } from '@antv/g';
19
19
  export type { AntVDagreLayoutOptions, CircularLayoutOptions, ComboCombinedLayoutOptions, ConcentricLayoutOptions, D3Force3DLayoutOptions, D3ForceLayoutOptions, DagreLayoutOptions, ForceAtlas2LayoutOptions, ForceLayoutOptions, FruchtermanLayoutOptions, GridLayoutOptions, MDSLayoutOptions, RadialLayoutOptions, RandomLayoutOptions, } from '@antv/layout';
20
20
  export type { PathArray } from '@antv/util';
21
- export type { AnimationContext, AnimationEffectTiming, AnimationExecutor } from './animations/types';
21
+ export type { AnimationContext, AnimationEffectTiming, AnimationExecutor, AnimationOptions } from './animations/types';
22
22
  export type { BaseBehaviorOptions, BrushSelectOptions, ClickElementOptions, CollapseExpandOptions, CreateEdgeOptions, DragCanvasOptions, DragElementForceOptions, DragElementOptions, FocusElementOptions, HoverElementOptions, LassoSelectOptions, ScrollCanvasOptions, ZoomCanvasOptions, } from './behaviors';
23
23
  export type { BaseComboStyleProps, CircleComboStyleProps, RectComboStyleProps } from './elements/combos';
24
24
  export type { BaseEdgeStyleProps, CubicHorizontalStyleProps, CubicStyleProps, CubicVerticalStyleProps, LineStyleProps, PolylineStyleProps, QuadraticStyleProps, } from './elements/edges';
25
25
  export type { BaseNodeStyleProps, CircleStyleProps, DiamondStyleProps, DonutStyleProps, EllipseStyleProps, HTMLStyleProps, HexagonStyleProps, ImageStyleProps, RectStyleProps, StarStyleProps, TriangleStyleProps, } from './elements/nodes';
26
26
  export type { BadgeStyleProps, BaseShapeStyleProps, IconStyleProps, LabelStyleProps, PolygonStyleProps, } from './elements/shapes';
27
27
  export type { ContourLabelStyleProps, ContourStyleProps } from './elements/shapes/contour';
28
- export type { AnimationOptions, BaseLayoutOptions, WebWorkerLayoutOptions } from './layouts/types';
28
+ export type { BaseLayoutOptions, WebWorkerLayoutOptions } from './layouts/types';
29
29
  export type { CategoricalPalette } from './palettes/types';
30
30
  export type { BasePluginOptions, BubbleSetsOptions, CameraSettingOptions, ContextmenuOptions, GridLineOptions, HistoryOptions, HullOptions, LegendOptions, TimebarOptions, ToolbarOptions, TooltipOptions, WatermarkOptions, } from './plugins';
31
31
  export type { RuntimeContext } from './runtime/types';
32
32
  export type { BehaviorOptions, CanvasOptions, ComboData, ComboOptions, EdgeData, EdgeOptions, GraphData, GraphOptions, NodeData, NodeOptions, PluginOptions, ThemeOptions, ViewportOptions, } from './spec';
33
33
  export type { CustomBehaviorOption } from './spec/behavior';
34
+ export type { AnimationStage } from './spec/element/animation';
34
35
  export type { LayoutOptions, STDLayoutOptions, SingleLayoutOptions } from './spec/layout';
35
36
  export type { CustomPluginOption } from './spec/plugin';
36
37
  export type { BaseTransformOptions } from './transforms';
@@ -57,7 +57,7 @@ interface AntVDagreLayout extends BaseLayoutOptions, AntVDagreLayoutOptions {
57
57
  interface DagreLayout extends BaseLayoutOptions, DagreLayoutOptions {
58
58
  type: 'dagre';
59
59
  }
60
- export interface AnimationOptions {
60
+ interface AnimationOptions {
61
61
  /**
62
62
  * <zh/> 启用布局动画,对于迭代布局,会在两次迭代之间进行动画过渡
63
63
  *