@antv/g6 5.0.0-beta.33 → 5.0.0-beta.35

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 (514) hide show
  1. package/dist/g6.min.js +2 -2
  2. package/dist/lib/animations/types.d.ts +3 -4
  3. package/dist/lib/behaviors/base-behavior.d.ts +2 -1
  4. package/dist/lib/behaviors/brush-select.d.ts +33 -16
  5. package/dist/lib/behaviors/click-element.d.ts +28 -5
  6. package/dist/lib/behaviors/collapse-expand.d.ts +3 -2
  7. package/dist/lib/behaviors/create-edge.d.ts +1 -2
  8. package/dist/lib/behaviors/drag-canvas.d.ts +7 -0
  9. package/dist/lib/behaviors/drag-element-force.d.ts +1 -2
  10. package/dist/lib/behaviors/drag-element.d.ts +4 -5
  11. package/dist/lib/behaviors/index.d.ts +2 -0
  12. package/dist/lib/behaviors/lasso-select.d.ts +4 -4
  13. package/dist/lib/behaviors/scroll-canvas.d.ts +64 -0
  14. package/dist/lib/behaviors/types.d.ts +2 -1
  15. package/dist/lib/behaviors/zoom-canvas.d.ts +1 -1
  16. package/dist/lib/constants/events/animation.d.ts +1 -4
  17. package/dist/lib/constants/events/graph.d.ts +5 -1
  18. package/dist/lib/elements/combos/base-combo.d.ts +1 -1
  19. package/dist/lib/elements/edges/base-edge.d.ts +0 -5
  20. package/dist/lib/elements/nodes/base-node.d.ts +3 -10
  21. package/dist/lib/elements/nodes/donut.d.ts +45 -0
  22. package/dist/lib/elements/nodes/html.d.ts +27 -0
  23. package/dist/lib/elements/nodes/index.d.ts +4 -0
  24. package/dist/lib/elements/shapes/badge.d.ts +1 -1
  25. package/dist/lib/{plugins/hull/shape.d.ts → elements/shapes/contour.d.ts} +17 -17
  26. package/dist/lib/elements/shapes/index.d.ts +2 -0
  27. package/dist/lib/exports.d.ts +15 -22
  28. package/dist/lib/plugins/bubble-sets.d.ts +45 -0
  29. package/dist/lib/plugins/camera-setting.d.ts +4 -2
  30. package/dist/lib/plugins/contextmenu.d.ts +1 -0
  31. package/dist/lib/plugins/grid-line.d.ts +51 -8
  32. package/dist/lib/plugins/hull/index.d.ts +44 -13
  33. package/dist/lib/plugins/index.d.ts +4 -0
  34. package/dist/lib/plugins/timebar.d.ts +225 -0
  35. package/dist/lib/plugins/tooltip.d.ts +2 -2
  36. package/dist/lib/registry/index.d.ts +1 -1
  37. package/dist/lib/runtime/data.d.ts +13 -7
  38. package/dist/lib/runtime/element.d.ts +6 -10
  39. package/dist/lib/runtime/graph.d.ts +532 -45
  40. package/dist/lib/runtime/types.d.ts +3 -3
  41. package/dist/lib/runtime/viewport.d.ts +3 -4
  42. package/dist/lib/spec/canvas.d.ts +6 -2
  43. package/dist/lib/spec/data.d.ts +74 -1
  44. package/dist/lib/spec/element/combo.d.ts +17 -6
  45. package/dist/lib/spec/element/edge.d.ts +14 -2
  46. package/dist/lib/spec/element/node.d.ts +19 -3
  47. package/{lib/spec/spec.d.ts → dist/lib/spec/graph.d.ts} +12 -4
  48. package/dist/lib/spec/index.d.ts +1 -1
  49. package/dist/lib/spec/theme.d.ts +1 -4
  50. package/dist/lib/spec/viewport.d.ts +1 -1
  51. package/dist/lib/themes/base.d.ts +1 -0
  52. package/dist/lib/themes/types.d.ts +0 -1
  53. package/dist/lib/transforms/process-parallel-edges.d.ts +2 -3
  54. package/dist/lib/transforms/types.d.ts +1 -1
  55. package/dist/lib/types/callable.d.ts +2 -2
  56. package/dist/lib/types/data.d.ts +3 -3
  57. package/dist/lib/types/id.d.ts +1 -0
  58. package/dist/lib/types/index.d.ts +1 -0
  59. package/dist/lib/types/style.d.ts +1 -3
  60. package/dist/lib/types/viewport.d.ts +4 -4
  61. package/dist/lib/utils/animation.d.ts +6 -6
  62. package/dist/lib/utils/behaviors/brush.d.ts +1 -2
  63. package/dist/lib/utils/behaviors/lasso.d.ts +1 -2
  64. package/dist/lib/utils/behaviors/utils.d.ts +1 -1
  65. package/dist/lib/utils/data.d.ts +2 -2
  66. package/dist/lib/utils/edge.d.ts +1 -2
  67. package/dist/lib/utils/element.d.ts +1 -1
  68. package/dist/lib/utils/event/events.d.ts +1 -1
  69. package/dist/lib/utils/event/index.d.ts +1 -1
  70. package/dist/lib/utils/id.d.ts +2 -3
  71. package/dist/lib/utils/palette.d.ts +2 -3
  72. package/dist/lib/utils/relation.d.ts +3 -4
  73. package/dist/lib/utils/visibility.d.ts +1 -1
  74. package/esm/animations/types.d.ts +3 -4
  75. package/esm/behaviors/base-behavior.d.ts +2 -1
  76. package/esm/behaviors/brush-select.d.ts +33 -16
  77. package/esm/behaviors/brush-select.js +7 -2
  78. package/esm/behaviors/brush-select.js.map +1 -1
  79. package/esm/behaviors/click-element.d.ts +28 -5
  80. package/esm/behaviors/click-element.js +11 -0
  81. package/esm/behaviors/click-element.js.map +1 -1
  82. package/esm/behaviors/collapse-expand.d.ts +3 -2
  83. package/esm/behaviors/collapse-expand.js +2 -2
  84. package/esm/behaviors/collapse-expand.js.map +1 -1
  85. package/esm/behaviors/create-edge.d.ts +1 -2
  86. package/esm/behaviors/create-edge.js.map +1 -1
  87. package/esm/behaviors/drag-canvas.d.ts +7 -0
  88. package/esm/behaviors/drag-canvas.js.map +1 -1
  89. package/esm/behaviors/drag-element-force.d.ts +1 -2
  90. package/esm/behaviors/drag-element-force.js.map +1 -1
  91. package/esm/behaviors/drag-element.d.ts +4 -5
  92. package/esm/behaviors/drag-element.js.map +1 -1
  93. package/esm/behaviors/focus-element.js.map +1 -1
  94. package/esm/behaviors/hover-element.js.map +1 -1
  95. package/esm/behaviors/index.d.ts +2 -0
  96. package/esm/behaviors/index.js +1 -0
  97. package/esm/behaviors/index.js.map +1 -1
  98. package/esm/behaviors/lasso-select.d.ts +4 -4
  99. package/esm/behaviors/lasso-select.js +1 -1
  100. package/esm/behaviors/lasso-select.js.map +1 -1
  101. package/esm/behaviors/scroll-canvas.d.ts +64 -0
  102. package/esm/behaviors/scroll-canvas.js +80 -0
  103. package/esm/behaviors/scroll-canvas.js.map +1 -0
  104. package/esm/behaviors/types.d.ts +2 -1
  105. package/esm/behaviors/zoom-canvas.d.ts +1 -1
  106. package/esm/constants/events/animation.d.ts +1 -4
  107. package/esm/constants/events/animation.js +0 -4
  108. package/esm/constants/events/animation.js.map +1 -1
  109. package/esm/constants/events/graph.d.ts +5 -1
  110. package/esm/constants/events/graph.js +4 -0
  111. package/esm/constants/events/graph.js.map +1 -1
  112. package/esm/elements/combos/base-combo.d.ts +1 -1
  113. package/esm/elements/edges/base-edge.d.ts +0 -5
  114. package/esm/elements/edges/base-edge.js +1 -2
  115. package/esm/elements/edges/base-edge.js.map +1 -1
  116. package/esm/elements/nodes/base-node.d.ts +3 -10
  117. package/esm/elements/nodes/base-node.js +2 -2
  118. package/esm/elements/nodes/base-node.js.map +1 -1
  119. package/esm/elements/nodes/donut.d.ts +45 -0
  120. package/esm/elements/nodes/donut.js +81 -0
  121. package/esm/elements/nodes/donut.js.map +1 -0
  122. package/esm/elements/nodes/html.d.ts +27 -0
  123. package/esm/elements/nodes/html.js +209 -0
  124. package/esm/elements/nodes/html.js.map +1 -0
  125. package/esm/elements/nodes/index.d.ts +4 -0
  126. package/esm/elements/nodes/index.js +2 -0
  127. package/esm/elements/nodes/index.js.map +1 -1
  128. package/esm/elements/shapes/badge.d.ts +1 -1
  129. package/esm/{plugins/hull/shape.d.ts → elements/shapes/contour.d.ts} +17 -17
  130. package/esm/{plugins/hull/shape.js → elements/shapes/contour.js} +12 -11
  131. package/esm/elements/shapes/contour.js.map +1 -0
  132. package/esm/elements/shapes/index.d.ts +2 -0
  133. package/esm/elements/shapes/index.js +1 -0
  134. package/esm/elements/shapes/index.js.map +1 -1
  135. package/esm/exports.d.ts +15 -22
  136. package/esm/exports.js +8 -18
  137. package/esm/exports.js.map +1 -1
  138. package/esm/plugins/bubble-sets.d.ts +45 -0
  139. package/esm/plugins/bubble-sets.js +212 -0
  140. package/esm/plugins/bubble-sets.js.map +1 -0
  141. package/esm/plugins/camera-setting.d.ts +4 -2
  142. package/esm/plugins/camera-setting.js.map +1 -1
  143. package/esm/plugins/contextmenu.d.ts +1 -0
  144. package/esm/plugins/contextmenu.js +1 -0
  145. package/esm/plugins/contextmenu.js.map +1 -1
  146. package/esm/plugins/grid-line.d.ts +51 -8
  147. package/esm/plugins/grid-line.js.map +1 -1
  148. package/esm/plugins/history/utils.js +6 -2
  149. package/esm/plugins/history/utils.js.map +1 -1
  150. package/esm/plugins/hull/index.d.ts +44 -13
  151. package/esm/plugins/hull/index.js +46 -16
  152. package/esm/plugins/hull/index.js.map +1 -1
  153. package/esm/plugins/index.d.ts +4 -0
  154. package/esm/plugins/index.js +2 -0
  155. package/esm/plugins/index.js.map +1 -1
  156. package/esm/plugins/legend.js +4 -2
  157. package/esm/plugins/legend.js.map +1 -1
  158. package/esm/plugins/timebar.d.ts +225 -0
  159. package/esm/plugins/timebar.js +253 -0
  160. package/esm/plugins/timebar.js.map +1 -0
  161. package/esm/plugins/tooltip.d.ts +2 -2
  162. package/esm/registry/build-in.js +15 -10
  163. package/esm/registry/build-in.js.map +1 -1
  164. package/esm/registry/index.d.ts +1 -1
  165. package/esm/registry/index.js +1 -1
  166. package/esm/runtime/canvas.js +7 -4
  167. package/esm/runtime/canvas.js.map +1 -1
  168. package/esm/runtime/data.d.ts +13 -7
  169. package/esm/runtime/data.js +20 -3
  170. package/esm/runtime/data.js.map +1 -1
  171. package/esm/runtime/element.d.ts +6 -10
  172. package/esm/runtime/element.js +65 -46
  173. package/esm/runtime/element.js.map +1 -1
  174. package/esm/runtime/graph.d.ts +532 -45
  175. package/esm/runtime/graph.js +418 -40
  176. package/esm/runtime/graph.js.map +1 -1
  177. package/esm/runtime/layout.js +2 -2
  178. package/esm/runtime/layout.js.map +1 -1
  179. package/esm/runtime/types.d.ts +3 -3
  180. package/esm/runtime/viewport.d.ts +3 -4
  181. package/esm/runtime/viewport.js +2 -2
  182. package/esm/runtime/viewport.js.map +1 -1
  183. package/esm/spec/canvas.d.ts +6 -2
  184. package/esm/spec/data.d.ts +74 -1
  185. package/esm/spec/element/combo.d.ts +17 -6
  186. package/esm/spec/element/edge.d.ts +14 -2
  187. package/esm/spec/element/node.d.ts +19 -3
  188. package/esm/spec/{spec.d.ts → graph.d.ts} +12 -4
  189. package/esm/spec/graph.js +2 -0
  190. package/esm/spec/graph.js.map +1 -0
  191. package/esm/spec/index.d.ts +1 -1
  192. package/esm/spec/theme.d.ts +1 -4
  193. package/esm/spec/viewport.d.ts +1 -1
  194. package/esm/themes/base.d.ts +1 -0
  195. package/esm/themes/base.js +11 -9
  196. package/esm/themes/base.js.map +1 -1
  197. package/esm/themes/types.d.ts +0 -1
  198. package/esm/transforms/process-parallel-edges.d.ts +2 -3
  199. package/esm/transforms/process-parallel-edges.js +2 -4
  200. package/esm/transforms/process-parallel-edges.js.map +1 -1
  201. package/esm/transforms/types.d.ts +1 -1
  202. package/esm/transforms/update-related-edge.js.map +1 -1
  203. package/esm/types/callable.d.ts +2 -2
  204. package/esm/types/data.d.ts +3 -3
  205. package/esm/types/id.d.ts +1 -0
  206. package/esm/types/id.js +2 -0
  207. package/esm/types/id.js.map +1 -0
  208. package/esm/types/index.d.ts +1 -0
  209. package/esm/types/style.d.ts +1 -3
  210. package/esm/types/viewport.d.ts +4 -4
  211. package/esm/utils/animation.d.ts +6 -6
  212. package/esm/utils/animation.js +3 -3
  213. package/esm/utils/animation.js.map +1 -1
  214. package/esm/utils/behaviors/brush.d.ts +1 -2
  215. package/esm/utils/behaviors/brush.js.map +1 -1
  216. package/esm/utils/behaviors/lasso.d.ts +1 -2
  217. package/esm/utils/behaviors/lasso.js.map +1 -1
  218. package/esm/utils/behaviors/utils.d.ts +1 -1
  219. package/esm/utils/change.js +8 -1
  220. package/esm/utils/change.js.map +1 -1
  221. package/esm/utils/data.d.ts +2 -2
  222. package/esm/utils/data.js +2 -2
  223. package/esm/utils/edge.d.ts +1 -2
  224. package/esm/utils/edge.js.map +1 -1
  225. package/esm/utils/element.d.ts +1 -1
  226. package/esm/utils/element.js +2 -2
  227. package/esm/utils/event/events.d.ts +1 -1
  228. package/esm/utils/event/events.js.map +1 -1
  229. package/esm/utils/event/index.d.ts +1 -1
  230. package/esm/utils/event/index.js +1 -1
  231. package/esm/utils/id.d.ts +2 -3
  232. package/esm/utils/id.js.map +1 -1
  233. package/esm/utils/palette.d.ts +2 -3
  234. package/esm/utils/palette.js +1 -1
  235. package/esm/utils/palette.js.map +1 -1
  236. package/esm/utils/relation.d.ts +3 -4
  237. package/esm/utils/relation.js +2 -2
  238. package/esm/utils/relation.js.map +1 -1
  239. package/esm/utils/style.js +3 -3
  240. package/esm/utils/style.js.map +1 -1
  241. package/esm/utils/visibility.d.ts +1 -1
  242. package/esm/utils/visibility.js +1 -1
  243. package/lib/animations/types.d.ts +3 -4
  244. package/lib/behaviors/base-behavior.d.ts +2 -1
  245. package/lib/behaviors/brush-select.d.ts +33 -16
  246. package/lib/behaviors/brush-select.js +7 -2
  247. package/lib/behaviors/brush-select.js.map +1 -1
  248. package/lib/behaviors/click-element.d.ts +28 -5
  249. package/lib/behaviors/click-element.js +11 -0
  250. package/lib/behaviors/click-element.js.map +1 -1
  251. package/lib/behaviors/collapse-expand.d.ts +3 -2
  252. package/lib/behaviors/collapse-expand.js +2 -2
  253. package/lib/behaviors/collapse-expand.js.map +1 -1
  254. package/lib/behaviors/create-edge.d.ts +1 -2
  255. package/lib/behaviors/create-edge.js.map +1 -1
  256. package/lib/behaviors/drag-canvas.d.ts +7 -0
  257. package/lib/behaviors/drag-canvas.js.map +1 -1
  258. package/lib/behaviors/drag-element-force.d.ts +1 -2
  259. package/lib/behaviors/drag-element-force.js.map +1 -1
  260. package/lib/behaviors/drag-element.d.ts +4 -5
  261. package/lib/behaviors/drag-element.js.map +1 -1
  262. package/lib/behaviors/focus-element.js.map +1 -1
  263. package/lib/behaviors/hover-element.js.map +1 -1
  264. package/lib/behaviors/index.d.ts +2 -0
  265. package/lib/behaviors/index.js +3 -1
  266. package/lib/behaviors/index.js.map +1 -1
  267. package/lib/behaviors/lasso-select.d.ts +4 -4
  268. package/lib/behaviors/lasso-select.js +1 -1
  269. package/lib/behaviors/lasso-select.js.map +1 -1
  270. package/lib/behaviors/scroll-canvas.d.ts +64 -0
  271. package/lib/behaviors/scroll-canvas.js +84 -0
  272. package/lib/behaviors/scroll-canvas.js.map +1 -0
  273. package/lib/behaviors/types.d.ts +2 -1
  274. package/lib/behaviors/zoom-canvas.d.ts +1 -1
  275. package/lib/constants/events/animation.d.ts +1 -4
  276. package/lib/constants/events/animation.js +0 -4
  277. package/lib/constants/events/animation.js.map +1 -1
  278. package/lib/constants/events/graph.d.ts +5 -1
  279. package/lib/constants/events/graph.js +4 -0
  280. package/lib/constants/events/graph.js.map +1 -1
  281. package/lib/elements/combos/base-combo.d.ts +1 -1
  282. package/lib/elements/edges/base-edge.d.ts +0 -5
  283. package/lib/elements/edges/base-edge.js +1 -2
  284. package/lib/elements/edges/base-edge.js.map +1 -1
  285. package/lib/elements/nodes/base-node.d.ts +3 -10
  286. package/lib/elements/nodes/base-node.js +2 -2
  287. package/lib/elements/nodes/base-node.js.map +1 -1
  288. package/lib/elements/nodes/donut.d.ts +45 -0
  289. package/lib/elements/nodes/donut.js +85 -0
  290. package/lib/elements/nodes/donut.js.map +1 -0
  291. package/lib/elements/nodes/html.d.ts +27 -0
  292. package/lib/elements/nodes/html.js +213 -0
  293. package/lib/elements/nodes/html.js.map +1 -0
  294. package/lib/elements/nodes/index.d.ts +4 -0
  295. package/lib/elements/nodes/index.js +5 -1
  296. package/lib/elements/nodes/index.js.map +1 -1
  297. package/lib/elements/shapes/badge.d.ts +1 -1
  298. package/lib/{plugins/hull/shape.d.ts → elements/shapes/contour.d.ts} +17 -17
  299. package/lib/{plugins/hull/shape.js → elements/shapes/contour.js} +15 -14
  300. package/lib/elements/shapes/contour.js.map +1 -0
  301. package/lib/elements/shapes/index.d.ts +2 -0
  302. package/lib/elements/shapes/index.js +3 -1
  303. package/lib/elements/shapes/index.js.map +1 -1
  304. package/lib/exports.d.ts +15 -22
  305. package/lib/exports.js +50 -17
  306. package/lib/exports.js.map +1 -1
  307. package/lib/plugins/bubble-sets.d.ts +45 -0
  308. package/lib/plugins/bubble-sets.js +216 -0
  309. package/lib/plugins/bubble-sets.js.map +1 -0
  310. package/lib/plugins/camera-setting.d.ts +4 -2
  311. package/lib/plugins/camera-setting.js.map +1 -1
  312. package/lib/plugins/contextmenu.d.ts +1 -0
  313. package/lib/plugins/contextmenu.js +1 -0
  314. package/lib/plugins/contextmenu.js.map +1 -1
  315. package/lib/plugins/grid-line.d.ts +51 -8
  316. package/lib/plugins/grid-line.js.map +1 -1
  317. package/lib/plugins/history/utils.js +6 -2
  318. package/lib/plugins/history/utils.js.map +1 -1
  319. package/lib/plugins/hull/index.d.ts +44 -13
  320. package/lib/plugins/hull/index.js +46 -16
  321. package/lib/plugins/hull/index.js.map +1 -1
  322. package/lib/plugins/index.d.ts +4 -0
  323. package/lib/plugins/index.js +5 -1
  324. package/lib/plugins/index.js.map +1 -1
  325. package/lib/plugins/legend.js +4 -2
  326. package/lib/plugins/legend.js.map +1 -1
  327. package/lib/plugins/timebar.d.ts +225 -0
  328. package/lib/plugins/timebar.js +257 -0
  329. package/lib/plugins/timebar.js.map +1 -0
  330. package/lib/plugins/tooltip.d.ts +2 -2
  331. package/lib/registry/build-in.js +12 -7
  332. package/lib/registry/build-in.js.map +1 -1
  333. package/lib/registry/index.d.ts +1 -1
  334. package/lib/registry/index.js +1 -1
  335. package/lib/runtime/canvas.js +7 -4
  336. package/lib/runtime/canvas.js.map +1 -1
  337. package/lib/runtime/data.d.ts +13 -7
  338. package/lib/runtime/data.js +20 -3
  339. package/lib/runtime/data.js.map +1 -1
  340. package/lib/runtime/element.d.ts +6 -10
  341. package/lib/runtime/element.js +64 -45
  342. package/lib/runtime/element.js.map +1 -1
  343. package/lib/runtime/graph.d.ts +532 -45
  344. package/lib/runtime/graph.js +417 -39
  345. package/lib/runtime/graph.js.map +1 -1
  346. package/lib/runtime/layout.js +2 -2
  347. package/lib/runtime/layout.js.map +1 -1
  348. package/lib/runtime/types.d.ts +3 -3
  349. package/lib/runtime/viewport.d.ts +3 -4
  350. package/lib/runtime/viewport.js +2 -2
  351. package/lib/runtime/viewport.js.map +1 -1
  352. package/lib/spec/canvas.d.ts +6 -2
  353. package/lib/spec/data.d.ts +74 -1
  354. package/lib/spec/element/combo.d.ts +17 -6
  355. package/lib/spec/element/edge.d.ts +14 -2
  356. package/lib/spec/element/node.d.ts +19 -3
  357. package/{dist/lib/spec/spec.d.ts → lib/spec/graph.d.ts} +12 -4
  358. package/lib/spec/{spec.js → graph.js} +1 -1
  359. package/lib/spec/graph.js.map +1 -0
  360. package/lib/spec/index.d.ts +1 -1
  361. package/lib/spec/theme.d.ts +1 -4
  362. package/lib/spec/viewport.d.ts +1 -1
  363. package/lib/themes/base.d.ts +1 -0
  364. package/lib/themes/base.js +11 -9
  365. package/lib/themes/base.js.map +1 -1
  366. package/lib/themes/types.d.ts +0 -1
  367. package/lib/transforms/process-parallel-edges.d.ts +2 -3
  368. package/lib/transforms/process-parallel-edges.js +2 -4
  369. package/lib/transforms/process-parallel-edges.js.map +1 -1
  370. package/lib/transforms/types.d.ts +1 -1
  371. package/lib/transforms/update-related-edge.js.map +1 -1
  372. package/lib/types/callable.d.ts +2 -2
  373. package/lib/types/data.d.ts +3 -3
  374. package/lib/types/id.d.ts +1 -0
  375. package/lib/{spec/element/base.js → types/id.js} +1 -1
  376. package/lib/types/id.js.map +1 -0
  377. package/lib/types/index.d.ts +1 -0
  378. package/lib/types/style.d.ts +1 -3
  379. package/lib/types/viewport.d.ts +4 -4
  380. package/lib/utils/animation.d.ts +6 -6
  381. package/lib/utils/animation.js +3 -3
  382. package/lib/utils/animation.js.map +1 -1
  383. package/lib/utils/behaviors/brush.d.ts +1 -2
  384. package/lib/utils/behaviors/brush.js.map +1 -1
  385. package/lib/utils/behaviors/lasso.d.ts +1 -2
  386. package/lib/utils/behaviors/lasso.js.map +1 -1
  387. package/lib/utils/behaviors/utils.d.ts +1 -1
  388. package/lib/utils/change.js +8 -1
  389. package/lib/utils/change.js.map +1 -1
  390. package/lib/utils/data.d.ts +2 -2
  391. package/lib/utils/data.js +2 -2
  392. package/lib/utils/edge.d.ts +1 -2
  393. package/lib/utils/edge.js.map +1 -1
  394. package/lib/utils/element.d.ts +1 -1
  395. package/lib/utils/element.js +2 -2
  396. package/lib/utils/event/events.d.ts +1 -1
  397. package/lib/utils/event/events.js.map +1 -1
  398. package/lib/utils/event/index.d.ts +1 -1
  399. package/lib/utils/event/index.js +1 -1
  400. package/lib/utils/id.d.ts +2 -3
  401. package/lib/utils/id.js.map +1 -1
  402. package/lib/utils/palette.d.ts +2 -3
  403. package/lib/utils/palette.js +1 -1
  404. package/lib/utils/palette.js.map +1 -1
  405. package/lib/utils/relation.d.ts +3 -4
  406. package/lib/utils/relation.js +2 -2
  407. package/lib/utils/relation.js.map +1 -1
  408. package/lib/utils/style.js +3 -3
  409. package/lib/utils/style.js.map +1 -1
  410. package/lib/utils/visibility.d.ts +1 -1
  411. package/lib/utils/visibility.js +1 -1
  412. package/package.json +2 -1
  413. package/src/animations/types.ts +3 -4
  414. package/src/behaviors/base-behavior.ts +1 -1
  415. package/src/behaviors/brush-select.ts +34 -16
  416. package/src/behaviors/click-element.ts +29 -7
  417. package/src/behaviors/collapse-expand.ts +5 -4
  418. package/src/behaviors/create-edge.ts +1 -2
  419. package/src/behaviors/drag-canvas.ts +7 -0
  420. package/src/behaviors/drag-element-force.ts +1 -2
  421. package/src/behaviors/drag-element.ts +3 -4
  422. package/src/behaviors/focus-element.ts +1 -2
  423. package/src/behaviors/hover-element.ts +1 -2
  424. package/src/behaviors/index.ts +2 -0
  425. package/src/behaviors/lasso-select.ts +3 -4
  426. package/src/behaviors/scroll-canvas.ts +143 -0
  427. package/src/behaviors/types.ts +2 -1
  428. package/src/behaviors/zoom-canvas.ts +1 -1
  429. package/src/constants/events/animation.ts +0 -4
  430. package/src/constants/events/graph.ts +4 -0
  431. package/src/elements/combos/base-combo.ts +1 -1
  432. package/src/elements/edges/base-edge.ts +1 -7
  433. package/src/elements/nodes/base-node.ts +6 -15
  434. package/src/elements/nodes/donut.ts +137 -0
  435. package/src/elements/nodes/html.ts +230 -0
  436. package/src/elements/nodes/index.ts +4 -0
  437. package/src/{plugins/hull/shape.ts → elements/shapes/contour.ts} +27 -34
  438. package/src/elements/shapes/index.ts +2 -0
  439. package/src/exports.ts +124 -25
  440. package/src/plugins/bubble-sets.ts +268 -0
  441. package/src/plugins/camera-setting.ts +4 -2
  442. package/src/plugins/contextmenu.ts +1 -0
  443. package/src/plugins/grid-line.ts +51 -8
  444. package/src/plugins/history/utils.ts +6 -2
  445. package/src/plugins/hull/index.ts +58 -22
  446. package/src/plugins/index.ts +4 -0
  447. package/src/plugins/legend.ts +6 -4
  448. package/src/plugins/timebar.ts +450 -0
  449. package/src/plugins/tooltip.ts +2 -2
  450. package/src/registry/build-in.ts +27 -8
  451. package/src/registry/index.ts +1 -1
  452. package/src/runtime/canvas.ts +7 -4
  453. package/src/runtime/data.ts +23 -4
  454. package/src/runtime/element.ts +67 -40
  455. package/src/runtime/graph.ts +554 -56
  456. package/src/runtime/layout.ts +4 -4
  457. package/src/runtime/types.ts +3 -3
  458. package/src/runtime/viewport.ts +3 -4
  459. package/src/spec/canvas.ts +6 -2
  460. package/src/spec/data.ts +74 -1
  461. package/src/spec/element/combo.ts +17 -6
  462. package/src/spec/element/edge.ts +14 -2
  463. package/src/spec/element/node.ts +19 -3
  464. package/src/spec/{spec.ts → graph.ts} +12 -4
  465. package/src/spec/index.ts +1 -1
  466. package/src/spec/theme.ts +1 -5
  467. package/src/spec/viewport.ts +1 -1
  468. package/src/themes/base.ts +12 -9
  469. package/src/themes/types.ts +0 -2
  470. package/src/transforms/arrange-draw-order.ts +1 -1
  471. package/src/transforms/process-parallel-edges.ts +5 -7
  472. package/src/transforms/types.ts +1 -1
  473. package/src/transforms/update-related-edge.ts +1 -2
  474. package/src/types/callable.ts +2 -2
  475. package/src/types/data.ts +3 -3
  476. package/src/types/id.ts +1 -0
  477. package/src/types/index.ts +1 -0
  478. package/src/types/style.ts +1 -3
  479. package/src/types/viewport.ts +4 -4
  480. package/src/utils/animation.ts +6 -6
  481. package/src/utils/behaviors/brush.ts +1 -2
  482. package/src/utils/behaviors/lasso.ts +1 -2
  483. package/src/utils/behaviors/utils.ts +1 -1
  484. package/src/utils/change.ts +7 -3
  485. package/src/utils/data.ts +2 -2
  486. package/src/utils/edge.ts +1 -1
  487. package/src/utils/element.ts +2 -2
  488. package/src/utils/event/events.ts +3 -1
  489. package/src/utils/event/index.ts +1 -1
  490. package/src/utils/id.ts +1 -2
  491. package/src/utils/palette.ts +2 -2
  492. package/src/utils/relation.ts +3 -4
  493. package/src/utils/style.ts +3 -3
  494. package/src/utils/visibility.ts +1 -1
  495. package/dist/lib/runtime/index.d.ts +0 -6
  496. package/dist/lib/spec/element/base.d.ts +0 -6
  497. package/esm/plugins/hull/shape.js.map +0 -1
  498. package/esm/runtime/index.d.ts +0 -6
  499. package/esm/runtime/index.js +0 -7
  500. package/esm/runtime/index.js.map +0 -1
  501. package/esm/spec/element/base.d.ts +0 -6
  502. package/esm/spec/element/base.js +0 -2
  503. package/esm/spec/element/base.js.map +0 -1
  504. package/esm/spec/spec.js +0 -2
  505. package/esm/spec/spec.js.map +0 -1
  506. package/lib/plugins/hull/shape.js.map +0 -1
  507. package/lib/runtime/index.d.ts +0 -6
  508. package/lib/runtime/index.js +0 -8
  509. package/lib/runtime/index.js.map +0 -1
  510. package/lib/spec/element/base.d.ts +0 -6
  511. package/lib/spec/element/base.js.map +0 -1
  512. package/lib/spec/spec.js.map +0 -1
  513. package/src/runtime/index.ts +0 -7
  514. package/src/spec/element/base.ts +0 -6
@@ -1,4 +1,4 @@
1
- import type { G6Spec } from '../spec';
1
+ import type { GraphOptions } from '../spec';
2
2
  import type { BatchController } from './batch';
3
3
  import type { BehaviorController } from './behavior';
4
4
  import type { Canvas } from './canvas';
@@ -27,7 +27,7 @@ export interface RuntimeContext {
27
27
  *
28
28
  * <en/> G6 options
29
29
  */
30
- options: G6Spec;
30
+ options: GraphOptions;
31
31
  /**
32
32
  * <zh/> 数据模型
33
33
  *
@@ -44,7 +44,7 @@ export interface RuntimeContext {
44
44
  * <zh/> 元素控制器
45
45
  *
46
46
  * <en/> Element controller
47
- * @description
47
+ * @remarks
48
48
  * <zh/> 仅在绘制开始后才可用
49
49
  *
50
50
  * <en/> Only available after drawing starts
@@ -1,6 +1,5 @@
1
1
  import { AABB } from '@antv/g';
2
- import type { ID } from '@antv/graphlib';
3
- import type { FitViewOptions, Point, TransformOptions, ViewportAnimationEffectTiming } from '../types';
2
+ import type { FitViewOptions, ID, Point, TransformOptions, ViewportAnimationEffectTiming } from '../types';
4
3
  import type { RuntimeContext } from './types';
5
4
  export declare class ViewportController {
6
5
  private context;
@@ -17,7 +16,7 @@ export declare class ViewportController {
17
16
  *
18
17
  * <en/> Get the center coordinates of the canvas
19
18
  * @returns - <zh/> 画布中心坐标 | <en/> Center coordinates of the canvas
20
- * @description
19
+ * @remarks
21
20
  * <zh/> 基于画布的宽高计算中心坐标,不受视口变换影响
22
21
  *
23
22
  * <en/> Calculate the center coordinates based on the width and height of the canvas, not affected by the viewport transformation
@@ -28,7 +27,7 @@ export declare class ViewportController {
28
27
  *
29
28
  * <en/> Current viewport center coordinates
30
29
  * @returns - <zh/> 视口中心坐标 | <en/> Viewport center coordinates
31
- * @description
30
+ * @remarks
32
31
  * <zh/> 以画布原点为原点,受到视口变换影响
33
32
  *
34
33
  * <en/> With the origin of the canvas as the origin, affected by the viewport transformation
@@ -1,6 +1,5 @@
1
1
  import type { CanvasConfig, IRenderer } from '@antv/g';
2
2
  import type { Canvas } from '../runtime/canvas';
3
- import type { CanvasLayer } from '../types/canvas';
4
3
  /**
5
4
  * <zh/> 画布配置项
6
5
  *
@@ -8,6 +7,11 @@ import type { CanvasLayer } from '../types/canvas';
8
7
  * @public
9
8
  */
10
9
  export interface CanvasOptions extends Pick<CanvasConfig, 'devicePixelRatio'> {
10
+ /**
11
+ * <zh/> 画布容器
12
+ *
13
+ * <en/> canvas container
14
+ */
11
15
  container?: string | HTMLElement | Canvas;
12
16
  /**
13
17
  * <zh/> 画布宽度
@@ -26,7 +30,7 @@ export interface CanvasOptions extends Pick<CanvasConfig, 'devicePixelRatio'> {
26
30
  *
27
31
  * <en/> get renderer
28
32
  */
29
- renderer?: (layer: CanvasLayer) => IRenderer;
33
+ renderer?: (layer: 'background' | 'main' | 'label' | 'transient') => IRenderer;
30
34
  /**
31
35
  * <zh/> 是否自动调整画布大小
32
36
  *
@@ -1,4 +1,4 @@
1
- import type { ID } from '@antv/graphlib';
1
+ import type { ID } from '../types';
2
2
  import type { ComboStyle } from './element/combo';
3
3
  import type { EdgeStyle } from './element/edge';
4
4
  import type { NodeStyle } from './element/node';
@@ -23,22 +23,95 @@ export interface GraphData {
23
23
  combos?: ComboData[];
24
24
  }
25
25
  export interface NodeData {
26
+ /**
27
+ * <zh/> 节点 ID
28
+ *
29
+ * <en/> Node ID
30
+ */
26
31
  id: ID;
32
+ /**
33
+ * <zh/> 节点类型
34
+ *
35
+ * <en/> Node type
36
+ */
37
+ type?: string;
38
+ /**
39
+ * <zh/> 节点数据
40
+ *
41
+ * <en/> Node data
42
+ */
27
43
  data?: Record<string, unknown>;
44
+ /**
45
+ * <zh/> 节点样式
46
+ *
47
+ * <en/> Node style
48
+ */
28
49
  style?: NodeStyle;
29
50
  [key: string]: unknown;
30
51
  }
31
52
  export interface ComboData {
53
+ /**
54
+ * <zh/> Combo ID
55
+ *
56
+ * <en/> Combo ID
57
+ */
32
58
  id: ID;
59
+ /**
60
+ * <zh/> Combo 类型
61
+ *
62
+ * <en/> Combo type
63
+ */
64
+ type?: string;
65
+ /**
66
+ * <zh/> Combo 数据
67
+ *
68
+ * <en/> Combo data
69
+ */
33
70
  data?: Record<string, unknown>;
71
+ /**
72
+ * <zh/> Combo 样式
73
+ *
74
+ * <en/> Combo style
75
+ */
34
76
  style?: ComboStyle;
35
77
  [key: string]: unknown;
36
78
  }
37
79
  export interface EdgeData {
80
+ /**
81
+ * <zh/> 边 ID
82
+ *
83
+ * <en/> Edge ID
84
+ */
38
85
  id?: ID;
86
+ /**
87
+ * <zh/> 边源节点 ID
88
+ *
89
+ * <en/> Source node ID
90
+ */
39
91
  source: ID;
92
+ /**
93
+ * <zh/> 边目标节点 ID
94
+ *
95
+ * <en/> Target node ID
96
+ */
40
97
  target: ID;
98
+ /**
99
+ * <zh/> 边类型
100
+ *
101
+ * <en/> Edge type
102
+ */
103
+ type?: string;
104
+ /**
105
+ * <zh/> 边数据
106
+ *
107
+ * <en/> Edge data
108
+ */
41
109
  data?: Record<string, unknown>;
110
+ /**
111
+ * <zh/> 边样式
112
+ *
113
+ * <en/> Edge style
114
+ */
42
115
  style?: EdgeStyle;
43
116
  [key: string]: unknown;
44
117
  }
@@ -1,9 +1,8 @@
1
- import type { ID } from '@antv/graphlib';
2
1
  import type { BaseComboStyleProps } from '../../elements/combos';
2
+ import type { ID, State } from '../../types';
3
3
  import type { CallableObject } from '../../types/callable';
4
- import type { NodeData } from '../data';
4
+ import type { ComboData } from '../data';
5
5
  import type { AnimationOptions } from './animation';
6
- import type { BaseElementStyle } from './base';
7
6
  import type { PaletteOptions } from './palette';
8
7
  /**
9
8
  * <zh/> Combo 配置项
@@ -11,18 +10,24 @@ import type { PaletteOptions } from './palette';
11
10
  * <en/> Combo spec
12
11
  */
13
12
  export interface ComboOptions {
13
+ /**
14
+ * <zh/> Combo 类型
15
+ *
16
+ * <en/> Combo type
17
+ */
18
+ type?: string | ((datum: ComboData) => string);
14
19
  /**
15
20
  * <zh/> Combo 样式
16
21
  *
17
22
  * <en/> Combo style
18
23
  */
19
- style?: CallableObject<ComboStyle, NodeData>;
24
+ style?: CallableObject<ComboStyle, ComboData>;
20
25
  /**
21
26
  * <zh/> Combo 状态样式
22
27
  *
23
28
  * <en/> Combo state style
24
29
  */
25
- state?: Record<string, CallableObject<ComboStyle, NodeData>>;
30
+ state?: Record<string, CallableObject<ComboStyle, ComboData>>;
26
31
  /**
27
32
  * <zh/> Combo 动画
28
33
  *
@@ -42,7 +47,13 @@ export interface StaticComboOptions {
42
47
  animation?: AnimationOptions;
43
48
  palette?: PaletteOptions;
44
49
  }
45
- export interface ComboStyle extends BaseElementStyle, Partial<BaseComboStyleProps> {
50
+ export interface ComboStyle extends Partial<BaseComboStyleProps> {
51
+ /**
52
+ * <zh/> 初始状态
53
+ *
54
+ * <en/> Initial state
55
+ */
56
+ states?: State[];
46
57
  children?: ID[];
47
58
  [key: string]: any;
48
59
  }
@@ -1,8 +1,8 @@
1
1
  import type { BaseEdgeStyleProps } from '../../elements/edges';
2
+ import { State } from '../../types';
2
3
  import type { CallableObject } from '../../types/callable';
3
4
  import type { EdgeData } from '../data';
4
5
  import type { AnimationOptions } from './animation';
5
- import type { BaseElementStyle } from './base';
6
6
  import type { PaletteOptions } from './palette';
7
7
  /**
8
8
  * <zh/> 边配置项
@@ -10,6 +10,12 @@ import type { PaletteOptions } from './palette';
10
10
  * <en/> Edge spec
11
11
  */
12
12
  export interface EdgeOptions {
13
+ /**
14
+ * <zh/> 边类型
15
+ *
16
+ * <en/> Edge type
17
+ */
18
+ type?: string | ((datum: EdgeData) => string);
13
19
  /**
14
20
  * <zh/> 边样式
15
21
  *
@@ -41,6 +47,12 @@ export interface StaticEdgeOptions {
41
47
  animation?: AnimationOptions;
42
48
  palette?: PaletteOptions;
43
49
  }
44
- export interface EdgeStyle extends BaseElementStyle, Partial<BaseEdgeStyleProps> {
50
+ export interface EdgeStyle extends Partial<BaseEdgeStyleProps> {
51
+ /**
52
+ * <zh/> 初始状态
53
+ *
54
+ * <en/> Initial state
55
+ */
56
+ states?: State[];
45
57
  [key: string]: any;
46
58
  }
@@ -1,9 +1,8 @@
1
- import type { ID } from '@antv/graphlib';
2
1
  import type { BaseNodeStyleProps } from '../../elements/nodes';
2
+ import type { ID, State } from '../../types';
3
3
  import type { CallableObject } from '../../types/callable';
4
4
  import type { NodeData } from '../data';
5
5
  import type { AnimationOptions } from './animation';
6
- import type { BaseElementStyle } from './base';
7
6
  import type { PaletteOptions } from './palette';
8
7
  /**
9
8
  * <zh/> 节点配置项
@@ -11,6 +10,12 @@ import type { PaletteOptions } from './palette';
11
10
  * <en/> Node spec
12
11
  */
13
12
  export interface NodeOptions {
13
+ /**
14
+ * <zh/> 节点类型
15
+ *
16
+ * <en/> Node type
17
+ */
18
+ type?: string | ((datum: NodeData) => string);
14
19
  /**
15
20
  * <zh/> 节点样式
16
21
  *
@@ -42,7 +47,18 @@ export interface StaticNodeOptions {
42
47
  animation?: AnimationOptions;
43
48
  palette?: PaletteOptions;
44
49
  }
45
- export interface NodeStyle extends BaseElementStyle, Partial<BaseNodeStyleProps> {
50
+ export interface NodeStyle extends Partial<BaseNodeStyleProps> {
51
+ /**
52
+ * <zh/> 初始状态
53
+ *
54
+ * <en/> Initial state
55
+ */
56
+ states?: State[];
57
+ /**
58
+ * <zh/> 子节点 ID (树图专用)
59
+ *
60
+ * <en/> Child node ID (for tree graph)
61
+ */
46
62
  children?: ID[];
47
63
  [key: string]: any;
48
64
  }
@@ -11,16 +11,24 @@ import type { ThemeOptions } from './theme';
11
11
  import type { TransformOptions } from './transform';
12
12
  import type { ViewportOptions } from './viewport';
13
13
  /**
14
- * <zh/> Spec 定义
14
+ * <zh/> Graph 配置项
15
15
  *
16
- * <en/> Specification definition
16
+ * <en/> Graph options
17
+ * @remarks
18
+ * <zh/> Graph 的初始化通过 `new` 进行实例化,实例化时需要传入需要的参数。目前所支持的参数如下:
19
+ *
20
+ * <en/> The initialization of Graph is instantiated through `new`, and the required parameters need to be passed in when instantiated.
21
+ *
22
+ * ```
23
+ * new G6.Graph(options: GraphOptions) => Graph
24
+ * ```
17
25
  */
18
- export interface G6Spec extends CanvasOptions, ViewportOptions {
26
+ export interface GraphOptions extends CanvasOptions, ViewportOptions {
19
27
  /**
20
28
  * <zh/> 启用关闭、全局动画
21
29
  *
22
30
  * <en/> Enable or disable global animation
23
- * @description
31
+ * @remarks
24
32
  * <zh/> 为动画配置项时,会启用动画,并将该动画配置作为全局动画的基础配置
25
33
  *
26
34
  * <en/> When it is an animation configuration item, the animation will be enabled, and the animation configuration will be used as the basic configuration of the global animation
@@ -4,9 +4,9 @@ export type { ComboData, EdgeData, GraphData, NodeData } from './data';
4
4
  export type { ComboOptions } from './element/combo';
5
5
  export type { EdgeOptions } from './element/edge';
6
6
  export type { NodeOptions } from './element/node';
7
+ export type { GraphOptions } from './graph';
7
8
  export type { LayoutOptions } from './layout';
8
9
  export type { PluginOptions } from './plugin';
9
- export type { G6Spec } from './spec';
10
10
  export type { ThemeOptions } from './theme';
11
11
  export type { TransformOptions } from './transform';
12
12
  export type { ViewportOptions } from './viewport';
@@ -1,10 +1,7 @@
1
- import type { BuiltInTheme } from '../themes/types';
2
1
  /**
3
2
  * <zh/> 主题配置项
4
3
  *
5
4
  * <en/> Theme Options
6
5
  * @public
7
6
  */
8
- export type ThemeOptions = BuiltInTheme | CustomTheme;
9
- type CustomTheme = string;
10
- export {};
7
+ export type ThemeOptions = 'light' | 'dark' | string;
@@ -29,7 +29,7 @@ export interface ViewportOptions {
29
29
  * <zh/> 画布内边距
30
30
  *
31
31
  * <en/> canvas padding
32
- * @description
32
+ * @remarks
33
33
  * <zh/> 通常在自适应时,会根据内边距进行适配
34
34
  *
35
35
  * <en/> Usually, it will be adapted according to the padding when auto-fitting
@@ -8,6 +8,7 @@ type ThemeTokens = {
8
8
  nodeStroke: string;
9
9
  nodeBadgePalette?: string[];
10
10
  nodePaletteOptions?: PaletteOptions;
11
+ donutPaletteOptions?: PaletteOptions;
11
12
  edgeColor: string;
12
13
  edgeColorDisabled: string;
13
14
  edgePaletteOptions?: PaletteOptions;
@@ -1,7 +1,6 @@
1
1
  import type { StaticComboOptions } from '../spec/element/combo';
2
2
  import type { StaticEdgeOptions } from '../spec/element/edge';
3
3
  import type { StaticNodeOptions } from '../spec/element/node';
4
- export type BuiltInTheme = 'light' | 'dark';
5
4
  export type Theme = {
6
5
  node?: StaticNodeOptions;
7
6
  edge?: StaticEdgeOptions;
@@ -1,8 +1,7 @@
1
1
  import type { PathStyleProps } from '@antv/g';
2
- import type { ID } from '@antv/graphlib';
3
2
  import type { RuntimeContext } from '../runtime/types';
4
3
  import type { EdgeData } from '../spec';
5
- import type { ElementDatum, ElementType } from '../types';
4
+ import type { ElementDatum, ElementType, ID } from '../types';
6
5
  import type { BaseTransformOptions } from './base-transform';
7
6
  import { BaseTransform } from './base-transform';
8
7
  import type { DrawData } from './types';
@@ -11,7 +10,7 @@ export interface ProcessParallelEdgesOptions extends BaseTransformOptions {
11
10
  * <zh/> 处理模式,默认为捆绑
12
11
  *
13
12
  * <en/> Processing mode, default is bundle
14
- * @description
13
+ * @remarks
15
14
  * <zh/>
16
15
  * - merge: 将平行边合并为一条边,适用于不需要区分平行边的情况
17
16
  * - bundle: 每条边都会与其他所有平行边捆绑在一起,并通过改变曲率与其他边分开。如果一组平行边的数量是奇数,那么中心的边将被绘制为直线,其他的边将被绘制为曲线
@@ -1,5 +1,5 @@
1
- import { ID } from '@antv/graphlib';
2
1
  import type { ComboData, EdgeData, NodeData } from '../spec';
2
+ import type { ID } from '../types';
3
3
  import type { BaseTransform, BaseTransformOptions } from './base-transform';
4
4
  export type BuiltInTransformOptions = BaseTransformOptions;
5
5
  export type Transform = BaseTransform<any>;
@@ -25,6 +25,6 @@ export type CallableValue<Returns, Param = Returns> = Returns | ((args: Param) =
25
25
  * fill: ({ model }) => model.value,
26
26
  * }
27
27
  */
28
- export type CallableObject<Obj extends Record<string, unknown>, T> = ((datum: T, index: number, data: T[]) => Obj) | {
29
- [K in keyof Obj]: Obj[K] | ((datum: T, index: number, data: T[]) => NonNullable<Obj[K]>);
28
+ export type CallableObject<Obj extends Record<string, unknown>, T> = ((datum: T) => Obj) | {
29
+ [K in keyof Obj]: Obj[K] | ((datum: T) => NonNullable<Obj[K]>);
30
30
  };
@@ -1,5 +1,5 @@
1
- import type { ID } from '@antv/graphlib';
2
1
  import type { ComboData, EdgeData, NodeData } from '../spec/data';
2
+ import type { ID } from '../types';
3
3
  export type DataID = {
4
4
  nodes?: ID[];
5
5
  edges?: ID[];
@@ -12,7 +12,7 @@ export type ElementData = NodeData[] | EdgeData[] | ComboData[];
12
12
  * <zh/> 节点、边更新可选数据
13
13
  *
14
14
  * <en/> Node, edge update optional data
15
- * @description
15
+ * @remarks
16
16
  * <zh/> 必须包含 id 字段,其他字段可选
17
17
  *
18
18
  * <en/> Must contain the id field, other fields are optional
@@ -22,7 +22,7 @@ export type PartialNodeLikeData<T extends NodeLikeData> = Partial<T> & Pick<T, '
22
22
  * <zh/> 边更新可选数据
23
23
  *
24
24
  * <en/> Edge update optional data
25
- * @description
25
+ * @remarks
26
26
  * <zh/> 包含两种情况:
27
27
  * 1. 必须包含 source、target 字段,其他字段可选
28
28
  * 2. 必须包含 id 字段,其他字段可选
@@ -0,0 +1 @@
1
+ export type ID = string;
@@ -9,6 +9,7 @@ export type * from './element';
9
9
  export type * from './enum';
10
10
  export type * from './event';
11
11
  export type * from './graphlib';
12
+ export type * from './id';
12
13
  export type * from './node';
13
14
  export type * from './padding';
14
15
  export type * from './placement';
@@ -1,4 +1,4 @@
1
- import type { ElementData, ElementDatum } from './data';
1
+ import type { ElementDatum } from './data';
2
2
  /**
3
3
  * <zh/> 样式计算迭代上下文
4
4
  *
@@ -6,6 +6,4 @@ import type { ElementData, ElementDatum } from './data';
6
6
  */
7
7
  export type StyleIterationContext = {
8
8
  datum: ElementDatum;
9
- index: number;
10
- elementData: ElementData;
11
9
  };
@@ -3,14 +3,14 @@ export type ViewportAnimationEffectTiming = boolean | {
3
3
  easing?: string;
4
4
  duration?: number;
5
5
  };
6
- export type TransformOptions = {
6
+ export interface TransformOptions {
7
7
  mode: ViewportChangeMode;
8
8
  origin?: Point;
9
9
  translate?: Point;
10
10
  rotate?: number;
11
11
  scale?: number;
12
- };
13
- export type FitViewOptions = {
12
+ }
13
+ export interface FitViewOptions {
14
14
  /**
15
15
  * <zh/> 在以下情况下进行适配
16
16
  * - 'overflow' 仅当图内容超出视口时进行适配
@@ -33,6 +33,6 @@ export type FitViewOptions = {
33
33
  * - 'both' Adapt to the x and y directions
34
34
  */
35
35
  direction?: 'x' | 'y' | 'both';
36
- };
36
+ }
37
37
  type ViewportChangeMode = 'relative' | 'absolute';
38
38
  export {};
@@ -1,5 +1,5 @@
1
1
  import type { DisplayObject, IAnimation } from '@antv/g';
2
- import type { G6Spec } from '../spec';
2
+ import type { GraphOptions } from '../spec';
3
3
  import type { AnimatableTask, Keyframe } from '../types';
4
4
  export declare function createAnimationsProxy(animations: IAnimation[]): IAnimation | null;
5
5
  export declare function createAnimationsProxy(sourceAnimation: IAnimation, targetAnimations: IAnimation[]): IAnimation;
@@ -19,7 +19,7 @@ export declare function preprocessKeyframes(keyframes: Keyframe[]): Keyframe[];
19
19
  * @param keyframes - <zh/> 动画关键帧 | <en/> keyframes of the animation
20
20
  * @param options - <zh/> 动画配置项 | <en/> animation options
21
21
  * @returns <zh/> 动画对象 | <en/> animation object
22
- * @description
22
+ * @remarks
23
23
  * <zh/> 在设置 enableCSSParsing 为 false 后,复合图形无法继承父属性,因此对于一些需要继承父属性的动画,需要对所有子图形执行相同的动画
24
24
  *
25
25
  * <en/> After setting enableCSSParsing to false, the compound shape cannot inherit the parent attribute, so for some animations that need to inherit the parent attribute, the same animation needs to be performed on all child shapes
@@ -31,12 +31,12 @@ export declare function executeAnimation<T extends DisplayObject>(shape: T, keyf
31
31
  * <en/> Get default value of attribute
32
32
  * @param name - <zh/> 属性名 | <en/> Attribute name
33
33
  * @returns <zh/> 属性默认值 | <en/> Attribute default value
34
- * @description
34
+ * @remarks
35
35
  * <zh/> 执行动画过程中,一些属性没有显式指定属性值,但实际上在 G 中存在属性值,因此通过该方法获取其实际默认值
36
36
  *
37
37
  * <en/> During the animation, some attributes do not explicitly specify the attribute value, but in fact there is an attribute value in G, so use this method to get the actual default value
38
38
  */
39
- export declare function inferDefaultValue(name: string): false | 1 | never[] | 0 | "visible" | undefined;
39
+ export declare function inferDefaultValue(name: string): false | 1 | "visible" | 0 | never[] | undefined;
40
40
  type Callbacks = {
41
41
  before?: () => void;
42
42
  beforeAnimate?: (result: IAnimation) => void;
@@ -51,7 +51,7 @@ type Callbacks = {
51
51
  * @param callbacks - <zh/> 回调函数 | <en/> callback function
52
52
  * @returns <zh/> 动画对象 | <en/> animation object
53
53
  */
54
- export declare function withAnimationCallbacks(animation: IAnimation | null, callbacks: Callbacks): IAnimation | null;
54
+ export declare function withAnimationCallbacks(animation: IAnimation | null | undefined, callbacks: Callbacks): IAnimation | null;
55
55
  /**
56
56
  * <zh/> 执行动画任务
57
57
  *
@@ -69,5 +69,5 @@ export declare function executeAnimatableTasks(tasks: AnimatableTask[], callback
69
69
  * @param localAnimation - <zh/> 局部动画配置 | <en/> local animation configuration
70
70
  * @returns <zh/> 动画配置 | <en/> animation configuration
71
71
  */
72
- export declare function getAnimation(options: G6Spec, localAnimation: boolean | EffectTiming | undefined): false | EffectTiming;
72
+ export declare function getAnimation(options: GraphOptions, localAnimation: boolean | EffectTiming | undefined): false | EffectTiming;
73
73
  export {};
@@ -1,6 +1,5 @@
1
- import type { ID } from '@antv/graphlib';
2
1
  import type { Graph } from '../../runtime/graph';
3
- import type { Point, Points } from '../../types';
2
+ import type { ID, Point, Points } from '../../types';
4
3
  /**
5
4
  * <zh/> 元素中心是否在 rect 中
6
5
  *
@@ -1,6 +1,5 @@
1
- import type { ID } from '@antv/graphlib';
2
1
  import type { Graph } from '../../runtime/graph';
3
- import type { Points } from '../../types';
2
+ import type { ID, Points } from '../../types';
4
3
  /**
5
4
  * <zh/> 元素中心是否在 path 中
6
5
  *
@@ -1,6 +1,6 @@
1
- import type { ID } from '@antv/graphlib';
2
1
  import type { States } from '../../behaviors/types';
3
2
  import type { Graph } from '../../runtime/graph';
3
+ import type { ID } from '../../types';
4
4
  /**
5
5
  * <zh/> 获取所有元素状态.
6
6
  *
@@ -6,7 +6,7 @@ import type { ComboData, EdgeData, GraphData, NodeData } from '../spec';
6
6
  * @param original - <zh/> 原始数据 | <en/> original data
7
7
  * @param modified - <zh/> 待合并的数据 | <en/> data to be merged
8
8
  * @returns <zh/> 合并后的数据 | <en/> merged data
9
- * @description
9
+ * @remarks
10
10
  * <zh/> 只会合并第一层的数据,data、style 下的二级数据会被覆盖
11
11
  *
12
12
  * <en/> Only the first level of data will be merged, the second level of data under data and style will be overwritten
@@ -18,7 +18,7 @@ export declare function mergeElementsData<T extends NodeData | EdgeData | ComboD
18
18
  * <en/> Clone clement data
19
19
  * @param data - <zh/> 待克隆的数据 | <en/> data to be cloned
20
20
  * @returns <zh/> 克隆后的数据 | <en/> cloned data
21
- * @description
21
+ * @remarks
22
22
  * <zh/> 只会克隆到第二层(data、style)
23
23
  *
24
24
  * <en/> Only clone to the second level (data, style)
@@ -1,8 +1,7 @@
1
1
  import type { AABB } from '@antv/g';
2
- import type { ID } from '@antv/graphlib';
3
2
  import type { PathArray } from '@antv/util';
4
3
  import type { EdgeData } from '../spec';
5
- import type { EdgeKey, EdgeLabelPlacement, EdgeLabelStyleProps, LoopPlacement, Node, Point, Port } from '../types';
4
+ import type { EdgeKey, EdgeLabelPlacement, EdgeLabelStyleProps, ID, LoopPlacement, Node, Point, Port } from '../types';
6
5
  /**
7
6
  * <zh/> 获取标签的位置样式
8
7
  *
@@ -92,7 +92,7 @@ export declare function findPorts(sourceNode: Node, targetNode: Node, sourcePort
92
92
  * <zh/> 查找节点上的最有可能连接的连接桩
93
93
  *
94
94
  * <en/> Find the most likely connected port on the node
95
- * @description
95
+ * @remarks
96
96
  * 1. If `portKey` is specified, return the port.
97
97
  * 2. If `portKey` is not specified, return the port closest to the opposite connection points.
98
98
  * 3. If the node has no ports, return undefined.
@@ -7,7 +7,7 @@ export declare class BaseEvent {
7
7
  }
8
8
  export declare class GraphLifeCycleEvent extends BaseEvent implements IGraphLifeCycleEvent {
9
9
  data?: any;
10
- constructor(type: GraphEvent.BEFORE_RENDER | GraphEvent.AFTER_RENDER | GraphEvent.BEFORE_DRAW | GraphEvent.AFTER_DRAW | GraphEvent.BEFORE_LAYOUT | GraphEvent.AFTER_LAYOUT | GraphEvent.BEFORE_SIZE_CHANGE | GraphEvent.AFTER_SIZE_CHANGE | GraphEvent.BATCH_START | GraphEvent.BATCH_END, data?: any);
10
+ constructor(type: GraphEvent.BEFORE_RENDER | GraphEvent.AFTER_RENDER | GraphEvent.BEFORE_DRAW | GraphEvent.AFTER_DRAW | GraphEvent.BEFORE_LAYOUT | GraphEvent.AFTER_LAYOUT | GraphEvent.BEFORE_SIZE_CHANGE | GraphEvent.AFTER_SIZE_CHANGE | GraphEvent.BATCH_START | GraphEvent.BATCH_END | GraphEvent.BEFORE_DESTROY | GraphEvent.AFTER_DESTROY, data?: any);
11
11
  }
12
12
  export declare class AnimateEvent extends BaseEvent implements IAnimateEvent {
13
13
  animationType: AnimationType;
@@ -18,7 +18,7 @@ export declare function emit(emitter: EventEmitter, event: BaseEvent): void;
18
18
  * <en/> Get the event target element
19
19
  * @param shape - <zh/> 事件图形 | <en/> event shape
20
20
  * @returns <zh/> 目标元素 | <en/> target element
21
- * @description
21
+ * @remarks
22
22
  * <zh/> 事件响应大多数情况会命中元素的内部图形,通过该方法可以获取到其所属元素
23
23
  *
24
24
  * <en/> Most of the event responses will hit the internal graphics of the element, and this method can be used to get the element to which it belongs