@antv/g6 5.0.0-beta.1 → 5.0.0-beta.11

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 (409) hide show
  1. package/dist/g6.min.js +2 -2
  2. package/esm/constant/shape.d.ts +4 -1
  3. package/esm/constant/shape.js.map +1 -1
  4. package/esm/index.d.ts +22 -7
  5. package/esm/index.js +3 -2
  6. package/esm/index.js.map +1 -1
  7. package/esm/item/combo.d.ts +1 -1
  8. package/esm/item/combo.js +16 -9
  9. package/esm/item/combo.js.map +1 -1
  10. package/esm/item/edge.d.ts +20 -3
  11. package/esm/item/edge.js +99 -43
  12. package/esm/item/edge.js.map +1 -1
  13. package/esm/item/item.d.ts +3 -2
  14. package/esm/item/item.js +21 -11
  15. package/esm/item/item.js.map +1 -1
  16. package/esm/item/node.d.ts +2 -1
  17. package/esm/item/node.js +32 -16
  18. package/esm/item/node.js.map +1 -1
  19. package/esm/runtime/controller/data.d.ts +7 -10
  20. package/esm/runtime/controller/data.js +125 -281
  21. package/esm/runtime/controller/data.js.map +1 -1
  22. package/esm/runtime/controller/item.d.ts +1 -0
  23. package/esm/runtime/controller/item.js +267 -151
  24. package/esm/runtime/controller/item.js.map +1 -1
  25. package/esm/runtime/graph.d.ts +103 -23
  26. package/esm/runtime/graph.js +460 -88
  27. package/esm/runtime/graph.js.map +1 -1
  28. package/esm/stdlib/behavior/activate-relations.d.ts +9 -9
  29. package/esm/stdlib/behavior/activate-relations.js +8 -8
  30. package/esm/stdlib/behavior/activate-relations.js.map +1 -1
  31. package/esm/stdlib/behavior/brush-select.js +1 -2
  32. package/esm/stdlib/behavior/brush-select.js.map +1 -1
  33. package/esm/stdlib/behavior/click-select.js +1 -1
  34. package/esm/stdlib/behavior/click-select.js.map +1 -1
  35. package/esm/stdlib/behavior/create-edge.d.ts +57 -0
  36. package/esm/stdlib/behavior/create-edge.js +207 -0
  37. package/esm/stdlib/behavior/create-edge.js.map +1 -0
  38. package/esm/stdlib/behavior/drag-canvas.d.ts +2 -1
  39. package/esm/stdlib/behavior/drag-canvas.js +59 -28
  40. package/esm/stdlib/behavior/drag-canvas.js.map +1 -1
  41. package/esm/stdlib/behavior/drag-combo.d.ts +2 -2
  42. package/esm/stdlib/behavior/drag-combo.js +43 -32
  43. package/esm/stdlib/behavior/drag-combo.js.map +1 -1
  44. package/esm/stdlib/behavior/drag-node.d.ts +3 -3
  45. package/esm/stdlib/behavior/drag-node.js +76 -63
  46. package/esm/stdlib/behavior/drag-node.js.map +1 -1
  47. package/esm/stdlib/behavior/index.d.ts +3 -0
  48. package/esm/stdlib/behavior/index.js +3 -0
  49. package/esm/stdlib/behavior/index.js.map +1 -1
  50. package/esm/stdlib/behavior/lasso-select.d.ts +1 -1
  51. package/esm/stdlib/behavior/lasso-select.js +1 -2
  52. package/esm/stdlib/behavior/lasso-select.js.map +1 -1
  53. package/esm/stdlib/behavior/scroll-canvas.d.ts +67 -0
  54. package/esm/stdlib/behavior/scroll-canvas.js +266 -0
  55. package/esm/stdlib/behavior/scroll-canvas.js.map +1 -0
  56. package/esm/stdlib/behavior/shortcuts-call.d.ts +38 -0
  57. package/esm/stdlib/behavior/shortcuts-call.js +80 -0
  58. package/esm/stdlib/behavior/shortcuts-call.js.map +1 -0
  59. package/esm/stdlib/behavior/zoom-canvas.d.ts +2 -1
  60. package/esm/stdlib/behavior/zoom-canvas.js +55 -24
  61. package/esm/stdlib/behavior/zoom-canvas.js.map +1 -1
  62. package/esm/stdlib/data/mapNodeSize.d.ts +2 -2
  63. package/esm/stdlib/data/mapNodeSize.js +2 -2
  64. package/esm/stdlib/data/mapNodeSize.js.map +1 -1
  65. package/esm/stdlib/data/transformV4Data.d.ts +2 -2
  66. package/esm/stdlib/data/transformV4Data.js +2 -2
  67. package/esm/stdlib/data/transformV4Data.js.map +1 -1
  68. package/esm/stdlib/data/validateData.d.ts +2 -2
  69. package/esm/stdlib/data/validateData.js +9 -9
  70. package/esm/stdlib/data/validateData.js.map +1 -1
  71. package/esm/stdlib/index.d.ts +16 -6
  72. package/esm/stdlib/index.js +20 -10
  73. package/esm/stdlib/index.js.map +1 -1
  74. package/esm/stdlib/item/edge/base.d.ts +10 -1
  75. package/esm/stdlib/item/edge/base.js +20 -13
  76. package/esm/stdlib/item/edge/base.js.map +1 -1
  77. package/esm/stdlib/item/edge/line.js +5 -2
  78. package/esm/stdlib/item/edge/line.js.map +1 -1
  79. package/esm/stdlib/item/edge/polyline.d.ts +3 -2
  80. package/esm/stdlib/item/edge/polyline.js +3 -3
  81. package/esm/stdlib/item/edge/polyline.js.map +1 -1
  82. package/esm/stdlib/item/node/base.d.ts +1 -1
  83. package/esm/stdlib/item/node/base.js +18 -26
  84. package/esm/stdlib/item/node/base.js.map +1 -1
  85. package/esm/stdlib/item/node/base3d.d.ts +1 -0
  86. package/esm/stdlib/item/node/base3d.js +1 -0
  87. package/esm/stdlib/item/node/base3d.js.map +1 -1
  88. package/esm/stdlib/item/node/diamond.js +1 -1
  89. package/esm/stdlib/item/node/ellipse.js +2 -2
  90. package/esm/stdlib/item/node/hexagon.js +12 -5
  91. package/esm/stdlib/item/node/hexagon.js.map +1 -1
  92. package/esm/stdlib/item/node/image.d.ts +40 -0
  93. package/esm/stdlib/item/node/image.js +110 -0
  94. package/esm/stdlib/item/node/image.js.map +1 -0
  95. package/esm/stdlib/item/node/index.d.ts +1 -0
  96. package/esm/stdlib/item/node/index.js +1 -0
  97. package/esm/stdlib/item/node/index.js.map +1 -1
  98. package/esm/stdlib/plugin/history/combo-command.js +2 -2
  99. package/esm/stdlib/plugin/history/combo-command.js.map +1 -1
  100. package/esm/stdlib/plugin/history/index.d.ts +10 -10
  101. package/esm/stdlib/plugin/history/index.js +14 -14
  102. package/esm/stdlib/plugin/history/index.js.map +1 -1
  103. package/esm/stdlib/plugin/history/item-data-command.js +25 -16
  104. package/esm/stdlib/plugin/history/item-data-command.js.map +1 -1
  105. package/esm/stdlib/plugin/history/layer-updated-command.js +2 -2
  106. package/esm/stdlib/plugin/history/layer-updated-command.js.map +1 -1
  107. package/esm/stdlib/plugin/history/state-updated-command.js +1 -1
  108. package/esm/stdlib/plugin/history/state-updated-command.js.map +1 -1
  109. package/esm/stdlib/plugin/history/visibility-updated-command.js +2 -2
  110. package/esm/stdlib/plugin/history/visibility-updated-command.js.map +1 -1
  111. package/esm/stdlib/plugin/hull/hullComponent.d.ts +1 -1
  112. package/esm/stdlib/plugin/hull/hullComponent.js +3 -6
  113. package/esm/stdlib/plugin/hull/hullComponent.js.map +1 -1
  114. package/esm/stdlib/plugin/index.d.ts +2 -0
  115. package/esm/stdlib/plugin/index.js +2 -0
  116. package/esm/stdlib/plugin/index.js.map +1 -1
  117. package/esm/stdlib/plugin/legend/index.js +1 -1
  118. package/esm/stdlib/plugin/legend/index.js.map +1 -1
  119. package/esm/stdlib/plugin/map/index.d.ts +118 -0
  120. package/esm/stdlib/plugin/map/index.js +683 -0
  121. package/esm/stdlib/plugin/map/index.js.map +1 -0
  122. package/esm/stdlib/plugin/minimap/index.d.ts +5 -1
  123. package/esm/stdlib/plugin/minimap/index.js +116 -9
  124. package/esm/stdlib/plugin/minimap/index.js.map +1 -1
  125. package/esm/stdlib/plugin/snapline/index.d.ts +167 -0
  126. package/esm/stdlib/plugin/snapline/index.js +1063 -0
  127. package/esm/stdlib/plugin/snapline/index.js.map +1 -0
  128. package/esm/stdlib/plugin/timebar/index.d.ts +98 -0
  129. package/esm/stdlib/plugin/timebar/index.js +303 -0
  130. package/esm/stdlib/plugin/timebar/index.js.map +1 -0
  131. package/esm/stdlib/plugin/toolbar/index.js +1 -1
  132. package/esm/stdlib/plugin/toolbar/index.js.map +1 -1
  133. package/esm/stdlib/plugin/types.d.ts +2 -0
  134. package/esm/stdlib/theme/dark.js +42 -2
  135. package/esm/stdlib/theme/dark.js.map +1 -1
  136. package/esm/stdlib/theme/light.js +4 -4
  137. package/esm/types/common.d.ts +1 -0
  138. package/esm/types/event.d.ts +1 -0
  139. package/esm/types/graph.d.ts +48 -22
  140. package/esm/types/hook.d.ts +22 -2
  141. package/esm/types/item.d.ts +6 -0
  142. package/esm/types/item.js.map +1 -1
  143. package/esm/types/spec.d.ts +19 -3
  144. package/esm/types/view.d.ts +5 -0
  145. package/esm/util/bbox.d.ts +16 -1
  146. package/esm/util/bbox.js +29 -0
  147. package/esm/util/bbox.js.map +1 -1
  148. package/esm/util/canvas.d.ts +2 -2
  149. package/esm/util/canvas.js +5 -11
  150. package/esm/util/canvas.js.map +1 -1
  151. package/esm/util/event.d.ts +3 -1
  152. package/esm/util/event.js +8 -1
  153. package/esm/util/event.js.map +1 -1
  154. package/esm/util/item.d.ts +16 -1
  155. package/esm/util/item.js +31 -8
  156. package/esm/util/item.js.map +1 -1
  157. package/esm/util/layout.d.ts +11 -0
  158. package/esm/util/layout.js +45 -0
  159. package/esm/util/layout.js.map +1 -1
  160. package/esm/util/point.js +9 -2
  161. package/esm/util/point.js.map +1 -1
  162. package/esm/util/router.d.ts +4 -3
  163. package/esm/util/router.js +8 -5
  164. package/esm/util/router.js.map +1 -1
  165. package/esm/util/shape.d.ts +3 -3
  166. package/esm/util/shape.js +8 -12
  167. package/esm/util/shape.js.map +1 -1
  168. package/esm/util/warn.d.ts +14 -0
  169. package/esm/util/warn.js +4 -0
  170. package/esm/util/warn.js.map +1 -0
  171. package/lib/constant/shape.d.ts +4 -1
  172. package/lib/constant/shape.js.map +1 -1
  173. package/lib/index.d.ts +22 -7
  174. package/lib/index.js +4 -2
  175. package/lib/index.js.map +1 -1
  176. package/lib/item/combo.d.ts +1 -1
  177. package/lib/item/combo.js +16 -9
  178. package/lib/item/combo.js.map +1 -1
  179. package/lib/item/edge.d.ts +20 -3
  180. package/lib/item/edge.js +98 -42
  181. package/lib/item/edge.js.map +1 -1
  182. package/lib/item/item.d.ts +3 -2
  183. package/lib/item/item.js +21 -11
  184. package/lib/item/item.js.map +1 -1
  185. package/lib/item/node.d.ts +2 -1
  186. package/lib/item/node.js +32 -16
  187. package/lib/item/node.js.map +1 -1
  188. package/lib/runtime/controller/data.d.ts +7 -10
  189. package/lib/runtime/controller/data.js +125 -281
  190. package/lib/runtime/controller/data.js.map +1 -1
  191. package/lib/runtime/controller/item.d.ts +1 -0
  192. package/lib/runtime/controller/item.js +266 -150
  193. package/lib/runtime/controller/item.js.map +1 -1
  194. package/lib/runtime/graph.d.ts +103 -23
  195. package/lib/runtime/graph.js +460 -88
  196. package/lib/runtime/graph.js.map +1 -1
  197. package/lib/stdlib/behavior/activate-relations.d.ts +9 -9
  198. package/lib/stdlib/behavior/activate-relations.js +8 -8
  199. package/lib/stdlib/behavior/activate-relations.js.map +1 -1
  200. package/lib/stdlib/behavior/brush-select.js +1 -2
  201. package/lib/stdlib/behavior/brush-select.js.map +1 -1
  202. package/lib/stdlib/behavior/click-select.js +1 -1
  203. package/lib/stdlib/behavior/click-select.js.map +1 -1
  204. package/lib/stdlib/behavior/create-edge.d.ts +57 -0
  205. package/lib/stdlib/behavior/create-edge.js +211 -0
  206. package/lib/stdlib/behavior/create-edge.js.map +1 -0
  207. package/lib/stdlib/behavior/drag-canvas.d.ts +2 -1
  208. package/lib/stdlib/behavior/drag-canvas.js +59 -28
  209. package/lib/stdlib/behavior/drag-canvas.js.map +1 -1
  210. package/lib/stdlib/behavior/drag-combo.d.ts +2 -2
  211. package/lib/stdlib/behavior/drag-combo.js +43 -32
  212. package/lib/stdlib/behavior/drag-combo.js.map +1 -1
  213. package/lib/stdlib/behavior/drag-node.d.ts +3 -3
  214. package/lib/stdlib/behavior/drag-node.js +76 -63
  215. package/lib/stdlib/behavior/drag-node.js.map +1 -1
  216. package/lib/stdlib/behavior/index.d.ts +3 -0
  217. package/lib/stdlib/behavior/index.js +3 -0
  218. package/lib/stdlib/behavior/index.js.map +1 -1
  219. package/lib/stdlib/behavior/lasso-select.d.ts +1 -1
  220. package/lib/stdlib/behavior/lasso-select.js +1 -2
  221. package/lib/stdlib/behavior/lasso-select.js.map +1 -1
  222. package/lib/stdlib/behavior/scroll-canvas.d.ts +67 -0
  223. package/lib/stdlib/behavior/scroll-canvas.js +270 -0
  224. package/lib/stdlib/behavior/scroll-canvas.js.map +1 -0
  225. package/lib/stdlib/behavior/shortcuts-call.d.ts +38 -0
  226. package/lib/stdlib/behavior/shortcuts-call.js +84 -0
  227. package/lib/stdlib/behavior/shortcuts-call.js.map +1 -0
  228. package/lib/stdlib/behavior/zoom-canvas.d.ts +2 -1
  229. package/lib/stdlib/behavior/zoom-canvas.js +55 -24
  230. package/lib/stdlib/behavior/zoom-canvas.js.map +1 -1
  231. package/lib/stdlib/data/mapNodeSize.d.ts +2 -2
  232. package/lib/stdlib/data/mapNodeSize.js +2 -2
  233. package/lib/stdlib/data/mapNodeSize.js.map +1 -1
  234. package/lib/stdlib/data/transformV4Data.d.ts +2 -2
  235. package/lib/stdlib/data/transformV4Data.js +2 -2
  236. package/lib/stdlib/data/transformV4Data.js.map +1 -1
  237. package/lib/stdlib/data/validateData.d.ts +2 -2
  238. package/lib/stdlib/data/validateData.js +9 -9
  239. package/lib/stdlib/data/validateData.js.map +1 -1
  240. package/lib/stdlib/index.d.ts +16 -6
  241. package/lib/stdlib/index.js +20 -10
  242. package/lib/stdlib/index.js.map +1 -1
  243. package/lib/stdlib/item/edge/base.d.ts +10 -1
  244. package/lib/stdlib/item/edge/base.js +20 -13
  245. package/lib/stdlib/item/edge/base.js.map +1 -1
  246. package/lib/stdlib/item/edge/line.js +5 -2
  247. package/lib/stdlib/item/edge/line.js.map +1 -1
  248. package/lib/stdlib/item/edge/polyline.d.ts +3 -2
  249. package/lib/stdlib/item/edge/polyline.js +3 -3
  250. package/lib/stdlib/item/edge/polyline.js.map +1 -1
  251. package/lib/stdlib/item/node/base.d.ts +1 -1
  252. package/lib/stdlib/item/node/base.js +18 -26
  253. package/lib/stdlib/item/node/base.js.map +1 -1
  254. package/lib/stdlib/item/node/base3d.d.ts +1 -0
  255. package/lib/stdlib/item/node/base3d.js +1 -0
  256. package/lib/stdlib/item/node/base3d.js.map +1 -1
  257. package/lib/stdlib/item/node/diamond.js +1 -1
  258. package/lib/stdlib/item/node/ellipse.js +2 -2
  259. package/lib/stdlib/item/node/hexagon.js +12 -5
  260. package/lib/stdlib/item/node/hexagon.js.map +1 -1
  261. package/lib/stdlib/item/node/image.d.ts +40 -0
  262. package/lib/stdlib/item/node/image.js +114 -0
  263. package/lib/stdlib/item/node/image.js.map +1 -0
  264. package/lib/stdlib/item/node/index.d.ts +1 -0
  265. package/lib/stdlib/item/node/index.js +1 -0
  266. package/lib/stdlib/item/node/index.js.map +1 -1
  267. package/lib/stdlib/plugin/history/combo-command.js +2 -2
  268. package/lib/stdlib/plugin/history/combo-command.js.map +1 -1
  269. package/lib/stdlib/plugin/history/index.d.ts +10 -10
  270. package/lib/stdlib/plugin/history/index.js +14 -14
  271. package/lib/stdlib/plugin/history/index.js.map +1 -1
  272. package/lib/stdlib/plugin/history/item-data-command.js +25 -16
  273. package/lib/stdlib/plugin/history/item-data-command.js.map +1 -1
  274. package/lib/stdlib/plugin/history/layer-updated-command.js +2 -2
  275. package/lib/stdlib/plugin/history/layer-updated-command.js.map +1 -1
  276. package/lib/stdlib/plugin/history/state-updated-command.js +1 -1
  277. package/lib/stdlib/plugin/history/state-updated-command.js.map +1 -1
  278. package/lib/stdlib/plugin/history/visibility-updated-command.js +2 -2
  279. package/lib/stdlib/plugin/history/visibility-updated-command.js.map +1 -1
  280. package/lib/stdlib/plugin/hull/hullComponent.d.ts +1 -1
  281. package/lib/stdlib/plugin/hull/hullComponent.js +3 -6
  282. package/lib/stdlib/plugin/hull/hullComponent.js.map +1 -1
  283. package/lib/stdlib/plugin/index.d.ts +2 -0
  284. package/lib/stdlib/plugin/index.js +2 -0
  285. package/lib/stdlib/plugin/index.js.map +1 -1
  286. package/lib/stdlib/plugin/legend/index.js +1 -1
  287. package/lib/stdlib/plugin/legend/index.js.map +1 -1
  288. package/lib/stdlib/plugin/map/index.d.ts +118 -0
  289. package/lib/stdlib/plugin/map/index.js +687 -0
  290. package/lib/stdlib/plugin/map/index.js.map +1 -0
  291. package/lib/stdlib/plugin/minimap/index.d.ts +5 -1
  292. package/lib/stdlib/plugin/minimap/index.js +116 -9
  293. package/lib/stdlib/plugin/minimap/index.js.map +1 -1
  294. package/lib/stdlib/plugin/snapline/index.d.ts +167 -0
  295. package/lib/stdlib/plugin/snapline/index.js +1067 -0
  296. package/lib/stdlib/plugin/snapline/index.js.map +1 -0
  297. package/lib/stdlib/plugin/timebar/index.d.ts +98 -0
  298. package/lib/stdlib/plugin/timebar/index.js +307 -0
  299. package/lib/stdlib/plugin/timebar/index.js.map +1 -0
  300. package/lib/stdlib/plugin/toolbar/index.js +1 -1
  301. package/lib/stdlib/plugin/toolbar/index.js.map +1 -1
  302. package/lib/stdlib/plugin/types.d.ts +2 -0
  303. package/lib/stdlib/theme/dark.js +42 -2
  304. package/lib/stdlib/theme/dark.js.map +1 -1
  305. package/lib/stdlib/theme/light.js +4 -4
  306. package/lib/types/common.d.ts +1 -0
  307. package/lib/types/event.d.ts +1 -0
  308. package/lib/types/graph.d.ts +48 -22
  309. package/lib/types/hook.d.ts +22 -2
  310. package/lib/types/item.d.ts +6 -0
  311. package/lib/types/item.js.map +1 -1
  312. package/lib/types/spec.d.ts +19 -3
  313. package/lib/types/view.d.ts +5 -0
  314. package/lib/util/bbox.d.ts +16 -1
  315. package/lib/util/bbox.js +32 -1
  316. package/lib/util/bbox.js.map +1 -1
  317. package/lib/util/canvas.d.ts +2 -2
  318. package/lib/util/canvas.js +5 -11
  319. package/lib/util/canvas.js.map +1 -1
  320. package/lib/util/event.d.ts +3 -1
  321. package/lib/util/event.js +8 -1
  322. package/lib/util/event.js.map +1 -1
  323. package/lib/util/item.d.ts +16 -1
  324. package/lib/util/item.js +33 -9
  325. package/lib/util/item.js.map +1 -1
  326. package/lib/util/layout.d.ts +11 -0
  327. package/lib/util/layout.js +47 -1
  328. package/lib/util/layout.js.map +1 -1
  329. package/lib/util/point.js +9 -2
  330. package/lib/util/point.js.map +1 -1
  331. package/lib/util/router.d.ts +4 -3
  332. package/lib/util/router.js +8 -5
  333. package/lib/util/router.js.map +1 -1
  334. package/lib/util/shape.d.ts +3 -3
  335. package/lib/util/shape.js +8 -12
  336. package/lib/util/shape.js.map +1 -1
  337. package/lib/util/warn.d.ts +14 -0
  338. package/lib/util/warn.js +8 -0
  339. package/lib/util/warn.js.map +1 -0
  340. package/package.json +10 -10
  341. package/src/constant/shape.ts +2 -1
  342. package/src/index.ts +4 -2
  343. package/src/item/combo.ts +14 -9
  344. package/src/item/edge.ts +131 -57
  345. package/src/item/item.ts +24 -15
  346. package/src/item/node.ts +37 -24
  347. package/src/runtime/controller/data.ts +140 -339
  348. package/src/runtime/controller/item.ts +236 -72
  349. package/src/runtime/graph.ts +592 -96
  350. package/src/stdlib/behavior/activate-relations.ts +8 -8
  351. package/src/stdlib/behavior/brush-select.ts +4 -2
  352. package/src/stdlib/behavior/click-select.ts +1 -1
  353. package/src/stdlib/behavior/create-edge.ts +296 -0
  354. package/src/stdlib/behavior/drag-canvas.ts +78 -29
  355. package/src/stdlib/behavior/drag-combo.ts +10 -10
  356. package/src/stdlib/behavior/drag-node.ts +18 -18
  357. package/src/stdlib/behavior/index.ts +3 -0
  358. package/src/stdlib/behavior/lasso-select.ts +5 -3
  359. package/src/stdlib/behavior/scroll-canvas.ts +348 -0
  360. package/src/stdlib/behavior/shortcuts-call.ts +120 -0
  361. package/src/stdlib/behavior/zoom-canvas.ts +72 -25
  362. package/src/stdlib/data/mapNodeSize.ts +2 -2
  363. package/src/stdlib/data/transformV4Data.ts +2 -2
  364. package/src/stdlib/data/validateData.ts +9 -9
  365. package/src/stdlib/index.ts +33 -9
  366. package/src/stdlib/item/edge/base.ts +26 -13
  367. package/src/stdlib/item/edge/line.ts +8 -2
  368. package/src/stdlib/item/edge/polyline.ts +7 -5
  369. package/src/stdlib/item/node/base.ts +24 -29
  370. package/src/stdlib/item/node/base3d.ts +1 -0
  371. package/src/stdlib/item/node/diamond.ts +1 -1
  372. package/src/stdlib/item/node/ellipse.ts +2 -2
  373. package/src/stdlib/item/node/hexagon.ts +14 -6
  374. package/src/stdlib/item/node/image.ts +190 -0
  375. package/src/stdlib/item/node/index.ts +1 -0
  376. package/src/stdlib/plugin/history/combo-command.ts +2 -2
  377. package/src/stdlib/plugin/history/index.ts +14 -14
  378. package/src/stdlib/plugin/history/item-data-command.ts +35 -17
  379. package/src/stdlib/plugin/history/layer-updated-command.ts +2 -2
  380. package/src/stdlib/plugin/history/state-updated-command.ts +1 -1
  381. package/src/stdlib/plugin/history/visibility-updated-command.ts +2 -2
  382. package/src/stdlib/plugin/hull/hullComponent.ts +8 -5
  383. package/src/stdlib/plugin/index.ts +2 -0
  384. package/src/stdlib/plugin/legend/index.ts +1 -1
  385. package/src/stdlib/plugin/map/index.ts +808 -0
  386. package/src/stdlib/plugin/minimap/index.ts +120 -10
  387. package/src/stdlib/plugin/snapline/index.ts +1297 -0
  388. package/src/stdlib/plugin/timebar/index.ts +473 -0
  389. package/src/stdlib/plugin/toolbar/index.ts +1 -1
  390. package/src/stdlib/plugin/types.ts +2 -0
  391. package/src/stdlib/theme/dark.ts +66 -2
  392. package/src/stdlib/theme/light.ts +4 -4
  393. package/src/types/common.ts +1 -0
  394. package/src/types/event.ts +1 -0
  395. package/src/types/graph.ts +59 -25
  396. package/src/types/hook.ts +22 -2
  397. package/src/types/item.ts +10 -0
  398. package/src/types/spec.ts +22 -3
  399. package/src/types/view.ts +8 -3
  400. package/src/util/bbox.ts +38 -1
  401. package/src/util/canvas.ts +5 -5
  402. package/src/util/event.ts +14 -1
  403. package/src/util/item.ts +65 -28
  404. package/src/util/layout.ts +45 -0
  405. package/src/util/point.ts +8 -3
  406. package/src/util/router.ts +15 -6
  407. package/src/util/shape.ts +16 -14
  408. package/src/util/warn.ts +20 -0
  409. package/src/api-doc/readme.md +0 -59
@@ -0,0 +1,473 @@
1
+ import { createDom } from '@antv/dom-util';
2
+ import { Canvas } from '@antv/g';
3
+ import type { TimebarStyleProps } from '@antv/gui';
4
+ import { Timebar as GUITimebar } from '@antv/gui';
5
+ import { deepMix } from '@antv/util';
6
+ import type { EdgeModel, NodeModel } from '../../../types';
7
+ import { GraphData, IGraph } from '../../../types';
8
+ import type { Padding } from '../../../types/common';
9
+ import type { ITEM_TYPE } from '../../../types/item';
10
+ import { Plugin as Base, IPluginBaseConfig } from '../../../types/plugin';
11
+ import { createCanvas } from '../../../util/canvas';
12
+ import { formatPadding } from '../../../util/shape';
13
+
14
+ // -- start -- Adapt to GUI -- start --
15
+ type SubStyleProps<T, Prefix extends string> = {
16
+ [K in keyof T as K extends `${Prefix}${infer Rest}`
17
+ ? Uncapitalize<Rest>
18
+ : never]: T[K];
19
+ };
20
+
21
+ const prefixStyleProps = (style: Record<string, any>, prefix: string) => {
22
+ const result: Record<string, any> = {};
23
+ Object.entries(style).forEach(([key, val]) => {
24
+ const newKey = `${prefix}${key[0].toUpperCase()}${key.slice(1)}`;
25
+ result[newKey] = val;
26
+ });
27
+ return result;
28
+ };
29
+ // -- end -- Adapt to GUI -- end --
30
+
31
+ type Model = NodeModel | EdgeModel;
32
+ type ItemType = Extract<ITEM_TYPE, 'node' | 'edge'>;
33
+
34
+ type STATE = {
35
+ nodes: { enter: Model[]; exit: Model[] };
36
+ edges: { enter: Model[]; exit: Model[] };
37
+ };
38
+
39
+ type Datum = Record<string, any>;
40
+
41
+ export interface TimebarConfig
42
+ extends IPluginBaseConfig,
43
+ Pick<
44
+ TimebarStyleProps,
45
+ | 'playMode'
46
+ | 'values'
47
+ | 'labelFormatter'
48
+ | 'interval'
49
+ | 'loop'
50
+ | 'onChange'
51
+ | 'onBackward'
52
+ | 'onPause'
53
+ | 'onPlay'
54
+ | 'onForward'
55
+ | 'onSelectionTypeChange'
56
+ | 'onChartTypeChange'
57
+ > {
58
+ /** specific the x pos of timebar manually */
59
+ x?: number;
60
+ /** specific the y pos of timebar manually */
61
+ y?: number;
62
+ /** width of timebar */
63
+ width?: number;
64
+ /** height of timebar */
65
+ height?: number;
66
+ /** padding of timebar */
67
+ padding?: Padding;
68
+ /** data of timebar */
69
+ data: Datum[];
70
+ /**
71
+ * position of the timebar relative to graph
72
+ * @description it will be failure if x or y is specified
73
+ */
74
+ position?: 'bottom';
75
+ timebarType: TimebarStyleProps['type'];
76
+ /**
77
+ * how to filter the graph data, default is modify
78
+ * @description modify: the graph data will be changed by addItem or removeItem
79
+ * @description visibility: the graph item will be hidden or shown
80
+ */
81
+ filterType?: 'modify' | 'visibility';
82
+ /** filter item by specific types */
83
+ filterItemTypes?: ItemType[];
84
+ /** describe how to get time from item */
85
+ getTimeFromItem?: (model: Model, itemType: ItemType) => number | Date;
86
+ /** describe how to get time from timebar data */
87
+ getTimeFromData?: (datum: Datum) => number | Date;
88
+ /** describe how to get value from timebar data */
89
+ getValueFromData?: (datum: Datum) => number;
90
+ /** determines whether an item should be ignored during the filtering process */
91
+ shouldIgnore?: (
92
+ model: Model,
93
+ itemType: ItemType,
94
+ dateRange: number | Date | [number, number] | [Date, Date],
95
+ ) => boolean;
96
+ /**
97
+ * manage graph manually when timebar range/value change
98
+ * @description if it is not specified, the graph will be filtered by default
99
+ */
100
+ filter?: (
101
+ graph: IGraph,
102
+ values: Parameters<TimebarStyleProps['onChange']>,
103
+ ) => void;
104
+ axisStyle?: SubStyleProps<TimebarStyleProps, 'axis'>;
105
+ chartStyle?: SubStyleProps<TimebarStyleProps, 'chart'>;
106
+ controllerStyle?: SubStyleProps<TimebarStyleProps, 'controller'>;
107
+ }
108
+
109
+ const prospectiveTimeKeys = ['timestamp', 'time', 'date', 'datetime'];
110
+ const prospectiveValueKeys = ['value', 'date'];
111
+
112
+ const tryToGet = <T = any>(
113
+ datum: Datum,
114
+ optionsKeys: string[],
115
+ defaultValue?: T,
116
+ ) => {
117
+ for (let i = 0; i < optionsKeys.length; i++) {
118
+ const key = optionsKeys[i];
119
+ const val = datum?.[key] as T;
120
+ if (val) return val;
121
+ }
122
+ return defaultValue;
123
+ };
124
+
125
+ export class Timebar extends Base {
126
+ private wrapper: HTMLDivElement;
127
+ private canvas: Canvas;
128
+ private timebar: GUITimebar;
129
+ private graphDataCache: GraphData;
130
+ private itemTypes: ItemType[] = ['node', 'edge'];
131
+
132
+ private get padding() {
133
+ return formatPadding(this.options.padding);
134
+ }
135
+
136
+ private get containerShape() {
137
+ const { width, height } = this.options;
138
+ const [top, right, bottom, left] = this.padding;
139
+ /** extra height for speed select to avoid being cut */
140
+ const extraHeightForSpeedSelect = 30;
141
+
142
+ return {
143
+ x: left,
144
+ y: top,
145
+ width: width + left + right,
146
+ height: height + top + bottom + extraHeightForSpeedSelect,
147
+ };
148
+ }
149
+
150
+ private get data() {
151
+ const { graph } = this;
152
+ return { nodes: graph.getAllNodesData(), edges: graph.getAllEdgesData() };
153
+ }
154
+
155
+ constructor(options?: TimebarConfig) {
156
+ super(options);
157
+ }
158
+
159
+ public getDefaultCfgs(): TimebarConfig {
160
+ // @ts-ignore
161
+ const configuration: TimebarConfig = {
162
+ axisStyle: {},
163
+ className: 'g6-component-timebar',
164
+ controllerStyle: {},
165
+ data: [],
166
+ filterItemTypes: ['node'],
167
+ filterType: 'modify',
168
+ getTimeFromItem: (model) =>
169
+ tryToGet<number | Date>(model.data, prospectiveTimeKeys, undefined),
170
+ getTimeFromData: (datum) =>
171
+ tryToGet<number | Date>(datum, prospectiveTimeKeys, undefined),
172
+ getValueFromItem: (datum) => tryToGet(datum, prospectiveValueKeys, 0),
173
+ height: 60,
174
+ padding: 10,
175
+ position: 'bottom',
176
+ timebarType: 'time',
177
+ width: 200,
178
+ };
179
+ return configuration;
180
+ }
181
+
182
+ public getEvents() {
183
+ return {
184
+ afterrender: this.updateTimebar,
185
+ afterchangedata: this.handleDataChange,
186
+ };
187
+ }
188
+
189
+ public init(graph: IGraph) {
190
+ super.init(graph);
191
+ }
192
+
193
+ /** reset */
194
+ public reset() {
195
+ this.timebar.reset();
196
+ }
197
+
198
+ /** backward */
199
+ public backward() {
200
+ this.timebar.backward();
201
+ }
202
+
203
+ /** play */
204
+ public play() {
205
+ this.timebar.play();
206
+ }
207
+
208
+ /** pause */
209
+ public pause() {
210
+ this.timebar.pause();
211
+ }
212
+
213
+ /** forward */
214
+ public forward() {
215
+ this.timebar.forward();
216
+ }
217
+
218
+ public destroy() {
219
+ this.canvas.destroy();
220
+ super.destroy();
221
+ }
222
+
223
+ /** Get the container of timebar */
224
+ private get container(): HTMLElement {
225
+ const { container } = this.options;
226
+ if (container instanceof HTMLElement) return container;
227
+ const element = document.getElementById(container);
228
+ if (element) return element;
229
+ return this.graph.container;
230
+ }
231
+
232
+ /** Create a wrapper div for timebar */
233
+ private createWrapper() {
234
+ const { options } = this;
235
+ const { className } = options;
236
+ const { width, height } = this.containerShape;
237
+
238
+ const wrapper = (HTMLDivElement = createDom(
239
+ `<div class="${className}" style="width: ${width}px;height: ${height}"></div>`,
240
+ ));
241
+ this.container.appendChild(wrapper);
242
+ return wrapper;
243
+ }
244
+
245
+ private createCanvas() {
246
+ const { width, height } = this.containerShape;
247
+ const canvas = createCanvas(
248
+ 'canvas',
249
+ this.wrapper,
250
+ width,
251
+ height,
252
+ undefined,
253
+ { background: '#fff' },
254
+ );
255
+ return canvas;
256
+ }
257
+
258
+ private updateTimebar() {
259
+ if (!this.wrapper) this.wrapper = this.createWrapper();
260
+ if (!this.canvas) this.canvas = this.createCanvas();
261
+
262
+ this.canvas.ready.then(() => {
263
+ this.renderTimebar();
264
+ });
265
+ }
266
+
267
+ private updatePosition() {
268
+ const { graph } = this;
269
+ const { x, y } = this.options;
270
+ const { width } = this.containerShape;
271
+ const { position } = this.options;
272
+ const [graphWidth, graphHeight] = graph.getSize();
273
+
274
+ // if x or y is not specified, calculate the position
275
+ if (!x && !y) {
276
+ switch (position) {
277
+ case 'bottom':
278
+ this.wrapper.style.top = graphHeight + 'px';
279
+ this.wrapper.style.left = (graphWidth - width) / 2 + 'px';
280
+ break;
281
+ }
282
+ }
283
+ }
284
+
285
+ private renderTimebar() {
286
+ const { x, y } = this.containerShape;
287
+ const {
288
+ x: ignoreX,
289
+ y: ignoreY,
290
+ axisStyle = {},
291
+ chartStyle = {},
292
+ className,
293
+ container,
294
+ controllerStyle = {},
295
+ data: userDefinedData,
296
+ filter,
297
+ filterItemTypes,
298
+ filterType,
299
+ getTimeFromData,
300
+ getTimeFromItem,
301
+ getValueFromData,
302
+ onChange,
303
+ padding,
304
+ position,
305
+ shouldIgnore,
306
+ timebarType,
307
+ type,
308
+ ...userDefinedOptions
309
+ } = this.options;
310
+
311
+ const data = userDefinedData.map((datum) => ({
312
+ time: getTimeFromData?.(datum) || datum?.time,
313
+ value: getValueFromData?.(datum) || datum?.value,
314
+ }));
315
+
316
+ const style: TimebarStyleProps = {
317
+ x,
318
+ y,
319
+ data,
320
+ type: timebarType,
321
+ onChange: (values) => {
322
+ this.handleValuesChange(values);
323
+ onChange?.(values);
324
+ },
325
+ ...prefixStyleProps(axisStyle, 'axis'),
326
+ ...prefixStyleProps(controllerStyle, 'controller'),
327
+ ...prefixStyleProps(chartStyle, 'chart'),
328
+ ...userDefinedOptions,
329
+ };
330
+
331
+ if (!this.timebar)
332
+ this.timebar = this.canvas.appendChild(new GUITimebar({ style }));
333
+ else this.timebar.update(style);
334
+ this.updatePosition();
335
+ }
336
+
337
+ private handleDataChange() {
338
+ this.graphDataCache = deepMix({}, this.data);
339
+ this.updateTimebar();
340
+ this.processValuesChange();
341
+ }
342
+
343
+ private handleValuesChange(
344
+ values: Parameters<TimebarStyleProps['onChange']>[0],
345
+ ) {
346
+ this.processValuesChange(values);
347
+ }
348
+
349
+ private processValuesChange(
350
+ values: Parameters<TimebarStyleProps['onChange']>[0] = this.timebar.values,
351
+ ) {
352
+ const { filter } = this.options;
353
+ if (filter) filter(values);
354
+ else this.filter(values);
355
+ }
356
+
357
+ private filter(values: Parameters<TimebarStyleProps['onChange']>[0]) {
358
+ // cache data
359
+ if (
360
+ !this.graphDataCache ||
361
+ (this.graphDataCache.nodes.length === 0 &&
362
+ this.graphDataCache.edges.length === 0)
363
+ ) {
364
+ this.graphDataCache = deepMix({}, this.data);
365
+ }
366
+
367
+ const { filterType, filterItemTypes, shouldIgnore, getTimeFromItem } =
368
+ this.options;
369
+
370
+ const isTimeInValues = (time: number | Date) => {
371
+ if (Array.isArray(values)) {
372
+ return time >= values[0] && time <= values[1];
373
+ }
374
+ return time === values;
375
+ };
376
+
377
+ /**
378
+ * store which items to be existed and exited
379
+ * if modify, enter item will be added, exit item will be removed
380
+ * if visibility, enter item will be shown, exit item will be hidden
381
+ */
382
+ const state: STATE = {
383
+ nodes: { enter: [], exit: [] },
384
+ edges: { enter: [], exit: [] },
385
+ };
386
+
387
+ const filterByType = (type: ItemType) => {
388
+ const key = `${type}s`;
389
+ if (!(key in this.data)) return;
390
+
391
+ const items = this.graphDataCache[key];
392
+ items.forEach((item) => {
393
+ const queryItem =
394
+ type === 'node'
395
+ ? this.graph.getNodeData(item.id)
396
+ : this.graph.getEdgeData(item.id);
397
+ const time = getTimeFromItem(item, type);
398
+ const isItemExists = queryItem !== undefined;
399
+ const isItemVisible = queryItem && this.graph.getItemVisible(item.id);
400
+
401
+ const isEdgeDangling = () => {
402
+ if (type !== 'edge') return false;
403
+ const { source, target } = item as EdgeModel;
404
+ // enter nodes and current nodes
405
+ const nodes = [...state.nodes.enter, ...this.data.nodes];
406
+ const isSourceExists = nodes.find((n) => n.id === source);
407
+ const isTargetExists = nodes.find((n) => n.id === target);
408
+ return !isSourceExists || !isTargetExists;
409
+ };
410
+
411
+ const addItem = () => {
412
+ if (filterType === 'modify' && !isItemExists) {
413
+ state[key].enter.push(item);
414
+ } else if (filterType === 'visibility' && !isItemVisible) {
415
+ state[key].enter.push(item);
416
+ }
417
+ };
418
+
419
+ const removeItem = () => {
420
+ if (filterType === 'modify' && isItemExists) {
421
+ state[key].exit.push(item);
422
+ } else if (filterType === 'visibility' && isItemVisible) {
423
+ state[key].exit.push(item);
424
+ }
425
+ };
426
+
427
+ if (isEdgeDangling()) return;
428
+ if (!filterItemTypes.includes(type)) addItem();
429
+ // if time is undefined, always enter
430
+ else if (time === undefined) addItem();
431
+ // ignore, push to enter
432
+ else if (shouldIgnore?.(item, type, values)) addItem();
433
+ // time in range, push to enter
434
+ else if (isTimeInValues(time)) addItem();
435
+ // push to exit
436
+ else if (this.data[key].find(({ id }) => id === item.id)) removeItem();
437
+ });
438
+ };
439
+
440
+ this.itemTypes.forEach((type) => filterByType(type));
441
+
442
+ this.mutateGraph(state);
443
+ }
444
+
445
+ private mutateGraph(state: STATE) {
446
+ const { filterType } = this.options;
447
+ const mutateByType = (type: ItemType) => {
448
+ const { enter, exit } = state[`${type}s`];
449
+
450
+ if (filterType === 'modify') {
451
+ this.graph.addData(type, enter);
452
+ this.graph.removeData(
453
+ type,
454
+ exit.map((n) => n.id),
455
+ );
456
+ } else {
457
+ this.graph.showItem(enter.map((e) => e.id));
458
+ this.graph.hideItem(exit.map((e) => e.id));
459
+ }
460
+ };
461
+
462
+ const preventConsoleError = (callback: () => void) => {
463
+ const originError = console.error;
464
+ console.error = () => {};
465
+ callback?.();
466
+ console.error = originError;
467
+ };
468
+
469
+ preventConsoleError(() => {
470
+ this.itemTypes.forEach((type) => mutateByType(type));
471
+ });
472
+ }
473
+ }
@@ -150,7 +150,7 @@ export class Toolbar extends Base {
150
150
  * insert css style
151
151
  */
152
152
  private insertStyle() {
153
- if (typeof document !== undefined) {
153
+ if (typeof document !== 'undefined') {
154
154
  insertCss(`
155
155
  .g6-component-toolbar {
156
156
  position: absolute;
@@ -6,3 +6,5 @@ export type { MenuConfig } from './menu';
6
6
  export type { MiniMapConfig } from './minimap';
7
7
  export type { ToolbarConfig } from './toolbar';
8
8
  export type { TooltipConfig } from './tooltip';
9
+ export type { TimebarConfig } from './timebar';
10
+ export type { SnapLineConfig } from './snapline';
@@ -7,6 +7,7 @@ const textColor = 'rgba(255,255,255,0.85)';
7
7
  const nodeColor = 'rgb(34,126,255)';
8
8
  const edgeColor = 'rgb(153, 173, 209)';
9
9
  const comboFill = 'rgb(253, 253, 253)';
10
+ const comboStroke = 'rgba(153,173,209,1)';
10
11
  const disabledFill = '#D0E4FF';
11
12
 
12
13
  const edgeMainStroke = '#637088';
@@ -105,7 +106,7 @@ export const DarkTheme = {
105
106
  },
106
107
  haloShape: {
107
108
  opacity: 0.45,
108
- lineWidth: 20,
109
+ lineWidth: 12,
109
110
  zIndex: -1,
110
111
  pointerEvents: 'none',
111
112
  visible: true,
@@ -118,7 +119,7 @@ export const DarkTheme = {
118
119
  },
119
120
  haloShape: {
120
121
  opacity: 0.25,
121
- lineWidth: 20,
122
+ lineWidth: 12,
122
123
  zIndex: -1,
123
124
  pointerEvents: 'none',
124
125
  visible: true,
@@ -301,6 +302,23 @@ export const DarkTheme = {
301
302
  height: 10,
302
303
  padding: [25, 20, 15, 20],
303
304
  },
305
+ labelShape: {
306
+ ...DEFAULT_TEXT_STYLE,
307
+ fill: textColor,
308
+ opacity: 0.85,
309
+ position: 'bottom',
310
+ zIndex: 2,
311
+ lod: 0,
312
+ maxLines: 1,
313
+ },
314
+ labelBackgroundShape: {
315
+ padding: [2, 4, 2, 4],
316
+ lineWidth: 0,
317
+ fill: '#000',
318
+ opacity: 0.75,
319
+ zIndex: 1,
320
+ lod: 0,
321
+ },
304
322
  },
305
323
  selected: {
306
324
  keyShape: {
@@ -311,12 +329,30 @@ export const DarkTheme = {
311
329
  labelShape: {
312
330
  fontWeight: 700,
313
331
  },
332
+ haloShape: {
333
+ opacity: 0.25,
334
+ lineWidth: 12,
335
+ pointerEvents: 'none',
336
+ zIndex: -1,
337
+ visible: true,
338
+ stroke: comboStroke,
339
+ droppable: false,
340
+ },
314
341
  },
315
342
  active: {
316
343
  keyShape: {
317
344
  stroke: nodeStroke,
318
345
  lineWidth: 1,
319
346
  },
347
+ haloShape: {
348
+ opacity: 0.25,
349
+ lineWidth: 12,
350
+ pointerEvents: 'none',
351
+ zIndex: -1,
352
+ visible: true,
353
+ stroke: comboStroke,
354
+ droppable: false,
355
+ },
320
356
  },
321
357
  highlight: {
322
358
  keyShape: {
@@ -334,6 +370,9 @@ export const DarkTheme = {
334
370
  fill: comboFill,
335
371
  lineWidth: 1,
336
372
  },
373
+ labelShape: {
374
+ opacity: 0.65,
375
+ },
337
376
  },
338
377
  disable: {
339
378
  keyShape: {
@@ -344,6 +383,31 @@ export const DarkTheme = {
344
383
  fill: disabledFill,
345
384
  opacity: 0.25,
346
385
  },
386
+ labelShape: {
387
+ opacity: 0.25,
388
+ },
389
+ },
390
+ collapsed: {
391
+ keyShape: {
392
+ ...DEFAULT_SHAPE_STYLE,
393
+ fill: comboFill,
394
+ lineWidth: 1,
395
+ stroke: comboStroke,
396
+ // the collapsed size
397
+ r: 16,
398
+ width: 48,
399
+ height: 24,
400
+ padding: [25, 20, 15, 20],
401
+ },
402
+ iconShape: {
403
+ ...DEFAULT_TEXT_STYLE,
404
+ fill: comboStroke,
405
+ fontSize: 12,
406
+ zIndex: 1,
407
+ lod: -1,
408
+ contentType: 'childCount',
409
+ visible: true,
410
+ },
347
411
  },
348
412
  },
349
413
  ],
@@ -108,7 +108,7 @@ export const LightTheme = {
108
108
  },
109
109
  haloShape: {
110
110
  opacity: 0.25,
111
- lineWidth: 20,
111
+ lineWidth: 12,
112
112
  pointerEvents: 'none',
113
113
  zIndex: -1,
114
114
  visible: true,
@@ -121,7 +121,7 @@ export const LightTheme = {
121
121
  },
122
122
  haloShape: {
123
123
  opacity: 0.25,
124
- lineWidth: 20,
124
+ lineWidth: 12,
125
125
  pointerEvents: 'none',
126
126
  zIndex: -1,
127
127
  visible: true,
@@ -328,7 +328,7 @@ export const LightTheme = {
328
328
  },
329
329
  haloShape: {
330
330
  opacity: 0.25,
331
- lineWidth: 20,
331
+ lineWidth: 12,
332
332
  pointerEvents: 'none',
333
333
  zIndex: -1,
334
334
  visible: true,
@@ -343,7 +343,7 @@ export const LightTheme = {
343
343
  },
344
344
  haloShape: {
345
345
  opacity: 0.25,
346
- lineWidth: 20,
346
+ lineWidth: 12,
347
347
  pointerEvents: 'none',
348
348
  zIndex: -1,
349
349
  visible: true,
@@ -1,6 +1,7 @@
1
1
  import { ID } from 'types';
2
2
 
3
3
  export type Padding = number | number[];
4
+ export type StandardPadding = [number, number, number, number];
4
5
 
5
6
  export type Point = {
6
7
  x: number;
@@ -42,6 +42,7 @@ export interface IG6GraphEvent
42
42
  currentTarget: IGraph;
43
43
  itemType: 'node' | 'edge' | 'combo' | 'canvas';
44
44
  itemId: ID;
45
+ key?: string;
45
46
  /** Original event emitted by G */
46
47
  gEvent: Event;
47
48
  }