@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,57 +1,159 @@
1
1
  import EventEmitter from '@antv/event-emitter';
2
2
  import type { AABB, BaseStyleProps } from '@antv/g';
3
- import type { ID } from '@antv/graphlib';
4
3
  import type { Plugin } from '../plugins/types';
5
- import type { BehaviorOptions, ComboData, ComboOptions, EdgeData, EdgeOptions, G6Spec, GraphData, LayoutOptions, NodeData, NodeOptions, PluginOptions, ThemeOptions, TransformOptions } from '../spec';
4
+ import type { BehaviorOptions, ComboData, ComboOptions, EdgeData, EdgeOptions, GraphData, GraphOptions, LayoutOptions, NodeData, NodeOptions, PluginOptions, ThemeOptions, TransformOptions } from '../spec';
6
5
  import type { UpdateBehaviorOption } from '../spec/behavior';
7
6
  import type { UpdatePluginOption } from '../spec/plugin';
8
7
  import type { UpdateTransformOption } from '../spec/transform';
9
- import type { CallableValue, DataID, EdgeDirection, ElementType, FitViewOptions, IEvent, NodeLikeData, PartialEdgeData, PartialGraphData, PartialNodeLikeData, Point, Position, State, ViewportAnimationEffectTiming } from '../types';
8
+ import type { CallableValue, DataID, EdgeDirection, ElementType, FitViewOptions, ID, IEvent, NodeLikeData, PartialEdgeData, PartialGraphData, PartialNodeLikeData, Point, Position, State, ViewportAnimationEffectTiming } from '../types';
10
9
  import type { DataURLOptions } from './canvas';
11
10
  import { Canvas } from './canvas';
12
11
  import type { HierarchyKey } from './data';
13
12
  export declare class Graph extends EventEmitter {
14
13
  private options;
15
- static defaultOptions: G6Spec;
14
+ /**
15
+ * @internal
16
+ */
17
+ static defaultOptions: GraphOptions;
18
+ /**
19
+ * <zh/> 当前图实例是否已经被销毁
20
+ *
21
+ * <en/> Whether the current graph instance has been destroyed
22
+ */
16
23
  destroyed: boolean;
17
24
  private context;
18
- constructor(options: G6Spec);
25
+ constructor(options: GraphOptions);
19
26
  /**
20
27
  * <zh/> 获取配置项
21
28
  *
22
29
  * <en/> Get options
23
30
  * @returns <zh/> 配置项 | <en/> options
31
+ * @apiCategory option
24
32
  */
25
- getOptions(): G6Spec;
33
+ getOptions(): GraphOptions;
26
34
  /**
27
35
  * <zh/> 设置配置项
28
36
  *
29
37
  * <en/> Set options
30
38
  * @param options - <zh/> 配置项 | <en/> options
31
- * @description
39
+ * @remarks
32
40
  * <zh/> 要更新 devicePixelRatio、container 属性请销毁后重新创建实例
33
41
  *
34
42
  * <en/> To update devicePixelRatio and container properties, please destroy and recreate the instance
43
+ * @apiCategory option
44
+ */
45
+ setOptions(options: GraphOptions): void;
46
+ /**
47
+ * <zh/> 设置画布背景色
48
+ *
49
+ * <en/> Set canvas background color
50
+ * @param background - <zh/> 背景色 | <en/> background color
51
+ * @apiCategory canvas
52
+ */
53
+ setBackground(background: GraphOptions['background']): void;
54
+ /**
55
+ * <zh/> 获取画布背景色
56
+ *
57
+ * <en/> Get canvas background color
58
+ * @returns <zh/> 背景色 | <en/> background color
59
+ * @apiCategory canvas
60
+ */
61
+ getBackground(): GraphOptions['background'];
62
+ /**
63
+ * <zh/> 获取当前图容器的大小
64
+ *
65
+ * <en/> Get the size of the current canvas container
66
+ * @returns <zh/> 画布尺寸 | <en/> canvas size
67
+ * @apiCategory canvas
35
68
  */
36
- setOptions(options: G6Spec): void;
37
- setBackground(background: G6Spec['background']): void;
38
- getBackground(): G6Spec['background'];
39
69
  getSize(): [number, number];
70
+ /**
71
+ * <zh/> 获取当前图容器的大小
72
+ *
73
+ * <en/> Get the size of the current canvas container
74
+ * @param width - <zh/> 画布宽度 | <en/> canvas width
75
+ * @param height - <zh/> 画布高度 | <en/> canvas height
76
+ * @apiCategory canvas
77
+ */
40
78
  setSize(width: number, height: number): void;
41
- setZoomRange(zoomRange: G6Spec['zoomRange']): void;
42
- getZoomRange(): G6Spec['zoomRange'];
79
+ /**
80
+ * <zh/> 获取当前图的缩放区间
81
+ *
82
+ * <en/> Get the zoom range of the current graph
83
+ * @param zoomRange - <zh/> 缩放区间 | <en/> zoom range
84
+ * @apiCategory viewport
85
+ */
86
+ setZoomRange(zoomRange: GraphOptions['zoomRange']): void;
87
+ /**
88
+ * <zh/> 获取当前图的缩放区间
89
+ *
90
+ * <en/> Get the zoom range of the current graph
91
+ * @returns <zh/> 缩放区间 | <en/> zoom range
92
+ * @apiCategory viewport
93
+ */
94
+ getZoomRange(): GraphOptions['zoomRange'];
95
+ /**
96
+ * <zh/> 设置节点样式映射
97
+ *
98
+ * <en/> Set node mapper
99
+ * @param node - <zh/> 节点配置 | <en/> node configuration
100
+ * @apiCategory element
101
+ */
43
102
  setNode(node: NodeOptions): void;
103
+ /**
104
+ * <zh/> 设置边样式映射
105
+ *
106
+ * <en/> Set edge mapper
107
+ * @param edge - <zh/> 边配置 | <en/> edge configuration
108
+ * @apiCategory element
109
+ */
44
110
  setEdge(edge: EdgeOptions): void;
111
+ /**
112
+ * <zh/> 设置组合样式映射
113
+ *
114
+ * <en/> Set combo mapper
115
+ * @param combo - <zh/> 组合配置 | <en/> combo configuration
116
+ * @apiCategory element
117
+ */
45
118
  setCombo(combo: ComboOptions): void;
119
+ /**
120
+ * <zh/> 获取主题
121
+ *
122
+ * <en/> Get theme
123
+ * @returns <zh/> 主题配置 | <en/> theme configuration
124
+ * @apiCategory theme
125
+ */
46
126
  getTheme(): ThemeOptions;
127
+ /**
128
+ * <zh/> 设置主题
129
+ *
130
+ * <en/> Set theme
131
+ * @param theme - <zh/> 主题配置 | <en/> theme configuration
132
+ * @apiCategory theme
133
+ */
47
134
  setTheme(theme: CallableValue<ThemeOptions>): void;
135
+ /**
136
+ * <zh/> 设置布局
137
+ *
138
+ * <en/> Set layout
139
+ * @param layout - <zh/> 布局配置 | <en/> layout configuration
140
+ * @apiCategory layout
141
+ */
48
142
  setLayout(layout: CallableValue<LayoutOptions>): void;
143
+ /**
144
+ * <zh/> 获取布局
145
+ *
146
+ * <en/> Get layout
147
+ * @returns <zh/> 布局配置 | <en/> layout configuration
148
+ * @apiCategory layout
149
+ */
49
150
  getLayout(): LayoutOptions;
50
151
  /**
51
152
  * <zh/> 设置交互
52
153
  *
53
154
  * <en/> Set behaviors
54
155
  * @param behaviors - <zh/> 交互配置 | <en/> behavior configuration
156
+ * @apiCategory behavior
55
157
  */
56
158
  setBehaviors(behaviors: CallableValue<BehaviorOptions>): void;
57
159
  /**
@@ -59,6 +161,7 @@ export declare class Graph extends EventEmitter {
59
161
  *
60
162
  * <en/> Update behavior
61
163
  * @param behavior - <zh/> 交互配置 | <en/> behavior configuration
164
+ * @apiCategory behavior
62
165
  */
63
166
  updateBehavior(behavior: UpdateBehaviorOption): void;
64
167
  /**
@@ -66,6 +169,7 @@ export declare class Graph extends EventEmitter {
66
169
  *
67
170
  * <en/> Get behaviors
68
171
  * @returns <zh/> 交互配置 | <en/> behavior configuration
172
+ * @apiCategory behavior
69
173
  */
70
174
  getBehaviors(): BehaviorOptions;
71
175
  /**
@@ -73,6 +177,7 @@ export declare class Graph extends EventEmitter {
73
177
  *
74
178
  * <en/> Set plugins
75
179
  * @param plugins - <zh/> 插件配置 | <en/> plugin configuration
180
+ * @apiCategory plugin
76
181
  */
77
182
  setPlugins(plugins: CallableValue<PluginOptions>): void;
78
183
  /**
@@ -80,6 +185,7 @@ export declare class Graph extends EventEmitter {
80
185
  *
81
186
  * <en/> Update plugin
82
187
  * @param plugin - <zh/> 插件配置 | <en/> plugin configuration
188
+ * @apiCategory plugin
83
189
  */
84
190
  updatePlugin(plugin: UpdatePluginOption): void;
85
191
  /**
@@ -87,6 +193,7 @@ export declare class Graph extends EventEmitter {
87
193
  *
88
194
  * <en/> Get plugins
89
195
  * @returns <zh/> 插件配置 | <en/> plugin configuration
196
+ * @apiCategory plugin
90
197
  */
91
198
  getPlugins(): PluginOptions;
92
199
  /**
@@ -95,6 +202,7 @@ export declare class Graph extends EventEmitter {
95
202
  * <en/> Get plugin instance
96
203
  * @param key - <zh/> 插件 key | <en/> plugin key
97
204
  * @returns <zh/> 插件实例 | <en/> plugin instance
205
+ * @apiCategory plugin
98
206
  */
99
207
  getPluginInstance<T extends Plugin>(key: string): T;
100
208
  /**
@@ -102,6 +210,7 @@ export declare class Graph extends EventEmitter {
102
210
  *
103
211
  * <en/> Set data transforms
104
212
  * @param transforms - <zh/> 数据转换配置 | <en/> data transform configuration
213
+ * @apiCategory transform
105
214
  */
106
215
  setTransforms(transforms: CallableValue<TransformOptions>): void;
107
216
  /**
@@ -109,6 +218,7 @@ export declare class Graph extends EventEmitter {
109
218
  *
110
219
  * <en/> Update data transform
111
220
  * @param transform - <zh/> 数据转换配置 | <en/> data transform configuration
221
+ * @apiCategory transform
112
222
  */
113
223
  updateTransform(transform: UpdateTransformOption): void;
114
224
  /**
@@ -116,78 +226,299 @@ export declare class Graph extends EventEmitter {
116
226
  *
117
227
  * <en/> Get data transforms
118
228
  * @returns <zh/> 数据转换器实例 | <en/> data transform instance
229
+ * @apiCategory transform
119
230
  */
120
231
  getTransforms(): TransformOptions;
232
+ /**
233
+ * <zh/> 获取数据
234
+ *
235
+ * <en/> Get data
236
+ * @returns <zh/> 数据 | <en/> data
237
+ * @apiCategory data
238
+ */
121
239
  getData(): GraphData;
240
+ /**
241
+ * <zh/> 获取所有节点数据
242
+ *
243
+ * <en/> Get all node data
244
+ * @returns <zh/> 节点数据 | <en/> node data
245
+ * @apiCategory data
246
+ */
122
247
  getNodeData(): NodeData[];
248
+ /**
249
+ * <zh/> 获取单个节点数据
250
+ *
251
+ * <en/> Get single node data
252
+ * @param id - <zh/> 节点 ID | <en/> node ID
253
+ * @returns <zh/> 节点数据 | <en/> node data
254
+ * @apiCategory data
255
+ */
123
256
  getNodeData(id: ID): NodeData;
257
+ /**
258
+ * <zh/> 批量获取多个节点数据
259
+ *
260
+ * <en/> Get multiple node data in batch
261
+ * @param ids - <zh/> 节点 ID 数组 | <en/> node ID array
262
+ * @returns <zh/> 节点数据 | <en/> node data
263
+ * @apiCategory data
264
+ */
124
265
  getNodeData(ids: ID[]): NodeData[];
266
+ /**
267
+ * <zh/> 获取所有边数据
268
+ *
269
+ * <en/> Get all edge data
270
+ * @returns <zh/> 边数据 | <en/> edge data
271
+ * @apiCategory data
272
+ */
125
273
  getEdgeData(): EdgeData[];
274
+ /**
275
+ * <zh/> 获取单条边数据
276
+ *
277
+ * <en/> Get single edge data
278
+ * @param id - <zh/> 边 ID | <en/> edge ID
279
+ * @returns <zh/> 边数据 | <en/> edge data
280
+ * @apiCategory data
281
+ */
126
282
  getEdgeData(id: ID): EdgeData;
283
+ /**
284
+ * <zh/> 批量获取多条边数据
285
+ *
286
+ * <en/> Get multiple edge data in batch
287
+ * @param ids - <zh/> 边 ID 数组 | <en/> edge ID array
288
+ * @returns <zh/> 边数据 | <en/> edge data
289
+ * @apiCategory data
290
+ */
127
291
  getEdgeData(ids: ID[]): EdgeData[];
292
+ /**
293
+ * <zh/> 获取所有组合数据
294
+ *
295
+ * <en/> Get all combo data
296
+ * @returns <zh/> 组合数据 | <en/> combo data
297
+ * @apiCategory data
298
+ */
128
299
  getComboData(): ComboData[];
300
+ /**
301
+ * <zh/> 获取单个组合数据
302
+ *
303
+ * <en/> Get single combo data
304
+ * @param id - <zh/> 组合ID | <en/> combo ID
305
+ * @returns <zh/> 组合数据 | <en/> combo data
306
+ * @apiCategory data
307
+ */
129
308
  getComboData(id: ID): ComboData;
309
+ /**
310
+ * <zh/> 批量获取多个组合数据
311
+ *
312
+ * <en/> Get multiple combo data in batch
313
+ * @param ids - <zh/> 组合ID 数组 | <en/> combo ID array
314
+ * @returns <zh/> 组合数据 | <en/> combo data
315
+ * @apiCategory data
316
+ */
130
317
  getComboData(ids: ID[]): ComboData[];
318
+ /**
319
+ * <zh/> 设置全量数据
320
+ *
321
+ * <en/> Set full data
322
+ * @param data - <zh/> 数据 | <en/> data
323
+ * @apiCategory data
324
+ */
131
325
  setData(data: CallableValue<GraphData>): void;
326
+ /**
327
+ * <zh/> 新增元素数据
328
+ *
329
+ * <en/> Add element data
330
+ * @param data - <zh/> 元素数据 | <en/> element data
331
+ * @apiCategory data
332
+ */
132
333
  addData(data: CallableValue<GraphData>): void;
334
+ /**
335
+ * <zh/> 新增节点数据
336
+ *
337
+ * <en/> Add node data
338
+ * @param data - <zh/> 节点数据 | <en/> node data
339
+ * @apiCategory data
340
+ */
133
341
  addNodeData(data: CallableValue<NodeData[]>): void;
342
+ /**
343
+ * <zh/> 新增边数据
344
+ *
345
+ * <en/> Add edge data
346
+ * @param data - <zh/> 边数据 | <en/> edge data
347
+ * @apiCategory data
348
+ */
134
349
  addEdgeData(data: CallableValue<EdgeData[]>): void;
350
+ /**
351
+ * <zh/> 新增组合数据
352
+ *
353
+ * <en/> Add combo data
354
+ * @param data - <zh/> 组合数据 | <en/> combo data
355
+ * @apiCategory data
356
+ */
135
357
  addComboData(data: CallableValue<ComboData[]>): void;
358
+ /**
359
+ * <zh/> 更新元素数据
360
+ *
361
+ * <en/> Update element data
362
+ * @param data - <zh/> 元素数据 | <en/> element data
363
+ * @apiCategory data
364
+ */
136
365
  updateData(data: CallableValue<PartialGraphData>): void;
366
+ /**
367
+ * <zh/> 更新节点数据
368
+ *
369
+ * <en/> Update node data
370
+ * @param data - <zh/> 节点数据 | <en/> node data
371
+ * @apiCategory data
372
+ */
137
373
  updateNodeData(data: CallableValue<PartialNodeLikeData<NodeData>[]>): void;
374
+ /**
375
+ * <zh/> 更新边数据
376
+ *
377
+ * <en/> Update edge data
378
+ * @param data - <zh/> 边数据 | <en/> edge data
379
+ * @apiCategory data
380
+ */
138
381
  updateEdgeData(data: CallableValue<PartialEdgeData<EdgeData>[]>): void;
382
+ /**
383
+ * <zh/> 更新 组合数据
384
+ *
385
+ * <en/> Update combo data
386
+ * @param data - <zh/> 组合数据 | <en/> combo data
387
+ * @apiCategory data
388
+ */
139
389
  updateComboData(data: CallableValue<PartialNodeLikeData<ComboData>[]>): void;
140
- removeData(id: DataID | ((data: GraphData) => DataID)): void;
390
+ /**
391
+ * <zh/> 删除多条元素数据
392
+ *
393
+ * <en/> Remove multiple element data
394
+ * @param ids - <zh/> 元素 ID 数组 | <en/> element ID array
395
+ * @apiCategory data
396
+ */
397
+ removeData(ids: DataID | ((data: GraphData) => DataID)): void;
398
+ /**
399
+ * <zh/> 删除多条节点数据
400
+ *
401
+ * <en/> Remove multiple node data
402
+ * @param ids - <zh/> 节点 ID 数组 | <en/> node ID array
403
+ * @apiCategory data
404
+ */
141
405
  removeNodeData(ids: ID[] | ((data: NodeData[]) => ID[])): void;
406
+ /**
407
+ * <zh/> 删除多条边数据
408
+ *
409
+ * <en/> Remove multiple edge data
410
+ * @param ids - <zh/> 边 ID 数组 | <en/> edge ID array
411
+ * @apiCategory data
412
+ */
142
413
  removeEdgeData(ids: ID[] | ((data: EdgeData[]) => ID[])): void;
414
+ /**
415
+ * <zh/> 删除多条组合数据
416
+ *
417
+ * <en/> Remove multiple combo data
418
+ * @param ids - <zh/> 组合 ID 数组 | <en/> 组合 ID array
419
+ * @apiCategory data
420
+ */
143
421
  removeComboData(ids: ID[] | ((data: ComboData[]) => ID[])): void;
422
+ /**
423
+ * <zh/> 获取元素类型
424
+ *
425
+ * <en/> Get element type
426
+ * @param id - <zh/> 元素 ID | <en/> element ID
427
+ * @returns <zh/> 元素类型 | <en/> element type
428
+ * @apiCategory element
429
+ */
144
430
  getElementType(id: ID): ElementType;
431
+ /**
432
+ * <zh/> 获取节点或组合相关的边数据
433
+ *
434
+ * <en/> Get the edge data related to the node or combo
435
+ * @param id - <zh/> 节点或组合ID | <en/> node or combo ID
436
+ * @param direction - <zh/> 边的方向 | <en/> edge direction
437
+ * @returns <zh/> 边数据 | <en/> edge data
438
+ * @apiCategory data
439
+ */
145
440
  getRelatedEdgesData(id: ID, direction?: EdgeDirection): EdgeData[];
441
+ /**
442
+ * <zh/> 获取节点或组合的一跳邻居节点数据
443
+ *
444
+ * <en/> Get the one-hop neighbor node data of the node or combo
445
+ * @param id - <zh/> 节点或组合ID | <en/> node or combo ID
446
+ * @returns <zh/> 邻居节点数据 | <en/> neighbor node data
447
+ * @apiCategory data
448
+ */
146
449
  getNeighborNodesData(id: ID): NodeData[];
147
450
  /**
148
- * <zh/> 获取节点或 combo 的祖先元素数据
451
+ * <zh/> 获取节点或组合的祖先元素数据
149
452
  *
150
453
  * <en/> Get the ancestor element data of the node or combo
151
- * @param id - <zh/> 节点或 combo ID | <en/> node or combo ID
152
- * @param hierarchy - <zh/> 指定树图层级关系还是 combo 层级关系 | <en/> specify tree or combo hierarchy relationship
454
+ * @param id - <zh/> 节点或组合ID | <en/> node or combo ID
455
+ * @param hierarchy - <zh/> 指定树图层级关系还是组合层级关系 | <en/> specify tree or combo hierarchy relationship
153
456
  * @returns <zh/> 祖先元素数据 | <en/> ancestor element data
154
- * @description
457
+ * @remarks
155
458
  * <zh/> 数组中的顺序是从父节点到祖先节点
156
459
  *
157
460
  * <en/> The order in the array is from the parent node to the ancestor node
461
+ * @apiCategory data
158
462
  */
159
463
  getAncestorsData(id: ID, hierarchy: HierarchyKey): NodeLikeData[];
160
464
  /**
161
- * <zh/> 获取节点或 combo 的父元素数据
465
+ * <zh/> 获取节点或组合的父元素数据
162
466
  *
163
467
  * <en/> Get the parent element data of the node or combo
164
- * @param id - <zh/> 节点或 combo ID | <en/> node or combo ID
165
- * @param hierarchy - <zh/> 指定树图层级关系还是 combo 层级关系 | <en/> specify tree or combo hierarchy relationship
468
+ * @param id - <zh/> 节点或组合ID | <en/> node or combo ID
469
+ * @param hierarchy - <zh/> 指定树图层级关系还是组合层级关系 | <en/> specify tree or combo hierarchy relationship
166
470
  * @returns <zh/> 父元素数据 | <en/> parent element data
471
+ * @apiCategory data
167
472
  */
168
473
  getParentData(id: ID, hierarchy: HierarchyKey): NodeLikeData | undefined;
169
474
  /**
170
- * <zh/> 获取节点或 combo 的子元素数据
475
+ * <zh/> 获取节点或组合的子元素数据
171
476
  *
172
477
  * <en/> Get the child element data of the node or combo
173
- * @param id - <zh/> 节点或 combo ID | <en/> node or combo ID
478
+ * @param id - <zh/> 节点或组合ID | <en/> node or combo ID
174
479
  * @returns <zh/> 子元素数据 | <en/> child element data
480
+ * @apiCategory data
175
481
  */
176
482
  getChildrenData(id: ID): NodeLikeData[];
483
+ /**
484
+ * <zh/> 获取具体某一状态下的节点数据
485
+ *
486
+ * <en/> Get node data in a specific state
487
+ * @param state - <zh/> 状态 | <en/> state
488
+ * @returns <zh/> 节点数据 | <en/> node data
489
+ * @apiCategory data
490
+ */
177
491
  getElementDataByState(elementType: 'node', state: State): NodeData[];
492
+ /**
493
+ * <zh/> 获取具体某一状态下的边数据
494
+ *
495
+ * <en/> Get edge data in a specific state
496
+ * @param state - <zh/> 状态 | <en/> state
497
+ * @returns <zh/> 边数据 | <en/> edge data
498
+ * @apiCategory data
499
+ */
178
500
  getElementDataByState(elementType: 'edge', state: State): EdgeData[];
501
+ /**
502
+ * <zh/> 获取具体某一状态下的组合数据
503
+ *
504
+ * <en/> Get combo data in a specific state
505
+ * @param state - <zh/> 状态 | <en/> state
506
+ * @returns <zh/> 组合数据 | <en/> combo data
507
+ * @apiCategory data
508
+ */
179
509
  getElementDataByState(elementType: 'combo', state: State): ComboData[];
180
510
  private initCanvas;
181
- private createRuntime;
511
+ private initRuntime;
182
512
  private prepare;
183
513
  /**
184
514
  * <zh/> 执行渲染
185
515
  *
186
516
  * <en/> Render
187
- * @description
517
+ * @remarks
188
518
  * <zh/> 此过程会执行数据更新、绘制元素、执行布局
189
519
  *
190
520
  * <en/> This process will execute data update, element rendering, and layout execution
521
+ * @apiCategory render
191
522
  */
192
523
  render(): Promise<void>;
193
524
  /**
@@ -195,19 +526,64 @@ export declare class Graph extends EventEmitter {
195
526
  *
196
527
  * <en/> Draw elements
197
528
  * @returns <zh/> 渲染结果 | <en/> draw result
529
+ * @apiCategory element
198
530
  */
199
531
  draw(): Promise<void>;
200
- layout(): Promise<void>;
532
+ /**
533
+ * <zh/> 执行布局
534
+ *
535
+ * <en/> Execute layout
536
+ * @apiCategory layout
537
+ */
538
+ layout(): void;
539
+ /**
540
+ * <zh/> 停止布局
541
+ *
542
+ * <en/> Stop layout
543
+ * @remarks
544
+ * <zh/> 适用于带有迭代动画的布局,目前有 `force` 属于此类布局,即停止力导布局的迭代,一般用于布局迭代时间过长情况下的手动停止迭代动画,例如在点击画布/节点的监听中调用
545
+ *
546
+ * <en/> Suitable for layouts with iterative animations. Currently, `force` belongs to this type of layout, that is, stop the iteration of the force-directed layout. It is generally used to manually stop the iteration animation when the layout iteration time is too long, such as calling in the click canvas/node listener
547
+ * @apiCategory layout
548
+ */
201
549
  stopLayout(): void;
202
550
  /**
203
551
  * <zh/> 清空画布元素
204
552
  *
205
553
  * <en/> Clear canvas elements
554
+ * @apiCategory canvas
206
555
  */
207
556
  clear(): Promise<void>;
557
+ /**
558
+ * <zh/> 销毁当前图实例
559
+ *
560
+ * <en/> Destroy the current graph instance
561
+ * @apiCategory instance
562
+ */
208
563
  destroy(): void;
564
+ /**
565
+ * <zh/> 获取画布实例
566
+ *
567
+ * <en/> Get canvas instance
568
+ * @returns - <zh/> 画布实例 | <en/> canvas instance
569
+ * @apiCategory canvas
570
+ */
209
571
  getCanvas(): Canvas;
572
+ /**
573
+ * <zh/> 调整画布大小为图容器大小
574
+ *
575
+ * <en/> Resize the canvas to the size of the graph container
576
+ * @apiCategory viewport
577
+ */
210
578
  resize(): void;
579
+ /**
580
+ * <zh/> 调整画布大小为指定宽高
581
+ *
582
+ * <en/> Resize the canvas to the specified width and height
583
+ * @param width - <zh/> 宽度 | <en/> width
584
+ * @param height - <zh/> 高度 | <en/> height
585
+ * @apiCategory viewport
586
+ */
211
587
  resize(width: number, height: number): void;
212
588
  /**
213
589
  * <zh/> 将图缩放至合适大小并平移至视口中心
@@ -215,6 +591,7 @@ export declare class Graph extends EventEmitter {
215
591
  * <en/> Zoom the graph to fit the viewport and move it to the center of the viewport
216
592
  * @param options - <zh/> 适配配置 | <en/> fit options
217
593
  * @param animation - <zh/> 动画配置 | <en/> animation configuration
594
+ * @apiCategory viewport
218
595
  */
219
596
  fitView(options?: FitViewOptions, animation?: ViewportAnimationEffectTiming): Promise<void>;
220
597
  /**
@@ -222,9 +599,18 @@ export declare class Graph extends EventEmitter {
222
599
  *
223
600
  * <en/> Move the graph to the center of the viewport
224
601
  * @param animation - <zh/> 动画配置 | <en/> animation configuration
602
+ * @apiCategory viewport
225
603
  */
226
604
  fitCenter(animation?: ViewportAnimationEffectTiming): Promise<void>;
227
605
  private autoFit;
606
+ /**
607
+ * <zh/> 移动图,使得元素对齐到视口中心
608
+ *
609
+ * <en/> Move the graph so that the element is aligned to the center of the viewport
610
+ * @param id - <zh/> 元素 ID | <en/> element ID
611
+ * @param animation - <zh/> 动画配置 | <en/> animation configuration
612
+ * @apiCategory viewport
613
+ */
228
614
  focusElement(id: ID | ID[], animation?: ViewportAnimationEffectTiming): Promise<void>;
229
615
  /**
230
616
  * <zh/> 基于当前缩放比例进行缩放
@@ -233,13 +619,15 @@ export declare class Graph extends EventEmitter {
233
619
  * @param ratio - <zh/> 缩放比例 | <en/> zoom ratio
234
620
  * @param animation - <zh/> 动画配置 | <en/> animation configuration
235
621
  * @param origin - <zh/> 缩放中心(视口坐标) | <en/> zoom center(viewport coordinates)
236
- * @description
622
+ * @remarks
237
623
  * <zh/>
238
624
  * - ratio > 1 放大
239
625
  * - ratio < 1 缩小
626
+ *
240
627
  * <en/>
241
628
  * - ratio > 1 zoom in
242
629
  * - ratio < 1 zoom out
630
+ * @apiCategory viewport
243
631
  */
244
632
  zoomBy(ratio: number, animation?: ViewportAnimationEffectTiming, origin?: Point): Promise<void>;
245
633
  /**
@@ -249,15 +637,17 @@ export declare class Graph extends EventEmitter {
249
637
  * @param zoom - <zh/> 指定缩放比例 | <en/> specified zoom ratio
250
638
  * @param animation - <zh/> 动画配置 | <en/> animation configuration
251
639
  * @param origin - <zh/> 缩放中心(视口坐标) | <en/> zoom center(viewport coordinates)
252
- * @description
640
+ * @remarks
253
641
  * <zh/>
254
642
  * - zoom = 1 默认大小
255
643
  * - zoom > 1 放大
256
644
  * - zoom < 1 缩小
645
+ *
257
646
  * <en/>
258
647
  * - zoom = 1 default size
259
648
  * - zoom > 1 zoom in
260
649
  * - zoom < 1 zoom out
650
+ * @apiCategory viewport
261
651
  */
262
652
  zoomTo(zoom: number, animation?: ViewportAnimationEffectTiming, origin?: Point): Promise<void>;
263
653
  /**
@@ -265,6 +655,7 @@ export declare class Graph extends EventEmitter {
265
655
  *
266
656
  * <en/> Get the current zoom ratio
267
657
  * @returns <zh/> 缩放比例 | <en/> zoom ratio
658
+ * @apiCategory viewport
268
659
  */
269
660
  getZoom(): number;
270
661
  /**
@@ -274,6 +665,7 @@ export declare class Graph extends EventEmitter {
274
665
  * @param angle - <zh/> 旋转角度 | <en/> rotation angle
275
666
  * @param animation - <zh/> 动画配置 | <en/> animation configuration
276
667
  * @param origin - <zh/> 旋转中心(视口坐标) | <en/> rotation center(viewport coordinates)
668
+ * @apiCategory viewport
277
669
  */
278
670
  rotateBy(angle: number, animation?: ViewportAnimationEffectTiming, origin?: Point): Promise<void>;
279
671
  /**
@@ -283,6 +675,7 @@ export declare class Graph extends EventEmitter {
283
675
  * @param angle - <zh/> 目标角度 | <en/> target angle
284
676
  * @param animation - <zh/> 动画配置 | <en/> animation configuration
285
677
  * @param origin - <zh/> 旋转中心(视口坐标) | <en/> rotation center(viewport coordinates)
678
+ * @apiCategory viewport
286
679
  */
287
680
  rotateTo(angle: number, animation?: ViewportAnimationEffectTiming, origin?: Point): Promise<void>;
288
681
  /**
@@ -290,6 +683,7 @@ export declare class Graph extends EventEmitter {
290
683
  *
291
684
  * <en/> Get the current rotation angle
292
685
  * @returns <zh/> 旋转角度 | <en/> rotation angle
686
+ * @apiCategory viewport
293
687
  */
294
688
  getRotation(): number;
295
689
  /**
@@ -298,6 +692,7 @@ export declare class Graph extends EventEmitter {
298
692
  * <en/> Translate the graph by the specified distance
299
693
  * @param offset - <zh/> 偏移量 | <en/> offset
300
694
  * @param animation - <zh/> 动画配置 | <en/> animation configuration
695
+ * @apiCategory viewport
301
696
  */
302
697
  translateBy(offset: Point, animation?: ViewportAnimationEffectTiming): Promise<void>;
303
698
  /**
@@ -306,7 +701,7 @@ export declare class Graph extends EventEmitter {
306
701
  * <en/> Translate the graph to the specified position
307
702
  * @param position - <zh/> 指定位置 | <en/> specified position
308
703
  * @param animation - <zh/> 动画配置 | <en/> animation configuration
309
- * @description
704
+ * @apiCategory viewport
310
705
  */
311
706
  translateTo(position: Point, animation?: ViewportAnimationEffectTiming): Promise<void>;
312
707
  /**
@@ -314,10 +709,11 @@ export declare class Graph extends EventEmitter {
314
709
  *
315
710
  * <en/> Get the position of the graph
316
711
  * @returns <zh/> 图的位置 | <en/> position of the graph
317
- * @description
712
+ * @remarks
318
713
  * <zh/> 默认状态下,图的位置为 [0, 0]
319
714
  *
320
715
  * <en/> By default, the position of the graph is [0, 0]
716
+ * @apiCategory viewport
321
717
  */
322
718
  getPosition(): Point;
323
719
  /**
@@ -326,7 +722,8 @@ export declare class Graph extends EventEmitter {
326
722
  * <en/> Translate the element by the specified distance
327
723
  * @param id - <zh/> 元素 ID | <en/> element ID
328
724
  * @param offset - <zh/> 偏移量 | <en/> offset
329
- * @param animation - <zh/> 动画配置 | <en/> animation configuration
725
+ * @param animation - <zh/> 是否启用动画 | <en/> whether to enable animation
726
+ * @apiCategory element
330
727
  */
331
728
  translateElementBy(id: ID, offset: Position, animation?: boolean): Promise<void>;
332
729
  /**
@@ -334,7 +731,8 @@ export declare class Graph extends EventEmitter {
334
731
  *
335
732
  * <en/> Batch translate elements by the specified distance
336
733
  * @param offsets - <zh/> 偏移量配置 | <en/> offset configuration
337
- * @param animation - <zh/> 动画配置 | <en/> animation configuration
734
+ * @param animation - <zh/> 是否启用动画 | <en/> whether to enable animation
735
+ * @apiCategory element
338
736
  */
339
737
  translateElementBy(offsets: Record<ID, Position>, animation?: boolean): Promise<void>;
340
738
  /**
@@ -343,7 +741,8 @@ export declare class Graph extends EventEmitter {
343
741
  * <en/> Translate the element to the specified position
344
742
  * @param id - <zh/> 元素 ID | <en/> element ID
345
743
  * @param position - <zh/> 指定位置 | <en/> specified position
346
- * @param animation - <zh/> 动画配置 | <en/> animation configuration
744
+ * @param animation - <zh/> 是否启用动画 | <en/> whether to enable animation
745
+ * @apiCategory element
347
746
  */
348
747
  translateElementTo(id: ID, position: Position, animation?: boolean): Promise<void>;
349
748
  /**
@@ -351,10 +750,27 @@ export declare class Graph extends EventEmitter {
351
750
  *
352
751
  * <en/> Batch translate elements to the specified position
353
752
  * @param positions - <zh/> 位置配置 | <en/> position configuration
354
- * @param animation - <zh/> 动画配置 | <en/> animation configuration
753
+ * @param animation - <zh/> 是否启用动画 | <en/> whether to enable animation
754
+ * @apiCategory element
355
755
  */
356
756
  translateElementTo(positions: Record<ID, Position>, animation?: boolean): Promise<void>;
757
+ /**
758
+ * <zh/> 获取元素位置
759
+ *
760
+ * <en/> Get element position
761
+ * @param id - <zh/> 元素 ID | <en/> element ID
762
+ * @returns <zh/> 元素位置 | <en/> element position
763
+ * @apiCategory element
764
+ */
357
765
  getElementPosition(id: ID): Position;
766
+ /**
767
+ * <zh/> 获取元素渲染样式
768
+ *
769
+ * <en/> Get element rendering style
770
+ * @param id - <zh/> 元素 ID | <en/> element ID
771
+ * @returns <zh/> 元素渲染样式 | <en/> element rendering style
772
+ * @apiCategory element
773
+ */
358
774
  getElementRenderStyle(id: ID): import("@antv/util/lib/lodash/types").ObjectType<unknown>;
359
775
  /**
360
776
  * <zh/> 设置元素可见性
@@ -363,6 +779,7 @@ export declare class Graph extends EventEmitter {
363
779
  * @param id - <zh/> 元素 ID | <en/> element ID
364
780
  * @param visibility - <zh/> 可见性 | <en/> visibility
365
781
  * @param animation - <zh/> 动画配置 | <en/> animation configuration
782
+ * @apiCategory element
366
783
  */
367
784
  setElementVisibility(id: ID, visibility: BaseStyleProps['visibility'], animation?: boolean): Promise<void>;
368
785
  /**
@@ -371,6 +788,7 @@ export declare class Graph extends EventEmitter {
371
788
  * <en/> Batch set element visibility
372
789
  * @param visibility - <zh/> 可见性配置 | <en/> visibility configuration
373
790
  * @param animation - <zh/> 动画配置 | <en/> animation configuration
791
+ * @apiCategory element
374
792
  */
375
793
  setElementVisibility(visibility: Record<ID, BaseStyleProps['visibility']>, animation?: boolean): Promise<void>;
376
794
  /**
@@ -378,7 +796,8 @@ export declare class Graph extends EventEmitter {
378
796
  *
379
797
  * <en/> Show element
380
798
  * @param id - <zh/> 元素 ID | <en/> element ID
381
- * @param animation - <zh/> 动画配置 | <en/> animation configuration
799
+ * @param animation - <zh/> 是否启用动画 | <en/> whether to enable animation
800
+ * @apiCategory element
382
801
  */
383
802
  showElement(id: ID | ID[], animation?: boolean): Promise<void>;
384
803
  /**
@@ -386,7 +805,8 @@ export declare class Graph extends EventEmitter {
386
805
  *
387
806
  * <en/> Hide element
388
807
  * @param id - <zh/> 元素 ID | <en/> element ID
389
- * @param animation - <zh/> 动画配置 | <en/> animation configuration
808
+ * @param animation - <zh/> 是否启用动画 | <en/> whether to enable animation
809
+ * @apiCategory element
390
810
  */
391
811
  hideElement(id: ID | ID[], animation?: boolean): Promise<void>;
392
812
  /**
@@ -395,6 +815,7 @@ export declare class Graph extends EventEmitter {
395
815
  * <en/> Get element visibility
396
816
  * @param id - <zh/> 元素 ID | <en/> element ID
397
817
  * @returns <zh/> 元素可见性 | <en/> element visibility
818
+ * @apiCategory element
398
819
  */
399
820
  getElementVisibility(id: ID): BaseStyleProps['visibility'];
400
821
  /**
@@ -403,6 +824,7 @@ export declare class Graph extends EventEmitter {
403
824
  * <en/> Set element z-index
404
825
  * @param id - <zh/> 元素 ID | <en/> element ID
405
826
  * @param zIndex - <zh/> 层级 | <en/> z-index
827
+ * @apiCategory element
406
828
  */
407
829
  setElementZIndex(id: ID, zIndex: number): Promise<void>;
408
830
  /**
@@ -410,6 +832,7 @@ export declare class Graph extends EventEmitter {
410
832
  *
411
833
  * <en/> Batch set element z-index
412
834
  * @param zIndex - <zh/> 层级配置 | <en/> z-index configuration
835
+ * @apiCategory element
413
836
  */
414
837
  setElementZIndex(zIndex: Record<ID, number>): Promise<void>;
415
838
  /**
@@ -417,6 +840,7 @@ export declare class Graph extends EventEmitter {
417
840
  *
418
841
  * <en/> Bring the element to the front
419
842
  * @param id - <zh/> 元素 ID | <en/> element ID
843
+ * @apiCategory element
420
844
  */
421
845
  frontElement(id: ID | ID[]): Promise<void>;
422
846
  /**
@@ -425,6 +849,7 @@ export declare class Graph extends EventEmitter {
425
849
  * <en/> Get element z-index
426
850
  * @param id - <zh/> 元素 ID | <en/> element ID
427
851
  * @returns <zh/> 元素层级 | <en/> element z-index
852
+ * @apiCategory element
428
853
  */
429
854
  getElementZIndex(id: ID): number;
430
855
  /**
@@ -434,6 +859,7 @@ export declare class Graph extends EventEmitter {
434
859
  * @param id - <zh/> 元素 ID | <en/> element ID
435
860
  * @param state - <zh/> 状态 | <en/> state
436
861
  * @param animation - <zh/> 动画配置 | <en/> animation configuration
862
+ * @apiCategory element
437
863
  */
438
864
  setElementState(id: ID, state: State | State[], animation?: boolean): Promise<void>;
439
865
  /**
@@ -442,6 +868,7 @@ export declare class Graph extends EventEmitter {
442
868
  * <en/> Batch set element state
443
869
  * @param state - <zh/> 状态配置 | <en/> state configuration
444
870
  * @param animation - <zh/> 动画配置 | <en/> animation configuration
871
+ * @apiCategory element
445
872
  */
446
873
  setElementState(state: Record<ID, State | State[]>, animation?: boolean): Promise<void>;
447
874
  /**
@@ -450,39 +877,97 @@ export declare class Graph extends EventEmitter {
450
877
  * <en/> Get element state
451
878
  * @param id - <zh/> 元素 ID | <en/> element ID
452
879
  * @returns <zh/> 元素状态 | <en/> element state
880
+ * @apiCategory element
453
881
  */
454
882
  getElementState(id: ID): State[];
883
+ /**
884
+ * <zh/> 获取元素自身以及子节点在世界坐标系下的渲染包围盒
885
+ *
886
+ * <en/> Get the rendering bounding box of the element itself and its child nodes in the world coordinate system
887
+ * @param id - <zh/> 元素 ID | <en/> element ID
888
+ * @returns <zh/> 渲染包围盒 | <en/> render bounding box
889
+ * @apiCategory element
890
+ */
455
891
  getElementRenderBounds(id: ID): AABB;
456
- collapse(id: ID, animation?: boolean): Promise<void>;
457
- expand(id: ID, animation?: boolean): Promise<void>;
892
+ /**
893
+ * <zh/> 收起 Combo
894
+ *
895
+ * <en/> Collapse Combo
896
+ * @param id - <zh/> 元素 ID | <en/> element ID
897
+ * @param animation - <zh/> 是否启用动画 | <en/> whether to enable animation
898
+ * @apiCategory element
899
+ */
900
+ collapseElement(id: ID, animation?: boolean): Promise<void>;
901
+ /**
902
+ * <zh/> 展开 Combo
903
+ *
904
+ * <en/> Expand Combo
905
+ * @param id - <zh/> 元素 ID | <en/> element ID
906
+ * @param animation - <zh/> 是否启用动画 | <en/> whether to enable animation
907
+ * @apiCategory element
908
+ */
909
+ expandElement(id: ID, animation?: boolean): Promise<void>;
458
910
  private setElementCollapsibility;
459
911
  /**
460
912
  * <zh/> 导出画布内容为 DataURL
461
913
  *
462
914
  * <en/> Export canvas content as DataURL
463
915
  * @param options - <zh/> 导出配置 | <en/> export configuration
464
- * @param mode
465
- * <zh/> 导出模式
466
- * - viewport: 导出视口内容
467
- * - overall: 导出整个画布
468
- *
469
- * <en/> export mode
470
- * - viewport: export the content of the viewport
471
- * - overall: export the entire canvas
472
916
  * @returns <zh/> DataURL | <en/> DataURL
917
+ * @apiCategory exportImage
473
918
  */
474
919
  toDataURL(options?: Partial<DataURLOptions>): Promise<string>;
920
+ /**
921
+ * <zh/> 给定的视窗 DOM 坐标,转换为画布上的绘制坐标
922
+ *
923
+ * <en/> Convert the given viewport DOM coordinates to the drawing coordinates on the canvas
924
+ * @param point - <zh/> 视窗坐标 | <en/> viewport coordinates
925
+ * @returns <zh/> 画布上的绘制坐标 | <en/> drawing coordinates on the canvas
926
+ * @apiCategory viewport
927
+ */
475
928
  getCanvasByViewport(point: Point): Point;
929
+ /**
930
+ * <zh/> 给定画布上的绘制坐标,转换为视窗 DOM 的坐标
931
+ *
932
+ * <en/> Convert the given drawing coordinates on the canvas to the coordinates of the viewport DOM
933
+ * @param point - <zh/> 画布坐标 | <en/> canvas coordinates
934
+ * @returns <zh/> 视窗 DOM 的坐标 | <en/> coordinates of the viewport DOM
935
+ * @apiCategory viewport
936
+ */
476
937
  getViewportByCanvas(point: Point): Point;
938
+ /**
939
+ * <zh/> 给定画布上的绘制坐标,转换为浏览器坐标
940
+ *
941
+ * <en/> Convert the given drawing coordinates on the canvas to browser coordinates
942
+ * @param point - <zh/> 画布坐标 | <en/> canvas coordinates
943
+ * @returns <zh/> 浏览器坐标 | <en/> browser coordinates
944
+ * @apiCategory viewport
945
+ */
477
946
  getClientByCanvas(point: Point): Point;
947
+ /**
948
+ * <zh/> 给定的浏览器坐标,转换为画布上的绘制坐标
949
+ *
950
+ * <en/> Convert the given browser coordinates to drawing coordinates on the canvas
951
+ * @param point - <zh/> 浏览器坐标 | <en/> browser coordinates
952
+ * @returns <zh/> 画布上的绘制坐标 | <en/> drawing coordinates on the canvas
953
+ * @apiCategory viewport
954
+ */
478
955
  getCanvasByClient(point: Point): Point;
479
956
  /**
480
957
  * <zh/> 获取视口中心的画布坐标
481
958
  *
482
959
  * <en/> Get the canvas coordinates of the viewport center
483
960
  * @returns <zh/> 视口中心的画布坐标 | <en/> Canvas coordinates of the viewport center
961
+ * @apiCategory viewport
484
962
  */
485
963
  getViewportCenter(): Point;
964
+ /**
965
+ * <zh/> 获取画布中心的画布坐标
966
+ *
967
+ * <en/> Get the canvas coordinates of the canvas center
968
+ * @returns <zh/> 画布中心的画布坐标 | <en/> Canvas coordinates of the canvas center
969
+ * @apiCategory viewport
970
+ */
486
971
  getCanvasCenter(): Point;
487
972
  private onResize;
488
973
  /**
@@ -492,6 +977,7 @@ export declare class Graph extends EventEmitter {
492
977
  * @param eventName - <zh/> 事件名称 | <en/> event name
493
978
  * @param callback - <zh/> 回调函数 | <en/> callback function
494
979
  * @returns <zh/> Graph 实例 | <en/> Graph instance
980
+ * @apiCategory event
495
981
  */
496
982
  on<T extends IEvent = IEvent>(eventName: string, callback: (event: T) => void): this;
497
983
  /**
@@ -501,6 +987,7 @@ export declare class Graph extends EventEmitter {
501
987
  * @param eventName - <zh/> 事件名称 | <en/> event name
502
988
  * @param callback - <zh/> 回调函数 | <en/> callback function
503
989
  * @returns <zh/> Graph 实例 | <en/> Graph instance
990
+ * @apiCategory event
504
991
  */
505
992
  once<T extends IEvent = IEvent>(eventName: string, callback: (event: T) => void): this;
506
993
  }