@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,7 +1,6 @@
1
1
  import type { DisplayObject, IAnimation, IAnimationEffectTiming } from '@antv/g';
2
2
  import type { State } from '../types';
3
3
  /**
4
- * @description
5
4
  * <zh/> 为 string 时,会从注册的动画中获取
6
5
  *
7
6
  * <en/> When it is a string, it will be obtained from the registered animation
@@ -18,7 +17,7 @@ export interface AnimationContext {
18
17
  * <zh/> 动画的源样式
19
18
  *
20
19
  * <en/> Source style of animation
21
- * @description
20
+ * @remarks
22
21
  * <zh/> 用于在动画执行前将 shape 的样式设置为源样式,例如 move-to 动画,需要将 shape 的 x, y 设置为源样式
23
22
  *
24
23
  * <en/> Used to set the style of shape to the source style before the animation is executed. For example, the move-to animation needs to set the x and y of shape to the source style
@@ -28,7 +27,7 @@ export interface AnimationContext {
28
27
  * <zh/> 额外的动画终态样式
29
28
  *
30
29
  * <en/> Additional animation final state style
31
- * @description
30
+ * @remarks
32
31
  * <zh/> 例如元素销毁前,需要将元素的终态透明度设置为 0
33
32
  *
34
33
  * <en/> For example, before the element is destroyed, the final state opacity of the element needs to be set to 0
@@ -38,7 +37,7 @@ export interface AnimationContext {
38
37
  * <zh/> 动画配置过滤
39
38
  *
40
39
  * <en/> Animation configuration filter
41
- * @description
40
+ * @remarks
42
41
  * <zh/> 某些情况下,需要过滤掉一些动画配置,例如位移动画只会作用于元素根节点图形,不会作用于子图形。这项配置通常用于优化动画性能,避免不必要的动画执行
43
42
  *
44
43
  * <en/> In some cases, it is necessary to filter out some animation configurations. For example, the displacement animation will only affect the root node shape of the element, not the child shape. This configuration is usually used to optimize animation performance and avoid unnecessary animation execution
@@ -1,5 +1,6 @@
1
1
  import { BaseExtension } from '../registry/extension';
2
2
  import type { CustomBehaviorOption } from '../spec/behavior';
3
- export type BaseBehaviorOptions = CustomBehaviorOption;
3
+ export interface BaseBehaviorOptions extends CustomBehaviorOption {
4
+ }
4
5
  export declare abstract class BaseBehavior<T extends BaseBehaviorOptions> extends BaseExtension<T> {
5
6
  }
@@ -1,63 +1,74 @@
1
1
  import { Shortcut } from '../utils/shortcut';
2
2
  import { BaseBehavior } from './base-behavior';
3
- import type { ID } from '@antv/graphlib';
4
3
  import type { Graph } from '../runtime/graph';
5
4
  import type { RuntimeContext } from '../runtime/types';
6
5
  import type { NodeStyle } from '../spec/element/node';
7
- import type { ElementType, IPointerEvent, Points, State } from '../types';
6
+ import type { ElementType, ID, IPointerEvent, Points, State } from '../types';
8
7
  import type { ShortcutKey } from '../utils/shortcut';
9
8
  import type { BaseBehaviorOptions } from './base-behavior';
10
- type SELECT_MODE = 'union' | 'intersect' | 'diff' | 'default';
11
9
  export type States = Record<ID, State | State[]>;
10
+ /**
11
+ * <zh/> 框选配置项
12
+ *
13
+ * <en/> Brush select options
14
+ */
12
15
  export interface BrushSelectOptions extends BaseBehaviorOptions {
13
16
  /**
14
17
  * <zh/> 是否启用框选功能
15
18
  *
16
19
  * <en/> Whether to enable Brush select element function.
20
+ * @defaultValue true
17
21
  */
18
22
  enable?: boolean | ((event: IPointerEvent) => boolean);
19
23
  /**
20
24
  * <zh/> 可框选的元素类型
21
25
  *
22
26
  * <en/> Enable Elements type.
27
+ * @defaultValue ['node', 'combo', 'edge']
23
28
  */
24
29
  enableElements?: ElementType[];
25
30
  /**
26
31
  * <zh/> 是否启用动画
27
32
  *
28
33
  * <en/> Whether to enable animation.
34
+ * @defaultValue false
29
35
  */
30
36
  animation?: boolean;
31
37
  /**
32
38
  * <zh/> 交互配置 按键拖拽 或 直接拖拽
33
39
  *
34
40
  * <en/> Trigger click or drag.
41
+ * @defaultValue ['drag']
35
42
  */
36
43
  trigger?: ShortcutKey;
37
44
  /**
38
45
  * <zh/> 框选选中模式
39
- * union : 选中元素添加 state 状态
40
- * intersect : 进一步筛选已经 state 开启的元素
41
- * diff : 反转选中元素的 state 状态
42
- * default : 选中元素添加 state 状态, 其他元素 state 关闭
46
+ * - union : 选中元素添加 state 状态
47
+ * - intersect : 进一步筛选已经 state 开启的元素
48
+ * - diff : 反转选中元素的 state 状态
49
+ * - default : 选中元素添加 state 状态, 其他元素 state 关闭
43
50
  *
44
51
  * <en/> Box Select Select the mode.
45
- * union : Select element add state.
46
- * intersect : Further filter the elements that are already state enabled.
47
- * diff : Inverts the state of the selected element.
48
- * default : Check element state to turn on and other elements state to turn off.
52
+ * - union : Select element add state.
53
+ * - intersect : Further filter the elements that are already state enabled.
54
+ * - diff : Inverts the state of the selected element.
55
+ * - default : Check element state to turn on and other elements state to turn off.
56
+ * @defaultValue 'default'
49
57
  */
50
- mode?: SELECT_MODE;
58
+ mode?: 'union' | 'intersect' | 'diff' | 'default';
51
59
  /**
52
60
  * <zh/> 选中 state 状态
53
61
  *
54
62
  * <en/> Check state status.
63
+ * @defaultValue 'selected'
55
64
  */
56
- state?: 'selected' | 'active';
65
+ state?: State;
57
66
  /**
58
67
  * <zh/> 及时框选, 在框选模式为 default 时,才能使用
59
68
  *
69
+ // * TODO fixme
60
70
  * <en/> Timely screening.
71
+ * @defaultValue false
61
72
  */
62
73
  immediately?: boolean;
63
74
  /**
@@ -70,16 +81,23 @@ export interface BrushSelectOptions extends BaseBehaviorOptions {
70
81
  * <zh/> 框选元素状态回调。
71
82
  *
72
83
  * <en/> Callback when brush select elements.
84
+ * @param states - 选中的元素状态
85
+ * @returns 选中的元素状态
73
86
  */
74
87
  onSelect?: (states: States) => States;
75
88
  }
76
89
  export declare const DEFAULT_STYLE: {
77
90
  lineWidth: number;
78
- color: string;
91
+ fill: string;
79
92
  stroke: string;
80
93
  fillOpacity: number;
81
94
  zIndex: number;
82
95
  };
96
+ /**
97
+ * <zh/> 框选一组元素
98
+ *
99
+ * <en/> Brush select elements
100
+ */
83
101
  export declare class BrushSelect<T extends BaseBehaviorOptions = BrushSelectOptions> extends BaseBehavior<T> {
84
102
  static defaultOptions: Partial<BrushSelectOptions>;
85
103
  private startPoint?;
@@ -94,11 +112,10 @@ export declare class BrushSelect<T extends BaseBehaviorOptions = BrushSelectOpti
94
112
  clearSelected: () => void;
95
113
  updateElementState: (points: Points) => void;
96
114
  private clearBrush;
97
- getPointsSelectIds: (graph: Graph, points: Points, itemTypes: ElementType[]) => ID[];
115
+ getPointsSelectIds: (graph: Graph, points: Points, itemTypes: ElementType[]) => string[];
98
116
  isKeydown(): boolean | undefined;
99
117
  validate(event: IPointerEvent): any;
100
118
  bindEvents(): void;
101
119
  unbindEvents(): void;
102
120
  destroy(): void;
103
121
  }
104
- export {};
@@ -3,48 +3,60 @@ import type { IPointerEvent, State } from '../types';
3
3
  import type { ShortcutKey } from '../utils/shortcut';
4
4
  import type { BaseBehaviorOptions } from './base-behavior';
5
5
  import { BaseBehavior } from './base-behavior';
6
+ /**
7
+ * <zh/> 点击元素交互配置项
8
+ *
9
+ * <en/> Click element behavior options
10
+ */
6
11
  export interface ClickElementOptions extends BaseBehaviorOptions {
7
12
  /**
8
13
  * <zh/> 是否启用动画
9
14
  *
10
15
  * <en/> Whether to enable animation
16
+ * @defaultValue true
11
17
  */
12
18
  animation?: boolean;
13
19
  /**
14
20
  * <zh/> 是否启用点击元素的功能
15
21
  *
16
22
  * <en/> Whether to enable the function of clicking the element
23
+ * @defaultValue true
17
24
  */
18
25
  enable?: boolean | ((event: IPointerEvent) => boolean);
19
26
  /**
20
27
  * <zh/> 是否允许多选
21
28
  *
22
29
  * <en/> Whether to allow multiple selection
30
+ * @defaultValue false
23
31
  */
24
32
  multiple?: boolean;
25
33
  /**
26
34
  * <zh/> 按下该快捷键配合鼠标点击进行多选
27
35
  *
28
36
  * <en/> Press this shortcut key to apply multiple selection with mouse click
37
+ * @defaultValue ['shift']
29
38
  */
30
39
  trigger?: ShortcutKey;
31
40
  /**
32
- * <zh/> 选中时应用的状态,默认为 selected
41
+ * <zh/> 选中时应用的状态
33
42
  *
34
43
  * <en/> The state to be applied when select.
44
+ * @defaultValue 'selected'
35
45
  */
36
- selectedState: State;
46
+ selectedState?: State;
37
47
  /**
38
- * <zh/> 当有元素被选中时,其他未选中的元素应用的状态,默认为 undefined
48
+ * <zh/> 当有元素被选中时,其他未选中的元素应用的状态
39
49
  *
40
50
  * <en/> The state to be applied on other unselected elements when some elements are selected
51
+ * @defaultValue undefined
41
52
  */
42
- unselectedState: State;
53
+ unselectedState?: State;
43
54
  /**
44
55
  * <zh/> 选中元素的度,即决定了影响范围
45
56
  *
46
57
  * <en/> The degree to determine the scope of influence
47
- * @description
58
+ * @defaultValue 0
59
+ * @remarks
48
60
  * <zh/> 对于节点来说,
49
61
  * - 0 表示只选中当前节点
50
62
  * - 1 表示选中当前节点及其直接相邻的节点和边,以此类推
@@ -61,6 +73,17 @@ export interface ClickElementOptions extends BaseBehaviorOptions {
61
73
  */
62
74
  degree?: number;
63
75
  }
76
+ /**
77
+ * <zh/> 点击元素
78
+ *
79
+ * <en/> Click Element
80
+ * @remarks
81
+ * ```typescript
82
+ * const graph = new Graph({
83
+ * behaviors: ['click-element'],
84
+ * });
85
+ * ```
86
+ */
64
87
  export declare class ClickElement extends BaseBehavior<ClickElementOptions> {
65
88
  private selectedElementIds;
66
89
  private shortcut;
@@ -1,6 +1,5 @@
1
- import type { ID } from '@antv/graphlib';
2
1
  import type { RuntimeContext } from '../runtime/types';
3
- import type { IPointerEvent } from '../types';
2
+ import type { ID, IPointerEvent } from '../types';
4
3
  import type { BaseBehaviorOptions } from './base-behavior';
5
4
  import { BaseBehavior } from './base-behavior';
6
5
  export interface CollapseExpandOptions extends BaseBehaviorOptions {
@@ -8,12 +7,14 @@ export interface CollapseExpandOptions extends BaseBehaviorOptions {
8
7
  * <zh/> 是否启用动画
9
8
  *
10
9
  * <en/> Whether to enable animation
10
+ * @defaultValue true
11
11
  */
12
12
  animation: boolean;
13
13
  /**
14
14
  * <zh/> 是否启用展开/收起功能
15
15
  *
16
16
  * <en/> Whether to enable the expand/collapse function
17
+ * @defaultValue true
17
18
  */
18
19
  enable?: boolean | ((event: IPointerEvent) => boolean);
19
20
  /**
@@ -1,8 +1,7 @@
1
- import type { ID } from '@antv/graphlib';
2
1
  import type { RuntimeContext } from '../runtime/types';
3
2
  import type { EdgeData } from '../spec';
4
3
  import type { EdgeStyle } from '../spec/element/edge';
5
- import type { IPointerEvent } from '../types';
4
+ import type { ID, IPointerEvent } from '../types';
6
5
  import type { BaseBehaviorOptions } from './base-behavior';
7
6
  import { BaseBehavior } from './base-behavior';
8
7
  export interface CreateEdgeOptions extends BaseBehaviorOptions {
@@ -3,6 +3,11 @@ import type { IKeyboardEvent, IPointerEvent, Vector2, ViewportAnimationEffectTim
3
3
  import type { ShortcutKey } from '../utils/shortcut';
4
4
  import type { BaseBehaviorOptions } from './base-behavior';
5
5
  import { BaseBehavior } from './base-behavior';
6
+ /**
7
+ * <zh/> 拖拽画布交互配置项
8
+ *
9
+ * <en/> Drag canvas behavior options
10
+ */
6
11
  export interface DragCanvasOptions extends BaseBehaviorOptions {
7
12
  /**
8
13
  * <zh/> 是否启用拖拽动画,仅在使用按键移动时有效
@@ -14,6 +19,7 @@ export interface DragCanvasOptions extends BaseBehaviorOptions {
14
19
  * <zh/> 是否启用拖拽画布的功能
15
20
  *
16
21
  * <en/> Whether to enable the function of dragging the canvas
22
+ * @defaultValue true
17
23
  */
18
24
  enable?: boolean | ((event: IPointerEvent | IKeyboardEvent) => boolean);
19
25
  /**
@@ -26,6 +32,7 @@ export interface DragCanvasOptions extends BaseBehaviorOptions {
26
32
  * <zh/> 触发一次按键移动的距离
27
33
  *
28
34
  * <en/> The distance of a single key movement
35
+ * @defaultValue 10
29
36
  */
30
37
  sensitivity?: number;
31
38
  /**
@@ -1,5 +1,4 @@
1
- import type { ID } from '@antv/graphlib';
2
- import type { Element, IDragEvent, Point } from '../types';
1
+ import type { Element, ID, IDragEvent, Point } from '../types';
3
2
  import type { DragElementOptions } from './drag-element';
4
3
  import { DragElement } from './drag-element';
5
4
  export interface DragElementForceOptions extends Omit<DragElementOptions, 'animation' | 'dropEffect' | 'shadow'> {
@@ -1,7 +1,6 @@
1
1
  import type { BaseStyleProps } from '@antv/g';
2
- import type { ID } from '@antv/graphlib';
3
2
  import type { RuntimeContext } from '../runtime/types';
4
- import type { EdgeDirection, Element, IDragEvent, Point, PrefixObject } from '../types';
3
+ import type { EdgeDirection, Element, ID, IDragEvent, Point, PrefixObject } from '../types';
5
4
  import type { BaseBehaviorOptions } from './base-behavior';
6
5
  import { BaseBehavior } from './base-behavior';
7
6
  export interface DragElementOptions extends BaseBehaviorOptions, PrefixObject<BaseStyleProps, 'shadow'> {
@@ -27,7 +26,7 @@ export interface DragElementOptions extends BaseBehaviorOptions, PrefixObject<Ba
27
26
  * - link: Place the drag element as a child element of the target element
28
27
  * - move: Move the element and update the parent element size
29
28
  * - none: Only update the drag target position, no additional operations
30
- * @description
29
+ * @remarks
31
30
  * <zh/> combo 元素可作为元素容器置入 node 或 combo 元素
32
31
  *
33
32
  * <en/> The combo element can be placed as an element container into the node or combo element
@@ -53,7 +52,7 @@ export interface DragElementOptions extends BaseBehaviorOptions, PrefixObject<Ba
53
52
  * - in: hide the edges with the node as the target node
54
53
  * - both: hide all edges related to the node
55
54
  * - all: hide all edges in the graph
56
- * @description
55
+ * @remarks
57
56
  * <zh/> 使用幽灵节点时不会隐藏边
58
57
  *
59
58
  * <en/> Edges will not be hidden when using the drag shadow
@@ -84,7 +83,7 @@ export declare class DragElement extends BaseBehavior<DragElementOptions> {
84
83
  constructor(context: RuntimeContext, options: DragElementOptions);
85
84
  update(options: Partial<DragElementOptions>): void;
86
85
  private bindEvents;
87
- protected getSelectedNodeIDs(currTarget: ID[]): ID[];
86
+ protected getSelectedNodeIDs(currTarget: ID[]): string[];
88
87
  protected getDelta(event: IElementDragEvent): [number, number] | Float32Array | [number, number, number];
89
88
  protected onDragStart(event: IElementDragEvent): void;
90
89
  protected onDrag(event: IElementDragEvent): void;
@@ -9,6 +9,7 @@ export { DragElementForce } from './drag-element-force';
9
9
  export { FocusElement } from './focus-element';
10
10
  export { HoverElement } from './hover-element';
11
11
  export { LassoSelect } from './lasso-select';
12
+ export { ScrollCanvas } from './scroll-canvas';
12
13
  export { ZoomCanvas } from './zoom-canvas';
13
14
  export type { BaseBehaviorOptions } from './base-behavior';
14
15
  export type { BrushSelectOptions } from './brush-select';
@@ -21,4 +22,5 @@ export type { DragElementForceOptions } from './drag-element-force';
21
22
  export type { FocusElementOptions } from './focus-element';
22
23
  export type { HoverElementOptions } from './hover-element';
23
24
  export type { LassoSelectOptions } from './lasso-select';
25
+ export type { ScrollCanvasOptions } from './scroll-canvas';
24
26
  export type { ZoomCanvasOptions } from './zoom-canvas';
@@ -1,15 +1,15 @@
1
1
  import { BrushSelect } from './brush-select';
2
- import type { ID } from '@antv/graphlib';
3
2
  import type { RuntimeContext } from '../runtime/types';
4
- import type { IPointerEvent, Points, State } from '../types';
3
+ import type { ID, IPointerEvent, Points, State } from '../types';
5
4
  import type { BrushSelectOptions } from './brush-select';
6
5
  export type States = Record<ID, State | State[]>;
7
- export type LassoSelectOptions = BrushSelectOptions;
6
+ export interface LassoSelectOptions extends BrushSelectOptions {
7
+ }
8
8
  export declare class LassoSelect extends BrushSelect<LassoSelectOptions> {
9
9
  static defaultOptions: Partial<LassoSelectOptions>;
10
10
  private points?;
11
11
  private pathShape?;
12
- selectElementFn: (graph: import("..").Graph, id: ID, points: Points) => boolean;
12
+ selectElementFn: (graph: import("..").Graph, id: string, points: Points) => boolean;
13
13
  constructor(context: RuntimeContext, options: LassoSelectOptions);
14
14
  pointerDown: (event: IPointerEvent) => Promise<void>;
15
15
  pointerMove: (event: IPointerEvent) => Promise<void>;
@@ -0,0 +1,64 @@
1
+ import type { RuntimeContext } from '../runtime/types';
2
+ import type { IKeyboardEvent } from '../types';
3
+ import { ShortcutKey } from '../utils/shortcut';
4
+ import type { BaseBehaviorOptions } from './base-behavior';
5
+ import { BaseBehavior } from './base-behavior';
6
+ export interface ScrollCanvasOptions extends BaseBehaviorOptions {
7
+ /**
8
+ * <zh/> 是否启用滚动画布的功能
9
+ *
10
+ * <en/> Whether to enable the function of scrolling the canvas
11
+ * @defaultValue true
12
+ */
13
+ enable?: boolean | ((event: WheelEvent | IKeyboardEvent) => boolean);
14
+ /**
15
+ * <zh/> 触发滚动的方式,默认使用指针滚动
16
+ *
17
+ * <en/> The way to trigger scrolling, default to scrolling with the pointer pressed
18
+ */
19
+ trigger?: CombinationKey;
20
+ /**
21
+ * <zh/> 允许的滚动方向
22
+ * - 默认情况下没有限制
23
+ * - x : 只允许水平滚动
24
+ * - y : 只允许垂直滚动
25
+ *
26
+ * <en/> The allowed rolling direction
27
+ * - by default, there is no restriction
28
+ * - x: only allow horizontal scrolling
29
+ * - y: only allow vertical scrolling
30
+ */
31
+ direction?: 'x' | 'y';
32
+ /**
33
+ * <zh/> 滚动灵敏度
34
+ *
35
+ * <en/> Scroll sensitivity
36
+ * @defaultValue 1
37
+ */
38
+ sensitivity?: number;
39
+ /**
40
+ * <zh/> 完成滚动时的回调
41
+ *
42
+ * <en/> Callback when scrolling is completed
43
+ */
44
+ onFinish?: () => void;
45
+ }
46
+ type CombinationKey = {
47
+ up: ShortcutKey;
48
+ down: ShortcutKey;
49
+ left: ShortcutKey;
50
+ right: ShortcutKey;
51
+ };
52
+ export declare class ScrollCanvas extends BaseBehavior<ScrollCanvasOptions> {
53
+ static defaultOptions: ScrollCanvasOptions;
54
+ private shortcut;
55
+ constructor(context: RuntimeContext, options: ScrollCanvasOptions);
56
+ private bindEvents;
57
+ get graphDom(): import("@antv/g").CanvasLike | null;
58
+ private onWheel;
59
+ private formatDisplacement;
60
+ private scroll;
61
+ private validate;
62
+ destroy(): void;
63
+ }
64
+ export {};
@@ -1,6 +1,7 @@
1
1
  import type { BaseBehavior } from './base-behavior';
2
2
  import type { DragCanvasOptions } from './drag-canvas';
3
+ import type { ScrollCanvasOptions } from './scroll-canvas';
3
4
  import type { ZoomCanvasOptions } from './zoom-canvas';
4
5
  export type { States } from './brush-select';
5
- export type BuiltInBehaviorOptions = DragCanvasOptions | ZoomCanvasOptions;
6
+ export type BuiltInBehaviorOptions = DragCanvasOptions | ZoomCanvasOptions | ScrollCanvasOptions;
6
7
  export type Behavior = BaseBehavior<any>;
@@ -20,7 +20,7 @@ export interface ZoomCanvasOptions extends BaseBehaviorOptions {
20
20
  * <zh/> 触发缩放的方式
21
21
  *
22
22
  * <en/> The way to trigger zoom
23
- * @description
23
+ * @remarks
24
24
  * <zh/>
25
25
  * - 数组:组合快捷键,默认使用滚轮缩放,['Control'] 表示按住 Control 键滚动鼠标滚轮时触发缩放
26
26
  * - 对象:缩放快捷键,例如 { zoomIn: ['Control', '+'], zoomOut: ['Control', '-'], reset: ['Control', '0'] }
@@ -1,7 +1,4 @@
1
1
  export declare enum AnimationType {
2
2
  DRAW = "draw",
3
- TRANSFORM = "transform",
4
- ELEMENT_VISIBILITY_CHANGE = "elementvisibilitychange",
5
- ELEMENT_STATE_CHANGE = "elementstatechange",
6
- ELEMENT_TRANSLATE = "elementtranslate"
3
+ TRANSFORM = "transform"
7
4
  }
@@ -50,5 +50,9 @@ export declare enum GraphEvent {
50
50
  /** <zh/> 批处理开始 | <en/> Batch processing starts */
51
51
  BATCH_START = "batchstart",
52
52
  /** <zh/> 批处理结束 | <en/> Batch processing ends */
53
- BATCH_END = "batchend"
53
+ BATCH_END = "batchend",
54
+ /** <zh/> 销毁开始之前 | <en/> Before destruction */
55
+ BEFORE_DESTROY = "beforedestroy",
56
+ /** <zh/> 销毁结束之后 | <en/> After destruction */
57
+ AFTER_DESTROY = "afterdestroy"
54
58
  }
@@ -31,7 +31,7 @@ export type BaseComboStyleProps<T extends Record<string, unknown> = Record<strin
31
31
  * <zh/> Combo 的子元素数据
32
32
  *
33
33
  * <en/> The data of the children of combo
34
- * @description
34
+ * @remarks
35
35
  * <zh/> 如果 combo 是收起状态,children 可能为空,通过 childrenData 能够获取完整的子元素数据
36
36
  *
37
37
  * <en/> If the combo is collapsed, children may be empty, and the complete child element data can be obtained through childrenData
@@ -42,11 +42,6 @@ export type BaseEdgeStyleProps = BaseElementStyleProps & Pick<PathStyleProps, 'i
42
42
  * <en/> Offset of the end arrow
43
43
  */
44
44
  endArrowOffset?: number;
45
- /**
46
- * <zh/> 主色
47
- * <en/> Subject color
48
- */
49
- color?: string;
50
45
  /**
51
46
  * <zh/> 边的起点 shape
52
47
  * <en/> The source shape. Represents the start of the edge
@@ -1,8 +1,7 @@
1
1
  import type { DisplayObject, DisplayObjectConfig, Group } from '@antv/g';
2
- import type { ID } from '@antv/graphlib';
3
2
  import type { CategoricalPalette } from '../../palettes/types';
4
3
  import type { NodeData } from '../../spec';
5
- import type { BadgePlacement, BaseElementStyleProps, Keyframe, LabelPlacement, Node, Placement, Point, Port, PortStyleProps, PrefixObject, Size } from '../../types';
4
+ import type { BadgePlacement, BaseElementStyleProps, ID, Keyframe, LabelPlacement, Node, Placement, Point, Port, PortStyleProps, PrefixObject, Size } from '../../types';
6
5
  import type { BadgeStyleProps, IconStyleProps, LabelStyleProps } from '../shapes';
7
6
  import { BaseShape } from '../shapes';
8
7
  export type BaseNodeStyleProps<T extends Record<string, unknown> = Record<string, any>> = T & BaseElementStyleProps & PrefixObject<NodeLabelStyleProps, 'label'> & PrefixObject<T, 'halo'> & PrefixObject<IconStyleProps, 'icon'> & PrefixObject<BadgeStyleProps, 'badge'> & PrefixObject<PortStyleProps, 'port'> & {
@@ -30,18 +29,12 @@ export type BaseNodeStyleProps<T extends Record<string, unknown> = Record<string
30
29
  * <en/> The size of node, which is a shortcut to set the width and height of node
31
30
  */
32
31
  size?: Size;
33
- /**
34
- * <zh/> 主色
35
- *
36
- * <en/> Subject color
37
- */
38
- color?: string;
39
32
  /**
40
33
  * @deprecated
41
34
  * <zh/> 解决类型 style.getPropertyValue 问题,不要使用该属性
42
35
  *
43
36
  * <en/> Solve the problem of style.getPropertyValue, do not use this property
44
- * @description
37
+ * @remarks
45
38
  * <zh/> 移除该属性会导致 Polygon 及其子类与 Node 不兼容
46
39
  *
47
40
  * <en/> Removing this property will cause Polygon and its subclasses to be incompatible with Node
@@ -141,7 +134,7 @@ export declare abstract class BaseNode<S extends BaseNodeStyleProps = BaseNodeSt
141
134
  * Get the key shape for the node.
142
135
  * @returns Key shape.
143
136
  */
144
- getKey(): DisplayObject;
137
+ getKey<T extends DisplayObject>(): T;
145
138
  /**
146
139
  * Get the ports for the node.
147
140
  * @returns Ports shape map.
@@ -0,0 +1,45 @@
1
+ import { Circle } from './circle';
2
+ import type { BaseStyleProps, DisplayObjectConfig, Group } from '@antv/g';
3
+ import type { PrefixObject } from '../../types';
4
+ import type { CircleStyleProps } from './circle';
5
+ interface Round extends BaseStyleProps {
6
+ /**
7
+ * <zh/> 数值,用于计算比例
8
+ *
9
+ * <en/> Numerical value used to calculate the scale.
10
+ */
11
+ value: number;
12
+ /**
13
+ * <zh/> 颜色
14
+ *
15
+ * <en/> Color.
16
+ */
17
+ color?: string;
18
+ }
19
+ export interface DonutStyleProps extends CircleStyleProps, PrefixObject<BaseStyleProps, 'donut'> {
20
+ /**
21
+ * <zh/> 内环半径,使用百分比或者像素值
22
+ *
23
+ * <en/> Inner ring radius, using percentage or pixel value.
24
+ */
25
+ innerRadius?: string | number;
26
+ /**
27
+ * <zh/> 圆环数据
28
+ *
29
+ * <en/> Donut data.
30
+ */
31
+ donuts?: number[] | Round[];
32
+ /**
33
+ * <zh/> 颜色或者色板名
34
+ *
35
+ * <en/> Color or palette.
36
+ */
37
+ colors?: string | string[];
38
+ }
39
+ export declare class Donut extends Circle {
40
+ static defaultStyleProps: Partial<DonutStyleProps>;
41
+ constructor(options: DisplayObjectConfig<DonutStyleProps>);
42
+ protected drawDonutShape(attributes: Required<DonutStyleProps>, container: Group): void;
43
+ render(attributes: Required<DonutStyleProps>, container?: Group): void;
44
+ }
45
+ export {};
@@ -0,0 +1,27 @@
1
+ import type { DisplayObjectConfig, HTMLStyleProps as GHTMLStyleProps, Group } from '@antv/g';
2
+ import type { BaseNodeStyleProps } from './base-node';
3
+ import { BaseNode } from './base-node';
4
+ export type HTMLStyleProps = BaseNodeStyleProps<{
5
+ innerHTML: string | HTMLElement;
6
+ }>;
7
+ /**
8
+ * @see https://github.com/antvis/G/blob/next/packages/g-lite/src/plugins/EventPlugin.ts
9
+ */
10
+ export declare class HTML extends BaseNode<HTMLStyleProps> {
11
+ static defaultStyleProps: Partial<HTMLStyleProps>;
12
+ constructor(options: DisplayObjectConfig<HTMLStyleProps>);
13
+ private rootPointerEvent;
14
+ private get eventService();
15
+ private get events();
16
+ protected getDomElement(): HTMLElement;
17
+ protected getKeyStyle(attributes: Required<HTMLStyleProps>): GHTMLStyleProps;
18
+ protected drawKeyShape(attributes: Required<HTMLStyleProps>, container: Group): any;
19
+ connectedCallback(): void;
20
+ attributeChangedCallback(name: any, oldValue: any, newValue: any): void;
21
+ onDestroy(): void;
22
+ private forwardEvents;
23
+ private normalizeToPointerEvent;
24
+ private transferMouseData;
25
+ private bootstrapEvent;
26
+ private getViewportXY;
27
+ }