@antv/g6 4.8.14 → 5.0.0-alpha.2

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 (595) hide show
  1. package/dist/g6.min.js +19 -3
  2. package/esm/constant/index.d.ts +1 -0
  3. package/esm/constant/index.js +2 -0
  4. package/esm/constant/index.js.map +1 -0
  5. package/esm/constant/shape.d.ts +27 -0
  6. package/esm/constant/shape.js +26 -0
  7. package/esm/constant/shape.js.map +1 -0
  8. package/esm/index.d.ts +124 -0
  9. package/esm/index.js +11 -0
  10. package/esm/index.js.map +1 -0
  11. package/esm/item/combo.d.ts +4 -0
  12. package/esm/item/combo.js +4 -0
  13. package/esm/item/combo.js.map +1 -0
  14. package/esm/item/edge.d.ts +54 -0
  15. package/esm/item/edge.js +113 -0
  16. package/esm/item/edge.js.map +1 -0
  17. package/esm/item/item.d.ts +189 -0
  18. package/esm/item/item.js +636 -0
  19. package/esm/item/item.js.map +1 -0
  20. package/esm/item/node.d.ts +54 -0
  21. package/esm/item/node.js +170 -0
  22. package/esm/item/node.js.map +1 -0
  23. package/esm/runtime/controller/data.d.ts +65 -0
  24. package/esm/runtime/controller/data.js +489 -0
  25. package/esm/runtime/controller/data.js.map +1 -0
  26. package/esm/runtime/controller/extension.d.ts +9 -0
  27. package/esm/runtime/controller/extension.js +11 -0
  28. package/esm/runtime/controller/extension.js.map +1 -0
  29. package/esm/runtime/controller/index.d.ts +7 -0
  30. package/esm/runtime/controller/index.js +8 -0
  31. package/esm/runtime/controller/index.js.map +1 -0
  32. package/esm/runtime/controller/interaction.d.ts +51 -0
  33. package/esm/runtime/controller/interaction.js +259 -0
  34. package/esm/runtime/controller/interaction.js.map +1 -0
  35. package/esm/runtime/controller/item.d.ts +101 -0
  36. package/esm/runtime/controller/item.js +537 -0
  37. package/esm/runtime/controller/item.js.map +1 -0
  38. package/esm/runtime/controller/layout.d.ts +30 -0
  39. package/esm/runtime/controller/layout.js +204 -0
  40. package/esm/runtime/controller/layout.js.map +1 -0
  41. package/esm/runtime/controller/plugin.d.ts +34 -0
  42. package/esm/runtime/controller/plugin.js +140 -0
  43. package/esm/runtime/controller/plugin.js.map +1 -0
  44. package/esm/runtime/controller/theme.d.ts +29 -0
  45. package/esm/runtime/controller/theme.js +54 -0
  46. package/esm/runtime/controller/theme.js.map +1 -0
  47. package/esm/runtime/controller/viewport.d.ts +11 -0
  48. package/esm/runtime/controller/viewport.js +102 -0
  49. package/esm/runtime/controller/viewport.js.map +1 -0
  50. package/esm/runtime/graph.d.ts +462 -0
  51. package/esm/runtime/graph.js +1077 -0
  52. package/esm/runtime/graph.js.map +1 -0
  53. package/esm/runtime/hooks.d.ts +33 -0
  54. package/esm/runtime/hooks.js +74 -0
  55. package/esm/runtime/hooks.js.map +1 -0
  56. package/esm/stdlib/behavior/activate-relations.d.ts +62 -0
  57. package/esm/stdlib/behavior/activate-relations.js +81 -0
  58. package/esm/stdlib/behavior/activate-relations.js.map +1 -0
  59. package/esm/stdlib/behavior/brush-select.d.ts +110 -0
  60. package/esm/stdlib/behavior/brush-select.js +268 -0
  61. package/esm/stdlib/behavior/brush-select.js.map +1 -0
  62. package/esm/stdlib/behavior/click-select.d.ts +71 -0
  63. package/esm/stdlib/behavior/click-select.js +143 -0
  64. package/esm/stdlib/behavior/click-select.js.map +1 -0
  65. package/esm/stdlib/behavior/drag-canvas.d.ts +82 -0
  66. package/esm/stdlib/behavior/drag-canvas.js +246 -0
  67. package/esm/stdlib/behavior/drag-canvas.js.map +1 -0
  68. package/esm/stdlib/behavior/drag-node.d.ts +80 -0
  69. package/esm/stdlib/behavior/drag-node.js +250 -0
  70. package/esm/stdlib/behavior/drag-node.js.map +1 -0
  71. package/esm/stdlib/behavior/hover-activate.d.ts +41 -0
  72. package/esm/stdlib/behavior/hover-activate.js +63 -0
  73. package/esm/stdlib/behavior/hover-activate.js.map +1 -0
  74. package/esm/stdlib/behavior/lasso-select.d.ts +27 -0
  75. package/esm/stdlib/behavior/lasso-select.js +79 -0
  76. package/esm/stdlib/behavior/lasso-select.js.map +1 -0
  77. package/esm/stdlib/behavior/orbit-canvas-3d.d.ts +37 -0
  78. package/esm/stdlib/behavior/orbit-canvas-3d.js +62 -0
  79. package/esm/stdlib/behavior/orbit-canvas-3d.js.map +1 -0
  80. package/esm/stdlib/behavior/rotate-canvas-3d.d.ts +61 -0
  81. package/esm/stdlib/behavior/rotate-canvas-3d.js +123 -0
  82. package/esm/stdlib/behavior/rotate-canvas-3d.js.map +1 -0
  83. package/esm/stdlib/behavior/track-canvas-3d.d.ts +37 -0
  84. package/esm/stdlib/behavior/track-canvas-3d.js +62 -0
  85. package/esm/stdlib/behavior/track-canvas-3d.js.map +1 -0
  86. package/esm/stdlib/behavior/zoom-canvas-3d.d.ts +51 -0
  87. package/esm/stdlib/behavior/zoom-canvas-3d.js +74 -0
  88. package/esm/stdlib/behavior/zoom-canvas-3d.js.map +1 -0
  89. package/esm/stdlib/behavior/zoom-canvas.d.ts +61 -0
  90. package/esm/stdlib/behavior/zoom-canvas.js +160 -0
  91. package/esm/stdlib/behavior/zoom-canvas.js.map +1 -0
  92. package/esm/stdlib/data/comboFromNode.d.ts +9 -0
  93. package/esm/stdlib/data/comboFromNode.js +28 -0
  94. package/esm/stdlib/data/comboFromNode.js.map +1 -0
  95. package/esm/stdlib/index.d.ts +80 -0
  96. package/esm/stdlib/index.js +82 -0
  97. package/esm/stdlib/index.js.map +1 -0
  98. package/esm/stdlib/item/edge/base.d.ts +111 -0
  99. package/esm/stdlib/item/edge/base.js +341 -0
  100. package/esm/stdlib/item/edge/base.js.map +1 -0
  101. package/esm/stdlib/item/edge/index.d.ts +1 -0
  102. package/esm/stdlib/item/edge/index.js +2 -0
  103. package/esm/stdlib/item/edge/index.js.map +1 -0
  104. package/esm/stdlib/item/edge/line.d.ts +33 -0
  105. package/esm/stdlib/item/edge/line.js +45 -0
  106. package/esm/stdlib/item/edge/line.js.map +1 -0
  107. package/esm/stdlib/item/node/base.d.ts +137 -0
  108. package/esm/stdlib/item/node/base.js +414 -0
  109. package/esm/stdlib/item/node/base.js.map +1 -0
  110. package/esm/stdlib/item/node/base3d.d.ts +72 -0
  111. package/esm/stdlib/item/node/base3d.js +113 -0
  112. package/esm/stdlib/item/node/base3d.js.map +1 -0
  113. package/esm/stdlib/item/node/circle.d.ts +30 -0
  114. package/esm/stdlib/item/node/circle.js +56 -0
  115. package/esm/stdlib/item/node/circle.js.map +1 -0
  116. package/esm/stdlib/item/node/index.d.ts +2 -0
  117. package/esm/stdlib/item/node/index.js +3 -0
  118. package/esm/stdlib/item/node/index.js.map +1 -0
  119. package/esm/stdlib/item/node/sphere.d.ts +33 -0
  120. package/esm/stdlib/item/node/sphere.js +52 -0
  121. package/esm/stdlib/item/node/sphere.js.map +1 -0
  122. package/esm/stdlib/plugin/legend/index.d.ts +121 -0
  123. package/esm/stdlib/plugin/legend/index.js +587 -0
  124. package/esm/stdlib/plugin/legend/index.js.map +1 -0
  125. package/esm/stdlib/plugin/minimap/index.d.ts +106 -0
  126. package/esm/stdlib/plugin/minimap/index.js +578 -0
  127. package/esm/stdlib/plugin/minimap/index.js.map +1 -0
  128. package/esm/stdlib/selector/lasso.d.ts +15 -0
  129. package/esm/stdlib/selector/lasso.js +61 -0
  130. package/esm/stdlib/selector/lasso.js.map +1 -0
  131. package/esm/stdlib/selector/rect.d.ts +16 -0
  132. package/esm/stdlib/selector/rect.js +54 -0
  133. package/esm/stdlib/selector/rect.js.map +1 -0
  134. package/esm/stdlib/theme/dark.d.ts +3 -0
  135. package/esm/stdlib/theme/dark.js +279 -0
  136. package/esm/stdlib/theme/dark.js.map +1 -0
  137. package/esm/stdlib/theme/light.d.ts +3 -0
  138. package/esm/stdlib/theme/light.js +274 -0
  139. package/esm/stdlib/theme/light.js.map +1 -0
  140. package/esm/stdlib/themeSolver/base.d.ts +15 -0
  141. package/esm/stdlib/themeSolver/base.js +11 -0
  142. package/esm/stdlib/themeSolver/base.js.map +1 -0
  143. package/esm/stdlib/themeSolver/spec.d.ts +37 -0
  144. package/esm/stdlib/themeSolver/spec.js +66 -0
  145. package/esm/stdlib/themeSolver/spec.js.map +1 -0
  146. package/esm/stdlib/themeSolver/subject.d.ts +43 -0
  147. package/esm/stdlib/themeSolver/subject.js +396 -0
  148. package/esm/stdlib/themeSolver/subject.js.map +1 -0
  149. package/esm/types/animate.d.ts +59 -0
  150. package/esm/types/animate.js +2 -0
  151. package/esm/types/animate.js.map +1 -0
  152. package/esm/types/behavior.d.ts +45 -0
  153. package/esm/types/behavior.js +14 -0
  154. package/esm/types/behavior.js.map +1 -0
  155. package/esm/types/combo.d.ts +87 -0
  156. package/esm/types/combo.js +2 -0
  157. package/esm/types/combo.js.map +1 -0
  158. package/esm/types/common.d.ts +6 -0
  159. package/esm/types/common.js +2 -0
  160. package/esm/types/common.js.map +1 -0
  161. package/esm/types/data.d.ts +21 -0
  162. package/esm/types/data.js +2 -0
  163. package/esm/types/data.js.map +1 -0
  164. package/esm/types/edge.d.ts +100 -0
  165. package/esm/types/edge.js +2 -0
  166. package/esm/types/edge.js.map +1 -0
  167. package/esm/types/event.d.ts +30 -0
  168. package/esm/types/event.js +31 -0
  169. package/esm/types/event.js.map +1 -0
  170. package/esm/types/graph.d.ts +445 -0
  171. package/esm/types/graph.js +2 -0
  172. package/esm/types/graph.js.map +1 -0
  173. package/esm/types/hook.d.ts +97 -0
  174. package/esm/types/hook.js +2 -0
  175. package/esm/types/hook.js.map +1 -0
  176. package/esm/types/index.d.ts +10 -0
  177. package/esm/types/index.js +2 -0
  178. package/esm/types/index.js.map +1 -0
  179. package/esm/types/item.d.ts +229 -0
  180. package/esm/types/item.js +16 -0
  181. package/esm/types/item.js.map +1 -0
  182. package/esm/types/layout.d.ts +69 -0
  183. package/esm/types/layout.js +20 -0
  184. package/esm/types/layout.js.map +1 -0
  185. package/esm/types/node.d.ts +134 -0
  186. package/esm/types/node.js +2 -0
  187. package/esm/types/node.js.map +1 -0
  188. package/esm/types/plugin.d.ts +40 -0
  189. package/esm/types/plugin.js +53 -0
  190. package/esm/types/plugin.js.map +1 -0
  191. package/esm/types/render.d.ts +1 -0
  192. package/esm/types/render.js +2 -0
  193. package/esm/types/render.js.map +1 -0
  194. package/esm/types/spec.d.ts +65 -0
  195. package/esm/types/spec.js +2 -0
  196. package/esm/types/spec.js.map +1 -0
  197. package/esm/types/stdlib.d.ts +13 -0
  198. package/esm/types/stdlib.js +2 -0
  199. package/esm/types/stdlib.js.map +1 -0
  200. package/esm/types/theme.d.ts +102 -0
  201. package/esm/types/theme.js +15 -0
  202. package/esm/types/theme.js.map +1 -0
  203. package/esm/types/view.d.ts +23 -0
  204. package/esm/types/view.js +2 -0
  205. package/esm/types/view.js.map +1 -0
  206. package/esm/util/animate.d.ts +101 -0
  207. package/esm/util/animate.js +350 -0
  208. package/esm/util/animate.js.map +1 -0
  209. package/esm/util/array.d.ts +20 -0
  210. package/esm/util/array.js +60 -0
  211. package/esm/util/array.js.map +1 -0
  212. package/esm/util/canvas.d.ts +20 -0
  213. package/esm/util/canvas.js +81 -0
  214. package/esm/util/canvas.js.map +1 -0
  215. package/esm/util/event.d.ts +12 -0
  216. package/esm/util/event.js +26 -0
  217. package/esm/util/event.js.map +1 -0
  218. package/esm/util/extend.d.ts +21 -0
  219. package/esm/util/extend.js +22 -0
  220. package/esm/util/extend.js.map +1 -0
  221. package/esm/util/extension.d.ts +10 -0
  222. package/esm/util/extension.js +24 -0
  223. package/esm/util/extension.js.map +1 -0
  224. package/esm/util/index.d.ts +14 -0
  225. package/esm/util/index.js +5 -0
  226. package/esm/util/index.js.map +1 -0
  227. package/esm/util/item.d.ts +14 -0
  228. package/esm/util/item.js +42 -0
  229. package/esm/util/item.js.map +1 -0
  230. package/esm/util/mapper.d.ts +17 -0
  231. package/esm/util/mapper.js +60 -0
  232. package/esm/util/mapper.js.map +1 -0
  233. package/esm/util/math.d.ts +8 -0
  234. package/esm/util/math.js +9 -0
  235. package/esm/util/math.js.map +1 -0
  236. package/esm/util/point.d.ts +61 -0
  237. package/esm/util/point.js +160 -0
  238. package/esm/util/point.js.map +1 -0
  239. package/esm/util/shape.d.ts +105 -0
  240. package/esm/util/shape.js +504 -0
  241. package/esm/util/shape.js.map +1 -0
  242. package/esm/util/shape3d.d.ts +23 -0
  243. package/esm/util/shape3d.js +147 -0
  244. package/esm/util/shape3d.js.map +1 -0
  245. package/esm/util/text.d.ts +18 -0
  246. package/esm/util/text.js +36 -0
  247. package/esm/util/text.js.map +1 -0
  248. package/esm/util/type.d.ts +2 -0
  249. package/esm/util/type.js +2 -0
  250. package/esm/util/type.js.map +1 -0
  251. package/esm/util/zoom.d.ts +17 -0
  252. package/esm/util/zoom.js +36 -0
  253. package/esm/util/zoom.js.map +1 -0
  254. package/lib/constant/index.d.ts +1 -0
  255. package/lib/constant/index.js +18 -0
  256. package/lib/constant/index.js.map +1 -0
  257. package/lib/constant/shape.d.ts +27 -0
  258. package/lib/constant/shape.js +29 -0
  259. package/lib/constant/shape.js.map +1 -0
  260. package/lib/index.d.ts +124 -4
  261. package/lib/index.js +30 -27
  262. package/lib/index.js.map +1 -0
  263. package/lib/item/combo.d.ts +4 -0
  264. package/lib/item/combo.js +10 -0
  265. package/lib/item/combo.js.map +1 -0
  266. package/lib/item/edge.d.ts +54 -0
  267. package/lib/item/edge.js +119 -0
  268. package/lib/item/edge.js.map +1 -0
  269. package/lib/item/item.d.ts +189 -0
  270. package/lib/item/item.js +639 -0
  271. package/lib/item/item.js.map +1 -0
  272. package/lib/item/node.d.ts +54 -0
  273. package/lib/item/node.js +176 -0
  274. package/lib/item/node.js.map +1 -0
  275. package/lib/runtime/controller/data.d.ts +65 -0
  276. package/lib/runtime/controller/data.js +493 -0
  277. package/lib/runtime/controller/data.js.map +1 -0
  278. package/lib/runtime/controller/extension.d.ts +9 -0
  279. package/lib/runtime/controller/extension.js +15 -0
  280. package/lib/runtime/controller/extension.js.map +1 -0
  281. package/lib/runtime/controller/index.d.ts +7 -0
  282. package/lib/runtime/controller/index.js +24 -0
  283. package/lib/runtime/controller/index.js.map +1 -0
  284. package/lib/runtime/controller/interaction.d.ts +51 -0
  285. package/lib/runtime/controller/interaction.js +263 -0
  286. package/lib/runtime/controller/interaction.js.map +1 -0
  287. package/lib/runtime/controller/item.d.ts +101 -0
  288. package/lib/runtime/controller/item.js +544 -0
  289. package/lib/runtime/controller/item.js.map +1 -0
  290. package/lib/runtime/controller/layout.d.ts +30 -0
  291. package/lib/runtime/controller/layout.js +208 -0
  292. package/lib/runtime/controller/layout.js.map +1 -0
  293. package/lib/runtime/controller/plugin.d.ts +34 -0
  294. package/lib/runtime/controller/plugin.js +147 -0
  295. package/lib/runtime/controller/plugin.js.map +1 -0
  296. package/lib/runtime/controller/theme.d.ts +29 -0
  297. package/lib/runtime/controller/theme.js +61 -0
  298. package/lib/runtime/controller/theme.js.map +1 -0
  299. package/lib/runtime/controller/viewport.d.ts +11 -0
  300. package/lib/runtime/controller/viewport.js +106 -0
  301. package/lib/runtime/controller/viewport.js.map +1 -0
  302. package/lib/runtime/graph.d.ts +462 -0
  303. package/lib/runtime/graph.js +1083 -0
  304. package/lib/runtime/graph.js.map +1 -0
  305. package/lib/runtime/hooks.d.ts +33 -0
  306. package/lib/runtime/hooks.js +77 -0
  307. package/lib/runtime/hooks.js.map +1 -0
  308. package/lib/stdlib/behavior/activate-relations.d.ts +62 -0
  309. package/lib/stdlib/behavior/activate-relations.js +84 -0
  310. package/lib/stdlib/behavior/activate-relations.js.map +1 -0
  311. package/lib/stdlib/behavior/brush-select.d.ts +110 -0
  312. package/lib/stdlib/behavior/brush-select.js +271 -0
  313. package/lib/stdlib/behavior/brush-select.js.map +1 -0
  314. package/lib/stdlib/behavior/click-select.d.ts +71 -0
  315. package/lib/stdlib/behavior/click-select.js +146 -0
  316. package/lib/stdlib/behavior/click-select.js.map +1 -0
  317. package/lib/stdlib/behavior/drag-canvas.d.ts +82 -0
  318. package/lib/stdlib/behavior/drag-canvas.js +249 -0
  319. package/lib/stdlib/behavior/drag-canvas.js.map +1 -0
  320. package/lib/stdlib/behavior/drag-node.d.ts +80 -0
  321. package/lib/stdlib/behavior/drag-node.js +253 -0
  322. package/lib/stdlib/behavior/drag-node.js.map +1 -0
  323. package/lib/stdlib/behavior/hover-activate.d.ts +41 -0
  324. package/lib/stdlib/behavior/hover-activate.js +67 -0
  325. package/lib/stdlib/behavior/hover-activate.js.map +1 -0
  326. package/lib/stdlib/behavior/lasso-select.d.ts +27 -0
  327. package/lib/stdlib/behavior/lasso-select.js +85 -0
  328. package/lib/stdlib/behavior/lasso-select.js.map +1 -0
  329. package/lib/stdlib/behavior/orbit-canvas-3d.d.ts +37 -0
  330. package/lib/stdlib/behavior/orbit-canvas-3d.js +68 -0
  331. package/lib/stdlib/behavior/orbit-canvas-3d.js.map +1 -0
  332. package/lib/stdlib/behavior/rotate-canvas-3d.d.ts +61 -0
  333. package/lib/stdlib/behavior/rotate-canvas-3d.js +126 -0
  334. package/lib/stdlib/behavior/rotate-canvas-3d.js.map +1 -0
  335. package/lib/stdlib/behavior/track-canvas-3d.d.ts +37 -0
  336. package/lib/stdlib/behavior/track-canvas-3d.js +68 -0
  337. package/lib/stdlib/behavior/track-canvas-3d.js.map +1 -0
  338. package/lib/stdlib/behavior/zoom-canvas-3d.d.ts +51 -0
  339. package/lib/stdlib/behavior/zoom-canvas-3d.js +77 -0
  340. package/lib/stdlib/behavior/zoom-canvas-3d.js.map +1 -0
  341. package/lib/stdlib/behavior/zoom-canvas.d.ts +61 -0
  342. package/lib/stdlib/behavior/zoom-canvas.js +163 -0
  343. package/lib/stdlib/behavior/zoom-canvas.js.map +1 -0
  344. package/lib/stdlib/data/comboFromNode.d.ts +9 -0
  345. package/lib/stdlib/data/comboFromNode.js +32 -0
  346. package/lib/stdlib/data/comboFromNode.js.map +1 -0
  347. package/lib/stdlib/index.d.ts +80 -0
  348. package/lib/stdlib/index.js +90 -0
  349. package/lib/stdlib/index.js.map +1 -0
  350. package/lib/stdlib/item/edge/base.d.ts +111 -0
  351. package/lib/stdlib/item/edge/base.js +345 -0
  352. package/lib/stdlib/item/edge/base.js.map +1 -0
  353. package/lib/stdlib/item/edge/index.d.ts +1 -0
  354. package/lib/stdlib/item/edge/index.js +18 -0
  355. package/lib/stdlib/item/edge/index.js.map +1 -0
  356. package/lib/stdlib/item/edge/line.d.ts +33 -0
  357. package/lib/stdlib/item/edge/line.js +49 -0
  358. package/lib/stdlib/item/edge/line.js.map +1 -0
  359. package/lib/stdlib/item/node/base.d.ts +137 -0
  360. package/lib/stdlib/item/node/base.js +418 -0
  361. package/lib/stdlib/item/node/base.js.map +1 -0
  362. package/lib/stdlib/item/node/base3d.d.ts +72 -0
  363. package/lib/stdlib/item/node/base3d.js +117 -0
  364. package/lib/stdlib/item/node/base3d.js.map +1 -0
  365. package/lib/stdlib/item/node/circle.d.ts +30 -0
  366. package/lib/stdlib/item/node/circle.js +60 -0
  367. package/lib/stdlib/item/node/circle.js.map +1 -0
  368. package/lib/stdlib/item/node/index.d.ts +2 -0
  369. package/lib/stdlib/item/node/index.js +19 -0
  370. package/lib/stdlib/item/node/index.js.map +1 -0
  371. package/lib/stdlib/item/node/sphere.d.ts +33 -0
  372. package/lib/stdlib/item/node/sphere.js +56 -0
  373. package/lib/stdlib/item/node/sphere.js.map +1 -0
  374. package/lib/stdlib/plugin/legend/index.d.ts +121 -0
  375. package/lib/stdlib/plugin/legend/index.js +590 -0
  376. package/lib/stdlib/plugin/legend/index.js.map +1 -0
  377. package/lib/stdlib/plugin/minimap/index.d.ts +106 -0
  378. package/lib/stdlib/plugin/minimap/index.js +581 -0
  379. package/lib/stdlib/plugin/minimap/index.js.map +1 -0
  380. package/lib/stdlib/selector/lasso.d.ts +15 -0
  381. package/lib/stdlib/selector/lasso.js +63 -0
  382. package/lib/stdlib/selector/lasso.js.map +1 -0
  383. package/lib/stdlib/selector/rect.d.ts +16 -0
  384. package/lib/stdlib/selector/rect.js +56 -0
  385. package/lib/stdlib/selector/rect.js.map +1 -0
  386. package/lib/stdlib/theme/dark.d.ts +3 -0
  387. package/lib/stdlib/theme/dark.js +281 -0
  388. package/lib/stdlib/theme/dark.js.map +1 -0
  389. package/lib/stdlib/theme/light.d.ts +3 -0
  390. package/lib/stdlib/theme/light.js +276 -0
  391. package/lib/stdlib/theme/light.js.map +1 -0
  392. package/lib/stdlib/themeSolver/base.d.ts +15 -0
  393. package/lib/stdlib/themeSolver/base.js +14 -0
  394. package/lib/stdlib/themeSolver/base.js.map +1 -0
  395. package/lib/stdlib/themeSolver/spec.d.ts +37 -0
  396. package/lib/stdlib/themeSolver/spec.js +72 -0
  397. package/lib/stdlib/themeSolver/spec.js.map +1 -0
  398. package/lib/stdlib/themeSolver/subject.d.ts +43 -0
  399. package/lib/stdlib/themeSolver/subject.js +404 -0
  400. package/lib/stdlib/themeSolver/subject.js.map +1 -0
  401. package/lib/types/animate.d.ts +59 -0
  402. package/lib/types/animate.js +3 -0
  403. package/lib/types/animate.js.map +1 -0
  404. package/lib/types/behavior.d.ts +45 -0
  405. package/lib/types/behavior.js +18 -0
  406. package/lib/types/behavior.js.map +1 -0
  407. package/lib/types/combo.d.ts +87 -0
  408. package/lib/types/combo.js +3 -0
  409. package/lib/types/combo.js.map +1 -0
  410. package/lib/types/common.d.ts +6 -0
  411. package/lib/types/common.js +3 -0
  412. package/lib/types/common.js.map +1 -0
  413. package/lib/types/data.d.ts +21 -0
  414. package/lib/types/data.js +3 -0
  415. package/lib/types/data.js.map +1 -0
  416. package/lib/types/edge.d.ts +100 -0
  417. package/lib/types/edge.js +3 -0
  418. package/lib/types/edge.js.map +1 -0
  419. package/lib/types/event.d.ts +30 -0
  420. package/lib/types/event.js +34 -0
  421. package/lib/types/event.js.map +1 -0
  422. package/lib/types/graph.d.ts +445 -0
  423. package/lib/types/graph.js +3 -0
  424. package/lib/types/graph.js.map +1 -0
  425. package/lib/types/hook.d.ts +97 -0
  426. package/lib/types/hook.js +3 -0
  427. package/lib/types/hook.js.map +1 -0
  428. package/lib/types/index.d.ts +10 -0
  429. package/lib/types/index.js +7 -0
  430. package/lib/types/index.js.map +1 -0
  431. package/lib/types/item.d.ts +229 -0
  432. package/lib/types/item.js +19 -0
  433. package/lib/types/item.js.map +1 -0
  434. package/lib/types/layout.d.ts +69 -0
  435. package/lib/types/layout.js +25 -0
  436. package/lib/types/layout.js.map +1 -0
  437. package/lib/types/node.d.ts +134 -0
  438. package/lib/types/node.js +3 -0
  439. package/lib/types/node.js.map +1 -0
  440. package/lib/types/plugin.d.ts +40 -0
  441. package/lib/types/plugin.js +57 -0
  442. package/lib/types/plugin.js.map +1 -0
  443. package/lib/types/render.d.ts +1 -0
  444. package/lib/types/render.js +3 -0
  445. package/lib/types/render.js.map +1 -0
  446. package/lib/types/spec.d.ts +65 -0
  447. package/lib/types/spec.js +3 -0
  448. package/lib/types/spec.js.map +1 -0
  449. package/lib/types/stdlib.d.ts +13 -0
  450. package/lib/types/stdlib.js +3 -0
  451. package/lib/types/stdlib.js.map +1 -0
  452. package/lib/types/theme.d.ts +102 -0
  453. package/lib/types/theme.js +19 -0
  454. package/lib/types/theme.js.map +1 -0
  455. package/lib/types/view.d.ts +23 -0
  456. package/lib/types/view.js +3 -0
  457. package/lib/types/view.js.map +1 -0
  458. package/lib/util/animate.d.ts +101 -0
  459. package/lib/util/animate.js +358 -0
  460. package/lib/util/animate.js.map +1 -0
  461. package/lib/util/array.d.ts +20 -0
  462. package/lib/util/array.js +68 -0
  463. package/lib/util/array.js.map +1 -0
  464. package/lib/util/canvas.d.ts +20 -0
  465. package/lib/util/canvas.js +86 -0
  466. package/lib/util/canvas.js.map +1 -0
  467. package/lib/util/event.d.ts +12 -0
  468. package/lib/util/event.js +30 -0
  469. package/lib/util/event.js.map +1 -0
  470. package/lib/util/extend.d.ts +21 -0
  471. package/lib/util/extend.js +29 -0
  472. package/lib/util/extend.js.map +1 -0
  473. package/lib/util/extension.d.ts +10 -0
  474. package/lib/util/extension.js +29 -0
  475. package/lib/util/extension.js.map +1 -0
  476. package/lib/util/index.d.ts +14 -0
  477. package/lib/util/index.js +7 -0
  478. package/lib/util/index.js.map +1 -0
  479. package/lib/util/item.d.ts +14 -0
  480. package/lib/util/item.js +47 -0
  481. package/lib/util/item.js.map +1 -0
  482. package/lib/util/mapper.d.ts +17 -0
  483. package/lib/util/mapper.js +63 -0
  484. package/lib/util/mapper.js.map +1 -0
  485. package/lib/util/math.d.ts +8 -0
  486. package/lib/util/math.js +13 -0
  487. package/lib/util/math.js.map +1 -0
  488. package/lib/util/point.d.ts +61 -0
  489. package/lib/util/point.js +169 -0
  490. package/lib/util/point.js.map +1 -0
  491. package/lib/util/shape.d.ts +105 -0
  492. package/lib/util/shape.js +519 -0
  493. package/lib/util/shape.js.map +1 -0
  494. package/lib/util/shape3d.d.ts +23 -0
  495. package/lib/util/shape3d.js +153 -0
  496. package/lib/util/shape3d.js.map +1 -0
  497. package/lib/util/text.d.ts +18 -0
  498. package/lib/util/text.js +41 -0
  499. package/lib/util/text.js.map +1 -0
  500. package/lib/util/type.d.ts +2 -0
  501. package/lib/util/type.js +6 -0
  502. package/lib/util/type.js.map +1 -0
  503. package/lib/util/zoom.d.ts +17 -0
  504. package/lib/util/zoom.js +41 -0
  505. package/lib/util/zoom.js.map +1 -0
  506. package/package.json +82 -50
  507. package/src/constant/index.ts +1 -0
  508. package/src/constant/shape.ts +33 -0
  509. package/src/index.ts +13 -0
  510. package/src/item/combo.ts +5 -0
  511. package/src/item/edge.ts +177 -0
  512. package/src/item/item.ts +812 -0
  513. package/src/item/node.ts +275 -0
  514. package/src/runtime/controller/data.ts +575 -0
  515. package/src/runtime/controller/extension.ts +14 -0
  516. package/src/runtime/controller/index.ts +7 -0
  517. package/src/runtime/controller/interaction.ts +343 -0
  518. package/src/runtime/controller/item.ts +780 -0
  519. package/src/runtime/controller/layout.ts +251 -0
  520. package/src/runtime/controller/plugin.ts +171 -0
  521. package/src/runtime/controller/theme.ts +69 -0
  522. package/src/runtime/controller/viewport.ts +131 -0
  523. package/src/runtime/graph.ts +1439 -0
  524. package/src/runtime/hooks.ts +64 -0
  525. package/src/stdlib/behavior/activate-relations.ts +139 -0
  526. package/src/stdlib/behavior/brush-select.ts +386 -0
  527. package/src/stdlib/behavior/click-select.ts +201 -0
  528. package/src/stdlib/behavior/drag-canvas.ts +333 -0
  529. package/src/stdlib/behavior/drag-node.ts +402 -0
  530. package/src/stdlib/behavior/hover-activate.ts +106 -0
  531. package/src/stdlib/behavior/lasso-select.ts +94 -0
  532. package/src/stdlib/behavior/orbit-canvas-3d.ts +104 -0
  533. package/src/stdlib/behavior/rotate-canvas-3d.ts +172 -0
  534. package/src/stdlib/behavior/track-canvas-3d.ts +104 -0
  535. package/src/stdlib/behavior/zoom-canvas-3d.ts +127 -0
  536. package/src/stdlib/behavior/zoom-canvas.ts +244 -0
  537. package/src/stdlib/data/comboFromNode.ts +28 -0
  538. package/src/stdlib/index.ts +87 -0
  539. package/src/stdlib/item/edge/base.ts +571 -0
  540. package/src/stdlib/item/edge/index.ts +1 -0
  541. package/src/stdlib/item/edge/line.ts +98 -0
  542. package/src/stdlib/item/node/base.ts +726 -0
  543. package/src/stdlib/item/node/base3d.ts +192 -0
  544. package/src/stdlib/item/node/circle.ts +113 -0
  545. package/src/stdlib/item/node/index.ts +2 -0
  546. package/src/stdlib/item/node/sphere.ts +99 -0
  547. package/src/stdlib/plugin/legend/index.ts +733 -0
  548. package/src/stdlib/plugin/minimap/index.ts +689 -0
  549. package/src/stdlib/selector/lasso.ts +75 -0
  550. package/src/stdlib/selector/rect.ts +78 -0
  551. package/src/stdlib/theme/dark.ts +340 -0
  552. package/src/stdlib/theme/light.ts +333 -0
  553. package/src/stdlib/themeSolver/base.ts +22 -0
  554. package/src/stdlib/themeSolver/spec.ts +110 -0
  555. package/src/stdlib/themeSolver/subject.ts +502 -0
  556. package/src/types/animate.ts +71 -0
  557. package/src/types/behavior.ts +49 -0
  558. package/src/types/combo.ts +120 -0
  559. package/src/types/common.ts +7 -0
  560. package/src/types/data.ts +35 -0
  561. package/src/types/edge.ts +119 -0
  562. package/src/types/event.ts +47 -0
  563. package/src/types/graph.ts +573 -0
  564. package/src/types/hook.ts +98 -0
  565. package/src/types/index.ts +29 -0
  566. package/src/types/item.ts +324 -0
  567. package/src/types/layout.ts +138 -0
  568. package/src/types/node.ts +162 -0
  569. package/src/types/plugin.ts +77 -0
  570. package/src/types/render.ts +1 -0
  571. package/src/types/spec.ts +116 -0
  572. package/src/types/stdlib.ts +25 -0
  573. package/src/types/theme.ts +101 -0
  574. package/src/types/view.ts +31 -0
  575. package/src/util/animate.ts +430 -0
  576. package/src/util/array.ts +57 -0
  577. package/src/util/canvas.ts +95 -0
  578. package/src/util/event.ts +34 -0
  579. package/src/util/extend.ts +42 -0
  580. package/src/util/extension.ts +29 -0
  581. package/src/util/index.ts +4 -0
  582. package/src/util/item.ts +70 -0
  583. package/src/util/mapper.ts +61 -0
  584. package/src/util/math.ts +9 -0
  585. package/src/util/point.ts +195 -0
  586. package/src/util/shape.ts +609 -0
  587. package/src/util/shape3d.ts +198 -0
  588. package/src/util/text.ts +49 -0
  589. package/src/util/type.ts +4 -0
  590. package/src/util/zoom.ts +39 -0
  591. package/README.en-US.md +0 -170
  592. package/README.md +0 -177
  593. package/dist/g6.min.js.map +0 -1
  594. package/es/index.d.ts +0 -4
  595. package/es/index.js +0 -5
@@ -0,0 +1,21 @@
1
+ import { Graph as IGraph } from '@antv/graphlib';
2
+ import { ComboUserModel } from './combo';
3
+ import { NodeDisplayModelData, NodeModelData, NodeUserModel } from './node';
4
+ import { EdgeDisplayModelData, EdgeModelData, EdgeUserModel } from './edge';
5
+ export interface GraphData {
6
+ nodes?: NodeUserModel[];
7
+ edges?: EdgeUserModel[];
8
+ combos?: ComboUserModel[];
9
+ }
10
+ export interface InlineDataConfig {
11
+ type: 'inline';
12
+ value: GraphData;
13
+ }
14
+ export interface FetchDataConfig {
15
+ type: 'fetch';
16
+ value: string;
17
+ }
18
+ export type GraphCore = IGraph<NodeModelData, EdgeModelData>;
19
+ export type DisplayGraphCore = IGraph<NodeDisplayModelData, EdgeDisplayModelData>;
20
+ export type TransformerFn = (data: GraphData) => GraphData;
21
+ export type DataChangeType = 'replace' | 'mergeReplace' | 'union' | 'remove' | 'update';
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=data.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data.js","sourceRoot":"src/","sources":["types/data.ts"],"names":[],"mappings":""}
@@ -0,0 +1,100 @@
1
+ import { DisplayObject } from '@antv/g';
2
+ import { Edge as GEdge, PlainObject } from '@antv/graphlib';
3
+ import { IAnimates } from './animate';
4
+ import { Encode, IItem, ItemShapeStyles, LabelBackground, ShapeAttrEncode, ShapesEncode, ShapeStyle, LodStrategy } from './item';
5
+ export interface EdgeUserModelData extends PlainObject {
6
+ /**
7
+ * Anchor index to link to the source / target node.
8
+ */
9
+ sourceAnchor?: number;
10
+ targetAnchor?: number;
11
+ /**
12
+ * Edge type, e.g. 'line'.
13
+ */
14
+ type?: string;
15
+ /**
16
+ * Subject color for the keyShape and arrows.
17
+ * More styles should be configured in edge mapper.
18
+ */
19
+ color?: string;
20
+ /**
21
+ * The text to show on the edge.
22
+ * More styles should be configured in edge mapper.
23
+ */
24
+ label?: string;
25
+ /**
26
+ * Whether show the edge by default.
27
+ */
28
+ visible?: boolean;
29
+ /**
30
+ * The icon to show on the edge.
31
+ * More styles should be configured in edge mapper.
32
+ */
33
+ icon?: {
34
+ type: 'icon' | 'text';
35
+ text?: string;
36
+ img?: string;
37
+ };
38
+ /**
39
+ * The badges to show on the edge.
40
+ * More styles should be configured in edge mapper.
41
+ */
42
+ badge?: {
43
+ type: 'icon' | 'text';
44
+ text: string;
45
+ };
46
+ }
47
+ export interface EdgeModelData extends EdgeUserModelData {
48
+ }
49
+ export interface EdgeShapeStyles extends ItemShapeStyles {
50
+ labelShape?: ShapeStyle & {
51
+ position?: 'start' | 'middle' | 'end';
52
+ offsetX?: number;
53
+ offsetY?: number;
54
+ offsetZ?: number;
55
+ autoRotate?: boolean;
56
+ maxWidth?: string | number;
57
+ };
58
+ labelBackgroundShape?: ShapeStyle & {
59
+ padding?: number | number[];
60
+ };
61
+ badgeShape?: ShapeStyle & {
62
+ color?: string;
63
+ textColor?: string;
64
+ };
65
+ }
66
+ export type EdgeDisplayModelData = EdgeModelData & EdgeShapeStyles & {
67
+ lodStrategy?: LodStrategy;
68
+ };
69
+ /** User input data. */
70
+ export type EdgeUserModel = GEdge<EdgeUserModelData>;
71
+ /** Inner node data, clone and transform from user data. */
72
+ export type EdgeModel = GEdge<EdgeModelData>;
73
+ /** Displayed data, only for drawing and not received by users. */
74
+ export type EdgeDisplayModel = GEdge<EdgeDisplayModelData>;
75
+ export type EdgeLabelPosition = 'start' | 'middle' | 'end';
76
+ interface EdgeLabelShapeAttrEncode extends ShapeAttrEncode {
77
+ position?: EdgeLabelPosition | Encode<EdgeLabelPosition>;
78
+ offsetX?: number | Encode<number>;
79
+ offsetY?: number | Encode<number>;
80
+ offsetZ?: number | Encode<number>;
81
+ background?: LabelBackground | Encode<LabelBackground>;
82
+ autoRotate?: boolean | Encode<boolean>;
83
+ }
84
+ export interface EdgeShapesEncode extends ShapesEncode {
85
+ labelShape?: EdgeLabelShapeAttrEncode;
86
+ labelBackgroundShape?: LabelBackground | Encode<LabelBackground>;
87
+ badgeShape?: ShapeAttrEncode | Encode<ShapeStyle>;
88
+ }
89
+ export interface EdgeEncode extends EdgeShapesEncode {
90
+ type?: string | Encode<string>;
91
+ animates?: IAnimates;
92
+ }
93
+ export interface EdgeShapeMap {
94
+ keyShape: DisplayObject;
95
+ labelShape?: DisplayObject;
96
+ iconShape?: DisplayObject;
97
+ [otherShapeId: string]: DisplayObject;
98
+ }
99
+ export type IEdge = IItem;
100
+ export {};
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=edge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"edge.js","sourceRoot":"src/","sources":["types/edge.ts"],"names":[],"mappings":""}
@@ -0,0 +1,30 @@
1
+ import { FederatedPointerEvent } from '@antv/g';
2
+ import { ID } from '@antv/graphlib';
3
+ import { IGraph } from './graph';
4
+ /** Event type enum */
5
+ export declare enum CANVAS_EVENT_TYPE {
6
+ 'pointerover' = "pointerover",
7
+ 'pointerenter' = "pointerenter",
8
+ 'pointerdown' = "pointerdown",
9
+ 'pointermove' = "pointermove",
10
+ 'pointerup' = "pointerup",
11
+ 'pointerleave' = "pointerleave",
12
+ 'click' = "click",
13
+ 'wheel' = "wheel"
14
+ }
15
+ export declare enum DOM_EVENT_TYPE {
16
+ 'focus' = "focus",
17
+ 'blur' = "blur",
18
+ 'keyup' = "keyup",
19
+ 'keydown' = "keydown",
20
+ 'keypress' = "keypress"
21
+ }
22
+ /** Event type union */
23
+ export type ICanvasEventType = `${CANVAS_EVENT_TYPE}`;
24
+ export interface IG6GraphEvent extends Omit<FederatedPointerEvent, 'currentTarget'> {
25
+ currentTarget: IGraph;
26
+ itemType: 'node' | 'edge' | 'combo' | 'canvas';
27
+ itemId: ID;
28
+ /** Original event emitted by G */
29
+ gEvent: Event;
30
+ }
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DOM_EVENT_TYPE = exports.CANVAS_EVENT_TYPE = void 0;
4
+ /** Event type enum */
5
+ var CANVAS_EVENT_TYPE;
6
+ (function (CANVAS_EVENT_TYPE) {
7
+ // Pointer events
8
+ CANVAS_EVENT_TYPE["pointerover"] = "pointerover";
9
+ CANVAS_EVENT_TYPE["pointerenter"] = "pointerenter";
10
+ CANVAS_EVENT_TYPE["pointerdown"] = "pointerdown";
11
+ CANVAS_EVENT_TYPE["pointermove"] = "pointermove";
12
+ CANVAS_EVENT_TYPE["pointerup"] = "pointerup";
13
+ CANVAS_EVENT_TYPE["pointerleave"] = "pointerleave";
14
+ // Mouse events
15
+ CANVAS_EVENT_TYPE["click"] = "click";
16
+ CANVAS_EVENT_TYPE["wheel"] = "wheel";
17
+ // 'dragstart',
18
+ // 'drag',
19
+ // 'dragend',
20
+ // 'dragenter',
21
+ // 'dragleave',
22
+ // 'dragover',
23
+ // 'dragout',
24
+ // 'drop',
25
+ })(CANVAS_EVENT_TYPE = exports.CANVAS_EVENT_TYPE || (exports.CANVAS_EVENT_TYPE = {}));
26
+ var DOM_EVENT_TYPE;
27
+ (function (DOM_EVENT_TYPE) {
28
+ DOM_EVENT_TYPE["focus"] = "focus";
29
+ DOM_EVENT_TYPE["blur"] = "blur";
30
+ DOM_EVENT_TYPE["keyup"] = "keyup";
31
+ DOM_EVENT_TYPE["keydown"] = "keydown";
32
+ DOM_EVENT_TYPE["keypress"] = "keypress";
33
+ })(DOM_EVENT_TYPE = exports.DOM_EVENT_TYPE || (exports.DOM_EVENT_TYPE = {}));
34
+ //# sourceMappingURL=event.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event.js","sourceRoot":"src/","sources":["types/event.ts"],"names":[],"mappings":";;;AAIA,sBAAsB;AACtB,IAAY,iBAqBX;AArBD,WAAY,iBAAiB;IAC3B,iBAAiB;IACjB,gDAA6B,CAAA;IAC7B,kDAA+B,CAAA;IAC/B,gDAA6B,CAAA;IAC7B,gDAA6B,CAAA;IAC7B,4CAAyB,CAAA;IACzB,kDAA+B,CAAA;IAE/B,eAAe;IACf,oCAAiB,CAAA;IACjB,oCAAiB,CAAA;IAEjB,eAAe;IACf,UAAU;IACV,aAAa;IACb,eAAe;IACf,eAAe;IACf,cAAc;IACd,aAAa;IACb,UAAU;AACZ,CAAC,EArBW,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QAqB5B;AAED,IAAY,cAMX;AAND,WAAY,cAAc;IACxB,iCAAiB,CAAA;IACjB,+BAAe,CAAA;IACf,iCAAiB,CAAA;IACjB,qCAAqB,CAAA;IACrB,uCAAuB,CAAA;AACzB,CAAC,EANW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAMzB"}
@@ -0,0 +1,445 @@
1
+ import EventEmitter from '@antv/event-emitter';
2
+ import { AABB, Canvas, DisplayObject, PointLike } from '@antv/g';
3
+ import { ID } from '@antv/graphlib';
4
+ import { Hooks } from '../types/hook';
5
+ import { CameraAnimationOptions } from './animate';
6
+ import { BehaviorOptionsOf, BehaviorRegistry } from './behavior';
7
+ import { ComboModel, ComboUserModel } from './combo';
8
+ import { Padding, Point } from './common';
9
+ import { GraphData } from './data';
10
+ import { EdgeModel, EdgeUserModel } from './edge';
11
+ import { ITEM_TYPE, SHAPE_TYPE } from './item';
12
+ import { LayoutOptions } from './layout';
13
+ import { NodeModel, NodeUserModel } from './node';
14
+ import { RendererName } from './render';
15
+ import { Specification } from './spec';
16
+ import { ThemeOptionsOf, ThemeRegistry } from './theme';
17
+ import { FitViewRules, GraphTransformOptions } from './view';
18
+ export interface IGraph<B extends BehaviorRegistry = BehaviorRegistry, T extends ThemeRegistry = ThemeRegistry> extends EventEmitter {
19
+ hooks: Hooks;
20
+ canvas: Canvas;
21
+ transientCanvas: Canvas;
22
+ destroyed: boolean;
23
+ container: HTMLElement;
24
+ rendererType: RendererName;
25
+ /**
26
+ * Destroy the graph instance and remove the related canvases.
27
+ * @returns
28
+ * @group Graph Instance
29
+ */
30
+ destroy: (callback?: Function) => void;
31
+ /**
32
+ * Update the specs (configurations).
33
+ */
34
+ updateSpecification: (spec: Specification<B, T>) => Specification<B, T>;
35
+ /**
36
+ * Update the theme specs (configurations).
37
+ */
38
+ updateTheme: (theme: ThemeOptionsOf<T>) => void;
39
+ /**
40
+ * Get the copy of specs(configurations).
41
+ * @returns graph specs
42
+ */
43
+ getSpecification: () => Specification<B, T>;
44
+ /**
45
+ * Change the renderer at runtime.
46
+ * @param type renderer name
47
+ * @returns
48
+ */
49
+ changeRenderer: (type: RendererName) => void;
50
+ /**
51
+ * Find a node's inner data according to id or function.
52
+ * @param { ID | Function} condition id or condition function
53
+ * @returns result node's inner data
54
+ * @group Data
55
+ */
56
+ getNodeData: (condition: ID | Function) => NodeModel | undefined;
57
+ /**
58
+ * Find an edge's inner data according to id or function.
59
+ * @param { ID | Function} condition id or condition function
60
+ * @returns result edge's inner data
61
+ * @group Data
62
+ */
63
+ getEdgeData: (condition: ID | Function) => EdgeModel | undefined;
64
+ /**
65
+ * Find a combo's inner data according to id or function.
66
+ * @param { ID | Function} condition id or condition function
67
+ * @returns result combo's inner data
68
+ * @group Data
69
+ */
70
+ getComboData: (condition: ID | Function) => ComboModel | undefined;
71
+ /**
72
+ * Get all the nodes' inner data
73
+ * @returns all nodes' inner data on the graph
74
+ * @group Data
75
+ */
76
+ getAllNodesData: () => NodeModel[];
77
+ /**
78
+ * Get all the edges' inner data
79
+ * @returns all edges' inner data on the graph
80
+ * @group Data
81
+ */
82
+ getAllEdgesData: () => EdgeModel[];
83
+ /**
84
+ * Get all the combos' inner data
85
+ * @returns all combos' inner data on the graph
86
+ * @group Data
87
+ */
88
+ getAllCombosData: () => ComboModel[];
89
+ /**
90
+ * Get one-hop edge ids from a start node.
91
+ * @param nodeId id of the start node
92
+ * @returns one-hop edge ids
93
+ * @group Data
94
+ */
95
+ getRelatedEdgesData: (nodeId: ID, direction?: 'in' | 'out' | 'both') => EdgeModel[];
96
+ /**
97
+ * Get one-hop node ids from a start node.
98
+ * @param nodeId id of the start node
99
+ * @returns one-hop node ids
100
+ * @group Data
101
+ */
102
+ getNeighborNodesData: (nodeId: ID, direction?: 'in' | 'out' | 'both') => NodeModel[];
103
+ /**
104
+ * Input data and render the graph.
105
+ * If there is old data, diffs and changes it.
106
+ * @param data
107
+ * @returns
108
+ * @group Data
109
+ */
110
+ read: (data: GraphData) => void;
111
+ /**
112
+ * Change graph data.
113
+ * @param data new data
114
+ * @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)
115
+ * @returns
116
+ * @group Data
117
+ */
118
+ changeData: (data: GraphData, type: 'replace' | 'mergeReplace') => void;
119
+ /**
120
+ * Clear the graph, means remove all the items on the graph.
121
+ * @returns
122
+ */
123
+ clear: () => void;
124
+ /**
125
+ * Find items which has the state.
126
+ * @param itemType item type
127
+ * @param state state name
128
+ * @param value state value, true by default
129
+ * @param additionalFilter additional filter function
130
+ * @returns items that is the type and has the state
131
+ * @group Item
132
+ */
133
+ findIdByState: (itemType: ITEM_TYPE, state: string, value?: string | boolean, additionalFilter?: (model: NodeModel | EdgeModel | ComboModel) => boolean) => ID[];
134
+ /**
135
+ * Add one or more node/edge/combo data to the graph.
136
+ * @param itemType item type
137
+ * @param model user data
138
+ * @param stack whether push this operation to stack
139
+ * @returns whehter success
140
+ * @group Data
141
+ */
142
+ addData: (itemType: ITEM_TYPE, model: NodeUserModel | EdgeUserModel | ComboUserModel | NodeUserModel[] | EdgeUserModel[] | ComboUserModel[], stack?: boolean) => NodeModel | EdgeModel | ComboModel | NodeModel[] | EdgeModel[] | ComboModel[];
143
+ /**
144
+ * Remove one or more node/edge/combo data from the graph.
145
+ * @param item the item to be removed
146
+ * @param stack whether push this operation to stack
147
+ * @returns whehter success
148
+ * @group Data
149
+ */
150
+ removeData: (itemType: ITEM_TYPE, id: ID | ID[], stack?: boolean) => void;
151
+ /**
152
+ * Update one or more node/edge/combo data on the graph.
153
+ * @param item the item to be updated
154
+ * @param model update configs
155
+ * @param {boolean} stack whether push this operation to stack
156
+ * @group Data
157
+ */
158
+ updateData: (itemType: ITEM_TYPE, model: Partial<NodeUserModel> | Partial<EdgeUserModel> | Partial<ComboUserModel | Partial<NodeUserModel>[] | Partial<EdgeUserModel>[] | Partial<ComboUserModel>[]>, stack?: boolean) => NodeModel | EdgeModel | ComboModel | NodeModel[] | EdgeModel[] | ComboModel[];
159
+ /**
160
+ * Update one or more nodes' positions,
161
+ * do not update other styles which leads to better performance than updating positions by updateData.
162
+ * @param models new configurations with x and y for every node, which has id field to indicate the specific item
163
+ * @param {boolean} stack whether push this operation into graph's stack, true by default
164
+ * @group Data
165
+ */
166
+ updateNodePosition: (models: Partial<NodeUserModel> | Partial<ComboUserModel | Partial<NodeUserModel>[] | Partial<ComboUserModel>[]>, stack?: boolean) => NodeModel | ComboModel | NodeModel[] | ComboModel[];
167
+ /**
168
+ * Move the graph with a relative vector.
169
+ * @param dx x of the relative vector
170
+ * @param dy y of the relative vector
171
+ * @param effectTiming animation configurations
172
+ */
173
+ translate: (distance: Partial<{
174
+ dx: number;
175
+ dy: number;
176
+ dz: number;
177
+ }>, effectTiming?: CameraAnimationOptions) => Promise<void>;
178
+ /**
179
+ * Move the graph and align to a point.
180
+ * @param point position on the canvas to align
181
+ * @param effectTiming animation configurations
182
+ */
183
+ translateTo: (point: PointLike, effectTiming?: CameraAnimationOptions) => Promise<void>;
184
+ /**
185
+ * Return the current zoom level of camera.
186
+ * @returns current zoom
187
+ */
188
+ getZoom: () => number;
189
+ /**
190
+ * Zoom the graph with a relative ratio.
191
+ * @param ratio relative ratio to zoom
192
+ * @param center zoom center
193
+ * @param effectTiming animation configurations
194
+ */
195
+ zoom: (ratio: number, center?: Point, effectTiming?: CameraAnimationOptions) => Promise<void>;
196
+ /**
197
+ * Zoom the graph to a specified ratio.
198
+ * @param toRatio specified ratio
199
+ * @param center zoom center
200
+ * @param effectTiming animation configurations
201
+ */
202
+ zoomTo: (toRatio: number, center?: Point, effectTiming?: CameraAnimationOptions) => Promise<void>;
203
+ /**
204
+ * Rotate the graph with a relative angle in clockwise.
205
+ * @param angle
206
+ * @param center
207
+ * @param effectTiming
208
+ */
209
+ rotate: (angle: number, center?: Point, effectTiming?: CameraAnimationOptions) => Promise<void>;
210
+ /**
211
+ * Rotate the graph to an absolute angle in clockwise.
212
+ * @param toAngle
213
+ * @param center
214
+ * @param effectTiming
215
+ */
216
+ rotateTo: (toAngle: number, center?: Point, effectTiming?: CameraAnimationOptions) => Promise<void>;
217
+ /**
218
+ * Transform the graph with a CSS-Transform-like syntax.
219
+ * @param options
220
+ * @param effectTiming
221
+ */
222
+ transform: (options: GraphTransformOptions, effectTiming?: CameraAnimationOptions) => Promise<void>;
223
+ /**
224
+ * Stop the current transition of transform immediately.
225
+ */
226
+ stopTransformTransition: () => void;
227
+ /**
228
+ * Return the center of viewport, e.g. for a 500 * 500 canvas, its center is [250, 250].
229
+ */
230
+ getViewportCenter: () => PointLike;
231
+ /**
232
+ * Fit the graph content to the view.
233
+ * @param options.padding padding while fitting
234
+ * @param options.rules rules for fitting
235
+ * @param effectTiming animation configurations
236
+ * @returns
237
+ * @group View
238
+ */
239
+ fitView: (options?: {
240
+ padding: Padding;
241
+ rules: FitViewRules;
242
+ }, effectTiming?: CameraAnimationOptions) => Promise<void>;
243
+ /**
244
+ * Fit the graph center to the view center.
245
+ * @param effectTiming animation configurations
246
+ * @returns
247
+ * @group View
248
+ */
249
+ fitCenter: (effectTiming?: CameraAnimationOptions) => Promise<void>;
250
+ /**
251
+ * Move the graph to make the item align the view center.
252
+ * @param item node/edge/combo item or its id
253
+ * @param effectTiming animation configurations
254
+ * @group View
255
+ */
256
+ focusItem: (id: ID | ID[], effectTiming?: CameraAnimationOptions) => Promise<void>;
257
+ /**
258
+ * Get the size of the graph canvas.
259
+ * @returns [width, height]
260
+ * @group View
261
+ */
262
+ getSize: () => number[];
263
+ /**
264
+ * Set the size for the graph canvas.
265
+ * @param number[] [width, height]
266
+ * @group View
267
+ */
268
+ setSize: (size: number[]) => void;
269
+ /**
270
+ * Get the rendering coordinate according to the canvas dom (viewport) coordinate.
271
+ * @param Point rendering coordinate
272
+ * @returns canvas dom (viewport) coordinate
273
+ * @group View
274
+ */
275
+ getCanvasByViewport: (viewportPoint: Point) => Point;
276
+ /**
277
+ * Get the canvas dom (viewport) coordinate according to the rendering coordinate.
278
+ * @param Point canvas dom (viewport) coordinate
279
+ * @returns rendering coordinate
280
+ * @group View
281
+ */
282
+ getViewportByCanvas: (canvasPoint: Point) => Point;
283
+ /**
284
+ * Get the browser coordinate according to the rendering coordinate.
285
+ * @param Point rendering coordinate
286
+ * @returns browser coordinate
287
+ * @group View
288
+ */
289
+ getClientByCanvas: (canvasPoint: Point) => Point;
290
+ /**
291
+ * Get the rendering coordinate according to the browser coordinate.
292
+ * @param Point browser coordinate
293
+ * @returns rendering coordinate
294
+ * @group View
295
+ */
296
+ getCanvasByClient: (ClientPoint: Point) => Point;
297
+ /**
298
+ * Show the item(s).
299
+ * @param ids the item id(s) to be shown
300
+ * @returns
301
+ * @group Data
302
+ */
303
+ showItem: (ids: ID | ID[], disableAniamte?: boolean) => void;
304
+ /**
305
+ * Hide the item(s).
306
+ * @param ids the item id(s) to be hidden
307
+ * @returns
308
+ * @group Item
309
+ */
310
+ hideItem: (ids: ID | ID[], disableAniamte?: boolean) => void;
311
+ /**
312
+ * Set state for the item(s).
313
+ * @param ids the id(s) for the item(s) to be set
314
+ * @param state the state name
315
+ * @param value state value
316
+ * @returns
317
+ * @group Item
318
+ */
319
+ setItemState: (ids: ID | ID[], state: string, value: boolean) => void;
320
+ /**
321
+ * Get the state value for an item.
322
+ * @param id the id for the item
323
+ * @param states the state name
324
+ * @returns {boolean | string} the state value
325
+ * @group Item
326
+ */
327
+ getItemState: (id: ID, state: string) => boolean | string;
328
+ /**
329
+ * Clear all the states for item(s).
330
+ * @param ids the id(s) for the item(s) to be clear
331
+ * @param states the states' names, all the states wil be cleared if states is not assigned
332
+ * @returns
333
+ * @group Item
334
+ */
335
+ clearItemState: (ids: ID | ID[], states?: string[]) => void;
336
+ /**
337
+ * Get the rendering bbox for a node / edge / combo, or the graph (when the id is not assigned).
338
+ * @param id the id for the node / edge / combo, undefined for the whole graph
339
+ * @returns rendering bounding box. returns false if the item is not exist
340
+ */
341
+ getRenderBBox: (id: ID | undefined) => AABB | false;
342
+ /**
343
+ * Get the visibility for a node / edge / combo.
344
+ * @param id the id for the node / edge / combo
345
+ * @returns visibility for the item, false for invisible or unexistence for the item
346
+ */
347
+ getItemVisible: (id: ID) => boolean;
348
+ /**
349
+ * Create a new combo with existing child nodes and combos.
350
+ * @param combo combo ID or Combo model
351
+ * @param childrenIds id array of children of the new combo
352
+ * @group Combo
353
+ */
354
+ createCombo: (combo: string | ComboUserModel, childrenIds: string[], stack?: boolean) => void;
355
+ /**
356
+ * dissolve combo
357
+ * @param {String | ICombo} item combo item or id to be dissolve
358
+ */
359
+ uncombo: (comboId: ID, stack?: boolean) => void;
360
+ /**
361
+ * Collapse a combo.
362
+ * @param comboId combo id or item
363
+ * @group Combo
364
+ */
365
+ collapseCombo: (comboId: ID, stack?: boolean) => void;
366
+ /**
367
+ * Expand a combo.
368
+ * @group Combo
369
+ * @param combo combo ID 或 combo 实例
370
+ * @group Combo
371
+ */
372
+ expandCombo: (comboId: ID, stack?: boolean) => void;
373
+ /**
374
+ * Layout the graph (with current configurations if cfg is not assigned).
375
+ */
376
+ layout: (options?: LayoutOptions) => Promise<void>;
377
+ stopLayout: () => void;
378
+ /**
379
+ * Switch mode.
380
+ * @param mode mode name
381
+ * @returns
382
+ * @group Interaction
383
+ */
384
+ setMode: (mode: string) => void;
385
+ /**
386
+ * Add behavior(s) to mode(s).
387
+ * @param behaviors behavior names or configs
388
+ * @param modes mode names
389
+ * @returns
390
+ */
391
+ addBehaviors: (behaviors: BehaviorOptionsOf<B>[], modes: string | string[]) => void;
392
+ /**
393
+ * Remove behavior(s) from mode(s).
394
+ * @param behaviors behavior names or configs
395
+ * @param modes mode names
396
+ * @returns
397
+ * @group Interaction
398
+ */
399
+ removeBehaviors: (behaviorKeys: string[], modes: string | string[]) => void;
400
+ /**
401
+ * Update a behavior on a mode.
402
+ * @param behavior behavior configs, whose name indicates the behavior to be updated
403
+ * @param mode mode name
404
+ * @returns
405
+ * @group Interaction
406
+ */
407
+ updateBehavior: (behavior: BehaviorOptionsOf<B>, mode?: string) => void;
408
+ /**
409
+ * Draw or update a G shape or group to the transient canvas.
410
+ * @param type shape type or item type
411
+ * @param id new shape id or updated shape id for a interation shape, node/edge/combo id for item interaction group drawing
412
+ * @returns upserted shape or group
413
+ * @group Interaction
414
+ */
415
+ drawTransient: (type: ITEM_TYPE | SHAPE_TYPE, id: ID, config: any) => DisplayObject;
416
+ /**
417
+ * Add plugin(s) to graph.
418
+ * @param pluginCfgs
419
+ * @returns
420
+ * @group Plugin
421
+ */
422
+ addPlugins: (pluginCfgs: {
423
+ key: string;
424
+ type: string;
425
+ [cfgName: string]: unknown;
426
+ }[]) => void;
427
+ /**
428
+ * Remove plugin(s) from graph.
429
+ * @param pluginCfgs
430
+ * @returns
431
+ * @group Plugin
432
+ */
433
+ removePlugins: (pluginKeys: string[]) => void;
434
+ /**
435
+ * Update one plugin of the graph.
436
+ * @param pluginCfgs
437
+ * @returns
438
+ * @group Plugin
439
+ */
440
+ updatePlugin: (pluginCfg: {
441
+ key: string;
442
+ type: string;
443
+ [cfgName: string]: unknown;
444
+ }) => void;
445
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=graph.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graph.js","sourceRoot":"src/","sources":["types/graph.ts"],"names":[],"mappings":""}