@antv/g6 5.0.0-beta.8 → 5.0.0

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 (2728) hide show
  1. package/LICENSE +21 -0
  2. package/dist/g6.min.js +2 -2
  3. package/dist/lib/animations/executor.d.ts +11 -0
  4. package/dist/lib/animations/index.d.ts +32 -0
  5. package/dist/lib/animations/types.d.ts +113 -0
  6. package/dist/lib/behaviors/base-behavior.d.ts +6 -0
  7. package/dist/lib/behaviors/brush-select.d.ts +189 -0
  8. package/dist/lib/behaviors/click-select.d.ts +116 -0
  9. package/dist/lib/behaviors/collapse-expand.d.ts +64 -0
  10. package/dist/lib/behaviors/create-edge.d.ts +75 -0
  11. package/dist/lib/behaviors/drag-canvas.d.ts +83 -0
  12. package/dist/lib/behaviors/drag-element-force.d.ts +53 -0
  13. package/dist/lib/behaviors/drag-element.d.ts +209 -0
  14. package/dist/lib/behaviors/focus-element.d.ts +42 -0
  15. package/dist/lib/behaviors/hover-activate.d.ts +84 -0
  16. package/dist/lib/behaviors/index.d.ts +26 -0
  17. package/dist/lib/behaviors/lasso-select.d.ts +41 -0
  18. package/dist/lib/behaviors/scroll-canvas.d.ts +85 -0
  19. package/dist/lib/behaviors/types.d.ts +6 -0
  20. package/dist/lib/behaviors/zoom-canvas.d.ts +98 -0
  21. package/dist/lib/constants/animation.d.ts +3 -0
  22. package/dist/lib/constants/change.d.ts +64 -0
  23. package/dist/lib/constants/element.d.ts +7 -0
  24. package/dist/lib/constants/events/animation.d.ts +6 -0
  25. package/dist/lib/constants/events/canvas.d.ts +115 -0
  26. package/dist/lib/constants/events/combo.d.ts +109 -0
  27. package/dist/lib/constants/events/common.d.ts +122 -0
  28. package/dist/lib/constants/events/container.d.ts +14 -0
  29. package/dist/lib/constants/events/edge.d.ts +91 -0
  30. package/dist/lib/constants/events/graph.d.ts +158 -0
  31. package/dist/lib/constants/events/history.d.ts +38 -0
  32. package/dist/lib/constants/events/index.d.ts +9 -0
  33. package/dist/lib/constants/events/node.d.ts +109 -0
  34. package/dist/lib/constants/graphlib.d.ts +2 -0
  35. package/dist/lib/constants/index.d.ts +5 -0
  36. package/dist/lib/constants/registry.d.ts +62 -0
  37. package/dist/lib/elements/base-element.d.ts +35 -0
  38. package/dist/lib/elements/combos/base-combo.d.ts +91 -0
  39. package/dist/lib/elements/combos/circle.d.ts +25 -0
  40. package/dist/lib/elements/combos/index.d.ts +6 -0
  41. package/dist/lib/elements/combos/rect.d.ts +21 -0
  42. package/dist/lib/elements/edges/base-edge.d.ts +164 -0
  43. package/dist/lib/elements/edges/cubic-horizontal.d.ts +39 -0
  44. package/dist/lib/elements/edges/cubic-vertical.d.ts +39 -0
  45. package/dist/lib/elements/edges/cubic.d.ts +48 -0
  46. package/dist/lib/elements/edges/index.d.ts +14 -0
  47. package/dist/lib/elements/edges/line.d.ts +25 -0
  48. package/dist/lib/elements/edges/polyline.d.ts +63 -0
  49. package/dist/lib/elements/edges/quadratic.d.ts +44 -0
  50. package/dist/lib/elements/index.d.ts +3 -0
  51. package/dist/lib/elements/nodes/base-node.d.ts +193 -0
  52. package/dist/lib/elements/nodes/circle.d.ts +26 -0
  53. package/dist/lib/elements/nodes/diamond.d.ts +21 -0
  54. package/dist/lib/elements/nodes/donut.d.ts +45 -0
  55. package/dist/lib/elements/nodes/ellipse.d.ts +26 -0
  56. package/dist/lib/elements/nodes/hexagon.d.ts +28 -0
  57. package/dist/lib/elements/nodes/html.d.ts +41 -0
  58. package/dist/lib/elements/nodes/image.d.ts +38 -0
  59. package/dist/lib/elements/nodes/index.d.ts +22 -0
  60. package/dist/lib/elements/nodes/rect.d.ts +25 -0
  61. package/dist/lib/elements/nodes/star.d.ts +30 -0
  62. package/dist/lib/elements/nodes/triangle.d.ts +31 -0
  63. package/dist/lib/elements/shapes/badge.d.ts +15 -0
  64. package/dist/lib/elements/shapes/base-shape.d.ts +63 -0
  65. package/dist/lib/elements/shapes/contour.d.ts +66 -0
  66. package/dist/lib/elements/shapes/icon.d.ts +13 -0
  67. package/dist/lib/elements/shapes/index.d.ts +16 -0
  68. package/dist/lib/elements/shapes/label.d.ts +32 -0
  69. package/dist/lib/elements/shapes/polygon.d.ts +30 -0
  70. package/dist/lib/exports.d.ts +40 -0
  71. package/dist/lib/index.d.ts +3 -0
  72. package/dist/lib/layouts/base-layout.d.ts +10 -0
  73. package/dist/lib/layouts/index.d.ts +4 -0
  74. package/dist/lib/layouts/types.d.ts +84 -0
  75. package/dist/lib/palettes/index.d.ts +10 -0
  76. package/dist/lib/palettes/types.d.ts +5 -0
  77. package/dist/lib/plugins/background/index.d.ts +38 -0
  78. package/dist/lib/plugins/base-plugin.d.ts +6 -0
  79. package/dist/lib/plugins/bubble-sets.d.ts +116 -0
  80. package/dist/lib/plugins/camera-setting.d.ts +111 -0
  81. package/dist/lib/plugins/contextmenu/index.d.ts +115 -0
  82. package/dist/lib/plugins/contextmenu/util.d.ts +26 -0
  83. package/dist/lib/plugins/fullscreen/index.d.ts +79 -0
  84. package/dist/lib/plugins/grid-line.d.ts +106 -0
  85. package/dist/lib/plugins/history/index.d.ts +120 -0
  86. package/dist/lib/plugins/history/util.d.ts +21 -0
  87. package/dist/lib/plugins/hull/index.d.ts +114 -0
  88. package/dist/lib/plugins/hull/util.d.ts +12 -0
  89. package/dist/lib/plugins/index.d.ts +28 -0
  90. package/dist/lib/plugins/legend.d.ts +129 -0
  91. package/dist/lib/plugins/timebar.d.ts +241 -0
  92. package/dist/lib/plugins/toolbar/index.d.ts +69 -0
  93. package/dist/lib/plugins/toolbar/util.d.ts +33 -0
  94. package/dist/lib/plugins/tooltip.d.ts +116 -0
  95. package/dist/lib/plugins/types.d.ts +4 -0
  96. package/dist/lib/plugins/watermark/index.d.ts +191 -0
  97. package/dist/lib/plugins/watermark/util.d.ts +18 -0
  98. package/dist/lib/preset.d.ts +1 -0
  99. package/dist/lib/registry/build-in.d.ts +6 -0
  100. package/dist/lib/registry/extension/index.d.ts +33 -0
  101. package/dist/lib/registry/extension/types.d.ts +38 -0
  102. package/dist/lib/registry/index.d.ts +59 -0
  103. package/dist/lib/registry/types.d.ts +39 -0
  104. package/dist/lib/runtime/animation.d.ts +54 -0
  105. package/dist/lib/runtime/batch.d.ts +11 -0
  106. package/dist/lib/runtime/behavior.d.ts +20 -0
  107. package/dist/lib/runtime/canvas.d.ts +60 -0
  108. package/dist/lib/runtime/data.d.ts +202 -0
  109. package/dist/lib/runtime/element.d.ts +102 -0
  110. package/dist/lib/runtime/graph.d.ts +1011 -0
  111. package/dist/lib/runtime/layout.d.ts +38 -0
  112. package/dist/lib/runtime/plugin.d.ts +10 -0
  113. package/dist/lib/runtime/transform.d.ts +12 -0
  114. package/dist/lib/runtime/types.d.ts +90 -0
  115. package/dist/lib/runtime/viewport.d.ts +58 -0
  116. package/dist/lib/spec/behavior.d.ts +30 -0
  117. package/dist/lib/spec/canvas.d.ts +53 -0
  118. package/dist/lib/spec/data.d.ts +222 -0
  119. package/dist/lib/spec/element/animation.d.ts +6 -0
  120. package/dist/lib/spec/element/combo.d.ts +52 -0
  121. package/dist/lib/spec/element/edge.d.ts +52 -0
  122. package/dist/lib/spec/element/node.d.ts +52 -0
  123. package/dist/lib/spec/element/palette.d.ts +53 -0
  124. package/dist/lib/spec/graph.d.ts +91 -0
  125. package/dist/lib/spec/index.d.ts +12 -0
  126. package/dist/lib/spec/layout.d.ts +4 -0
  127. package/dist/lib/spec/plugin.d.ts +32 -0
  128. package/dist/lib/spec/theme.d.ts +7 -0
  129. package/dist/lib/spec/transform.d.ts +12 -0
  130. package/dist/lib/spec/viewport.d.ts +82 -0
  131. package/dist/lib/themes/base.d.ts +34 -0
  132. package/dist/lib/themes/dark.d.ts +2 -0
  133. package/dist/lib/themes/index.d.ts +2 -0
  134. package/dist/lib/themes/light.d.ts +2 -0
  135. package/dist/lib/themes/types.d.ts +9 -0
  136. package/dist/lib/transforms/arrange-draw-order.d.ts +10 -0
  137. package/dist/lib/transforms/base-transform.d.ts +8 -0
  138. package/dist/lib/transforms/collapse-expand-combo.d.ts +11 -0
  139. package/dist/lib/transforms/collapse-expand-node.d.ts +12 -0
  140. package/dist/lib/transforms/get-edge-actual-ends.d.ts +13 -0
  141. package/dist/lib/transforms/index.d.ts +8 -0
  142. package/dist/lib/transforms/process-parallel-edges.d.ts +85 -0
  143. package/dist/lib/transforms/types.d.ts +20 -0
  144. package/dist/lib/transforms/update-related-edge.d.ts +10 -0
  145. package/dist/lib/transforms/utils.d.ts +13 -0
  146. package/dist/lib/types/anchor.d.ts +3 -0
  147. package/dist/lib/types/animation.d.ts +5 -0
  148. package/dist/lib/types/callable.d.ts +30 -0
  149. package/dist/lib/types/canvas.d.ts +1 -0
  150. package/dist/lib/types/change.d.ts +68 -0
  151. package/dist/lib/types/combo.d.ts +23 -0
  152. package/dist/lib/types/data.d.ts +44 -0
  153. package/dist/lib/types/edge.d.ts +127 -0
  154. package/dist/lib/types/element.d.ts +18 -0
  155. package/dist/lib/types/enum.d.ts +1 -0
  156. package/dist/lib/types/event.d.ts +55 -0
  157. package/dist/lib/types/graphlib.d.ts +16 -0
  158. package/dist/lib/types/history.d.ts +51 -0
  159. package/dist/lib/types/id.d.ts +1 -0
  160. package/dist/lib/types/index.d.ts +26 -0
  161. package/dist/lib/types/layout.d.ts +9 -0
  162. package/dist/lib/types/node.d.ts +144 -0
  163. package/dist/lib/types/padding.d.ts +2 -0
  164. package/dist/lib/types/placement.d.ts +5 -0
  165. package/dist/lib/types/plugin.d.ts +5 -0
  166. package/dist/lib/types/point.d.ts +2 -0
  167. package/dist/lib/types/position.d.ts +2 -0
  168. package/dist/lib/types/prefix.d.ts +17 -0
  169. package/dist/lib/types/size.d.ts +3 -0
  170. package/dist/lib/types/state.d.ts +1 -0
  171. package/dist/lib/types/style.d.ts +9 -0
  172. package/dist/lib/types/tree.d.ts +5 -0
  173. package/dist/lib/types/vector.d.ts +2 -0
  174. package/dist/lib/types/viewport.d.ts +36 -0
  175. package/dist/lib/utils/anchor.d.ts +9 -0
  176. package/dist/lib/utils/animation.d.ts +47 -0
  177. package/dist/lib/utils/array.d.ts +9 -0
  178. package/dist/lib/utils/bbox.d.ts +108 -0
  179. package/dist/lib/utils/cache.d.ts +36 -0
  180. package/dist/lib/utils/change.d.ts +17 -0
  181. package/dist/lib/utils/collapsibility.d.ts +9 -0
  182. package/dist/lib/utils/data.d.ts +34 -0
  183. package/dist/lib/utils/diff.d.ts +15 -0
  184. package/dist/lib/utils/dom.d.ts +29 -0
  185. package/dist/lib/utils/edge.d.ts +192 -0
  186. package/dist/lib/utils/element.d.ts +231 -0
  187. package/dist/lib/utils/event/events.d.ts +26 -0
  188. package/dist/lib/utils/event/index.d.ts +29 -0
  189. package/dist/lib/utils/extension.d.ts +10 -0
  190. package/dist/lib/utils/graphlib.d.ts +14 -0
  191. package/dist/lib/utils/id.d.ts +20 -0
  192. package/dist/lib/utils/is.d.ts +34 -0
  193. package/dist/lib/utils/layout.d.ts +70 -0
  194. package/dist/lib/utils/line.d.ts +21 -0
  195. package/dist/lib/utils/math.d.ts +10 -0
  196. package/dist/lib/utils/node.d.ts +11 -0
  197. package/dist/lib/utils/padding.d.ts +9 -0
  198. package/dist/lib/utils/palette.d.ts +32 -0
  199. package/dist/lib/utils/path.d.ts +35 -0
  200. package/dist/lib/utils/placement.d.ts +9 -0
  201. package/dist/lib/utils/point.d.ts +192 -0
  202. package/dist/lib/utils/polygon.d.ts +17 -0
  203. package/dist/lib/utils/position.d.ts +50 -0
  204. package/dist/lib/utils/prefix.d.ts +66 -0
  205. package/dist/lib/utils/relation.d.ts +33 -0
  206. package/dist/lib/utils/router/orth.d.ts +103 -0
  207. package/dist/lib/utils/shape.d.ts +9 -0
  208. package/dist/lib/utils/shortcut.d.ts +31 -0
  209. package/dist/lib/utils/size.d.ts +7 -0
  210. package/dist/lib/utils/style.d.ts +30 -0
  211. package/dist/lib/utils/symbol.d.ts +30 -0
  212. package/dist/lib/utils/text.d.ts +26 -0
  213. package/dist/lib/utils/theme.d.ts +9 -0
  214. package/dist/lib/utils/transform.d.ts +24 -0
  215. package/dist/lib/utils/traverse.d.ts +23 -0
  216. package/dist/lib/utils/tree.d.ts +17 -0
  217. package/dist/lib/utils/vector.d.ts +143 -0
  218. package/dist/lib/utils/visibility.d.ts +13 -0
  219. package/esm/animations/executor.d.ts +11 -0
  220. package/esm/animations/executor.js +70 -0
  221. package/esm/animations/executor.js.map +1 -0
  222. package/esm/animations/index.d.ts +32 -0
  223. package/esm/animations/index.js +15 -0
  224. package/esm/animations/index.js.map +1 -0
  225. package/esm/animations/types.d.ts +113 -0
  226. package/esm/animations/types.js.map +1 -0
  227. package/esm/behaviors/base-behavior.d.ts +6 -0
  228. package/esm/behaviors/base-behavior.js +4 -0
  229. package/esm/behaviors/base-behavior.js.map +1 -0
  230. package/esm/behaviors/brush-select.d.ts +189 -0
  231. package/esm/behaviors/brush-select.js +273 -0
  232. package/esm/behaviors/brush-select.js.map +1 -0
  233. package/esm/behaviors/click-select.d.ts +116 -0
  234. package/esm/behaviors/click-select.js +133 -0
  235. package/esm/behaviors/click-select.js.map +1 -0
  236. package/esm/behaviors/collapse-expand.d.ts +64 -0
  237. package/esm/behaviors/collapse-expand.js +76 -0
  238. package/esm/behaviors/collapse-expand.js.map +1 -0
  239. package/esm/behaviors/create-edge.d.ts +75 -0
  240. package/esm/behaviors/create-edge.js +155 -0
  241. package/esm/behaviors/create-edge.js.map +1 -0
  242. package/esm/behaviors/drag-canvas.d.ts +83 -0
  243. package/esm/behaviors/drag-canvas.js +97 -0
  244. package/esm/behaviors/drag-canvas.js.map +1 -0
  245. package/esm/behaviors/drag-element-force.d.ts +53 -0
  246. package/esm/behaviors/drag-element-force.js +94 -0
  247. package/esm/behaviors/drag-element-force.js.map +1 -0
  248. package/esm/behaviors/drag-element.d.ts +209 -0
  249. package/esm/behaviors/drag-element.js +310 -0
  250. package/esm/behaviors/drag-element.js.map +1 -0
  251. package/esm/behaviors/focus-element.d.ts +42 -0
  252. package/esm/behaviors/focus-element.js +58 -0
  253. package/esm/behaviors/focus-element.js.map +1 -0
  254. package/esm/behaviors/hover-activate.d.ts +84 -0
  255. package/esm/behaviors/hover-activate.js +104 -0
  256. package/esm/behaviors/hover-activate.js.map +1 -0
  257. package/esm/behaviors/index.d.ts +26 -0
  258. package/esm/behaviors/index.js +14 -0
  259. package/esm/behaviors/index.js.map +1 -0
  260. package/esm/behaviors/lasso-select.d.ts +41 -0
  261. package/esm/behaviors/lasso-select.js +66 -0
  262. package/esm/behaviors/lasso-select.js.map +1 -0
  263. package/esm/behaviors/scroll-canvas.d.ts +85 -0
  264. package/esm/behaviors/scroll-canvas.js +100 -0
  265. package/esm/behaviors/scroll-canvas.js.map +1 -0
  266. package/esm/behaviors/types.d.ts +6 -0
  267. package/esm/behaviors/types.js.map +1 -0
  268. package/esm/behaviors/zoom-canvas.d.ts +98 -0
  269. package/esm/behaviors/zoom-canvas.js +110 -0
  270. package/esm/behaviors/zoom-canvas.js.map +1 -0
  271. package/esm/constants/animation.d.ts +3 -0
  272. package/esm/constants/animation.js +10 -0
  273. package/esm/constants/animation.js.map +1 -0
  274. package/esm/constants/change.d.ts +64 -0
  275. package/esm/constants/change.js +66 -0
  276. package/esm/constants/change.js.map +1 -0
  277. package/esm/constants/element.d.ts +7 -0
  278. package/esm/constants/element.js +8 -0
  279. package/esm/constants/element.js.map +1 -0
  280. package/esm/constants/events/animation.d.ts +6 -0
  281. package/esm/constants/events/animation.js +8 -0
  282. package/esm/constants/events/animation.js.map +1 -0
  283. package/esm/constants/events/canvas.d.ts +115 -0
  284. package/esm/constants/events/canvas.js +117 -0
  285. package/esm/constants/events/canvas.js.map +1 -0
  286. package/esm/constants/events/combo.d.ts +109 -0
  287. package/esm/constants/events/combo.js +111 -0
  288. package/esm/constants/events/combo.js.map +1 -0
  289. package/esm/constants/events/common.d.ts +122 -0
  290. package/esm/constants/events/common.js +124 -0
  291. package/esm/constants/events/common.js.map +1 -0
  292. package/esm/constants/events/container.d.ts +14 -0
  293. package/esm/constants/events/container.js +16 -0
  294. package/esm/constants/events/container.js.map +1 -0
  295. package/esm/constants/events/edge.d.ts +91 -0
  296. package/esm/constants/events/edge.js +93 -0
  297. package/esm/constants/events/edge.js.map +1 -0
  298. package/esm/constants/events/graph.d.ts +158 -0
  299. package/esm/constants/events/graph.js +160 -0
  300. package/esm/constants/events/graph.js.map +1 -0
  301. package/esm/constants/events/history.d.ts +38 -0
  302. package/esm/constants/events/history.js +40 -0
  303. package/esm/constants/events/history.js.map +1 -0
  304. package/esm/constants/events/index.d.ts +9 -0
  305. package/esm/constants/events/index.js +10 -0
  306. package/esm/constants/events/index.js.map +1 -0
  307. package/esm/constants/events/node.d.ts +109 -0
  308. package/esm/constants/events/node.js +111 -0
  309. package/esm/constants/events/node.js.map +1 -0
  310. package/esm/constants/graphlib.d.ts +2 -0
  311. package/esm/constants/graphlib.js +3 -0
  312. package/esm/constants/graphlib.js.map +1 -0
  313. package/esm/constants/index.d.ts +5 -0
  314. package/esm/constants/index.js +6 -0
  315. package/esm/constants/index.js.map +1 -0
  316. package/esm/constants/registry.d.ts +62 -0
  317. package/esm/constants/registry.js +64 -0
  318. package/esm/constants/registry.js.map +1 -0
  319. package/esm/elements/base-element.d.ts +35 -0
  320. package/esm/elements/base-element.js +42 -0
  321. package/esm/elements/base-element.js.map +1 -0
  322. package/esm/elements/combos/base-combo.d.ts +91 -0
  323. package/esm/elements/combos/base-combo.js +162 -0
  324. package/esm/elements/combos/base-combo.js.map +1 -0
  325. package/esm/elements/combos/circle.d.ts +25 -0
  326. package/esm/elements/combos/circle.js +45 -0
  327. package/esm/elements/combos/circle.js.map +1 -0
  328. package/esm/elements/combos/index.d.ts +6 -0
  329. package/esm/elements/combos/index.js +4 -0
  330. package/esm/elements/combos/index.js.map +1 -0
  331. package/esm/elements/combos/rect.d.ts +21 -0
  332. package/esm/elements/combos/rect.js +29 -0
  333. package/esm/elements/combos/rect.js.map +1 -0
  334. package/esm/elements/edges/base-edge.d.ts +164 -0
  335. package/esm/elements/edges/base-edge.js +205 -0
  336. package/esm/elements/edges/base-edge.js.map +1 -0
  337. package/esm/elements/edges/cubic-horizontal.d.ts +39 -0
  338. package/esm/elements/edges/cubic-horizontal.js +28 -0
  339. package/esm/elements/edges/cubic-horizontal.js.map +1 -0
  340. package/esm/elements/edges/cubic-vertical.d.ts +39 -0
  341. package/esm/elements/edges/cubic-vertical.js +28 -0
  342. package/esm/elements/edges/cubic-vertical.js.map +1 -0
  343. package/esm/elements/edges/cubic.d.ts +48 -0
  344. package/esm/elements/edges/cubic.js +35 -0
  345. package/esm/elements/edges/cubic.js.map +1 -0
  346. package/esm/elements/edges/index.d.ts +14 -0
  347. package/esm/elements/edges/index.js +8 -0
  348. package/esm/elements/edges/index.js.map +1 -0
  349. package/esm/elements/edges/line.d.ts +25 -0
  350. package/esm/elements/edges/line.js +23 -0
  351. package/esm/elements/edges/line.js.map +1 -0
  352. package/esm/elements/edges/polyline.d.ts +63 -0
  353. package/esm/elements/edges/polyline.js +67 -0
  354. package/esm/elements/edges/polyline.js.map +1 -0
  355. package/esm/elements/edges/quadratic.d.ts +44 -0
  356. package/esm/elements/edges/quadratic.js +24 -0
  357. package/esm/elements/edges/quadratic.js.map +1 -0
  358. package/esm/elements/index.d.ts +3 -0
  359. package/esm/elements/index.js +4 -0
  360. package/esm/elements/index.js.map +1 -0
  361. package/esm/elements/nodes/base-node.d.ts +193 -0
  362. package/esm/elements/nodes/base-node.js +218 -0
  363. package/esm/elements/nodes/base-node.js.map +1 -0
  364. package/esm/elements/nodes/circle.d.ts +26 -0
  365. package/esm/elements/nodes/circle.js +36 -0
  366. package/esm/elements/nodes/circle.js.map +1 -0
  367. package/esm/elements/nodes/diamond.d.ts +21 -0
  368. package/esm/elements/nodes/diamond.js +23 -0
  369. package/esm/elements/nodes/diamond.js.map +1 -0
  370. package/esm/elements/nodes/donut.d.ts +45 -0
  371. package/esm/elements/nodes/donut.js +95 -0
  372. package/esm/elements/nodes/donut.js.map +1 -0
  373. package/esm/elements/nodes/ellipse.d.ts +26 -0
  374. package/esm/elements/nodes/ellipse.js +41 -0
  375. package/esm/elements/nodes/ellipse.js.map +1 -0
  376. package/esm/elements/nodes/hexagon.d.ts +28 -0
  377. package/esm/elements/nodes/hexagon.js +25 -0
  378. package/esm/elements/nodes/hexagon.js.map +1 -0
  379. package/esm/elements/nodes/html.d.ts +41 -0
  380. package/esm/elements/nodes/html.js +222 -0
  381. package/esm/elements/nodes/html.js.map +1 -0
  382. package/esm/elements/nodes/image.d.ts +38 -0
  383. package/esm/elements/nodes/image.js +59 -0
  384. package/esm/elements/nodes/image.js.map +1 -0
  385. package/esm/elements/nodes/index.d.ts +22 -0
  386. package/esm/elements/nodes/index.js +12 -0
  387. package/esm/elements/nodes/index.js.map +1 -0
  388. package/esm/elements/nodes/rect.d.ts +25 -0
  389. package/esm/elements/nodes/rect.js +38 -0
  390. package/esm/elements/nodes/rect.js.map +1 -0
  391. package/esm/elements/nodes/star.d.ts +30 -0
  392. package/esm/elements/nodes/star.js +34 -0
  393. package/esm/elements/nodes/star.js.map +1 -0
  394. package/esm/elements/nodes/triangle.d.ts +31 -0
  395. package/esm/elements/nodes/triangle.js +53 -0
  396. package/esm/elements/nodes/triangle.js.map +1 -0
  397. package/esm/elements/shapes/badge.d.ts +15 -0
  398. package/esm/elements/shapes/badge.js +27 -0
  399. package/esm/elements/shapes/badge.js.map +1 -0
  400. package/esm/elements/shapes/base-shape.d.ts +63 -0
  401. package/esm/elements/shapes/base-shape.js +160 -0
  402. package/esm/elements/shapes/base-shape.js.map +1 -0
  403. package/esm/elements/shapes/contour.d.ts +66 -0
  404. package/esm/elements/shapes/contour.js +36 -0
  405. package/esm/elements/shapes/contour.js.map +1 -0
  406. package/esm/elements/shapes/icon.d.ts +13 -0
  407. package/esm/elements/shapes/icon.js +31 -0
  408. package/esm/elements/shapes/icon.js.map +1 -0
  409. package/esm/elements/shapes/index.d.ts +16 -0
  410. package/esm/elements/shapes/index.js +11 -0
  411. package/esm/elements/shapes/index.js.map +1 -0
  412. package/esm/elements/shapes/label.d.ts +32 -0
  413. package/esm/elements/shapes/label.js +71 -0
  414. package/esm/elements/shapes/label.js.map +1 -0
  415. package/esm/elements/shapes/polygon.d.ts +30 -0
  416. package/esm/elements/shapes/polygon.js +27 -0
  417. package/esm/elements/shapes/polygon.js.map +1 -0
  418. package/esm/exports.d.ts +40 -0
  419. package/esm/exports.js +18 -0
  420. package/esm/exports.js.map +1 -0
  421. package/esm/index.d.ts +3 -259
  422. package/esm/index.js +3 -18
  423. package/esm/index.js.map +1 -1
  424. package/esm/layouts/base-layout.d.ts +10 -0
  425. package/esm/layouts/base-layout.js +9 -0
  426. package/esm/layouts/base-layout.js.map +1 -0
  427. package/esm/layouts/index.d.ts +4 -0
  428. package/esm/layouts/index.js +4 -0
  429. package/esm/layouts/index.js.map +1 -0
  430. package/esm/layouts/types.d.ts +84 -0
  431. package/esm/layouts/types.js.map +1 -0
  432. package/esm/palettes/index.d.ts +10 -0
  433. package/esm/palettes/index.js +64 -0
  434. package/esm/palettes/index.js.map +1 -0
  435. package/esm/palettes/types.d.ts +5 -0
  436. package/esm/palettes/types.js +2 -0
  437. package/esm/palettes/types.js.map +1 -0
  438. package/esm/plugins/background/index.d.ts +38 -0
  439. package/esm/plugins/background/index.js +48 -0
  440. package/esm/plugins/background/index.js.map +1 -0
  441. package/esm/plugins/base-plugin.d.ts +6 -0
  442. package/esm/plugins/base-plugin.js +4 -0
  443. package/esm/plugins/base-plugin.js.map +1 -0
  444. package/esm/plugins/bubble-sets.d.ts +116 -0
  445. package/esm/plugins/bubble-sets.js +279 -0
  446. package/esm/plugins/bubble-sets.js.map +1 -0
  447. package/esm/plugins/camera-setting.d.ts +111 -0
  448. package/esm/plugins/camera-setting.js +72 -0
  449. package/esm/plugins/camera-setting.js.map +1 -0
  450. package/esm/plugins/contextmenu/index.d.ts +115 -0
  451. package/esm/plugins/contextmenu/index.js +132 -0
  452. package/esm/plugins/contextmenu/index.js.map +1 -0
  453. package/esm/plugins/contextmenu/util.d.ts +26 -0
  454. package/esm/plugins/contextmenu/util.js +45 -0
  455. package/esm/plugins/contextmenu/util.js.map +1 -0
  456. package/esm/plugins/fullscreen/index.d.ts +79 -0
  457. package/esm/plugins/fullscreen/index.js +112 -0
  458. package/esm/plugins/fullscreen/index.js.map +1 -0
  459. package/esm/plugins/grid-line.d.ts +106 -0
  460. package/esm/plugins/grid-line.js +78 -0
  461. package/esm/plugins/grid-line.js.map +1 -0
  462. package/esm/plugins/history/index.d.ts +120 -0
  463. package/esm/plugins/history/index.js +195 -0
  464. package/esm/plugins/history/index.js.map +1 -0
  465. package/esm/plugins/history/util.d.ts +21 -0
  466. package/esm/plugins/history/util.js +83 -0
  467. package/esm/plugins/history/util.js.map +1 -0
  468. package/esm/plugins/hull/index.d.ts +114 -0
  469. package/esm/plugins/hull/index.js +161 -0
  470. package/esm/plugins/hull/index.js.map +1 -0
  471. package/esm/plugins/hull/util.d.ts +12 -0
  472. package/esm/plugins/hull/util.js +203 -0
  473. package/esm/plugins/hull/util.js.map +1 -0
  474. package/esm/plugins/index.d.ts +28 -0
  475. package/esm/plugins/index.js +15 -0
  476. package/esm/plugins/index.js.map +1 -0
  477. package/esm/plugins/legend.d.ts +129 -0
  478. package/esm/plugins/legend.js +318 -0
  479. package/esm/plugins/legend.js.map +1 -0
  480. package/esm/plugins/timebar.d.ts +241 -0
  481. package/esm/plugins/timebar.js +267 -0
  482. package/esm/plugins/timebar.js.map +1 -0
  483. package/esm/plugins/toolbar/index.d.ts +69 -0
  484. package/esm/plugins/toolbar/index.js +71 -0
  485. package/esm/plugins/toolbar/index.js.map +1 -0
  486. package/esm/plugins/toolbar/util.d.ts +33 -0
  487. package/esm/plugins/toolbar/util.js +93 -0
  488. package/esm/plugins/toolbar/util.js.map +1 -0
  489. package/esm/plugins/tooltip.d.ts +116 -0
  490. package/esm/plugins/tooltip.js +294 -0
  491. package/esm/plugins/tooltip.js.map +1 -0
  492. package/esm/plugins/types.d.ts +4 -0
  493. package/esm/plugins/types.js +2 -0
  494. package/esm/plugins/types.js.map +1 -0
  495. package/esm/plugins/watermark/index.d.ts +191 -0
  496. package/esm/plugins/watermark/index.js +67 -0
  497. package/esm/plugins/watermark/index.js.map +1 -0
  498. package/esm/plugins/watermark/util.d.ts +18 -0
  499. package/esm/plugins/watermark/util.js +73 -0
  500. package/esm/plugins/watermark/util.js.map +1 -0
  501. package/esm/preset.d.ts +1 -0
  502. package/esm/preset.js +5 -0
  503. package/esm/preset.js.map +1 -0
  504. package/esm/registry/build-in.d.ts +6 -0
  505. package/esm/registry/build-in.js +115 -0
  506. package/esm/registry/build-in.js.map +1 -0
  507. package/esm/registry/extension/index.d.ts +33 -0
  508. package/esm/registry/extension/index.js +84 -0
  509. package/esm/registry/extension/index.js.map +1 -0
  510. package/esm/registry/extension/types.d.ts +38 -0
  511. package/esm/registry/extension/types.js +2 -0
  512. package/esm/registry/extension/types.js.map +1 -0
  513. package/esm/registry/index.d.ts +59 -0
  514. package/esm/registry/index.js +97 -0
  515. package/esm/registry/index.js.map +1 -0
  516. package/esm/registry/types.d.ts +39 -0
  517. package/esm/registry/types.js +2 -0
  518. package/esm/registry/types.js.map +1 -0
  519. package/esm/runtime/animation.d.ts +54 -0
  520. package/esm/runtime/animation.js +139 -0
  521. package/esm/runtime/animation.js.map +1 -0
  522. package/esm/runtime/batch.d.ts +11 -0
  523. package/esm/runtime/batch.js +31 -0
  524. package/esm/runtime/batch.js.map +1 -0
  525. package/esm/runtime/behavior.d.ts +20 -0
  526. package/esm/runtime/behavior.js +119 -0
  527. package/esm/runtime/behavior.js.map +1 -0
  528. package/esm/runtime/canvas.d.ts +60 -0
  529. package/esm/runtime/canvas.js +258 -0
  530. package/esm/runtime/canvas.js.map +1 -0
  531. package/esm/runtime/data.d.ts +202 -0
  532. package/esm/runtime/data.js +694 -0
  533. package/esm/runtime/data.js.map +1 -0
  534. package/esm/runtime/element.d.ts +102 -0
  535. package/esm/runtime/element.js +553 -0
  536. package/esm/runtime/element.js.map +1 -0
  537. package/esm/runtime/graph.d.ts +826 -536
  538. package/esm/runtime/graph.js +1029 -1832
  539. package/esm/runtime/graph.js.map +1 -1
  540. package/esm/runtime/layout.d.ts +38 -0
  541. package/esm/runtime/layout.js +236 -0
  542. package/esm/runtime/layout.js.map +1 -0
  543. package/esm/runtime/plugin.d.ts +10 -0
  544. package/esm/runtime/plugin.js +15 -0
  545. package/esm/runtime/plugin.js.map +1 -0
  546. package/esm/runtime/transform.d.ts +12 -0
  547. package/esm/runtime/transform.js +27 -0
  548. package/esm/runtime/transform.js.map +1 -0
  549. package/esm/runtime/types.d.ts +90 -0
  550. package/esm/runtime/types.js +2 -0
  551. package/esm/runtime/types.js.map +1 -0
  552. package/esm/runtime/viewport.d.ts +58 -0
  553. package/esm/runtime/viewport.js +241 -0
  554. package/esm/runtime/viewport.js.map +1 -0
  555. package/esm/spec/behavior.d.ts +30 -0
  556. package/esm/spec/behavior.js +2 -0
  557. package/esm/spec/behavior.js.map +1 -0
  558. package/esm/spec/canvas.d.ts +53 -0
  559. package/esm/spec/canvas.js +2 -0
  560. package/esm/spec/canvas.js.map +1 -0
  561. package/esm/spec/data.d.ts +222 -0
  562. package/esm/spec/data.js +2 -0
  563. package/esm/spec/data.js.map +1 -0
  564. package/esm/spec/element/animation.d.ts +6 -0
  565. package/esm/spec/element/animation.js +2 -0
  566. package/esm/spec/element/animation.js.map +1 -0
  567. package/esm/spec/element/combo.d.ts +52 -0
  568. package/esm/spec/element/combo.js +2 -0
  569. package/esm/spec/element/combo.js.map +1 -0
  570. package/esm/spec/element/edge.d.ts +52 -0
  571. package/esm/spec/element/edge.js +2 -0
  572. package/esm/spec/element/edge.js.map +1 -0
  573. package/esm/spec/element/node.d.ts +52 -0
  574. package/esm/spec/element/node.js +2 -0
  575. package/esm/spec/element/node.js.map +1 -0
  576. package/esm/spec/element/palette.d.ts +53 -0
  577. package/esm/spec/element/palette.js +2 -0
  578. package/esm/spec/element/palette.js.map +1 -0
  579. package/esm/spec/graph.d.ts +91 -0
  580. package/esm/spec/graph.js.map +1 -0
  581. package/esm/spec/index.d.ts +12 -0
  582. package/esm/spec/index.js +2 -0
  583. package/esm/spec/index.js.map +1 -0
  584. package/esm/spec/layout.d.ts +4 -0
  585. package/esm/spec/layout.js.map +1 -0
  586. package/esm/spec/plugin.d.ts +32 -0
  587. package/esm/spec/plugin.js +2 -0
  588. package/esm/spec/plugin.js.map +1 -0
  589. package/esm/spec/theme.d.ts +7 -0
  590. package/esm/spec/theme.js +2 -0
  591. package/esm/spec/theme.js.map +1 -0
  592. package/esm/spec/transform.d.ts +12 -0
  593. package/esm/spec/transform.js +2 -0
  594. package/esm/spec/transform.js.map +1 -0
  595. package/esm/spec/viewport.d.ts +82 -0
  596. package/esm/spec/viewport.js +2 -0
  597. package/esm/spec/viewport.js.map +1 -0
  598. package/esm/themes/base.d.ts +34 -0
  599. package/esm/themes/base.js +253 -0
  600. package/esm/themes/base.js.map +1 -0
  601. package/esm/themes/dark.d.ts +2 -0
  602. package/esm/themes/dark.js +39 -0
  603. package/esm/themes/dark.js.map +1 -0
  604. package/esm/themes/index.d.ts +2 -0
  605. package/esm/themes/index.js +3 -0
  606. package/esm/themes/index.js.map +1 -0
  607. package/esm/themes/light.d.ts +2 -0
  608. package/esm/themes/light.js +22 -0
  609. package/esm/themes/light.js.map +1 -0
  610. package/esm/themes/types.d.ts +9 -0
  611. package/esm/themes/types.js +2 -0
  612. package/esm/themes/types.js.map +1 -0
  613. package/esm/transforms/arrange-draw-order.d.ts +10 -0
  614. package/esm/transforms/arrange-draw-order.js +32 -0
  615. package/esm/transforms/arrange-draw-order.js.map +1 -0
  616. package/esm/transforms/base-transform.d.ts +8 -0
  617. package/esm/transforms/base-transform.js +7 -0
  618. package/esm/transforms/base-transform.js.map +1 -0
  619. package/esm/transforms/collapse-expand-combo.d.ts +11 -0
  620. package/esm/transforms/collapse-expand-combo.js +75 -0
  621. package/esm/transforms/collapse-expand-combo.js.map +1 -0
  622. package/esm/transforms/collapse-expand-node.d.ts +12 -0
  623. package/esm/transforms/collapse-expand-node.js +91 -0
  624. package/esm/transforms/collapse-expand-node.js.map +1 -0
  625. package/esm/transforms/get-edge-actual-ends.d.ts +13 -0
  626. package/esm/transforms/get-edge-actual-ends.js +36 -0
  627. package/esm/transforms/get-edge-actual-ends.js.map +1 -0
  628. package/esm/transforms/index.d.ts +8 -0
  629. package/esm/transforms/index.js +8 -0
  630. package/esm/transforms/index.js.map +1 -0
  631. package/esm/transforms/process-parallel-edges.d.ts +85 -0
  632. package/esm/transforms/process-parallel-edges.js +228 -0
  633. package/esm/transforms/process-parallel-edges.js.map +1 -0
  634. package/esm/transforms/types.d.ts +20 -0
  635. package/esm/transforms/types.js +2 -0
  636. package/esm/transforms/types.js.map +1 -0
  637. package/esm/transforms/update-related-edge.d.ts +10 -0
  638. package/esm/transforms/update-related-edge.js +23 -0
  639. package/esm/transforms/update-related-edge.js.map +1 -0
  640. package/esm/transforms/utils.d.ts +13 -0
  641. package/esm/transforms/utils.js +25 -0
  642. package/esm/transforms/utils.js.map +1 -0
  643. package/esm/types/anchor.d.ts +3 -0
  644. package/esm/types/anchor.js +2 -0
  645. package/esm/types/anchor.js.map +1 -0
  646. package/esm/types/animation.d.ts +5 -0
  647. package/esm/types/animation.js +2 -0
  648. package/esm/types/animation.js.map +1 -0
  649. package/esm/types/callable.d.ts +30 -0
  650. package/esm/types/callable.js +2 -0
  651. package/esm/types/callable.js.map +1 -0
  652. package/esm/types/canvas.d.ts +1 -0
  653. package/esm/types/canvas.js +2 -0
  654. package/esm/types/canvas.js.map +1 -0
  655. package/esm/types/change.d.ts +68 -0
  656. package/esm/types/change.js +2 -0
  657. package/esm/types/change.js.map +1 -0
  658. package/esm/types/combo.d.ts +20 -132
  659. package/esm/types/data.d.ts +44 -27
  660. package/esm/types/edge.d.ts +110 -97
  661. package/esm/types/element.d.ts +18 -0
  662. package/esm/types/element.js +2 -0
  663. package/esm/types/element.js.map +1 -0
  664. package/esm/types/enum.d.ts +1 -0
  665. package/esm/types/enum.js +2 -0
  666. package/esm/types/enum.js.map +1 -0
  667. package/esm/types/event.d.ts +54 -38
  668. package/esm/types/event.js +1 -30
  669. package/esm/types/event.js.map +1 -1
  670. package/esm/types/graphlib.d.ts +16 -0
  671. package/esm/types/graphlib.js +2 -0
  672. package/esm/types/graphlib.js.map +1 -0
  673. package/esm/types/history.d.ts +49 -26
  674. package/esm/types/history.js +1 -5
  675. package/esm/types/history.js.map +1 -1
  676. package/esm/types/id.d.ts +1 -0
  677. package/esm/types/id.js +2 -0
  678. package/esm/types/id.js.map +1 -0
  679. package/esm/types/index.d.ts +26 -16
  680. package/esm/types/index.js +1 -1
  681. package/esm/types/index.js.map +1 -1
  682. package/esm/types/layout.d.ts +8 -71
  683. package/esm/types/layout.js +1 -19
  684. package/esm/types/layout.js.map +1 -1
  685. package/esm/types/node.d.ts +132 -203
  686. package/esm/types/padding.d.ts +2 -0
  687. package/esm/types/padding.js +2 -0
  688. package/esm/types/padding.js.map +1 -0
  689. package/esm/types/placement.d.ts +5 -0
  690. package/esm/types/placement.js +2 -0
  691. package/esm/types/placement.js.map +1 -0
  692. package/esm/types/plugin.d.ts +5 -44
  693. package/esm/types/plugin.js +1 -52
  694. package/esm/types/plugin.js.map +1 -1
  695. package/esm/types/point.d.ts +2 -0
  696. package/esm/types/point.js +2 -0
  697. package/esm/types/point.js.map +1 -0
  698. package/esm/types/position.d.ts +2 -0
  699. package/esm/types/position.js +2 -0
  700. package/esm/types/position.js.map +1 -0
  701. package/esm/types/prefix.d.ts +17 -0
  702. package/esm/types/prefix.js +2 -0
  703. package/esm/types/prefix.js.map +1 -0
  704. package/esm/types/size.d.ts +3 -0
  705. package/esm/types/size.js +2 -0
  706. package/esm/types/size.js.map +1 -0
  707. package/esm/types/state.d.ts +1 -0
  708. package/esm/types/state.js +2 -0
  709. package/esm/types/state.js.map +1 -0
  710. package/esm/types/style.d.ts +9 -0
  711. package/esm/types/style.js +2 -0
  712. package/esm/types/style.js.map +1 -0
  713. package/esm/types/tree.d.ts +5 -0
  714. package/esm/types/tree.js +2 -0
  715. package/esm/types/tree.js.map +1 -0
  716. package/esm/types/vector.d.ts +2 -0
  717. package/esm/types/vector.js +2 -0
  718. package/esm/types/vector.js.map +1 -0
  719. package/esm/types/viewport.d.ts +36 -0
  720. package/esm/types/viewport.js +2 -0
  721. package/esm/types/viewport.js.map +1 -0
  722. package/esm/utils/anchor.d.ts +9 -0
  723. package/esm/utils/anchor.js +16 -0
  724. package/esm/utils/anchor.js.map +1 -0
  725. package/esm/utils/animation.d.ts +47 -0
  726. package/esm/utils/animation.js +189 -0
  727. package/esm/utils/animation.js.map +1 -0
  728. package/esm/utils/array.d.ts +9 -0
  729. package/esm/utils/array.js +16 -0
  730. package/esm/utils/array.js.map +1 -0
  731. package/esm/utils/bbox.d.ts +108 -0
  732. package/esm/utils/bbox.js +206 -0
  733. package/esm/utils/bbox.js.map +1 -0
  734. package/esm/utils/cache.d.ts +36 -0
  735. package/esm/utils/cache.js +52 -0
  736. package/esm/utils/cache.js.map +1 -0
  737. package/esm/utils/change.d.ts +17 -0
  738. package/esm/utils/change.js +91 -0
  739. package/esm/utils/change.js.map +1 -0
  740. package/esm/utils/collapsibility.d.ts +9 -0
  741. package/esm/utils/collapsibility.js +11 -0
  742. package/esm/utils/collapsibility.js.map +1 -0
  743. package/esm/utils/data.d.ts +34 -0
  744. package/esm/utils/data.js +59 -0
  745. package/esm/utils/data.js.map +1 -0
  746. package/esm/utils/diff.d.ts +15 -0
  747. package/esm/utils/diff.js +40 -0
  748. package/esm/utils/diff.js.map +1 -0
  749. package/esm/utils/dom.d.ts +29 -0
  750. package/esm/utils/dom.js +92 -0
  751. package/esm/utils/dom.js.map +1 -0
  752. package/esm/utils/edge.d.ts +192 -0
  753. package/esm/utils/edge.js +516 -0
  754. package/esm/utils/edge.js.map +1 -0
  755. package/esm/utils/element.d.ts +231 -0
  756. package/esm/utils/element.js +469 -0
  757. package/esm/utils/element.js.map +1 -0
  758. package/esm/utils/event/events.d.ts +26 -0
  759. package/esm/utils/event/events.js +41 -0
  760. package/esm/utils/event/events.js.map +1 -0
  761. package/esm/utils/event/index.d.ts +29 -0
  762. package/esm/utils/event/index.js +45 -0
  763. package/esm/utils/event/index.js.map +1 -0
  764. package/esm/utils/extension.d.ts +10 -0
  765. package/esm/utils/extension.js +25 -0
  766. package/esm/utils/extension.js.map +1 -0
  767. package/esm/utils/graphlib.d.ts +14 -0
  768. package/esm/utils/graphlib.js +44 -0
  769. package/esm/utils/graphlib.js.map +1 -0
  770. package/esm/utils/id.d.ts +20 -0
  771. package/esm/utils/id.js +41 -0
  772. package/esm/utils/id.js.map +1 -0
  773. package/esm/utils/is.d.ts +34 -0
  774. package/esm/utils/is.js +48 -0
  775. package/esm/utils/is.js.map +1 -0
  776. package/esm/utils/layout.d.ts +70 -0
  777. package/esm/utils/layout.js +204 -0
  778. package/esm/utils/layout.js.map +1 -0
  779. package/esm/utils/line.d.ts +21 -0
  780. package/esm/utils/line.js +41 -0
  781. package/esm/utils/line.js.map +1 -0
  782. package/esm/utils/math.d.ts +10 -0
  783. package/esm/utils/math.js +13 -0
  784. package/esm/utils/math.js.map +1 -0
  785. package/esm/utils/node.d.ts +11 -0
  786. package/esm/utils/node.js +19 -0
  787. package/esm/utils/node.js.map +1 -0
  788. package/esm/utils/padding.d.ts +9 -0
  789. package/esm/utils/padding.js +15 -0
  790. package/esm/utils/padding.js.map +1 -0
  791. package/esm/utils/palette.d.ts +32 -0
  792. package/esm/utils/palette.js +111 -0
  793. package/esm/utils/palette.js.map +1 -0
  794. package/esm/utils/path.d.ts +35 -0
  795. package/esm/utils/path.js +143 -0
  796. package/esm/utils/path.js.map +1 -0
  797. package/esm/utils/placement.d.ts +9 -0
  798. package/esm/utils/placement.js +18 -0
  799. package/esm/utils/placement.js.map +1 -0
  800. package/esm/utils/point.d.ts +192 -0
  801. package/esm/utils/point.js +342 -0
  802. package/esm/utils/point.js.map +1 -0
  803. package/esm/utils/polygon.d.ts +17 -0
  804. package/esm/utils/polygon.js +59 -0
  805. package/esm/utils/polygon.js.map +1 -0
  806. package/esm/utils/position.d.ts +50 -0
  807. package/esm/utils/position.js +67 -0
  808. package/esm/utils/position.js.map +1 -0
  809. package/esm/utils/prefix.d.ts +66 -0
  810. package/esm/utils/prefix.js +131 -0
  811. package/esm/utils/prefix.js.map +1 -0
  812. package/esm/utils/relation.d.ts +33 -0
  813. package/esm/utils/relation.js +72 -0
  814. package/esm/utils/relation.js.map +1 -0
  815. package/esm/utils/router/orth.d.ts +103 -0
  816. package/esm/utils/router/orth.js +280 -0
  817. package/esm/utils/router/orth.js.map +1 -0
  818. package/esm/utils/shape.d.ts +9 -0
  819. package/esm/utils/shape.js +22 -0
  820. package/esm/utils/shape.js.map +1 -0
  821. package/esm/utils/shortcut.d.ts +31 -0
  822. package/esm/utils/shortcut.js +88 -0
  823. package/esm/utils/shortcut.js.map +1 -0
  824. package/esm/utils/size.d.ts +7 -0
  825. package/esm/utils/size.js +12 -0
  826. package/esm/utils/size.js.map +1 -0
  827. package/esm/utils/style.d.ts +30 -0
  828. package/esm/utils/style.js +46 -0
  829. package/esm/utils/style.js.map +1 -0
  830. package/esm/utils/symbol.d.ts +30 -0
  831. package/esm/utils/symbol.js +75 -0
  832. package/esm/utils/symbol.js.map +1 -0
  833. package/esm/utils/text.d.ts +26 -0
  834. package/esm/utils/text.js +44 -0
  835. package/esm/utils/text.js.map +1 -0
  836. package/esm/utils/theme.d.ts +9 -0
  837. package/esm/utils/theme.js +17 -0
  838. package/esm/utils/theme.js.map +1 -0
  839. package/esm/utils/transform.d.ts +24 -0
  840. package/esm/utils/transform.js +43 -0
  841. package/esm/utils/transform.js.map +1 -0
  842. package/esm/utils/traverse.d.ts +23 -0
  843. package/esm/utils/traverse.js +44 -0
  844. package/esm/utils/traverse.js.map +1 -0
  845. package/esm/utils/tree.d.ts +17 -0
  846. package/esm/utils/tree.js +28 -0
  847. package/esm/utils/tree.js.map +1 -0
  848. package/esm/utils/vector.d.ts +143 -0
  849. package/esm/utils/vector.js +191 -0
  850. package/esm/utils/vector.js.map +1 -0
  851. package/esm/utils/visibility.d.ts +13 -0
  852. package/esm/utils/visibility.js +28 -0
  853. package/esm/utils/visibility.js.map +1 -0
  854. package/lib/animations/executor.d.ts +11 -0
  855. package/lib/animations/executor.js +74 -0
  856. package/lib/animations/executor.js.map +1 -0
  857. package/lib/animations/index.d.ts +32 -0
  858. package/lib/animations/index.js +19 -0
  859. package/lib/animations/index.js.map +1 -0
  860. package/lib/animations/types.d.ts +113 -0
  861. package/lib/animations/types.js.map +1 -0
  862. package/lib/behaviors/base-behavior.d.ts +6 -0
  863. package/lib/behaviors/base-behavior.js +8 -0
  864. package/lib/behaviors/base-behavior.js.map +1 -0
  865. package/lib/behaviors/brush-select.d.ts +189 -0
  866. package/lib/behaviors/brush-select.js +278 -0
  867. package/lib/behaviors/brush-select.js.map +1 -0
  868. package/lib/behaviors/click-select.d.ts +116 -0
  869. package/lib/behaviors/click-select.js +137 -0
  870. package/lib/behaviors/click-select.js.map +1 -0
  871. package/lib/behaviors/collapse-expand.d.ts +64 -0
  872. package/lib/behaviors/collapse-expand.js +80 -0
  873. package/lib/behaviors/collapse-expand.js.map +1 -0
  874. package/lib/behaviors/create-edge.d.ts +75 -0
  875. package/lib/behaviors/create-edge.js +159 -0
  876. package/lib/behaviors/create-edge.js.map +1 -0
  877. package/lib/behaviors/drag-canvas.d.ts +83 -0
  878. package/lib/behaviors/drag-canvas.js +101 -0
  879. package/lib/behaviors/drag-canvas.js.map +1 -0
  880. package/lib/behaviors/drag-element-force.d.ts +53 -0
  881. package/lib/behaviors/drag-element-force.js +98 -0
  882. package/lib/behaviors/drag-element-force.js.map +1 -0
  883. package/lib/behaviors/drag-element.d.ts +209 -0
  884. package/lib/behaviors/drag-element.js +314 -0
  885. package/lib/behaviors/drag-element.js.map +1 -0
  886. package/lib/behaviors/focus-element.d.ts +42 -0
  887. package/lib/behaviors/focus-element.js +62 -0
  888. package/lib/behaviors/focus-element.js.map +1 -0
  889. package/lib/behaviors/hover-activate.d.ts +84 -0
  890. package/lib/behaviors/hover-activate.js +108 -0
  891. package/lib/behaviors/hover-activate.js.map +1 -0
  892. package/lib/behaviors/index.d.ts +26 -0
  893. package/lib/behaviors/index.js +30 -0
  894. package/lib/behaviors/index.js.map +1 -0
  895. package/lib/behaviors/lasso-select.d.ts +41 -0
  896. package/lib/behaviors/lasso-select.js +70 -0
  897. package/lib/behaviors/lasso-select.js.map +1 -0
  898. package/lib/behaviors/scroll-canvas.d.ts +85 -0
  899. package/lib/behaviors/scroll-canvas.js +104 -0
  900. package/lib/behaviors/scroll-canvas.js.map +1 -0
  901. package/lib/behaviors/types.d.ts +6 -0
  902. package/lib/behaviors/types.js.map +1 -0
  903. package/lib/behaviors/zoom-canvas.d.ts +98 -0
  904. package/lib/behaviors/zoom-canvas.js +114 -0
  905. package/lib/behaviors/zoom-canvas.js.map +1 -0
  906. package/lib/constants/animation.d.ts +3 -0
  907. package/lib/constants/animation.js +13 -0
  908. package/lib/constants/animation.js.map +1 -0
  909. package/lib/constants/change.d.ts +64 -0
  910. package/lib/constants/change.js +69 -0
  911. package/lib/constants/change.js.map +1 -0
  912. package/lib/constants/element.d.ts +7 -0
  913. package/lib/constants/element.js +11 -0
  914. package/lib/constants/element.js.map +1 -0
  915. package/lib/constants/events/animation.d.ts +6 -0
  916. package/lib/constants/events/animation.js +11 -0
  917. package/lib/constants/events/animation.js.map +1 -0
  918. package/lib/constants/events/canvas.d.ts +115 -0
  919. package/lib/constants/events/canvas.js +120 -0
  920. package/lib/constants/events/canvas.js.map +1 -0
  921. package/lib/constants/events/combo.d.ts +109 -0
  922. package/lib/constants/events/combo.js +114 -0
  923. package/lib/constants/events/combo.js.map +1 -0
  924. package/lib/constants/events/common.d.ts +122 -0
  925. package/lib/constants/events/common.js +127 -0
  926. package/lib/constants/events/common.js.map +1 -0
  927. package/lib/constants/events/container.d.ts +14 -0
  928. package/lib/constants/events/container.js +19 -0
  929. package/lib/constants/events/container.js.map +1 -0
  930. package/lib/constants/events/edge.d.ts +91 -0
  931. package/lib/constants/events/edge.js +96 -0
  932. package/lib/constants/events/edge.js.map +1 -0
  933. package/lib/constants/events/graph.d.ts +158 -0
  934. package/lib/constants/events/graph.js +163 -0
  935. package/lib/constants/events/graph.js.map +1 -0
  936. package/lib/constants/events/history.d.ts +38 -0
  937. package/lib/constants/events/history.js +43 -0
  938. package/lib/constants/events/history.js.map +1 -0
  939. package/lib/constants/events/index.d.ts +9 -0
  940. package/lib/constants/events/index.js +22 -0
  941. package/lib/constants/events/index.js.map +1 -0
  942. package/lib/constants/events/node.d.ts +109 -0
  943. package/lib/constants/events/node.js +114 -0
  944. package/lib/constants/events/node.js.map +1 -0
  945. package/lib/constants/graphlib.d.ts +2 -0
  946. package/lib/constants/graphlib.js +6 -0
  947. package/lib/constants/graphlib.js.map +1 -0
  948. package/lib/constants/index.d.ts +5 -0
  949. package/lib/constants/index.js +22 -0
  950. package/lib/constants/index.js.map +1 -0
  951. package/lib/constants/registry.d.ts +62 -0
  952. package/lib/constants/registry.js +67 -0
  953. package/lib/constants/registry.js.map +1 -0
  954. package/lib/elements/base-element.d.ts +35 -0
  955. package/lib/elements/base-element.js +46 -0
  956. package/lib/elements/base-element.js.map +1 -0
  957. package/lib/elements/combos/base-combo.d.ts +91 -0
  958. package/lib/elements/combos/base-combo.js +166 -0
  959. package/lib/elements/combos/base-combo.js.map +1 -0
  960. package/lib/elements/combos/circle.d.ts +25 -0
  961. package/lib/elements/combos/circle.js +49 -0
  962. package/lib/elements/combos/circle.js.map +1 -0
  963. package/lib/elements/combos/index.d.ts +6 -0
  964. package/lib/elements/combos/index.js +10 -0
  965. package/lib/elements/combos/index.js.map +1 -0
  966. package/lib/elements/combos/rect.d.ts +21 -0
  967. package/lib/elements/combos/rect.js +33 -0
  968. package/lib/elements/combos/rect.js.map +1 -0
  969. package/lib/elements/edges/base-edge.d.ts +164 -0
  970. package/lib/elements/edges/base-edge.js +232 -0
  971. package/lib/elements/edges/base-edge.js.map +1 -0
  972. package/lib/elements/edges/cubic-horizontal.d.ts +39 -0
  973. package/lib/elements/edges/cubic-horizontal.js +32 -0
  974. package/lib/elements/edges/cubic-horizontal.js.map +1 -0
  975. package/lib/elements/edges/cubic-vertical.d.ts +39 -0
  976. package/lib/elements/edges/cubic-vertical.js +32 -0
  977. package/lib/elements/edges/cubic-vertical.js.map +1 -0
  978. package/lib/elements/edges/cubic.d.ts +48 -0
  979. package/lib/elements/edges/cubic.js +39 -0
  980. package/lib/elements/edges/cubic.js.map +1 -0
  981. package/lib/elements/edges/index.d.ts +14 -0
  982. package/lib/elements/edges/index.js +18 -0
  983. package/lib/elements/edges/index.js.map +1 -0
  984. package/lib/elements/edges/line.d.ts +25 -0
  985. package/lib/elements/edges/line.js +27 -0
  986. package/lib/elements/edges/line.js.map +1 -0
  987. package/lib/elements/edges/polyline.d.ts +63 -0
  988. package/lib/elements/edges/polyline.js +71 -0
  989. package/lib/elements/edges/polyline.js.map +1 -0
  990. package/lib/elements/edges/quadratic.d.ts +44 -0
  991. package/lib/elements/edges/quadratic.js +28 -0
  992. package/lib/elements/edges/quadratic.js.map +1 -0
  993. package/lib/elements/index.d.ts +3 -0
  994. package/lib/elements/index.js +20 -0
  995. package/lib/elements/index.js.map +1 -0
  996. package/lib/elements/nodes/base-node.d.ts +193 -0
  997. package/lib/elements/nodes/base-node.js +222 -0
  998. package/lib/elements/nodes/base-node.js.map +1 -0
  999. package/lib/elements/nodes/circle.d.ts +26 -0
  1000. package/lib/elements/nodes/circle.js +40 -0
  1001. package/lib/elements/nodes/circle.js.map +1 -0
  1002. package/lib/elements/nodes/diamond.d.ts +21 -0
  1003. package/lib/elements/nodes/diamond.js +27 -0
  1004. package/lib/elements/nodes/diamond.js.map +1 -0
  1005. package/lib/elements/nodes/donut.d.ts +45 -0
  1006. package/lib/elements/nodes/donut.js +99 -0
  1007. package/lib/elements/nodes/donut.js.map +1 -0
  1008. package/lib/elements/nodes/ellipse.d.ts +26 -0
  1009. package/lib/elements/nodes/ellipse.js +45 -0
  1010. package/lib/elements/nodes/ellipse.js.map +1 -0
  1011. package/lib/elements/nodes/hexagon.d.ts +28 -0
  1012. package/lib/elements/nodes/hexagon.js +29 -0
  1013. package/lib/elements/nodes/hexagon.js.map +1 -0
  1014. package/lib/elements/nodes/html.d.ts +41 -0
  1015. package/lib/elements/nodes/html.js +226 -0
  1016. package/lib/elements/nodes/html.js.map +1 -0
  1017. package/lib/elements/nodes/image.d.ts +38 -0
  1018. package/lib/elements/nodes/image.js +63 -0
  1019. package/lib/elements/nodes/image.js.map +1 -0
  1020. package/lib/elements/nodes/index.d.ts +22 -0
  1021. package/lib/elements/nodes/index.js +26 -0
  1022. package/lib/elements/nodes/index.js.map +1 -0
  1023. package/lib/elements/nodes/rect.d.ts +25 -0
  1024. package/lib/elements/nodes/rect.js +42 -0
  1025. package/lib/elements/nodes/rect.js.map +1 -0
  1026. package/lib/elements/nodes/star.d.ts +30 -0
  1027. package/lib/elements/nodes/star.js +38 -0
  1028. package/lib/elements/nodes/star.js.map +1 -0
  1029. package/lib/elements/nodes/triangle.d.ts +31 -0
  1030. package/lib/elements/nodes/triangle.js +57 -0
  1031. package/lib/elements/nodes/triangle.js.map +1 -0
  1032. package/lib/elements/shapes/badge.d.ts +15 -0
  1033. package/lib/elements/shapes/badge.js +31 -0
  1034. package/lib/elements/shapes/badge.js.map +1 -0
  1035. package/lib/elements/shapes/base-shape.d.ts +63 -0
  1036. package/lib/elements/shapes/base-shape.js +164 -0
  1037. package/lib/elements/shapes/base-shape.js.map +1 -0
  1038. package/lib/elements/shapes/contour.d.ts +66 -0
  1039. package/lib/elements/shapes/contour.js +40 -0
  1040. package/lib/elements/shapes/contour.js.map +1 -0
  1041. package/lib/elements/shapes/icon.d.ts +13 -0
  1042. package/lib/elements/shapes/icon.js +35 -0
  1043. package/lib/elements/shapes/icon.js.map +1 -0
  1044. package/lib/elements/shapes/index.d.ts +16 -0
  1045. package/lib/elements/shapes/index.js +19 -0
  1046. package/lib/elements/shapes/index.js.map +1 -0
  1047. package/lib/elements/shapes/label.d.ts +32 -0
  1048. package/lib/elements/shapes/label.js +75 -0
  1049. package/lib/elements/shapes/label.js.map +1 -0
  1050. package/lib/elements/shapes/polygon.d.ts +30 -0
  1051. package/lib/elements/shapes/polygon.js +31 -0
  1052. package/lib/elements/shapes/polygon.js.map +1 -0
  1053. package/lib/exports.d.ts +40 -0
  1054. package/lib/exports.js +109 -0
  1055. package/lib/exports.js.map +1 -0
  1056. package/lib/index.d.ts +3 -259
  1057. package/lib/index.js +4 -27
  1058. package/lib/index.js.map +1 -1
  1059. package/lib/layouts/base-layout.d.ts +10 -0
  1060. package/lib/layouts/base-layout.js +13 -0
  1061. package/lib/layouts/base-layout.js.map +1 -0
  1062. package/lib/layouts/index.d.ts +4 -0
  1063. package/lib/layouts/index.js +25 -0
  1064. package/lib/layouts/index.js.map +1 -0
  1065. package/lib/layouts/types.d.ts +84 -0
  1066. package/lib/layouts/types.js.map +1 -0
  1067. package/lib/palettes/index.d.ts +10 -0
  1068. package/lib/palettes/index.js +67 -0
  1069. package/lib/palettes/index.js.map +1 -0
  1070. package/lib/palettes/types.d.ts +5 -0
  1071. package/lib/palettes/types.js +3 -0
  1072. package/lib/palettes/types.js.map +1 -0
  1073. package/lib/plugins/background/index.d.ts +38 -0
  1074. package/lib/plugins/background/index.js +52 -0
  1075. package/lib/plugins/background/index.js.map +1 -0
  1076. package/lib/plugins/base-plugin.d.ts +6 -0
  1077. package/lib/plugins/base-plugin.js +8 -0
  1078. package/lib/plugins/base-plugin.js.map +1 -0
  1079. package/lib/plugins/bubble-sets.d.ts +116 -0
  1080. package/lib/plugins/bubble-sets.js +283 -0
  1081. package/lib/plugins/bubble-sets.js.map +1 -0
  1082. package/lib/plugins/camera-setting.d.ts +111 -0
  1083. package/lib/plugins/camera-setting.js +76 -0
  1084. package/lib/plugins/camera-setting.js.map +1 -0
  1085. package/lib/plugins/contextmenu/index.d.ts +115 -0
  1086. package/lib/plugins/contextmenu/index.js +136 -0
  1087. package/lib/plugins/contextmenu/index.js.map +1 -0
  1088. package/lib/plugins/contextmenu/util.d.ts +26 -0
  1089. package/lib/plugins/contextmenu/util.js +49 -0
  1090. package/lib/plugins/contextmenu/util.js.map +1 -0
  1091. package/lib/plugins/fullscreen/index.d.ts +79 -0
  1092. package/lib/plugins/fullscreen/index.js +116 -0
  1093. package/lib/plugins/fullscreen/index.js.map +1 -0
  1094. package/lib/plugins/grid-line.d.ts +106 -0
  1095. package/lib/plugins/grid-line.js +82 -0
  1096. package/lib/plugins/grid-line.js.map +1 -0
  1097. package/lib/plugins/history/index.d.ts +120 -0
  1098. package/lib/plugins/history/index.js +202 -0
  1099. package/lib/plugins/history/index.js.map +1 -0
  1100. package/lib/plugins/history/util.d.ts +21 -0
  1101. package/lib/plugins/history/util.js +88 -0
  1102. package/lib/plugins/history/util.js.map +1 -0
  1103. package/lib/plugins/hull/index.d.ts +114 -0
  1104. package/lib/plugins/hull/index.js +168 -0
  1105. package/lib/plugins/hull/index.js.map +1 -0
  1106. package/lib/plugins/hull/util.d.ts +12 -0
  1107. package/lib/plugins/hull/util.js +207 -0
  1108. package/lib/plugins/hull/util.js.map +1 -0
  1109. package/lib/plugins/index.d.ts +28 -0
  1110. package/lib/plugins/index.js +32 -0
  1111. package/lib/plugins/index.js.map +1 -0
  1112. package/lib/plugins/legend.d.ts +129 -0
  1113. package/lib/plugins/legend.js +322 -0
  1114. package/lib/plugins/legend.js.map +1 -0
  1115. package/lib/plugins/timebar.d.ts +241 -0
  1116. package/lib/plugins/timebar.js +271 -0
  1117. package/lib/plugins/timebar.js.map +1 -0
  1118. package/lib/plugins/toolbar/index.d.ts +69 -0
  1119. package/lib/plugins/toolbar/index.js +75 -0
  1120. package/lib/plugins/toolbar/index.js.map +1 -0
  1121. package/lib/plugins/toolbar/util.d.ts +33 -0
  1122. package/lib/plugins/toolbar/util.js +97 -0
  1123. package/lib/plugins/toolbar/util.js.map +1 -0
  1124. package/lib/plugins/tooltip.d.ts +116 -0
  1125. package/lib/plugins/tooltip.js +298 -0
  1126. package/lib/plugins/tooltip.js.map +1 -0
  1127. package/lib/plugins/types.d.ts +4 -0
  1128. package/lib/plugins/types.js +3 -0
  1129. package/lib/plugins/types.js.map +1 -0
  1130. package/lib/plugins/watermark/index.d.ts +191 -0
  1131. package/lib/plugins/watermark/index.js +71 -0
  1132. package/lib/plugins/watermark/index.js.map +1 -0
  1133. package/lib/plugins/watermark/util.d.ts +18 -0
  1134. package/lib/plugins/watermark/util.js +78 -0
  1135. package/lib/plugins/watermark/util.js.map +1 -0
  1136. package/lib/preset.d.ts +1 -0
  1137. package/lib/preset.js +7 -0
  1138. package/lib/preset.js.map +1 -0
  1139. package/lib/registry/build-in.d.ts +6 -0
  1140. package/lib/registry/build-in.js +118 -0
  1141. package/lib/registry/build-in.js.map +1 -0
  1142. package/lib/registry/extension/index.d.ts +33 -0
  1143. package/lib/registry/extension/index.js +89 -0
  1144. package/lib/registry/extension/index.js.map +1 -0
  1145. package/lib/registry/extension/types.d.ts +38 -0
  1146. package/lib/registry/extension/types.js +3 -0
  1147. package/lib/registry/extension/types.js.map +1 -0
  1148. package/lib/registry/index.d.ts +59 -0
  1149. package/lib/registry/index.js +104 -0
  1150. package/lib/registry/index.js.map +1 -0
  1151. package/lib/registry/types.d.ts +39 -0
  1152. package/lib/registry/types.js +3 -0
  1153. package/lib/registry/types.js.map +1 -0
  1154. package/lib/runtime/animation.d.ts +54 -0
  1155. package/lib/runtime/animation.js +143 -0
  1156. package/lib/runtime/animation.js.map +1 -0
  1157. package/lib/runtime/batch.d.ts +11 -0
  1158. package/lib/runtime/batch.js +35 -0
  1159. package/lib/runtime/batch.js.map +1 -0
  1160. package/lib/runtime/behavior.d.ts +20 -0
  1161. package/lib/runtime/behavior.js +123 -0
  1162. package/lib/runtime/behavior.js.map +1 -0
  1163. package/lib/runtime/canvas.d.ts +60 -0
  1164. package/lib/runtime/canvas.js +262 -0
  1165. package/lib/runtime/canvas.js.map +1 -0
  1166. package/lib/runtime/data.d.ts +202 -0
  1167. package/lib/runtime/data.js +698 -0
  1168. package/lib/runtime/data.js.map +1 -0
  1169. package/lib/runtime/element.d.ts +102 -0
  1170. package/lib/runtime/element.js +557 -0
  1171. package/lib/runtime/element.js.map +1 -0
  1172. package/lib/runtime/graph.d.ts +826 -536
  1173. package/lib/runtime/graph.js +1028 -1830
  1174. package/lib/runtime/graph.js.map +1 -1
  1175. package/lib/runtime/layout.d.ts +38 -0
  1176. package/lib/runtime/layout.js +240 -0
  1177. package/lib/runtime/layout.js.map +1 -0
  1178. package/lib/runtime/plugin.d.ts +10 -0
  1179. package/lib/runtime/plugin.js +19 -0
  1180. package/lib/runtime/plugin.js.map +1 -0
  1181. package/lib/runtime/transform.d.ts +12 -0
  1182. package/lib/runtime/transform.js +31 -0
  1183. package/lib/runtime/transform.js.map +1 -0
  1184. package/lib/runtime/types.d.ts +90 -0
  1185. package/lib/runtime/types.js +3 -0
  1186. package/lib/runtime/types.js.map +1 -0
  1187. package/lib/runtime/viewport.d.ts +58 -0
  1188. package/lib/runtime/viewport.js +245 -0
  1189. package/lib/runtime/viewport.js.map +1 -0
  1190. package/lib/spec/behavior.d.ts +30 -0
  1191. package/lib/spec/behavior.js +3 -0
  1192. package/lib/spec/behavior.js.map +1 -0
  1193. package/lib/spec/canvas.d.ts +53 -0
  1194. package/lib/spec/canvas.js +3 -0
  1195. package/lib/spec/canvas.js.map +1 -0
  1196. package/lib/spec/data.d.ts +222 -0
  1197. package/lib/spec/data.js +3 -0
  1198. package/lib/spec/data.js.map +1 -0
  1199. package/lib/spec/element/animation.d.ts +6 -0
  1200. package/lib/spec/element/animation.js +3 -0
  1201. package/lib/spec/element/animation.js.map +1 -0
  1202. package/lib/spec/element/combo.d.ts +52 -0
  1203. package/lib/spec/element/combo.js +3 -0
  1204. package/lib/spec/element/combo.js.map +1 -0
  1205. package/lib/spec/element/edge.d.ts +52 -0
  1206. package/lib/spec/element/edge.js +3 -0
  1207. package/lib/spec/element/edge.js.map +1 -0
  1208. package/lib/spec/element/node.d.ts +52 -0
  1209. package/lib/spec/element/node.js +3 -0
  1210. package/lib/spec/element/node.js.map +1 -0
  1211. package/lib/spec/element/palette.d.ts +53 -0
  1212. package/lib/spec/element/palette.js +3 -0
  1213. package/lib/spec/element/palette.js.map +1 -0
  1214. package/lib/spec/graph.d.ts +91 -0
  1215. package/lib/spec/graph.js.map +1 -0
  1216. package/lib/spec/index.d.ts +12 -0
  1217. package/lib/spec/index.js +3 -0
  1218. package/lib/spec/index.js.map +1 -0
  1219. package/lib/spec/layout.d.ts +4 -0
  1220. package/lib/spec/layout.js.map +1 -0
  1221. package/lib/spec/plugin.d.ts +32 -0
  1222. package/lib/spec/plugin.js +3 -0
  1223. package/lib/spec/plugin.js.map +1 -0
  1224. package/lib/spec/theme.d.ts +7 -0
  1225. package/lib/spec/theme.js +3 -0
  1226. package/lib/spec/theme.js.map +1 -0
  1227. package/lib/spec/transform.d.ts +12 -0
  1228. package/lib/spec/transform.js +3 -0
  1229. package/lib/spec/transform.js.map +1 -0
  1230. package/lib/spec/viewport.d.ts +82 -0
  1231. package/lib/spec/viewport.js +3 -0
  1232. package/lib/spec/viewport.js.map +1 -0
  1233. package/lib/themes/base.d.ts +34 -0
  1234. package/lib/themes/base.js +257 -0
  1235. package/lib/themes/base.js.map +1 -0
  1236. package/lib/themes/dark.d.ts +2 -0
  1237. package/lib/themes/dark.js +42 -0
  1238. package/lib/themes/dark.js.map +1 -0
  1239. package/lib/themes/index.d.ts +2 -0
  1240. package/lib/themes/index.js +8 -0
  1241. package/lib/themes/index.js.map +1 -0
  1242. package/lib/themes/light.d.ts +2 -0
  1243. package/lib/themes/light.js +25 -0
  1244. package/lib/themes/light.js.map +1 -0
  1245. package/lib/themes/types.d.ts +9 -0
  1246. package/lib/themes/types.js +3 -0
  1247. package/lib/themes/types.js.map +1 -0
  1248. package/lib/transforms/arrange-draw-order.d.ts +10 -0
  1249. package/lib/transforms/arrange-draw-order.js +36 -0
  1250. package/lib/transforms/arrange-draw-order.js.map +1 -0
  1251. package/lib/transforms/base-transform.d.ts +8 -0
  1252. package/lib/transforms/base-transform.js +11 -0
  1253. package/lib/transforms/base-transform.js.map +1 -0
  1254. package/lib/transforms/collapse-expand-combo.d.ts +11 -0
  1255. package/lib/transforms/collapse-expand-combo.js +79 -0
  1256. package/lib/transforms/collapse-expand-combo.js.map +1 -0
  1257. package/lib/transforms/collapse-expand-node.d.ts +12 -0
  1258. package/lib/transforms/collapse-expand-node.js +95 -0
  1259. package/lib/transforms/collapse-expand-node.js.map +1 -0
  1260. package/lib/transforms/get-edge-actual-ends.d.ts +13 -0
  1261. package/lib/transforms/get-edge-actual-ends.js +41 -0
  1262. package/lib/transforms/get-edge-actual-ends.js.map +1 -0
  1263. package/lib/transforms/index.d.ts +8 -0
  1264. package/lib/transforms/index.js +18 -0
  1265. package/lib/transforms/index.js.map +1 -0
  1266. package/lib/transforms/process-parallel-edges.d.ts +85 -0
  1267. package/lib/transforms/process-parallel-edges.js +235 -0
  1268. package/lib/transforms/process-parallel-edges.js.map +1 -0
  1269. package/lib/transforms/types.d.ts +20 -0
  1270. package/lib/transforms/types.js +3 -0
  1271. package/lib/transforms/types.js.map +1 -0
  1272. package/lib/transforms/update-related-edge.d.ts +10 -0
  1273. package/lib/transforms/update-related-edge.js +27 -0
  1274. package/lib/transforms/update-related-edge.js.map +1 -0
  1275. package/lib/transforms/utils.d.ts +13 -0
  1276. package/lib/transforms/utils.js +29 -0
  1277. package/lib/transforms/utils.js.map +1 -0
  1278. package/lib/types/anchor.d.ts +3 -0
  1279. package/lib/types/anchor.js +3 -0
  1280. package/lib/types/anchor.js.map +1 -0
  1281. package/lib/types/animation.d.ts +5 -0
  1282. package/lib/types/animation.js +3 -0
  1283. package/lib/types/animation.js.map +1 -0
  1284. package/lib/types/callable.d.ts +30 -0
  1285. package/lib/types/callable.js +3 -0
  1286. package/lib/types/callable.js.map +1 -0
  1287. package/lib/types/canvas.d.ts +1 -0
  1288. package/lib/types/canvas.js +3 -0
  1289. package/lib/types/canvas.js.map +1 -0
  1290. package/lib/types/change.d.ts +68 -0
  1291. package/lib/types/change.js +3 -0
  1292. package/lib/types/change.js.map +1 -0
  1293. package/lib/types/combo.d.ts +20 -132
  1294. package/lib/types/data.d.ts +44 -27
  1295. package/lib/types/edge.d.ts +110 -97
  1296. package/lib/types/element.d.ts +18 -0
  1297. package/lib/types/element.js +3 -0
  1298. package/lib/types/element.js.map +1 -0
  1299. package/lib/types/enum.d.ts +1 -0
  1300. package/lib/types/enum.js +3 -0
  1301. package/lib/types/enum.js.map +1 -0
  1302. package/lib/types/event.d.ts +54 -38
  1303. package/lib/types/event.js +0 -31
  1304. package/lib/types/event.js.map +1 -1
  1305. package/lib/types/graphlib.d.ts +16 -0
  1306. package/lib/types/graphlib.js +3 -0
  1307. package/lib/types/graphlib.js.map +1 -0
  1308. package/lib/types/history.d.ts +49 -26
  1309. package/lib/types/history.js +0 -6
  1310. package/lib/types/history.js.map +1 -1
  1311. package/lib/types/id.d.ts +1 -0
  1312. package/lib/types/id.js +3 -0
  1313. package/lib/types/id.js.map +1 -0
  1314. package/lib/types/index.d.ts +26 -16
  1315. package/lib/types/index.js +0 -4
  1316. package/lib/types/index.js.map +1 -1
  1317. package/lib/types/layout.d.ts +8 -71
  1318. package/lib/types/layout.js +0 -22
  1319. package/lib/types/layout.js.map +1 -1
  1320. package/lib/types/node.d.ts +132 -203
  1321. package/lib/types/padding.d.ts +2 -0
  1322. package/lib/types/padding.js +3 -0
  1323. package/lib/types/padding.js.map +1 -0
  1324. package/lib/types/placement.d.ts +5 -0
  1325. package/lib/types/placement.js +3 -0
  1326. package/lib/types/placement.js.map +1 -0
  1327. package/lib/types/plugin.d.ts +5 -44
  1328. package/lib/types/plugin.js +0 -54
  1329. package/lib/types/plugin.js.map +1 -1
  1330. package/lib/types/point.d.ts +2 -0
  1331. package/lib/types/point.js +3 -0
  1332. package/lib/types/point.js.map +1 -0
  1333. package/lib/types/position.d.ts +2 -0
  1334. package/lib/types/position.js +3 -0
  1335. package/lib/types/position.js.map +1 -0
  1336. package/lib/types/prefix.d.ts +17 -0
  1337. package/lib/types/prefix.js +3 -0
  1338. package/lib/types/prefix.js.map +1 -0
  1339. package/lib/types/size.d.ts +3 -0
  1340. package/lib/types/size.js +3 -0
  1341. package/lib/types/size.js.map +1 -0
  1342. package/lib/types/state.d.ts +1 -0
  1343. package/lib/types/state.js +3 -0
  1344. package/lib/types/state.js.map +1 -0
  1345. package/lib/types/style.d.ts +9 -0
  1346. package/lib/types/style.js +3 -0
  1347. package/lib/types/style.js.map +1 -0
  1348. package/lib/types/tree.d.ts +5 -0
  1349. package/lib/types/tree.js +3 -0
  1350. package/lib/types/tree.js.map +1 -0
  1351. package/lib/types/vector.d.ts +2 -0
  1352. package/lib/types/vector.js +3 -0
  1353. package/lib/types/vector.js.map +1 -0
  1354. package/lib/types/viewport.d.ts +36 -0
  1355. package/lib/types/viewport.js +3 -0
  1356. package/lib/types/viewport.js.map +1 -0
  1357. package/lib/utils/anchor.d.ts +9 -0
  1358. package/lib/utils/anchor.js +20 -0
  1359. package/lib/utils/anchor.js.map +1 -0
  1360. package/lib/utils/animation.d.ts +47 -0
  1361. package/lib/utils/animation.js +197 -0
  1362. package/lib/utils/animation.js.map +1 -0
  1363. package/lib/utils/array.d.ts +9 -0
  1364. package/lib/utils/array.js +20 -0
  1365. package/lib/utils/array.js.map +1 -0
  1366. package/lib/utils/bbox.d.ts +108 -0
  1367. package/lib/utils/bbox.js +222 -0
  1368. package/lib/utils/bbox.js.map +1 -0
  1369. package/lib/utils/cache.d.ts +36 -0
  1370. package/lib/utils/cache.js +59 -0
  1371. package/lib/utils/cache.js.map +1 -0
  1372. package/lib/utils/change.d.ts +17 -0
  1373. package/lib/utils/change.js +96 -0
  1374. package/lib/utils/change.js.map +1 -0
  1375. package/lib/utils/collapsibility.d.ts +9 -0
  1376. package/lib/utils/collapsibility.js +15 -0
  1377. package/lib/utils/collapsibility.js.map +1 -0
  1378. package/lib/utils/data.d.ts +34 -0
  1379. package/lib/utils/data.js +65 -0
  1380. package/lib/utils/data.js.map +1 -0
  1381. package/lib/utils/diff.d.ts +15 -0
  1382. package/lib/utils/diff.js +44 -0
  1383. package/lib/utils/diff.js.map +1 -0
  1384. package/lib/utils/dom.d.ts +29 -0
  1385. package/lib/utils/dom.js +99 -0
  1386. package/lib/utils/dom.js.map +1 -0
  1387. package/lib/utils/edge.d.ts +192 -0
  1388. package/lib/utils/edge.js +537 -0
  1389. package/lib/utils/edge.js.map +1 -0
  1390. package/lib/utils/element.d.ts +231 -0
  1391. package/lib/utils/element.js +498 -0
  1392. package/lib/utils/element.js.map +1 -0
  1393. package/lib/utils/event/events.d.ts +26 -0
  1394. package/lib/utils/event/events.js +49 -0
  1395. package/lib/utils/event/events.js.map +1 -0
  1396. package/lib/utils/event/index.d.ts +29 -0
  1397. package/lib/utils/event/index.js +64 -0
  1398. package/lib/utils/event/index.js.map +1 -0
  1399. package/lib/utils/extension.d.ts +10 -0
  1400. package/lib/utils/extension.js +29 -0
  1401. package/lib/utils/extension.js.map +1 -0
  1402. package/lib/utils/graphlib.d.ts +14 -0
  1403. package/lib/utils/graphlib.js +50 -0
  1404. package/lib/utils/graphlib.js.map +1 -0
  1405. package/lib/utils/id.d.ts +20 -0
  1406. package/lib/utils/id.js +47 -0
  1407. package/lib/utils/id.js.map +1 -0
  1408. package/lib/utils/is.d.ts +34 -0
  1409. package/lib/utils/is.js +55 -0
  1410. package/lib/utils/is.js.map +1 -0
  1411. package/lib/utils/layout.d.ts +70 -0
  1412. package/lib/utils/layout.js +214 -0
  1413. package/lib/utils/layout.js.map +1 -0
  1414. package/lib/utils/line.d.ts +21 -0
  1415. package/lib/utils/line.js +46 -0
  1416. package/lib/utils/line.js.map +1 -0
  1417. package/lib/utils/math.d.ts +10 -0
  1418. package/lib/utils/math.js +17 -0
  1419. package/lib/utils/math.js.map +1 -0
  1420. package/lib/utils/node.d.ts +11 -0
  1421. package/lib/utils/node.js +23 -0
  1422. package/lib/utils/node.js.map +1 -0
  1423. package/lib/utils/padding.d.ts +9 -0
  1424. package/lib/utils/padding.js +19 -0
  1425. package/lib/utils/padding.js.map +1 -0
  1426. package/lib/utils/palette.d.ts +32 -0
  1427. package/lib/utils/palette.js +117 -0
  1428. package/lib/utils/palette.js.map +1 -0
  1429. package/lib/utils/path.d.ts +35 -0
  1430. package/lib/utils/path.js +150 -0
  1431. package/lib/utils/path.js.map +1 -0
  1432. package/lib/utils/placement.d.ts +9 -0
  1433. package/lib/utils/placement.js +22 -0
  1434. package/lib/utils/placement.js.map +1 -0
  1435. package/lib/utils/point.d.ts +192 -0
  1436. package/lib/utils/point.js +366 -0
  1437. package/lib/utils/point.js.map +1 -0
  1438. package/lib/utils/polygon.d.ts +17 -0
  1439. package/lib/utils/polygon.js +63 -0
  1440. package/lib/utils/polygon.js.map +1 -0
  1441. package/lib/utils/position.d.ts +50 -0
  1442. package/lib/utils/position.js +75 -0
  1443. package/lib/utils/position.js.map +1 -0
  1444. package/lib/utils/prefix.d.ts +66 -0
  1445. package/lib/utils/prefix.js +141 -0
  1446. package/lib/utils/prefix.js.map +1 -0
  1447. package/lib/utils/relation.d.ts +33 -0
  1448. package/lib/utils/relation.js +77 -0
  1449. package/lib/utils/relation.js.map +1 -0
  1450. package/lib/utils/router/orth.d.ts +103 -0
  1451. package/lib/utils/router/orth.js +292 -0
  1452. package/lib/utils/router/orth.js.map +1 -0
  1453. package/lib/utils/shape.d.ts +9 -0
  1454. package/lib/utils/shape.js +26 -0
  1455. package/lib/utils/shape.js.map +1 -0
  1456. package/lib/utils/shortcut.d.ts +31 -0
  1457. package/lib/utils/shortcut.js +92 -0
  1458. package/lib/utils/shortcut.js.map +1 -0
  1459. package/lib/utils/size.d.ts +7 -0
  1460. package/lib/utils/size.js +16 -0
  1461. package/lib/utils/size.js.map +1 -0
  1462. package/lib/utils/style.d.ts +30 -0
  1463. package/lib/utils/style.js +52 -0
  1464. package/lib/utils/style.js.map +1 -0
  1465. package/lib/utils/symbol.d.ts +30 -0
  1466. package/lib/utils/symbol.js +85 -0
  1467. package/lib/utils/symbol.js.map +1 -0
  1468. package/lib/utils/text.d.ts +26 -0
  1469. package/lib/utils/text.js +50 -0
  1470. package/lib/utils/text.js.map +1 -0
  1471. package/lib/utils/theme.d.ts +9 -0
  1472. package/lib/utils/theme.js +21 -0
  1473. package/lib/utils/theme.js.map +1 -0
  1474. package/lib/utils/transform.d.ts +24 -0
  1475. package/lib/utils/transform.js +48 -0
  1476. package/lib/utils/transform.js.map +1 -0
  1477. package/lib/utils/traverse.d.ts +23 -0
  1478. package/lib/utils/traverse.js +49 -0
  1479. package/lib/utils/traverse.js.map +1 -0
  1480. package/lib/utils/tree.d.ts +17 -0
  1481. package/lib/utils/tree.js +32 -0
  1482. package/lib/utils/tree.js.map +1 -0
  1483. package/lib/utils/vector.d.ts +143 -0
  1484. package/lib/utils/vector.js +210 -0
  1485. package/lib/utils/vector.js.map +1 -0
  1486. package/lib/utils/visibility.d.ts +13 -0
  1487. package/lib/utils/visibility.js +32 -0
  1488. package/lib/utils/visibility.js.map +1 -0
  1489. package/package.json +56 -104
  1490. package/src/animations/executor.ts +94 -0
  1491. package/src/animations/index.ts +23 -0
  1492. package/src/animations/types.ts +122 -0
  1493. package/src/behaviors/base-behavior.ts +6 -0
  1494. package/src/behaviors/brush-select.ts +394 -0
  1495. package/src/behaviors/click-select.ts +245 -0
  1496. package/src/behaviors/collapse-expand.ts +124 -0
  1497. package/src/behaviors/create-edge.ts +224 -0
  1498. package/src/behaviors/drag-canvas.ts +157 -0
  1499. package/src/behaviors/drag-element-force.ts +107 -0
  1500. package/src/behaviors/drag-element.ts +438 -0
  1501. package/src/behaviors/focus-element.ts +88 -0
  1502. package/src/behaviors/hover-activate.ts +185 -0
  1503. package/src/behaviors/index.ts +27 -0
  1504. package/src/behaviors/lasso-select.ts +82 -0
  1505. package/src/behaviors/scroll-canvas.ts +166 -0
  1506. package/src/behaviors/types.ts +7 -0
  1507. package/src/behaviors/zoom-canvas.ts +190 -0
  1508. package/src/constants/animation.ts +12 -0
  1509. package/src/constants/change.ts +65 -0
  1510. package/src/constants/element.ts +8 -0
  1511. package/src/constants/events/animation.ts +6 -0
  1512. package/src/constants/events/canvas.ts +115 -0
  1513. package/src/constants/events/combo.ts +109 -0
  1514. package/src/constants/events/common.ts +122 -0
  1515. package/src/constants/events/container.ts +14 -0
  1516. package/src/constants/events/edge.ts +91 -0
  1517. package/src/constants/events/graph.ts +158 -0
  1518. package/src/constants/events/history.ts +38 -0
  1519. package/src/constants/events/index.ts +9 -0
  1520. package/src/constants/events/node.ts +109 -0
  1521. package/src/constants/graphlib.ts +3 -0
  1522. package/src/constants/index.ts +5 -0
  1523. package/src/constants/registry.ts +62 -0
  1524. package/src/elements/base-element.ts +52 -0
  1525. package/src/elements/combos/base-combo.ts +260 -0
  1526. package/src/elements/combos/circle.ts +61 -0
  1527. package/src/elements/combos/index.ts +7 -0
  1528. package/src/elements/combos/rect.ts +41 -0
  1529. package/src/elements/edges/base-edge.ts +420 -0
  1530. package/src/elements/edges/cubic-horizontal.ts +60 -0
  1531. package/src/elements/edges/cubic-vertical.ts +60 -0
  1532. package/src/elements/edges/cubic.ts +86 -0
  1533. package/src/elements/edges/index.ts +15 -0
  1534. package/src/elements/edges/line.ts +37 -0
  1535. package/src/elements/edges/polyline.ts +143 -0
  1536. package/src/elements/edges/quadratic.ts +61 -0
  1537. package/src/elements/index.ts +3 -0
  1538. package/src/elements/nodes/base-node.ts +426 -0
  1539. package/src/elements/nodes/circle.ts +52 -0
  1540. package/src/elements/nodes/diamond.ts +35 -0
  1541. package/src/elements/nodes/donut.ts +147 -0
  1542. package/src/elements/nodes/ellipse.ts +58 -0
  1543. package/src/elements/nodes/hexagon.ts +45 -0
  1544. package/src/elements/nodes/html.ts +256 -0
  1545. package/src/elements/nodes/image.ts +89 -0
  1546. package/src/elements/nodes/index.ts +23 -0
  1547. package/src/elements/nodes/rect.ts +53 -0
  1548. package/src/elements/nodes/star.ts +56 -0
  1549. package/src/elements/nodes/triangle.ts +78 -0
  1550. package/src/elements/shapes/badge.ts +37 -0
  1551. package/src/elements/shapes/base-shape.ts +199 -0
  1552. package/src/elements/shapes/contour.ts +106 -0
  1553. package/src/elements/shapes/icon.ts +39 -0
  1554. package/src/elements/shapes/index.ts +18 -0
  1555. package/src/elements/shapes/label.ts +106 -0
  1556. package/src/elements/shapes/polygon.ts +51 -0
  1557. package/src/exports.ts +241 -0
  1558. package/src/index.ts +3 -23
  1559. package/src/layouts/base-layout.ts +18 -0
  1560. package/src/layouts/hierarchy.d.ts +10 -0
  1561. package/src/layouts/index.ts +17 -0
  1562. package/src/layouts/types.ts +131 -0
  1563. package/src/palettes/index.ts +67 -0
  1564. package/src/palettes/types.ts +9 -0
  1565. package/src/plugins/background/index.ts +64 -0
  1566. package/src/plugins/base-plugin.ts +6 -0
  1567. package/src/plugins/bubble-sets.ts +333 -0
  1568. package/src/plugins/camera-setting.ts +168 -0
  1569. package/src/plugins/contextmenu/index.ts +225 -0
  1570. package/src/plugins/contextmenu/util.ts +62 -0
  1571. package/src/plugins/fullscreen/index.ts +168 -0
  1572. package/src/plugins/grid-line.ts +165 -0
  1573. package/src/plugins/history/index.ts +256 -0
  1574. package/src/plugins/history/util.ts +90 -0
  1575. package/src/plugins/hull/index.ts +214 -0
  1576. package/src/plugins/hull/util.ts +222 -0
  1577. package/src/plugins/index.ts +29 -0
  1578. package/src/plugins/legend.ts +405 -0
  1579. package/src/plugins/timebar.ts +471 -0
  1580. package/src/plugins/toolbar/index.ts +131 -0
  1581. package/src/plugins/toolbar/util.ts +119 -0
  1582. package/src/plugins/tooltip.ts +343 -0
  1583. package/src/plugins/types.ts +5 -0
  1584. package/src/plugins/watermark/index.ts +239 -0
  1585. package/src/plugins/watermark/util.ts +93 -0
  1586. package/src/preset.ts +5 -0
  1587. package/src/registry/build-in.ts +186 -0
  1588. package/src/registry/extension/index.ts +112 -0
  1589. package/src/registry/extension/types.ts +45 -0
  1590. package/src/registry/index.ts +109 -0
  1591. package/src/registry/types.ts +26 -0
  1592. package/src/runtime/animation.ts +186 -0
  1593. package/src/runtime/batch.ts +38 -0
  1594. package/src/runtime/behavior.ts +136 -0
  1595. package/src/runtime/canvas.ts +348 -0
  1596. package/src/runtime/data.ts +789 -0
  1597. package/src/runtime/element.ts +738 -0
  1598. package/src/runtime/graph.ts +1309 -2353
  1599. package/src/runtime/layout.ts +299 -0
  1600. package/src/runtime/plugin.ts +21 -0
  1601. package/src/runtime/transform.ts +35 -0
  1602. package/src/runtime/types.ts +91 -0
  1603. package/src/runtime/viewport.ts +282 -0
  1604. package/src/spec/behavior.ts +33 -0
  1605. package/src/spec/canvas.ts +54 -0
  1606. package/src/spec/data.ts +225 -0
  1607. package/src/spec/element/animation.ts +6 -0
  1608. package/src/spec/element/combo.ts +55 -0
  1609. package/src/spec/element/edge.ts +55 -0
  1610. package/src/spec/element/node.ts +55 -0
  1611. package/src/spec/element/palette.ts +57 -0
  1612. package/src/spec/graph.ts +93 -0
  1613. package/src/spec/index.ts +12 -0
  1614. package/src/spec/layout.ts +7 -0
  1615. package/src/spec/plugin.ts +35 -0
  1616. package/src/spec/theme.ts +7 -0
  1617. package/src/spec/transform.ts +15 -0
  1618. package/src/spec/viewport.ts +76 -0
  1619. package/src/themes/base.ts +305 -0
  1620. package/src/themes/dark.ts +43 -0
  1621. package/src/themes/index.ts +2 -0
  1622. package/src/themes/light.ts +24 -0
  1623. package/src/themes/types.ts +10 -0
  1624. package/src/transforms/arrange-draw-order.ts +42 -0
  1625. package/src/transforms/base-transform.ts +12 -0
  1626. package/src/transforms/collapse-expand-combo.ts +80 -0
  1627. package/src/transforms/collapse-expand-node.ts +107 -0
  1628. package/src/transforms/get-edge-actual-ends.ts +45 -0
  1629. package/src/transforms/index.ts +9 -0
  1630. package/src/transforms/process-parallel-edges.ts +298 -0
  1631. package/src/transforms/types.ts +23 -0
  1632. package/src/transforms/update-related-edge.ts +31 -0
  1633. package/src/transforms/utils.ts +31 -0
  1634. package/src/types/anchor.ts +5 -0
  1635. package/src/types/animation.ts +7 -0
  1636. package/src/types/callable.ts +33 -0
  1637. package/src/types/canvas.ts +1 -0
  1638. package/src/types/change.ts +82 -0
  1639. package/src/types/combo.ts +21 -174
  1640. package/src/types/data.ts +53 -56
  1641. package/src/types/edge.ts +124 -122
  1642. package/src/types/element.ts +25 -0
  1643. package/src/types/enum.ts +1 -0
  1644. package/src/types/event.ts +73 -43
  1645. package/src/types/graphlib.ts +28 -0
  1646. package/src/types/history.ts +50 -27
  1647. package/src/types/id.ts +1 -0
  1648. package/src/types/index.ts +26 -54
  1649. package/src/types/layout.ts +8 -138
  1650. package/src/types/node.ts +140 -225
  1651. package/src/types/padding.ts +3 -0
  1652. package/src/types/placement.ts +17 -0
  1653. package/src/types/plugin.ts +5 -82
  1654. package/src/types/point.ts +2 -0
  1655. package/src/types/position.ts +3 -0
  1656. package/src/types/prefix.ts +19 -0
  1657. package/src/types/size.ts +5 -0
  1658. package/src/types/state.ts +1 -0
  1659. package/src/types/style.ts +10 -0
  1660. package/src/types/tree.ts +5 -0
  1661. package/src/types/vector.ts +3 -0
  1662. package/src/types/viewport.ts +41 -0
  1663. package/src/utils/anchor.ts +19 -0
  1664. package/src/utils/animation.ts +208 -0
  1665. package/src/utils/array.ts +15 -0
  1666. package/src/utils/bbox.ts +228 -0
  1667. package/src/utils/cache.ts +57 -0
  1668. package/src/utils/change.ts +101 -0
  1669. package/src/utils/collapsibility.ts +12 -0
  1670. package/src/utils/data.ts +64 -0
  1671. package/src/utils/diff.ts +43 -0
  1672. package/src/utils/dom.ts +115 -0
  1673. package/src/utils/edge.ts +621 -0
  1674. package/src/utils/element.ts +527 -0
  1675. package/src/utils/event/events.ts +72 -0
  1676. package/src/utils/event/index.ts +50 -0
  1677. package/src/utils/extension.ts +26 -0
  1678. package/src/utils/graphlib.ts +54 -0
  1679. package/src/utils/id.ts +46 -0
  1680. package/src/utils/is.ts +53 -0
  1681. package/src/utils/layout.ts +241 -0
  1682. package/src/utils/line.ts +50 -0
  1683. package/src/utils/math.ts +12 -0
  1684. package/src/utils/node.ts +23 -0
  1685. package/src/utils/padding.ts +16 -0
  1686. package/src/utils/palette.ts +126 -0
  1687. package/src/utils/path.ts +153 -0
  1688. package/src/utils/placement.ts +19 -0
  1689. package/src/utils/point.ts +374 -0
  1690. package/src/utils/polygon.ts +69 -0
  1691. package/src/utils/position.ts +73 -0
  1692. package/src/utils/prefix.ts +141 -0
  1693. package/src/utils/relation.ts +83 -0
  1694. package/src/utils/router/orth.ts +323 -0
  1695. package/src/utils/shape.ts +26 -0
  1696. package/src/utils/shortcut.ts +113 -0
  1697. package/src/utils/size.ts +12 -0
  1698. package/src/utils/style.ts +55 -0
  1699. package/src/utils/symbol.ts +86 -0
  1700. package/src/utils/text.ts +51 -0
  1701. package/src/utils/theme.ts +18 -0
  1702. package/src/utils/transform.ts +50 -0
  1703. package/src/utils/traverse.ts +59 -0
  1704. package/src/utils/tree.ts +47 -0
  1705. package/src/utils/vector.ts +208 -0
  1706. package/src/utils/visibility.ts +31 -0
  1707. package/esm/api-doc/behaviors.d.ts +0 -2
  1708. package/esm/api-doc/behaviors.js +0 -2
  1709. package/esm/api-doc/behaviors.js.map +0 -1
  1710. package/esm/api-doc/graph.d.ts +0 -4
  1711. package/esm/api-doc/graph.js +0 -4
  1712. package/esm/api-doc/graph.js.map +0 -1
  1713. package/esm/api-doc/item.d.ts +0 -11
  1714. package/esm/api-doc/item.js +0 -5
  1715. package/esm/api-doc/item.js.map +0 -1
  1716. package/esm/api-doc/layout.d.ts +0 -1
  1717. package/esm/api-doc/layout.js.map +0 -1
  1718. package/esm/api-doc/plugins.d.ts +0 -1
  1719. package/esm/api-doc/plugins.js +0 -2
  1720. package/esm/api-doc/plugins.js.map +0 -1
  1721. package/esm/api-doc/types.d.ts +0 -0
  1722. package/esm/api-doc/types.js +0 -3
  1723. package/esm/api-doc/types.js.map +0 -1
  1724. package/esm/api-doc/util.d.ts +0 -3
  1725. package/esm/api-doc/util.js +0 -4
  1726. package/esm/api-doc/util.js.map +0 -1
  1727. package/esm/constant/index.d.ts +0 -1
  1728. package/esm/constant/index.js +0 -2
  1729. package/esm/constant/index.js.map +0 -1
  1730. package/esm/constant/shape.d.ts +0 -23
  1731. package/esm/constant/shape.js +0 -27
  1732. package/esm/constant/shape.js.map +0 -1
  1733. package/esm/item/combo.d.ts +0 -81
  1734. package/esm/item/combo.js +0 -195
  1735. package/esm/item/combo.js.map +0 -1
  1736. package/esm/item/edge.d.ts +0 -78
  1737. package/esm/item/edge.js +0 -195
  1738. package/esm/item/edge.js.map +0 -1
  1739. package/esm/item/item.d.ts +0 -192
  1740. package/esm/item/item.js +0 -711
  1741. package/esm/item/item.js.map +0 -1
  1742. package/esm/item/node.d.ts +0 -64
  1743. package/esm/item/node.js +0 -204
  1744. package/esm/item/node.js.map +0 -1
  1745. package/esm/runtime/controller/data.d.ts +0 -86
  1746. package/esm/runtime/controller/data.js +0 -722
  1747. package/esm/runtime/controller/data.js.map +0 -1
  1748. package/esm/runtime/controller/extension.d.ts +0 -9
  1749. package/esm/runtime/controller/extension.js +0 -11
  1750. package/esm/runtime/controller/extension.js.map +0 -1
  1751. package/esm/runtime/controller/index.d.ts +0 -7
  1752. package/esm/runtime/controller/index.js +0 -8
  1753. package/esm/runtime/controller/index.js.map +0 -1
  1754. package/esm/runtime/controller/interaction.d.ts +0 -52
  1755. package/esm/runtime/controller/interaction.js +0 -274
  1756. package/esm/runtime/controller/interaction.js.map +0 -1
  1757. package/esm/runtime/controller/item.d.ts +0 -144
  1758. package/esm/runtime/controller/item.js +0 -1257
  1759. package/esm/runtime/controller/item.js.map +0 -1
  1760. package/esm/runtime/controller/layout.d.ts +0 -33
  1761. package/esm/runtime/controller/layout.js +0 -300
  1762. package/esm/runtime/controller/layout.js.map +0 -1
  1763. package/esm/runtime/controller/plugin.d.ts +0 -45
  1764. package/esm/runtime/controller/plugin.js +0 -173
  1765. package/esm/runtime/controller/plugin.js.map +0 -1
  1766. package/esm/runtime/controller/theme.d.ts +0 -29
  1767. package/esm/runtime/controller/theme.js +0 -58
  1768. package/esm/runtime/controller/theme.js.map +0 -1
  1769. package/esm/runtime/controller/viewport.d.ts +0 -11
  1770. package/esm/runtime/controller/viewport.js +0 -102
  1771. package/esm/runtime/controller/viewport.js.map +0 -1
  1772. package/esm/runtime/hooks.d.ts +0 -33
  1773. package/esm/runtime/hooks.js +0 -74
  1774. package/esm/runtime/hooks.js.map +0 -1
  1775. package/esm/stdlib/behavior/activate-relations.d.ts +0 -61
  1776. package/esm/stdlib/behavior/activate-relations.js +0 -85
  1777. package/esm/stdlib/behavior/activate-relations.js.map +0 -1
  1778. package/esm/stdlib/behavior/brush-select.d.ts +0 -109
  1779. package/esm/stdlib/behavior/brush-select.js +0 -267
  1780. package/esm/stdlib/behavior/brush-select.js.map +0 -1
  1781. package/esm/stdlib/behavior/click-select.d.ts +0 -73
  1782. package/esm/stdlib/behavior/click-select.js +0 -157
  1783. package/esm/stdlib/behavior/click-select.js.map +0 -1
  1784. package/esm/stdlib/behavior/collapse-expand-combo.d.ts +0 -28
  1785. package/esm/stdlib/behavior/collapse-expand-combo.js +0 -35
  1786. package/esm/stdlib/behavior/collapse-expand-combo.js.map +0 -1
  1787. package/esm/stdlib/behavior/collapse-expand-tree.d.ts +0 -44
  1788. package/esm/stdlib/behavior/collapse-expand-tree.js +0 -69
  1789. package/esm/stdlib/behavior/collapse-expand-tree.js.map +0 -1
  1790. package/esm/stdlib/behavior/create-edge.d.ts +0 -57
  1791. package/esm/stdlib/behavior/create-edge.js +0 -207
  1792. package/esm/stdlib/behavior/create-edge.js.map +0 -1
  1793. package/esm/stdlib/behavior/drag-canvas.d.ts +0 -82
  1794. package/esm/stdlib/behavior/drag-canvas.js +0 -281
  1795. package/esm/stdlib/behavior/drag-canvas.js.map +0 -1
  1796. package/esm/stdlib/behavior/drag-combo.d.ts +0 -111
  1797. package/esm/stdlib/behavior/drag-combo.js +0 -391
  1798. package/esm/stdlib/behavior/drag-combo.js.map +0 -1
  1799. package/esm/stdlib/behavior/drag-node.d.ts +0 -100
  1800. package/esm/stdlib/behavior/drag-node.js +0 -452
  1801. package/esm/stdlib/behavior/drag-node.js.map +0 -1
  1802. package/esm/stdlib/behavior/hover-activate.d.ts +0 -42
  1803. package/esm/stdlib/behavior/hover-activate.js +0 -64
  1804. package/esm/stdlib/behavior/hover-activate.js.map +0 -1
  1805. package/esm/stdlib/behavior/index.d.ts +0 -18
  1806. package/esm/stdlib/behavior/index.js +0 -19
  1807. package/esm/stdlib/behavior/index.js.map +0 -1
  1808. package/esm/stdlib/behavior/lasso-select.d.ts +0 -31
  1809. package/esm/stdlib/behavior/lasso-select.js +0 -78
  1810. package/esm/stdlib/behavior/lasso-select.js.map +0 -1
  1811. package/esm/stdlib/behavior/orbit-canvas-3d.d.ts +0 -36
  1812. package/esm/stdlib/behavior/orbit-canvas-3d.js +0 -62
  1813. package/esm/stdlib/behavior/orbit-canvas-3d.js.map +0 -1
  1814. package/esm/stdlib/behavior/rotate-canvas-3d.d.ts +0 -60
  1815. package/esm/stdlib/behavior/rotate-canvas-3d.js +0 -123
  1816. package/esm/stdlib/behavior/rotate-canvas-3d.js.map +0 -1
  1817. package/esm/stdlib/behavior/scroll-canvas.d.ts +0 -67
  1818. package/esm/stdlib/behavior/scroll-canvas.js +0 -266
  1819. package/esm/stdlib/behavior/scroll-canvas.js.map +0 -1
  1820. package/esm/stdlib/behavior/shortcuts-call.d.ts +0 -38
  1821. package/esm/stdlib/behavior/shortcuts-call.js +0 -80
  1822. package/esm/stdlib/behavior/shortcuts-call.js.map +0 -1
  1823. package/esm/stdlib/behavior/track-canvas-3d.d.ts +0 -36
  1824. package/esm/stdlib/behavior/track-canvas-3d.js +0 -62
  1825. package/esm/stdlib/behavior/track-canvas-3d.js.map +0 -1
  1826. package/esm/stdlib/behavior/types.d.ts +0 -13
  1827. package/esm/stdlib/behavior/types.js.map +0 -1
  1828. package/esm/stdlib/behavior/zoom-canvas-3d.d.ts +0 -58
  1829. package/esm/stdlib/behavior/zoom-canvas-3d.js +0 -98
  1830. package/esm/stdlib/behavior/zoom-canvas-3d.js.map +0 -1
  1831. package/esm/stdlib/behavior/zoom-canvas.d.ts +0 -69
  1832. package/esm/stdlib/behavior/zoom-canvas.js +0 -200
  1833. package/esm/stdlib/behavior/zoom-canvas.js.map +0 -1
  1834. package/esm/stdlib/data/index.d.ts +0 -3
  1835. package/esm/stdlib/data/index.js +0 -4
  1836. package/esm/stdlib/data/index.js.map +0 -1
  1837. package/esm/stdlib/data/mapNodeSize.d.ts +0 -12
  1838. package/esm/stdlib/data/mapNodeSize.js +0 -43
  1839. package/esm/stdlib/data/mapNodeSize.js.map +0 -1
  1840. package/esm/stdlib/data/transformV4Data.d.ts +0 -9
  1841. package/esm/stdlib/data/transformV4Data.js +0 -142
  1842. package/esm/stdlib/data/transformV4Data.js.map +0 -1
  1843. package/esm/stdlib/data/validateData.d.ts +0 -9
  1844. package/esm/stdlib/data/validateData.js +0 -103
  1845. package/esm/stdlib/data/validateData.js.map +0 -1
  1846. package/esm/stdlib/index.d.ts +0 -156
  1847. package/esm/stdlib/index.js +0 -211
  1848. package/esm/stdlib/index.js.map +0 -1
  1849. package/esm/stdlib/item/combo/circle.d.ts +0 -29
  1850. package/esm/stdlib/item/combo/circle.js +0 -56
  1851. package/esm/stdlib/item/combo/circle.js.map +0 -1
  1852. package/esm/stdlib/item/combo/index.d.ts +0 -2
  1853. package/esm/stdlib/item/combo/index.js +0 -3
  1854. package/esm/stdlib/item/combo/index.js.map +0 -1
  1855. package/esm/stdlib/item/combo/rect.d.ts +0 -31
  1856. package/esm/stdlib/item/combo/rect.js +0 -65
  1857. package/esm/stdlib/item/combo/rect.js.map +0 -1
  1858. package/esm/stdlib/item/edge/base.d.ts +0 -210
  1859. package/esm/stdlib/item/edge/base.js +0 -448
  1860. package/esm/stdlib/item/edge/base.js.map +0 -1
  1861. package/esm/stdlib/item/edge/cubic-horizontal.d.ts +0 -36
  1862. package/esm/stdlib/item/edge/cubic-horizontal.js +0 -56
  1863. package/esm/stdlib/item/edge/cubic-horizontal.js.map +0 -1
  1864. package/esm/stdlib/item/edge/cubic-vertical.d.ts +0 -36
  1865. package/esm/stdlib/item/edge/cubic-vertical.js +0 -56
  1866. package/esm/stdlib/item/edge/cubic-vertical.js.map +0 -1
  1867. package/esm/stdlib/item/edge/cubic.d.ts +0 -59
  1868. package/esm/stdlib/item/edge/cubic.js +0 -116
  1869. package/esm/stdlib/item/edge/cubic.js.map +0 -1
  1870. package/esm/stdlib/item/edge/index.d.ts +0 -7
  1871. package/esm/stdlib/item/edge/index.js +0 -8
  1872. package/esm/stdlib/item/edge/index.js.map +0 -1
  1873. package/esm/stdlib/item/edge/line.d.ts +0 -33
  1874. package/esm/stdlib/item/edge/line.js +0 -63
  1875. package/esm/stdlib/item/edge/line.js.map +0 -1
  1876. package/esm/stdlib/item/edge/loop.d.ts +0 -32
  1877. package/esm/stdlib/item/edge/loop.js +0 -115
  1878. package/esm/stdlib/item/edge/loop.js.map +0 -1
  1879. package/esm/stdlib/item/edge/polyline.d.ts +0 -45
  1880. package/esm/stdlib/item/edge/polyline.js +0 -92
  1881. package/esm/stdlib/item/edge/polyline.js.map +0 -1
  1882. package/esm/stdlib/item/edge/quadratic.d.ts +0 -40
  1883. package/esm/stdlib/item/edge/quadratic.js +0 -78
  1884. package/esm/stdlib/item/edge/quadratic.js.map +0 -1
  1885. package/esm/stdlib/item/node/base.d.ts +0 -256
  1886. package/esm/stdlib/item/node/base.js +0 -595
  1887. package/esm/stdlib/item/node/base.js.map +0 -1
  1888. package/esm/stdlib/item/node/base3d.d.ts +0 -96
  1889. package/esm/stdlib/item/node/base3d.js +0 -129
  1890. package/esm/stdlib/item/node/base3d.js.map +0 -1
  1891. package/esm/stdlib/item/node/circle.d.ts +0 -30
  1892. package/esm/stdlib/item/node/circle.js +0 -56
  1893. package/esm/stdlib/item/node/circle.js.map +0 -1
  1894. package/esm/stdlib/item/node/diamond.d.ts +0 -32
  1895. package/esm/stdlib/item/node/diamond.js +0 -79
  1896. package/esm/stdlib/item/node/diamond.js.map +0 -1
  1897. package/esm/stdlib/item/node/donut.d.ts +0 -70
  1898. package/esm/stdlib/item/node/donut.js +0 -207
  1899. package/esm/stdlib/item/node/donut.js.map +0 -1
  1900. package/esm/stdlib/item/node/ellipse.d.ts +0 -32
  1901. package/esm/stdlib/item/node/ellipse.js +0 -71
  1902. package/esm/stdlib/item/node/ellipse.js.map +0 -1
  1903. package/esm/stdlib/item/node/hexagon.d.ts +0 -33
  1904. package/esm/stdlib/item/node/hexagon.js +0 -109
  1905. package/esm/stdlib/item/node/hexagon.js.map +0 -1
  1906. package/esm/stdlib/item/node/image.d.ts +0 -40
  1907. package/esm/stdlib/item/node/image.js +0 -110
  1908. package/esm/stdlib/item/node/image.js.map +0 -1
  1909. package/esm/stdlib/item/node/index.d.ts +0 -11
  1910. package/esm/stdlib/item/node/index.js +0 -12
  1911. package/esm/stdlib/item/node/index.js.map +0 -1
  1912. package/esm/stdlib/item/node/modelRect.d.ts +0 -61
  1913. package/esm/stdlib/item/node/modelRect.js +0 -186
  1914. package/esm/stdlib/item/node/modelRect.js.map +0 -1
  1915. package/esm/stdlib/item/node/rect.d.ts +0 -32
  1916. package/esm/stdlib/item/node/rect.js +0 -75
  1917. package/esm/stdlib/item/node/rect.js.map +0 -1
  1918. package/esm/stdlib/item/node/sphere.d.ts +0 -33
  1919. package/esm/stdlib/item/node/sphere.js +0 -52
  1920. package/esm/stdlib/item/node/sphere.js.map +0 -1
  1921. package/esm/stdlib/item/node/star.d.ts +0 -34
  1922. package/esm/stdlib/item/node/star.js +0 -115
  1923. package/esm/stdlib/item/node/star.js.map +0 -1
  1924. package/esm/stdlib/item/node/triangle.d.ts +0 -44
  1925. package/esm/stdlib/item/node/triangle.js +0 -177
  1926. package/esm/stdlib/item/node/triangle.js.map +0 -1
  1927. package/esm/stdlib/plugin/fisheye/index.d.ts +0 -130
  1928. package/esm/stdlib/plugin/fisheye/index.js +0 -488
  1929. package/esm/stdlib/plugin/fisheye/index.js.map +0 -1
  1930. package/esm/stdlib/plugin/grid/index.d.ts +0 -36
  1931. package/esm/stdlib/plugin/grid/index.js +0 -81
  1932. package/esm/stdlib/plugin/grid/index.js.map +0 -1
  1933. package/esm/stdlib/plugin/history/combo-command.d.ts +0 -9
  1934. package/esm/stdlib/plugin/history/combo-command.js +0 -21
  1935. package/esm/stdlib/plugin/history/combo-command.js.map +0 -1
  1936. package/esm/stdlib/plugin/history/command.d.ts +0 -18
  1937. package/esm/stdlib/plugin/history/command.js +0 -51
  1938. package/esm/stdlib/plugin/history/command.js.map +0 -1
  1939. package/esm/stdlib/plugin/history/index.d.ts +0 -112
  1940. package/esm/stdlib/plugin/history/index.js +0 -275
  1941. package/esm/stdlib/plugin/history/index.js.map +0 -1
  1942. package/esm/stdlib/plugin/history/item-data-command.d.ts +0 -14
  1943. package/esm/stdlib/plugin/history/item-data-command.js +0 -72
  1944. package/esm/stdlib/plugin/history/item-data-command.js.map +0 -1
  1945. package/esm/stdlib/plugin/history/layer-updated-command.d.ts +0 -9
  1946. package/esm/stdlib/plugin/history/layer-updated-command.js +0 -21
  1947. package/esm/stdlib/plugin/history/layer-updated-command.js.map +0 -1
  1948. package/esm/stdlib/plugin/history/state-updated-command.d.ts +0 -9
  1949. package/esm/stdlib/plugin/history/state-updated-command.js +0 -20
  1950. package/esm/stdlib/plugin/history/state-updated-command.js.map +0 -1
  1951. package/esm/stdlib/plugin/history/visibility-updated-command.d.ts +0 -10
  1952. package/esm/stdlib/plugin/history/visibility-updated-command.js +0 -23
  1953. package/esm/stdlib/plugin/history/visibility-updated-command.js.map +0 -1
  1954. package/esm/stdlib/plugin/hull/bubbleset.d.ts +0 -9
  1955. package/esm/stdlib/plugin/hull/bubbleset.js +0 -592
  1956. package/esm/stdlib/plugin/hull/bubbleset.js.map +0 -1
  1957. package/esm/stdlib/plugin/hull/convexHull.d.ts +0 -14
  1958. package/esm/stdlib/plugin/hull/convexHull.js +0 -56
  1959. package/esm/stdlib/plugin/hull/convexHull.js.map +0 -1
  1960. package/esm/stdlib/plugin/hull/hullComponent.d.ts +0 -87
  1961. package/esm/stdlib/plugin/hull/hullComponent.js +0 -379
  1962. package/esm/stdlib/plugin/hull/hullComponent.js.map +0 -1
  1963. package/esm/stdlib/plugin/hull/index.d.ts +0 -59
  1964. package/esm/stdlib/plugin/hull/index.js +0 -161
  1965. package/esm/stdlib/plugin/hull/index.js.map +0 -1
  1966. package/esm/stdlib/plugin/hull/types.d.ts +0 -15
  1967. package/esm/stdlib/plugin/hull/types.js.map +0 -1
  1968. package/esm/stdlib/plugin/hull/util.d.ts +0 -77
  1969. package/esm/stdlib/plugin/hull/util.js +0 -401
  1970. package/esm/stdlib/plugin/hull/util.js.map +0 -1
  1971. package/esm/stdlib/plugin/index.d.ts +0 -10
  1972. package/esm/stdlib/plugin/index.js +0 -11
  1973. package/esm/stdlib/plugin/index.js.map +0 -1
  1974. package/esm/stdlib/plugin/legend/index.d.ts +0 -163
  1975. package/esm/stdlib/plugin/legend/index.js +0 -594
  1976. package/esm/stdlib/plugin/legend/index.js.map +0 -1
  1977. package/esm/stdlib/plugin/menu/index.d.ts +0 -55
  1978. package/esm/stdlib/plugin/menu/index.js +0 -237
  1979. package/esm/stdlib/plugin/menu/index.js.map +0 -1
  1980. package/esm/stdlib/plugin/minimap/index.d.ts +0 -118
  1981. package/esm/stdlib/plugin/minimap/index.js +0 -683
  1982. package/esm/stdlib/plugin/minimap/index.js.map +0 -1
  1983. package/esm/stdlib/plugin/snapline/index.d.ts +0 -167
  1984. package/esm/stdlib/plugin/snapline/index.js +0 -1063
  1985. package/esm/stdlib/plugin/snapline/index.js.map +0 -1
  1986. package/esm/stdlib/plugin/timebar/index.d.ts +0 -98
  1987. package/esm/stdlib/plugin/timebar/index.js +0 -303
  1988. package/esm/stdlib/plugin/timebar/index.js.map +0 -1
  1989. package/esm/stdlib/plugin/toolbar/index.d.ts +0 -59
  1990. package/esm/stdlib/plugin/toolbar/index.js +0 -215
  1991. package/esm/stdlib/plugin/toolbar/index.js.map +0 -1
  1992. package/esm/stdlib/plugin/tooltip/index.d.ts +0 -96
  1993. package/esm/stdlib/plugin/tooltip/index.js +0 -378
  1994. package/esm/stdlib/plugin/tooltip/index.js.map +0 -1
  1995. package/esm/stdlib/plugin/types.d.ts +0 -10
  1996. package/esm/stdlib/plugin/types.js.map +0 -1
  1997. package/esm/stdlib/selector/lasso.d.ts +0 -15
  1998. package/esm/stdlib/selector/lasso.js +0 -61
  1999. package/esm/stdlib/selector/lasso.js.map +0 -1
  2000. package/esm/stdlib/selector/rect.d.ts +0 -16
  2001. package/esm/stdlib/selector/rect.js +0 -54
  2002. package/esm/stdlib/selector/rect.js.map +0 -1
  2003. package/esm/stdlib/theme/dark.d.ts +0 -2
  2004. package/esm/stdlib/theme/dark.js +0 -332
  2005. package/esm/stdlib/theme/dark.js.map +0 -1
  2006. package/esm/stdlib/theme/index.d.ts +0 -2
  2007. package/esm/stdlib/theme/index.js +0 -3
  2008. package/esm/stdlib/theme/index.js.map +0 -1
  2009. package/esm/stdlib/theme/light.d.ts +0 -2
  2010. package/esm/stdlib/theme/light.js +0 -330
  2011. package/esm/stdlib/theme/light.js.map +0 -1
  2012. package/esm/stdlib/themeSolver/base.d.ts +0 -15
  2013. package/esm/stdlib/themeSolver/base.js +0 -11
  2014. package/esm/stdlib/themeSolver/base.js.map +0 -1
  2015. package/esm/stdlib/themeSolver/index.d.ts +0 -3
  2016. package/esm/stdlib/themeSolver/index.js +0 -4
  2017. package/esm/stdlib/themeSolver/index.js.map +0 -1
  2018. package/esm/stdlib/themeSolver/spec.d.ts +0 -35
  2019. package/esm/stdlib/themeSolver/spec.js +0 -66
  2020. package/esm/stdlib/themeSolver/spec.js.map +0 -1
  2021. package/esm/stdlib/themeSolver/subject.d.ts +0 -41
  2022. package/esm/stdlib/themeSolver/subject.js +0 -396
  2023. package/esm/stdlib/themeSolver/subject.js.map +0 -1
  2024. package/esm/types/animate.d.ts +0 -59
  2025. package/esm/types/animate.js +0 -2
  2026. package/esm/types/animate.js.map +0 -1
  2027. package/esm/types/behavior.d.ts +0 -45
  2028. package/esm/types/behavior.js +0 -14
  2029. package/esm/types/behavior.js.map +0 -1
  2030. package/esm/types/common.d.ts +0 -17
  2031. package/esm/types/common.js +0 -2
  2032. package/esm/types/common.js.map +0 -1
  2033. package/esm/types/graph.d.ts +0 -620
  2034. package/esm/types/graph.js.map +0 -1
  2035. package/esm/types/hook.d.ts +0 -144
  2036. package/esm/types/hook.js +0 -2
  2037. package/esm/types/hook.js.map +0 -1
  2038. package/esm/types/item.d.ts +0 -241
  2039. package/esm/types/item.js +0 -16
  2040. package/esm/types/item.js.map +0 -1
  2041. package/esm/types/loop.d.ts +0 -21
  2042. package/esm/types/loop.js +0 -12
  2043. package/esm/types/loop.js.map +0 -1
  2044. package/esm/types/render.d.ts +0 -1
  2045. package/esm/types/render.js +0 -2
  2046. package/esm/types/render.js.map +0 -1
  2047. package/esm/types/spec.d.ts +0 -98
  2048. package/esm/types/spec.js +0 -2
  2049. package/esm/types/spec.js.map +0 -1
  2050. package/esm/types/stdlib.d.ts +0 -13
  2051. package/esm/types/stdlib.js +0 -2
  2052. package/esm/types/stdlib.js.map +0 -1
  2053. package/esm/types/theme.d.ts +0 -168
  2054. package/esm/types/theme.js +0 -14
  2055. package/esm/types/theme.js.map +0 -1
  2056. package/esm/types/view.d.ts +0 -28
  2057. package/esm/types/view.js +0 -2
  2058. package/esm/types/view.js.map +0 -1
  2059. package/esm/util/animate.d.ts +0 -106
  2060. package/esm/util/animate.js +0 -391
  2061. package/esm/util/animate.js.map +0 -1
  2062. package/esm/util/array.d.ts +0 -28
  2063. package/esm/util/array.js +0 -70
  2064. package/esm/util/array.js.map +0 -1
  2065. package/esm/util/arrow.d.ts +0 -17
  2066. package/esm/util/arrow.js +0 -56
  2067. package/esm/util/arrow.js.map +0 -1
  2068. package/esm/util/bbox.d.ts +0 -121
  2069. package/esm/util/bbox.js +0 -284
  2070. package/esm/util/bbox.js.map +0 -1
  2071. package/esm/util/behavior.d.ts +0 -2
  2072. package/esm/util/behavior.js +0 -12
  2073. package/esm/util/behavior.js.map +0 -1
  2074. package/esm/util/canvas.d.ts +0 -19
  2075. package/esm/util/canvas.js +0 -66
  2076. package/esm/util/canvas.js.map +0 -1
  2077. package/esm/util/data.d.ts +0 -96
  2078. package/esm/util/data.js +0 -262
  2079. package/esm/util/data.js.map +0 -1
  2080. package/esm/util/event.d.ts +0 -42
  2081. package/esm/util/event.js +0 -103
  2082. package/esm/util/event.js.map +0 -1
  2083. package/esm/util/extend.d.ts +0 -27
  2084. package/esm/util/extend.js +0 -22
  2085. package/esm/util/extend.js.map +0 -1
  2086. package/esm/util/extension.d.ts +0 -10
  2087. package/esm/util/extension.js +0 -24
  2088. package/esm/util/extension.js.map +0 -1
  2089. package/esm/util/index.d.ts +0 -52
  2090. package/esm/util/index.js +0 -24
  2091. package/esm/util/index.js.map +0 -1
  2092. package/esm/util/item.d.ts +0 -30
  2093. package/esm/util/item.js +0 -90
  2094. package/esm/util/item.js.map +0 -1
  2095. package/esm/util/layout.d.ts +0 -51
  2096. package/esm/util/layout.js +0 -205
  2097. package/esm/util/layout.js.map +0 -1
  2098. package/esm/util/loop.d.ts +0 -37
  2099. package/esm/util/loop.js +0 -104
  2100. package/esm/util/loop.js.map +0 -1
  2101. package/esm/util/mapper.d.ts +0 -17
  2102. package/esm/util/mapper.js +0 -55
  2103. package/esm/util/mapper.js.map +0 -1
  2104. package/esm/util/math.d.ts +0 -23
  2105. package/esm/util/math.js +0 -23
  2106. package/esm/util/math.js.map +0 -1
  2107. package/esm/util/mock.d.ts +0 -30
  2108. package/esm/util/mock.js +0 -69
  2109. package/esm/util/mock.js.map +0 -1
  2110. package/esm/util/path.d.ts +0 -11
  2111. package/esm/util/path.js +0 -44
  2112. package/esm/util/path.js.map +0 -1
  2113. package/esm/util/point.d.ts +0 -83
  2114. package/esm/util/point.js +0 -189
  2115. package/esm/util/point.js.map +0 -1
  2116. package/esm/util/polyline.d.ts +0 -113
  2117. package/esm/util/polyline.js +0 -505
  2118. package/esm/util/polyline.js.map +0 -1
  2119. package/esm/util/router.d.ts +0 -32
  2120. package/esm/util/router.js +0 -383
  2121. package/esm/util/router.js.map +0 -1
  2122. package/esm/util/shape.d.ts +0 -140
  2123. package/esm/util/shape.js +0 -616
  2124. package/esm/util/shape.js.map +0 -1
  2125. package/esm/util/shape3d.d.ts +0 -23
  2126. package/esm/util/shape3d.js +0 -153
  2127. package/esm/util/shape3d.js.map +0 -1
  2128. package/esm/util/text.d.ts +0 -18
  2129. package/esm/util/text.js +0 -36
  2130. package/esm/util/text.js.map +0 -1
  2131. package/esm/util/type.d.ts +0 -8
  2132. package/esm/util/type.js +0 -8
  2133. package/esm/util/type.js.map +0 -1
  2134. package/esm/util/warn.d.ts +0 -14
  2135. package/esm/util/warn.js +0 -4
  2136. package/esm/util/warn.js.map +0 -1
  2137. package/esm/util/zoom.d.ts +0 -17
  2138. package/esm/util/zoom.js +0 -40
  2139. package/esm/util/zoom.js.map +0 -1
  2140. package/lib/api-doc/behaviors.d.ts +0 -2
  2141. package/lib/api-doc/behaviors.js +0 -18
  2142. package/lib/api-doc/behaviors.js.map +0 -1
  2143. package/lib/api-doc/graph.d.ts +0 -4
  2144. package/lib/api-doc/graph.js +0 -11
  2145. package/lib/api-doc/graph.js.map +0 -1
  2146. package/lib/api-doc/item.d.ts +0 -11
  2147. package/lib/api-doc/item.js +0 -25
  2148. package/lib/api-doc/item.js.map +0 -1
  2149. package/lib/api-doc/layout.d.ts +0 -1
  2150. package/lib/api-doc/layout.js.map +0 -1
  2151. package/lib/api-doc/plugins.d.ts +0 -1
  2152. package/lib/api-doc/plugins.js +0 -18
  2153. package/lib/api-doc/plugins.js.map +0 -1
  2154. package/lib/api-doc/types.d.ts +0 -0
  2155. package/lib/api-doc/types.js +0 -3
  2156. package/lib/api-doc/types.js.map +0 -1
  2157. package/lib/api-doc/util.d.ts +0 -3
  2158. package/lib/api-doc/util.js +0 -10
  2159. package/lib/api-doc/util.js.map +0 -1
  2160. package/lib/constant/index.d.ts +0 -1
  2161. package/lib/constant/index.js +0 -18
  2162. package/lib/constant/index.js.map +0 -1
  2163. package/lib/constant/shape.d.ts +0 -23
  2164. package/lib/constant/shape.js +0 -30
  2165. package/lib/constant/shape.js.map +0 -1
  2166. package/lib/item/combo.d.ts +0 -81
  2167. package/lib/item/combo.js +0 -201
  2168. package/lib/item/combo.js.map +0 -1
  2169. package/lib/item/edge.d.ts +0 -78
  2170. package/lib/item/edge.js +0 -201
  2171. package/lib/item/edge.js.map +0 -1
  2172. package/lib/item/item.d.ts +0 -192
  2173. package/lib/item/item.js +0 -714
  2174. package/lib/item/item.js.map +0 -1
  2175. package/lib/item/node.d.ts +0 -64
  2176. package/lib/item/node.js +0 -210
  2177. package/lib/item/node.js.map +0 -1
  2178. package/lib/runtime/controller/data.d.ts +0 -86
  2179. package/lib/runtime/controller/data.js +0 -726
  2180. package/lib/runtime/controller/data.js.map +0 -1
  2181. package/lib/runtime/controller/extension.d.ts +0 -9
  2182. package/lib/runtime/controller/extension.js +0 -15
  2183. package/lib/runtime/controller/extension.js.map +0 -1
  2184. package/lib/runtime/controller/index.d.ts +0 -7
  2185. package/lib/runtime/controller/index.js +0 -24
  2186. package/lib/runtime/controller/index.js.map +0 -1
  2187. package/lib/runtime/controller/interaction.d.ts +0 -52
  2188. package/lib/runtime/controller/interaction.js +0 -278
  2189. package/lib/runtime/controller/interaction.js.map +0 -1
  2190. package/lib/runtime/controller/item.d.ts +0 -144
  2191. package/lib/runtime/controller/item.js +0 -1264
  2192. package/lib/runtime/controller/item.js.map +0 -1
  2193. package/lib/runtime/controller/layout.d.ts +0 -33
  2194. package/lib/runtime/controller/layout.js +0 -327
  2195. package/lib/runtime/controller/layout.js.map +0 -1
  2196. package/lib/runtime/controller/plugin.d.ts +0 -45
  2197. package/lib/runtime/controller/plugin.js +0 -180
  2198. package/lib/runtime/controller/plugin.js.map +0 -1
  2199. package/lib/runtime/controller/theme.d.ts +0 -29
  2200. package/lib/runtime/controller/theme.js +0 -65
  2201. package/lib/runtime/controller/theme.js.map +0 -1
  2202. package/lib/runtime/controller/viewport.d.ts +0 -11
  2203. package/lib/runtime/controller/viewport.js +0 -106
  2204. package/lib/runtime/controller/viewport.js.map +0 -1
  2205. package/lib/runtime/hooks.d.ts +0 -33
  2206. package/lib/runtime/hooks.js +0 -77
  2207. package/lib/runtime/hooks.js.map +0 -1
  2208. package/lib/stdlib/behavior/activate-relations.d.ts +0 -61
  2209. package/lib/stdlib/behavior/activate-relations.js +0 -89
  2210. package/lib/stdlib/behavior/activate-relations.js.map +0 -1
  2211. package/lib/stdlib/behavior/brush-select.d.ts +0 -109
  2212. package/lib/stdlib/behavior/brush-select.js +0 -271
  2213. package/lib/stdlib/behavior/brush-select.js.map +0 -1
  2214. package/lib/stdlib/behavior/click-select.d.ts +0 -73
  2215. package/lib/stdlib/behavior/click-select.js +0 -161
  2216. package/lib/stdlib/behavior/click-select.js.map +0 -1
  2217. package/lib/stdlib/behavior/collapse-expand-combo.d.ts +0 -28
  2218. package/lib/stdlib/behavior/collapse-expand-combo.js +0 -39
  2219. package/lib/stdlib/behavior/collapse-expand-combo.js.map +0 -1
  2220. package/lib/stdlib/behavior/collapse-expand-tree.d.ts +0 -44
  2221. package/lib/stdlib/behavior/collapse-expand-tree.js +0 -73
  2222. package/lib/stdlib/behavior/collapse-expand-tree.js.map +0 -1
  2223. package/lib/stdlib/behavior/create-edge.d.ts +0 -57
  2224. package/lib/stdlib/behavior/create-edge.js +0 -211
  2225. package/lib/stdlib/behavior/create-edge.js.map +0 -1
  2226. package/lib/stdlib/behavior/drag-canvas.d.ts +0 -82
  2227. package/lib/stdlib/behavior/drag-canvas.js +0 -285
  2228. package/lib/stdlib/behavior/drag-canvas.js.map +0 -1
  2229. package/lib/stdlib/behavior/drag-combo.d.ts +0 -111
  2230. package/lib/stdlib/behavior/drag-combo.js +0 -395
  2231. package/lib/stdlib/behavior/drag-combo.js.map +0 -1
  2232. package/lib/stdlib/behavior/drag-node.d.ts +0 -100
  2233. package/lib/stdlib/behavior/drag-node.js +0 -456
  2234. package/lib/stdlib/behavior/drag-node.js.map +0 -1
  2235. package/lib/stdlib/behavior/hover-activate.d.ts +0 -42
  2236. package/lib/stdlib/behavior/hover-activate.js +0 -68
  2237. package/lib/stdlib/behavior/hover-activate.js.map +0 -1
  2238. package/lib/stdlib/behavior/index.d.ts +0 -18
  2239. package/lib/stdlib/behavior/index.js +0 -35
  2240. package/lib/stdlib/behavior/index.js.map +0 -1
  2241. package/lib/stdlib/behavior/lasso-select.d.ts +0 -31
  2242. package/lib/stdlib/behavior/lasso-select.js +0 -82
  2243. package/lib/stdlib/behavior/lasso-select.js.map +0 -1
  2244. package/lib/stdlib/behavior/orbit-canvas-3d.d.ts +0 -36
  2245. package/lib/stdlib/behavior/orbit-canvas-3d.js +0 -66
  2246. package/lib/stdlib/behavior/orbit-canvas-3d.js.map +0 -1
  2247. package/lib/stdlib/behavior/rotate-canvas-3d.d.ts +0 -60
  2248. package/lib/stdlib/behavior/rotate-canvas-3d.js +0 -127
  2249. package/lib/stdlib/behavior/rotate-canvas-3d.js.map +0 -1
  2250. package/lib/stdlib/behavior/scroll-canvas.d.ts +0 -67
  2251. package/lib/stdlib/behavior/scroll-canvas.js +0 -270
  2252. package/lib/stdlib/behavior/scroll-canvas.js.map +0 -1
  2253. package/lib/stdlib/behavior/shortcuts-call.d.ts +0 -38
  2254. package/lib/stdlib/behavior/shortcuts-call.js +0 -84
  2255. package/lib/stdlib/behavior/shortcuts-call.js.map +0 -1
  2256. package/lib/stdlib/behavior/track-canvas-3d.d.ts +0 -36
  2257. package/lib/stdlib/behavior/track-canvas-3d.js +0 -66
  2258. package/lib/stdlib/behavior/track-canvas-3d.js.map +0 -1
  2259. package/lib/stdlib/behavior/types.d.ts +0 -13
  2260. package/lib/stdlib/behavior/types.js.map +0 -1
  2261. package/lib/stdlib/behavior/zoom-canvas-3d.d.ts +0 -58
  2262. package/lib/stdlib/behavior/zoom-canvas-3d.js +0 -102
  2263. package/lib/stdlib/behavior/zoom-canvas-3d.js.map +0 -1
  2264. package/lib/stdlib/behavior/zoom-canvas.d.ts +0 -69
  2265. package/lib/stdlib/behavior/zoom-canvas.js +0 -204
  2266. package/lib/stdlib/behavior/zoom-canvas.js.map +0 -1
  2267. package/lib/stdlib/data/index.d.ts +0 -3
  2268. package/lib/stdlib/data/index.js +0 -20
  2269. package/lib/stdlib/data/index.js.map +0 -1
  2270. package/lib/stdlib/data/mapNodeSize.d.ts +0 -12
  2271. package/lib/stdlib/data/mapNodeSize.js +0 -47
  2272. package/lib/stdlib/data/mapNodeSize.js.map +0 -1
  2273. package/lib/stdlib/data/transformV4Data.d.ts +0 -9
  2274. package/lib/stdlib/data/transformV4Data.js +0 -146
  2275. package/lib/stdlib/data/transformV4Data.js.map +0 -1
  2276. package/lib/stdlib/data/validateData.d.ts +0 -9
  2277. package/lib/stdlib/data/validateData.js +0 -107
  2278. package/lib/stdlib/data/validateData.js.map +0 -1
  2279. package/lib/stdlib/index.d.ts +0 -156
  2280. package/lib/stdlib/index.js +0 -243
  2281. package/lib/stdlib/index.js.map +0 -1
  2282. package/lib/stdlib/item/combo/circle.d.ts +0 -29
  2283. package/lib/stdlib/item/combo/circle.js +0 -60
  2284. package/lib/stdlib/item/combo/circle.js.map +0 -1
  2285. package/lib/stdlib/item/combo/index.d.ts +0 -2
  2286. package/lib/stdlib/item/combo/index.js +0 -19
  2287. package/lib/stdlib/item/combo/index.js.map +0 -1
  2288. package/lib/stdlib/item/combo/rect.d.ts +0 -31
  2289. package/lib/stdlib/item/combo/rect.js +0 -69
  2290. package/lib/stdlib/item/combo/rect.js.map +0 -1
  2291. package/lib/stdlib/item/edge/base.d.ts +0 -210
  2292. package/lib/stdlib/item/edge/base.js +0 -452
  2293. package/lib/stdlib/item/edge/base.js.map +0 -1
  2294. package/lib/stdlib/item/edge/cubic-horizontal.d.ts +0 -36
  2295. package/lib/stdlib/item/edge/cubic-horizontal.js +0 -60
  2296. package/lib/stdlib/item/edge/cubic-horizontal.js.map +0 -1
  2297. package/lib/stdlib/item/edge/cubic-vertical.d.ts +0 -36
  2298. package/lib/stdlib/item/edge/cubic-vertical.js +0 -60
  2299. package/lib/stdlib/item/edge/cubic-vertical.js.map +0 -1
  2300. package/lib/stdlib/item/edge/cubic.d.ts +0 -59
  2301. package/lib/stdlib/item/edge/cubic.js +0 -120
  2302. package/lib/stdlib/item/edge/cubic.js.map +0 -1
  2303. package/lib/stdlib/item/edge/index.d.ts +0 -7
  2304. package/lib/stdlib/item/edge/index.js +0 -24
  2305. package/lib/stdlib/item/edge/index.js.map +0 -1
  2306. package/lib/stdlib/item/edge/line.d.ts +0 -33
  2307. package/lib/stdlib/item/edge/line.js +0 -67
  2308. package/lib/stdlib/item/edge/line.js.map +0 -1
  2309. package/lib/stdlib/item/edge/loop.d.ts +0 -32
  2310. package/lib/stdlib/item/edge/loop.js +0 -119
  2311. package/lib/stdlib/item/edge/loop.js.map +0 -1
  2312. package/lib/stdlib/item/edge/polyline.d.ts +0 -45
  2313. package/lib/stdlib/item/edge/polyline.js +0 -96
  2314. package/lib/stdlib/item/edge/polyline.js.map +0 -1
  2315. package/lib/stdlib/item/edge/quadratic.d.ts +0 -40
  2316. package/lib/stdlib/item/edge/quadratic.js +0 -82
  2317. package/lib/stdlib/item/edge/quadratic.js.map +0 -1
  2318. package/lib/stdlib/item/node/base.d.ts +0 -256
  2319. package/lib/stdlib/item/node/base.js +0 -599
  2320. package/lib/stdlib/item/node/base.js.map +0 -1
  2321. package/lib/stdlib/item/node/base3d.d.ts +0 -96
  2322. package/lib/stdlib/item/node/base3d.js +0 -133
  2323. package/lib/stdlib/item/node/base3d.js.map +0 -1
  2324. package/lib/stdlib/item/node/circle.d.ts +0 -30
  2325. package/lib/stdlib/item/node/circle.js +0 -60
  2326. package/lib/stdlib/item/node/circle.js.map +0 -1
  2327. package/lib/stdlib/item/node/diamond.d.ts +0 -32
  2328. package/lib/stdlib/item/node/diamond.js +0 -83
  2329. package/lib/stdlib/item/node/diamond.js.map +0 -1
  2330. package/lib/stdlib/item/node/donut.d.ts +0 -70
  2331. package/lib/stdlib/item/node/donut.js +0 -211
  2332. package/lib/stdlib/item/node/donut.js.map +0 -1
  2333. package/lib/stdlib/item/node/ellipse.d.ts +0 -32
  2334. package/lib/stdlib/item/node/ellipse.js +0 -75
  2335. package/lib/stdlib/item/node/ellipse.js.map +0 -1
  2336. package/lib/stdlib/item/node/hexagon.d.ts +0 -33
  2337. package/lib/stdlib/item/node/hexagon.js +0 -113
  2338. package/lib/stdlib/item/node/hexagon.js.map +0 -1
  2339. package/lib/stdlib/item/node/image.d.ts +0 -40
  2340. package/lib/stdlib/item/node/image.js +0 -114
  2341. package/lib/stdlib/item/node/image.js.map +0 -1
  2342. package/lib/stdlib/item/node/index.d.ts +0 -11
  2343. package/lib/stdlib/item/node/index.js +0 -28
  2344. package/lib/stdlib/item/node/index.js.map +0 -1
  2345. package/lib/stdlib/item/node/modelRect.d.ts +0 -61
  2346. package/lib/stdlib/item/node/modelRect.js +0 -190
  2347. package/lib/stdlib/item/node/modelRect.js.map +0 -1
  2348. package/lib/stdlib/item/node/rect.d.ts +0 -32
  2349. package/lib/stdlib/item/node/rect.js +0 -79
  2350. package/lib/stdlib/item/node/rect.js.map +0 -1
  2351. package/lib/stdlib/item/node/sphere.d.ts +0 -33
  2352. package/lib/stdlib/item/node/sphere.js +0 -56
  2353. package/lib/stdlib/item/node/sphere.js.map +0 -1
  2354. package/lib/stdlib/item/node/star.d.ts +0 -34
  2355. package/lib/stdlib/item/node/star.js +0 -119
  2356. package/lib/stdlib/item/node/star.js.map +0 -1
  2357. package/lib/stdlib/item/node/triangle.d.ts +0 -44
  2358. package/lib/stdlib/item/node/triangle.js +0 -181
  2359. package/lib/stdlib/item/node/triangle.js.map +0 -1
  2360. package/lib/stdlib/plugin/fisheye/index.d.ts +0 -130
  2361. package/lib/stdlib/plugin/fisheye/index.js +0 -492
  2362. package/lib/stdlib/plugin/fisheye/index.js.map +0 -1
  2363. package/lib/stdlib/plugin/grid/index.d.ts +0 -36
  2364. package/lib/stdlib/plugin/grid/index.js +0 -85
  2365. package/lib/stdlib/plugin/grid/index.js.map +0 -1
  2366. package/lib/stdlib/plugin/history/combo-command.d.ts +0 -9
  2367. package/lib/stdlib/plugin/history/combo-command.js +0 -25
  2368. package/lib/stdlib/plugin/history/combo-command.js.map +0 -1
  2369. package/lib/stdlib/plugin/history/command.d.ts +0 -18
  2370. package/lib/stdlib/plugin/history/command.js +0 -54
  2371. package/lib/stdlib/plugin/history/command.js.map +0 -1
  2372. package/lib/stdlib/plugin/history/index.d.ts +0 -112
  2373. package/lib/stdlib/plugin/history/index.js +0 -283
  2374. package/lib/stdlib/plugin/history/index.js.map +0 -1
  2375. package/lib/stdlib/plugin/history/item-data-command.d.ts +0 -14
  2376. package/lib/stdlib/plugin/history/item-data-command.js +0 -76
  2377. package/lib/stdlib/plugin/history/item-data-command.js.map +0 -1
  2378. package/lib/stdlib/plugin/history/layer-updated-command.d.ts +0 -9
  2379. package/lib/stdlib/plugin/history/layer-updated-command.js +0 -25
  2380. package/lib/stdlib/plugin/history/layer-updated-command.js.map +0 -1
  2381. package/lib/stdlib/plugin/history/state-updated-command.d.ts +0 -9
  2382. package/lib/stdlib/plugin/history/state-updated-command.js +0 -24
  2383. package/lib/stdlib/plugin/history/state-updated-command.js.map +0 -1
  2384. package/lib/stdlib/plugin/history/visibility-updated-command.d.ts +0 -10
  2385. package/lib/stdlib/plugin/history/visibility-updated-command.js +0 -27
  2386. package/lib/stdlib/plugin/history/visibility-updated-command.js.map +0 -1
  2387. package/lib/stdlib/plugin/hull/bubbleset.d.ts +0 -9
  2388. package/lib/stdlib/plugin/hull/bubbleset.js +0 -596
  2389. package/lib/stdlib/plugin/hull/bubbleset.js.map +0 -1
  2390. package/lib/stdlib/plugin/hull/convexHull.d.ts +0 -14
  2391. package/lib/stdlib/plugin/hull/convexHull.js +0 -61
  2392. package/lib/stdlib/plugin/hull/convexHull.js.map +0 -1
  2393. package/lib/stdlib/plugin/hull/hullComponent.d.ts +0 -87
  2394. package/lib/stdlib/plugin/hull/hullComponent.js +0 -382
  2395. package/lib/stdlib/plugin/hull/hullComponent.js.map +0 -1
  2396. package/lib/stdlib/plugin/hull/index.d.ts +0 -59
  2397. package/lib/stdlib/plugin/hull/index.js +0 -167
  2398. package/lib/stdlib/plugin/hull/index.js.map +0 -1
  2399. package/lib/stdlib/plugin/hull/types.d.ts +0 -15
  2400. package/lib/stdlib/plugin/hull/types.js.map +0 -1
  2401. package/lib/stdlib/plugin/hull/util.d.ts +0 -77
  2402. package/lib/stdlib/plugin/hull/util.js +0 -419
  2403. package/lib/stdlib/plugin/hull/util.js.map +0 -1
  2404. package/lib/stdlib/plugin/index.d.ts +0 -10
  2405. package/lib/stdlib/plugin/index.js +0 -27
  2406. package/lib/stdlib/plugin/index.js.map +0 -1
  2407. package/lib/stdlib/plugin/legend/index.d.ts +0 -163
  2408. package/lib/stdlib/plugin/legend/index.js +0 -598
  2409. package/lib/stdlib/plugin/legend/index.js.map +0 -1
  2410. package/lib/stdlib/plugin/menu/index.d.ts +0 -55
  2411. package/lib/stdlib/plugin/menu/index.js +0 -244
  2412. package/lib/stdlib/plugin/menu/index.js.map +0 -1
  2413. package/lib/stdlib/plugin/minimap/index.d.ts +0 -118
  2414. package/lib/stdlib/plugin/minimap/index.js +0 -687
  2415. package/lib/stdlib/plugin/minimap/index.js.map +0 -1
  2416. package/lib/stdlib/plugin/snapline/index.d.ts +0 -167
  2417. package/lib/stdlib/plugin/snapline/index.js +0 -1067
  2418. package/lib/stdlib/plugin/snapline/index.js.map +0 -1
  2419. package/lib/stdlib/plugin/timebar/index.d.ts +0 -98
  2420. package/lib/stdlib/plugin/timebar/index.js +0 -307
  2421. package/lib/stdlib/plugin/timebar/index.js.map +0 -1
  2422. package/lib/stdlib/plugin/toolbar/index.d.ts +0 -59
  2423. package/lib/stdlib/plugin/toolbar/index.js +0 -222
  2424. package/lib/stdlib/plugin/toolbar/index.js.map +0 -1
  2425. package/lib/stdlib/plugin/tooltip/index.d.ts +0 -96
  2426. package/lib/stdlib/plugin/tooltip/index.js +0 -385
  2427. package/lib/stdlib/plugin/tooltip/index.js.map +0 -1
  2428. package/lib/stdlib/plugin/types.d.ts +0 -10
  2429. package/lib/stdlib/plugin/types.js.map +0 -1
  2430. package/lib/stdlib/selector/lasso.d.ts +0 -15
  2431. package/lib/stdlib/selector/lasso.js +0 -63
  2432. package/lib/stdlib/selector/lasso.js.map +0 -1
  2433. package/lib/stdlib/selector/rect.d.ts +0 -16
  2434. package/lib/stdlib/selector/rect.js +0 -56
  2435. package/lib/stdlib/selector/rect.js.map +0 -1
  2436. package/lib/stdlib/theme/dark.d.ts +0 -2
  2437. package/lib/stdlib/theme/dark.js +0 -335
  2438. package/lib/stdlib/theme/dark.js.map +0 -1
  2439. package/lib/stdlib/theme/index.d.ts +0 -2
  2440. package/lib/stdlib/theme/index.js +0 -19
  2441. package/lib/stdlib/theme/index.js.map +0 -1
  2442. package/lib/stdlib/theme/light.d.ts +0 -2
  2443. package/lib/stdlib/theme/light.js +0 -333
  2444. package/lib/stdlib/theme/light.js.map +0 -1
  2445. package/lib/stdlib/themeSolver/base.d.ts +0 -15
  2446. package/lib/stdlib/themeSolver/base.js +0 -15
  2447. package/lib/stdlib/themeSolver/base.js.map +0 -1
  2448. package/lib/stdlib/themeSolver/index.d.ts +0 -3
  2449. package/lib/stdlib/themeSolver/index.js +0 -20
  2450. package/lib/stdlib/themeSolver/index.js.map +0 -1
  2451. package/lib/stdlib/themeSolver/spec.d.ts +0 -35
  2452. package/lib/stdlib/themeSolver/spec.js +0 -70
  2453. package/lib/stdlib/themeSolver/spec.js.map +0 -1
  2454. package/lib/stdlib/themeSolver/subject.d.ts +0 -41
  2455. package/lib/stdlib/themeSolver/subject.js +0 -404
  2456. package/lib/stdlib/themeSolver/subject.js.map +0 -1
  2457. package/lib/types/animate.d.ts +0 -59
  2458. package/lib/types/animate.js +0 -3
  2459. package/lib/types/animate.js.map +0 -1
  2460. package/lib/types/behavior.d.ts +0 -45
  2461. package/lib/types/behavior.js +0 -18
  2462. package/lib/types/behavior.js.map +0 -1
  2463. package/lib/types/common.d.ts +0 -17
  2464. package/lib/types/common.js +0 -3
  2465. package/lib/types/common.js.map +0 -1
  2466. package/lib/types/graph.d.ts +0 -620
  2467. package/lib/types/graph.js.map +0 -1
  2468. package/lib/types/hook.d.ts +0 -144
  2469. package/lib/types/hook.js +0 -3
  2470. package/lib/types/hook.js.map +0 -1
  2471. package/lib/types/item.d.ts +0 -241
  2472. package/lib/types/item.js +0 -19
  2473. package/lib/types/item.js.map +0 -1
  2474. package/lib/types/loop.d.ts +0 -21
  2475. package/lib/types/loop.js +0 -15
  2476. package/lib/types/loop.js.map +0 -1
  2477. package/lib/types/render.d.ts +0 -1
  2478. package/lib/types/render.js +0 -3
  2479. package/lib/types/render.js.map +0 -1
  2480. package/lib/types/spec.d.ts +0 -98
  2481. package/lib/types/spec.js +0 -3
  2482. package/lib/types/spec.js.map +0 -1
  2483. package/lib/types/stdlib.d.ts +0 -13
  2484. package/lib/types/stdlib.js +0 -3
  2485. package/lib/types/stdlib.js.map +0 -1
  2486. package/lib/types/theme.d.ts +0 -168
  2487. package/lib/types/theme.js +0 -18
  2488. package/lib/types/theme.js.map +0 -1
  2489. package/lib/types/view.d.ts +0 -28
  2490. package/lib/types/view.js +0 -3
  2491. package/lib/types/view.js.map +0 -1
  2492. package/lib/util/animate.d.ts +0 -106
  2493. package/lib/util/animate.js +0 -400
  2494. package/lib/util/animate.js.map +0 -1
  2495. package/lib/util/array.d.ts +0 -28
  2496. package/lib/util/array.js +0 -79
  2497. package/lib/util/array.js.map +0 -1
  2498. package/lib/util/arrow.d.ts +0 -17
  2499. package/lib/util/arrow.js +0 -60
  2500. package/lib/util/arrow.js.map +0 -1
  2501. package/lib/util/bbox.d.ts +0 -121
  2502. package/lib/util/bbox.js +0 -304
  2503. package/lib/util/bbox.js.map +0 -1
  2504. package/lib/util/behavior.d.ts +0 -2
  2505. package/lib/util/behavior.js +0 -16
  2506. package/lib/util/behavior.js.map +0 -1
  2507. package/lib/util/canvas.d.ts +0 -19
  2508. package/lib/util/canvas.js +0 -71
  2509. package/lib/util/canvas.js.map +0 -1
  2510. package/lib/util/data.d.ts +0 -96
  2511. package/lib/util/data.js +0 -276
  2512. package/lib/util/data.js.map +0 -1
  2513. package/lib/util/event.d.ts +0 -42
  2514. package/lib/util/event.js +0 -109
  2515. package/lib/util/event.js.map +0 -1
  2516. package/lib/util/extend.d.ts +0 -27
  2517. package/lib/util/extend.js +0 -29
  2518. package/lib/util/extend.js.map +0 -1
  2519. package/lib/util/extension.d.ts +0 -10
  2520. package/lib/util/extension.js +0 -29
  2521. package/lib/util/extension.js.map +0 -1
  2522. package/lib/util/index.d.ts +0 -52
  2523. package/lib/util/index.js +0 -26
  2524. package/lib/util/index.js.map +0 -1
  2525. package/lib/util/item.d.ts +0 -30
  2526. package/lib/util/item.js +0 -96
  2527. package/lib/util/item.js.map +0 -1
  2528. package/lib/util/layout.d.ts +0 -51
  2529. package/lib/util/layout.js +0 -218
  2530. package/lib/util/layout.js.map +0 -1
  2531. package/lib/util/loop.d.ts +0 -37
  2532. package/lib/util/loop.js +0 -111
  2533. package/lib/util/loop.js.map +0 -1
  2534. package/lib/util/mapper.d.ts +0 -17
  2535. package/lib/util/mapper.js +0 -58
  2536. package/lib/util/mapper.js.map +0 -1
  2537. package/lib/util/math.d.ts +0 -23
  2538. package/lib/util/math.js +0 -29
  2539. package/lib/util/math.js.map +0 -1
  2540. package/lib/util/mock.d.ts +0 -30
  2541. package/lib/util/mock.js +0 -73
  2542. package/lib/util/mock.js.map +0 -1
  2543. package/lib/util/path.d.ts +0 -11
  2544. package/lib/util/path.js +0 -49
  2545. package/lib/util/path.js.map +0 -1
  2546. package/lib/util/point.d.ts +0 -83
  2547. package/lib/util/point.js +0 -201
  2548. package/lib/util/point.js.map +0 -1
  2549. package/lib/util/polyline.d.ts +0 -113
  2550. package/lib/util/polyline.js +0 -524
  2551. package/lib/util/polyline.js.map +0 -1
  2552. package/lib/util/router.d.ts +0 -32
  2553. package/lib/util/router.js +0 -387
  2554. package/lib/util/router.js.map +0 -1
  2555. package/lib/util/shape.d.ts +0 -140
  2556. package/lib/util/shape.js +0 -634
  2557. package/lib/util/shape.js.map +0 -1
  2558. package/lib/util/shape3d.d.ts +0 -23
  2559. package/lib/util/shape3d.js +0 -159
  2560. package/lib/util/shape3d.js.map +0 -1
  2561. package/lib/util/text.d.ts +0 -18
  2562. package/lib/util/text.js +0 -41
  2563. package/lib/util/text.js.map +0 -1
  2564. package/lib/util/type.d.ts +0 -8
  2565. package/lib/util/type.js +0 -13
  2566. package/lib/util/type.js.map +0 -1
  2567. package/lib/util/warn.d.ts +0 -14
  2568. package/lib/util/warn.js +0 -8
  2569. package/lib/util/warn.js.map +0 -1
  2570. package/lib/util/zoom.d.ts +0 -17
  2571. package/lib/util/zoom.js +0 -45
  2572. package/lib/util/zoom.js.map +0 -1
  2573. package/src/api-doc/behaviors.ts +0 -2
  2574. package/src/api-doc/graph.ts +0 -4
  2575. package/src/api-doc/item.ts +0 -45
  2576. package/src/api-doc/layout.ts +0 -13
  2577. package/src/api-doc/plugins.ts +0 -1
  2578. package/src/api-doc/types.ts +0 -2
  2579. package/src/api-doc/util.ts +0 -3
  2580. package/src/constant/index.ts +0 -1
  2581. package/src/constant/shape.ts +0 -37
  2582. package/src/item/combo.ts +0 -315
  2583. package/src/item/edge.ts +0 -296
  2584. package/src/item/item.ts +0 -915
  2585. package/src/item/node.ts +0 -356
  2586. package/src/runtime/controller/data.ts +0 -850
  2587. package/src/runtime/controller/extension.ts +0 -14
  2588. package/src/runtime/controller/index.ts +0 -7
  2589. package/src/runtime/controller/interaction.ts +0 -367
  2590. package/src/runtime/controller/item.ts +0 -1775
  2591. package/src/runtime/controller/layout.ts +0 -403
  2592. package/src/runtime/controller/plugin.ts +0 -220
  2593. package/src/runtime/controller/theme.ts +0 -73
  2594. package/src/runtime/controller/viewport.ts +0 -131
  2595. package/src/runtime/hooks.ts +0 -64
  2596. package/src/stdlib/behavior/activate-relations.ts +0 -142
  2597. package/src/stdlib/behavior/brush-select.ts +0 -387
  2598. package/src/stdlib/behavior/click-select.ts +0 -216
  2599. package/src/stdlib/behavior/collapse-expand-combo.ts +0 -57
  2600. package/src/stdlib/behavior/collapse-expand-tree.ts +0 -106
  2601. package/src/stdlib/behavior/create-edge.ts +0 -296
  2602. package/src/stdlib/behavior/drag-canvas.ts +0 -384
  2603. package/src/stdlib/behavior/drag-combo.ts +0 -589
  2604. package/src/stdlib/behavior/drag-node.ts +0 -676
  2605. package/src/stdlib/behavior/hover-activate.ts +0 -102
  2606. package/src/stdlib/behavior/index.ts +0 -18
  2607. package/src/stdlib/behavior/lasso-select.ts +0 -100
  2608. package/src/stdlib/behavior/orbit-canvas-3d.ts +0 -102
  2609. package/src/stdlib/behavior/rotate-canvas-3d.ts +0 -170
  2610. package/src/stdlib/behavior/scroll-canvas.ts +0 -348
  2611. package/src/stdlib/behavior/shortcuts-call.ts +0 -120
  2612. package/src/stdlib/behavior/track-canvas-3d.ts +0 -102
  2613. package/src/stdlib/behavior/types.ts +0 -15
  2614. package/src/stdlib/behavior/zoom-canvas-3d.ts +0 -168
  2615. package/src/stdlib/behavior/zoom-canvas.ts +0 -306
  2616. package/src/stdlib/data/index.ts +0 -3
  2617. package/src/stdlib/data/mapNodeSize.ts +0 -67
  2618. package/src/stdlib/data/transformV4Data.ts +0 -207
  2619. package/src/stdlib/data/validateData.ts +0 -151
  2620. package/src/stdlib/index.ts +0 -295
  2621. package/src/stdlib/item/combo/circle.ts +0 -113
  2622. package/src/stdlib/item/combo/index.ts +0 -2
  2623. package/src/stdlib/item/combo/rect.ts +0 -123
  2624. package/src/stdlib/item/edge/base.ts +0 -735
  2625. package/src/stdlib/item/edge/cubic-horizontal.ts +0 -86
  2626. package/src/stdlib/item/edge/cubic-vertical.ts +0 -85
  2627. package/src/stdlib/item/edge/cubic.ts +0 -198
  2628. package/src/stdlib/item/edge/index.ts +0 -7
  2629. package/src/stdlib/item/edge/line.ts +0 -103
  2630. package/src/stdlib/item/edge/loop.ts +0 -162
  2631. package/src/stdlib/item/edge/polyline.ts +0 -163
  2632. package/src/stdlib/item/edge/quadratic.ts +0 -133
  2633. package/src/stdlib/item/node/base.ts +0 -996
  2634. package/src/stdlib/item/node/base3d.ts +0 -210
  2635. package/src/stdlib/item/node/circle.ts +0 -113
  2636. package/src/stdlib/item/node/diamond.ts +0 -144
  2637. package/src/stdlib/item/node/donut.ts +0 -368
  2638. package/src/stdlib/item/node/ellipse.ts +0 -128
  2639. package/src/stdlib/item/node/hexagon.ts +0 -176
  2640. package/src/stdlib/item/node/image.ts +0 -190
  2641. package/src/stdlib/item/node/index.ts +0 -11
  2642. package/src/stdlib/item/node/modelRect.ts +0 -405
  2643. package/src/stdlib/item/node/rect.ts +0 -141
  2644. package/src/stdlib/item/node/sphere.ts +0 -99
  2645. package/src/stdlib/item/node/star.ts +0 -181
  2646. package/src/stdlib/item/node/triangle.ts +0 -265
  2647. package/src/stdlib/plugin/fisheye/index.ts +0 -607
  2648. package/src/stdlib/plugin/grid/index.ts +0 -125
  2649. package/src/stdlib/plugin/history/combo-command.ts +0 -28
  2650. package/src/stdlib/plugin/history/command.ts +0 -81
  2651. package/src/stdlib/plugin/history/index.ts +0 -347
  2652. package/src/stdlib/plugin/history/item-data-command.ts +0 -114
  2653. package/src/stdlib/plugin/history/layer-updated-command.ts +0 -28
  2654. package/src/stdlib/plugin/history/state-updated-command.ts +0 -36
  2655. package/src/stdlib/plugin/history/visibility-updated-command.ts +0 -41
  2656. package/src/stdlib/plugin/hull/bubbleset.ts +0 -828
  2657. package/src/stdlib/plugin/hull/convexHull.ts +0 -68
  2658. package/src/stdlib/plugin/hull/hullComponent.ts +0 -504
  2659. package/src/stdlib/plugin/hull/index.ts +0 -234
  2660. package/src/stdlib/plugin/hull/types.ts +0 -15
  2661. package/src/stdlib/plugin/hull/util.ts +0 -511
  2662. package/src/stdlib/plugin/index.ts +0 -10
  2663. package/src/stdlib/plugin/legend/index.ts +0 -795
  2664. package/src/stdlib/plugin/menu/index.ts +0 -275
  2665. package/src/stdlib/plugin/minimap/index.ts +0 -808
  2666. package/src/stdlib/plugin/snapline/index.ts +0 -1297
  2667. package/src/stdlib/plugin/timebar/index.ts +0 -473
  2668. package/src/stdlib/plugin/toolbar/index.ts +0 -257
  2669. package/src/stdlib/plugin/tooltip/index.ts +0 -444
  2670. package/src/stdlib/plugin/types.ts +0 -10
  2671. package/src/stdlib/selector/lasso.ts +0 -75
  2672. package/src/stdlib/selector/rect.ts +0 -78
  2673. package/src/stdlib/theme/dark.ts +0 -418
  2674. package/src/stdlib/theme/index.ts +0 -2
  2675. package/src/stdlib/theme/light.ts +0 -413
  2676. package/src/stdlib/themeSolver/base.ts +0 -22
  2677. package/src/stdlib/themeSolver/index.ts +0 -3
  2678. package/src/stdlib/themeSolver/spec.ts +0 -107
  2679. package/src/stdlib/themeSolver/subject.ts +0 -499
  2680. package/src/types/animate.ts +0 -71
  2681. package/src/types/behavior.ts +0 -48
  2682. package/src/types/common.ts +0 -21
  2683. package/src/types/graph.ts +0 -814
  2684. package/src/types/hook.ts +0 -148
  2685. package/src/types/item.ts +0 -348
  2686. package/src/types/loop.ts +0 -23
  2687. package/src/types/render.ts +0 -1
  2688. package/src/types/spec.ts +0 -152
  2689. package/src/types/stdlib.ts +0 -25
  2690. package/src/types/theme.ts +0 -171
  2691. package/src/types/view.ts +0 -36
  2692. package/src/util/animate.ts +0 -477
  2693. package/src/util/array.ts +0 -68
  2694. package/src/util/arrow.ts +0 -62
  2695. package/src/util/bbox.ts +0 -335
  2696. package/src/util/behavior.ts +0 -14
  2697. package/src/util/canvas.ts +0 -87
  2698. package/src/util/data.ts +0 -307
  2699. package/src/util/event.ts +0 -160
  2700. package/src/util/extend.ts +0 -48
  2701. package/src/util/extension.ts +0 -29
  2702. package/src/util/index.ts +0 -34
  2703. package/src/util/item.ts +0 -173
  2704. package/src/util/layout.ts +0 -210
  2705. package/src/util/loop.ts +0 -145
  2706. package/src/util/mapper.ts +0 -62
  2707. package/src/util/math.ts +0 -33
  2708. package/src/util/mock.ts +0 -72
  2709. package/src/util/path.ts +0 -52
  2710. package/src/util/point.ts +0 -228
  2711. package/src/util/polyline.ts +0 -676
  2712. package/src/util/router.ts +0 -561
  2713. package/src/util/shape.ts +0 -764
  2714. package/src/util/shape3d.ts +0 -203
  2715. package/src/util/text.ts +0 -49
  2716. package/src/util/type.ts +0 -11
  2717. package/src/util/warn.ts +0 -20
  2718. package/src/util/zoom.ts +0 -43
  2719. /package/esm/{stdlib/behavior → animations}/types.js +0 -0
  2720. /package/esm/{stdlib/plugin/hull → behaviors}/types.js +0 -0
  2721. /package/esm/{stdlib/plugin → layouts}/types.js +0 -0
  2722. /package/esm/{types → spec}/graph.js +0 -0
  2723. /package/esm/{api-doc → spec}/layout.js +0 -0
  2724. /package/lib/{stdlib/behavior → animations}/types.js +0 -0
  2725. /package/lib/{stdlib/plugin/hull → behaviors}/types.js +0 -0
  2726. /package/lib/{stdlib/plugin → layouts}/types.js +0 -0
  2727. /package/lib/{types → spec}/graph.js +0 -0
  2728. /package/lib/{api-doc → spec}/layout.js +0 -0
@@ -1,2069 +1,1266 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- var __rest = (this && this.__rest) || function (s, e) {
11
- var t = {};
12
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
13
- t[p] = s[p];
14
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
15
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
16
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
17
- t[p[i]] = s[p[i]];
18
- }
19
- return t;
20
- };
21
1
  import EventEmitter from '@antv/event-emitter';
22
- import { Rect, } from '@antv/g';
23
- import { clone, groupBy, isArray, isEmpty, isEqual, isNil, isNumber, isObject, isString, map, } from '@antv/util';
24
- import { createDom } from '@antv/dom-util';
25
- import { changeRenderer, createCanvas } from '../util/canvas';
26
- import { formatPadding } from '../util/shape';
27
- import { getLayoutBounds } from '../util/layout';
28
- import { DataController, ExtensionController, InteractionController, ItemController, LayoutController, ThemeController, ViewportController, } from './controller';
29
- import { PluginController } from './controller/plugin';
30
- import Hook from './hooks';
31
- export default class Graph extends EventEmitter {
32
- constructor(spec) {
2
+ import { debounce, isEqual, isFunction, isNumber, isObject, isString, omit } from '@antv/util';
3
+ import { COMBO_KEY, GraphEvent } from '../constants';
4
+ import { getExtension } from '../registry';
5
+ import { isCollapsed } from '../utils/collapsibility';
6
+ import { sizeOf } from '../utils/dom';
7
+ import { GraphLifeCycleEvent, emit } from '../utils/event';
8
+ import { idOf } from '../utils/id';
9
+ import { parsePoint, toPointObject } from '../utils/point';
10
+ import { zIndexOf } from '../utils/style';
11
+ import { subtract } from '../utils/vector';
12
+ import { Animation } from './animation';
13
+ import { BatchController } from './batch';
14
+ import { BehaviorController } from './behavior';
15
+ import { Canvas } from './canvas';
16
+ import { DataController } from './data';
17
+ import { ElementController } from './element';
18
+ import { LayoutController } from './layout';
19
+ import { PluginController } from './plugin';
20
+ import { TransformController } from './transform';
21
+ import { ViewportController } from './viewport';
22
+ export class Graph extends EventEmitter {
23
+ options;
24
+ /**
25
+ * @internal
26
+ */
27
+ static defaultOptions = {
28
+ autoResize: false,
29
+ theme: 'light',
30
+ rotation: 0,
31
+ zoom: 1,
32
+ zoomRange: [0.01, 10],
33
+ };
34
+ /**
35
+ * <zh/> 当前图实例是否已经被销毁
36
+ *
37
+ * <en/> Whether the current graph instance has been destroyed
38
+ */
39
+ destroyed = false;
40
+ // @ts-expect-error will be initialized in createRuntime
41
+ context = {
42
+ model: new DataController(),
43
+ };
44
+ constructor(options) {
33
45
  super();
34
- this.defaultSpecification = {
35
- theme: {
36
- type: 'spec',
37
- base: 'light',
38
- },
39
- enableStack: true,
40
- };
41
- /**
42
- * Execute a callback without allowing any stacking operations.
43
- * @param callback
44
- */
45
- this.executeWithNoStack = (callback) => {
46
- const history = this.getHistoryPlugin();
47
- history === null || history === void 0 ? void 0 : history.pauseStack();
48
- try {
49
- callback();
50
- }
51
- finally {
52
- history === null || history === void 0 ? void 0 : history.resumeStack();
53
- }
54
- };
55
- this.specification = Object.assign({}, this.defaultSpecification, this.formatSpecification(spec));
56
- this.initHooks();
57
- this.initCanvas();
58
- this.initControllers();
59
- this.initHistory();
60
- this.hooks.init.emit({
61
- canvases: {
62
- background: this.backgroundCanvas,
63
- main: this.canvas,
64
- transient: this.transientCanvas,
65
- },
66
- });
67
- const { data } = spec;
68
- if (data) {
69
- // TODO: handle multiple type data configs
70
- this.read(data);
71
- }
46
+ this.options = Object.assign({}, Graph.defaultOptions, options);
47
+ this.setOptions(this.options);
48
+ this.context.graph = this;
49
+ // Listening window.resize to autoResize.
50
+ this.options.autoResize && window.addEventListener('resize', this.onResize);
72
51
  }
73
52
  /**
74
- * Initialize the controllers for different plugins.
75
- */
76
- initControllers() {
77
- this.dataController = new DataController(this);
78
- this.interactionController = new InteractionController(this);
79
- this.layoutController = new LayoutController(this);
80
- this.themeController = new ThemeController(this);
81
- this.itemController = new ItemController(this);
82
- this.viewportController = new ViewportController(this);
83
- this.extensionController = new ExtensionController(this);
84
- this.pluginController = new PluginController(this);
85
- }
86
- initCanvas() {
87
- const { renderer, container, canvas, backgroundCanvas, transientCanvas, width, height, } = this.specification;
88
- let pixelRatio;
89
- if (renderer && !isString(renderer)) {
90
- // @ts-ignore
91
- this.rendererType = renderer.type || 'canvas';
92
- // @ts-ignore
93
- pixelRatio = renderer.pixelRatio;
94
- }
95
- else {
96
- // @ts-ignore
97
- this.rendererType = renderer || 'canvas';
98
- }
99
- /**
100
- * These 3 canvases can be passed in by users, e.g. when doing serverside rendering we can't use DOM API.
101
- */
102
- if (canvas) {
103
- this.canvas = canvas;
104
- this.backgroundCanvas = backgroundCanvas;
105
- this.transientCanvas = transientCanvas;
106
- this.container = container;
107
- }
108
- else {
109
- const containerDOM = isString(container)
110
- ? document.getElementById(container)
111
- : container;
112
- if (!containerDOM) {
113
- console.error(`Create graph failed. The container for graph ${containerDOM} is not exist.`);
114
- this.destroy();
115
- return;
116
- }
117
- this.container = containerDOM;
118
- const size = [width, height];
119
- if (size[0] === undefined) {
120
- size[0] = containerDOM.scrollWidth;
121
- }
122
- if (size[1] === undefined) {
123
- size[1] = containerDOM.scrollHeight;
124
- }
125
- this.backgroundCanvas = createCanvas(this.rendererType, containerDOM, size[0], size[1], pixelRatio);
126
- this.canvas = createCanvas(this.rendererType, containerDOM, size[0], size[1], pixelRatio);
127
- this.transientCanvas = createCanvas(this.rendererType, containerDOM, size[0], size[1], pixelRatio);
128
- }
129
- Promise.all([this.backgroundCanvas, this.canvas, this.transientCanvas].map((canvas) => canvas.ready)).then(() => {
130
- [this.backgroundCanvas, this.canvas, this.transientCanvas].forEach((canvas, i) => {
131
- const $domElement = canvas
132
- .getContextService()
133
- .getDomElement();
134
- if ($domElement && $domElement.style) {
135
- $domElement.style.position = 'fixed';
136
- $domElement.style.outline = 'none';
137
- $domElement.tabIndex = 1; // Enable keyboard events
138
- // Transient canvas should let interactive events go through.
139
- if (i === 2) {
140
- $domElement.style.pointerEvents = 'none';
141
- }
142
- }
143
- });
144
- this.canvasReady = true;
145
- });
146
- }
147
- initHistory() {
148
- const { enableStack, stackCfg } = this.specification;
149
- if (enableStack) {
150
- const history = {
151
- type: 'history',
152
- key: 'history',
153
- enableStack,
154
- stackCfg,
155
- };
156
- if (!this.specification.plugins) {
157
- this.specification.plugins = [];
158
- }
159
- this.specification.plugins.push(history);
160
- }
53
+ * <zh/> 获取配置项
54
+ *
55
+ * <en/> Get options
56
+ * @returns <zh/> 配置项 | <en/> options
57
+ * @apiCategory option
58
+ */
59
+ getOptions() {
60
+ return this.options;
161
61
  }
162
62
  /**
163
- * Change the renderer at runtime.
164
- * @param type renderer name
165
- * @returns
166
- */
167
- changeRenderer(type) {
168
- this.rendererType = type || 'canvas';
169
- changeRenderer(this.rendererType, this.canvas);
170
- }
171
- /**
172
- * Initialize the hooks for graph's lifecycles.
173
- */
174
- initHooks() {
175
- this.hooks = {
176
- init: new Hook({ name: 'init' }),
177
- datachange: new Hook({
178
- name: 'datachange',
179
- }),
180
- itemchange: new Hook({ name: 'itemchange' }),
181
- render: new Hook({
182
- name: 'render',
183
- }),
184
- layout: new Hook({ name: 'layout' }),
185
- viewportchange: new Hook({ name: 'viewport' }),
186
- modechange: new Hook({ name: 'modechange' }),
187
- behaviorchange: new Hook({ name: 'behaviorchange' }),
188
- itemstatechange: new Hook({
189
- name: 'itemstatechange',
190
- }),
191
- itemvisibilitychange: new Hook({
192
- name: 'itemvisibilitychange',
193
- }),
194
- itemzindexchange: new Hook({
195
- name: 'itemzindexchange',
196
- }),
197
- transientupdate: new Hook({ name: 'transientupdate' }),
198
- pluginchange: new Hook({ name: 'pluginchange' }),
199
- themechange: new Hook({ name: 'themechange' }),
200
- mapperchange: new Hook({ name: 'mapperchange' }),
201
- treecollapseexpand: new Hook({ name: 'treecollapseexpand' }),
202
- destroy: new Hook({ name: 'destroy' }),
203
- };
204
- }
205
- formatSpecification(spec) {
206
- var _a;
207
- return Object.assign(Object.assign(Object.assign({}, this.specification), spec), { optimize: Object.assign(Object.assign({ tileBehavior: 2000, tileBehaviorSize: 1000, tileFirstRender: 10000, tileFirstRenderSize: 1000 }, (_a = this.specification) === null || _a === void 0 ? void 0 : _a.optimize), spec.optimize) });
63
+ * <zh/> 设置配置项
64
+ *
65
+ * <en/> Set options
66
+ * @param options - <zh/> 配置项 | <en/> options
67
+ * @remarks
68
+ * <zh/> 要更新 devicePixelRatio、container 属性请销毁后重新创建实例
69
+ *
70
+ * <en/> To update devicePixelRatio and container properties, please destroy and recreate the instance
71
+ * @apiCategory option
72
+ */
73
+ setOptions(options) {
74
+ const { background, behaviors, combo, data, edge, height, layout, node, plugins, theme, transforms, width } = options;
75
+ Object.assign(this.options, options);
76
+ if (background)
77
+ this.setBackground(background);
78
+ if (behaviors)
79
+ this.setBehaviors(behaviors);
80
+ if (combo)
81
+ this.setCombo(combo);
82
+ if (data)
83
+ this.setData(data);
84
+ if (edge)
85
+ this.setEdge(edge);
86
+ if (layout)
87
+ this.setLayout(layout);
88
+ if (node)
89
+ this.setNode(node);
90
+ if (theme)
91
+ this.setTheme(theme);
92
+ if (plugins)
93
+ this.setPlugins(plugins);
94
+ if (transforms)
95
+ this.setTransforms(transforms);
96
+ if (isNumber(width) || isNumber(height))
97
+ this.setSize(width ?? this.options.width ?? 0, height ?? this.options.height ?? 0);
98
+ }
99
+ /**
100
+ * <zh/> 设置画布背景色
101
+ *
102
+ * <en/> Set canvas background color
103
+ * @param background - <zh/> 背景色 | <en/> background color
104
+ * @apiCategory canvas
105
+ */
106
+ setBackground(background) {
107
+ this.options.background = background;
108
+ this.context.canvas?.setBackground(background);
208
109
  }
209
110
  /**
210
- * Update the specs(configurations).
111
+ * <zh/> 获取画布背景色
112
+ *
113
+ * <en/> Get canvas background color
114
+ * @returns <zh/> 背景色 | <en/> background color
115
+ * @apiCategory canvas
211
116
  */
212
- updateSpecification(spec) {
213
- const newSpec = Object.assign(this.specification, this.formatSpecification(spec));
214
- // TODO: update something
215
- return newSpec;
117
+ getBackground() {
118
+ return this.options.background;
216
119
  }
217
120
  /**
218
- * Update the theme specs (configurations).
121
+ * <zh/> 获取当前图容器的大小
122
+ *
123
+ * <en/> Get the size of the current canvas container
124
+ * @returns <zh/> 画布尺寸 | <en/> canvas size
125
+ * @apiCategory canvas
219
126
  */
220
- updateTheme(theme) {
221
- this.specification.theme = theme;
222
- // const { specification } = this.themeController;
223
- // notifiying the themeController
224
- this.hooks.themechange.emit({
225
- canvases: {
226
- background: this.backgroundCanvas,
227
- main: this.canvas,
228
- transient: this.transientCanvas,
229
- },
230
- });
231
- // theme is formatted by themeController, notify the item controller to update the items
232
- this.hooks.themechange.emit({
233
- theme: this.themeController.specification,
234
- });
127
+ getSize() {
128
+ if (this.context.canvas)
129
+ return this.context.canvas.getSize();
130
+ return [this.options.width || 0, this.options.height || 0];
235
131
  }
236
132
  /**
237
- * Update the item display mapper for a specific item type.
238
- * @param {ITEM_TYPE} type - The type of item (node, edge, or combo).
239
- * @param {NodeMapper | EdgeMapper | ComboMapper} mapper - The mapper to be updated.
240
- * */
241
- updateMapper(type, mapper) {
242
- switch (type) {
243
- case 'node':
244
- this.specification.node = mapper;
245
- break;
246
- case 'edge':
247
- this.specification.edge = mapper;
248
- break;
249
- case 'combo':
250
- this.specification.combo = mapper;
251
- break;
252
- }
253
- this.hooks.mapperchange.emit({
254
- type,
255
- mapper,
256
- });
133
+ * <zh/> 获取当前图容器的大小
134
+ *
135
+ * <en/> Get the size of the current canvas container
136
+ * @param width - <zh/> 画布宽度 | <en/> canvas width
137
+ * @param height - <zh/> 画布高度 | <en/> canvas height
138
+ * @apiCategory canvas
139
+ */
140
+ setSize(width, height) {
141
+ Object.assign(this.options, { width, height });
142
+ this.context.canvas?.resize(width, height);
257
143
  }
258
144
  /**
259
- * Get the copy of specs(configurations).
260
- * @returns graph specs
261
- */
262
- getSpecification() {
263
- return this.specification;
264
- }
265
- /**
266
- * Input data and render the graph.
267
- * If there is old data, diffs and changes it.
268
- * @param data
269
- * @returns
270
- * @group Data
271
- */
272
- read(data) {
273
- return __awaiter(this, void 0, void 0, function* () {
274
- const { tileFirstRender, tileFirstRenderSize } = this.specification.optimize || {};
275
- this.hooks.datachange.emit({ data, type: 'replace' });
276
- const emitRender = () => __awaiter(this, void 0, void 0, function* () {
277
- yield this.hooks.render.emitLinearAsync({
278
- graphCore: this.dataController.graphCore,
279
- theme: this.themeController.specification,
280
- transientCanvas: this.transientCanvas,
281
- tileOptimize: {
282
- tileFirstRender,
283
- tileFirstRenderSize,
284
- },
285
- });
286
- this.emit('afterrender');
287
- this.once('afterlayout', () => __awaiter(this, void 0, void 0, function* () {
288
- const { autoFit } = this.specification;
289
- if (autoFit) {
290
- if (autoFit === 'view') {
291
- yield this.fitView({ rules: { boundsType: 'layout' } });
292
- }
293
- else if (autoFit === 'center') {
294
- yield this.fitCenter('layout');
295
- }
296
- else {
297
- const { type, effectTiming } = autoFit, others = __rest(autoFit, ["type", "effectTiming"]);
298
- if (type === 'view') {
299
- const { padding, rules } = others;
300
- yield this.fitView({
301
- padding,
302
- rules: Object.assign(Object.assign({}, rules), { boundsType: 'layout' }),
303
- }, effectTiming);
304
- }
305
- else if (type === 'center') {
306
- yield this.fitCenter('layout', effectTiming);
307
- }
308
- else if (type === 'position') {
309
- // TODO: align
310
- yield this.translateTo(others.position, effectTiming);
311
- }
312
- }
313
- }
314
- }));
315
- yield this.layout();
316
- });
317
- if (this.canvasReady) {
318
- yield emitRender();
319
- }
320
- else {
321
- yield Promise.all([this.backgroundCanvas, this.canvas, this.transientCanvas].map((canvas) => canvas.ready));
322
- yield emitRender();
323
- }
324
- });
145
+ * <zh/> 获取当前图的缩放区间
146
+ *
147
+ * <en/> Get the zoom range of the current graph
148
+ * @param zoomRange - <zh/> 缩放区间 | <en/> zoom range
149
+ * @apiCategory viewport
150
+ */
151
+ setZoomRange(zoomRange) {
152
+ this.options.zoomRange = zoomRange;
325
153
  }
326
154
  /**
327
- * Change graph data.
328
- * @param data new data
329
- * @param type the way to change data, 'replace' means discard the old data and use the new one; 'mergeReplace' means merge the common part, remove (old - new), add (new - old)
330
- * @returns
331
- * @group Data
332
- */
333
- changeData(data, type = 'mergeReplace') {
334
- return __awaiter(this, void 0, void 0, function* () {
335
- const { tileFirstRender, tileFirstRenderSize } = this.specification.optimize || {};
336
- this.hooks.datachange.emit({ data, type });
337
- this.hooks.render.emit({
338
- graphCore: this.dataController.graphCore,
339
- theme: this.themeController.specification,
340
- transientCanvas: this.transientCanvas,
341
- tileOptimize: {
342
- tileFirstRender,
343
- tileFirstRenderSize,
344
- },
345
- });
346
- this.emit('afterrender');
347
- yield this.layout();
348
- });
155
+ * <zh/> 获取当前图的缩放区间
156
+ *
157
+ * <en/> Get the zoom range of the current graph
158
+ * @returns <zh/> 缩放区间 | <en/> zoom range
159
+ * @apiCategory viewport
160
+ */
161
+ getZoomRange() {
162
+ return this.options.zoomRange;
349
163
  }
350
164
  /**
351
- * Clear the graph, means remove all the items on the graph.
352
- * @returns
165
+ * <zh/> 设置节点样式映射
166
+ *
167
+ * <en/> Set node mapper
168
+ * @param node - <zh/> 节点配置 | <en/> node configuration
169
+ * @apiCategory element
353
170
  */
354
- clear() {
355
- this.startHistoryBatch();
356
- this.removeData('edge', this.getAllEdgesData().map((edge) => edge.id));
357
- this.removeData('node', this.getAllNodesData().map((node) => node.id));
358
- this.removeData('combo', this.getAllCombosData().map((combo) => combo.id));
359
- this.stopHistoryBatch();
360
- }
361
- getViewportCenter() {
362
- const { width, height } = this.canvas.getConfig();
363
- return { x: width / 2, y: height / 2 };
364
- }
365
- transform(options, effectTiming) {
366
- return __awaiter(this, void 0, void 0, function* () {
367
- const { tileLodSize } = this.specification.optimize || {};
368
- yield this.hooks.viewportchange.emitLinearAsync({
369
- transform: options,
370
- effectTiming,
371
- tileLodSize,
372
- });
373
- this.emit('viewportchange', options);
374
- });
171
+ setNode(node) {
172
+ this.options.node = node;
173
+ this.context.model.refreshData();
375
174
  }
376
175
  /**
377
- * Stop the current transition of transform immediately.
176
+ * <zh/> 设置边样式映射
177
+ *
178
+ * <en/> Set edge mapper
179
+ * @param edge - <zh/> 边配置 | <en/> edge configuration
180
+ * @apiCategory element
378
181
  */
379
- stopTransformTransition() {
380
- this.canvas.getCamera().cancelLandmarkAnimation();
182
+ setEdge(edge) {
183
+ this.options.edge = edge;
184
+ this.context.model.refreshData();
381
185
  }
382
186
  /**
383
- * Move the graph with a relative distance under viewport coordinates.
384
- * @param dx x of the relative distance
385
- * @param dy y of the relative distance
386
- * @param effectTiming animation configurations
187
+ * <zh/> 设置组合样式映射
188
+ *
189
+ * <en/> Set combo mapper
190
+ * @param combo - <zh/> 组合配置 | <en/> combo configuration
191
+ * @apiCategory element
387
192
  */
388
- translate(distance, effectTiming) {
389
- return __awaiter(this, void 0, void 0, function* () {
390
- yield this.transform({
391
- translate: distance,
392
- }, effectTiming);
393
- });
193
+ setCombo(combo) {
194
+ this.options.combo = combo;
195
+ this.context.model.refreshData();
394
196
  }
395
197
  /**
396
- * Move the graph to destination under viewport coordinates.
397
- * @param destination destination under viewport coordinates.
398
- * @param effectTiming animation configurations
198
+ * <zh/> 获取主题
199
+ *
200
+ * <en/> Get theme
201
+ * @returns <zh/> 主题配置 | <en/> theme configuration
202
+ * @apiCategory theme
399
203
  */
400
- translateTo({ x, y }, effectTiming) {
401
- return __awaiter(this, void 0, void 0, function* () {
402
- const { x: cx, y: cy } = this.getViewportCenter();
403
- yield this.translate({ dx: cx - x, dy: cy - y }, effectTiming);
404
- });
204
+ getTheme() {
205
+ return this.options.theme;
405
206
  }
406
207
  /**
407
- * Zoom the graph with a relative ratio.
408
- * @param ratio relative ratio to zoom
409
- * @param origin origin under viewport coordinates.
410
- * @param effectTiming animation configurations
411
- */
412
- zoom(ratio, origin, effectTiming) {
413
- return __awaiter(this, void 0, void 0, function* () {
414
- yield this.transform({
415
- zoom: {
416
- ratio,
417
- },
418
- origin,
419
- }, effectTiming);
420
- });
208
+ * <zh/> 设置主题
209
+ *
210
+ * <en/> Set theme
211
+ * @param theme - <zh/> 主题配置 | <en/> theme configuration
212
+ * @apiCategory theme
213
+ */
214
+ setTheme(theme) {
215
+ this.options.theme = isFunction(theme) ? theme(this.getTheme()) : theme;
216
+ const { background } = getExtension('theme', this.options.theme) || {};
217
+ if (background && !this.options.background) {
218
+ this.setBackground(background);
219
+ }
421
220
  }
422
221
  /**
423
- * Zoom the graph to a specified ratio.
424
- * @param zoom specified ratio
425
- * @param origin zoom center
426
- * @param effectTiming animation configurations
222
+ * <zh/> 设置布局
223
+ *
224
+ * <en/> Set layout
225
+ * @param layout - <zh/> 布局配置 | <en/> layout configuration
226
+ * @apiCategory layout
427
227
  */
428
- zoomTo(zoom, origin, effectTiming) {
429
- return __awaiter(this, void 0, void 0, function* () {
430
- yield this.zoom(zoom / this.canvas.getCamera().getZoom(), origin, effectTiming);
431
- });
228
+ setLayout(layout) {
229
+ this.options.layout = isFunction(layout) ? layout(this.getLayout()) : layout;
432
230
  }
433
231
  /**
434
- * Return the current zoom level of camera.
435
- * @returns current zoom
232
+ * <zh/> 获取布局
233
+ *
234
+ * <en/> Get layout
235
+ * @returns <zh/> 布局配置 | <en/> layout configuration
236
+ * @apiCategory layout
436
237
  */
437
- getZoom() {
438
- return this.canvas.getCamera().getZoom();
439
- }
440
- /**
441
- * Rotate the graph with a relative angle.
442
- * @param angle
443
- * @param origin
444
- * @param effectTiming
445
- */
446
- rotate(angle, origin, effectTiming) {
447
- return __awaiter(this, void 0, void 0, function* () {
448
- yield this.transform({
449
- rotate: {
450
- angle,
451
- },
452
- origin,
453
- }, effectTiming);
454
- });
238
+ getLayout() {
239
+ return this.options.layout;
455
240
  }
456
241
  /**
457
- * Rotate the graph to an absolute angle.
458
- * @param angle
459
- * @param origin
460
- * @param effectTiming
242
+ * <zh/> 设置交互
243
+ *
244
+ * <en/> Set behaviors
245
+ * @param behaviors - <zh/> 交互配置 | <en/> behavior configuration
246
+ * @apiCategory behavior
461
247
  */
462
- rotateTo(angle, origin, effectTiming) {
463
- return __awaiter(this, void 0, void 0, function* () {
464
- yield this.rotate(angle - this.canvas.getCamera().getRoll(), origin, effectTiming);
465
- });
248
+ setBehaviors(behaviors) {
249
+ this.options.behaviors = isFunction(behaviors) ? behaviors(this.getBehaviors()) : behaviors;
250
+ this.context.behavior?.setBehaviors(this.options.behaviors);
466
251
  }
467
252
  /**
468
- * Fit the graph content to the view.
469
- * @param options.padding padding while fitting
470
- * @param options.rules rules for fitting
471
- * @param effectTiming animation configurations
472
- */
473
- fitView(options, effectTiming) {
474
- return __awaiter(this, void 0, void 0, function* () {
475
- const { padding, rules } = options || {};
476
- const [top, right, bottom, left] = padding
477
- ? formatPadding(padding)
478
- : [0, 0, 0, 0];
479
- const { direction = 'both', ratioRule = 'min', boundsType = 'render', } = rules || {};
480
- const { center: [graphCenterX, graphCenterY], halfExtents, } = boundsType === 'render'
481
- ? // Get the bounds of the whole graph content.
482
- this.canvas.document.documentElement.getBounds()
483
- : // Get the bounds of the nodes positions while the graph content is not ready.
484
- getLayoutBounds(this);
485
- const origin = this.canvas.canvas2Viewport({
486
- x: graphCenterX,
487
- y: graphCenterY,
488
- });
489
- const { width: viewportWidth, height: viewportHeight } = this.canvas.getConfig();
490
- const graphWidth = halfExtents[0] * 2;
491
- const graphHeight = halfExtents[1] * 2;
492
- const tlInCanvas = this.canvas.viewport2Canvas({ x: left, y: top });
493
- const brInCanvas = this.canvas.viewport2Canvas({
494
- x: viewportWidth - right,
495
- y: viewportHeight - bottom,
496
- });
497
- const targetViewWidth = brInCanvas.x - tlInCanvas.x;
498
- const targetViewHeight = brInCanvas.y - tlInCanvas.y;
499
- const wRatio = targetViewWidth / graphWidth;
500
- const hRatio = targetViewHeight / graphHeight;
501
- let ratio;
502
- if (direction === 'x') {
503
- ratio = wRatio;
504
- }
505
- else if (direction === 'y') {
506
- ratio = hRatio;
507
- }
508
- else {
509
- ratio =
510
- ratioRule === 'max'
511
- ? Math.max(wRatio, hRatio)
512
- : Math.min(wRatio, hRatio);
253
+ * <zh/> 更新交互
254
+ *
255
+ * <en/> Update behavior
256
+ * @param behavior - <zh/> 交互配置 | <en/> behavior configuration
257
+ * @apiCategory behavior
258
+ */
259
+ updateBehavior(behavior) {
260
+ this.setBehaviors((behaviors) => behaviors.map((_behavior) => {
261
+ if (isObject(_behavior) && _behavior.key === behavior.key) {
262
+ return { ..._behavior, ...behavior };
513
263
  }
514
- yield this.transform({
515
- translate: {
516
- dx: viewportWidth / 2 - origin.x,
517
- dy: viewportHeight / 2 - origin.y,
518
- },
519
- zoom: {
520
- ratio,
521
- },
522
- }, effectTiming);
523
- });
264
+ return _behavior;
265
+ }));
524
266
  }
525
267
  /**
526
- * Fit the graph center to the view center.
527
- * @param effectTiming animation configurations
268
+ * <zh/> 获取交互
269
+ *
270
+ * <en/> Get behaviors
271
+ * @returns <zh/> 交互配置 | <en/> behavior configuration
272
+ * @apiCategory behavior
528
273
  */
529
- fitCenter(boundsType = 'render', effectTiming) {
530
- return __awaiter(this, void 0, void 0, function* () {
531
- const { center: [graphCenterX, graphCenterY], } = boundsType === 'render'
532
- ? // Get the bounds of the whole graph content.
533
- this.canvas.document.documentElement.getBounds()
534
- : // Get the bounds of the nodes positions while the graph content is not ready.
535
- getLayoutBounds(this);
536
- yield this.translateTo(this.canvas.canvas2Viewport({ x: graphCenterX, y: graphCenterY }), effectTiming);
537
- });
274
+ getBehaviors() {
275
+ return this.options.behaviors || [];
538
276
  }
539
277
  /**
540
- * Move the graph to make the item align the view center.
541
- * @param item node/edge/combo item or its id
542
- * @param effectTiming animation configurations
543
- */
544
- focusItem(id, effectTiming) {
545
- return __awaiter(this, void 0, void 0, function* () {
546
- let bounds = null;
547
- for (const itemId of !isArray(id) ? [id] : id) {
548
- const item = this.getItemById(itemId);
549
- if (item) {
550
- const itemBounds = item.group.getBounds();
551
- if (!bounds) {
552
- bounds = itemBounds;
553
- }
554
- else {
555
- bounds.add(itemBounds);
556
- }
557
- }
558
- }
559
- if (bounds) {
560
- const { center: [itemCenterX, itemCenterY], } = bounds;
561
- yield this.translateTo(this.canvas.canvas2Viewport({ x: itemCenterX, y: itemCenterY }), effectTiming);
562
- }
563
- });
278
+ * <zh/> 设置插件
279
+ *
280
+ * <en/> Set plugins
281
+ * @param plugins - <zh/> 插件配置 | <en/> plugin configuration
282
+ * @apiCategory plugin
283
+ */
284
+ setPlugins(plugins) {
285
+ this.options.plugins = isFunction(plugins) ? plugins(this.getPlugins()) : plugins;
286
+ this.context.plugin?.setPlugins(this.options.plugins);
564
287
  }
565
288
  /**
566
- * Get item by id. We don't want to
567
- * @param id
568
- * @returns Node | Edge | Combo
289
+ * <zh/> 更新插件
290
+ *
291
+ * <en/> Update plugin
292
+ * @param plugin - <zh/> 插件配置 | <en/> plugin configuration
293
+ * @apiCategory plugin
569
294
  */
570
- getItemById(id) {
571
- return this.itemController.getItemById(id);
295
+ updatePlugin(plugin) {
296
+ this.setPlugins((plugins) => plugins.map((_plugin) => {
297
+ if (isObject(_plugin) && _plugin.key === plugin.key) {
298
+ return { ..._plugin, ...plugin };
299
+ }
300
+ return _plugin;
301
+ }));
572
302
  }
573
303
  /**
574
- * Get the size of the graph canvas.
575
- * @returns [width, height]
576
- * @group View
304
+ * <zh/> 获取插件
305
+ *
306
+ * <en/> Get plugins
307
+ * @returns <zh/> 插件配置 | <en/> plugin configuration
308
+ * @apiCategory plugin
577
309
  */
578
- getSize() {
579
- const { width = 500, height = 500 } = this.specification;
580
- return [width, height];
310
+ getPlugins() {
311
+ return this.options.plugins || [];
581
312
  }
582
313
  /**
583
- * Set the size for the graph canvas.
584
- * @param number[] [width, height]
585
- * @group View
314
+ * <zh/> 获取插件实例
315
+ *
316
+ * <en/> Get plugin instance
317
+ * @param key - <zh/> 插件 key | <en/> plugin key
318
+ * @returns <zh/> 插件实例 | <en/> plugin instance
319
+ * @apiCategory plugin
586
320
  */
587
- setSize(size) {
588
- if (!isArray(size) || size.length < 2) {
589
- console.warn(`Failed to setSize. The parameter size: ${size} is invalid. It must be an array with 2 number elements.`);
590
- return;
591
- }
592
- this.specification.width = size[0];
593
- this.specification.height = size[1];
594
- this.canvas.resize(size[0], size[1]);
595
- }
596
- getCanvasRange() {
597
- const [width, height] = this.getSize();
598
- const leftTop = this.getCanvasByViewport({ x: 0, y: 0 });
599
- const rightBottom = this.getCanvasByViewport({ x: width, y: height });
600
- return {
601
- min: [leftTop.x, leftTop.y, leftTop.z],
602
- max: [rightBottom.x, rightBottom.y, rightBottom.z],
603
- center: [
604
- (leftTop.x + rightBottom.x) / 2,
605
- (leftTop.y + rightBottom.y) / 2,
606
- (leftTop.z + rightBottom.z) / 2,
607
- ],
608
- halfExtents: [
609
- (rightBottom.x - leftTop.x) / 2,
610
- (rightBottom.y - leftTop.y) / 2,
611
- (rightBottom.z - leftTop.z) / 2,
612
- ],
613
- };
321
+ getPluginInstance(key) {
322
+ return this.context.plugin.getPluginInstance(key);
614
323
  }
615
324
  /**
616
- * Get the rendering coordinate according to the canvas dom (viewport) coordinate.
617
- * @param Point rendering coordinate
618
- * @returns canvas dom (viewport) coordinate
619
- * @group View
325
+ * <zh/> 设置数据转换器
326
+ *
327
+ * <en/> Set data transforms
328
+ * @param transforms - <zh/> 数据转换配置 | <en/> data transform configuration
329
+ * @apiCategory transform
620
330
  */
621
- getCanvasByViewport(viewportPoint) {
622
- return this.canvas.viewport2Canvas(viewportPoint);
331
+ setTransforms(transforms) {
332
+ this.options.transforms = isFunction(transforms) ? transforms(this.getTransforms()) : transforms;
333
+ this.context.transform?.setTransforms(this.options.transforms);
334
+ }
335
+ /**
336
+ * <zh/> 更新数据转换器
337
+ *
338
+ * <en/> Update data transform
339
+ * @param transform - <zh/> 数据转换配置 | <en/> data transform configuration
340
+ * @apiCategory transform
341
+ */
342
+ updateTransform(transform) {
343
+ this.setTransforms((transforms) => transforms.map((_transform) => {
344
+ if (isObject(_transform) && _transform.key === transform.key) {
345
+ return { ..._transform, ...transform };
346
+ }
347
+ return _transform;
348
+ }));
349
+ this.context.model.refreshData();
623
350
  }
624
351
  /**
625
- * Get the canvas dom (viewport) coordinate according to the rendering coordinate.
626
- * @param Point canvas dom (viewport) coordinate
627
- * @returns rendering coordinate
628
- * @group View
352
+ * <zh/> 获取数据转换器
353
+ *
354
+ * <en/> Get data transforms
355
+ * @returns <zh/> 数据转换器实例 | <en/> data transform instance
356
+ * @apiCategory transform
629
357
  */
630
- getViewportByCanvas(canvasPoint) {
631
- return this.canvas.canvas2Viewport(canvasPoint);
358
+ getTransforms() {
359
+ return this.options.transforms || [];
632
360
  }
633
361
  /**
634
- * Get the browser coordinate according to the rendering coordinate.
635
- * @param Point rendering coordinate
636
- * @returns browser coordinate
637
- * @group View
362
+ * <zh/> 获取数据
363
+ *
364
+ * <en/> Get data
365
+ * @returns <zh/> 数据 | <en/> data
366
+ * @apiCategory data
367
+ */
368
+ getData() {
369
+ return this.context.model.getData();
370
+ }
371
+ getElementData(ids) {
372
+ if (Array.isArray(ids))
373
+ return ids.map((id) => this.context.model.getElementDataById(id));
374
+ return this.context.model.getElementDataById(ids);
375
+ }
376
+ getNodeData(id) {
377
+ if (id === undefined)
378
+ return this.context.model.getNodeData();
379
+ if (Array.isArray(id))
380
+ return this.context.model.getNodeData(id);
381
+ return this.context.model.getNodeData([id])?.[0];
382
+ }
383
+ getEdgeData(id) {
384
+ if (id === undefined)
385
+ return this.context.model.getEdgeData();
386
+ if (Array.isArray(id))
387
+ return this.context.model.getEdgeData(id);
388
+ return this.context.model.getEdgeData([id])?.[0];
389
+ }
390
+ getComboData(id) {
391
+ if (id === undefined)
392
+ return this.context.model.getComboData();
393
+ if (Array.isArray(id))
394
+ return this.context.model.getComboData(id);
395
+ return this.context.model.getComboData([id])?.[0];
396
+ }
397
+ /**
398
+ * <zh/> 设置全量数据
399
+ *
400
+ * <en/> Set full data
401
+ * @param data - <zh/> 数据 | <en/> data
402
+ * @apiCategory data
638
403
  */
639
- getClientByCanvas(canvasPoint) {
640
- const viewportPoint = this.canvas.canvas2Viewport(canvasPoint);
641
- return this.canvas.viewport2Client(viewportPoint);
404
+ setData(data) {
405
+ this.context.model.setData(isFunction(data) ? data(this.getData()) : data);
642
406
  }
643
407
  /**
644
- * Get the rendering coordinate according to the browser coordinate.
645
- * @param Point browser coordinate
646
- * @returns rendering coordinate
647
- * @group View
408
+ * <zh/> 新增元素数据
409
+ *
410
+ * <en/> Add element data
411
+ * @param data - <zh/> 元素数据 | <en/> element data
412
+ * @apiCategory data
648
413
  */
649
- getCanvasByClient(clientPoint) {
650
- const viewportPoint = this.canvas.client2Viewport(clientPoint);
651
- return this.canvas.viewport2Canvas(viewportPoint);
414
+ addData(data) {
415
+ this.context.model.addData(isFunction(data) ? data(this.getData()) : data);
652
416
  }
653
- // ===== item operations =====
654
417
  /**
655
- * Find a node's inner data according to id or function.
656
- * @param { ID | Function } condition id or condition function
657
- * @returns result node's inner data
658
- * @group Data
418
+ * <zh/> 新增节点数据
419
+ *
420
+ * <en/> Add node data
421
+ * @param data - <zh/> 节点数据 | <en/> node data
422
+ * @apiCategory data
659
423
  */
660
- getNodeData(condition) {
661
- var _a;
662
- const conds = isString(condition) || isNumber(condition) ? [condition] : condition;
663
- return (_a = this.dataController.findData('node', conds)) === null || _a === void 0 ? void 0 : _a[0];
424
+ addNodeData(data) {
425
+ this.context.model.addNodeData(isFunction(data) ? data(this.getNodeData()) : data);
664
426
  }
665
427
  /**
666
- * Find an edge's inner data according to id or function.
667
- * @param { ID | Function } condition id or condition function
668
- * @returns result edge's inner data
669
- * @group Data
428
+ * <zh/> 新增边数据
429
+ *
430
+ * <en/> Add edge data
431
+ * @param data - <zh/> 边数据 | <en/> edge data
432
+ * @apiCategory data
670
433
  */
671
- getEdgeData(condition) {
672
- var _a;
673
- const conds = isString(condition) || isNumber(condition) || isNumber(condition)
674
- ? [condition]
675
- : condition;
676
- return (_a = this.dataController.findData('edge', conds)) === null || _a === void 0 ? void 0 : _a[0];
434
+ addEdgeData(data) {
435
+ this.context.model.addEdgeData(isFunction(data) ? data(this.getEdgeData()) : data);
677
436
  }
678
437
  /**
679
- * Find an combo's inner data according to id or function.
680
- * @param { ID | Function } condition id or condition function
681
- * @returns result combo's inner data
682
- * @group Data
438
+ * <zh/> 新增组合数据
439
+ *
440
+ * <en/> Add combo data
441
+ * @param data - <zh/> 组合数据 | <en/> combo data
442
+ * @apiCategory data
683
443
  */
684
- getComboData(condition) {
685
- var _a;
686
- const conds = isString(condition) || isNumber(condition) ? [condition] : condition;
687
- return (_a = this.dataController.findData('combo', conds)) === null || _a === void 0 ? void 0 : _a[0];
444
+ addComboData(data) {
445
+ this.context.model.addComboData(isFunction(data) ? data(this.getComboData()) : data);
688
446
  }
689
447
  /**
690
- * Get all the nodes' inner data
691
- * @returns all nodes' inner data on the graph
692
- * @group Data
448
+ * <zh/> 更新元素数据
449
+ *
450
+ * <en/> Update element data
451
+ * @param data - <zh/> 元素数据 | <en/> element data
452
+ * @apiCategory data
693
453
  */
694
- getAllNodesData() {
695
- return this.dataController.findAllData('node');
454
+ updateData(data) {
455
+ this.context.model.updateData(isFunction(data) ? data(this.getData()) : data);
696
456
  }
697
457
  /**
698
- * Get all the edges' inner data
699
- * @returns all edges' inner data on the graph
700
- * @group Data
458
+ * <zh/> 更新节点数据
459
+ *
460
+ * <en/> Update node data
461
+ * @param data - <zh/> 节点数据 | <en/> node data
462
+ * @apiCategory data
701
463
  */
702
- getAllEdgesData() {
703
- return this.dataController.findAllData('edge');
464
+ updateNodeData(data) {
465
+ this.context.model.updateNodeData(isFunction(data) ? data(this.getNodeData()) : data);
704
466
  }
705
467
  /**
706
- * Get all the combos' inner data
707
- * @returns all combos' inner data on the graph
708
- * @group Data
468
+ * <zh/> 更新边数据
469
+ *
470
+ * <en/> Update edge data
471
+ * @param data - <zh/> 边数据 | <en/> edge data
472
+ * @apiCategory data
709
473
  */
710
- getAllCombosData() {
711
- return this.dataController.findAllData('combo');
474
+ updateEdgeData(data) {
475
+ this.context.model.updateEdgeData(isFunction(data) ? data(this.getEdgeData()) : data);
712
476
  }
713
477
  /**
714
- * Get one-hop edge ids from a start node.
715
- * @param nodeId id of the start node
716
- * @returns one-hop edges' data array
717
- * @group Data
478
+ * <zh/> 更新组合数据
479
+ *
480
+ * <en/> Update combo data
481
+ * @param data - <zh/> 组合数据 | <en/> combo data
482
+ * @apiCategory data
718
483
  */
719
- getRelatedEdgesData(nodeId, direction = 'both') {
720
- return this.dataController.findRelatedEdges(nodeId, direction);
484
+ updateComboData(data) {
485
+ this.context.model.updateComboData(isFunction(data) ? data(this.getComboData()) : data);
721
486
  }
722
487
  /**
723
- * Get one-hop node ids from a start node.
724
- * @param nodeId id of the start node
725
- * @returns one-hop nodes' data array
726
- * @group Data
488
+ * <zh/> 删除多条元素数据
489
+ *
490
+ * <en/> Remove multiple element data
491
+ * @param ids - <zh/> 元素 ID 数组 | <en/> element ID array
492
+ * @apiCategory data
727
493
  */
728
- getNeighborNodesData(nodeId, direction = 'both') {
729
- return this.dataController.findNeighborNodes(nodeId, direction);
494
+ removeData(ids) {
495
+ this.context.model.removeData(isFunction(ids) ? ids(this.getData()) : ids);
730
496
  }
731
497
  /**
732
- * Get the children's data of a combo.
733
- * @param comboId combo id
734
- * @returns children's data array
735
- * @group Data
498
+ * <zh/> 删除多条节点数据
499
+ *
500
+ * <en/> Remove multiple node data
501
+ * @param ids - <zh/> 节点 ID 数组 | <en/> node ID array
502
+ * @apiCategory data
736
503
  */
737
- getComboChildrenData(comboId) {
738
- return this.dataController.findChildren(comboId, 'combo');
504
+ removeNodeData(ids) {
505
+ this.context.model.removeNodeData(isFunction(ids) ? ids(this.getNodeData()) : ids);
739
506
  }
740
- /*
741
- * Get the display model of a node / edge / combo.
742
- * @param id item id
743
- * @returns display model
744
- * @group Data
507
+ /**
508
+ * <zh/> 删除多条边数据
509
+ *
510
+ * <en/> Remove multiple edge data
511
+ * @param ids - <zh/> 边 ID 数组 | <en/> edge ID array
512
+ * @apiCategory data
745
513
  */
746
- getDisplayModel(id) {
747
- return this.itemController.findDisplayModel(id);
514
+ removeEdgeData(ids) {
515
+ this.context.model.removeEdgeData(isFunction(ids) ? ids(this.getEdgeData()) : ids);
748
516
  }
749
517
  /**
750
- * Retrieve the nearby edges for a given node using quadtree collision detection.
751
- * @param nodeId node id
752
- * @group Data
518
+ * <zh/> 删除多条组合数据
519
+ *
520
+ * <en/> Remove multiple combo data
521
+ * @param ids - <zh/> 组合 ID 数组 | <en/> 组合 ID array
522
+ * @apiCategory data
753
523
  */
754
- getNearEdgesForNode(nodeId) {
755
- const { graphCore } = this.dataController;
756
- return this.itemController.findNearEdgesByNode(nodeId, graphCore);
524
+ removeComboData(ids) {
525
+ this.context.model.removeComboData(isFunction(ids) ? ids(this.getComboData()) : ids);
757
526
  }
758
527
  /**
759
- * Find items which has the state.
760
- * @param itemType item type
761
- * @param state state name
762
- * @param additionalFilter additional filter function
763
- * @returns items that is the type and has the state
764
- * @group Item
528
+ * <zh/> 获取元素类型
529
+ *
530
+ * <en/> Get element type
531
+ * @param id - <zh/> 元素 ID | <en/> element ID
532
+ * @returns <zh/> 元素类型 | <en/> element type
533
+ * @apiCategory element
765
534
  */
766
- findIdByState(itemType, state, value = true, additionalFilter) {
767
- let ids = this.itemController.findIdByState(itemType, state, value);
768
- if (additionalFilter) {
769
- let getDataFunc = this.getEdgeData;
770
- if (itemType === 'node')
771
- getDataFunc = this.getNodeData;
772
- else if (itemType === 'combo')
773
- getDataFunc = this.getComboData;
774
- ids = ids.filter((id) => additionalFilter(getDataFunc(id)));
775
- }
776
- return ids;
777
- }
778
- /**
779
- * Add one or more node/edge/combo data to the graph.
780
- * @param itemType item type
781
- * @param model user data
782
- * @returns whether success
783
- * @group Data
784
- */
785
- addData(itemType, models) {
786
- // data controller and item controller subscribe additem in order
787
- const { graphCore } = this.dataController;
788
- const { specification } = this.themeController;
789
- graphCore.once('changed', (event) => {
790
- if (!event.changes.length)
791
- return;
792
- const changes = event.changes;
793
- const timingParameters = {
794
- type: itemType,
795
- action: 'add',
796
- models,
797
- apiName: 'addData',
798
- changes,
799
- };
800
- this.emit('beforeitemchange', timingParameters);
801
- this.hooks.itemchange.emit({
802
- type: itemType,
803
- changes: graphCore.reduceChanges(event.changes),
804
- graphCore,
805
- theme: specification,
806
- });
807
- this.emit('afteritemchange', timingParameters);
808
- });
809
- const modelArr = isArray(models) ? models : [models];
810
- const data = { nodes: [], edges: [], combos: [] };
811
- data[`${itemType}s`] = modelArr;
812
- this.hooks.datachange.emit({
813
- data,
814
- type: 'union',
815
- });
816
- const dataList = this.dataController.findData(itemType, modelArr.map((model) => model.id));
817
- return isArray(models) ? dataList : dataList[0];
818
- }
819
- /**
820
- * Remove one or more node/edge/combo data from the graph.
821
- * @param item the item to be removed
822
- * @returns whether success
823
- * @group Data
824
- */
825
- removeData(itemType, ids) {
826
- const idArr = isArray(ids) ? ids : [ids];
827
- const data = { nodes: [], edges: [], combos: [] };
828
- const { graphCore } = this.dataController;
829
- const { specification } = this.themeController;
830
- const getItem = itemType === 'edge' ? graphCore.getEdge : graphCore.getNode;
831
- const hasItem = itemType === 'edge' ? graphCore.hasEdge : graphCore.hasNode;
832
- data[`${itemType}s`] = idArr
833
- .map((id) => {
834
- if (!hasItem.bind(graphCore)(id)) {
835
- console.warn(`The ${itemType} data with id ${id} does not exist. It will be ignored`);
836
- return;
837
- }
838
- return getItem.bind(graphCore)(id);
839
- })
840
- .filter(Boolean);
841
- graphCore.once('changed', (event) => {
842
- if (!event.changes.length)
843
- return;
844
- const changes = event.changes;
845
- const timingParameters = {
846
- type: itemType,
847
- action: 'remove',
848
- ids: idArr,
849
- apiName: 'removeData',
850
- changes,
851
- };
852
- this.emit('beforeitemchange', timingParameters);
853
- this.hooks.itemchange.emit({
854
- type: itemType,
855
- changes: event.changes,
856
- graphCore,
857
- theme: specification,
858
- });
859
- this.emit('afteritemchange', timingParameters);
860
- });
861
- this.hooks.datachange.emit({
862
- data,
863
- type: 'remove',
864
- });
535
+ getElementType(id) {
536
+ return this.context.model.getElementType(id);
865
537
  }
866
538
  /**
867
- * Extends the fields of oldValue and newValue
868
- * to make sure they both contain the union set of their original fields.
869
- * The missing fields' values are filled using data from displayModel data.
870
- * @param changes
871
- * @returns
872
- */
873
- extendChanges(changes) {
874
- return changes
875
- .map((change) => {
876
- const { id, propertyName, oldValue, newValue } = change;
877
- if (!oldValue || !newValue)
878
- return change;
879
- if (propertyName) {
880
- if (oldValue !== newValue)
881
- return change;
882
- return false;
883
- }
884
- const displayData = this.getItemById(id).displayModel.data;
885
- const oldFields = Object.keys(oldValue);
886
- const newFields = Object.keys(newValue);
887
- const commonFields = [...new Set([...oldFields, ...newFields])];
888
- commonFields.forEach((field) => {
889
- if (!Object.prototype.hasOwnProperty.call(oldValue, field)) {
890
- oldValue[field] = displayData[field];
891
- }
892
- if (!Object.prototype.hasOwnProperty.call(newValue, field)) {
893
- newValue[field] = displayData[field];
894
- }
895
- });
896
- if ((oldValue.x === undefined || Number.isNaN(oldValue.x)) &&
897
- !oldValue._isCombo)
898
- oldValue.x = 0;
899
- if ((oldValue.y === undefined || Number.isNaN(oldValue.x)) &&
900
- !oldValue._isCombo)
901
- oldValue.y = 0;
902
- if (Number.isNaN(newValue.x))
903
- delete newValue.x;
904
- if (Number.isNaN(newValue.y))
905
- delete newValue.y;
906
- if (isEqual(newValue, oldValue))
907
- return false;
908
- return Object.assign(Object.assign({}, change), { newValue,
909
- oldValue });
910
- })
911
- .filter(Boolean);
912
- }
913
- /**
914
- * Update one or more node/edge/combo data on the graph.
915
- * @param {ITEM_TYPE} itemType 'node' | 'edge' | 'combo'
916
- * @param models new configurations for every node/edge/combo, which has id field to indicate the specific item
917
- * @group Data
918
- */
919
- updateData(itemType, models) {
920
- const modelArr = isArray(models) ? models : [models];
921
- const data = { nodes: [], edges: [], combos: [] };
922
- data[`${itemType}s`] = modelArr;
923
- const { graphCore } = this.dataController;
924
- const { specification } = this.themeController;
925
- graphCore.once('changed', (event) => {
926
- const changes = this.extendChanges(clone(event.changes));
927
- const timingParameters = {
928
- type: itemType,
929
- action: 'update',
930
- models,
931
- apiName: 'updateData',
932
- changes,
933
- };
934
- this.emit('beforeitemchange', timingParameters);
935
- this.hooks.itemchange.emit({
936
- type: itemType,
937
- changes: event.changes,
938
- graphCore,
939
- theme: specification,
940
- });
941
- this.emit('afteritemchange', timingParameters);
942
- });
943
- this.hooks.datachange.emit({
944
- data,
945
- type: 'update',
946
- });
947
- const dataList = this.dataController.findData(itemType, modelArr.map((model) => model.id));
948
- return isArray(models) ? dataList : dataList[0];
539
+ * <zh/> 获取节点或组合关联边的数据
540
+ *
541
+ * <en/> Get edge data related to the node or combo
542
+ * @param id - <zh/> 节点或组合ID | <en/> node or combo ID
543
+ * @param direction - <zh/> 边的方向 | <en/> edge direction
544
+ * @returns <zh/> 边数据 | <en/> edge data
545
+ * @apiCategory data
546
+ */
547
+ getRelatedEdgesData(id, direction = 'both') {
548
+ return this.context.model.getRelatedEdgesData(id, direction);
949
549
  }
950
550
  /**
951
- * Update one or more nodes' positions,
952
- * do not update other styles which leads to better performance than updating positions by updateData.
953
- * @param models new configurations with x and y for every node, which has id field to indicate the specific item
954
- * @group Data
551
+ * <zh/> 获取节点或组合的一跳邻居节点数据
552
+ *
553
+ * <en/> Get the one-hop neighbor node data of the node or combo
554
+ * @param id - <zh/> 节点或组合ID | <en/> node or combo ID
555
+ * @returns <zh/> 邻居节点数据 | <en/> neighbor node data
556
+ * @apiCategory data
955
557
  */
956
- updateNodePosition(models, upsertAncestors, disableAnimate = false, callback, stack) {
957
- return this.updatePosition('node', models, upsertAncestors, disableAnimate, callback, stack);
558
+ getNeighborNodesData(id) {
559
+ return this.context.model.getNeighborNodesData(id);
958
560
  }
959
561
  /**
960
- * Update one or more combos' positions,
961
- * do not update other styles which leads to better performance than updating positions by updateData.
962
- * In fact, it changes the succeed nodes positions to affect the combo's position, but not modify the combo's position directly.
963
- * @param models new configurations with x and y for every combo, which has id field to indicate the specific item
964
- * @group Data
562
+ * <zh/> 获取节点或组合的祖先元素数据
563
+ *
564
+ * <en/> Get the ancestor element data of the node or combo
565
+ * @param id - <zh/> 节点或组合ID | <en/> node or combo ID
566
+ * @param hierarchy - <zh/> 指定树图层级关系还是组合层级关系 | <en/> specify tree or combo hierarchy relationship
567
+ * @returns <zh/> 祖先元素数据 | <en/> ancestor element data
568
+ * @remarks
569
+ * <zh/> 数组中的顺序是从父节点到祖先节点
570
+ *
571
+ * <en/> The order in the array is from the parent node to the ancestor node
572
+ * @apiCategory data
965
573
  */
966
- updateComboPosition(models, upsertAncestors, disableAnimate = false, callback, stack) {
967
- return this.updatePosition('combo', models, upsertAncestors, disableAnimate, callback, stack);
574
+ getAncestorsData(id, hierarchy) {
575
+ return this.context.model.getAncestorsData(id, hierarchy);
968
576
  }
969
577
  /**
970
- * Get history plugin instance
578
+ * <zh/> 获取节点或组合的父元素数据
579
+ *
580
+ * <en/> Get the parent element data of the node or combo
581
+ * @param id - <zh/> 节点或组合ID | <en/> node or combo ID
582
+ * @param hierarchy - <zh/> 指定树图层级关系还是组合层级关系 | <en/> specify tree or combo hierarchy relationship
583
+ * @returns <zh/> 父元素数据 | <en/> parent element data
584
+ * @apiCategory data
971
585
  */
972
- getHistoryPlugin() {
973
- if (!this.specification.enableStack ||
974
- !this.pluginController.hasPlugin('history')) {
975
- console.error('The history plugin is not loaded or initialized.');
976
- return;
586
+ getParentData(id, hierarchy) {
587
+ return this.context.model.getParentData(id, hierarchy);
588
+ }
589
+ /**
590
+ * <zh/> 获取节点或组合的子元素数据
591
+ *
592
+ * <en/> Get the child element data of the node or combo
593
+ * @param id - <zh/> 节点或组合ID | <en/> node or combo ID
594
+ * @returns <zh/> 子元素数据 | <en/> child element data
595
+ * @apiCategory data
596
+ */
597
+ getChildrenData(id) {
598
+ return this.context.model.getChildrenData(id);
599
+ }
600
+ getElementDataByState(elementType, state) {
601
+ return this.context.model.getElementDataByState(elementType, state);
602
+ }
603
+ async initCanvas() {
604
+ if (this.context.canvas)
605
+ return await this.context.canvas.init();
606
+ const { container = 'container', width, height, renderer, background } = this.options;
607
+ if (container instanceof Canvas) {
608
+ this.context.canvas = container;
609
+ container.setBackground(background);
610
+ await container.init();
977
611
  }
978
- return this.pluginController.getPlugin('history');
979
- }
980
- updatePosition(type, models, upsertAncestors, disableAnimate = false, callback, stack) {
981
- const modelArr = isArray(models) ? models : [models];
982
- const { graphCore } = this.dataController;
983
- const { specification } = this.themeController;
984
- graphCore.once('changed', (event) => {
985
- if (!event.changes.length)
986
- return;
987
- const changes = event.changes.filter((change) => !isEqual(change.newValue, change.oldValue));
988
- const timingParameters = {
989
- type,
990
- action: 'updatePosition',
991
- upsertAncestors,
992
- models,
993
- apiName: 'updatePosition',
994
- changes,
995
- };
996
- this.emit('beforeitemchange', timingParameters);
997
- this.hooks.itemchange.emit({
998
- type,
999
- changes: event.changes,
1000
- graphCore,
1001
- theme: specification,
1002
- upsertAncestors,
1003
- action: 'updatePosition',
1004
- animate: !disableAnimate,
1005
- callback,
1006
- });
1007
- this.emit('afteritemchange', timingParameters);
1008
- });
1009
- this.hooks.datachange.emit({
1010
- data: {
1011
- nodes: type === 'node' ? modelArr : [],
1012
- edges: [],
1013
- combos: type === 'combo' ? modelArr : [],
1014
- },
1015
- type: 'update',
1016
- });
1017
- const dataList = this.dataController.findData(type, modelArr.map((model) => model.id));
1018
- return isArray(models) ? dataList : dataList[0];
1019
- }
1020
- getItemPreviousVisibility(ids) {
1021
- const objs = ids.map((id) => ({ id, visible: this.getItemVisible(id) }));
1022
- const groupedByVisible = groupBy(objs, 'visible');
1023
- const values = [];
1024
- for (const visible in groupedByVisible) {
1025
- values.push({
1026
- ids: map(groupedByVisible[visible], (item) => item.id),
1027
- visible: visible === 'true',
612
+ else {
613
+ const $container = isString(container) ? document.getElementById(container) : container;
614
+ const containerSize = sizeOf($container);
615
+ this.emit(GraphEvent.BEFORE_CANVAS_INIT, { container: $container, width, height });
616
+ const canvas = new Canvas({
617
+ container: $container,
618
+ width: width || containerSize[0],
619
+ height: height || containerSize[1],
620
+ background,
621
+ renderer,
1028
622
  });
623
+ this.context.canvas = canvas;
624
+ await canvas.init();
625
+ this.emit(GraphEvent.AFTER_CANVAS_INIT, { canvas });
1029
626
  }
1030
- return values;
1031
627
  }
1032
- /**
1033
- * Show the item(s).
1034
- * @param item the item to be shown
1035
- * @returns
1036
- * @group Item
628
+ initRuntime() {
629
+ this.context.options = this.options;
630
+ if (!this.context.batch)
631
+ this.context.batch = new BatchController(this.context);
632
+ if (!this.context.plugin)
633
+ this.context.plugin = new PluginController(this.context);
634
+ if (!this.context.viewport)
635
+ this.context.viewport = new ViewportController(this.context);
636
+ if (!this.context.transform)
637
+ this.context.transform = new TransformController(this.context);
638
+ if (!this.context.element)
639
+ this.context.element = new ElementController(this.context);
640
+ if (!this.context.animation)
641
+ this.context.animation = new Animation(this.context);
642
+ if (!this.context.layout)
643
+ this.context.layout = new LayoutController(this.context);
644
+ if (!this.context.behavior)
645
+ this.context.behavior = new BehaviorController(this.context);
646
+ }
647
+ async prepare() {
648
+ // 等待同步任务执行完成,避免 render 后立即调用 destroy 导致的问题
649
+ // Wait for synchronous tasks to complete, to avoid problems caused by calling destroy immediately after render
650
+ await Promise.resolve();
651
+ if (this.destroyed)
652
+ throw new Error('Graph has been destroyed');
653
+ await this.initCanvas();
654
+ this.initRuntime();
655
+ }
656
+ /**
657
+ * <zh/> 执行渲染
658
+ *
659
+ * <en/> Render
660
+ * @remarks
661
+ * <zh/> 此过程会执行数据更新、绘制元素、执行布局
662
+ *
663
+ * <en/> This process will execute data update, element rendering, and layout execution
664
+ * @apiCategory render
1037
665
  */
1038
- showItem(ids, disableAnimate = false) {
1039
- const idArr = isArray(ids) ? ids : [ids];
1040
- if (isEmpty(idArr))
1041
- return;
1042
- const changes = {
1043
- newValue: [{ ids: idArr, visible: true }],
1044
- oldValue: this.getItemPreviousVisibility(idArr),
1045
- };
1046
- this.hooks.itemvisibilitychange.emit({
1047
- ids: idArr,
1048
- value: true,
1049
- graphCore: this.dataController.graphCore,
1050
- animate: !disableAnimate,
1051
- });
1052
- this.emit('afteritemvisibilitychange', {
1053
- ids,
1054
- value: true,
1055
- animate: !disableAnimate,
1056
- action: 'updateVisibility',
1057
- apiName: 'showItem',
1058
- changes,
1059
- });
666
+ async render() {
667
+ await this.prepare();
668
+ emit(this, new GraphLifeCycleEvent(GraphEvent.BEFORE_RENDER));
669
+ const animation = this.context.element.draw();
670
+ await Promise.all([animation?.finished, this.context.layout.layout()]);
671
+ await this.autoFit();
672
+ emit(this, new GraphLifeCycleEvent(GraphEvent.AFTER_RENDER));
1060
673
  }
1061
674
  /**
1062
- * Hide the item(s).
1063
- * @param item the item to be hidden
1064
- * @returns
1065
- * @group Item
675
+ * <zh/> 绘制元素
676
+ *
677
+ * <en/> Draw elements
678
+ * @returns <zh/> 渲染结果 | <en/> draw result
679
+ * @apiCategory element
1066
680
  */
1067
- hideItem(ids, disableAnimate = false, keepKeyShape = false) {
1068
- const idArr = isArray(ids) ? ids : [ids];
1069
- if (isEmpty(idArr))
1070
- return;
1071
- const changes = {
1072
- newValue: [{ ids: idArr, visible: false }],
1073
- oldValue: this.getItemPreviousVisibility(idArr),
1074
- };
1075
- this.hooks.itemvisibilitychange.emit({
1076
- ids: idArr,
1077
- value: false,
1078
- graphCore: this.dataController.graphCore,
1079
- animate: !disableAnimate,
1080
- keepKeyShape,
1081
- });
1082
- this.emit('afteritemvisibilitychange', {
1083
- ids,
1084
- value: false,
1085
- animate: !disableAnimate,
1086
- action: 'updateVisibility',
1087
- apiName: 'hideItem',
1088
- keepKeyShape,
1089
- changes,
1090
- });
681
+ async draw() {
682
+ await this.prepare();
683
+ await this.context.element.draw()?.finished;
684
+ await this.autoFit();
1091
685
  }
1092
686
  /**
1093
- * Make the item(s) to the front.
1094
- * @param ids
1095
- * @returns
1096
- * @group Item
687
+ * <zh/> 执行布局
688
+ *
689
+ * <en/> Execute layout
690
+ * @apiCategory layout
1097
691
  */
1098
- frontItem(ids) {
1099
- const idArr = isArray(ids) ? ids : [ids];
1100
- this.hooks.itemzindexchange.emit({
1101
- ids: idArr,
1102
- action: 'front',
1103
- graphCore: this.dataController.graphCore,
1104
- });
1105
- this.emit('afteritemzindexchange', {
1106
- ids: idArr,
1107
- action: 'front',
1108
- apiName: 'frontItem',
1109
- });
692
+ async layout() {
693
+ await this.context.layout.layout();
1110
694
  }
1111
695
  /**
1112
- * Make the item(s) to the back.
1113
- * @param ids
1114
- * @returns
1115
- * @group Item
696
+ * <zh/> 停止布局
697
+ *
698
+ * <en/> Stop layout
699
+ * @remarks
700
+ * <zh/> 适用于带有迭代动画的布局,目前有 `force` 属于此类布局,即停止力导布局的迭代,一般用于布局迭代时间过长情况下的手动停止迭代动画,例如在点击画布/节点的监听中调用
701
+ *
702
+ * <en/> Suitable for layouts with iterative animations. Currently, `force` belongs to this type of layout, that is, stop the iteration of the force-directed layout. It is generally used to manually stop the iteration animation when the layout iteration time is too long, such as calling in the click canvas/node listener
703
+ * @apiCategory layout
1116
704
  */
1117
- backItem(ids) {
1118
- const idArr = isArray(ids) ? ids : [ids];
1119
- this.hooks.itemzindexchange.emit({
1120
- ids: idArr,
1121
- action: 'back',
1122
- graphCore: this.dataController.graphCore,
1123
- });
1124
- this.emit('afteritemzindexchange', {
1125
- ids: idArr,
1126
- action: 'back',
1127
- apiName: 'backItem',
1128
- });
1129
- }
1130
- getItemPreviousStates(stateOption) {
1131
- const { ids, states } = stateOption;
1132
- const idArr = Array.isArray(ids) ? ids : [ids];
1133
- const stateArr = Array.isArray(states) ? states : [states];
1134
- if (isEmpty(idArr))
1135
- return;
1136
- return idArr.flatMap((id) => {
1137
- return stateArr.map((state) => ({
1138
- ids: id,
1139
- states: state,
1140
- value: this.getItemState(id, state),
1141
- }));
1142
- });
1143
- }
1144
- /**
1145
- * Set state for the item.
1146
- * @param item the item to be set
1147
- * @param state the state name
1148
- * @param value state value
1149
- * @returns
1150
- * @group Item
1151
- */
1152
- setItemState(ids, states, value) {
1153
- const idArr = isArray(ids) ? ids : [ids];
1154
- const stateArr = isArray(states) ? states : [states];
1155
- const stateOption = { ids: idArr, states: stateArr, value };
1156
- const changes = {
1157
- newValue: [stateOption],
1158
- oldValue: this.getItemPreviousStates(stateOption),
1159
- };
1160
- this.hooks.itemstatechange.emit({
1161
- ids: idArr,
1162
- states: stateArr,
1163
- value,
1164
- });
1165
- this.emit('afteritemstatechange', {
1166
- ids,
1167
- states,
1168
- value,
1169
- action: 'updateState',
1170
- apiName: 'setItemState',
1171
- changes,
1172
- });
705
+ stopLayout() {
706
+ this.context.layout.stopLayout();
1173
707
  }
1174
708
  /**
1175
- * Get the state value for an item.
1176
- * @param id the id for the item
1177
- * @param states the state name
1178
- * @returns {boolean} the state value
1179
- * @group Item
709
+ * <zh/> 清空画布元素
710
+ *
711
+ * <en/> Clear canvas elements
712
+ * @apiCategory canvas
1180
713
  */
1181
- getItemState(id, state) {
1182
- return this.itemController.getItemState(id, state);
714
+ async clear() {
715
+ this.context.model.setData({});
716
+ await this.draw();
1183
717
  }
1184
718
  /**
1185
- * Get all the state names with value true for an item.
1186
- * @param id the id for the item
1187
- * @returns {string[]} the state names with value true
1188
- * @group Item
1189
- */
1190
- getItemAllStates(id) {
1191
- return this.itemController.getItemAllStates(id);
719
+ * <zh/> 销毁当前图实例
720
+ *
721
+ * <en/> Destroy the current graph instance
722
+ * @apiCategory instance
723
+ */
724
+ destroy() {
725
+ emit(this, new GraphLifeCycleEvent(GraphEvent.BEFORE_DESTROY));
726
+ const { layout, animation, element, model, canvas, behavior, plugin } = this.context;
727
+ plugin?.destroy();
728
+ behavior?.destroy();
729
+ layout?.destroy();
730
+ animation?.destroy();
731
+ element?.destroy();
732
+ model.destroy();
733
+ canvas?.destroy();
734
+ this.options = {};
735
+ // @ts-expect-error force delete
736
+ this.context = {};
737
+ this.off();
738
+ window.removeEventListener('resize', this.onResize);
739
+ this.destroyed = true;
740
+ emit(this, new GraphLifeCycleEvent(GraphEvent.AFTER_DESTROY));
1192
741
  }
1193
742
  /**
1194
- * Clear all the states for item(s).
1195
- * @param ids the id(s) for the item(s) to be clear
1196
- * @param states the states' names, all the states wil be cleared if states is not assigned
1197
- * @returns
1198
- * @group Item
743
+ * <zh/> 获取画布实例
744
+ *
745
+ * <en/> Get canvas instance
746
+ * @returns - <zh/> 画布实例 | <en/> canvas instance
747
+ * @apiCategory canvas
1199
748
  */
1200
- clearItemState(ids, states) {
1201
- const idArr = isArray(ids) ? ids : [ids];
1202
- const stateOptions = { ids: idArr, states, value: false };
1203
- const changes = {
1204
- newValue: [stateOptions],
1205
- oldValue: this.getItemPreviousStates(stateOptions),
1206
- };
1207
- this.hooks.itemstatechange.emit({
1208
- ids: idArr,
1209
- states,
1210
- value: false,
1211
- });
1212
- this.emit('afteritemstatechange', {
1213
- ids,
1214
- states,
1215
- value: false,
1216
- action: 'updateState',
1217
- apiName: 'clearItemState',
1218
- changes,
1219
- });
749
+ getCanvas() {
750
+ return this.context.canvas;
1220
751
  }
1221
- /**
1222
- * Get the rendering bbox for a node / edge / combo, or the graph (when the id is not assigned).
1223
- * @param id the id for the node / edge / combo, undefined for the whole graph
1224
- * @returns rendering bounding box. returns false if the item is not exist
1225
- * @group Item
1226
- */
1227
- getRenderBBox(id, onlyKeyShape = false, isTransient = false) {
1228
- if (!id)
1229
- return this.canvas.getRoot().getRenderBounds();
1230
- return this.itemController.getItemBBox(id, onlyKeyShape, isTransient);
1231
- }
1232
- /**
1233
- * Get the visibility for a node / edge / combo.
1234
- * @param id the id for the node / edge / combo
1235
- * @returns visibility for the item, false for invisible or unexistence for the item
1236
- * @group Item
1237
- */
1238
- getItemVisible(id) {
1239
- return this.itemController.getItemVisible(id);
1240
- }
1241
- // ===== combo operations =====
1242
- /**
1243
- * Add a new combo to the graph, and update the structure of the existed child in childrenIds to be the children of the new combo.
1244
- * Different from addData with combo type, this API update the succeeds' combo tree strucutres in the same time.
1245
- * @param model combo user data
1246
- * @returns whether success
1247
- * @group Combo
1248
- */
1249
- addCombo(model, childrenIds) {
1250
- const { graphCore } = this.dataController;
1251
- const { specification } = this.themeController;
1252
- graphCore.once('changed', (event) => {
1253
- if (!event.changes.length)
1254
- return;
1255
- const changes = event.changes;
1256
- const timingParameters = {
1257
- type: 'combo',
1258
- action: 'add',
1259
- models: [model],
1260
- apiName: 'addCombo',
1261
- changes,
1262
- };
1263
- this.emit('beforeitemchange', timingParameters);
1264
- this.hooks.itemchange.emit({
1265
- type: 'combo',
1266
- changes: graphCore.reduceChanges(event.changes),
1267
- graphCore,
1268
- theme: specification,
1269
- });
1270
- this.emit('afteritemchange', timingParameters);
1271
- });
1272
- const data = {
1273
- nodes: [],
1274
- edges: [],
1275
- combos: [
1276
- Object.assign(Object.assign({}, model), { data: Object.assign(Object.assign({}, model.data), { _children: childrenIds }) }),
1277
- ],
1278
- };
1279
- this.hooks.datachange.emit({
1280
- data,
1281
- type: 'addCombo',
1282
- });
1283
- return this.dataController.findData('combo', [model.id])[0];
752
+ resize(width, height) {
753
+ const size = !width || !height ? sizeOf(this.context.canvas.getContainer()) : [width, height];
754
+ if (isEqual(size, this.getSize()))
755
+ return;
756
+ emit(this, new GraphLifeCycleEvent(GraphEvent.BEFORE_SIZE_CHANGE, { size }));
757
+ this.context.canvas.resize(...size);
758
+ emit(this, new GraphLifeCycleEvent(GraphEvent.AFTER_SIZE_CHANGE, { size }));
1284
759
  }
1285
760
  /**
1286
- * Collapse a combo.
1287
- * @param comboId combo ids
1288
- * @group Combo
761
+ * <zh/> 将图缩放至合适大小并平移至视口中心
762
+ *
763
+ * <en/> Zoom the graph to fit the viewport and move it to the center of the viewport
764
+ * @param options - <zh/> 适配配置 | <en/> fit options
765
+ * @param animation - <zh/> 动画配置 | <en/> animation configuration
766
+ * @apiCategory viewport
1289
767
  */
1290
- collapseCombo(comboIds) {
1291
- const ids = isArray(comboIds) ? comboIds : [comboIds];
1292
- this.executeWithNoStack(() => {
1293
- this.updateData('combo', ids.map((id) => ({ id, data: { collapsed: true } })));
1294
- });
1295
- this.emit('aftercollapsecombo', {
1296
- type: 'combo',
1297
- action: 'collapseCombo',
1298
- ids: comboIds,
1299
- apiName: 'collapseCombo',
1300
- });
768
+ async fitView(options, animation) {
769
+ await this.context.viewport?.fitView(options, animation);
1301
770
  }
1302
771
  /**
1303
- * Expand a combo.
1304
- * @param combo combo ids
1305
- * @group Combo
772
+ * <zh/> 将图平移至视口中心
773
+ *
774
+ * <en/> Move the graph to the center of the viewport
775
+ * @param animation - <zh/> 动画配置 | <en/> animation configuration
776
+ * @apiCategory viewport
1306
777
  */
1307
- expandCombo(comboIds) {
1308
- const ids = isArray(comboIds) ? comboIds : [comboIds];
1309
- this.executeWithNoStack(() => {
1310
- this.updateData('combo', ids.map((id) => ({ id, data: { collapsed: false } })));
1311
- });
1312
- this.emit('afterexpandcombo', {
1313
- type: 'combo',
1314
- action: 'expandCombo',
1315
- ids: comboIds,
1316
- apiName: 'expandCombo',
1317
- });
778
+ async fitCenter(animation) {
779
+ await this.context.viewport?.fitCenter(animation);
1318
780
  }
1319
- /**
1320
- * Move one or more combos a distance (dx, dy) relatively,
1321
- * do not update other styles which leads to better performance than updating positions by updateData.
1322
- * In fact, it changes the succeed nodes positions to affect the combo's position, but not modify the combo's position directly.
1323
- * @param models new configurations with x and y for every combo, which has id field to indicate the specific item
1324
- * @group Combo
1325
- */
1326
- moveCombo(ids, dx, dy, upsertAncestors, callback) {
1327
- const idArr = isArray(ids) ? ids : [ids];
1328
- const { graphCore } = this.dataController;
1329
- const { specification } = this.themeController;
1330
- graphCore.once('changed', (event) => {
1331
- if (!event.changes.length)
1332
- return;
1333
- const changes = this.extendChanges(clone(event.changes));
1334
- const timingParameters = {
1335
- type: 'combo',
1336
- ids: idArr,
1337
- dx,
1338
- dy,
1339
- action: 'updatePosition',
1340
- upsertAncestors,
1341
- apiName: 'moveCombo',
1342
- changes,
1343
- };
1344
- this.emit('beforeitemchange', timingParameters);
1345
- this.hooks.itemchange.emit({
1346
- type: 'combo',
1347
- changes: event.changes,
1348
- graphCore,
1349
- theme: specification,
1350
- upsertAncestors,
1351
- action: 'updatePosition',
1352
- callback,
1353
- });
1354
- this.emit('afteritemchange', timingParameters);
1355
- });
1356
- this.hooks.datachange.emit({
1357
- data: {
1358
- nodes: [],
1359
- edges: [],
1360
- combos: idArr.map((id) => ({ id, data: { dx, dy } })),
1361
- },
1362
- type: 'moveCombo',
1363
- });
1364
- return this.dataController.findData('combo', idArr);
1365
- }
1366
- // ===== layout =====
1367
- /**
1368
- * Layout the graph (with current configurations if cfg is not assigned).
1369
- */
1370
- layout(options, disableAnimate = false) {
1371
- return __awaiter(this, void 0, void 0, function* () {
1372
- this.emit('beforelayout');
1373
- const { graphCore } = this.dataController;
1374
- const formattedOptions = Object.assign(Object.assign({}, this.getSpecification().layout), options);
1375
- this.updateSpecification({ layout: formattedOptions });
1376
- const layoutUnset = (!options && !this.getSpecification().layout) ||
1377
- !Object.keys(formattedOptions).length;
1378
- if (layoutUnset) {
1379
- const nodes = graphCore.getAllNodes();
1380
- if (nodes.every((node) => isNil(node.data.x) && isNil(node.data.y))) {
1381
- // Use `grid` layout as default when x/y of each node is unset.
1382
- formattedOptions.type = 'grid';
1383
- }
1384
- else {
1385
- // Use user-defined position(x/y default to 0).
1386
- formattedOptions.execute = (graph) => __awaiter(this, void 0, void 0, function* () {
1387
- const nodes = graph.getAllNodes();
1388
- return {
1389
- nodes: nodes.map((node) => ({
1390
- id: node.id,
1391
- data: {
1392
- x: Number(node.data.x) || 0,
1393
- y: Number(node.data.y) || 0,
1394
- },
1395
- })),
1396
- edges: [],
1397
- };
1398
- });
1399
- }
1400
- }
1401
- yield this.hooks.layout.emitLinearAsync({
1402
- graphCore,
1403
- options: formattedOptions,
1404
- animate: !disableAnimate,
1405
- });
1406
- this.emit('afterlayout');
1407
- });
781
+ async autoFit() {
782
+ const { autoFit } = this.context.options;
783
+ if (!autoFit)
784
+ return;
785
+ if (isString(autoFit)) {
786
+ if (autoFit === 'view')
787
+ await this.fitView();
788
+ else if (autoFit === 'center')
789
+ await this.fitCenter();
790
+ }
791
+ else {
792
+ const { type, animation } = autoFit;
793
+ if (type === 'view')
794
+ await this.fitView(autoFit.options, animation);
795
+ else if (type === 'center')
796
+ await this.fitCenter(animation);
797
+ }
1408
798
  }
1409
799
  /**
1410
- * Some layout algorithms has many iterations which can be stopped at any time.
800
+ * <zh/> 移动图,使得元素对齐到视口中心
801
+ *
802
+ * <en/> Move the graph so that the element is aligned to the center of the viewport
803
+ * @param id - <zh/> 元素 ID | <en/> element ID
804
+ * @param animation - <zh/> 动画配置 | <en/> animation configuration
805
+ * @apiCategory viewport
1411
806
  */
1412
- stopLayout() {
1413
- this.layoutController.stopLayout();
807
+ async focusElement(id, animation) {
808
+ await this.context.viewport?.focusElements(Array.isArray(id) ? id : [id], animation);
1414
809
  }
1415
810
  /**
811
+ * <zh/> 基于当前缩放比例进行缩放
1416
812
  *
1417
- * @returns
813
+ * <en/> Zoom based on the current zoom ratio
814
+ * @param ratio - <zh/> 缩放比例 | <en/> zoom ratio
815
+ * @param animation - <zh/> 动画配置 | <en/> animation configuration
816
+ * @param origin - <zh/> 缩放中心(视口坐标) | <en/> zoom center(viewport coordinates)
817
+ * @remarks
818
+ * <zh/>
819
+ * - ratio > 1 放大
820
+ * - ratio < 1 缩小
821
+ *
822
+ * <en/>
823
+ * - ratio > 1 zoom in
824
+ * - ratio < 1 zoom out
825
+ * @apiCategory viewport
1418
826
  */
1419
- getLayoutCurrentAnimation() {
1420
- return this.layoutController.getCurrentAnimation();
827
+ async zoomBy(ratio, animation, origin) {
828
+ await this.context.viewport.transform({ mode: 'relative', scale: ratio, origin }, animation);
1421
829
  }
1422
830
  /**
1423
- * Switch mode.
1424
- * @param mode mode name
1425
- * @returns
1426
- * @group Interaction
831
+ * <zh/> 缩放画布至指定比例
832
+ *
833
+ * <en/> Zoom the canvas to the specified ratio
834
+ * @param zoom - <zh/> 指定缩放比例 | <en/> specified zoom ratio
835
+ * @param animation - <zh/> 动画配置 | <en/> animation configuration
836
+ * @param origin - <zh/> 缩放中心(视口坐标) | <en/> zoom center(viewport coordinates)
837
+ * @remarks
838
+ * <zh/>
839
+ * - zoom = 1 默认大小
840
+ * - zoom > 1 放大
841
+ * - zoom < 1 缩小
842
+ *
843
+ * <en/>
844
+ * - zoom = 1 default size
845
+ * - zoom > 1 zoom in
846
+ * - zoom < 1 zoom out
847
+ * @apiCategory viewport
1427
848
  */
1428
- setMode(mode) {
1429
- this.hooks.modechange.emit({ mode });
849
+ async zoomTo(zoom, animation, origin) {
850
+ this.context.viewport.transform({ mode: 'absolute', scale: zoom, origin }, animation);
1430
851
  }
1431
852
  /**
1432
- * Get current mode.
1433
- * @returns mode name
1434
- * @group Interaction
853
+ * <zh/> 获取当前缩放比例
854
+ *
855
+ * <en/> Get the current zoom ratio
856
+ * @returns <zh/> 缩放比例 | <en/> zoom ratio
857
+ * @apiCategory viewport
1435
858
  */
1436
- getMode() {
1437
- return this.interactionController.getMode();
859
+ getZoom() {
860
+ return this.context.viewport.getZoom();
1438
861
  }
1439
862
  /**
1440
- * Set the cursor. But the cursor in item's style has higher priority.
1441
- * @param cursor
863
+ * <zh/> 基于当前旋转角度进行旋转
864
+ *
865
+ * <en/> Rotate based on the current rotation angle
866
+ * @param angle - <zh/> 旋转角度 | <en/> rotation angle
867
+ * @param animation - <zh/> 动画配置 | <en/> animation configuration
868
+ * @param origin - <zh/> 旋转中心(视口坐标) | <en/> rotation center(viewport coordinates)
869
+ * @apiCategory viewport
1442
870
  */
1443
- setCursor(cursor) {
1444
- this.canvas.setCursor(cursor);
1445
- this.transientCanvas.setCursor(cursor);
871
+ async rotateBy(angle, animation, origin) {
872
+ await this.context.viewport.transform({ mode: 'relative', rotate: angle, origin }, animation);
1446
873
  }
1447
874
  /**
1448
- * Add behavior(s) to mode(s).
1449
- * @param behaviors behavior names or configs
1450
- * @param modes mode names
1451
- * @returns
1452
- * @group Interaction
875
+ * <zh/> 旋转画布至指定角度
876
+ *
877
+ * <en/> Rotate the canvas to the specified angle
878
+ * @param angle - <zh/> 目标角度 | <en/> target angle
879
+ * @param animation - <zh/> 动画配置 | <en/> animation configuration
880
+ * @param origin - <zh/> 旋转中心(视口坐标) | <en/> rotation center(viewport coordinates)
881
+ * @apiCategory viewport
1453
882
  */
1454
- addBehaviors(behaviors, modes) {
1455
- const modesArr = isArray(modes) ? modes : [modes];
1456
- const behaviorsArr = isArray(behaviors) ? behaviors : [behaviors];
1457
- this.hooks.behaviorchange.emit({
1458
- action: 'add',
1459
- modes: modesArr,
1460
- // TODO: update type define.
1461
- // @ts-ignore
1462
- behaviors: behaviorsArr,
1463
- });
1464
- // update the graph specification
1465
- modesArr.forEach((mode) => {
1466
- this.specification.modes[mode] =
1467
- this.specification.modes[mode].concat(behaviorsArr);
1468
- });
883
+ async rotateTo(angle, animation, origin) {
884
+ await this.context.viewport.transform({ mode: 'absolute', rotate: angle, origin }, animation);
1469
885
  }
1470
886
  /**
1471
- * Remove behavior(s) from mode(s).
1472
- * @param behaviors behavior configs with unique key
1473
- * @param modes mode names
1474
- * @returns
1475
- * @group Interaction
887
+ * <zh/> 获取当前旋转角度
888
+ *
889
+ * <en/> Get the current rotation angle
890
+ * @returns <zh/> 旋转角度 | <en/> rotation angle
891
+ * @apiCategory viewport
1476
892
  */
1477
- removeBehaviors(behaviorKeys, modes) {
1478
- const modesArr = isArray(modes) ? modes : [modes];
1479
- this.hooks.behaviorchange.emit({
1480
- action: 'remove',
1481
- modes: modesArr,
1482
- behaviors: behaviorKeys,
1483
- });
1484
- // update the graph specification
1485
- modesArr.forEach((mode) => {
1486
- behaviorKeys.forEach((key) => {
1487
- const oldBehavior = this.specification.modes[mode].find((behavior) => isObject(behavior) && behavior.key === key);
1488
- const indexOfOldBehavior = this.specification.modes[mode].indexOf(oldBehavior);
1489
- this.specification.modes[mode].splice(indexOfOldBehavior, 1);
1490
- });
1491
- });
893
+ getRotation() {
894
+ return this.context.viewport.getRotation();
1492
895
  }
1493
896
  /**
1494
- * Update a behavior on a mode.
1495
- * @param behavior behavior configs, whose name indicates the behavior to be updated
1496
- * @param mode mode name
1497
- * @returns
1498
- * @group Interaction
897
+ * <zh/> 将图平移指定距离
898
+ *
899
+ * <en/> Translate the graph by the specified distance
900
+ * @param offset - <zh/> 偏移量 | <en/> offset
901
+ * @param animation - <zh/> 动画配置 | <en/> animation configuration
902
+ * @apiCategory viewport
1499
903
  */
1500
- updateBehavior(behavior, mode) {
1501
- this.hooks.behaviorchange.emit({
1502
- action: 'update',
1503
- modes: [mode],
1504
- // TODO: update type define.
1505
- // @ts-ignore
1506
- behaviors: [behavior],
1507
- });
1508
- // no need to update specification since the corresponding part is the same object as the behavior's option
1509
- // this.specification.modes[mode].forEach((b, i) => {
1510
- // if (isObject(b) && b.key === behavior.key) {
1511
- // this.specification.modes[mode][i] = behavior;
1512
- // }
1513
- // });
1514
- }
1515
- /**
1516
- * Add plugin(s) to graph.
1517
- * @param pluginCfgs
1518
- * @returns
1519
- * @group Plugin
1520
- */
1521
- addPlugins(pluginCfgs) {
1522
- const pluginsArr = isArray(pluginCfgs) ? pluginCfgs : [pluginCfgs];
1523
- // update the graph specification
1524
- if (!this.specification.plugins)
1525
- this.specification.plugins = [];
1526
- const oldPlugins = this.specification.plugins;
1527
- const validPlugins = [];
1528
- pluginsArr.forEach((config) => {
1529
- const oldPlugin = oldPlugins.find((oldPlugin) => {
1530
- if (typeof oldPlugin === 'string' || typeof config === 'string')
1531
- return false;
1532
- return oldPlugin.key === config.key;
1533
- });
1534
- if (oldPlugin) {
1535
- console.warn(`Add plugin with key ${config.key} failed, the key is duplicated to the existing plugins on the graph.`);
1536
- return;
1537
- }
1538
- validPlugins.push(config);
1539
- });
1540
- this.specification.plugins = oldPlugins.concat(validPlugins);
1541
- this.hooks.pluginchange.emit({
1542
- action: 'add',
1543
- plugins: validPlugins,
1544
- });
904
+ async translateBy(offset, animation) {
905
+ await this.context.viewport.transform({ mode: 'relative', translate: offset }, animation);
1545
906
  }
1546
907
  /**
1547
- * Remove plugin(s) from graph.
1548
- * @param pluginKeys
1549
- * @returns
1550
- * @group Plugin
908
+ * <zh/> 将图平移至指定位置
909
+ *
910
+ * <en/> Translate the graph to the specified position
911
+ * @param position - <zh/> 指定位置 | <en/> specified position
912
+ * @param animation - <zh/> 动画配置 | <en/> animation configuration
913
+ * @apiCategory viewport
1551
914
  */
1552
- removePlugins(pluginKeys) {
1553
- const pluginArr = isArray(pluginKeys) ? pluginKeys : [pluginKeys];
1554
- this.hooks.pluginchange.emit({
1555
- action: 'remove',
1556
- plugins: pluginArr,
1557
- });
1558
- // update the graph specification
1559
- const { plugins } = this.specification;
1560
- this.specification.plugins = plugins === null || plugins === void 0 ? void 0 : plugins.filter((plugin) => {
1561
- if (isObject(plugin))
1562
- return !(pluginArr.includes(plugin.key) ||
1563
- pluginArr.includes(plugin));
1564
- return !pluginArr.includes(plugin);
1565
- });
915
+ async translateTo(position, animation) {
916
+ await this.context.viewport.transform({ mode: 'absolute', translate: position }, animation);
1566
917
  }
1567
918
  /**
1568
- * Update a plugin of the graph.
1569
- * @param plugin plugin configs, whose key indicates the behavior to be updated
1570
- * @returns
1571
- * @group Interaction
919
+ * <zh/> 获取图的位置
920
+ *
921
+ * <en/> Get the position of the graph
922
+ * @returns <zh/> 图的位置 | <en/> position of the graph
923
+ * @remarks
924
+ * <zh/> 默认状态下,图的位置为 [0, 0]
925
+ *
926
+ * <en/> By default, the position of the graph is [0, 0]
927
+ * @apiCategory viewport
1572
928
  */
1573
- updatePlugin(plugin) {
1574
- const { plugins } = this.specification;
1575
- const { key } = plugin;
1576
- if (!key) {
1577
- console.warn('Update plugin failed, the key for the plugin to be updated should be assign.');
1578
- return;
1579
- }
1580
- if (!plugins) {
1581
- console.warn('Update plugin failed, the plugin to be updated does not exist.');
1582
- return;
1583
- }
1584
- const oldPlugin = plugins === null || plugins === void 0 ? void 0 : plugins.find((p) => {
1585
- if (typeof p === 'string')
1586
- return p === key;
1587
- return p.key === key;
1588
- });
1589
- if (!oldPlugin) {
1590
- console.warn('Update plugin failed, the key for the plugin to be updated should be assign.');
1591
- return;
1592
- }
1593
- const idx = plugins.indexOf(oldPlugin);
1594
- plugins[idx] = Object.assign(Object.assign({}, oldPlugin), plugin);
1595
- this.hooks.pluginchange.emit({
1596
- action: 'update',
1597
- plugins: [plugin],
1598
- });
929
+ getPosition() {
930
+ return subtract([0, 0], this.getCanvasByViewport([0, 0]));
1599
931
  }
1600
- /**
1601
- * Draw or update a G shape or group to the transient canvas.
1602
- * @param type shape type or item type
1603
- * @param id new shape id or updated shape id for a interation shape, node/edge/combo id for item interaction group drawing
1604
- * @returns upserted shape or group
1605
- * @group Interaction
1606
- */
1607
- drawTransient(type, id, config, canvas) {
1608
- this.hooks.transientupdate.emit({
1609
- type,
1610
- id,
1611
- config,
1612
- canvas: canvas || this.transientCanvas,
1613
- graphCore: this.dataController.graphCore,
1614
- });
1615
- return this.itemController.getTransient(String(id));
1616
- }
1617
- // ===== download operations =====
1618
- /**
1619
- * Asynchronously generates a Data URL representation of the canvas content, including
1620
- * background, main content, and transient canvas.
1621
- * @param The type of the Data URL (e.g., 'image/png', 'image/jpeg').
1622
- * @returns A Promise that resolves to the Data URL string.
1623
- */
1624
- toDataURL(type) {
1625
- return __awaiter(this, void 0, void 0, function* () {
1626
- const backgroundCanvas = this.backgroundCanvas;
1627
- const canvas = this.canvas;
1628
- const transientCanvas = this.transientCanvas;
1629
- const rendererType = this.rendererType;
1630
- const pixelRatio = typeof window !== 'undefined' ? window.devicePixelRatio : 1;
1631
- const width = this.getSize()[0];
1632
- const height = this.getSize()[1];
1633
- const vContainerDOM = createDom('<div id="virtual-image"></div>');
1634
- const vCanvas = createCanvas(rendererType, vContainerDOM, width, height, pixelRatio);
1635
- const vCanvasContextService = vCanvas.getContextService();
1636
- let bgRect;
1637
- if (rendererType !== 'svg') {
1638
- bgRect = new Rect({
1639
- style: {
1640
- x: 0,
1641
- y: 0,
1642
- z: -1,
1643
- width: vCanvasContextService.getDomElement().width,
1644
- height: vCanvasContextService.getDomElement().height,
1645
- //@ts-ignore
1646
- fill: backgroundCanvas.getContextService().getDomElement().style['background-color'],
1647
- },
1648
- });
1649
- vCanvas.appendChild(bgRect);
1650
- }
1651
- const backgroundClonedGroup = backgroundCanvas.getRoot().cloneNode(true);
1652
- const clonedGroup = canvas.getRoot().cloneNode(true);
1653
- const transientClonedGroup = transientCanvas.getRoot().cloneNode(true);
1654
- vCanvas.appendChild(backgroundClonedGroup);
1655
- vCanvas.appendChild(clonedGroup);
1656
- vCanvas.appendChild(transientClonedGroup);
1657
- vCanvas.render();
1658
- if (!type)
1659
- type = 'image/png';
1660
- let dataURL = '';
1661
- yield vCanvasContextService.toDataURL({ type }).then((url) => {
1662
- dataURL = url;
1663
- });
1664
- return dataURL;
1665
- });
932
+ async translateElementBy(args1, args2, args3 = true) {
933
+ const [config, animation] = isObject(args1)
934
+ ? [args1, args2 ?? true]
935
+ : [{ [args1]: args2 }, args3];
936
+ Object.entries(config).forEach(([id, offset]) => this.context.model.translateNodeBy(id, offset));
937
+ await this.context.element.draw({ animation })?.finished;
1666
938
  }
1667
- /**
1668
- * Asynchronously generates a Data URL representation of the full canvas content,
1669
- * including background, main content, and transient canvas, with optional padding.
1670
- * @param type The type of the Data URL (e.g., 'image/png', 'image/jpeg').
1671
- * @param imageConfig Configuration options for the image (optional).
1672
- * @returns A Promise that resolves to the Data URL string.
1673
- */
1674
- toFullDataURL(type, imageConfig) {
1675
- return __awaiter(this, void 0, void 0, function* () {
1676
- const backgroundCanvas = this.backgroundCanvas;
1677
- const canvas = this.canvas;
1678
- const transientCanvas = this.transientCanvas;
1679
- const backgroundRoot = canvas.getRoot();
1680
- const root = canvas.getRoot();
1681
- const transientRoot = transientCanvas.getRoot();
1682
- const rendererType = this.rendererType;
1683
- const backgroundBBox = backgroundRoot.getBBox();
1684
- const BBox = root.getBBox();
1685
- const transientBBox = transientRoot.getBBox();
1686
- let padding = imageConfig ? imageConfig.padding : undefined;
1687
- if (!padding) {
1688
- padding = [0, 0, 0, 0];
1689
- }
1690
- else if (isNumber(padding)) {
1691
- padding = [padding, padding, padding, padding];
1692
- }
1693
- const left = (transientBBox.left
1694
- ? backgroundBBox.left
1695
- ? Math.min(backgroundBBox.left, BBox.left, transientBBox.left)
1696
- : Math.min(BBox.left, transientBBox.left)
1697
- : BBox.left) - padding[3];
1698
- const right = (transientBBox.right
1699
- ? backgroundBBox.right
1700
- ? Math.max(backgroundBBox.right, BBox.right, transientBBox.right)
1701
- : Math.max(BBox.right, transientBBox.right)
1702
- : BBox.right) + padding[1];
1703
- const top = (transientBBox.top
1704
- ? backgroundBBox.top
1705
- ? Math.min(backgroundBBox.top, BBox.top, transientBBox.top)
1706
- : Math.min(BBox.top, transientBBox.top)
1707
- : BBox.top) - padding[0];
1708
- const bottom = (transientBBox.bottom
1709
- ? backgroundBBox.bottom
1710
- ? Math.max(backgroundBBox.bottom, BBox.bottom, transientBBox.bottom)
1711
- : Math.max(BBox.bottom, transientBBox.bottom)
1712
- : BBox.bottom) + padding[2];
1713
- const graphCenterX = (left + right) / 2;
1714
- const graphCenterY = (top + bottom) / 2;
1715
- const halfX = (right - left) / 2;
1716
- const halfY = (bottom - top) / 2;
1717
- const pixelRatio = typeof window !== 'undefined' ? window.devicePixelRatio : 1;
1718
- const vWidth = halfX * 2;
1719
- const vHeight = halfY * 2;
1720
- const vContainerDOM = createDom('<div id="virtual-image"></div>');
1721
- const vCanvas = createCanvas(rendererType, vContainerDOM, vWidth, vHeight, pixelRatio);
1722
- const vCanvasContextService = vCanvas.getContextService();
1723
- if (rendererType !== 'svg') {
1724
- const bgRect = new Rect({
1725
- style: {
1726
- x: 0,
1727
- y: 0,
1728
- z: -1,
1729
- width: vCanvasContextService.getDomElement().width,
1730
- height: vCanvasContextService.getDomElement().height,
1731
- //@ts-ignore
1732
- fill: backgroundCanvas.getContextService().getDomElement().style['background-color'],
1733
- },
1734
- });
1735
- vCanvas.appendChild(bgRect);
1736
- }
1737
- const backgroundClonedGroup = backgroundRoot.cloneNode(true);
1738
- const clonedGroup = root.cloneNode(true);
1739
- const transientClonedGroup = transientRoot.cloneNode(true);
1740
- const transPosition = [
1741
- -graphCenterX + halfX,
1742
- -graphCenterY + halfY,
1743
- ];
1744
- backgroundClonedGroup.setPosition(transPosition);
1745
- clonedGroup.setPosition(transPosition);
1746
- transientClonedGroup.setPosition(transPosition);
1747
- vCanvas.appendChild(backgroundClonedGroup);
1748
- vCanvas.appendChild(clonedGroup);
1749
- vCanvas.appendChild(transientClonedGroup);
1750
- vCanvas.render();
1751
- if (!type)
1752
- type = 'image/png';
1753
- let dataURL = '';
1754
- yield vCanvasContextService.toDataURL({ type }).then((url) => {
1755
- dataURL = url;
1756
- });
1757
- return dataURL;
1758
- });
939
+ async translateElementTo(args1, args2, args3 = true) {
940
+ const [config, animation] = isObject(args1)
941
+ ? [args1, args2 ?? true]
942
+ : [{ [args1]: args2 }, args3];
943
+ Object.entries(config).forEach(([id, position]) => this.context.model.translateNodeTo(id, position));
944
+ await this.context.element.draw({ animation })?.finished;
1759
945
  }
1760
946
  /**
1761
- * Converts a Data URL to an image file and handles the download of the image.
1762
- * @param dataURL The Data URL of the image to be converted and downloaded.
1763
- * @param renderer The renderer type ('svg' or other) used for the canvas.
1764
- * @param link The HTML link element used for image download.
1765
- * @param fileName The desired name for the downloaded image file.
947
+ * <zh/> 获取元素位置
948
+ *
949
+ * <en/> Get element position
950
+ * @param id - <zh/> 元素 ID | <en/> element ID
951
+ * @returns <zh/> 元素位置 | <en/> element position
952
+ * @apiCategory element
1766
953
  */
1767
- dataURLToImage(dataURL, renderer, link, fileName) {
1768
- if (!dataURL || dataURL === 'data:') {
1769
- console.error('Download image failed. The graph is too large or there is invalid attribute values in graph items');
1770
- return;
1771
- }
1772
- if (typeof window !== 'undefined') {
1773
- if (window.Blob && window.URL && renderer !== 'svg') {
1774
- const arr = dataURL.split(',');
1775
- let mime = '';
1776
- if (arr && arr.length > 0) {
1777
- const match = arr[0].match(/:(.*?);/);
1778
- // eslint-disable-next-line prefer-destructuring
1779
- if (match && match.length >= 2)
1780
- mime = match[1];
1781
- }
1782
- const bstr = atob(arr[1]);
1783
- let n = bstr.length;
1784
- const u8arr = new Uint8Array(n);
1785
- while (n--) {
1786
- u8arr[n] = bstr.charCodeAt(n);
1787
- }
1788
- const blobObj = new Blob([u8arr], { type: mime });
1789
- if (window.navigator.msSaveBlob) {
1790
- window.navigator.msSaveBlob(blobObj, fileName);
1791
- }
1792
- else {
1793
- link.addEventListener('click', () => {
1794
- link.download = fileName;
1795
- link.href = window.URL.createObjectURL(blobObj);
1796
- });
1797
- }
1798
- }
1799
- else {
1800
- link.addEventListener('click', () => {
1801
- link.download = fileName;
1802
- link.href = dataURL;
1803
- });
1804
- }
1805
- }
954
+ getElementPosition(id) {
955
+ return this.context.model.getElementPosition(id);
1806
956
  }
1807
957
  /**
1808
- * Initiates the download of the graph as an image with an optional name and type.
1809
- * @param name The desired name for the downloaded image file (optional).
1810
- * @param type The type of the image to download (optional, defaults to 'image/png').
1811
- */
1812
- downloadImage(name, type) {
1813
- const self = this;
1814
- // self.stopAnimate();
1815
- const rendererType = this.rendererType;
1816
- if (!type)
1817
- type = 'image/png';
1818
- const fileName = (name || 'graph') +
1819
- (rendererType === 'svg' ? '.svg' : type.split('/')[1]);
1820
- const link = document.createElement('a');
1821
- self.asyncToDataUrl(type, (dataURL) => {
1822
- this.dataURLToImage(dataURL, rendererType, link, fileName);
1823
- const e = document.createEvent('MouseEvents');
1824
- e.initEvent('click', false, false);
1825
- link.dispatchEvent(e);
1826
- });
958
+ * <zh/> 获取元素渲染样式
959
+ *
960
+ * <en/> Get element rendering style
961
+ * @param id - <zh/> 元素 ID | <en/> element ID
962
+ * @returns <zh/> 元素渲染样式 | <en/> element rendering style
963
+ * @apiCategory element
964
+ */
965
+ getElementRenderStyle(id) {
966
+ return omit(this.context.element.getElement(id).attributes, ['context']);
1827
967
  }
1828
- /**
1829
- * Initiates the download of the entire graph as an image with optional name, type, and padding configuration.
1830
- * @param name The desired name for the downloaded image file (optional).
1831
- * @param type The type of the image to download (optional, defaults to 'image/png').
1832
- * @param imageConfig Configuration options for the image (optional).
1833
- */
1834
- downloadFullImage(name, type, imageConfig) {
1835
- const self = this;
1836
- const rendererType = this.rendererType;
1837
- if (!type)
1838
- type = 'image/png';
1839
- const fileName = (name || 'graph') +
1840
- (rendererType === 'svg' ? '.svg' : type.split('/')[1]);
1841
- const link = document.createElement('a');
1842
- self.asyncToFullDataUrl(type, imageConfig, (dataURL) => {
1843
- this.dataURLToImage(dataURL, rendererType, link, fileName);
1844
- const e = document.createEvent('MouseEvents');
1845
- e.initEvent('click', false, false);
1846
- link.dispatchEvent(e);
968
+ async setElementVisibility(args1, args2, args3 = true) {
969
+ const [config, animation] = isObject(args1)
970
+ ? [args1, args2 ?? true]
971
+ : [{ [args1]: args2 }, args3];
972
+ const dataToUpdate = { nodes: [], edges: [], combos: [] };
973
+ Object.entries(config).forEach(([id, value]) => {
974
+ const elementType = this.getElementType(id);
975
+ dataToUpdate[`${elementType}s`].push({ id, style: { visibility: value } });
1847
976
  });
977
+ const { model, element } = this.context;
978
+ model.preventUpdateNodeLikeHierarchy(() => {
979
+ model.updateData(dataToUpdate);
980
+ });
981
+ await element.draw({ animation, stage: 'visibility' })?.finished;
1848
982
  }
1849
983
  /**
1850
- * Asynchronously converts the canvas content to a Data URL of the specified type and invokes the provided callback.
1851
- * @param type The type of the Data URL (optional, defaults to 'image/png').
1852
- * @param callback A callback function to handle the Data URL (optional).
1853
- */
1854
- asyncToDataUrl(type, callback) {
1855
- let dataURL = '';
1856
- if (!type)
1857
- type = 'image/png';
1858
- setTimeout(() => __awaiter(this, void 0, void 0, function* () {
1859
- yield this.toDataURL(type).then((url) => {
1860
- dataURL = url;
1861
- });
1862
- if (callback)
1863
- callback(dataURL);
1864
- }), 16);
1865
- }
1866
- /**
1867
- * Asynchronously converts the entire canvas content to a Data URL of the specified type
1868
- * with optional padding, and invokes the provided callback.
1869
- * @param type The type of the Data URL (optional, defaults to 'image/png').
1870
- * @param imageConfig Configuration options for the image (optional).
1871
- * @param callback A callback function to handle the Data URL (optional).
1872
- */
1873
- asyncToFullDataUrl(type, imageConfig, callback) {
1874
- let dataURL = '';
1875
- if (!type)
1876
- type = 'image/png';
1877
- setTimeout(() => __awaiter(this, void 0, void 0, function* () {
1878
- yield this.toFullDataURL(type, imageConfig).then((url) => {
1879
- dataURL = url;
1880
- });
1881
- if (callback)
1882
- callback(dataURL);
1883
- }), 16);
1884
- }
1885
- // ===== history operations =====
1886
- /**
1887
- * Determine if history (redo/undo) is enabled.
984
+ * <zh/> 显示元素
985
+ *
986
+ * <en/> Show element
987
+ * @param id - <zh/> 元素 ID | <en/> element ID
988
+ * @param animation - <zh/> 是否启用动画 | <en/> whether to enable animation
989
+ * @apiCategory element
1888
990
  */
1889
- isHistoryEnabled() {
1890
- const history = this.getHistoryPlugin();
1891
- return history === null || history === void 0 ? void 0 : history.isEnable();
991
+ async showElement(id, animation) {
992
+ const ids = Array.isArray(id) ? id : [id];
993
+ await this.setElementVisibility(Object.fromEntries(ids.map((_id) => [_id, 'visible'])), animation);
1892
994
  }
1893
995
  /**
1894
- * Push the operation(s) onto the specified stack
1895
- * @param cmd commands to be pushed
1896
- * @param stackType undo/redo stack
1897
- * @param isNew
996
+ * <zh/> 隐藏元素
997
+ *
998
+ * <en/> Hide element
999
+ * @param id - <zh/> 元素 ID | <en/> element ID
1000
+ * @param animation - <zh/> 是否启用动画 | <en/> whether to enable animation
1001
+ * @apiCategory element
1898
1002
  */
1899
- pushStack(cmd, stackType, isNew) {
1900
- const history = this.getHistoryPlugin();
1901
- return history === null || history === void 0 ? void 0 : history.push(cmd, stackType, isNew);
1003
+ async hideElement(id, animation) {
1004
+ const ids = Array.isArray(id) ? id : [id];
1005
+ await this.setElementVisibility(Object.fromEntries(ids.map((_id) => [_id, 'hidden'])), animation);
1902
1006
  }
1903
1007
  /**
1904
- * Pause stacking operation.
1008
+ * <zh/> 获取元素可见性
1009
+ *
1010
+ * <en/> Get element visibility
1011
+ * @param id - <zh/> 元素 ID | <en/> element ID
1012
+ * @returns <zh/> 元素可见性 | <en/> element visibility
1013
+ * @apiCategory element
1905
1014
  */
1906
- pauseStack() {
1907
- const history = this.getHistoryPlugin();
1908
- return history === null || history === void 0 ? void 0 : history.pauseStack();
1015
+ getElementVisibility(id) {
1016
+ const element = this.context.element.getElement(id);
1017
+ return element?.style?.visibility ?? 'visible';
1909
1018
  }
1910
- /**
1911
- * Resume stacking operation.
1912
- */
1913
- resumeStack() {
1914
- const history = this.getHistoryPlugin();
1915
- return history === null || history === void 0 ? void 0 : history.resumeStack();
1019
+ async setElementZIndex(args1, args2) {
1020
+ const dataToUpdate = { nodes: [], edges: [], combos: [] };
1021
+ const config = isObject(args1) ? args1 : { [args1]: args2 };
1022
+ Object.entries(config).forEach(([id, value]) => {
1023
+ const elementType = this.getElementType(id);
1024
+ dataToUpdate[`${elementType}s`].push({ id, style: { zIndex: value } });
1025
+ });
1026
+ const { model, element } = this.context;
1027
+ model.preventUpdateNodeLikeHierarchy(() => model.updateData(dataToUpdate));
1028
+ await element.draw({ animation: false })?.finished;
1916
1029
  }
1917
1030
  /**
1918
- * Retrieve the current redo stack which consists of operations that could be undone
1919
- */
1920
- getUndoStack() {
1921
- const history = this.getHistoryPlugin();
1922
- return history === null || history === void 0 ? void 0 : history.getUndoStack();
1031
+ * <zh/> 将元素置于最顶层
1032
+ *
1033
+ * <en/> Bring the element to the front
1034
+ * @param id - <zh/> 元素 ID | <en/> element ID
1035
+ * @apiCategory element
1036
+ */
1037
+ async frontElement(id) {
1038
+ const ids = Array.isArray(id) ? id : [id];
1039
+ const { model } = this.context;
1040
+ const config = {};
1041
+ ids.map((_id) => {
1042
+ const zIndex = model.getFrontZIndex(_id);
1043
+ const elementType = model.getElementType(_id);
1044
+ if (elementType === 'combo') {
1045
+ const ancestor = model.getAncestorsData(_id, COMBO_KEY).at(-1) || this.getComboData(_id);
1046
+ const combos = [ancestor, ...model.getDescendantsData(idOf(ancestor))].filter((datum) => model.isCombo(idOf(datum)));
1047
+ const delta = zIndex - zIndexOf(ancestor);
1048
+ combos.forEach((combo) => {
1049
+ config[idOf(combo)] = zIndexOf(combo) + delta;
1050
+ });
1051
+ }
1052
+ else
1053
+ config[_id] = zIndex;
1054
+ });
1055
+ await this.setElementZIndex(config);
1923
1056
  }
1924
1057
  /**
1925
- * Retrieve the current undo stack which consists of operations that were undone
1926
- */
1927
- getRedoStack() {
1928
- const history = this.getHistoryPlugin();
1929
- return history === null || history === void 0 ? void 0 : history.getRedoStack();
1058
+ * <zh/> 获取元素层级
1059
+ *
1060
+ * <en/> Get element z-index
1061
+ * @param id - <zh/> 元素 ID | <en/> element ID
1062
+ * @returns <zh/> 元素层级 | <en/> element z-index
1063
+ * @apiCategory element
1064
+ */
1065
+ getElementZIndex(id) {
1066
+ return zIndexOf(this.context.model.getElementDataById(id));
1067
+ }
1068
+ async setElementState(args1, args2, args3 = true) {
1069
+ const [config, animation] = isObject(args1)
1070
+ ? [args1, args2 ?? true]
1071
+ : [{ [args1]: args2 }, args3];
1072
+ const parseState = (state) => {
1073
+ if (!state)
1074
+ return [];
1075
+ return Array.isArray(state) ? state : [state];
1076
+ };
1077
+ const dataToUpdate = { nodes: [], edges: [], combos: [] };
1078
+ Object.entries(config).forEach(([id, value]) => {
1079
+ const elementType = this.getElementType(id);
1080
+ dataToUpdate[`${elementType}s`].push({ id, states: parseState(value) });
1081
+ });
1082
+ this.updateData(dataToUpdate);
1083
+ await this.context.element.draw({ animation })?.finished;
1930
1084
  }
1931
1085
  /**
1932
- * Retrieve the complete history stack
1933
- * @returns
1086
+ * <zh/> 获取元素状态
1087
+ *
1088
+ * <en/> Get element state
1089
+ * @param id - <zh/> 元素 ID | <en/> element ID
1090
+ * @returns <zh/> 元素状态 | <en/> element state
1091
+ * @apiCategory element
1934
1092
  */
1935
- getStack() {
1936
- const history = this.getHistoryPlugin();
1937
- return history === null || history === void 0 ? void 0 : history.getStack();
1093
+ getElementState(id) {
1094
+ return this.context.model.getElementState(id);
1938
1095
  }
1939
1096
  /**
1940
- * Restore n operations that were last n reverted on the graph.
1941
- * @param steps The number of operations to undo. Default to 1.
1942
- * @returns
1097
+ * <zh/> 获取元素自身以及子节点在世界坐标系下的渲染包围盒
1098
+ *
1099
+ * <en/> Get the rendering bounding box of the element itself and its child nodes in the world coordinate system
1100
+ * @param id - <zh/> 元素 ID | <en/> element ID
1101
+ * @returns <zh/> 渲染包围盒 | <en/> render bounding box
1102
+ * @apiCategory element
1943
1103
  */
1944
- undo() {
1945
- const history = this.getHistoryPlugin();
1946
- history === null || history === void 0 ? void 0 : history.undo();
1104
+ getElementRenderBounds(id) {
1105
+ return this.context.element.getElement(id).getRenderBounds();
1947
1106
  }
1107
+ isCollapsingExpanding = false;
1948
1108
  /**
1949
- * Revert recent n operation(s) performed on the graph.
1950
- * @param steps The number of operations to redo. Default to 1.
1951
- * @returns
1952
- */
1953
- redo() {
1954
- const history = this.getHistoryPlugin();
1955
- history === null || history === void 0 ? void 0 : history.redo();
1109
+ * <zh/> 收起 Combo
1110
+ *
1111
+ * <en/> Collapse Combo
1112
+ * @param id - <zh/> 元素 ID | <en/> element ID
1113
+ * @param animation - <zh/> 是否启用动画 | <en/> whether to enable animation
1114
+ * @apiCategory element
1115
+ */
1116
+ async collapseElement(id, animation = true) {
1117
+ const { model, element } = this.context;
1118
+ if (isCollapsed(model.getNodeLikeData([id])[0]))
1119
+ return;
1120
+ if (this.isCollapsingExpanding)
1121
+ return;
1122
+ const elementType = model.getElementType(id);
1123
+ this.isCollapsingExpanding = true;
1124
+ this.setElementCollapsibility(id, true);
1125
+ if (elementType === 'node')
1126
+ await element.collapseNode(id, animation);
1127
+ else if (elementType === 'combo')
1128
+ await element.collapseCombo(id, animation);
1129
+ this.isCollapsingExpanding = false;
1956
1130
  }
1957
1131
  /**
1958
- * Indicate whether there are any actions available in the undo stack.
1132
+ * <zh/> 展开 Combo
1133
+ *
1134
+ * <en/> Expand Combo
1135
+ * @param id - <zh/> 元素 ID | <en/> element ID
1136
+ * @param animation - <zh/> 是否启用动画 | <en/> whether to enable animation
1137
+ * @apiCategory element
1138
+ */
1139
+ async expandElement(id, animation = true) {
1140
+ const { model, element } = this.context;
1141
+ if (!isCollapsed(model.getNodeLikeData([id])[0]))
1142
+ return;
1143
+ if (this.isCollapsingExpanding)
1144
+ return;
1145
+ const elementType = model.getElementType(id);
1146
+ this.isCollapsingExpanding = true;
1147
+ this.setElementCollapsibility(id, false);
1148
+ if (elementType === 'node')
1149
+ await element.expandNode(id, animation);
1150
+ else if (elementType === 'combo')
1151
+ await element.expandCombo(id, animation);
1152
+ this.isCollapsingExpanding = false;
1153
+ }
1154
+ setElementCollapsibility(id, collapsed) {
1155
+ const elementType = this.getElementType(id);
1156
+ if (elementType === 'node')
1157
+ this.updateNodeData([{ id, style: { collapsed } }]);
1158
+ else if (elementType === 'combo')
1159
+ this.updateComboData([{ id, style: { collapsed } }]);
1160
+ }
1161
+ /**
1162
+ * <zh/> 导出画布内容为 DataURL
1163
+ *
1164
+ * <en/> Export canvas content as DataURL
1165
+ * @param options - <zh/> 导出配置 | <en/> export configuration
1166
+ * @returns <zh/> DataURL | <en/> DataURL
1167
+ * @apiCategory exportImage
1959
1168
  */
1960
- canUndo() {
1961
- const history = this.getHistoryPlugin();
1962
- return history === null || history === void 0 ? void 0 : history.canUndo();
1169
+ async toDataURL(options = {}) {
1170
+ return this.context.canvas.toDataURL(options);
1963
1171
  }
1964
1172
  /**
1965
- * Indicate whether there are any actions available in the redo stack.
1173
+ * <zh/> 给定的视窗 DOM 坐标,转换为画布上的绘制坐标
1174
+ *
1175
+ * <en/> Convert the given viewport DOM coordinates to the drawing coordinates on the canvas
1176
+ * @param point - <zh/> 视窗坐标 | <en/> viewport coordinates
1177
+ * @returns <zh/> 画布上的绘制坐标 | <en/> drawing coordinates on the canvas
1178
+ * @apiCategory viewport
1966
1179
  */
1967
- canRedo() {
1968
- const history = this.getHistoryPlugin();
1969
- return history === null || history === void 0 ? void 0 : history.canRedo();
1180
+ getCanvasByViewport(point) {
1181
+ return parsePoint(this.context.canvas.viewport2Canvas(toPointObject(point)));
1970
1182
  }
1971
1183
  /**
1972
- * Begin a historyBatch operation.
1973
- * Any operations performed between `startHistoryBatch` and `stopHistoryBatch` are grouped together.
1974
- * treated as a single operation when undoing or redoing.
1184
+ * <zh/> 给定画布上的绘制坐标,转换为视窗 DOM 的坐标
1185
+ *
1186
+ * <en/> Convert the given drawing coordinates on the canvas to the coordinates of the viewport DOM
1187
+ * @param point - <zh/> 画布坐标 | <en/> canvas coordinates
1188
+ * @returns <zh/> 视窗 DOM 的坐标 | <en/> coordinates of the viewport DOM
1189
+ * @apiCategory viewport
1975
1190
  */
1976
- startHistoryBatch() {
1977
- const history = this.getHistoryPlugin();
1978
- history === null || history === void 0 ? void 0 : history.startHistoryBatch();
1191
+ getViewportByCanvas(point) {
1192
+ return parsePoint(this.context.canvas.canvas2Viewport(toPointObject(point)));
1979
1193
  }
1980
1194
  /**
1981
- * End a historyBatch operation.
1982
- * Any operations performed between `startHistoryBatch` and `stopHistoryBatch` are grouped together.
1983
- * treated as a single operation when undoing or redoing.
1195
+ * <zh/> 给定画布上的绘制坐标,转换为浏览器坐标
1196
+ *
1197
+ * <en/> Convert the given drawing coordinates on the canvas to browser coordinates
1198
+ * @param point - <zh/> 画布坐标 | <en/> canvas coordinates
1199
+ * @returns <zh/> 浏览器坐标 | <en/> browser coordinates
1200
+ * @apiCategory viewport
1984
1201
  */
1985
- stopHistoryBatch() {
1986
- const history = this.getHistoryPlugin();
1987
- history === null || history === void 0 ? void 0 : history.stopHistoryBatch();
1202
+ getClientByCanvas(point) {
1203
+ const viewportPoint = this.context.canvas.canvas2Viewport(toPointObject(point));
1204
+ return parsePoint(this.context.canvas.viewport2Canvas(viewportPoint));
1988
1205
  }
1989
1206
  /**
1990
- * Execute a provided function within a batched context
1991
- * All operations performed inside callback will be treated as a composite operation
1992
- * more convenient way without manually invoking `startHistoryBatch` and `stopHistoryBatch`.
1993
- * @param callback The func containing operations to be batched together.
1207
+ * <zh/> 给定的浏览器坐标,转换为画布上的绘制坐标
1208
+ *
1209
+ * <en/> Convert the given browser coordinates to drawing coordinates on the canvas
1210
+ * @param point - <zh/> 浏览器坐标 | <en/> browser coordinates
1211
+ * @returns <zh/> 画布上的绘制坐标 | <en/> drawing coordinates on the canvas
1212
+ * @apiCategory viewport
1994
1213
  */
1995
- historyBatch(callback) {
1996
- const history = this.getHistoryPlugin();
1997
- history === null || history === void 0 ? void 0 : history.historyBatch(callback);
1214
+ getCanvasByClient(point) {
1215
+ const viewportPoint = this.context.canvas.client2Viewport(toPointObject(point));
1216
+ return parsePoint(this.context.canvas.viewport2Canvas(viewportPoint));
1998
1217
  }
1999
1218
  /**
2000
- * Clear history stack
2001
- * @param {StackType} stackType undo/redo stack
1219
+ * <zh/> 获取视口中心的画布坐标
1220
+ *
1221
+ * <en/> Get the canvas coordinates of the viewport center
1222
+ * @returns <zh/> 视口中心的画布坐标 | <en/> Canvas coordinates of the viewport center
1223
+ * @apiCategory viewport
2002
1224
  */
2003
- cleanHistory(stackType) {
2004
- const history = this.getHistoryPlugin();
2005
- if (!stackType)
2006
- return history === null || history === void 0 ? void 0 : history.clear();
2007
- return stackType === 'undo'
2008
- ? history === null || history === void 0 ? void 0 : history.clearUndoStack()
2009
- : history === null || history === void 0 ? void 0 : history.clearRedoStack();
1225
+ getViewportCenter() {
1226
+ return this.context.viewport.getViewportCenter();
2010
1227
  }
2011
1228
  /**
2012
- * Collapse sub tree(s).
2013
- * @param ids Root id(s) of the sub trees.
2014
- * @param disableAnimate Whether disable the animations for this operation.
2015
- * @param stack Whether push this operation to stack.
2016
- * @returns
2017
- * @group Tree
1229
+ * <zh/> 获取画布中心的画布坐标
1230
+ *
1231
+ * <en/> Get the canvas coordinates of the canvas center
1232
+ * @returns <zh/> 画布中心的画布坐标 | <en/> Canvas coordinates of the canvas center
1233
+ * @apiCategory viewport
2018
1234
  */
2019
- collapse(ids, disableAnimate = false, stack) {
2020
- this.hooks.treecollapseexpand.emit({
2021
- ids: isArray(ids) ? ids : [ids],
2022
- action: 'collapse',
2023
- animate: !disableAnimate,
2024
- graphCore: this.dataController.graphCore,
2025
- });
1235
+ getCanvasCenter() {
1236
+ return this.context.viewport.getCanvasCenter();
2026
1237
  }
1238
+ onResize = debounce(() => {
1239
+ this.resize();
1240
+ }, 300);
2027
1241
  /**
2028
- * Expand sub tree(s).
2029
- * @param ids Root id(s) of the sub trees.
2030
- * @param disableAnimate Whether disable the animations for this operation.
2031
- * @param stack Whether push this operation to stack.
2032
- * @returns
2033
- * @group Tree
1242
+ * <zh/> 监听事件
1243
+ *
1244
+ * <en/> Listen to events
1245
+ * @param eventName - <zh/> 事件名称 | <en/> event name
1246
+ * @param callback - <zh/> 回调函数 | <en/> callback function
1247
+ * @returns <zh/> Graph 实例 | <en/> Graph instance
1248
+ * @apiCategory event
2034
1249
  */
2035
- expand(ids, disableAnimate = false, stack) {
2036
- this.hooks.treecollapseexpand.emit({
2037
- ids: isArray(ids) ? ids : [ids],
2038
- action: 'expand',
2039
- animate: !disableAnimate,
2040
- graphCore: this.dataController.graphCore,
2041
- });
1250
+ on(eventName, callback) {
1251
+ return super.on(eventName, callback);
2042
1252
  }
2043
1253
  /**
2044
- * Destroy the graph instance and remove the related canvases.
2045
- * @returns
2046
- * @group Graph Instance
2047
- */
2048
- destroy(callback) {
2049
- // TODO: call the destroy functions after items' buildOut animations finished
2050
- // setTimeout(() => {
2051
- this.canvas.destroy();
2052
- this.backgroundCanvas.destroy();
2053
- this.transientCanvas.destroy();
2054
- // clear history stack
2055
- this.cleanHistory();
2056
- callback === null || callback === void 0 ? void 0 : callback();
2057
- // }, 500);
2058
- this.hooks.destroy.emit({});
2059
- // TODO: destroy controllers and off the listeners
2060
- // this.dataController.destroy();
2061
- // this.interactionController.destroy();
2062
- // this.layoutController.destroy();
2063
- // this.themeController.destroy();
2064
- // this.itemController.destroy();
2065
- // this.extensionController.destroy();
2066
- this.destroyed = true;
1254
+ * <zh/> 一次性监听事件
1255
+ *
1256
+ * <en/> Listen to events once
1257
+ * @param eventName - <zh/> 事件名称 | <en/> event name
1258
+ * @param callback - <zh/> 回调函数 | <en/> callback function
1259
+ * @returns <zh/> Graph 实例 | <en/> Graph instance
1260
+ * @apiCategory event
1261
+ */
1262
+ once(eventName, callback) {
1263
+ return super.once(eventName, callback);
2067
1264
  }
2068
1265
  }
2069
1266
  //# sourceMappingURL=graph.js.map