@antv/g6 5.0.0-beta.3 → 5.0.0-beta.31

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