@antv/g6 5.0.0-beta.28 → 5.0.0-beta.29

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