@antv/g6 5.0.0-beta.31 → 5.0.0-beta.33

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 (738) hide show
  1. package/dist/g6.min.js +2 -2
  2. package/dist/lib/behaviors/brush-select.d.ts +104 -0
  3. package/dist/lib/behaviors/click-element.d.ts +77 -0
  4. package/dist/lib/behaviors/collapse-expand.d.ts +4 -5
  5. package/dist/lib/behaviors/create-edge.d.ts +55 -0
  6. package/dist/lib/behaviors/drag-canvas.d.ts +6 -6
  7. package/dist/lib/behaviors/drag-element-force.d.ts +14 -0
  8. package/dist/lib/behaviors/drag-element.d.ts +17 -14
  9. package/dist/lib/behaviors/focus-element.d.ts +4 -3
  10. package/dist/lib/behaviors/hover-element.d.ts +4 -5
  11. package/dist/lib/behaviors/index.d.ts +10 -0
  12. package/dist/lib/behaviors/lasso-select.d.ts +20 -0
  13. package/dist/lib/behaviors/types.d.ts +1 -0
  14. package/dist/lib/behaviors/zoom-canvas.d.ts +7 -6
  15. package/dist/lib/constants/change.d.ts +1 -1
  16. package/dist/lib/constants/events/graph.d.ts +9 -15
  17. package/dist/lib/constants/index.d.ts +1 -0
  18. package/dist/lib/constants/registry.d.ts +22 -0
  19. package/dist/lib/elements/combos/base-combo.d.ts +64 -6
  20. package/dist/lib/elements/combos/circle.d.ts +8 -12
  21. package/dist/lib/elements/combos/rect.d.ts +5 -9
  22. package/dist/lib/elements/edges/base-edge.d.ts +85 -10
  23. package/dist/lib/elements/edges/cubic-horizontal.d.ts +2 -2
  24. package/dist/lib/elements/edges/cubic-vertical.d.ts +2 -2
  25. package/dist/lib/elements/edges/cubic.d.ts +2 -2
  26. package/dist/lib/elements/edges/polyline.d.ts +2 -2
  27. package/dist/lib/elements/edges/quadratic.d.ts +2 -2
  28. package/dist/lib/elements/nodes/base-node.d.ts +125 -13
  29. package/dist/lib/elements/nodes/circle.d.ts +5 -8
  30. package/dist/lib/elements/nodes/diamond.d.ts +2 -4
  31. package/dist/lib/elements/nodes/ellipse.d.ts +5 -8
  32. package/dist/lib/elements/nodes/hexagon.d.ts +6 -9
  33. package/dist/lib/elements/nodes/image.d.ts +9 -11
  34. package/dist/lib/elements/nodes/polygon.d.ts +9 -8
  35. package/dist/lib/elements/nodes/rect.d.ts +2 -3
  36. package/dist/lib/elements/nodes/star.d.ts +7 -10
  37. package/dist/lib/elements/nodes/triangle.d.ts +7 -10
  38. package/dist/lib/exports.d.ts +18 -14
  39. package/dist/lib/layouts/index.d.ts +1 -1
  40. package/dist/lib/layouts/types.d.ts +6 -6
  41. package/dist/lib/palettes/index.d.ts +1 -0
  42. package/dist/lib/plugins/camera-setting.d.ts +95 -0
  43. package/dist/lib/plugins/contextmenu.d.ts +8 -5
  44. package/dist/lib/plugins/history/events.d.ts +21 -0
  45. package/dist/lib/plugins/history/index.d.ts +82 -0
  46. package/dist/lib/plugins/history/utils.d.ts +31 -0
  47. package/dist/lib/plugins/hull/index.d.ts +59 -0
  48. package/dist/lib/plugins/hull/shape.d.ts +49 -0
  49. package/dist/lib/plugins/hull/util.d.ts +12 -0
  50. package/dist/lib/plugins/index.d.ts +8 -0
  51. package/dist/lib/plugins/legend.d.ts +49 -0
  52. package/dist/lib/plugins/tooltip.d.ts +12 -10
  53. package/dist/lib/registry/extension/index.d.ts +3 -3
  54. package/dist/lib/registry/index.d.ts +6 -4
  55. package/dist/lib/registry/types.d.ts +4 -6
  56. package/dist/lib/runtime/batch.d.ts +11 -0
  57. package/dist/lib/runtime/behavior.d.ts +1 -1
  58. package/dist/lib/runtime/canvas.d.ts +15 -4
  59. package/dist/lib/runtime/data.d.ts +4 -4
  60. package/dist/lib/runtime/element.d.ts +6 -23
  61. package/dist/lib/runtime/graph.d.ts +71 -6
  62. package/dist/lib/runtime/layout.d.ts +5 -11
  63. package/dist/lib/runtime/plugin.d.ts +2 -1
  64. package/dist/lib/runtime/transform.d.ts +11 -0
  65. package/dist/lib/runtime/types.d.ts +14 -0
  66. package/dist/lib/spec/index.d.ts +1 -0
  67. package/dist/lib/spec/spec.d.ts +7 -0
  68. package/dist/lib/spec/transform.d.ts +12 -0
  69. package/dist/lib/transforms/arrange-draw-order.d.ts +10 -0
  70. package/dist/lib/transforms/base-transform.d.ts +7 -0
  71. package/dist/lib/transforms/collapse-expand-combo.d.ts +10 -0
  72. package/dist/lib/transforms/index.d.ts +6 -0
  73. package/dist/lib/transforms/process-parallel-edges.d.ts +84 -0
  74. package/dist/lib/transforms/types.d.ts +20 -0
  75. package/dist/lib/transforms/update-related-edge.d.ts +9 -0
  76. package/dist/lib/types/canvas.d.ts +1 -1
  77. package/dist/lib/types/change.d.ts +27 -10
  78. package/dist/lib/types/element.d.ts +6 -140
  79. package/dist/lib/types/event.d.ts +42 -7
  80. package/dist/lib/types/index.d.ts +0 -1
  81. package/dist/lib/types/node.d.ts +3 -3
  82. package/dist/lib/types/point.d.ts +1 -0
  83. package/dist/lib/utils/animation.d.ts +1 -1
  84. package/dist/lib/utils/bbox.d.ts +1 -1
  85. package/dist/lib/utils/behaviors/brush.d.ts +19 -0
  86. package/dist/lib/utils/behaviors/lasso.d.ts +13 -0
  87. package/dist/lib/utils/behaviors/utils.d.ts +21 -0
  88. package/dist/lib/utils/change.d.ts +9 -1
  89. package/dist/lib/utils/combo.d.ts +5 -4
  90. package/dist/lib/utils/edge.d.ts +11 -0
  91. package/dist/lib/utils/element.d.ts +19 -11
  92. package/dist/lib/utils/event/events.d.ts +9 -14
  93. package/dist/lib/utils/extension.d.ts +1 -1
  94. package/dist/lib/utils/id.d.ts +3 -8
  95. package/dist/lib/utils/line.d.ts +21 -0
  96. package/dist/lib/utils/path.d.ts +35 -0
  97. package/dist/lib/utils/point.d.ts +74 -20
  98. package/dist/lib/utils/polygon.d.ts +17 -0
  99. package/dist/lib/utils/position.d.ts +14 -1
  100. package/dist/lib/utils/prefix.d.ts +1 -1
  101. package/dist/lib/utils/shortcut.d.ts +11 -0
  102. package/dist/lib/utils/vector.d.ts +3 -2
  103. package/esm/behaviors/brush-select.d.ts +104 -0
  104. package/esm/behaviors/brush-select.js +199 -0
  105. package/esm/behaviors/brush-select.js.map +1 -0
  106. package/esm/behaviors/click-element.d.ts +77 -0
  107. package/esm/behaviors/click-element.js +108 -0
  108. package/esm/behaviors/click-element.js.map +1 -0
  109. package/esm/behaviors/collapse-expand.d.ts +4 -5
  110. package/esm/behaviors/collapse-expand.js +8 -4
  111. package/esm/behaviors/collapse-expand.js.map +1 -1
  112. package/esm/behaviors/create-edge.d.ts +55 -0
  113. package/esm/behaviors/create-edge.js +141 -0
  114. package/esm/behaviors/create-edge.js.map +1 -0
  115. package/esm/behaviors/drag-canvas.d.ts +6 -6
  116. package/esm/behaviors/drag-canvas.js +15 -7
  117. package/esm/behaviors/drag-canvas.js.map +1 -1
  118. package/esm/behaviors/drag-element-force.d.ts +14 -0
  119. package/esm/behaviors/drag-element-force.js +55 -0
  120. package/esm/behaviors/drag-element-force.js.map +1 -0
  121. package/esm/behaviors/drag-element.d.ts +17 -14
  122. package/esm/behaviors/drag-element.js +17 -9
  123. package/esm/behaviors/drag-element.js.map +1 -1
  124. package/esm/behaviors/focus-element.d.ts +4 -3
  125. package/esm/behaviors/focus-element.js.map +1 -1
  126. package/esm/behaviors/hover-element.d.ts +4 -5
  127. package/esm/behaviors/hover-element.js +2 -2
  128. package/esm/behaviors/hover-element.js.map +1 -1
  129. package/esm/behaviors/index.d.ts +10 -0
  130. package/esm/behaviors/index.js +5 -0
  131. package/esm/behaviors/index.js.map +1 -1
  132. package/esm/behaviors/lasso-select.d.ts +20 -0
  133. package/esm/behaviors/lasso-select.js +79 -0
  134. package/esm/behaviors/lasso-select.js.map +1 -0
  135. package/esm/behaviors/types.d.ts +1 -0
  136. package/esm/behaviors/zoom-canvas.d.ts +7 -6
  137. package/esm/behaviors/zoom-canvas.js +6 -2
  138. package/esm/behaviors/zoom-canvas.js.map +1 -1
  139. package/esm/constants/change.d.ts +1 -1
  140. package/esm/constants/change.js +12 -12
  141. package/esm/constants/change.js.map +1 -1
  142. package/esm/constants/events/graph.d.ts +9 -15
  143. package/esm/constants/events/graph.js +8 -16
  144. package/esm/constants/events/graph.js.map +1 -1
  145. package/esm/constants/index.d.ts +1 -0
  146. package/esm/constants/index.js +1 -0
  147. package/esm/constants/index.js.map +1 -1
  148. package/esm/constants/registry.d.ts +22 -0
  149. package/esm/constants/registry.js +24 -0
  150. package/esm/constants/registry.js.map +1 -0
  151. package/esm/elements/combos/base-combo.d.ts +64 -6
  152. package/esm/elements/combos/base-combo.js +21 -0
  153. package/esm/elements/combos/base-combo.js.map +1 -1
  154. package/esm/elements/combos/circle.d.ts +8 -12
  155. package/esm/elements/combos/circle.js.map +1 -1
  156. package/esm/elements/combos/rect.d.ts +5 -9
  157. package/esm/elements/combos/rect.js.map +1 -1
  158. package/esm/elements/edges/base-edge.d.ts +85 -10
  159. package/esm/elements/edges/base-edge.js +21 -0
  160. package/esm/elements/edges/base-edge.js.map +1 -1
  161. package/esm/elements/edges/cubic-horizontal.d.ts +2 -2
  162. package/esm/elements/edges/cubic-vertical.d.ts +2 -2
  163. package/esm/elements/edges/cubic.d.ts +2 -2
  164. package/esm/elements/edges/polyline.d.ts +2 -2
  165. package/esm/elements/edges/quadratic.d.ts +2 -2
  166. package/esm/elements/nodes/base-node.d.ts +125 -13
  167. package/esm/elements/nodes/base-node.js +25 -1
  168. package/esm/elements/nodes/base-node.js.map +1 -1
  169. package/esm/elements/nodes/circle.d.ts +5 -8
  170. package/esm/elements/nodes/circle.js.map +1 -1
  171. package/esm/elements/nodes/diamond.d.ts +2 -4
  172. package/esm/elements/nodes/diamond.js +2 -2
  173. package/esm/elements/nodes/diamond.js.map +1 -1
  174. package/esm/elements/nodes/ellipse.d.ts +5 -8
  175. package/esm/elements/nodes/ellipse.js +1 -1
  176. package/esm/elements/nodes/ellipse.js.map +1 -1
  177. package/esm/elements/nodes/hexagon.d.ts +6 -9
  178. package/esm/elements/nodes/hexagon.js.map +1 -1
  179. package/esm/elements/nodes/image.d.ts +9 -11
  180. package/esm/elements/nodes/image.js.map +1 -1
  181. package/esm/elements/nodes/polygon.d.ts +9 -8
  182. package/esm/elements/nodes/polygon.js +4 -1
  183. package/esm/elements/nodes/polygon.js.map +1 -1
  184. package/esm/elements/nodes/rect.d.ts +2 -3
  185. package/esm/elements/nodes/rect.js.map +1 -1
  186. package/esm/elements/nodes/star.d.ts +7 -10
  187. package/esm/elements/nodes/star.js.map +1 -1
  188. package/esm/elements/nodes/triangle.d.ts +7 -10
  189. package/esm/elements/nodes/triangle.js.map +1 -1
  190. package/esm/exports.d.ts +18 -14
  191. package/esm/exports.js +8 -6
  192. package/esm/exports.js.map +1 -1
  193. package/esm/layouts/index.d.ts +1 -1
  194. package/esm/layouts/index.js +1 -1
  195. package/esm/layouts/index.js.map +1 -1
  196. package/esm/layouts/types.d.ts +6 -6
  197. package/esm/palettes/index.d.ts +1 -0
  198. package/esm/palettes/index.js +12 -0
  199. package/esm/palettes/index.js.map +1 -1
  200. package/esm/plugins/camera-setting.d.ts +95 -0
  201. package/esm/plugins/camera-setting.js +65 -0
  202. package/esm/plugins/camera-setting.js.map +1 -0
  203. package/esm/plugins/contextmenu.d.ts +8 -5
  204. package/esm/plugins/contextmenu.js.map +1 -1
  205. package/esm/plugins/history/events.d.ts +21 -0
  206. package/esm/plugins/history/events.js +16 -0
  207. package/esm/plugins/history/events.js.map +1 -0
  208. package/esm/plugins/history/index.d.ts +82 -0
  209. package/esm/plugins/history/index.js +168 -0
  210. package/esm/plugins/history/index.js.map +1 -0
  211. package/esm/plugins/history/utils.d.ts +31 -0
  212. package/esm/plugins/history/utils.js +79 -0
  213. package/esm/plugins/history/utils.js.map +1 -0
  214. package/esm/plugins/hull/index.d.ts +59 -0
  215. package/esm/plugins/hull/index.js +107 -0
  216. package/esm/plugins/hull/index.js.map +1 -0
  217. package/esm/plugins/hull/shape.d.ts +49 -0
  218. package/esm/plugins/hull/shape.js +35 -0
  219. package/esm/plugins/hull/shape.js.map +1 -0
  220. package/esm/plugins/hull/util.d.ts +12 -0
  221. package/esm/plugins/hull/util.js +203 -0
  222. package/esm/plugins/hull/util.js.map +1 -0
  223. package/esm/plugins/index.d.ts +8 -0
  224. package/esm/plugins/index.js +4 -0
  225. package/esm/plugins/index.js.map +1 -1
  226. package/esm/plugins/legend.d.ts +49 -0
  227. package/esm/plugins/legend.js +267 -0
  228. package/esm/plugins/legend.js.map +1 -0
  229. package/esm/plugins/tooltip.d.ts +12 -10
  230. package/esm/plugins/tooltip.js +0 -1
  231. package/esm/plugins/tooltip.js.map +1 -1
  232. package/esm/preset.js +2 -5
  233. package/esm/preset.js.map +1 -1
  234. package/esm/registry/build-in.js +21 -4
  235. package/esm/registry/build-in.js.map +1 -1
  236. package/esm/registry/extension/index.d.ts +3 -3
  237. package/esm/registry/extension/index.js.map +1 -1
  238. package/esm/registry/index.d.ts +6 -4
  239. package/esm/registry/index.js +1 -0
  240. package/esm/registry/index.js.map +1 -1
  241. package/esm/registry/types.d.ts +4 -6
  242. package/esm/runtime/batch.d.ts +11 -0
  243. package/esm/runtime/batch.js +31 -0
  244. package/esm/runtime/batch.js.map +1 -0
  245. package/esm/runtime/behavior.d.ts +1 -1
  246. package/esm/runtime/behavior.js +3 -2
  247. package/esm/runtime/behavior.js.map +1 -1
  248. package/esm/runtime/canvas.d.ts +15 -4
  249. package/esm/runtime/canvas.js +103 -41
  250. package/esm/runtime/canvas.js.map +1 -1
  251. package/esm/runtime/data.d.ts +4 -4
  252. package/esm/runtime/data.js +23 -25
  253. package/esm/runtime/data.js.map +1 -1
  254. package/esm/runtime/element.d.ts +6 -23
  255. package/esm/runtime/element.js +48 -150
  256. package/esm/runtime/element.js.map +1 -1
  257. package/esm/runtime/graph.d.ts +71 -6
  258. package/esm/runtime/graph.js +105 -10
  259. package/esm/runtime/graph.js.map +1 -1
  260. package/esm/runtime/layout.d.ts +5 -11
  261. package/esm/runtime/layout.js +29 -75
  262. package/esm/runtime/layout.js.map +1 -1
  263. package/esm/runtime/plugin.d.ts +2 -1
  264. package/esm/runtime/plugin.js +3 -0
  265. package/esm/runtime/plugin.js.map +1 -1
  266. package/esm/runtime/transform.d.ts +11 -0
  267. package/esm/runtime/transform.js +20 -0
  268. package/esm/runtime/transform.js.map +1 -0
  269. package/esm/runtime/types.d.ts +14 -0
  270. package/esm/spec/index.d.ts +1 -0
  271. package/esm/spec/spec.d.ts +7 -0
  272. package/esm/spec/transform.d.ts +12 -0
  273. package/esm/spec/transform.js +2 -0
  274. package/esm/spec/transform.js.map +1 -0
  275. package/esm/themes/base.js +9 -1
  276. package/esm/themes/base.js.map +1 -1
  277. package/esm/transforms/arrange-draw-order.d.ts +10 -0
  278. package/esm/transforms/arrange-draw-order.js +27 -0
  279. package/esm/transforms/arrange-draw-order.js.map +1 -0
  280. package/esm/transforms/base-transform.d.ts +7 -0
  281. package/esm/transforms/base-transform.js +7 -0
  282. package/esm/transforms/base-transform.js.map +1 -0
  283. package/esm/transforms/collapse-expand-combo.d.ts +10 -0
  284. package/esm/transforms/collapse-expand-combo.js +82 -0
  285. package/esm/transforms/collapse-expand-combo.js.map +1 -0
  286. package/esm/transforms/index.d.ts +6 -0
  287. package/esm/transforms/index.js +6 -0
  288. package/esm/transforms/index.js.map +1 -0
  289. package/esm/transforms/process-parallel-edges.d.ts +84 -0
  290. package/esm/transforms/process-parallel-edges.js +215 -0
  291. package/esm/transforms/process-parallel-edges.js.map +1 -0
  292. package/esm/transforms/types.d.ts +20 -0
  293. package/esm/transforms/types.js +11 -0
  294. package/esm/transforms/types.js.map +1 -0
  295. package/esm/transforms/update-related-edge.d.ts +9 -0
  296. package/esm/transforms/update-related-edge.js +20 -0
  297. package/esm/transforms/update-related-edge.js.map +1 -0
  298. package/esm/types/canvas.d.ts +1 -1
  299. package/esm/types/change.d.ts +27 -10
  300. package/esm/types/element.d.ts +6 -140
  301. package/esm/types/event.d.ts +42 -7
  302. package/esm/types/index.d.ts +0 -1
  303. package/esm/types/node.d.ts +3 -3
  304. package/esm/types/point.d.ts +1 -0
  305. package/esm/utils/animation.d.ts +1 -1
  306. package/esm/utils/animation.js +6 -0
  307. package/esm/utils/animation.js.map +1 -1
  308. package/esm/utils/bbox.d.ts +1 -1
  309. package/esm/utils/behaviors/brush.d.ts +19 -0
  310. package/esm/utils/behaviors/brush.js +25 -0
  311. package/esm/utils/behaviors/brush.js.map +1 -0
  312. package/esm/utils/behaviors/lasso.d.ts +13 -0
  313. package/esm/utils/behaviors/lasso.js +112 -0
  314. package/esm/utils/behaviors/lasso.js.map +1 -0
  315. package/esm/utils/behaviors/utils.d.ts +21 -0
  316. package/esm/utils/behaviors/utils.js +42 -0
  317. package/esm/utils/behaviors/utils.js.map +1 -0
  318. package/esm/utils/change.d.ts +9 -1
  319. package/esm/utils/change.js +28 -0
  320. package/esm/utils/change.js.map +1 -1
  321. package/esm/utils/combo.d.ts +5 -4
  322. package/esm/utils/combo.js.map +1 -1
  323. package/esm/utils/edge.d.ts +11 -0
  324. package/esm/utils/edge.js +1 -1
  325. package/esm/utils/edge.js.map +1 -1
  326. package/esm/utils/element.d.ts +19 -11
  327. package/esm/utils/element.js +19 -9
  328. package/esm/utils/element.js.map +1 -1
  329. package/esm/utils/event/events.d.ts +9 -14
  330. package/esm/utils/event/events.js +3 -8
  331. package/esm/utils/event/events.js.map +1 -1
  332. package/esm/utils/extension.d.ts +1 -1
  333. package/esm/utils/extension.js.map +1 -1
  334. package/esm/utils/id.d.ts +3 -8
  335. package/esm/utils/id.js +8 -2
  336. package/esm/utils/id.js.map +1 -1
  337. package/esm/utils/line.d.ts +21 -0
  338. package/esm/utils/line.js +41 -0
  339. package/esm/utils/line.js.map +1 -0
  340. package/esm/utils/path.d.ts +35 -0
  341. package/esm/utils/path.js +143 -0
  342. package/esm/utils/path.js.map +1 -0
  343. package/esm/utils/point.d.ts +74 -20
  344. package/esm/utils/point.js +168 -44
  345. package/esm/utils/point.js.map +1 -1
  346. package/esm/utils/polygon.d.ts +17 -0
  347. package/esm/utils/polygon.js +62 -0
  348. package/esm/utils/polygon.js.map +1 -0
  349. package/esm/utils/position.d.ts +14 -1
  350. package/esm/utils/position.js +16 -0
  351. package/esm/utils/position.js.map +1 -1
  352. package/esm/utils/prefix.d.ts +1 -1
  353. package/esm/utils/prefix.js.map +1 -1
  354. package/esm/utils/shortcut.d.ts +11 -0
  355. package/esm/utils/shortcut.js +37 -5
  356. package/esm/utils/shortcut.js.map +1 -1
  357. package/esm/utils/style.js.map +1 -1
  358. package/esm/utils/vector.d.ts +3 -2
  359. package/esm/utils/vector.js +10 -3
  360. package/esm/utils/vector.js.map +1 -1
  361. package/lib/behaviors/brush-select.d.ts +104 -0
  362. package/lib/behaviors/brush-select.js +203 -0
  363. package/lib/behaviors/brush-select.js.map +1 -0
  364. package/lib/behaviors/click-element.d.ts +77 -0
  365. package/lib/behaviors/click-element.js +112 -0
  366. package/lib/behaviors/click-element.js.map +1 -0
  367. package/lib/behaviors/collapse-expand.d.ts +4 -5
  368. package/lib/behaviors/collapse-expand.js +8 -4
  369. package/lib/behaviors/collapse-expand.js.map +1 -1
  370. package/lib/behaviors/create-edge.d.ts +55 -0
  371. package/lib/behaviors/create-edge.js +145 -0
  372. package/lib/behaviors/create-edge.js.map +1 -0
  373. package/lib/behaviors/drag-canvas.d.ts +6 -6
  374. package/lib/behaviors/drag-canvas.js +15 -7
  375. package/lib/behaviors/drag-canvas.js.map +1 -1
  376. package/lib/behaviors/drag-element-force.d.ts +14 -0
  377. package/lib/behaviors/drag-element-force.js +59 -0
  378. package/lib/behaviors/drag-element-force.js.map +1 -0
  379. package/lib/behaviors/drag-element.d.ts +17 -14
  380. package/lib/behaviors/drag-element.js +17 -9
  381. package/lib/behaviors/drag-element.js.map +1 -1
  382. package/lib/behaviors/focus-element.d.ts +4 -3
  383. package/lib/behaviors/focus-element.js.map +1 -1
  384. package/lib/behaviors/hover-element.d.ts +4 -5
  385. package/lib/behaviors/hover-element.js +1 -1
  386. package/lib/behaviors/hover-element.js.map +1 -1
  387. package/lib/behaviors/index.d.ts +10 -0
  388. package/lib/behaviors/index.js +11 -1
  389. package/lib/behaviors/index.js.map +1 -1
  390. package/lib/behaviors/lasso-select.d.ts +20 -0
  391. package/lib/behaviors/lasso-select.js +83 -0
  392. package/lib/behaviors/lasso-select.js.map +1 -0
  393. package/lib/behaviors/types.d.ts +1 -0
  394. package/lib/behaviors/zoom-canvas.d.ts +7 -6
  395. package/lib/behaviors/zoom-canvas.js +6 -2
  396. package/lib/behaviors/zoom-canvas.js.map +1 -1
  397. package/lib/constants/change.d.ts +1 -1
  398. package/lib/constants/change.js +13 -13
  399. package/lib/constants/change.js.map +1 -1
  400. package/lib/constants/events/graph.d.ts +9 -15
  401. package/lib/constants/events/graph.js +9 -17
  402. package/lib/constants/events/graph.js.map +1 -1
  403. package/lib/constants/index.d.ts +1 -0
  404. package/lib/constants/index.js +1 -0
  405. package/lib/constants/index.js.map +1 -1
  406. package/lib/constants/registry.d.ts +22 -0
  407. package/lib/constants/registry.js +27 -0
  408. package/lib/constants/registry.js.map +1 -0
  409. package/lib/elements/combos/base-combo.d.ts +64 -6
  410. package/lib/elements/combos/base-combo.js +21 -0
  411. package/lib/elements/combos/base-combo.js.map +1 -1
  412. package/lib/elements/combos/circle.d.ts +8 -12
  413. package/lib/elements/combos/circle.js.map +1 -1
  414. package/lib/elements/combos/rect.d.ts +5 -9
  415. package/lib/elements/combos/rect.js.map +1 -1
  416. package/lib/elements/edges/base-edge.d.ts +85 -10
  417. package/lib/elements/edges/base-edge.js +21 -0
  418. package/lib/elements/edges/base-edge.js.map +1 -1
  419. package/lib/elements/edges/cubic-horizontal.d.ts +2 -2
  420. package/lib/elements/edges/cubic-vertical.d.ts +2 -2
  421. package/lib/elements/edges/cubic.d.ts +2 -2
  422. package/lib/elements/edges/polyline.d.ts +2 -2
  423. package/lib/elements/edges/quadratic.d.ts +2 -2
  424. package/lib/elements/nodes/base-node.d.ts +125 -13
  425. package/lib/elements/nodes/base-node.js +25 -1
  426. package/lib/elements/nodes/base-node.js.map +1 -1
  427. package/lib/elements/nodes/circle.d.ts +5 -8
  428. package/lib/elements/nodes/circle.js.map +1 -1
  429. package/lib/elements/nodes/diamond.d.ts +2 -4
  430. package/lib/elements/nodes/diamond.js +2 -2
  431. package/lib/elements/nodes/diamond.js.map +1 -1
  432. package/lib/elements/nodes/ellipse.d.ts +5 -8
  433. package/lib/elements/nodes/ellipse.js +1 -1
  434. package/lib/elements/nodes/ellipse.js.map +1 -1
  435. package/lib/elements/nodes/hexagon.d.ts +6 -9
  436. package/lib/elements/nodes/hexagon.js.map +1 -1
  437. package/lib/elements/nodes/image.d.ts +9 -11
  438. package/lib/elements/nodes/image.js.map +1 -1
  439. package/lib/elements/nodes/polygon.d.ts +9 -8
  440. package/lib/elements/nodes/polygon.js +4 -1
  441. package/lib/elements/nodes/polygon.js.map +1 -1
  442. package/lib/elements/nodes/rect.d.ts +2 -3
  443. package/lib/elements/nodes/rect.js.map +1 -1
  444. package/lib/elements/nodes/star.d.ts +7 -10
  445. package/lib/elements/nodes/star.js.map +1 -1
  446. package/lib/elements/nodes/triangle.d.ts +7 -10
  447. package/lib/elements/nodes/triangle.js.map +1 -1
  448. package/lib/exports.d.ts +18 -14
  449. package/lib/exports.js +26 -1
  450. package/lib/exports.js.map +1 -1
  451. package/lib/layouts/index.d.ts +1 -1
  452. package/lib/layouts/index.js +2 -1
  453. package/lib/layouts/index.js.map +1 -1
  454. package/lib/layouts/types.d.ts +6 -6
  455. package/lib/palettes/index.d.ts +1 -0
  456. package/lib/palettes/index.js +13 -1
  457. package/lib/palettes/index.js.map +1 -1
  458. package/lib/plugins/camera-setting.d.ts +95 -0
  459. package/lib/plugins/camera-setting.js +69 -0
  460. package/lib/plugins/camera-setting.js.map +1 -0
  461. package/lib/plugins/contextmenu.d.ts +8 -5
  462. package/lib/plugins/contextmenu.js.map +1 -1
  463. package/lib/plugins/history/events.d.ts +21 -0
  464. package/lib/plugins/history/events.js +19 -0
  465. package/lib/plugins/history/events.js.map +1 -0
  466. package/lib/plugins/history/index.d.ts +82 -0
  467. package/lib/plugins/history/index.js +175 -0
  468. package/lib/plugins/history/index.js.map +1 -0
  469. package/lib/plugins/history/utils.d.ts +31 -0
  470. package/lib/plugins/history/utils.js +84 -0
  471. package/lib/plugins/history/utils.js.map +1 -0
  472. package/lib/plugins/hull/index.d.ts +59 -0
  473. package/lib/plugins/hull/index.js +114 -0
  474. package/lib/plugins/hull/index.js.map +1 -0
  475. package/lib/plugins/hull/shape.d.ts +49 -0
  476. package/lib/plugins/hull/shape.js +39 -0
  477. package/lib/plugins/hull/shape.js.map +1 -0
  478. package/lib/plugins/hull/util.d.ts +12 -0
  479. package/lib/plugins/hull/util.js +207 -0
  480. package/lib/plugins/hull/util.js.map +1 -0
  481. package/lib/plugins/index.d.ts +8 -0
  482. package/lib/plugins/index.js +9 -1
  483. package/lib/plugins/index.js.map +1 -1
  484. package/lib/plugins/legend.d.ts +49 -0
  485. package/lib/plugins/legend.js +271 -0
  486. package/lib/plugins/legend.js.map +1 -0
  487. package/lib/plugins/tooltip.d.ts +12 -10
  488. package/lib/plugins/tooltip.js +0 -1
  489. package/lib/plugins/tooltip.js.map +1 -1
  490. package/lib/preset.js +2 -5
  491. package/lib/preset.js.map +1 -1
  492. package/lib/registry/build-in.js +17 -0
  493. package/lib/registry/build-in.js.map +1 -1
  494. package/lib/registry/extension/index.d.ts +3 -3
  495. package/lib/registry/extension/index.js.map +1 -1
  496. package/lib/registry/index.d.ts +6 -4
  497. package/lib/registry/index.js +1 -0
  498. package/lib/registry/index.js.map +1 -1
  499. package/lib/registry/types.d.ts +4 -6
  500. package/lib/runtime/batch.d.ts +11 -0
  501. package/lib/runtime/batch.js +35 -0
  502. package/lib/runtime/batch.js.map +1 -0
  503. package/lib/runtime/behavior.d.ts +1 -1
  504. package/lib/runtime/behavior.js +3 -2
  505. package/lib/runtime/behavior.js.map +1 -1
  506. package/lib/runtime/canvas.d.ts +15 -4
  507. package/lib/runtime/canvas.js +101 -39
  508. package/lib/runtime/canvas.js.map +1 -1
  509. package/lib/runtime/data.d.ts +4 -4
  510. package/lib/runtime/data.js +22 -24
  511. package/lib/runtime/data.js.map +1 -1
  512. package/lib/runtime/element.d.ts +6 -23
  513. package/lib/runtime/element.js +47 -149
  514. package/lib/runtime/element.js.map +1 -1
  515. package/lib/runtime/graph.d.ts +71 -6
  516. package/lib/runtime/graph.js +104 -9
  517. package/lib/runtime/graph.js.map +1 -1
  518. package/lib/runtime/layout.d.ts +5 -11
  519. package/lib/runtime/layout.js +27 -73
  520. package/lib/runtime/layout.js.map +1 -1
  521. package/lib/runtime/plugin.d.ts +2 -1
  522. package/lib/runtime/plugin.js +3 -0
  523. package/lib/runtime/plugin.js.map +1 -1
  524. package/lib/runtime/transform.d.ts +11 -0
  525. package/lib/runtime/transform.js +24 -0
  526. package/lib/runtime/transform.js.map +1 -0
  527. package/lib/runtime/types.d.ts +14 -0
  528. package/lib/spec/index.d.ts +1 -0
  529. package/lib/spec/spec.d.ts +7 -0
  530. package/lib/spec/transform.d.ts +12 -0
  531. package/lib/{types/behavior.js → spec/transform.js} +1 -1
  532. package/lib/spec/transform.js.map +1 -0
  533. package/lib/themes/base.js +9 -1
  534. package/lib/themes/base.js.map +1 -1
  535. package/lib/transforms/arrange-draw-order.d.ts +10 -0
  536. package/lib/transforms/arrange-draw-order.js +31 -0
  537. package/lib/transforms/arrange-draw-order.js.map +1 -0
  538. package/lib/transforms/base-transform.d.ts +7 -0
  539. package/lib/transforms/base-transform.js +11 -0
  540. package/lib/transforms/base-transform.js.map +1 -0
  541. package/lib/transforms/collapse-expand-combo.d.ts +10 -0
  542. package/lib/transforms/collapse-expand-combo.js +86 -0
  543. package/lib/transforms/collapse-expand-combo.js.map +1 -0
  544. package/lib/transforms/index.d.ts +6 -0
  545. package/lib/transforms/index.js +14 -0
  546. package/lib/transforms/index.js.map +1 -0
  547. package/lib/transforms/process-parallel-edges.d.ts +84 -0
  548. package/lib/transforms/process-parallel-edges.js +222 -0
  549. package/lib/transforms/process-parallel-edges.js.map +1 -0
  550. package/lib/transforms/types.d.ts +20 -0
  551. package/lib/transforms/types.js +15 -0
  552. package/lib/transforms/types.js.map +1 -0
  553. package/lib/transforms/update-related-edge.d.ts +9 -0
  554. package/lib/transforms/update-related-edge.js +24 -0
  555. package/lib/transforms/update-related-edge.js.map +1 -0
  556. package/lib/types/canvas.d.ts +1 -1
  557. package/lib/types/change.d.ts +27 -10
  558. package/lib/types/element.d.ts +6 -140
  559. package/lib/types/event.d.ts +42 -7
  560. package/lib/types/index.d.ts +0 -1
  561. package/lib/types/node.d.ts +3 -3
  562. package/lib/types/point.d.ts +1 -0
  563. package/lib/utils/animation.d.ts +1 -1
  564. package/lib/utils/animation.js +6 -0
  565. package/lib/utils/animation.js.map +1 -1
  566. package/lib/utils/bbox.d.ts +1 -1
  567. package/lib/utils/behaviors/brush.d.ts +19 -0
  568. package/lib/utils/behaviors/brush.js +30 -0
  569. package/lib/utils/behaviors/brush.js.map +1 -0
  570. package/lib/utils/behaviors/lasso.d.ts +13 -0
  571. package/lib/utils/behaviors/lasso.js +116 -0
  572. package/lib/utils/behaviors/lasso.js.map +1 -0
  573. package/lib/utils/behaviors/utils.d.ts +21 -0
  574. package/lib/utils/behaviors/utils.js +47 -0
  575. package/lib/utils/behaviors/utils.js.map +1 -0
  576. package/lib/utils/change.d.ts +9 -1
  577. package/lib/utils/change.js +30 -1
  578. package/lib/utils/change.js.map +1 -1
  579. package/lib/utils/combo.d.ts +5 -4
  580. package/lib/utils/combo.js.map +1 -1
  581. package/lib/utils/edge.d.ts +11 -0
  582. package/lib/utils/edge.js +2 -1
  583. package/lib/utils/edge.js.map +1 -1
  584. package/lib/utils/element.d.ts +19 -11
  585. package/lib/utils/element.js +21 -10
  586. package/lib/utils/element.js.map +1 -1
  587. package/lib/utils/event/events.d.ts +9 -14
  588. package/lib/utils/event/events.js +4 -10
  589. package/lib/utils/event/events.js.map +1 -1
  590. package/lib/utils/extension.d.ts +1 -1
  591. package/lib/utils/extension.js.map +1 -1
  592. package/lib/utils/id.d.ts +3 -8
  593. package/lib/utils/id.js +10 -4
  594. package/lib/utils/id.js.map +1 -1
  595. package/lib/utils/line.d.ts +21 -0
  596. package/lib/utils/line.js +46 -0
  597. package/lib/utils/line.js.map +1 -0
  598. package/lib/utils/path.d.ts +35 -0
  599. package/lib/utils/path.js +150 -0
  600. package/lib/utils/path.js.map +1 -0
  601. package/lib/utils/point.d.ts +74 -20
  602. package/lib/utils/point.js +178 -48
  603. package/lib/utils/point.js.map +1 -1
  604. package/lib/utils/polygon.d.ts +17 -0
  605. package/lib/utils/polygon.js +66 -0
  606. package/lib/utils/polygon.js.map +1 -0
  607. package/lib/utils/position.d.ts +14 -1
  608. package/lib/utils/position.js +18 -1
  609. package/lib/utils/position.js.map +1 -1
  610. package/lib/utils/prefix.d.ts +1 -1
  611. package/lib/utils/prefix.js.map +1 -1
  612. package/lib/utils/shortcut.d.ts +11 -0
  613. package/lib/utils/shortcut.js +36 -4
  614. package/lib/utils/shortcut.js.map +1 -1
  615. package/lib/utils/style.js.map +1 -1
  616. package/lib/utils/vector.d.ts +3 -2
  617. package/lib/utils/vector.js +10 -3
  618. package/lib/utils/vector.js.map +1 -1
  619. package/package.json +6 -7
  620. package/src/behaviors/brush-select.ts +306 -0
  621. package/src/behaviors/click-element.ts +182 -0
  622. package/src/behaviors/collapse-expand.ts +13 -11
  623. package/src/behaviors/create-edge.ts +206 -0
  624. package/src/behaviors/drag-canvas.ts +22 -14
  625. package/src/behaviors/drag-element-force.ts +70 -0
  626. package/src/behaviors/drag-element.ts +32 -25
  627. package/src/behaviors/focus-element.ts +7 -6
  628. package/src/behaviors/hover-element.ts +16 -13
  629. package/src/behaviors/index.ts +10 -0
  630. package/src/behaviors/lasso-select.ts +103 -0
  631. package/src/behaviors/types.ts +2 -0
  632. package/src/behaviors/zoom-canvas.ts +14 -9
  633. package/src/constants/change.ts +1 -1
  634. package/src/constants/events/graph.ts +8 -16
  635. package/src/constants/index.ts +1 -0
  636. package/src/constants/registry.ts +22 -0
  637. package/src/elements/combos/base-combo.ts +83 -10
  638. package/src/elements/combos/circle.ts +8 -11
  639. package/src/elements/combos/rect.ts +5 -8
  640. package/src/elements/edges/base-edge.ts +95 -14
  641. package/src/elements/edges/cubic-horizontal.ts +2 -2
  642. package/src/elements/edges/cubic-vertical.ts +2 -2
  643. package/src/elements/edges/cubic.ts +2 -2
  644. package/src/elements/edges/polyline.ts +2 -2
  645. package/src/elements/edges/quadratic.ts +2 -2
  646. package/src/elements/nodes/base-node.ts +140 -20
  647. package/src/elements/nodes/circle.ts +5 -7
  648. package/src/elements/nodes/diamond.ts +4 -6
  649. package/src/elements/nodes/ellipse.ts +6 -8
  650. package/src/elements/nodes/hexagon.ts +7 -9
  651. package/src/elements/nodes/image.ts +12 -13
  652. package/src/elements/nodes/polygon.ts +17 -11
  653. package/src/elements/nodes/rect.ts +3 -4
  654. package/src/elements/nodes/star.ts +9 -11
  655. package/src/elements/nodes/triangle.ts +7 -9
  656. package/src/exports.ts +57 -12
  657. package/src/layouts/index.ts +1 -0
  658. package/src/layouts/types.ts +7 -5
  659. package/src/palettes/index.ts +13 -0
  660. package/src/plugins/camera-setting.ts +153 -0
  661. package/src/plugins/contextmenu.ts +10 -7
  662. package/src/plugins/history/events.ts +25 -0
  663. package/src/plugins/history/index.ts +222 -0
  664. package/src/plugins/history/utils.ts +98 -0
  665. package/src/plugins/hull/index.ts +149 -0
  666. package/src/plugins/hull/shape.ts +96 -0
  667. package/src/plugins/hull/util.ts +222 -0
  668. package/src/plugins/index.ts +8 -0
  669. package/src/plugins/legend.ts +321 -0
  670. package/src/plugins/tooltip.ts +16 -15
  671. package/src/preset.ts +2 -6
  672. package/src/registry/build-in.ts +33 -3
  673. package/src/registry/extension/index.ts +5 -5
  674. package/src/registry/index.ts +11 -4
  675. package/src/registry/types.ts +2 -7
  676. package/src/runtime/batch.ts +38 -0
  677. package/src/runtime/behavior.ts +4 -3
  678. package/src/runtime/canvas.ts +130 -52
  679. package/src/runtime/data.ts +31 -36
  680. package/src/runtime/element.ts +78 -185
  681. package/src/runtime/graph.ts +121 -15
  682. package/src/runtime/layout.ts +48 -79
  683. package/src/runtime/plugin.ts +5 -1
  684. package/src/runtime/transform.ts +27 -0
  685. package/src/runtime/types.ts +14 -0
  686. package/src/spec/index.ts +1 -0
  687. package/src/spec/spec.ts +7 -0
  688. package/src/spec/transform.ts +15 -0
  689. package/src/themes/base.ts +9 -1
  690. package/src/transforms/arrange-draw-order.ts +36 -0
  691. package/src/transforms/base-transform.ts +11 -0
  692. package/src/transforms/collapse-expand-combo.ts +87 -0
  693. package/src/transforms/index.ts +7 -0
  694. package/src/transforms/process-parallel-edges.ts +286 -0
  695. package/src/transforms/types.ts +23 -0
  696. package/src/transforms/update-related-edge.ts +28 -0
  697. package/src/types/canvas.ts +1 -1
  698. package/src/types/change.ts +28 -10
  699. package/src/types/element.ts +6 -147
  700. package/src/types/event.ts +62 -7
  701. package/src/types/index.ts +0 -1
  702. package/src/types/node.ts +3 -3
  703. package/src/types/point.ts +1 -0
  704. package/src/utils/animation.ts +6 -0
  705. package/src/utils/bbox.ts +1 -1
  706. package/src/utils/behaviors/brush.ts +29 -0
  707. package/src/utils/behaviors/lasso.ts +127 -0
  708. package/src/utils/behaviors/utils.ts +47 -0
  709. package/src/utils/change.ts +42 -1
  710. package/src/utils/combo.ts +6 -5
  711. package/src/utils/edge.ts +6 -1
  712. package/src/utils/element.ts +22 -11
  713. package/src/utils/event/events.ts +18 -18
  714. package/src/utils/extension.ts +1 -1
  715. package/src/utils/id.ts +11 -2
  716. package/src/utils/line.ts +50 -0
  717. package/src/utils/path.ts +153 -0
  718. package/src/utils/point.ts +190 -51
  719. package/src/utils/polygon.ts +72 -0
  720. package/src/utils/position.ts +18 -1
  721. package/src/utils/prefix.ts +1 -1
  722. package/src/utils/shortcut.ts +41 -5
  723. package/src/utils/style.ts +1 -1
  724. package/src/utils/vector.ts +10 -3
  725. package/dist/lib/types/behavior.d.ts +0 -5
  726. package/esm/elements/types.d.ts +0 -0
  727. package/esm/elements/types.js +0 -15
  728. package/esm/elements/types.js.map +0 -1
  729. package/esm/types/behavior.d.ts +0 -5
  730. package/esm/types/behavior.js +0 -2
  731. package/esm/types/behavior.js.map +0 -1
  732. package/lib/elements/types.d.ts +0 -0
  733. package/lib/elements/types.js +0 -15
  734. package/lib/elements/types.js.map +0 -1
  735. package/lib/types/behavior.d.ts +0 -5
  736. package/lib/types/behavior.js.map +0 -1
  737. package/src/elements/types.ts +0 -21
  738. package/src/types/behavior.ts +0 -6
@@ -1,8 +1,49 @@
1
- import type { AABB, BaseStyleProps, DisplayObject, DisplayObjectConfig, Group } from '@antv/g';
2
- import type { BaseComboProps, NodeLikeData, Position, PrefixObject, STDSize } from '../../types';
1
+ import type { AABB, DisplayObject, DisplayObjectConfig, Group } from '@antv/g';
2
+ import type { BaseElementStyleProps, Combo, Node, NodeLikeData, Padding, Placement, Position, PrefixObject, STDSize, Size } from '../../types';
3
3
  import type { BaseNodeStyleProps } from '../nodes';
4
4
  import { BaseNode } from '../nodes';
5
5
  import { IconStyleProps } from '../shapes';
6
+ export type BaseComboStyleProps<T extends Record<string, unknown> = Record<string, any>> = T & BaseElementStyleProps & BaseNodeStyleProps<T> & PrefixObject<T, 'collapsed'> & PrefixObject<CollapsedMarkerStyleProps, 'collapsedMarker'> & {
7
+ /**
8
+ * <zh/> Combo 展开后的默认大小
9
+ *
10
+ * <en/> The default size of combo when expanded
11
+ */
12
+ size?: Size;
13
+ /**
14
+ * <zh/> Combo 收起后的默认大小
15
+ *
16
+ * <en/> The default size of combo when collapsed
17
+ */
18
+ collapsedSize?: Size;
19
+ /**
20
+ * <zh/> Combo 收起时的原点
21
+ * <en/> The origin of combo when collapsed
22
+ */
23
+ collapsedOrigin?: Placement | [number, number];
24
+ /**
25
+ * <zh/> Combo 的子元素,可以是节点或者 Combo
26
+ *
27
+ * <en/> The children of combo, which can be nodes or combos
28
+ */
29
+ childrenNode?: (Node | Combo)[];
30
+ /**
31
+ * <zh/> Combo 的子元素数据
32
+ *
33
+ * <en/> The data of the children of combo
34
+ * @description
35
+ * <zh/> 如果 combo 是收起状态,children 可能为空,通过 childrenData 能够获取完整的子元素数据
36
+ *
37
+ * <en/> If the combo is collapsed, children may be empty, and the complete child element data can be obtained through childrenData
38
+ */
39
+ childrenData?: NodeLikeData[];
40
+ /**
41
+ * <zh/> Combo 的内边距,只在展开状态下生效
42
+ * <en/> The padding of combo, only effective when expanded
43
+ */
44
+ padding?: Padding;
45
+ collapsedMarker?: boolean;
46
+ };
6
47
  export type CollapsedMarkerStyleProps = IconStyleProps & {
7
48
  /**
8
49
  * <zh/> 标记类型
@@ -15,10 +56,6 @@ export type CollapsedMarkerStyleProps = IconStyleProps & {
15
56
  */
16
57
  type?: 'child-count' | 'descendant-count' | 'node-count' | ((children: NodeLikeData[]) => string);
17
58
  };
18
- export type BaseComboStyleProps<KeyStyleProps extends BaseStyleProps = BaseStyleProps> = BaseComboProps & PrefixObject<KeyStyleProps, 'collapsed'> & {
19
- collapsedMarker?: boolean;
20
- } & PrefixObject<CollapsedMarkerStyleProps, 'collapsedMarker'> & BaseNodeStyleProps<KeyStyleProps>;
21
- export type ParsedBaseComboStyleProps<KeyStyleProps extends BaseStyleProps> = Required<BaseComboStyleProps<KeyStyleProps>>;
22
59
  export declare abstract class BaseCombo<S extends BaseComboStyleProps = BaseComboStyleProps> extends BaseNode<S> {
23
60
  type: string;
24
61
  static defaultStyleProps: Partial<BaseComboStyleProps>;
@@ -44,4 +81,25 @@ export declare abstract class BaseCombo<S extends BaseComboStyleProps = BaseComb
44
81
  zIndex: number;
45
82
  };
46
83
  render(attributes: Required<S>, container?: Group): void;
84
+ /**
85
+ * <zh/> 在元素完成创建并执行完入场动画后调用
86
+ *
87
+ * <en/> Called after the element is created and the entrance animation is completed
88
+ * @override
89
+ */
90
+ onCreate(): void;
91
+ /**
92
+ * <zh/> 在元素更新并执行完过渡动画后调用
93
+ *
94
+ * <en/> Called after the element is updated and the transition animation is completed
95
+ * @override
96
+ */
97
+ onUpdate(): void;
98
+ /**
99
+ * <zh/> 在元素完成退场动画并销毁后调用
100
+ *
101
+ * <en/> Called after the element completes the exit animation and is destroyed
102
+ * @override
103
+ */
104
+ onDestroy(): void;
47
105
  }
@@ -1,18 +1,14 @@
1
1
  import type { DisplayObjectConfig, CircleStyleProps as GCircleStyleProps } from '@antv/g';
2
2
  import { Circle as GCircle, Group } from '@antv/g';
3
3
  import type { Position, STDSize } from '../../types';
4
- import type { BaseComboStyleProps, ParsedBaseComboStyleProps } from './base-combo';
4
+ import type { BaseComboStyleProps } from './base-combo';
5
5
  import { BaseCombo } from './base-combo';
6
- export type CircleComboStyleProps = BaseComboStyleProps<KeyStyleProps>;
7
- type ParsedCircleComboStyleProps = ParsedBaseComboStyleProps<KeyStyleProps>;
8
- type CircleComboOptions = DisplayObjectConfig<CircleComboStyleProps>;
9
- type KeyStyleProps = GCircleStyleProps;
6
+ export type CircleComboStyleProps = BaseComboStyleProps;
10
7
  export declare class CircleCombo extends BaseCombo<CircleComboStyleProps> {
11
- constructor(options: CircleComboOptions);
12
- protected drawKeyShape(attributes: ParsedCircleComboStyleProps, container: Group): GCircle | undefined;
13
- protected getKeyStyle(attributes: ParsedCircleComboStyleProps): GCircleStyleProps;
14
- protected getCollapsedKeySize(attributes: ParsedCircleComboStyleProps): STDSize;
15
- protected getExpandedKeySize(attributes: ParsedCircleComboStyleProps): STDSize;
16
- protected getCollapsedOriginPosition(attributes: ParsedBaseComboStyleProps<KeyStyleProps>): Position;
8
+ constructor(options: DisplayObjectConfig<CircleComboStyleProps>);
9
+ protected drawKeyShape(attributes: Required<CircleComboStyleProps>, container: Group): GCircle | undefined;
10
+ protected getKeyStyle(attributes: Required<CircleComboStyleProps>): GCircleStyleProps;
11
+ protected getCollapsedKeySize(attributes: Required<CircleComboStyleProps>): STDSize;
12
+ protected getExpandedKeySize(attributes: Required<CircleComboStyleProps>): STDSize;
13
+ protected getCollapsedOriginPosition(attributes: Required<CircleComboStyleProps>): Position;
17
14
  }
18
- export {};
@@ -1,15 +1,11 @@
1
1
  import type { DisplayObjectConfig, RectStyleProps as GRectStyleProps } from '@antv/g';
2
2
  import { Rect as GRect, Group } from '@antv/g';
3
- import type { BaseComboStyleProps, ParsedBaseComboStyleProps } from './base-combo';
3
+ import type { BaseComboStyleProps } from './base-combo';
4
4
  import { BaseCombo } from './base-combo';
5
- type KeyStyleProps = GRectStyleProps;
6
- export type RectComboStyleProps = BaseComboStyleProps<KeyStyleProps>;
7
- type ParsedRectComboStyleProps = ParsedBaseComboStyleProps<KeyStyleProps>;
8
- type RectComboOptions = DisplayObjectConfig<RectComboStyleProps>;
5
+ export type RectComboStyleProps = BaseComboStyleProps;
9
6
  export declare class RectCombo extends BaseCombo<RectComboStyleProps> {
10
7
  static defaultStyleProps: Partial<RectComboStyleProps>;
11
- constructor(options: RectComboOptions);
12
- protected drawKeyShape(attributes: ParsedRectComboStyleProps, container: Group): GRect | undefined;
13
- protected getKeyStyle(attributes: ParsedRectComboStyleProps): GRectStyleProps;
8
+ constructor(options: DisplayObjectConfig<RectComboStyleProps>);
9
+ protected drawKeyShape(attributes: Required<RectComboStyleProps>, container: Group): GRect | undefined;
10
+ protected getKeyStyle(attributes: Required<RectComboStyleProps>): GRectStyleProps;
14
11
  }
15
- export {};
@@ -1,11 +1,73 @@
1
1
  import type { DisplayObjectConfig, Group, ImageStyleProps, PathStyleProps } from '@antv/g';
2
2
  import { Path } from '@antv/g';
3
3
  import type { PathArray } from '@antv/util';
4
- import type { BaseEdgeProps, EdgeLabelStyleProps, Keyframe, LoopPlacement, Point, PrefixObject, Size } from '../../types';
4
+ import type { BaseElementStyleProps, EdgeLabelStyleProps, Keyframe, LoopPlacement, Node, Point, PrefixObject, Size } from '../../types';
5
5
  import type { SymbolFactor } from '../../utils/symbol';
6
6
  import type { LabelStyleProps } from '../shapes';
7
7
  import { BaseShape } from '../shapes/base-shape';
8
- export type BaseEdgeStyleProps = BaseEdgeProps & ShapeSwitch & PrefixObject<EdgeLabelStyleProps, 'label'> & PrefixObject<PathStyleProps, 'halo'> & PrefixObject<EdgeArrowStyleProps, 'startArrow'> & PrefixObject<EdgeArrowStyleProps, 'endArrow'> & PrefixObject<LoopStyleProps, 'loop'>;
8
+ export type BaseEdgeStyleProps = BaseElementStyleProps & Pick<PathStyleProps, 'isBillboard' | 'markerStart' | 'markerStartOffset' | 'markerEnd' | 'markerEndOffset' | 'markerMid'> & PrefixObject<EdgeLabelStyleProps, 'label'> & PrefixObject<PathStyleProps, 'halo'> & PrefixObject<EdgeArrowStyleProps, 'startArrow'> & PrefixObject<EdgeArrowStyleProps, 'endArrow'> & PrefixObject<LoopStyleProps, 'loop'> & {
9
+ /**
10
+ * <zh/> 是否显示边的标签
11
+ *
12
+ * <en/> Whether to display the label of the edge
13
+ */
14
+ label?: boolean;
15
+ /**
16
+ * <zh/> 是否显示边的光晕
17
+ *
18
+ * <en/> Whether to display the halo of the edge
19
+ */
20
+ halo?: boolean;
21
+ /**
22
+ * <zh/> 是否显示边的起始箭头
23
+ *
24
+ * <en/> Whether to display the start arrow of the edge
25
+ */
26
+ startArrow?: boolean;
27
+ /**
28
+ * <zh/> 是否显示边的结束箭头
29
+ *
30
+ * <en/> Whether to display the end arrow of the edge
31
+ */
32
+ endArrow?: boolean;
33
+ /**
34
+ * <zh/> 起始箭头的偏移量
35
+ *
36
+ * <en/> Offset of the start arrow
37
+ */
38
+ startArrowOffset?: number;
39
+ /**
40
+ * <zh/> 结束箭头的偏移量
41
+ *
42
+ * <en/> Offset of the end arrow
43
+ */
44
+ endArrowOffset?: number;
45
+ /**
46
+ * <zh/> 主色
47
+ * <en/> Subject color
48
+ */
49
+ color?: string;
50
+ /**
51
+ * <zh/> 边的起点 shape
52
+ * <en/> The source shape. Represents the start of the edge
53
+ */
54
+ sourceNode: Node;
55
+ /**
56
+ * <zh/> 边的终点 shape
57
+ * <en/> The source shape. Represents the start of the edge
58
+ */
59
+ targetNode: Node;
60
+ /**
61
+ * <zh/> 边起始连接的 port
62
+ * <en/> The Port of the source node
63
+ */
64
+ sourcePort?: string;
65
+ /**
66
+ * <zh/> 边终点连接的 port
67
+ * <en/> The Port of the target node
68
+ */
69
+ targetPort?: string;
70
+ };
9
71
  type ParsedBaseEdgeStyleProps = Required<BaseEdgeStyleProps>;
10
72
  export declare abstract class BaseEdge extends BaseShape<BaseEdgeStyleProps> {
11
73
  type: string;
@@ -23,6 +85,27 @@ export declare abstract class BaseEdge extends BaseShape<BaseEdgeStyleProps> {
23
85
  protected drawHaloShape(attributes: ParsedBaseEdgeStyleProps, container: Group): void;
24
86
  protected drawKeyShape(attributes: ParsedBaseEdgeStyleProps, container: Group): Path | undefined;
25
87
  render(attributes?: Required<BaseEdgeStyleProps>, container?: Group): void;
88
+ /**
89
+ * <zh/> 在元素完成创建并执行完入场动画后调用
90
+ *
91
+ * <en/> Called after the element is created and the entrance animation is completed
92
+ * @override
93
+ */
94
+ onCreate(): void;
95
+ /**
96
+ * <zh/> 在元素更新并执行完过渡动画后调用
97
+ *
98
+ * <en/> Called after the element is updated and the transition animation is completed
99
+ * @override
100
+ */
101
+ onUpdate(): void;
102
+ /**
103
+ * <zh/> 在元素完成退场动画并销毁后调用
104
+ *
105
+ * <en/> Called after the element completes the exit animation and is destroyed
106
+ * @override
107
+ */
108
+ onDestroy(): void;
26
109
  animate(keyframes: Keyframe[], options?: number | KeyframeAnimationOptions): import("@antv/g").IAnimation | null;
27
110
  }
28
111
  type SymbolName = 'triangle' | 'circle' | 'diamond' | 'vee' | 'rect' | 'triangleRect' | 'simple';
@@ -47,12 +130,4 @@ export type LoopStyleProps = {
47
130
  */
48
131
  dist?: number;
49
132
  };
50
- type ShapeSwitch = {
51
- label?: boolean;
52
- halo?: boolean;
53
- startArrow?: boolean;
54
- endArrow?: boolean;
55
- startArrowOffset?: number;
56
- endArrowOffset?: number;
57
- };
58
133
  export {};
@@ -2,7 +2,7 @@ import type { DisplayObjectConfig } from '@antv/g';
2
2
  import type { Point } from '../../types';
3
3
  import type { BaseEdgeStyleProps } from './base-edge';
4
4
  import { Cubic } from './cubic';
5
- export type CubicHorizontalStyleProps = BaseEdgeStyleProps & {
5
+ export interface CubicHorizontalStyleProps extends BaseEdgeStyleProps {
6
6
  /**
7
7
  * <zh/> 控制点在两端点连线上的相对位置,范围为`0-1`
8
8
  * <en/> The relative position of the control point on the line, ranging from `0-1`
@@ -13,7 +13,7 @@ export type CubicHorizontalStyleProps = BaseEdgeStyleProps & {
13
13
  * <en/> The distance of the control point from the line
14
14
  */
15
15
  curveOffset?: number | [number, number];
16
- };
16
+ }
17
17
  export declare class CubicHorizontal extends Cubic {
18
18
  static defaultStyleProps: Partial<CubicHorizontalStyleProps>;
19
19
  constructor(options: DisplayObjectConfig<CubicHorizontalStyleProps>);
@@ -2,7 +2,7 @@ import type { DisplayObjectConfig } from '@antv/g';
2
2
  import type { Point } from '../../types';
3
3
  import type { BaseEdgeStyleProps } from './base-edge';
4
4
  import { Cubic } from './cubic';
5
- export type CubicVerticalStyleProps = BaseEdgeStyleProps & {
5
+ export interface CubicVerticalStyleProps extends BaseEdgeStyleProps {
6
6
  /**
7
7
  * <zh/> 控制点在两端点连线上的相对位置,范围为`0-1`
8
8
  * <en/> The relative position of the control point on the line, ranging from `0-1`
@@ -13,7 +13,7 @@ export type CubicVerticalStyleProps = BaseEdgeStyleProps & {
13
13
  * <en/> The distance of the control point from the line
14
14
  */
15
15
  curveOffset?: number | [number, number];
16
- };
16
+ }
17
17
  export declare class CubicVertical extends Cubic {
18
18
  static defaultStyleProps: Partial<CubicVerticalStyleProps>;
19
19
  constructor(options: DisplayObjectConfig<CubicVerticalStyleProps>);
@@ -3,7 +3,7 @@ import type { PathArray } from '@antv/util';
3
3
  import type { Point } from '../../types';
4
4
  import type { BaseEdgeStyleProps } from './base-edge';
5
5
  import { BaseEdge } from './base-edge';
6
- export type CubicStyleProps = BaseEdgeStyleProps & {
6
+ export interface CubicStyleProps extends BaseEdgeStyleProps {
7
7
  /**
8
8
  * <zh/> 控制点数组,用于定义曲线的形状。如果不指定,将会通过`curveOffset`和`curvePosition`来计算控制点
9
9
  * <en/> Control points. Used to define the shape of the curve. If not specified, it will be calculated using `curveOffset` and `curvePosition`.
@@ -19,7 +19,7 @@ export type CubicStyleProps = BaseEdgeStyleProps & {
19
19
  * <en/> The distance of the control point from the line
20
20
  */
21
21
  curveOffset?: number | [number, number];
22
- };
22
+ }
23
23
  type ParsedCubicStyleProps = Required<CubicStyleProps>;
24
24
  export declare class Cubic extends BaseEdge {
25
25
  static defaultStyleProps: Partial<CubicStyleProps>;
@@ -3,7 +3,7 @@ import type { PathArray } from '@antv/util';
3
3
  import type { Padding, Point } from '../../types';
4
4
  import type { BaseEdgeStyleProps } from './base-edge';
5
5
  import { BaseEdge } from './base-edge';
6
- export type PolylineStyleProps = BaseEdgeStyleProps & {
6
+ export interface PolylineStyleProps extends BaseEdgeStyleProps {
7
7
  /**
8
8
  * <zh/> 圆角半径
9
9
  * <en/> The radius of the rounded corner
@@ -29,7 +29,7 @@ export type PolylineStyleProps = BaseEdgeStyleProps & {
29
29
  * <en/> Padding for routing calculation
30
30
  */
31
31
  routerPadding?: Padding;
32
- };
32
+ }
33
33
  type ParsedPolylineStyleProps = Required<PolylineStyleProps>;
34
34
  export declare class Polyline extends BaseEdge {
35
35
  static defaultStyleProps: Partial<PolylineStyleProps>;
@@ -3,7 +3,7 @@ import type { PathArray } from '@antv/util';
3
3
  import type { Point } from '../../types';
4
4
  import type { BaseEdgeStyleProps } from './base-edge';
5
5
  import { BaseEdge } from './base-edge';
6
- export type QuadraticStyleProps = BaseEdgeStyleProps & {
6
+ export interface QuadraticStyleProps extends BaseEdgeStyleProps {
7
7
  /**
8
8
  * <zh/> 控制点,用于定义曲线的形状。如果不指定,将会通过`curveOffset`和`curvePosition`来计算控制点
9
9
  * <en/> Control point. Used to define the shape of the curve. If not specified, it will be calculated using `curveOffset` and `curvePosition`.
@@ -19,7 +19,7 @@ export type QuadraticStyleProps = BaseEdgeStyleProps & {
19
19
  * <en/> The distance of the control point from the line
20
20
  */
21
21
  curveOffset?: number;
22
- };
22
+ }
23
23
  type ParsedQuadraticStyleProps = Required<QuadraticStyleProps>;
24
24
  export declare class Quadratic extends BaseEdge {
25
25
  static defaultStyleProps: Partial<QuadraticStyleProps>;
@@ -1,9 +1,106 @@
1
- import type { BaseStyleProps, DisplayObject, DisplayObjectConfig, Group } from '@antv/g';
1
+ import type { DisplayObject, DisplayObjectConfig, Group } from '@antv/g';
2
+ import type { ID } from '@antv/graphlib';
2
3
  import type { CategoricalPalette } from '../../palettes/types';
3
- import type { BadgePlacement, BaseNodeProps, Keyframe, LabelPlacement, Placement, Point, Port, PortStyleProps, PrefixObject } from '../../types';
4
+ import type { NodeData } from '../../spec';
5
+ import type { BadgePlacement, BaseElementStyleProps, Keyframe, LabelPlacement, Node, Placement, Point, Port, PortStyleProps, PrefixObject, Size } from '../../types';
4
6
  import type { BadgeStyleProps, IconStyleProps, LabelStyleProps } from '../shapes';
5
7
  import { BaseShape } from '../shapes';
6
- export type BaseNodeStyleProps<H extends BaseStyleProps = BaseNodeProps> = BaseNodeProps & ShapeSwitch & {
8
+ export type BaseNodeStyleProps<T extends Record<string, unknown> = Record<string, any>> = T & BaseElementStyleProps & PrefixObject<NodeLabelStyleProps, 'label'> & PrefixObject<T, 'halo'> & PrefixObject<IconStyleProps, 'icon'> & PrefixObject<BadgeStyleProps, 'badge'> & PrefixObject<PortStyleProps, 'port'> & {
9
+ /**
10
+ * <zh/> x 坐标
11
+ *
12
+ * <en/> The x-coordinate of node
13
+ */
14
+ x?: number | string;
15
+ /**
16
+ * <zh/> y 坐标
17
+ *
18
+ * <en/> The y-coordinate of node
19
+ */
20
+ y?: number | string;
21
+ /**
22
+ * <zh/> z 坐标
23
+ *
24
+ * <en/> The z-coordinate of node
25
+ */
26
+ z?: number;
27
+ /**
28
+ * <zh/> 节点大小,快捷设置节点宽高
29
+ *
30
+ * <en/> The size of node, which is a shortcut to set the width and height of node
31
+ */
32
+ size?: Size;
33
+ /**
34
+ * <zh/> 主色
35
+ *
36
+ * <en/> Subject color
37
+ */
38
+ color?: string;
39
+ /**
40
+ * @deprecated
41
+ * <zh/> 解决类型 style.getPropertyValue 问题,不要使用该属性
42
+ *
43
+ * <en/> Solve the problem of style.getPropertyValue, do not use this property
44
+ * @description
45
+ * <zh/> 移除该属性会导致 Polygon 及其子类与 Node 不兼容
46
+ *
47
+ * <en/> Removing this property will cause Polygon and its subclasses to be incompatible with Node
48
+ * @ignore
49
+ */
50
+ points?: ([number, number] | [number, number, number])[];
51
+ /**
52
+ * <zh/> 父节点 id
53
+ * <en/> The id of the parent node/combo
54
+ */
55
+ parentId?: ID;
56
+ /**
57
+ * <zh/> 是否收起
58
+ *
59
+ * <en/> Indicates whether the node is collapsed
60
+ */
61
+ collapsed?: boolean;
62
+ /**
63
+ * <zh/> 子节点实例
64
+ *
65
+ * <en/> The instance of the child node
66
+ */
67
+ childrenNode?: Node[];
68
+ /**
69
+ * <zh/> 子节点数据
70
+ *
71
+ * <en/> The data of the child node
72
+ */
73
+ childrenData?: NodeData[];
74
+ /**
75
+ * <zh/> 是否显示节点标签
76
+ *
77
+ * <en/> Whether to show the node label
78
+ */
79
+ label?: boolean;
80
+ /**
81
+ * <zh/> 是否显示节点光环
82
+ *
83
+ * <en/> Whether to show the node halo
84
+ */
85
+ halo?: boolean;
86
+ /**
87
+ * <zh/> 是否显示节点图标
88
+ *
89
+ * <en/> Whether to show the node icon
90
+ */
91
+ icon?: boolean;
92
+ /**
93
+ * <zh/> 是否显示节点徽标
94
+ *
95
+ * <en/> Whether to show the node badge
96
+ */
97
+ badge?: boolean;
98
+ /**
99
+ * <zh/> 是否显示连接桩
100
+ *
101
+ * <en/> Whether to show the node port
102
+ */
103
+ port?: boolean;
7
104
  /**
8
105
  * <zh/> 连接桩
9
106
  * <en/> Port
@@ -19,18 +116,19 @@ export type BaseNodeStyleProps<H extends BaseStyleProps = BaseNodeProps> = BaseN
19
116
  * <en/> Badge background color palette
20
117
  */
21
118
  badgePalette?: string[] | CategoricalPalette;
22
- } & PrefixObject<NodeLabelStyleProps, 'label'> & PrefixObject<H, 'halo'> & PrefixObject<IconStyleProps, 'icon'> & PrefixObject<BadgeStyleProps, 'badge'> & PrefixObject<PortStyleProps, 'port'>;
119
+ };
23
120
  /**
24
121
  * Design document: https://www.yuque.com/antv/g6/gl1iof1xpzg6ed98
25
122
  *
26
123
  * The P is the StyleProps of Key Shape.
27
124
  * The KeyShape is the type of the key shape.
28
125
  */
29
- export declare abstract class BaseNode<S extends BaseNodeStyleProps = any> extends BaseShape<S> {
126
+ export declare abstract class BaseNode<S extends BaseNodeStyleProps = BaseNodeStyleProps> extends BaseShape<S> {
30
127
  type: string;
31
128
  static defaultStyleProps: Partial<BaseNodeStyleProps>;
32
129
  constructor(options: DisplayObjectConfig<S>);
33
- protected getSize(attributes?: Required<S>): import("src/types/vector").Vector3;
130
+ get parsedAttributes(): Required<S>;
131
+ protected getSize(attributes?: S & import("@antv/g").BaseCustomElementStyleProps): import("../../types").Vector3;
34
132
  protected getKeyStyle(attributes: Required<S>): any;
35
133
  protected getLabelStyle(attributes: Required<S>): false | LabelStyleProps;
36
134
  protected getHaloStyle(attributes: Required<S>): any;
@@ -65,6 +163,27 @@ export declare abstract class BaseNode<S extends BaseNodeStyleProps = any> exten
65
163
  protected drawPortShapes(attributes: Required<S>, container: Group): void;
66
164
  protected abstract drawKeyShape(attributes: Required<S>, container: Group): DisplayObject | undefined;
67
165
  render(attributes?: Required<S>, container?: Group): void;
166
+ /**
167
+ * <zh/> 在元素完成创建并执行完入场动画后调用
168
+ *
169
+ * <en/> Called after the element is created and the entrance animation is completed
170
+ * @override
171
+ */
172
+ onCreate(): void;
173
+ /**
174
+ * <zh/> 在元素更新并执行完过渡动画后调用
175
+ *
176
+ * <en/> Called after the element is updated and the transition animation is completed
177
+ * @override
178
+ */
179
+ onUpdate(): void;
180
+ /**
181
+ * <zh/> 在元素完成退场动画并销毁后调用
182
+ *
183
+ * <en/> Called after the element completes the exit animation and is destroyed
184
+ * @override
185
+ */
186
+ onDestroy(): void;
68
187
  animate(keyframes: Keyframe[], options?: number | KeyframeAnimationOptions): import("@antv/g").IAnimation | null;
69
188
  }
70
189
  type NodeLabelStyleProps = LabelStyleProps & {
@@ -97,11 +216,4 @@ export type NodePortStyleProps = Partial<PortStyleProps> & {
97
216
  */
98
217
  placement: Placement;
99
218
  };
100
- type ShapeSwitch = {
101
- label?: boolean;
102
- halo?: boolean;
103
- icon?: boolean;
104
- badge?: boolean;
105
- port?: boolean;
106
- };
107
219
  export {};
@@ -3,18 +3,15 @@ import type { Point } from '../../types';
3
3
  import type { IconStyleProps } from '../shapes';
4
4
  import type { BaseNodeStyleProps } from './base-node';
5
5
  import { BaseNode } from './base-node';
6
- export type CircleStyleProps = BaseNodeStyleProps<KeyStyleProps>;
7
- type ParsedCircleStyleProps = Required<CircleStyleProps>;
8
- type KeyStyleProps = GCircleStyleProps;
6
+ export type CircleStyleProps = BaseNodeStyleProps;
9
7
  /**
10
8
  * Draw circle based on BaseNode, override drawKeyShape.
11
9
  */
12
- export declare class Circle extends BaseNode<CircleStyleProps> {
10
+ export declare class Circle extends BaseNode {
13
11
  static defaultStyleProps: Partial<CircleStyleProps>;
14
12
  constructor(options: DisplayObjectConfig<CircleStyleProps>);
15
- protected drawKeyShape(attributes: ParsedCircleStyleProps, container: Group): any;
16
- protected getKeyStyle(attributes: ParsedCircleStyleProps): KeyStyleProps;
17
- protected getIconStyle(attributes: ParsedCircleStyleProps): false | IconStyleProps;
13
+ protected drawKeyShape(attributes: Required<CircleStyleProps>, container: Group): any;
14
+ protected getKeyStyle(attributes: Required<CircleStyleProps>): GCircleStyleProps;
15
+ protected getIconStyle(attributes: Required<CircleStyleProps>): false | IconStyleProps;
18
16
  getIntersectPoint(point: Point): Point;
19
17
  }
20
- export {};
@@ -1,15 +1,13 @@
1
1
  import type { DisplayObjectConfig } from '@antv/g';
2
2
  import type { Point } from '../../types';
3
- import type { ParsedPolygonStyleProps, PolygonStyleProps } from './polygon';
3
+ import type { PolygonStyleProps } from './polygon';
4
4
  import { Polygon } from './polygon';
5
5
  export type DiamondStyleProps = PolygonStyleProps;
6
- type ParsedDiamondStyleProps = ParsedPolygonStyleProps;
7
6
  /**
8
7
  * Draw diamond based on BaseNode, override drawKeyShape.
9
8
  */
10
9
  export declare class Diamond extends Polygon {
11
10
  constructor(options: DisplayObjectConfig<DiamondStyleProps>);
12
- protected getPoints(attributes: ParsedDiamondStyleProps): Point[];
11
+ protected getPoints(attributes: Required<DiamondStyleProps>): Point[];
13
12
  getIntersectPoint(point: Point): Point;
14
13
  }
15
- export {};
@@ -3,15 +3,12 @@ import type { Point } from '../../types';
3
3
  import type { IconStyleProps } from '../shapes';
4
4
  import type { BaseNodeStyleProps } from './base-node';
5
5
  import { BaseNode } from './base-node';
6
- export type EllipseStyleProps = BaseNodeStyleProps<KeyStyleProps>;
7
- type ParsedEllipseStyleProps = Required<EllipseStyleProps>;
8
- type KeyStyleProps = GEllipseStyleProps;
9
- export declare class Ellipse extends BaseNode<EllipseStyleProps> {
6
+ export type EllipseStyleProps = BaseNodeStyleProps;
7
+ export declare class Ellipse extends BaseNode {
10
8
  static defaultStyleProps: Partial<EllipseStyleProps>;
11
9
  constructor(options: DisplayObjectConfig<EllipseStyleProps>);
12
- protected drawKeyShape(attributes: ParsedEllipseStyleProps, container: Group): any;
13
- protected getKeyStyle(attributes: ParsedEllipseStyleProps): KeyStyleProps;
14
- protected getIconStyle(attributes: ParsedEllipseStyleProps): false | IconStyleProps;
10
+ protected drawKeyShape(attributes: Required<EllipseStyleProps>, container: Group): any;
11
+ protected getKeyStyle(attributes: Required<EllipseStyleProps>): GEllipseStyleProps;
12
+ protected getIconStyle(attributes: Required<EllipseStyleProps>): false | IconStyleProps;
15
13
  getIntersectPoint(point: Point): Point;
16
14
  }
17
- export {};
@@ -1,21 +1,18 @@
1
1
  import type { DisplayObjectConfig } from '@antv/g';
2
2
  import type { Point } from '../../types';
3
3
  import type { IconStyleProps } from '../shapes';
4
- import type { ParsedPolygonStyleProps, PolygonStyleProps } from './polygon';
4
+ import type { PolygonStyleProps } from './polygon';
5
5
  import { Polygon } from './polygon';
6
- export type HexagonStyleProps = PolygonStyleProps & ExtendsStyleProps;
7
- type ParsedHexagonStyleProps = ParsedPolygonStyleProps & Required<HexagonStyleProps>;
8
- type ExtendsStyleProps = {
6
+ export type HexagonStyleProps = PolygonStyleProps<{
9
7
  /**
10
8
  * <zh/> 外半径
11
9
  * <en/> outer radius
12
10
  */
13
11
  outerR?: number;
14
- };
15
- export declare class Hexagon extends Polygon {
12
+ }>;
13
+ export declare class Hexagon extends Polygon<HexagonStyleProps> {
16
14
  constructor(options: DisplayObjectConfig<HexagonStyleProps>);
17
15
  private getOuterR;
18
- protected getPoints(attributes: ParsedHexagonStyleProps): Point[];
19
- protected getIconStyle(attributes: ParsedHexagonStyleProps): false | IconStyleProps;
16
+ protected getPoints(attributes: Required<HexagonStyleProps>): Point[];
17
+ protected getIconStyle(attributes: Required<HexagonStyleProps>): false | IconStyleProps;
20
18
  }
21
- export {};
@@ -1,20 +1,18 @@
1
1
  import type { DisplayObjectConfig, RectStyleProps as GRectStyleProps, Group } from '@antv/g';
2
2
  import { Image as GImage, ImageStyleProps as GImageStyleProps } from '@antv/g';
3
- import type { PrefixObject } from '../../types';
4
3
  import type { IconStyleProps } from '../shapes';
5
4
  import type { BaseNodeStyleProps } from './base-node';
6
5
  import { BaseNode } from './base-node';
7
- export type ImageStyleProps = BaseNodeStyleProps<KeyStyleProps>;
8
- type ParsedImageStyleProps = Required<ImageStyleProps>;
9
- type KeyStyleProps = GImageStyleProps & PrefixObject<HaloStyleProps, 'halo'>;
10
- type HaloStyleProps = GRectStyleProps;
6
+ export type ImageStyleProps = BaseNodeStyleProps<{
7
+ img?: string | HTMLImageElement;
8
+ src?: string | HTMLImageElement;
9
+ }>;
11
10
  export declare class Image extends BaseNode<ImageStyleProps> {
12
11
  static defaultStyleProps: Partial<ImageStyleProps>;
13
12
  constructor(options: DisplayObjectConfig<ImageStyleProps>);
14
- protected getKeyStyle(attributes: ParsedImageStyleProps): KeyStyleProps;
15
- protected getHaloStyle(attributes: ParsedImageStyleProps): false | HaloStyleProps;
16
- protected getIconStyle(attributes: ParsedImageStyleProps): false | IconStyleProps;
17
- protected drawKeyShape(attributes: ParsedImageStyleProps, container: Group): GImage | undefined;
18
- protected drawHaloShape(attributes: ParsedImageStyleProps, container: Group): void;
13
+ protected getKeyStyle(attributes: Required<ImageStyleProps>): GImageStyleProps;
14
+ protected getHaloStyle(attributes: Required<ImageStyleProps>): false | GRectStyleProps;
15
+ protected getIconStyle(attributes: Required<ImageStyleProps>): false | IconStyleProps;
16
+ protected drawKeyShape(attributes: Required<ImageStyleProps>, container: Group): GImage | undefined;
17
+ protected drawHaloShape(attributes: Required<ImageStyleProps>, container: Group): void;
19
18
  }
20
- export {};