@antv/g6 5.0.19 → 5.0.21

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 (440) hide show
  1. package/dist/g6.min.js +2 -2
  2. package/dist/lib/behaviors/base-behavior.d.ts +10 -0
  3. package/dist/lib/behaviors/drag-canvas.d.ts +9 -0
  4. package/dist/lib/behaviors/hover-activate.d.ts +16 -2
  5. package/dist/lib/behaviors/scroll-canvas.d.ts +9 -0
  6. package/dist/lib/elements/combos/circle.d.ts +1 -1
  7. package/dist/lib/elements/edges/cubic-radial.d.ts +24 -0
  8. package/dist/lib/elements/edges/index.d.ts +2 -0
  9. package/dist/lib/elements/edges/line.d.ts +0 -2
  10. package/dist/lib/elements/nodes/base-node.d.ts +2 -1
  11. package/dist/lib/elements/nodes/circle.d.ts +1 -1
  12. package/dist/lib/elements/nodes/ellipse.d.ts +1 -1
  13. package/dist/lib/elements/shapes/base-shape.d.ts +29 -14
  14. package/dist/lib/elements/shapes/polygon.d.ts +1 -1
  15. package/dist/lib/exports.d.ts +9 -7
  16. package/dist/lib/layouts/base-layout.d.ts +5 -0
  17. package/dist/lib/plugins/background/index.d.ts +1 -0
  18. package/dist/lib/plugins/base-plugin.d.ts +5 -0
  19. package/dist/lib/plugins/bubble-sets.d.ts +1 -0
  20. package/dist/lib/plugins/contextmenu/index.d.ts +1 -0
  21. package/dist/lib/plugins/grid-line.d.ts +1 -0
  22. package/dist/lib/plugins/history/index.d.ts +1 -0
  23. package/dist/lib/plugins/hull/index.d.ts +1 -0
  24. package/dist/lib/plugins/legend.d.ts +1 -0
  25. package/dist/lib/plugins/minimap/index.d.ts +8 -2
  26. package/dist/lib/plugins/snapline/index.d.ts +10 -0
  27. package/dist/lib/plugins/timebar.d.ts +1 -0
  28. package/dist/lib/plugins/toolbar/index.d.ts +1 -0
  29. package/dist/lib/plugins/tooltip.d.ts +11 -0
  30. package/dist/lib/plugins/watermark/index.d.ts +1 -0
  31. package/dist/lib/runtime/data.d.ts +1 -0
  32. package/dist/lib/runtime/element.d.ts +1 -0
  33. package/dist/lib/runtime/graph.d.ts +2 -0
  34. package/dist/lib/runtime/layout.d.ts +1 -0
  35. package/dist/lib/transforms/base-transform.d.ts +6 -0
  36. package/dist/lib/transforms/index.d.ts +3 -0
  37. package/dist/lib/transforms/position-radial-labels.d.ts +27 -0
  38. package/dist/lib/transforms/process-parallel-edges.d.ts +7 -9
  39. package/dist/lib/transforms/utils.d.ts +5 -5
  40. package/dist/lib/types/element.d.ts +2 -1
  41. package/dist/lib/utils/bbox.d.ts +12 -3
  42. package/dist/lib/utils/data.d.ts +14 -0
  43. package/dist/lib/utils/diff.d.ts +2 -1
  44. package/dist/lib/utils/padding.d.ts +4 -4
  45. package/dist/lib/utils/point.d.ts +17 -5
  46. package/dist/lib/utils/position.d.ts +8 -0
  47. package/dist/lib/utils/prefix.d.ts +1 -1
  48. package/dist/lib/utils/relation.d.ts +6 -4
  49. package/dist/lib/utils/router/orth.d.ts +1 -1
  50. package/dist/lib/utils/size.d.ts +3 -1
  51. package/dist/lib/utils/transform.d.ts +5 -5
  52. package/dist/lib/utils/vector.d.ts +8 -0
  53. package/dist/lib/version.d.ts +1 -1
  54. package/esm/behaviors/base-behavior.d.ts +10 -0
  55. package/esm/behaviors/base-behavior.js +5 -0
  56. package/esm/behaviors/base-behavior.js.map +1 -1
  57. package/esm/behaviors/drag-canvas.d.ts +9 -0
  58. package/esm/behaviors/drag-canvas.js +28 -3
  59. package/esm/behaviors/drag-canvas.js.map +1 -1
  60. package/esm/behaviors/hover-activate.d.ts +16 -2
  61. package/esm/behaviors/hover-activate.js +17 -7
  62. package/esm/behaviors/hover-activate.js.map +1 -1
  63. package/esm/behaviors/scroll-canvas.d.ts +9 -0
  64. package/esm/behaviors/scroll-canvas.js +31 -4
  65. package/esm/behaviors/scroll-canvas.js.map +1 -1
  66. package/esm/elements/combos/base-combo.js +2 -2
  67. package/esm/elements/combos/base-combo.js.map +1 -1
  68. package/esm/elements/combos/circle.d.ts +1 -1
  69. package/esm/elements/combos/circle.js +2 -2
  70. package/esm/elements/combos/circle.js.map +1 -1
  71. package/esm/elements/edges/cubic-radial.d.ts +24 -0
  72. package/esm/elements/edges/cubic-radial.js +52 -0
  73. package/esm/elements/edges/cubic-radial.js.map +1 -0
  74. package/esm/elements/edges/index.d.ts +2 -0
  75. package/esm/elements/edges/index.js +1 -0
  76. package/esm/elements/edges/index.js.map +1 -1
  77. package/esm/elements/edges/line.d.ts +0 -2
  78. package/esm/elements/edges/line.js +0 -2
  79. package/esm/elements/edges/line.js.map +1 -1
  80. package/esm/elements/edges/polyline.js.map +1 -1
  81. package/esm/elements/nodes/base-node.d.ts +2 -1
  82. package/esm/elements/nodes/base-node.js +3 -2
  83. package/esm/elements/nodes/base-node.js.map +1 -1
  84. package/esm/elements/nodes/circle.d.ts +1 -1
  85. package/esm/elements/nodes/circle.js +2 -2
  86. package/esm/elements/nodes/circle.js.map +1 -1
  87. package/esm/elements/nodes/ellipse.d.ts +1 -1
  88. package/esm/elements/nodes/ellipse.js +2 -2
  89. package/esm/elements/nodes/ellipse.js.map +1 -1
  90. package/esm/elements/nodes/html.js +4 -1
  91. package/esm/elements/nodes/html.js.map +1 -1
  92. package/esm/elements/shapes/base-shape.d.ts +29 -14
  93. package/esm/elements/shapes/base-shape.js +27 -12
  94. package/esm/elements/shapes/base-shape.js.map +1 -1
  95. package/esm/elements/shapes/polygon.d.ts +1 -1
  96. package/esm/elements/shapes/polygon.js +2 -2
  97. package/esm/elements/shapes/polygon.js.map +1 -1
  98. package/esm/exports.d.ts +9 -7
  99. package/esm/exports.js +6 -4
  100. package/esm/exports.js.map +1 -1
  101. package/esm/layouts/base-layout.d.ts +5 -0
  102. package/esm/layouts/base-layout.js +5 -0
  103. package/esm/layouts/base-layout.js.map +1 -1
  104. package/esm/plugins/background/index.d.ts +1 -0
  105. package/esm/plugins/background/index.js +1 -0
  106. package/esm/plugins/background/index.js.map +1 -1
  107. package/esm/plugins/base-plugin.d.ts +5 -0
  108. package/esm/plugins/base-plugin.js +5 -0
  109. package/esm/plugins/base-plugin.js.map +1 -1
  110. package/esm/plugins/bubble-sets.d.ts +1 -0
  111. package/esm/plugins/bubble-sets.js +1 -0
  112. package/esm/plugins/bubble-sets.js.map +1 -1
  113. package/esm/plugins/contextmenu/index.d.ts +1 -0
  114. package/esm/plugins/contextmenu/index.js +1 -0
  115. package/esm/plugins/contextmenu/index.js.map +1 -1
  116. package/esm/plugins/grid-line.d.ts +1 -0
  117. package/esm/plugins/grid-line.js +1 -0
  118. package/esm/plugins/grid-line.js.map +1 -1
  119. package/esm/plugins/history/index.d.ts +1 -0
  120. package/esm/plugins/history/index.js +1 -0
  121. package/esm/plugins/history/index.js.map +1 -1
  122. package/esm/plugins/hull/index.d.ts +1 -0
  123. package/esm/plugins/hull/index.js +1 -0
  124. package/esm/plugins/hull/index.js.map +1 -1
  125. package/esm/plugins/legend.d.ts +1 -0
  126. package/esm/plugins/legend.js +1 -0
  127. package/esm/plugins/legend.js.map +1 -1
  128. package/esm/plugins/minimap/index.d.ts +8 -2
  129. package/esm/plugins/minimap/index.js +5 -0
  130. package/esm/plugins/minimap/index.js.map +1 -1
  131. package/esm/plugins/snapline/index.d.ts +10 -0
  132. package/esm/plugins/snapline/index.js +5 -0
  133. package/esm/plugins/snapline/index.js.map +1 -1
  134. package/esm/plugins/timebar.d.ts +1 -0
  135. package/esm/plugins/timebar.js +1 -0
  136. package/esm/plugins/timebar.js.map +1 -1
  137. package/esm/plugins/toolbar/index.d.ts +1 -0
  138. package/esm/plugins/toolbar/index.js +1 -0
  139. package/esm/plugins/toolbar/index.js.map +1 -1
  140. package/esm/plugins/tooltip.d.ts +11 -0
  141. package/esm/plugins/tooltip.js +11 -2
  142. package/esm/plugins/tooltip.js.map +1 -1
  143. package/esm/plugins/watermark/index.d.ts +1 -0
  144. package/esm/plugins/watermark/index.js +1 -0
  145. package/esm/plugins/watermark/index.js.map +1 -1
  146. package/esm/registry/build-in.js +4 -2
  147. package/esm/registry/build-in.js.map +1 -1
  148. package/esm/runtime/animation.js +12 -10
  149. package/esm/runtime/animation.js.map +1 -1
  150. package/esm/runtime/data.d.ts +1 -0
  151. package/esm/runtime/data.js +21 -13
  152. package/esm/runtime/data.js.map +1 -1
  153. package/esm/runtime/element.d.ts +1 -0
  154. package/esm/runtime/element.js +21 -11
  155. package/esm/runtime/element.js.map +1 -1
  156. package/esm/runtime/graph.d.ts +2 -0
  157. package/esm/runtime/graph.js +42 -22
  158. package/esm/runtime/graph.js.map +1 -1
  159. package/esm/runtime/layout.d.ts +1 -0
  160. package/esm/runtime/layout.js +5 -0
  161. package/esm/runtime/layout.js.map +1 -1
  162. package/esm/transforms/base-transform.d.ts +6 -0
  163. package/esm/transforms/base-transform.js +6 -0
  164. package/esm/transforms/base-transform.js.map +1 -1
  165. package/esm/transforms/collapse-expand-combo.js +3 -0
  166. package/esm/transforms/collapse-expand-combo.js.map +1 -1
  167. package/esm/transforms/collapse-expand-node.js +2 -0
  168. package/esm/transforms/collapse-expand-node.js.map +1 -1
  169. package/esm/transforms/index.d.ts +3 -0
  170. package/esm/transforms/index.js +1 -0
  171. package/esm/transforms/index.js.map +1 -1
  172. package/esm/transforms/position-radial-labels.d.ts +27 -0
  173. package/esm/transforms/position-radial-labels.js +50 -0
  174. package/esm/transforms/position-radial-labels.js.map +1 -0
  175. package/esm/transforms/process-parallel-edges.d.ts +7 -9
  176. package/esm/transforms/process-parallel-edges.js.map +1 -1
  177. package/esm/transforms/utils.d.ts +5 -5
  178. package/esm/transforms/utils.js +5 -5
  179. package/esm/types/element.d.ts +2 -1
  180. package/esm/utils/bbox.d.ts +12 -3
  181. package/esm/utils/bbox.js +16 -4
  182. package/esm/utils/bbox.js.map +1 -1
  183. package/esm/utils/data.d.ts +14 -0
  184. package/esm/utils/data.js +39 -0
  185. package/esm/utils/data.js.map +1 -1
  186. package/esm/utils/diff.d.ts +2 -1
  187. package/esm/utils/diff.js +3 -2
  188. package/esm/utils/diff.js.map +1 -1
  189. package/esm/utils/edge.js +4 -4
  190. package/esm/utils/edge.js.map +1 -1
  191. package/esm/utils/padding.d.ts +4 -4
  192. package/esm/utils/padding.js +4 -4
  193. package/esm/utils/point.d.ts +17 -5
  194. package/esm/utils/point.js +27 -8
  195. package/esm/utils/point.js.map +1 -1
  196. package/esm/utils/position.d.ts +8 -0
  197. package/esm/utils/position.js +11 -0
  198. package/esm/utils/position.js.map +1 -1
  199. package/esm/utils/prefix.d.ts +1 -1
  200. package/esm/utils/prefix.js +1 -1
  201. package/esm/utils/relation.d.ts +6 -4
  202. package/esm/utils/relation.js +10 -8
  203. package/esm/utils/relation.js.map +1 -1
  204. package/esm/utils/router/orth.d.ts +1 -1
  205. package/esm/utils/router/orth.js +27 -11
  206. package/esm/utils/router/orth.js.map +1 -1
  207. package/esm/utils/size.d.ts +3 -1
  208. package/esm/utils/size.js +3 -1
  209. package/esm/utils/size.js.map +1 -1
  210. package/esm/utils/transform.d.ts +5 -5
  211. package/esm/utils/transform.js +5 -5
  212. package/esm/utils/vector.d.ts +8 -0
  213. package/esm/utils/vector.js +13 -0
  214. package/esm/utils/vector.js.map +1 -1
  215. package/esm/version.d.ts +1 -1
  216. package/esm/version.js +1 -1
  217. package/lib/behaviors/base-behavior.d.ts +10 -0
  218. package/lib/behaviors/base-behavior.js +5 -0
  219. package/lib/behaviors/base-behavior.js.map +1 -1
  220. package/lib/behaviors/drag-canvas.d.ts +9 -0
  221. package/lib/behaviors/drag-canvas.js +27 -2
  222. package/lib/behaviors/drag-canvas.js.map +1 -1
  223. package/lib/behaviors/hover-activate.d.ts +16 -2
  224. package/lib/behaviors/hover-activate.js +17 -7
  225. package/lib/behaviors/hover-activate.js.map +1 -1
  226. package/lib/behaviors/scroll-canvas.d.ts +9 -0
  227. package/lib/behaviors/scroll-canvas.js +31 -4
  228. package/lib/behaviors/scroll-canvas.js.map +1 -1
  229. package/lib/elements/combos/base-combo.js +1 -1
  230. package/lib/elements/combos/base-combo.js.map +1 -1
  231. package/lib/elements/combos/circle.d.ts +1 -1
  232. package/lib/elements/combos/circle.js +2 -2
  233. package/lib/elements/combos/circle.js.map +1 -1
  234. package/lib/elements/edges/cubic-radial.d.ts +24 -0
  235. package/lib/elements/edges/cubic-radial.js +56 -0
  236. package/lib/elements/edges/cubic-radial.js.map +1 -0
  237. package/lib/elements/edges/index.d.ts +2 -0
  238. package/lib/elements/edges/index.js +3 -1
  239. package/lib/elements/edges/index.js.map +1 -1
  240. package/lib/elements/edges/line.d.ts +0 -2
  241. package/lib/elements/edges/line.js +0 -2
  242. package/lib/elements/edges/line.js.map +1 -1
  243. package/lib/elements/edges/polyline.js.map +1 -1
  244. package/lib/elements/nodes/base-node.d.ts +2 -1
  245. package/lib/elements/nodes/base-node.js +3 -2
  246. package/lib/elements/nodes/base-node.js.map +1 -1
  247. package/lib/elements/nodes/circle.d.ts +1 -1
  248. package/lib/elements/nodes/circle.js +2 -2
  249. package/lib/elements/nodes/circle.js.map +1 -1
  250. package/lib/elements/nodes/ellipse.d.ts +1 -1
  251. package/lib/elements/nodes/ellipse.js +2 -2
  252. package/lib/elements/nodes/ellipse.js.map +1 -1
  253. package/lib/elements/nodes/html.js +3 -0
  254. package/lib/elements/nodes/html.js.map +1 -1
  255. package/lib/elements/shapes/base-shape.d.ts +29 -14
  256. package/lib/elements/shapes/base-shape.js +27 -12
  257. package/lib/elements/shapes/base-shape.js.map +1 -1
  258. package/lib/elements/shapes/polygon.d.ts +1 -1
  259. package/lib/elements/shapes/polygon.js +2 -2
  260. package/lib/elements/shapes/polygon.js.map +1 -1
  261. package/lib/exports.d.ts +9 -7
  262. package/lib/exports.js +15 -6
  263. package/lib/exports.js.map +1 -1
  264. package/lib/layouts/base-layout.d.ts +5 -0
  265. package/lib/layouts/base-layout.js +5 -0
  266. package/lib/layouts/base-layout.js.map +1 -1
  267. package/lib/plugins/background/index.d.ts +1 -0
  268. package/lib/plugins/background/index.js +1 -0
  269. package/lib/plugins/background/index.js.map +1 -1
  270. package/lib/plugins/base-plugin.d.ts +5 -0
  271. package/lib/plugins/base-plugin.js +5 -0
  272. package/lib/plugins/base-plugin.js.map +1 -1
  273. package/lib/plugins/bubble-sets.d.ts +1 -0
  274. package/lib/plugins/bubble-sets.js +1 -0
  275. package/lib/plugins/bubble-sets.js.map +1 -1
  276. package/lib/plugins/contextmenu/index.d.ts +1 -0
  277. package/lib/plugins/contextmenu/index.js +1 -0
  278. package/lib/plugins/contextmenu/index.js.map +1 -1
  279. package/lib/plugins/grid-line.d.ts +1 -0
  280. package/lib/plugins/grid-line.js +1 -0
  281. package/lib/plugins/grid-line.js.map +1 -1
  282. package/lib/plugins/history/index.d.ts +1 -0
  283. package/lib/plugins/history/index.js +1 -0
  284. package/lib/plugins/history/index.js.map +1 -1
  285. package/lib/plugins/hull/index.d.ts +1 -0
  286. package/lib/plugins/hull/index.js +1 -0
  287. package/lib/plugins/hull/index.js.map +1 -1
  288. package/lib/plugins/legend.d.ts +1 -0
  289. package/lib/plugins/legend.js +1 -0
  290. package/lib/plugins/legend.js.map +1 -1
  291. package/lib/plugins/minimap/index.d.ts +8 -2
  292. package/lib/plugins/minimap/index.js +5 -0
  293. package/lib/plugins/minimap/index.js.map +1 -1
  294. package/lib/plugins/snapline/index.d.ts +10 -0
  295. package/lib/plugins/snapline/index.js +5 -0
  296. package/lib/plugins/snapline/index.js.map +1 -1
  297. package/lib/plugins/timebar.d.ts +1 -0
  298. package/lib/plugins/timebar.js +1 -0
  299. package/lib/plugins/timebar.js.map +1 -1
  300. package/lib/plugins/toolbar/index.d.ts +1 -0
  301. package/lib/plugins/toolbar/index.js +1 -0
  302. package/lib/plugins/toolbar/index.js.map +1 -1
  303. package/lib/plugins/tooltip.d.ts +11 -0
  304. package/lib/plugins/tooltip.js +11 -2
  305. package/lib/plugins/tooltip.js.map +1 -1
  306. package/lib/plugins/watermark/index.d.ts +1 -0
  307. package/lib/plugins/watermark/index.js +1 -0
  308. package/lib/plugins/watermark/index.js.map +1 -1
  309. package/lib/registry/build-in.js +2 -0
  310. package/lib/registry/build-in.js.map +1 -1
  311. package/lib/runtime/animation.js +12 -10
  312. package/lib/runtime/animation.js.map +1 -1
  313. package/lib/runtime/data.d.ts +1 -0
  314. package/lib/runtime/data.js +19 -11
  315. package/lib/runtime/data.js.map +1 -1
  316. package/lib/runtime/element.d.ts +1 -0
  317. package/lib/runtime/element.js +21 -11
  318. package/lib/runtime/element.js.map +1 -1
  319. package/lib/runtime/graph.d.ts +2 -0
  320. package/lib/runtime/graph.js +42 -22
  321. package/lib/runtime/graph.js.map +1 -1
  322. package/lib/runtime/layout.d.ts +1 -0
  323. package/lib/runtime/layout.js +5 -0
  324. package/lib/runtime/layout.js.map +1 -1
  325. package/lib/transforms/base-transform.d.ts +6 -0
  326. package/lib/transforms/base-transform.js +6 -0
  327. package/lib/transforms/base-transform.js.map +1 -1
  328. package/lib/transforms/collapse-expand-combo.js +3 -0
  329. package/lib/transforms/collapse-expand-combo.js.map +1 -1
  330. package/lib/transforms/collapse-expand-node.js +2 -0
  331. package/lib/transforms/collapse-expand-node.js.map +1 -1
  332. package/lib/transforms/index.d.ts +3 -0
  333. package/lib/transforms/index.js +3 -1
  334. package/lib/transforms/index.js.map +1 -1
  335. package/lib/transforms/position-radial-labels.d.ts +27 -0
  336. package/lib/transforms/position-radial-labels.js +54 -0
  337. package/lib/transforms/position-radial-labels.js.map +1 -0
  338. package/lib/transforms/process-parallel-edges.d.ts +7 -9
  339. package/lib/transforms/process-parallel-edges.js.map +1 -1
  340. package/lib/transforms/utils.d.ts +5 -5
  341. package/lib/transforms/utils.js +5 -5
  342. package/lib/types/element.d.ts +2 -1
  343. package/lib/utils/bbox.d.ts +12 -3
  344. package/lib/utils/bbox.js +19 -6
  345. package/lib/utils/bbox.js.map +1 -1
  346. package/lib/utils/data.d.ts +14 -0
  347. package/lib/utils/data.js +40 -0
  348. package/lib/utils/data.js.map +1 -1
  349. package/lib/utils/diff.d.ts +2 -1
  350. package/lib/utils/diff.js +3 -2
  351. package/lib/utils/diff.js.map +1 -1
  352. package/lib/utils/edge.js +3 -3
  353. package/lib/utils/edge.js.map +1 -1
  354. package/lib/utils/padding.d.ts +4 -4
  355. package/lib/utils/padding.js +4 -4
  356. package/lib/utils/point.d.ts +17 -5
  357. package/lib/utils/point.js +28 -8
  358. package/lib/utils/point.js.map +1 -1
  359. package/lib/utils/position.d.ts +8 -0
  360. package/lib/utils/position.js +12 -0
  361. package/lib/utils/position.js.map +1 -1
  362. package/lib/utils/prefix.d.ts +1 -1
  363. package/lib/utils/prefix.js +1 -1
  364. package/lib/utils/relation.d.ts +6 -4
  365. package/lib/utils/relation.js +10 -8
  366. package/lib/utils/relation.js.map +1 -1
  367. package/lib/utils/router/orth.d.ts +1 -1
  368. package/lib/utils/router/orth.js +25 -9
  369. package/lib/utils/router/orth.js.map +1 -1
  370. package/lib/utils/size.d.ts +3 -1
  371. package/lib/utils/size.js +3 -1
  372. package/lib/utils/size.js.map +1 -1
  373. package/lib/utils/transform.d.ts +5 -5
  374. package/lib/utils/transform.js +5 -5
  375. package/lib/utils/vector.d.ts +8 -0
  376. package/lib/utils/vector.js +14 -0
  377. package/lib/utils/vector.js.map +1 -1
  378. package/lib/version.d.ts +1 -1
  379. package/lib/version.js +1 -1
  380. package/package.json +10 -10
  381. package/src/behaviors/base-behavior.ts +10 -0
  382. package/src/behaviors/drag-canvas.ts +42 -3
  383. package/src/behaviors/hover-activate.ts +39 -9
  384. package/src/behaviors/scroll-canvas.ts +45 -4
  385. package/src/elements/combos/base-combo.ts +2 -2
  386. package/src/elements/combos/circle.ts +2 -2
  387. package/src/elements/edges/cubic-radial.ts +77 -0
  388. package/src/elements/edges/index.ts +2 -0
  389. package/src/elements/edges/line.ts +0 -2
  390. package/src/elements/edges/polyline.ts +2 -0
  391. package/src/elements/nodes/base-node.ts +3 -2
  392. package/src/elements/nodes/circle.ts +2 -2
  393. package/src/elements/nodes/ellipse.ts +2 -2
  394. package/src/elements/nodes/html.ts +4 -1
  395. package/src/elements/shapes/base-shape.ts +29 -14
  396. package/src/elements/shapes/polygon.ts +2 -2
  397. package/src/exports.ts +21 -7
  398. package/src/layouts/base-layout.ts +5 -0
  399. package/src/plugins/background/index.ts +1 -0
  400. package/src/plugins/base-plugin.ts +5 -0
  401. package/src/plugins/bubble-sets.ts +1 -0
  402. package/src/plugins/contextmenu/index.ts +1 -0
  403. package/src/plugins/grid-line.ts +1 -0
  404. package/src/plugins/history/index.ts +1 -0
  405. package/src/plugins/hull/index.ts +1 -0
  406. package/src/plugins/legend.ts +1 -0
  407. package/src/plugins/minimap/index.ts +8 -2
  408. package/src/plugins/snapline/index.ts +10 -0
  409. package/src/plugins/timebar.ts +1 -0
  410. package/src/plugins/toolbar/index.ts +1 -0
  411. package/src/plugins/tooltip.ts +15 -2
  412. package/src/plugins/watermark/index.ts +1 -0
  413. package/src/registry/build-in.ts +4 -0
  414. package/src/runtime/animation.ts +16 -11
  415. package/src/runtime/data.ts +20 -13
  416. package/src/runtime/element.ts +23 -11
  417. package/src/runtime/graph.ts +51 -22
  418. package/src/runtime/layout.ts +7 -0
  419. package/src/transforms/base-transform.ts +7 -0
  420. package/src/transforms/collapse-expand-combo.ts +2 -0
  421. package/src/transforms/collapse-expand-node.ts +3 -0
  422. package/src/transforms/index.ts +3 -0
  423. package/src/transforms/position-radial-labels.ts +76 -0
  424. package/src/transforms/process-parallel-edges.ts +7 -9
  425. package/src/transforms/utils.ts +5 -5
  426. package/src/types/element.ts +2 -1
  427. package/src/utils/bbox.ts +17 -4
  428. package/src/utils/data.ts +49 -0
  429. package/src/utils/diff.ts +8 -2
  430. package/src/utils/edge.ts +4 -4
  431. package/src/utils/padding.ts +4 -4
  432. package/src/utils/point.ts +27 -7
  433. package/src/utils/position.ts +12 -0
  434. package/src/utils/prefix.ts +1 -1
  435. package/src/utils/relation.ts +22 -9
  436. package/src/utils/router/orth.ts +29 -11
  437. package/src/utils/size.ts +3 -1
  438. package/src/utils/transform.ts +5 -5
  439. package/src/utils/vector.ts +13 -0
  440. package/src/version.ts +1 -1
@@ -1,6 +1,16 @@
1
1
  import { BaseExtension } from '../registry/extension';
2
2
  import type { CustomBehaviorOption } from '../spec/behavior';
3
+ /**
4
+ * <zh/> 交互通用配置项
5
+ *
6
+ * <en/> Base options for behaviors
7
+ */
3
8
  export interface BaseBehaviorOptions extends CustomBehaviorOption {
4
9
  }
10
+ /**
11
+ * <zh/> 交互的基类
12
+ *
13
+ * <en/> Base class for behaviors
14
+ */
5
15
  export declare abstract class BaseBehavior<T extends BaseBehaviorOptions = BaseBehaviorOptions> extends BaseExtension<T> {
6
16
  }
@@ -35,6 +35,13 @@ export interface DragCanvasOptions extends BaseBehaviorOptions {
35
35
  * @defaultValue `'both'`
36
36
  */
37
37
  direction?: 'x' | 'y' | 'both';
38
+ /**
39
+ * <zh/> 可拖拽的视口范围,默认最多可拖拽一屏。可以分别设置上、右、下、左四个方向的范围,每个方向的范围在 [0, Infinity] 之间
40
+ *
41
+ * <en/> The draggable viewport range allows you to drag up to one screen by default. You can set the range for each direction (top, right, bottom, left) individually, with each direction's range between [0, Infinity]
42
+ * @defaultValue 1
43
+ */
44
+ range?: number | number[];
38
45
  /**
39
46
  * <zh/> 触发拖拽的方式,默认使用指针按下拖拽
40
47
  *
@@ -94,6 +101,8 @@ export declare class DragCanvas extends BaseBehavior<DragCanvasOptions> {
94
101
  * @internal
95
102
  */
96
103
  protected translate(offset: Vector2, animation?: ViewportAnimationEffectTiming): Promise<void>;
104
+ private clampByDirection;
105
+ private clampByRange;
97
106
  private validate;
98
107
  private unbindEvents;
99
108
  destroy(): void;
@@ -1,5 +1,5 @@
1
1
  import type { RuntimeContext } from '../runtime/types';
2
- import type { IPointerEvent, State } from '../types';
2
+ import type { EdgeDirection, Element, IPointerEvent, State } from '../types';
3
3
  import type { BaseBehaviorOptions } from './base-behavior';
4
4
  import { BaseBehavior } from './base-behavior';
5
5
  /**
@@ -32,7 +32,20 @@ export interface HoverActivateOptions extends BaseBehaviorOptions {
32
32
  * - `1` means the current node and its directly adjacent nodes and edges are activated, etc
33
33
  * @defaultValue 0
34
34
  */
35
- degree?: number;
35
+ degree?: number | ((event: IPointerEvent) => number);
36
+ /**
37
+ * <zh/> 指定边的方向
38
+ * - `'both'`: 表示激活当前节点的所有关系
39
+ * - `'in'`: 表示激活当前节点的入边和入节点
40
+ * - `'out'`: 表示激活当前节点的出边和出节点
41
+ *
42
+ * <en/> Specify the direction of the edge
43
+ * - `'both'`: Activate all relationships of the current node
44
+ * - `'in'`: Activate the incoming edges and nodes of the current node
45
+ * - `'out'`: Activate the outgoing edges and nodes of the current node
46
+ * @defaultValue 'both'
47
+ */
48
+ direction?: EdgeDirection;
36
49
  /**
37
50
  * <zh/> 激活元素的状态,默认为 `active`
38
51
  *
@@ -75,6 +88,7 @@ export declare class HoverActivate extends BaseBehavior<HoverActivateOptions> {
75
88
  private toggleFrozen;
76
89
  private bindEvents;
77
90
  private hoverElement;
91
+ protected getActiveIds(event: IPointerEvent<Element>): string[];
78
92
  private updateElementsState;
79
93
  private getElementsState;
80
94
  private validate;
@@ -39,6 +39,13 @@ export interface ScrollCanvasOptions extends BaseBehaviorOptions {
39
39
  * - `'y'`: only allow vertical scrolling
40
40
  */
41
41
  direction?: 'x' | 'y';
42
+ /**
43
+ * <zh/> 可滚动的视口范围,默认最多可滚动一屏。可以分别设置上、右、下、左四个方向的范围,每个方向的范围在 [0, Infinity] 之间
44
+ *
45
+ * <en/> The scrollable viewport range allows you to scroll up to one screen by default. You can set the range for each direction (top, right, bottom, left) individually, with each direction's range between [0, Infinity]
46
+ * @defaultValue 1
47
+ */
48
+ range?: number | number[];
42
49
  /**
43
50
  * <zh/> 滚动灵敏度
44
51
  *
@@ -81,6 +88,8 @@ export declare class ScrollCanvas extends BaseBehavior<ScrollCanvasOptions> {
81
88
  get graphDom(): import("@antv/g").CanvasLike | null;
82
89
  private onWheel;
83
90
  private formatDisplacement;
91
+ private clampByDirection;
92
+ private clampByRange;
84
93
  private scroll;
85
94
  private validate;
86
95
  /**
@@ -21,5 +21,5 @@ export declare class CircleCombo extends BaseCombo<CircleComboStyleProps> {
21
21
  protected getKeyStyle(attributes: Required<CircleComboStyleProps>): GCircleStyleProps;
22
22
  protected getCollapsedKeySize(attributes: Required<CircleComboStyleProps>): STDSize;
23
23
  protected getExpandedKeySize(attributes: Required<CircleComboStyleProps>): STDSize;
24
- getIntersectPoint(point: Point): Point;
24
+ getIntersectPoint(point: Point, useExtendedLine?: boolean): Point;
25
25
  }
@@ -0,0 +1,24 @@
1
+ import type { DisplayObjectConfig } from '@antv/g';
2
+ import type { Point } from '../../types';
3
+ import type { CubicStyleProps } from './cubic';
4
+ import { Cubic } from './cubic';
5
+ /**
6
+ * <zh/> 径向贝塞尔曲线样式配置项
7
+ *
8
+ * <en/> Radial cubic style props
9
+ */
10
+ export interface CubicRadialStyleProps extends CubicStyleProps {
11
+ }
12
+ /**
13
+ * <zh/> 径向贝塞尔曲线
14
+ *
15
+ * <en/> Radial cubic edge
16
+ */
17
+ export declare class CubicRadial extends Cubic {
18
+ static defaultStyleProps: Partial<CubicStyleProps>;
19
+ constructor(options: DisplayObjectConfig<CubicStyleProps>);
20
+ private get ref();
21
+ protected getEndpoints(attributes: Required<CubicStyleProps>): [Point, Point];
22
+ private toRadialCoordinate;
23
+ protected getControlPoints(sourcePoint: Point, targetPoint: Point, curvePosition: [number, number], curveOffset: [number, number]): [Point, Point];
24
+ }
@@ -1,6 +1,7 @@
1
1
  export { BaseEdge } from './base-edge';
2
2
  export { Cubic } from './cubic';
3
3
  export { CubicHorizontal } from './cubic-horizontal';
4
+ export { CubicRadial } from './cubic-radial';
4
5
  export { CubicVertical } from './cubic-vertical';
5
6
  export { Line } from './line';
6
7
  export { Polyline } from './polyline';
@@ -8,6 +9,7 @@ export { Quadratic } from './quadratic';
8
9
  export type { BaseEdgeStyleProps } from './base-edge';
9
10
  export type { CubicStyleProps } from './cubic';
10
11
  export type { CubicHorizontalStyleProps } from './cubic-horizontal';
12
+ export type { CubicRadialStyleProps } from './cubic-radial';
11
13
  export type { CubicVerticalStyleProps } from './cubic-vertical';
12
14
  export type { LineStyleProps } from './line';
13
15
  export type { PolylineStyleProps } from './polyline';
@@ -14,8 +14,6 @@ type ParsedLineStyleProps = Required<LineStyleProps>;
14
14
  * <zh/> 直线
15
15
  *
16
16
  * <en/> Line
17
- * @remarks
18
- * <img width="300" src="https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*YbpvTa4liAEAAAAAAAAAAAAADmJ7AQ/original" />
19
17
  */
20
18
  export declare class Line extends BaseEdge {
21
19
  static defaultStyleProps: Partial<LineStyleProps>;
@@ -179,9 +179,10 @@ export declare abstract class BaseNode<S extends BaseNodeStyleProps = BaseNodeSt
179
179
  /**
180
180
  * Get the point on the outer contour of the node that is the intersection with a line starting in the center the ending in the point `p`.
181
181
  * @param point - The point to intersect with the node.
182
+ * @param useExtendedLine - Whether to use the extended line.
182
183
  * @returns The intersection point.
183
184
  */
184
- getIntersectPoint(point: Point): Point;
185
+ getIntersectPoint(point: Point, useExtendedLine?: boolean): Point;
185
186
  protected drawHaloShape(attributes: Required<S>, container: Group): void;
186
187
  protected drawIconShape(attributes: Required<S>, container: Group): void;
187
188
  protected drawBadgeShapes(attributes: Required<S>, container: Group): void;
@@ -22,5 +22,5 @@ export declare class Circle extends BaseNode {
22
22
  protected drawKeyShape(attributes: Required<CircleStyleProps>, container: Group): GCircle | undefined;
23
23
  protected getKeyStyle(attributes: Required<CircleStyleProps>): GCircleStyleProps;
24
24
  protected getIconStyle(attributes: Required<CircleStyleProps>): false | IconStyleProps;
25
- getIntersectPoint(point: Point): Point;
25
+ getIntersectPoint(point: Point, useExtendedLine?: boolean): Point;
26
26
  }
@@ -22,5 +22,5 @@ export declare class Ellipse extends BaseNode {
22
22
  protected drawKeyShape(attributes: Required<EllipseStyleProps>, container: Group): GEllipse | undefined;
23
23
  protected getKeyStyle(attributes: Required<EllipseStyleProps>): GEllipseStyleProps;
24
24
  protected getIconStyle(attributes: Required<EllipseStyleProps>): false | IconStyleProps;
25
- getIntersectPoint(point: Point): Point;
25
+ getIntersectPoint(point: Point, useExtendedLine?: boolean): Point;
26
26
  }
@@ -3,31 +3,45 @@ import { CustomElement } from '@antv/g';
3
3
  import type { Keyframe } from '../../types';
4
4
  export interface BaseShapeStyleProps extends BaseStyleProps {
5
5
  }
6
+ /**
7
+ * <zh/> 图形基类
8
+ *
9
+ * <en/> Base class for shapes
10
+ */
6
11
  export declare abstract class BaseShape<StyleProps extends BaseShapeStyleProps> extends CustomElement<StyleProps> {
7
12
  constructor(options: DisplayObjectConfig<StyleProps>);
13
+ /**
14
+ * <zh/> 解析后的属性
15
+ *
16
+ * <en/> parsed attributes
17
+ * @returns <zh/> 解析后的属性 | <en/> parsed attributes
18
+ * @internal
19
+ */
8
20
  protected get parsedAttributes(): Required<StyleProps>;
9
21
  /**
10
- * <zh> 图形实例映射表
22
+ * <zh/> 图形实例映射表
11
23
  *
12
- * <en> shape instance map
24
+ * <en/> shape instance map
25
+ * @internal
13
26
  */
14
27
  protected shapeMap: Record<string, DisplayObject>;
15
28
  /**
16
- * <zh> 动画实例映射表
29
+ * <zh/> 动画实例映射表
17
30
  *
18
- * <en> animation instance map
31
+ * <en/> animation instance map
32
+ * @internal
19
33
  */
20
34
  protected animateMap: Record<string, IAnimation>;
21
35
  /**
22
- * <zh> 创建、更新或删除图形
36
+ * <zh/> 创建、更新或删除图形
23
37
  *
24
- * <en> create, update or remove shape
25
- * @param className - <zh> 图形名称 | <en> shape name
26
- * @param Ctor - <zh> 图形类型 | <en> shape type
27
- * @param style - <zh> 图形样式。若要删除图形,传入 false | <en> shape style. Pass false to remove the shape
28
- * @param container - <zh> 容器 | <en> container
29
- * @param hooks - <zh> 钩子函数 | <en> hooks
30
- * @returns <zh> 图形实例 | <en> shape instance
38
+ * <en/> create, update or remove shape
39
+ * @param className - <zh/> 图形名称 | <en/> shape name
40
+ * @param Ctor - <zh/> 图形类型 | <en/> shape type
41
+ * @param style - <zh/> 图形样式。若要删除图形,传入 false | <en/> shape style. Pass false to remove the shape
42
+ * @param container - <zh/> 容器 | <en/> container
43
+ * @param hooks - <zh/> 钩子函数 | <en/> hooks
44
+ * @returns <zh/> 图形实例 | <en/> shape instance
31
45
  */
32
46
  protected upsert<T extends DisplayObject>(className: string, Ctor: string | {
33
47
  new (...args: any[]): T;
@@ -41,9 +55,9 @@ export declare abstract class BaseShape<StyleProps extends BaseShapeStyleProps>
41
55
  protected transformPosition(attributes: Partial<StyleProps>): void;
42
56
  update(attr?: Partial<StyleProps>): void;
43
57
  /**
44
- * <zh> 在初始化时会被自动调用
58
+ * <zh/> 在初始化时会被自动调用
45
59
  *
46
- * <en> will be called automatically when initializing
60
+ * <en/> will be called automatically when initializing
47
61
  * @param attributes
48
62
  * @param container
49
63
  */
@@ -61,6 +75,7 @@ export declare abstract class BaseShape<StyleProps extends BaseShapeStyleProps>
61
75
  /**
62
76
  * Get the prefix pairs for composite shapes used to handle animation
63
77
  * @returns tuples array where each tuple contains a key corresponding to a method `get${key}Style` and its shape prefix
78
+ * @internal
64
79
  */
65
80
  protected get compositeShapes(): [string, string][];
66
81
  animate(keyframes: Keyframe[], options?: number | KeyframeAnimationOptions): IAnimation | null;
@@ -26,5 +26,5 @@ export declare abstract class Polygon<T extends PolygonStyleProps = PolygonStyle
26
26
  protected drawKeyShape(attributes: Required<T>, container: Group): GPolygon | undefined;
27
27
  protected getKeyStyle(attributes: Required<T>): GPolygonStyleProps;
28
28
  protected abstract getPoints(attributes: Required<T>): Point[];
29
- getIntersectPoint(point: Point): Point;
29
+ getIntersectPoint(point: Point, useExtendedLine?: boolean): Point;
30
30
  }
@@ -1,18 +1,20 @@
1
1
  export { BaseBehavior, BrushSelect, ClickSelect, CollapseExpand, CreateEdge, DragCanvas, DragElement, DragElementForce, FixElementSize, FocusElement, HoverActivate, LassoSelect, OptimizeViewportTransform, ScrollCanvas, ZoomCanvas, } from './behaviors';
2
2
  export { CanvasEvent, ComboEvent, CommonEvent, ContainerEvent, EdgeEvent, ExtensionCategory, GraphEvent, HistoryEvent, NodeEvent, } from './constants';
3
3
  export { BaseCombo, CircleCombo, RectCombo } from './elements/combos';
4
- export { BaseEdge, Cubic, CubicHorizontal, CubicVertical, Line, Polyline, Quadratic } from './elements/edges';
4
+ export { BaseEdge, Cubic, CubicHorizontal, CubicRadial, CubicVertical, Line, Polyline, Quadratic, } from './elements/edges';
5
+ export { effect } from './elements/effect';
5
6
  export { BaseNode, Circle, Diamond, Donut, Ellipse, HTML, Hexagon, Image, Rect, Star, Triangle, } from './elements/nodes';
6
7
  export { Badge, BaseShape, Icon, Label } from './elements/shapes';
7
- export { AntVDagreLayout, BaseLayout, CircularLayout, ComboCombinedLayout, ConcentricLayout, D3ForceLayout, DagreLayout, ForceAtlas2Layout, ForceLayout, FruchtermanLayout, GridLayout, MDSLayout, RadialLayout, RandomLayout, compactBox, dendrogram, indented, mindmap, } from './layouts';
8
- export { BasePlugin, BubbleSets, CameraSetting, Contextmenu, EdgeFilterLens, Fisheye, Fullscreen, GridLine, History, Hull, Legend, Minimap, Snapline, Timebar, Toolbar, Tooltip, Watermark, } from './plugins';
8
+ export { AntVDagreLayout, BaseLayout, CircularLayout, ComboCombinedLayout, compactBox as CompactBoxLayout, ConcentricLayout, D3ForceLayout, DagreLayout, dendrogram as DendrogramLayout, ForceAtlas2Layout, ForceLayout, FruchtermanLayout, GridLayout, indented as IndentedLayout, MDSLayout, mindmap as MindmapLayout, RadialLayout, RandomLayout, } from './layouts';
9
+ export { Background, BasePlugin, BubbleSets, CameraSetting, Contextmenu, EdgeFilterLens, Fisheye, Fullscreen, GridLine, History, Hull, Legend, Minimap, Snapline, Timebar, Toolbar, Tooltip, Watermark, } from './plugins';
9
10
  export { getExtension, getExtensions } from './registry/get';
10
11
  export { register } from './registry/register';
11
12
  export { Graph } from './runtime/graph';
12
- export { BaseTransform } from './transforms';
13
+ export { BaseTransform, PositionRadialLabels, ProcessParallelEdges } from './transforms';
13
14
  export { isCollapsed } from './utils/collapsibility';
14
15
  export { idOf } from './utils/id';
15
16
  export { invokeLayoutMethod } from './utils/layout';
17
+ export { positionOf } from './utils/position';
16
18
  export { omitStyleProps, subStyleProps } from './utils/prefix';
17
19
  export { Shortcut } from './utils/shortcut';
18
20
  export { parseSize } from './utils/size';
@@ -25,14 +27,14 @@ export type { AnimationContext, AnimationEffectTiming, AnimationExecutor, Animat
25
27
  export type { BaseBehaviorOptions, BrushSelectOptions, ClickSelectOptions, CollapseExpandOptions, CreateEdgeOptions, DragCanvasOptions, DragElementForceOptions, DragElementOptions, FixElementSizeOptions, FocusElementOptions, HoverActivateOptions, LassoSelectOptions, OptimizeViewportTransformOptions, ScrollCanvasOptions, ZoomCanvasOptions, } from './behaviors';
26
28
  export type { FixShapeConfig } from './behaviors/fix-element-size';
27
29
  export type { BaseComboStyleProps, CircleComboStyleProps, RectComboStyleProps } from './elements/combos';
28
- export type { BaseEdgeStyleProps, CubicHorizontalStyleProps, CubicStyleProps, CubicVerticalStyleProps, LineStyleProps, PolylineStyleProps, QuadraticStyleProps, } from './elements/edges';
30
+ export type { BaseEdgeStyleProps, CubicHorizontalStyleProps, CubicRadialStyleProps, CubicStyleProps, CubicVerticalStyleProps, LineStyleProps, PolylineStyleProps, QuadraticStyleProps, } from './elements/edges';
29
31
  export type { BaseNodeStyleProps, CircleStyleProps, DiamondStyleProps, DonutStyleProps, EllipseStyleProps, HTMLStyleProps, HexagonStyleProps, ImageStyleProps, RectStyleProps, StarStyleProps, TriangleStyleProps, } from './elements/nodes';
30
32
  export type { BadgeStyleProps, BaseShapeStyleProps, IconStyleProps, LabelStyleProps, PolygonStyleProps, } from './elements/shapes';
31
33
  export type { UpsertHooks } from './elements/shapes/base-shape';
32
34
  export type { ContourLabelStyleProps, ContourStyleProps } from './elements/shapes/contour';
33
35
  export type { BaseLayoutOptions, WebWorkerLayoutOptions } from './layouts/types';
34
36
  export type { CategoricalPalette } from './palettes/types';
35
- export type { BasePluginOptions, BubbleSetsOptions, CameraSettingOptions, ContextmenuOptions, EdgeFilterLensOptions, FisheyeOptions, FullscreenOptions, GridLineOptions, HistoryOptions, HullOptions, LegendOptions, MinimapOptions, SnaplineOptions, TimebarOptions, ToolbarOptions, TooltipOptions, WatermarkOptions, } from './plugins';
37
+ export type { BackgroundOptions, BasePluginOptions, BubbleSetsOptions, CameraSettingOptions, ContextmenuOptions, EdgeFilterLensOptions, FisheyeOptions, FullscreenOptions, GridLineOptions, HistoryOptions, HullOptions, LegendOptions, MinimapOptions, SnaplineOptions, TimebarOptions, ToolbarOptions, TooltipOptions, WatermarkOptions, } from './plugins';
36
38
  export type { DataURLOptions } from './runtime/canvas';
37
39
  export type { RuntimeContext } from './runtime/types';
38
40
  export type { BehaviorOptions, CanvasOptions, ComboData, ComboOptions, EdgeData, EdgeOptions, GraphData, GraphOptions, NodeData, NodeOptions, PluginOptions, ThemeOptions, ViewportOptions, } from './spec';
@@ -40,7 +42,7 @@ export type { CustomBehaviorOption } from './spec/behavior';
40
42
  export type { AnimationStage } from './spec/element/animation';
41
43
  export type { LayoutOptions, STDLayoutOptions, SingleLayoutOptions } from './spec/layout';
42
44
  export type { CustomPluginOption } from './spec/plugin';
43
- export type { BaseTransformOptions } from './transforms';
45
+ export type { BaseTransformOptions, PositionRadialLabelsOptions, ProcessParallelEdgesOptions } from './transforms';
44
46
  export type { DrawData } from './transforms/types';
45
47
  export type { BaseElementStyleProps, CardinalPlacement, CollapsedMarkerStyleProps, Combo, CornerPlacement, DirectionalPlacement, Edge, EdgeArrowStyleProps, EdgeDirection, EdgeLabelStyleProps, Element, ElementDatum, ElementHooks, ElementMethods, ElementType, FitViewOptions, HierarchyKey, IAnimateEvent, ID, IDragEvent, IElementDragEvent, IElementEvent, IElementLifeCycleEvent, IEvent, IGraphLifeCycleEvent, IKeyboardEvent, IPointerEvent, IViewportEvent, IWheelEvent, LoopPlacement, LoopStyleProps, Node, NodeBadgeStyleProps, NodeLabelStyleProps, NodeLikeData, NodePortStyleProps, Padding, Placement, Point, PortStyleProps, Prefix, PrefixKey, RelativePlacement, Size, State, TransformOptions, TreeData, TriangleDirection, Vector2, Vector3, ViewportAnimationEffectTiming, } from './types';
46
48
  export type { Command, CommandData } from './types/history';
@@ -1,6 +1,11 @@
1
1
  import type { RuntimeContext } from '../runtime/types';
2
2
  import type { GraphData } from '../spec';
3
3
  import type { BaseLayoutOptions } from './types';
4
+ /**
5
+ * <zh/> 布局的基类
6
+ *
7
+ * <en/> Base class for layout
8
+ */
4
9
  export declare abstract class BaseLayout<O extends BaseLayoutOptions = any> {
5
10
  abstract id: string;
6
11
  options: O;
@@ -33,6 +33,7 @@ export declare class Background extends BasePlugin<BackgroundOptions> {
33
33
  * <zh/> 销毁背景图
34
34
  *
35
35
  * <en/> Destroy the background image
36
+ * @internal
36
37
  */
37
38
  destroy(): void;
38
39
  }
@@ -2,5 +2,10 @@ import { BaseExtension } from '../registry/extension';
2
2
  import type { CustomPluginOption } from '../spec/plugin';
3
3
  export interface BasePluginOptions extends CustomPluginOption {
4
4
  }
5
+ /**
6
+ * <zh/> 插件的基类
7
+ *
8
+ * <en/> Base class for plugins
9
+ */
5
10
  export declare abstract class BasePlugin<T extends BasePluginOptions> extends BaseExtension<T> {
6
11
  }
@@ -111,6 +111,7 @@ export declare class BubbleSets extends BasePlugin<BubbleSetsOptions> {
111
111
  * <zh/> 销毁
112
112
  *
113
113
  * <en/> Destroy
114
+ * @internal
114
115
  */
115
116
  destroy(): void;
116
117
  }
@@ -108,6 +108,7 @@ export declare class Contextmenu extends BasePlugin<ContextmenuOptions> {
108
108
  * <zh/> 销毁上下文菜单
109
109
  *
110
110
  * <en/> Destroy the contextmenu
111
+ * @internal
111
112
  */
112
113
  destroy(): void;
113
114
  private getDOMContent;
@@ -101,6 +101,7 @@ export declare class GridLine extends BasePlugin<GridLineOptions> {
101
101
  * <zh/> 销毁网格线
102
102
  *
103
103
  * <en/> Destroy the grid line
104
+ * @internal
104
105
  */
105
106
  destroy(): void;
106
107
  }
@@ -114,6 +114,7 @@ export declare class History extends BasePlugin<HistoryOptions> {
114
114
  * <zh/> 销毁
115
115
  *
116
116
  * <en/> Destroy
117
+ * @internal
117
118
  */
118
119
  destroy(): void;
119
120
  }
@@ -109,6 +109,7 @@ export declare class Hull extends BasePlugin<HullOptions> {
109
109
  * <zh/> 销毁 Hull
110
110
  *
111
111
  * <en/> Destroy Hull
112
+ * @internal
112
113
  */
113
114
  destroy(): void;
114
115
  }
@@ -124,6 +124,7 @@ export declare class Legend extends BasePlugin<LegendOptions> {
124
124
  * <zh/>销毁图例
125
125
  *
126
126
  * <en/> Destroy the legend
127
+ * @internal
127
128
  */
128
129
  destroy(): void;
129
130
  }
@@ -4,15 +4,16 @@ import type { ElementType, Padding, Placement } from '../../types';
4
4
  import type { BasePluginOptions } from '../base-plugin';
5
5
  import { BasePlugin } from '../base-plugin';
6
6
  /**
7
- * <zh/> 缩略图插件的配置项
7
+ * <zh/> 缩略图插件配置项
8
8
  *
9
- * <en/> The configuration item of the Minimap plugin
9
+ * <en/> Minimap plugin options
10
10
  */
11
11
  export interface MinimapOptions extends BasePluginOptions {
12
12
  /**
13
13
  * <zh/> 宽度和高度
14
14
  *
15
15
  * <en/> Width and height
16
+ * @defaultValue [240, 160]
16
17
  */
17
18
  size?: [number, number];
18
19
  /**
@@ -84,6 +85,11 @@ export interface MinimapOptions extends BasePluginOptions {
84
85
  */
85
86
  renderer?: IRenderer;
86
87
  }
88
+ /**
89
+ * <zh/> 缩略图插件
90
+ *
91
+ * <en/> Minimap plugin
92
+ */
87
93
  export declare class Minimap extends BasePlugin<MinimapOptions> {
88
94
  static defaultOptions: Partial<MinimapOptions>;
89
95
  private canvas;
@@ -3,6 +3,11 @@ import type { RuntimeContext } from '../../runtime/types';
3
3
  import type { IDragEvent, Node } from '../../types';
4
4
  import type { BasePluginOptions } from '../base-plugin';
5
5
  import { BasePlugin } from '../base-plugin';
6
+ /**
7
+ * <zh/> 对齐线插件配置项
8
+ *
9
+ * <en/> Snapline plugin options
10
+ */
6
11
  export interface SnaplineOptions extends BasePluginOptions {
7
12
  /**
8
13
  * <zh/> 对齐精度,即移动节点时与目标位置的距离小于 tolerance 时触发显示对齐线
@@ -62,6 +67,11 @@ export interface SnaplineOptions extends BasePluginOptions {
62
67
  */
63
68
  filter?: (node: Node) => boolean;
64
69
  }
70
+ /**
71
+ * <zh/> 对齐线插件
72
+ *
73
+ * <en/> Snapline plugin
74
+ */
65
75
  export declare class Snapline extends BasePlugin<SnaplineOptions> {
66
76
  static defaultOptions: Partial<SnaplineOptions>;
67
77
  private horizontalLine;
@@ -236,6 +236,7 @@ export declare class Timebar extends BasePlugin<TimebarOptions> {
236
236
  * <zh/> 销毁时间条
237
237
  *
238
238
  * <en/> Destroy the timebar
239
+ * @internal
239
240
  */
240
241
  destroy(): void;
241
242
  }
@@ -62,6 +62,7 @@ export declare class Toolbar extends BasePlugin<ToolbarOptions> {
62
62
  * <zh/> 销毁工具栏
63
63
  *
64
64
  * <en/> Destroy the toolbar
65
+ * @internal
65
66
  */
66
67
  destroy(): void;
67
68
  private getDOMContent;
@@ -3,6 +3,11 @@ import type { RuntimeContext } from '../runtime/types';
3
3
  import type { ElementDatum, ID, IElementEvent } from '../types';
4
4
  import type { BasePluginOptions } from './base-plugin';
5
5
  import { BasePlugin } from './base-plugin';
6
+ /**
7
+ * <zh/> 提示框插件配置项
8
+ *
9
+ * <en/> Tooltip plugin options
10
+ */
6
11
  export interface TooltipOptions extends BasePluginOptions, Pick<TooltipStyleProps, 'position' | 'offset' | 'enterable' | 'style' | 'container' | 'title'> {
7
12
  /**
8
13
  * <zh/> 触发行为,可选 hover | click
@@ -29,6 +34,11 @@ export interface TooltipOptions extends BasePluginOptions, Pick<TooltipStyleProp
29
34
  */
30
35
  enable?: boolean | ((event: IElementEvent) => boolean);
31
36
  }
37
+ /**
38
+ * <zh/> 提示框插件
39
+ *
40
+ * <en/> Tooltip plugin
41
+ */
32
42
  export declare class Tooltip extends BasePlugin<TooltipOptions> {
33
43
  static defaultOptions: Partial<TooltipOptions>;
34
44
  private currentTarget;
@@ -112,6 +122,7 @@ export declare class Tooltip extends BasePlugin<TooltipOptions> {
112
122
  * <zh/> 销毁tooltip
113
123
  *
114
124
  * <en/> Destroy tooltip
125
+ * @internal
115
126
  */
116
127
  destroy(): void;
117
128
  }
@@ -186,6 +186,7 @@ export declare class Watermark extends BasePlugin<WatermarkOptions> {
186
186
  * <zh/> 销毁水印
187
187
  *
188
188
  * <en/> Destroy the watermark
189
+ * @internal
189
190
  */
190
191
  destroy(): void;
191
192
  }
@@ -68,6 +68,7 @@ export declare class DataController {
68
68
  getEdgeDatum(id: ID): EdgeData;
69
69
  getEdgeData(ids?: ID[]): EdgeData[];
70
70
  getComboData(ids?: ID[]): ComboData[];
71
+ getRootsData(hierarchyKey?: HierarchyKey): NodeLikeData[];
71
72
  getAncestorsData(id: ID, hierarchyKey: HierarchyKey): NodeLikeData[];
72
73
  getDescendantsData(id: ID): NodeLikeData[];
73
74
  getParentData(id: ID, hierarchyKey: HierarchyKey): NodeLikeData | undefined;
@@ -66,6 +66,7 @@ export declare class ElementController {
66
66
  private transformData;
67
67
  private createElement;
68
68
  private createElements;
69
+ private getUpdateStageStyle;
69
70
  private updateElement;
70
71
  private updateElements;
71
72
  private visibilityCache;
@@ -42,6 +42,7 @@ export declare class Graph extends EventEmitter {
42
42
  * @apiCategory option
43
43
  */
44
44
  setOptions(options: GraphOptions): void;
45
+ private _setOptions;
45
46
  /**
46
47
  * <zh/> 获取当前画布容器的尺寸
47
48
  *
@@ -723,6 +724,7 @@ export declare class Graph extends EventEmitter {
723
724
  */
724
725
  getElementDataByState(elementType: 'combo', state: State): ComboData[];
725
726
  private initCanvas;
727
+ private updateCanvas;
726
728
  private initRuntime;
727
729
  private prepare;
728
730
  /**
@@ -13,6 +13,7 @@ export declare class LayoutController {
13
13
  constructor(context: RuntimeContext);
14
14
  getLayoutInstance(): BaseLayout[];
15
15
  layout(): Promise<void>;
16
+ private transformDataAfterLayout;
16
17
  /**
17
18
  * <zh/> 模拟布局
18
19
  *
@@ -3,6 +3,12 @@ import type { DrawContext } from '../runtime/element';
3
3
  import type { CustomBehaviorOption } from '../spec/behavior';
4
4
  import type { DrawData } from './types';
5
5
  export type BaseTransformOptions = CustomBehaviorOption;
6
+ /**
7
+ * <zh/> 数据转换的基类
8
+ *
9
+ * <en/> Base class for data transforms
10
+ */
6
11
  export declare abstract class BaseTransform<T extends BaseTransformOptions = BaseTransformOptions> extends BaseExtension<T> {
7
12
  beforeDraw(data: DrawData, context: DrawContext): DrawData;
13
+ afterLayout(): void;
8
14
  }
@@ -3,6 +3,9 @@ export { BaseTransform } from './base-transform';
3
3
  export { CollapseExpandCombo } from './collapse-expand-combo';
4
4
  export { CollapseExpandNode } from './collapse-expand-node';
5
5
  export { GetEdgeActualEnds } from './get-edge-actual-ends';
6
+ export { PositionRadialLabels } from './position-radial-labels';
6
7
  export { ProcessParallelEdges } from './process-parallel-edges';
7
8
  export { UpdateRelatedEdge } from './update-related-edge';
8
9
  export type { BaseTransformOptions } from './base-transform';
10
+ export type { PositionRadialLabelsOptions } from './position-radial-labels';
11
+ export type { ProcessParallelEdgesOptions } from './process-parallel-edges';
@@ -0,0 +1,27 @@
1
+ import type { RuntimeContext } from '../runtime/types';
2
+ import type { BaseTransformOptions } from './base-transform';
3
+ import { BaseTransform } from './base-transform';
4
+ /**
5
+ * <zh/> 根据径向布局自动调整节点标签样式的配置项
6
+ *
7
+ * <en/> Options for automatically adjusting the style of node labels according to the radial layout
8
+ */
9
+ export interface PositionRadialLabelsOptions extends BaseTransformOptions {
10
+ /**
11
+ * <zh/> 偏移量
12
+ *
13
+ * <en/> Offset
14
+ */
15
+ offset?: number;
16
+ }
17
+ /**
18
+ * <zh/> 根据径向布局自动调整节点标签样式,包括位置和旋转角度
19
+ *
20
+ * <en/> Automatically adjust the style of node labels according to the radial layout, including position and rotation angle
21
+ */
22
+ export declare class PositionRadialLabels extends BaseTransform<PositionRadialLabelsOptions> {
23
+ static defaultOptions: Partial<PositionRadialLabelsOptions>;
24
+ constructor(context: RuntimeContext, options: PositionRadialLabelsOptions);
25
+ private get ref();
26
+ afterLayout(): void;
27
+ }