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

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