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

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 +33 -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 +33 -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 +38 -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
@@ -2,7 +2,7 @@ import type { ID, IG6GraphEvent } from '../../types';
2
2
  import { Behavior } from '../../types/behavior';
3
3
 
4
4
  const KEYBOARD_TRIGGERS = ['shift', 'ctrl', 'alt', 'meta'] as const;
5
- const MOUSE_TRIGGERS = ['mouseenter', 'click'] as const;
5
+ const MOUSE_TRIGGERS = ['pointerenter', 'click'] as const;
6
6
 
7
7
  type Trigger = (typeof MOUSE_TRIGGERS)[number];
8
8
 
@@ -78,12 +78,12 @@ export class ActivateRelations extends Behavior {
78
78
 
79
79
  getEvents = () => {
80
80
  const { trigger } = this.options;
81
- if (trigger === 'mouseenter') {
81
+ if (trigger === 'pointerenter') {
82
82
  return {
83
- 'node:mouseenter': this.setAllItemStates,
84
- 'combo:mouseenter': this.setAllItemStates,
85
- 'node:mouseleave': this.clearActiveState,
86
- 'combo:mouseleave': this.clearActiveState,
83
+ 'node:pointerenter': this.setAllItemStates,
84
+ 'combo:pointerenter': this.setAllItemStates,
85
+ 'node:pointerleave': this.clearActiveState,
86
+ 'combo:pointerleave': this.clearActiveState,
87
87
  };
88
88
  }
89
89
 
@@ -118,7 +118,7 @@ export class ActivateRelations extends Behavior {
118
118
  edgeIds,
119
119
  );
120
120
 
121
- graph.batch(() => {
121
+ graph.historyBatch(() => {
122
122
  /** 节点 */
123
123
  graph.setItemState(activeNodeIds, ACTIVE_STATE, true);
124
124
  graph.setItemState(inactiveNodeIds, ACTIVE_STATE, false);
@@ -132,7 +132,7 @@ export class ActivateRelations extends Behavior {
132
132
  }
133
133
  public clearActiveState(e: any) {
134
134
  const { activeState: ACTIVE_STATE } = this.options;
135
- this.graph.batch(() => {
135
+ this.graph.historyBatch(() => {
136
136
  this.graph.setItemState(this.prevNodeIds, ACTIVE_STATE, false);
137
137
  this.graph.setItemState(this.prevEdgeIds, ACTIVE_STATE, false);
138
138
  });
@@ -345,8 +345,10 @@ export class BrushSelect extends Behavior {
345
345
  const { graph, options } = this;
346
346
  const { brushStyle } = options;
347
347
  const brush = graph.drawTransient('rect', BRUSH_SHAPE_ID, {
348
- style: brushStyle,
349
- capture: false,
348
+ style: {
349
+ ...brushStyle,
350
+ pointerEvents: 'none',
351
+ },
350
352
  });
351
353
  return brush;
352
354
  }
@@ -136,7 +136,7 @@ export class ClickSelect extends Behavior {
136
136
 
137
137
  // Select/Unselect item.
138
138
  if (this.options.shouldUpdate(event)) {
139
- this.graph.batch(() => {
139
+ this.graph.historyBatch(() => {
140
140
  if (!multiple) {
141
141
  // Not multiple, clear all currently selected items
142
142
  this.graph.setItemState(this.selectedIds, state, false);
@@ -0,0 +1,296 @@
1
+ import type { IG6GraphEvent } from '../../types';
2
+ import { warn } from '../../util/warn';
3
+ import { generateEdgeID } from '../../util/item';
4
+ import { Behavior } from '../../types/behavior';
5
+ import { EdgeDisplayModelData } from '../../types/edge';
6
+
7
+ const KEYBOARD_TRIGGERS = ['shift', 'ctrl', 'control', 'alt', 'meta'] as const;
8
+ const EVENT_TRIGGERS = ['click', 'drag'] as const;
9
+
10
+ const VIRTUAL_EDGE_ID = 'g6-create-edge-virtual-edge';
11
+ const DUMMY_NODE_ID = 'g6-create-edge-dummy-node';
12
+
13
+ // type Trigger = (typeof EVENT_TRIGGERS)[number];
14
+
15
+ interface CreateEdgeOptions {
16
+ /**
17
+ * The triggering conditions for this interaction can be either 'click' or 'drag'.
18
+ * Default to `click`.
19
+ */
20
+ trigger: (typeof EVENT_TRIGGERS)[number];
21
+ /**
22
+ * The assistant secondary key on keyboard. If it is not assigned, the behavior will be triggered when trigger happens.
23
+ * cound be 'shift', 'ctrl', 'control', 'alt', 'meta', undefined.
24
+ */
25
+ secondaryKey?: (typeof KEYBOARD_TRIGGERS)[number];
26
+ /**
27
+ * Config of the created edge.
28
+ */
29
+ edgeConfig: EdgeDisplayModelData;
30
+ /**
31
+ * The event name to trigger after creating the virtual edge.
32
+ */
33
+ createVirtualEventName?: string;
34
+ /**
35
+ * The event name to trigger after creating the actual edge.
36
+ */
37
+ createActualEventName?: string;
38
+ /**
39
+ * The event name to trigger after canceling the behavior.
40
+ */
41
+ cancelCreateEventName?: string;
42
+ /**
43
+ * Whether allow the behavior happen on the current item.
44
+ */
45
+ shouldBegin: (event: IG6GraphEvent) => boolean;
46
+ /**
47
+ *
48
+ * Whether it is allowed to end the creation of edges under the current conditions being operated.
49
+ */
50
+ shouldEnd: (event: IG6GraphEvent) => boolean;
51
+ }
52
+
53
+ const DEFAULT_OPTIONS: CreateEdgeOptions = {
54
+ trigger: 'click',
55
+ secondaryKey: undefined,
56
+ shouldBegin: () => true,
57
+ shouldEnd: () => false,
58
+ edgeConfig: {},
59
+ };
60
+
61
+ export class CreateEdge extends Behavior {
62
+ isKeyDown = false;
63
+ addingEdge = null;
64
+ dummyNode = null;
65
+
66
+ constructor(options: Partial<CreateEdgeOptions>) {
67
+ super(Object.assign({}, DEFAULT_OPTIONS, options));
68
+ this.validateOptions(options);
69
+ }
70
+
71
+ validateOptions(options: Partial<CreateEdgeOptions>) {
72
+ if (options.trigger && !EVENT_TRIGGERS.includes(options.trigger)) {
73
+ warn({
74
+ optionName: `create-edge.trigger`,
75
+ shouldBe: EVENT_TRIGGERS,
76
+ now: options.trigger,
77
+ scope: 'behavior',
78
+ });
79
+
80
+ this.options.trigger = DEFAULT_OPTIONS.trigger;
81
+ }
82
+
83
+ if (
84
+ options.secondaryKey &&
85
+ !KEYBOARD_TRIGGERS.includes(options.secondaryKey)
86
+ ) {
87
+ warn({
88
+ optionName: `create-edge.secondaryKey`,
89
+ shouldBe: KEYBOARD_TRIGGERS,
90
+ now: options.secondaryKey,
91
+ scope: 'behavior',
92
+ });
93
+ this.options.secondaryKey = DEFAULT_OPTIONS.secondaryKey;
94
+ }
95
+ }
96
+
97
+ getEvents = () => {
98
+ const { trigger, secondaryKey } = this.options;
99
+ const [CLICK_NAME] = EVENT_TRIGGERS;
100
+
101
+ const triggerEvents =
102
+ trigger === CLICK_NAME
103
+ ? {
104
+ 'node:click': this.handleCreateEdge,
105
+ pointermove: this.updateEndPoint,
106
+ 'edge:click': this.cancelCreating,
107
+ 'canvas:click': this.cancelCreating,
108
+ 'combo:click': this.handleCreateEdge,
109
+ }
110
+ : {
111
+ 'node:dragstart': this.handleCreateEdge,
112
+ 'combo:dragstart': this.handleCreateEdge,
113
+ drag: this.updateEndPoint,
114
+ drop: this.onDrop,
115
+ };
116
+
117
+ const keyboardEvents = secondaryKey
118
+ ? {
119
+ keydown: this.onKeyDown,
120
+ keyup: this.onKeyUp,
121
+ }
122
+ : {};
123
+
124
+ return { ...triggerEvents, ...keyboardEvents } as Record<
125
+ string,
126
+ (e: IG6GraphEvent) => void
127
+ >;
128
+ };
129
+
130
+ handleCreateEdge = (e: IG6GraphEvent) => {
131
+ if (this.options.secondaryKey && !this.isKeyDown) {
132
+ return;
133
+ }
134
+
135
+ if (this.options.shouldEnd(e)) {
136
+ return;
137
+ }
138
+
139
+ const { graph, options, addingEdge } = this;
140
+ const currentNodeId = e.itemId;
141
+
142
+ const { edgeConfig, createVirtualEventName, createActualEventName } =
143
+ options;
144
+
145
+ if (addingEdge) {
146
+ // create edge end, add the actual edge to graph and remove the virtual edge and node
147
+ const actualEdge = graph.addData('edge', {
148
+ id: generateEdgeID(addingEdge.source, currentNodeId),
149
+ source: addingEdge.source,
150
+ target: currentNodeId,
151
+ data: {
152
+ ...edgeConfig,
153
+ type:
154
+ currentNodeId === addingEdge.source ? 'loop-edge' : edgeConfig.type,
155
+ },
156
+ });
157
+ if (createActualEventName) {
158
+ graph.emit(createActualEventName, { edge: actualEdge });
159
+ }
160
+ this.cancelCreating();
161
+
162
+ return;
163
+ }
164
+
165
+ this.dummyNode = graph.addData('node', {
166
+ id: DUMMY_NODE_ID,
167
+ data: {
168
+ x: e.canvas.x,
169
+ y: e.canvas.y,
170
+ keyShape: {
171
+ opacity: 0,
172
+ interactive: false,
173
+ },
174
+ labelShape: {
175
+ opacity: 0,
176
+ },
177
+ anchorPoints: [[0.5, 0.5]],
178
+ },
179
+ });
180
+ this.addingEdge = graph.addData('edge', {
181
+ id: VIRTUAL_EDGE_ID,
182
+ source: currentNodeId,
183
+ target: DUMMY_NODE_ID,
184
+ data: {
185
+ ...edgeConfig,
186
+ },
187
+ });
188
+ if (createVirtualEventName) {
189
+ graph.emit(createVirtualEventName, { edge: this.addingEdge });
190
+ }
191
+ };
192
+
193
+ onDrop = async (e: IG6GraphEvent) => {
194
+ const { addingEdge, options, graph } = this;
195
+
196
+ const { edgeConfig, secondaryKey, createActualEventName } = options;
197
+ if (secondaryKey && !this.isKeyDown) {
198
+ return;
199
+ }
200
+
201
+ if (!addingEdge) {
202
+ return;
203
+ }
204
+
205
+ const elements = await this.graph.canvas.document.elementsFromPoint(
206
+ e.canvas.x,
207
+ e.canvas.y,
208
+ );
209
+ const currentIds = elements
210
+ // @ts-ignore TODO: G type
211
+ .map((ele) => ele.parentNode.getAttribute?.('data-item-id'))
212
+ .filter((id) => id !== undefined && !DUMMY_NODE_ID !== id);
213
+ const dropId = currentIds.find(
214
+ (id) => this.graph.getComboData(id) || this.graph.getNodeData(id),
215
+ );
216
+
217
+ if (!dropId) {
218
+ this.cancelCreating();
219
+ return;
220
+ }
221
+
222
+ const actualEdge = graph.addData('edge', {
223
+ id: generateEdgeID(addingEdge.source, dropId),
224
+ source: addingEdge.source,
225
+ target: dropId,
226
+ data: {
227
+ ...edgeConfig,
228
+ type: dropId === addingEdge.source ? 'loop-edge' : edgeConfig.type,
229
+ },
230
+ });
231
+ if (createActualEventName) {
232
+ graph.emit(createActualEventName, { edge: actualEdge });
233
+ }
234
+ this.cancelCreating();
235
+ };
236
+
237
+ updateEndPoint = (e: IG6GraphEvent) => {
238
+ const { options, graph, addingEdge, isKeyDown } = this;
239
+ if (options.secondaryKey && !isKeyDown) {
240
+ return;
241
+ }
242
+
243
+ if (!addingEdge) {
244
+ return;
245
+ }
246
+
247
+ const sourceId = addingEdge.source,
248
+ targetId = addingEdge.target;
249
+
250
+ if (!graph.getItemById(sourceId)) {
251
+ this.addingEdge = null;
252
+ return;
253
+ }
254
+
255
+ graph.updatePosition('node', {
256
+ id: targetId,
257
+ data: {
258
+ x: e.canvas.x,
259
+ y: e.canvas.y,
260
+ },
261
+ });
262
+ };
263
+
264
+ cancelCreating = () => {
265
+ if (this.addingEdge) {
266
+ this.graph.removeData('edge', VIRTUAL_EDGE_ID);
267
+ this.addingEdge = null;
268
+ }
269
+ if (this.dummyNode) {
270
+ this.graph.removeData('node', DUMMY_NODE_ID);
271
+ this.dummyNode = null;
272
+ }
273
+ if (this.options.cancelCreateEventName) {
274
+ this.graph.emit(this.options.cancelCreateEventName, {});
275
+ }
276
+ };
277
+
278
+ onKeyDown = (e: KeyboardEvent) => {
279
+ const code = e.key;
280
+
281
+ if (!code) {
282
+ return;
283
+ }
284
+
285
+ if (code.toLocaleLowerCase() === this.options.secondaryKey) {
286
+ this.isKeyDown = true;
287
+ }
288
+ };
289
+
290
+ onKeyUp = (e: IG6GraphEvent) => {
291
+ if (this.addingEdge) {
292
+ this.cancelCreating();
293
+ }
294
+ this.isKeyDown = false;
295
+ };
296
+ }
@@ -1,4 +1,5 @@
1
- import { ID, IG6GraphEvent } from 'types';
1
+ import { isNumber } from '@antv/util';
2
+ import { ID, IG6GraphEvent } from '../../types';
2
3
  import { Behavior } from '../../types/behavior';
3
4
  import { Point } from '../../types/common';
4
5
 
@@ -53,7 +54,7 @@ export interface DragCanvasOptions {
53
54
  }
54
55
 
55
56
  const DEFAULT_OPTIONS: Required<DragCanvasOptions> = {
56
- enableOptimize: false,
57
+ enableOptimize: undefined,
57
58
  dragOnItems: false,
58
59
  trigger: 'drag',
59
60
  direction: 'both',
@@ -73,6 +74,7 @@ export class DragCanvas extends Behavior {
73
74
  private disableKeydown: boolean;
74
75
  private hiddenEdgeIds: ID[];
75
76
  private hiddenNodeIds: ID[];
77
+ private tileRequestId?: number;
76
78
 
77
79
  constructor(options: Partial<DragCanvasOptions>) {
78
80
  const finalOptions = Object.assign({}, DEFAULT_OPTIONS, options);
@@ -132,25 +134,47 @@ export class DragCanvas extends Behavior {
132
134
 
133
135
  private hideShapes() {
134
136
  const { graph } = this;
135
- if (this.options.enableOptimize) {
137
+
138
+ const { tileBehavior: graphBehaviorOptimize, tileBehaviorSize = 1000 } =
139
+ graph.getSpecification().optimize || {};
140
+ const optimize =
141
+ this.options.enableOptimize !== undefined
142
+ ? this.options.enableOptimize
143
+ : graphBehaviorOptimize;
144
+ const shouldOptimize = isNumber(optimize)
145
+ ? graph.getAllNodesData().length > optimize
146
+ : optimize;
147
+
148
+ if (shouldOptimize) {
136
149
  this.hiddenEdgeIds = graph
137
150
  .getAllEdgesData()
138
151
  .map((edge) => edge.id)
139
152
  .filter((id) => graph.getItemVisible(id) === true);
140
- graph.executeWithoutStacking(() => {
141
- graph.hideItem(this.hiddenEdgeIds, true);
142
- this.hiddenNodeIds = graph
143
- .getAllNodesData()
144
- .map((node) => node.id)
145
- .filter((id) => graph.getItemVisible(id) === true);
146
- // draw node's keyShapes on transient, and then hidden the real nodes;
147
- // this.hiddenNodeIds.forEach((id) => {
148
- // graph.drawTransient('node', id, {
149
- // onlyDrawKeyShape: true,
150
- // });
151
- // });
152
- // graph.hideItem(this.hiddenNodeIds, true);
153
- });
153
+ this.hiddenNodeIds = graph
154
+ .getAllNodesData()
155
+ .map((node) => node.id)
156
+ .filter((id) => graph.getItemVisible(id) === true);
157
+ const hiddenIds = [...this.hiddenNodeIds];
158
+ const sectionNum = Math.ceil(hiddenIds.length / tileBehaviorSize);
159
+ const sections = Array.from({ length: sectionNum }, (v, i) =>
160
+ hiddenIds.slice(
161
+ i * tileBehaviorSize,
162
+ i * tileBehaviorSize + tileBehaviorSize,
163
+ ),
164
+ );
165
+ const update = () => {
166
+ if (!sections.length && this.tileRequestId) {
167
+ cancelAnimationFrame(this.tileRequestId);
168
+ this.tileRequestId = undefined;
169
+ return;
170
+ }
171
+ const section = sections.shift();
172
+ graph.executeWithNoStack(() => {
173
+ graph.hideItem(section, false, true);
174
+ });
175
+ this.tileRequestId = requestAnimationFrame(update);
176
+ };
177
+ this.tileRequestId = requestAnimationFrame(update);
154
178
  }
155
179
  }
156
180
 
@@ -241,19 +265,44 @@ export class DragCanvas extends Behavior {
241
265
  this.pointerDownAt = undefined;
242
266
  this.dragging = false;
243
267
 
244
- const { graph } = this;
245
- if (this.options.enableOptimize) {
246
- graph.startBatch();
247
- if (this.hiddenEdgeIds) {
248
- graph.showItem(this.hiddenEdgeIds, true);
268
+ const { graph, hiddenNodeIds, hiddenEdgeIds = [] } = this;
269
+ const { tileBehavior: graphBehaviorOptimize, tileBehaviorSize = 1000 } =
270
+ graph.getSpecification().optimize || {};
271
+ const optimize =
272
+ this.options.enableOptimize !== undefined
273
+ ? this.options.enableOptimize
274
+ : graphBehaviorOptimize;
275
+ const shouldOptimize = isNumber(optimize)
276
+ ? graph.getAllNodesData().length > optimize
277
+ : optimize;
278
+
279
+ if (shouldOptimize) {
280
+ if (this.tileRequestId) {
281
+ cancelAnimationFrame(this.tileRequestId);
282
+ this.tileRequestId = undefined;
283
+ }
284
+ if (hiddenNodeIds) {
285
+ const hiddenIds = [...hiddenNodeIds, ...hiddenEdgeIds];
286
+ const sectionNum = Math.ceil(hiddenIds.length / tileBehaviorSize);
287
+ const sections = Array.from({ length: sectionNum }, (v, i) =>
288
+ hiddenIds.slice(
289
+ i * tileBehaviorSize,
290
+ i * tileBehaviorSize + tileBehaviorSize,
291
+ ),
292
+ );
293
+ const update = () => {
294
+ if (!sections.length && this.tileRequestId) {
295
+ cancelAnimationFrame(this.tileRequestId);
296
+ this.tileRequestId = undefined;
297
+ return;
298
+ }
299
+ graph.startHistoryBatch();
300
+ graph.showItem(sections.shift(), false);
301
+ graph.stopHistoryBatch();
302
+ this.tileRequestId = requestAnimationFrame(update);
303
+ };
304
+ this.tileRequestId = requestAnimationFrame(update);
249
305
  }
250
- // if (this.hiddenNodeIds) {
251
- // this.hiddenNodeIds.forEach((id) => {
252
- // this.graph.drawTransient('node', id, { action: 'remove' });
253
- // });
254
- // graph.showItem(this.hiddenNodeIds, true);
255
- // }
256
- graph.stopBatch();
257
306
  }
258
307
  }
259
308
 
@@ -250,7 +250,7 @@ export class DragCombo extends Behavior {
250
250
  selectedComboIds,
251
251
  this.hiddenComboTreeRoots,
252
252
  );
253
- this.graph.executeWithoutStacking(() => {
253
+ this.graph.executeWithNoStack(() => {
254
254
  this.graph.hideItem(
255
255
  this.hiddenEdges.map((edge) => edge.id),
256
256
  true,
@@ -280,7 +280,7 @@ export class DragCombo extends Behavior {
280
280
  });
281
281
 
282
282
  // Hide original edges and nodes. They will be restored when pointerup.
283
- this.graph.executeWithoutStacking(() => {
283
+ this.graph.executeWithNoStack(() => {
284
284
  this.graph.hideItem(selectedComboIds, true);
285
285
  this.graph.hideItem(
286
286
  this.hiddenEdges.map((edge) => edge.id),
@@ -429,7 +429,7 @@ export class DragCombo extends Behavior {
429
429
  }
430
430
 
431
431
  public restoreHiddenItems(positions?: Position[]) {
432
- this.graph.pauseStacking();
432
+ this.graph.pauseStack();
433
433
  if (this.hiddenEdges.length) {
434
434
  this.graph.showItem(
435
435
  this.hiddenEdges.map((edge) => edge.id),
@@ -452,7 +452,7 @@ export class DragCombo extends Behavior {
452
452
  true,
453
453
  );
454
454
  }
455
- this.graph.resumeStacking();
455
+ this.graph.resumeStack();
456
456
  }
457
457
 
458
458
  public onPointerUp(event: IG6GraphEvent) {
@@ -526,8 +526,8 @@ export class DragCombo extends Behavior {
526
526
  this.originPositions = [];
527
527
  }
528
528
 
529
- public onDropNode(event: IG6GraphEvent) {
530
- const elements = this.graph.canvas.document.elementsFromPointSync(
529
+ public async onDropNode(event: IG6GraphEvent) {
530
+ const elements = await this.graph.canvas.document.elementsFromPoint(
531
531
  event.canvas.x,
532
532
  event.canvas.y,
533
533
  );
@@ -561,7 +561,7 @@ export class DragCombo extends Behavior {
561
561
 
562
562
  public onDropCombo(event: IG6GraphEvent) {
563
563
  const newParentId = event.itemId;
564
- this.graph.startBatch();
564
+ this.graph.startHistoryBatch();
565
565
  this.originPositions.forEach(({ id }) => {
566
566
  const model = this.graph.getComboData(id);
567
567
  if (!model || model.id === newParentId) return;
@@ -570,12 +570,12 @@ export class DragCombo extends Behavior {
570
570
  // event.stopPropagation();
571
571
  this.graph.updateData('combo', { id, data: { parentId: newParentId } });
572
572
  });
573
- this.graph.stopBatch();
573
+ this.graph.stopHistoryBatch();
574
574
  this.onPointerUp(event);
575
575
  }
576
576
 
577
577
  public onDropCanvas(event: IG6GraphEvent) {
578
- this.graph.startBatch();
578
+ this.graph.startHistoryBatch();
579
579
  this.originPositions.forEach(({ id }) => {
580
580
  const model = this.graph.getComboData(id);
581
581
  if (!model) return;
@@ -583,7 +583,7 @@ export class DragCombo extends Behavior {
583
583
  if (!parentId) return;
584
584
  this.graph.updateData('combo', { id, data: { parentId: undefined } });
585
585
  });
586
- this.graph.stopBatch();
586
+ this.graph.stopHistoryBatch();
587
587
  this.onPointerUp(event);
588
588
  }
589
589
  }