@antv/layout 0.3.12 → 1.0.0-alpha.1

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 (555) hide show
  1. package/README.md +45 -32
  2. package/dist/3a54d760230d1933f953.worker.js +2 -0
  3. package/dist/3a54d760230d1933f953.worker.js.map +1 -0
  4. package/dist/index.min.js +2 -0
  5. package/dist/index.min.js.map +1 -0
  6. package/lib/Circular.d.ts +40 -0
  7. package/lib/Supervisor.d.ts +65 -0
  8. package/lib/index.d.ts +4 -3
  9. package/lib/registry.d.ts +3 -0
  10. package/lib/types.d.ts +128 -0
  11. package/lib/util/gpu.d.ts +22 -22
  12. package/lib/util/index.d.ts +6 -6
  13. package/lib/util/math.d.ts +3 -3
  14. package/lib/worker.d.ts +3 -0
  15. package/package.json +21 -95
  16. package/dist/layout.min.js +0 -3
  17. package/dist/layout.min.js.LICENSE.txt +0 -1
  18. package/dist/layout.min.js.map +0 -1
  19. package/es/index.d.ts +0 -3
  20. package/es/index.js +0 -6
  21. package/es/index.js.map +0 -1
  22. package/es/layout/base.d.ts +0 -22
  23. package/es/layout/base.js +0 -51
  24. package/es/layout/base.js.map +0 -1
  25. package/es/layout/circular.d.ts +0 -80
  26. package/es/layout/circular.js +0 -314
  27. package/es/layout/circular.js.map +0 -1
  28. package/es/layout/comboCombined.d.ts +0 -54
  29. package/es/layout/comboCombined.js +0 -354
  30. package/es/layout/comboCombined.js.map +0 -1
  31. package/es/layout/comboForce.d.ts +0 -134
  32. package/es/layout/comboForce.js +0 -801
  33. package/es/layout/comboForce.js.map +0 -1
  34. package/es/layout/concentric.d.ts +0 -67
  35. package/es/layout/concentric.js +0 -219
  36. package/es/layout/concentric.js.map +0 -1
  37. package/es/layout/constants.d.ts +0 -12
  38. package/es/layout/constants.js +0 -22
  39. package/es/layout/constants.js.map +0 -1
  40. package/es/layout/dagre/graph.d.ts +0 -91
  41. package/es/layout/dagre/graph.js +0 -4
  42. package/es/layout/dagre/graph.js.map +0 -1
  43. package/es/layout/dagre/index.d.ts +0 -8
  44. package/es/layout/dagre/index.js +0 -31
  45. package/es/layout/dagre/index.js.map +0 -1
  46. package/es/layout/dagre/src/acyclic.d.ts +0 -6
  47. package/es/layout/dagre/src/acyclic.js +0 -52
  48. package/es/layout/dagre/src/acyclic.js.map +0 -1
  49. package/es/layout/dagre/src/add-border-segments.d.ts +0 -3
  50. package/es/layout/dagre/src/add-border-segments.js +0 -32
  51. package/es/layout/dagre/src/add-border-segments.js.map +0 -1
  52. package/es/layout/dagre/src/coordinate-system.d.ts +0 -6
  53. package/es/layout/dagre/src/coordinate-system.js +0 -69
  54. package/es/layout/dagre/src/coordinate-system.js.map +0 -1
  55. package/es/layout/dagre/src/data/list.d.ts +0 -12
  56. package/es/layout/dagre/src/data/list.js +0 -48
  57. package/es/layout/dagre/src/data/list.js.map +0 -1
  58. package/es/layout/dagre/src/debug.d.ts +0 -3
  59. package/es/layout/dagre/src/debug.js +0 -24
  60. package/es/layout/dagre/src/debug.js.map +0 -1
  61. package/es/layout/dagre/src/greedy-fas.d.ts +0 -3
  62. package/es/layout/dagre/src/greedy-fas.js +0 -114
  63. package/es/layout/dagre/src/greedy-fas.js.map +0 -1
  64. package/es/layout/dagre/src/layout.d.ts +0 -3
  65. package/es/layout/dagre/src/layout.js +0 -518
  66. package/es/layout/dagre/src/layout.js.map +0 -1
  67. package/es/layout/dagre/src/nesting-graph.d.ts +0 -6
  68. package/es/layout/dagre/src/nesting-graph.js +0 -117
  69. package/es/layout/dagre/src/nesting-graph.js.map +0 -1
  70. package/es/layout/dagre/src/normalize.d.ts +0 -6
  71. package/es/layout/dagre/src/normalize.js +0 -89
  72. package/es/layout/dagre/src/normalize.js.map +0 -1
  73. package/es/layout/dagre/src/order/add-subgraph-constraints.d.ts +0 -3
  74. package/es/layout/dagre/src/order/add-subgraph-constraints.js +0 -27
  75. package/es/layout/dagre/src/order/add-subgraph-constraints.js.map +0 -1
  76. package/es/layout/dagre/src/order/barycenter.d.ts +0 -11
  77. package/es/layout/dagre/src/order/barycenter.js +0 -24
  78. package/es/layout/dagre/src/order/barycenter.js.map +0 -1
  79. package/es/layout/dagre/src/order/build-layer-graph.d.ts +0 -3
  80. package/es/layout/dagre/src/order/build-layer-graph.js +0 -71
  81. package/es/layout/dagre/src/order/build-layer-graph.js.map +0 -1
  82. package/es/layout/dagre/src/order/cross-count.d.ts +0 -3
  83. package/es/layout/dagre/src/order/cross-count.js +0 -65
  84. package/es/layout/dagre/src/order/cross-count.js.map +0 -1
  85. package/es/layout/dagre/src/order/index.d.ts +0 -3
  86. package/es/layout/dagre/src/order/index.js +0 -91
  87. package/es/layout/dagre/src/order/index.js.map +0 -1
  88. package/es/layout/dagre/src/order/init-data-order.d.ts +0 -6
  89. package/es/layout/dagre/src/order/init-data-order.js +0 -25
  90. package/es/layout/dagre/src/order/init-data-order.js.map +0 -1
  91. package/es/layout/dagre/src/order/init-order.d.ts +0 -3
  92. package/es/layout/dagre/src/order/init-order.js +0 -52
  93. package/es/layout/dagre/src/order/init-order.js.map +0 -1
  94. package/es/layout/dagre/src/order/resolve-conflicts.d.ts +0 -19
  95. package/es/layout/dagre/src/order/resolve-conflicts.js +0 -93
  96. package/es/layout/dagre/src/order/resolve-conflicts.js.map +0 -1
  97. package/es/layout/dagre/src/order/sort-subgraph.d.ts +0 -7
  98. package/es/layout/dagre/src/order/sort-subgraph.js +0 -85
  99. package/es/layout/dagre/src/order/sort-subgraph.js.map +0 -1
  100. package/es/layout/dagre/src/order/sort.d.ts +0 -7
  101. package/es/layout/dagre/src/order/sort.js +0 -68
  102. package/es/layout/dagre/src/order/sort.js.map +0 -1
  103. package/es/layout/dagre/src/parent-dummy-chains.d.ts +0 -3
  104. package/es/layout/dagre/src/parent-dummy-chains.js +0 -81
  105. package/es/layout/dagre/src/parent-dummy-chains.js.map +0 -1
  106. package/es/layout/dagre/src/position/bk.d.ts +0 -23
  107. package/es/layout/dagre/src/position/bk.js +0 -370
  108. package/es/layout/dagre/src/position/bk.js.map +0 -1
  109. package/es/layout/dagre/src/position/index.d.ts +0 -3
  110. package/es/layout/dagre/src/position/index.js +0 -51
  111. package/es/layout/dagre/src/position/index.js.map +0 -1
  112. package/es/layout/dagre/src/rank/feasible-tree.d.ts +0 -9
  113. package/es/layout/dagre/src/rank/feasible-tree.js +0 -148
  114. package/es/layout/dagre/src/rank/feasible-tree.js.map +0 -1
  115. package/es/layout/dagre/src/rank/index.d.ts +0 -3
  116. package/es/layout/dagre/src/rank/index.js +0 -53
  117. package/es/layout/dagre/src/rank/index.js.map +0 -1
  118. package/es/layout/dagre/src/rank/network-simplex.d.ts +0 -9
  119. package/es/layout/dagre/src/rank/network-simplex.js +0 -195
  120. package/es/layout/dagre/src/rank/network-simplex.js.map +0 -1
  121. package/es/layout/dagre/src/rank/util.d.ts +0 -11
  122. package/es/layout/dagre/src/rank/util.js +0 -141
  123. package/es/layout/dagre/src/rank/util.js.map +0 -1
  124. package/es/layout/dagre/src/util.d.ts +0 -31
  125. package/es/layout/dagre/src/util.js +0 -261
  126. package/es/layout/dagre/src/util.js.map +0 -1
  127. package/es/layout/dagre.d.ts +0 -71
  128. package/es/layout/dagre.js +0 -433
  129. package/es/layout/dagre.js.map +0 -1
  130. package/es/layout/dagreCompound.d.ts +0 -121
  131. package/es/layout/dagreCompound.js +0 -391
  132. package/es/layout/dagreCompound.js.map +0 -1
  133. package/es/layout/er/core.d.ts +0 -1
  134. package/es/layout/er/core.js +0 -107
  135. package/es/layout/er/core.js.map +0 -1
  136. package/es/layout/er/forceGrid.d.ts +0 -8
  137. package/es/layout/er/forceGrid.js +0 -88
  138. package/es/layout/er/forceGrid.js.map +0 -1
  139. package/es/layout/er/grid.d.ts +0 -26
  140. package/es/layout/er/grid.js +0 -162
  141. package/es/layout/er/grid.js.map +0 -1
  142. package/es/layout/er/index.d.ts +0 -29
  143. package/es/layout/er/index.js +0 -54
  144. package/es/layout/er/index.js.map +0 -1
  145. package/es/layout/er/mysqlWorkbench.d.ts +0 -6
  146. package/es/layout/er/mysqlWorkbench.js +0 -324
  147. package/es/layout/er/mysqlWorkbench.js.map +0 -1
  148. package/es/layout/er/type.d.ts +0 -35
  149. package/es/layout/er/type.js +0 -2
  150. package/es/layout/er/type.js.map +0 -1
  151. package/es/layout/force/force-in-a-box.d.ts +0 -28
  152. package/es/layout/force/force-in-a-box.js +0 -330
  153. package/es/layout/force/force-in-a-box.js.map +0 -1
  154. package/es/layout/force/force.d.ts +0 -100
  155. package/es/layout/force/force.js +0 -340
  156. package/es/layout/force/force.js.map +0 -1
  157. package/es/layout/force/index.d.ts +0 -1
  158. package/es/layout/force/index.js +0 -2
  159. package/es/layout/force/index.js.map +0 -1
  160. package/es/layout/force2/ForceNBody.d.ts +0 -7
  161. package/es/layout/force2/ForceNBody.js +0 -94
  162. package/es/layout/force2/ForceNBody.js.map +0 -1
  163. package/es/layout/force2/index.d.ts +0 -119
  164. package/es/layout/force2/index.js +0 -608
  165. package/es/layout/force2/index.js.map +0 -1
  166. package/es/layout/forceAtlas2/body.d.ts +0 -33
  167. package/es/layout/forceAtlas2/body.js +0 -89
  168. package/es/layout/forceAtlas2/body.js.map +0 -1
  169. package/es/layout/forceAtlas2/index.d.ts +0 -115
  170. package/es/layout/forceAtlas2/index.js +0 -484
  171. package/es/layout/forceAtlas2/index.js.map +0 -1
  172. package/es/layout/forceAtlas2/quad.d.ts +0 -27
  173. package/es/layout/forceAtlas2/quad.js +0 -96
  174. package/es/layout/forceAtlas2/quad.js.map +0 -1
  175. package/es/layout/forceAtlas2/quadTree.d.ts +0 -20
  176. package/es/layout/forceAtlas2/quadTree.js +0 -103
  177. package/es/layout/forceAtlas2/quadTree.js.map +0 -1
  178. package/es/layout/fruchterman.d.ts +0 -73
  179. package/es/layout/fruchterman.js +0 -296
  180. package/es/layout/fruchterman.js.map +0 -1
  181. package/es/layout/gForce.d.ts +0 -96
  182. package/es/layout/gForce.js +0 -399
  183. package/es/layout/gForce.js.map +0 -1
  184. package/es/layout/gpu/fruchterman.d.ts +0 -57
  185. package/es/layout/gpu/fruchterman.js +0 -267
  186. package/es/layout/gpu/fruchterman.js.map +0 -1
  187. package/es/layout/gpu/fruchtermanShader.d.ts +0 -4
  188. package/es/layout/gpu/fruchtermanShader.js +0 -201
  189. package/es/layout/gpu/fruchtermanShader.js.map +0 -1
  190. package/es/layout/gpu/gForce.d.ts +0 -68
  191. package/es/layout/gpu/gForce.js +0 -330
  192. package/es/layout/gpu/gForce.js.map +0 -1
  193. package/es/layout/gpu/gForceShader.d.ts +0 -4
  194. package/es/layout/gpu/gForceShader.js +0 -218
  195. package/es/layout/gpu/gForceShader.js.map +0 -1
  196. package/es/layout/grid.d.ts +0 -83
  197. package/es/layout/grid.js +0 -317
  198. package/es/layout/grid.js.map +0 -1
  199. package/es/layout/index.d.ts +0 -22
  200. package/es/layout/index.js +0 -25
  201. package/es/layout/index.js.map +0 -1
  202. package/es/layout/layout.d.ts +0 -26
  203. package/es/layout/layout.js +0 -97
  204. package/es/layout/layout.js.map +0 -1
  205. package/es/layout/mds.d.ts +0 -39
  206. package/es/layout/mds.js +0 -122
  207. package/es/layout/mds.js.map +0 -1
  208. package/es/layout/radial/index.d.ts +0 -1
  209. package/es/layout/radial/index.js +0 -2
  210. package/es/layout/radial/index.js.map +0 -1
  211. package/es/layout/radial/mds.d.ts +0 -15
  212. package/es/layout/radial/mds.js +0 -38
  213. package/es/layout/radial/mds.js.map +0 -1
  214. package/es/layout/radial/radial.d.ts +0 -74
  215. package/es/layout/radial/radial.js +0 -420
  216. package/es/layout/radial/radial.js.map +0 -1
  217. package/es/layout/radial/radialNonoverlapForce.d.ts +0 -50
  218. package/es/layout/radial/radialNonoverlapForce.js +0 -123
  219. package/es/layout/radial/radialNonoverlapForce.js.map +0 -1
  220. package/es/layout/random.d.ts +0 -35
  221. package/es/layout/random.js +0 -62
  222. package/es/layout/random.js.map +0 -1
  223. package/es/layout/types.d.ts +0 -432
  224. package/es/layout/types.js +0 -2
  225. package/es/layout/types.js.map +0 -1
  226. package/es/registy/index.d.ts +0 -3
  227. package/es/registy/index.js +0 -41
  228. package/es/registy/index.js.map +0 -1
  229. package/es/util/array.d.ts +0 -1
  230. package/es/util/array.js +0 -2
  231. package/es/util/array.js.map +0 -1
  232. package/es/util/function.d.ts +0 -6
  233. package/es/util/function.js +0 -56
  234. package/es/util/function.js.map +0 -1
  235. package/es/util/gpu.d.ts +0 -52
  236. package/es/util/gpu.js +0 -239
  237. package/es/util/gpu.js.map +0 -1
  238. package/es/util/index.d.ts +0 -6
  239. package/es/util/index.js +0 -7
  240. package/es/util/index.js.map +0 -1
  241. package/es/util/math.d.ts +0 -48
  242. package/es/util/math.js +0 -276
  243. package/es/util/math.js.map +0 -1
  244. package/es/util/number.d.ts +0 -3
  245. package/es/util/number.js +0 -7
  246. package/es/util/number.js.map +0 -1
  247. package/es/util/object.d.ts +0 -2
  248. package/es/util/object.js +0 -25
  249. package/es/util/object.js.map +0 -1
  250. package/es/util/string.d.ts +0 -2
  251. package/es/util/string.js +0 -16
  252. package/es/util/string.js.map +0 -1
  253. package/lib/index.js +0 -24
  254. package/lib/index.js.map +0 -1
  255. package/lib/layout/base.d.ts +0 -22
  256. package/lib/layout/base.js +0 -56
  257. package/lib/layout/base.js.map +0 -1
  258. package/lib/layout/circular.d.ts +0 -80
  259. package/lib/layout/circular.js +0 -337
  260. package/lib/layout/circular.js.map +0 -1
  261. package/lib/layout/comboCombined.d.ts +0 -54
  262. package/lib/layout/comboCombined.js +0 -390
  263. package/lib/layout/comboCombined.js.map +0 -1
  264. package/lib/layout/comboForce.d.ts +0 -134
  265. package/lib/layout/comboForce.js +0 -826
  266. package/lib/layout/comboForce.js.map +0 -1
  267. package/lib/layout/concentric.d.ts +0 -67
  268. package/lib/layout/concentric.js +0 -243
  269. package/lib/layout/concentric.js.map +0 -1
  270. package/lib/layout/constants.d.ts +0 -12
  271. package/lib/layout/constants.js +0 -25
  272. package/lib/layout/constants.js.map +0 -1
  273. package/lib/layout/dagre/graph.d.ts +0 -91
  274. package/lib/layout/dagre/graph.js +0 -28
  275. package/lib/layout/dagre/graph.js.map +0 -1
  276. package/lib/layout/dagre/index.d.ts +0 -8
  277. package/lib/layout/dagre/index.js +0 -36
  278. package/lib/layout/dagre/index.js.map +0 -1
  279. package/lib/layout/dagre/src/acyclic.d.ts +0 -6
  280. package/lib/layout/dagre/src/acyclic.js +0 -57
  281. package/lib/layout/dagre/src/acyclic.js.map +0 -1
  282. package/lib/layout/dagre/src/add-border-segments.d.ts +0 -3
  283. package/lib/layout/dagre/src/add-border-segments.js +0 -34
  284. package/lib/layout/dagre/src/add-border-segments.js.map +0 -1
  285. package/lib/layout/dagre/src/coordinate-system.d.ts +0 -6
  286. package/lib/layout/dagre/src/coordinate-system.js +0 -71
  287. package/lib/layout/dagre/src/coordinate-system.js.map +0 -1
  288. package/lib/layout/dagre/src/data/list.d.ts +0 -12
  289. package/lib/layout/dagre/src/data/list.js +0 -52
  290. package/lib/layout/dagre/src/data/list.js.map +0 -1
  291. package/lib/layout/dagre/src/debug.d.ts +0 -3
  292. package/lib/layout/dagre/src/debug.js +0 -26
  293. package/lib/layout/dagre/src/debug.js.map +0 -1
  294. package/lib/layout/dagre/src/greedy-fas.d.ts +0 -3
  295. package/lib/layout/dagre/src/greedy-fas.js +0 -144
  296. package/lib/layout/dagre/src/greedy-fas.js.map +0 -1
  297. package/lib/layout/dagre/src/layout.d.ts +0 -3
  298. package/lib/layout/dagre/src/layout.js +0 -535
  299. package/lib/layout/dagre/src/layout.js.map +0 -1
  300. package/lib/layout/dagre/src/nesting-graph.d.ts +0 -6
  301. package/lib/layout/dagre/src/nesting-graph.js +0 -119
  302. package/lib/layout/dagre/src/nesting-graph.js.map +0 -1
  303. package/lib/layout/dagre/src/normalize.d.ts +0 -6
  304. package/lib/layout/dagre/src/normalize.js +0 -91
  305. package/lib/layout/dagre/src/normalize.js.map +0 -1
  306. package/lib/layout/dagre/src/order/add-subgraph-constraints.d.ts +0 -3
  307. package/lib/layout/dagre/src/order/add-subgraph-constraints.js +0 -29
  308. package/lib/layout/dagre/src/order/add-subgraph-constraints.js.map +0 -1
  309. package/lib/layout/dagre/src/order/barycenter.d.ts +0 -11
  310. package/lib/layout/dagre/src/order/barycenter.js +0 -26
  311. package/lib/layout/dagre/src/order/barycenter.js.map +0 -1
  312. package/lib/layout/dagre/src/order/build-layer-graph.d.ts +0 -3
  313. package/lib/layout/dagre/src/order/build-layer-graph.js +0 -73
  314. package/lib/layout/dagre/src/order/build-layer-graph.js.map +0 -1
  315. package/lib/layout/dagre/src/order/cross-count.d.ts +0 -3
  316. package/lib/layout/dagre/src/order/cross-count.js +0 -67
  317. package/lib/layout/dagre/src/order/cross-count.js.map +0 -1
  318. package/lib/layout/dagre/src/order/index.d.ts +0 -3
  319. package/lib/layout/dagre/src/order/index.js +0 -96
  320. package/lib/layout/dagre/src/order/index.js.map +0 -1
  321. package/lib/layout/dagre/src/order/init-data-order.d.ts +0 -6
  322. package/lib/layout/dagre/src/order/init-data-order.js +0 -27
  323. package/lib/layout/dagre/src/order/init-data-order.js.map +0 -1
  324. package/lib/layout/dagre/src/order/init-order.d.ts +0 -3
  325. package/lib/layout/dagre/src/order/init-order.js +0 -54
  326. package/lib/layout/dagre/src/order/init-order.js.map +0 -1
  327. package/lib/layout/dagre/src/order/resolve-conflicts.d.ts +0 -19
  328. package/lib/layout/dagre/src/order/resolve-conflicts.js +0 -98
  329. package/lib/layout/dagre/src/order/resolve-conflicts.js.map +0 -1
  330. package/lib/layout/dagre/src/order/sort-subgraph.d.ts +0 -7
  331. package/lib/layout/dagre/src/order/sort-subgraph.js +0 -90
  332. package/lib/layout/dagre/src/order/sort-subgraph.js.map +0 -1
  333. package/lib/layout/dagre/src/order/sort.d.ts +0 -7
  334. package/lib/layout/dagre/src/order/sort.js +0 -70
  335. package/lib/layout/dagre/src/order/sort.js.map +0 -1
  336. package/lib/layout/dagre/src/parent-dummy-chains.d.ts +0 -3
  337. package/lib/layout/dagre/src/parent-dummy-chains.js +0 -83
  338. package/lib/layout/dagre/src/parent-dummy-chains.js.map +0 -1
  339. package/lib/layout/dagre/src/position/bk.d.ts +0 -23
  340. package/lib/layout/dagre/src/position/bk.js +0 -409
  341. package/lib/layout/dagre/src/position/bk.js.map +0 -1
  342. package/lib/layout/dagre/src/position/index.d.ts +0 -3
  343. package/lib/layout/dagre/src/position/index.js +0 -64
  344. package/lib/layout/dagre/src/position/index.js.map +0 -1
  345. package/lib/layout/dagre/src/rank/feasible-tree.d.ts +0 -9
  346. package/lib/layout/dagre/src/rank/feasible-tree.js +0 -152
  347. package/lib/layout/dagre/src/rank/feasible-tree.js.map +0 -1
  348. package/lib/layout/dagre/src/rank/index.d.ts +0 -3
  349. package/lib/layout/dagre/src/rank/index.js +0 -58
  350. package/lib/layout/dagre/src/rank/index.js.map +0 -1
  351. package/lib/layout/dagre/src/rank/network-simplex.d.ts +0 -9
  352. package/lib/layout/dagre/src/rank/network-simplex.js +0 -205
  353. package/lib/layout/dagre/src/rank/network-simplex.js.map +0 -1
  354. package/lib/layout/dagre/src/rank/util.d.ts +0 -11
  355. package/lib/layout/dagre/src/rank/util.js +0 -146
  356. package/lib/layout/dagre/src/rank/util.js.map +0 -1
  357. package/lib/layout/dagre/src/util.d.ts +0 -31
  358. package/lib/layout/dagre/src/util.js +0 -280
  359. package/lib/layout/dagre/src/util.js.map +0 -1
  360. package/lib/layout/dagre.d.ts +0 -71
  361. package/lib/layout/dagre.js +0 -462
  362. package/lib/layout/dagre.js.map +0 -1
  363. package/lib/layout/dagreCompound.d.ts +0 -121
  364. package/lib/layout/dagreCompound.js +0 -429
  365. package/lib/layout/dagreCompound.js.map +0 -1
  366. package/lib/layout/er/core.d.ts +0 -1
  367. package/lib/layout/er/core.js +0 -147
  368. package/lib/layout/er/core.js.map +0 -1
  369. package/lib/layout/er/forceGrid.d.ts +0 -8
  370. package/lib/layout/er/forceGrid.js +0 -97
  371. package/lib/layout/er/forceGrid.js.map +0 -1
  372. package/lib/layout/er/grid.d.ts +0 -26
  373. package/lib/layout/er/grid.js +0 -177
  374. package/lib/layout/er/grid.js.map +0 -1
  375. package/lib/layout/er/index.d.ts +0 -29
  376. package/lib/layout/er/index.js +0 -80
  377. package/lib/layout/er/index.js.map +0 -1
  378. package/lib/layout/er/mysqlWorkbench.d.ts +0 -6
  379. package/lib/layout/er/mysqlWorkbench.js +0 -326
  380. package/lib/layout/er/mysqlWorkbench.js.map +0 -1
  381. package/lib/layout/er/type.d.ts +0 -35
  382. package/lib/layout/er/type.js +0 -3
  383. package/lib/layout/er/type.js.map +0 -1
  384. package/lib/layout/force/force-in-a-box.d.ts +0 -28
  385. package/lib/layout/force/force-in-a-box.js +0 -357
  386. package/lib/layout/force/force-in-a-box.js.map +0 -1
  387. package/lib/layout/force/force.d.ts +0 -100
  388. package/lib/layout/force/force.js +0 -388
  389. package/lib/layout/force/force.js.map +0 -1
  390. package/lib/layout/force/index.d.ts +0 -1
  391. package/lib/layout/force/index.js +0 -18
  392. package/lib/layout/force/index.js.map +0 -1
  393. package/lib/layout/force2/ForceNBody.d.ts +0 -7
  394. package/lib/layout/force2/ForceNBody.js +0 -98
  395. package/lib/layout/force2/ForceNBody.js.map +0 -1
  396. package/lib/layout/force2/index.d.ts +0 -119
  397. package/lib/layout/force2/index.js +0 -643
  398. package/lib/layout/force2/index.js.map +0 -1
  399. package/lib/layout/forceAtlas2/body.d.ts +0 -33
  400. package/lib/layout/forceAtlas2/body.js +0 -93
  401. package/lib/layout/forceAtlas2/body.js.map +0 -1
  402. package/lib/layout/forceAtlas2/index.d.ts +0 -115
  403. package/lib/layout/forceAtlas2/index.js +0 -509
  404. package/lib/layout/forceAtlas2/index.js.map +0 -1
  405. package/lib/layout/forceAtlas2/quad.d.ts +0 -27
  406. package/lib/layout/forceAtlas2/quad.js +0 -100
  407. package/lib/layout/forceAtlas2/quad.js.map +0 -1
  408. package/lib/layout/forceAtlas2/quadTree.d.ts +0 -20
  409. package/lib/layout/forceAtlas2/quadTree.js +0 -107
  410. package/lib/layout/forceAtlas2/quadTree.js.map +0 -1
  411. package/lib/layout/fruchterman.d.ts +0 -73
  412. package/lib/layout/fruchterman.js +0 -320
  413. package/lib/layout/fruchterman.js.map +0 -1
  414. package/lib/layout/gForce.d.ts +0 -96
  415. package/lib/layout/gForce.js +0 -421
  416. package/lib/layout/gForce.js.map +0 -1
  417. package/lib/layout/gpu/fruchterman.d.ts +0 -57
  418. package/lib/layout/gpu/fruchterman.js +0 -361
  419. package/lib/layout/gpu/fruchterman.js.map +0 -1
  420. package/lib/layout/gpu/fruchtermanShader.d.ts +0 -4
  421. package/lib/layout/gpu/fruchtermanShader.js +0 -8
  422. package/lib/layout/gpu/fruchtermanShader.js.map +0 -1
  423. package/lib/layout/gpu/gForce.d.ts +0 -68
  424. package/lib/layout/gpu/gForce.js +0 -415
  425. package/lib/layout/gpu/gForce.js.map +0 -1
  426. package/lib/layout/gpu/gForceShader.d.ts +0 -4
  427. package/lib/layout/gpu/gForceShader.js +0 -8
  428. package/lib/layout/gpu/gForceShader.js.map +0 -1
  429. package/lib/layout/grid.d.ts +0 -83
  430. package/lib/layout/grid.js +0 -339
  431. package/lib/layout/grid.js.map +0 -1
  432. package/lib/layout/index.d.ts +0 -22
  433. package/lib/layout/index.js +0 -59
  434. package/lib/layout/index.js.map +0 -1
  435. package/lib/layout/layout.d.ts +0 -26
  436. package/lib/layout/layout.js +0 -102
  437. package/lib/layout/layout.js.map +0 -1
  438. package/lib/layout/mds.d.ts +0 -39
  439. package/lib/layout/mds.js +0 -144
  440. package/lib/layout/mds.js.map +0 -1
  441. package/lib/layout/radial/index.d.ts +0 -1
  442. package/lib/layout/radial/index.js +0 -18
  443. package/lib/layout/radial/index.js.map +0 -1
  444. package/lib/layout/radial/mds.d.ts +0 -15
  445. package/lib/layout/radial/mds.js +0 -42
  446. package/lib/layout/radial/mds.js.map +0 -1
  447. package/lib/layout/radial/radial.d.ts +0 -74
  448. package/lib/layout/radial/radial.js +0 -445
  449. package/lib/layout/radial/radial.js.map +0 -1
  450. package/lib/layout/radial/radialNonoverlapForce.d.ts +0 -50
  451. package/lib/layout/radial/radialNonoverlapForce.js +0 -127
  452. package/lib/layout/radial/radialNonoverlapForce.js.map +0 -1
  453. package/lib/layout/random.d.ts +0 -35
  454. package/lib/layout/random.js +0 -84
  455. package/lib/layout/random.js.map +0 -1
  456. package/lib/layout/types.d.ts +0 -432
  457. package/lib/layout/types.js +0 -3
  458. package/lib/layout/types.js.map +0 -1
  459. package/lib/registy/index.d.ts +0 -3
  460. package/lib/registy/index.js +0 -65
  461. package/lib/registy/index.js.map +0 -1
  462. package/lib/util/array.js +0 -5
  463. package/lib/util/array.js.map +0 -1
  464. package/lib/util/function.js +0 -65
  465. package/lib/util/function.js.map +0 -1
  466. package/lib/util/gpu.js +0 -250
  467. package/lib/util/gpu.js.map +0 -1
  468. package/lib/util/index.js +0 -23
  469. package/lib/util/index.js.map +0 -1
  470. package/lib/util/math.js +0 -289
  471. package/lib/util/math.js.map +0 -1
  472. package/lib/util/number.js +0 -13
  473. package/lib/util/number.js.map +0 -1
  474. package/lib/util/object.js +0 -43
  475. package/lib/util/object.js.map +0 -1
  476. package/lib/util/string.js +0 -20
  477. package/lib/util/string.js.map +0 -1
  478. package/src/index.ts +0 -7
  479. package/src/layout/base.ts +0 -57
  480. package/src/layout/circular.ts +0 -370
  481. package/src/layout/comboCombined.ts +0 -397
  482. package/src/layout/comboForce.ts +0 -873
  483. package/src/layout/concentric.ts +0 -289
  484. package/src/layout/constants.ts +0 -22
  485. package/src/layout/dagre/graph.ts +0 -104
  486. package/src/layout/dagre/index.ts +0 -31
  487. package/src/layout/dagre/src/acyclic.ts +0 -58
  488. package/src/layout/dagre/src/add-border-segments.ts +0 -47
  489. package/src/layout/dagre/src/coordinate-system.ts +0 -77
  490. package/src/layout/dagre/src/data/list.ts +0 -60
  491. package/src/layout/dagre/src/debug.ts +0 -30
  492. package/src/layout/dagre/src/greedy-fas.ts +0 -144
  493. package/src/layout/dagre/src/layout.ts +0 -579
  494. package/src/layout/dagre/src/nesting-graph.ts +0 -143
  495. package/src/layout/dagre/src/normalize.ts +0 -96
  496. package/src/layout/dagre/src/order/add-subgraph-constraints.ts +0 -29
  497. package/src/layout/dagre/src/order/barycenter.ts +0 -26
  498. package/src/layout/dagre/src/order/build-layer-graph.ts +0 -82
  499. package/src/layout/dagre/src/order/cross-count.ts +0 -77
  500. package/src/layout/dagre/src/order/index.ts +0 -105
  501. package/src/layout/dagre/src/order/init-data-order.ts +0 -27
  502. package/src/layout/dagre/src/order/init-order.ts +0 -56
  503. package/src/layout/dagre/src/order/resolve-conflicts.ts +0 -152
  504. package/src/layout/dagre/src/order/sort-subgraph.ts +0 -105
  505. package/src/layout/dagre/src/order/sort.ts +0 -76
  506. package/src/layout/dagre/src/parent-dummy-chains.ts +0 -102
  507. package/src/layout/dagre/src/position/bk.ts +0 -493
  508. package/src/layout/dagre/src/position/index.ts +0 -82
  509. package/src/layout/dagre/src/rank/feasible-tree.ts +0 -165
  510. package/src/layout/dagre/src/rank/index.ts +0 -54
  511. package/src/layout/dagre/src/rank/network-simplex.ts +0 -225
  512. package/src/layout/dagre/src/rank/util.ts +0 -166
  513. package/src/layout/dagre/src/util.ts +0 -309
  514. package/src/layout/dagre.ts +0 -460
  515. package/src/layout/dagreCompound.ts +0 -518
  516. package/src/layout/er/core.ts +0 -117
  517. package/src/layout/er/forceGrid.ts +0 -95
  518. package/src/layout/er/grid.ts +0 -185
  519. package/src/layout/er/index.ts +0 -68
  520. package/src/layout/er/mysqlWorkbench.ts +0 -345
  521. package/src/layout/er/type.ts +0 -39
  522. package/src/layout/force/force-in-a-box.ts +0 -400
  523. package/src/layout/force/force.ts +0 -391
  524. package/src/layout/force/index.ts +0 -1
  525. package/src/layout/force2/ForceNBody.ts +0 -128
  526. package/src/layout/force2/index.ts +0 -741
  527. package/src/layout/forceAtlas2/body.ts +0 -115
  528. package/src/layout/forceAtlas2/index.ts +0 -556
  529. package/src/layout/forceAtlas2/quad.ts +0 -115
  530. package/src/layout/forceAtlas2/quadTree.ts +0 -107
  531. package/src/layout/fruchterman.ts +0 -361
  532. package/src/layout/gForce.ts +0 -488
  533. package/src/layout/gpu/fruchterman.ts +0 -314
  534. package/src/layout/gpu/fruchtermanShader.ts +0 -203
  535. package/src/layout/gpu/gForce.ts +0 -407
  536. package/src/layout/gpu/gForceShader.ts +0 -220
  537. package/src/layout/grid.ts +0 -404
  538. package/src/layout/index.ts +0 -47
  539. package/src/layout/layout.ts +0 -110
  540. package/src/layout/mds.ts +0 -140
  541. package/src/layout/radial/index.ts +0 -1
  542. package/src/layout/radial/mds.ts +0 -51
  543. package/src/layout/radial/radial.ts +0 -500
  544. package/src/layout/radial/radialNonoverlapForce.ts +0 -189
  545. package/src/layout/random.ts +0 -75
  546. package/src/layout/types.ts +0 -496
  547. package/src/registy/index.ts +0 -43
  548. package/src/util/array.ts +0 -1
  549. package/src/util/function.ts +0 -64
  550. package/src/util/gpu.ts +0 -256
  551. package/src/util/index.ts +0 -6
  552. package/src/util/math.ts +0 -294
  553. package/src/util/number.ts +0 -8
  554. package/src/util/object.ts +0 -28
  555. package/src/util/string.ts +0 -18
package/es/index.d.ts DELETED
@@ -1,3 +0,0 @@
1
- import { registerLayout, unRegisterLayout, getLayoutByName } from "./registy";
2
- export { registerLayout, unRegisterLayout, getLayoutByName };
3
- export * from "./layout";
package/es/index.js DELETED
@@ -1,6 +0,0 @@
1
- import { registerLayout, unRegisterLayout, getLayoutByName } from "./registy";
2
- // register layout
3
- export { registerLayout, unRegisterLayout, getLayoutByName };
4
- // layout, layout types file, worker
5
- export * from "./layout";
6
- //# sourceMappingURL=index.js.map
package/es/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAE9E,kBAAkB;AAClB,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,eAAe,EAAE,CAAC;AAE7D,oCAAoC;AACpC,cAAc,UAAU,CAAC"}
@@ -1,22 +0,0 @@
1
- import { Node, Edge, Combo, Model, PointTuple } from './types';
2
- export declare class Base {
3
- nodes: Node[] | null;
4
- edges: Edge[] | null;
5
- combos: Combo[] | null;
6
- comboEdges: Edge[] | null;
7
- hiddenNodes: Node[] | null;
8
- hiddenEdges: Edge[] | null;
9
- hiddenCombos: Combo[] | null;
10
- vedges: Edge[] | null;
11
- positions: PointTuple[] | null;
12
- destroyed: boolean;
13
- onLayoutEnd: () => void;
14
- layout(data: Model): Model;
15
- init(data: Model): void;
16
- execute(reloadData?: boolean): any;
17
- executeWithWorker(): void;
18
- getDefaultCfg(): {};
19
- updateCfg(cfg: any): void;
20
- getType(): string;
21
- destroy(): void;
22
- }
package/es/layout/base.js DELETED
@@ -1,51 +0,0 @@
1
- export class Base {
2
- constructor() {
3
- this.nodes = [];
4
- this.edges = [];
5
- this.combos = [];
6
- this.comboEdges = [];
7
- this.hiddenNodes = [];
8
- this.hiddenEdges = [];
9
- this.hiddenCombos = [];
10
- // temp edges e.g. the edge generated for releated collapsed combo
11
- this.vedges = [];
12
- this.positions = [];
13
- this.destroyed = false;
14
- this.onLayoutEnd = () => { };
15
- }
16
- layout(data) {
17
- this.init(data);
18
- return this.execute(true);
19
- }
20
- init(data) {
21
- this.nodes = data.nodes || [];
22
- this.edges = data.edges || [];
23
- this.combos = data.combos || [];
24
- this.comboEdges = data.comboEdges || [];
25
- this.hiddenNodes = data.hiddenNodes || [];
26
- this.hiddenEdges = data.hiddenEdges || [];
27
- this.hiddenCombos = data.hiddenCombos || [];
28
- this.vedges = data.vedges || [];
29
- }
30
- execute(reloadData) { }
31
- executeWithWorker() { }
32
- getDefaultCfg() {
33
- return {};
34
- }
35
- updateCfg(cfg) {
36
- if (cfg) {
37
- Object.assign(this, cfg);
38
- }
39
- }
40
- getType() {
41
- return 'base';
42
- }
43
- destroy() {
44
- this.nodes = null;
45
- this.edges = null;
46
- this.combos = null;
47
- this.positions = null;
48
- this.destroyed = true;
49
- }
50
- }
51
- //# sourceMappingURL=base.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"base.js","sourceRoot":"","sources":["../../src/layout/base.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,IAAI;IAAjB;QACS,UAAK,GAAkB,EAAE,CAAC;QAC1B,UAAK,GAAkB,EAAE,CAAC;QAC1B,WAAM,GAAmB,EAAE,CAAC;QAC5B,eAAU,GAAkB,EAAE,CAAC;QAC/B,gBAAW,GAAkB,EAAE,CAAC;QAChC,gBAAW,GAAkB,EAAE,CAAC;QAChC,iBAAY,GAAmB,EAAE,CAAC;QACzC,kEAAkE;QAC3D,WAAM,GAAkB,EAAE,CAAC;QAC3B,cAAS,GAAwB,EAAE,CAAC;QACpC,cAAS,GAAY,KAAK,CAAC;QAC3B,gBAAW,GAAe,GAAG,EAAE,GAAG,CAAC,CAAC;IA0C7C,CAAC;IAxCQ,MAAM,CAAC,IAAW;QACvB,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAChB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC;IAEM,IAAI,CAAC,IAAW;QACrB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC;QAC9B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC;QAC9B,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,IAAI,EAAE,CAAC;QAChC,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,IAAI,EAAE,CAAC;QACxC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,IAAI,EAAE,CAAC;QAC1C,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,IAAI,EAAE,CAAC;QAC1C,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,IAAI,EAAE,CAAC;QAC5C,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,IAAI,EAAE,CAAC;IAClC,CAAC;IAEM,OAAO,CAAC,UAAoB,IAAQ,CAAC;IACrC,iBAAiB,KAAI,CAAC;IAEtB,aAAa;QAClB,OAAO,EAAE,CAAC;IACZ,CAAC;IAEM,SAAS,CAAC,GAAQ;QACvB,IAAI,GAAG,EAAE;YACP,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;SAC1B;IACH,CAAC;IAEM,OAAO;QACZ,OAAO,MAAM,CAAC;IAChB,CAAC;IAEM,OAAO;QACZ,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;QACnB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QACtB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;IACxB,CAAC;CACF"}
@@ -1,80 +0,0 @@
1
- /**
2
- * @fileOverview random layout
3
- * @author shiwu.wyy@antfin.com
4
- */
5
- import { OutNode, Edge, PointTuple, CircularLayoutOptions } from "./types";
6
- import { Base } from "./base";
7
- type INode = OutNode & {
8
- degree: number;
9
- size: number | PointTuple;
10
- weight: number;
11
- children: string[];
12
- parent: string[];
13
- };
14
- /**
15
- * 圆形布局
16
- */
17
- export declare class CircularLayout extends Base {
18
- /** 布局中心 */
19
- center: PointTuple;
20
- /** 固定半径,若设置了 radius,则 startRadius 与 endRadius 不起效 */
21
- radius: number | null;
22
- /** 节点间距,若设置 nodeSpacing,则 radius 将被自动计算,即设置 radius 不生效 */
23
- nodeSpacing: ((d?: unknown) => number) | number | undefined;
24
- /** 节点大小,配合 nodeSpacing,一起用于计算 radius。若不配置,节点大小默认为 30 */
25
- nodeSize: number | undefined;
26
- /** 起始半径 */
27
- startRadius: number | null;
28
- /** 终止半径 */
29
- endRadius: number | null;
30
- /** 起始角度 */
31
- startAngle: number;
32
- /** 终止角度 */
33
- endAngle: number;
34
- /** 是否顺时针 */
35
- clockwise: boolean;
36
- /** 节点在环上分成段数(几个段将均匀分布),在 endRadius - startRadius != 0 时生效 */
37
- divisions: number;
38
- /** 节点在环上排序的依据,可选: 'topology', 'degree', 'null' */
39
- ordering: "topology" | "topology-directed" | "degree" | null;
40
- /** how many 2*pi from first to last nodes */
41
- angleRatio: number;
42
- nodes: INode[];
43
- edges: Edge[];
44
- private nodeMap;
45
- private degrees;
46
- width: number;
47
- height: number;
48
- onLayoutEnd: () => void;
49
- constructor(options?: CircularLayoutOptions);
50
- getDefaultCfg(): {
51
- radius: null;
52
- startRadius: null;
53
- endRadius: null;
54
- startAngle: number;
55
- endAngle: number;
56
- clockwise: boolean;
57
- divisions: number;
58
- ordering: null;
59
- angleRatio: number;
60
- };
61
- /**
62
- * 执行布局
63
- */
64
- execute(): {
65
- nodes: INode[];
66
- edges: Edge[];
67
- } | undefined;
68
- /**
69
- * 根据节点的拓扑结构排序
70
- * @return {array} orderedNodes 排序后的结果
71
- */
72
- topologyOrdering(directed?: boolean): INode[];
73
- /**
74
- * 根据节点度数大小排序
75
- * @return {array} orderedNodes 排序后的结果
76
- */
77
- degreeOrdering(): INode[];
78
- getType(): string;
79
- }
80
- export {};
@@ -1,314 +0,0 @@
1
- /**
2
- * @fileOverview random layout
3
- * @author shiwu.wyy@antfin.com
4
- */
5
- import { Base } from "./base";
6
- import { getDegree, clone, getEdgeTerminal, getFuncByUnknownType } from "../util";
7
- function initHierarchy(nodes, edges, nodeMap, directed) {
8
- nodes.forEach((_, i) => {
9
- nodes[i].children = [];
10
- nodes[i].parent = [];
11
- });
12
- if (directed) {
13
- edges.forEach((e) => {
14
- const source = getEdgeTerminal(e, 'source');
15
- const target = getEdgeTerminal(e, 'target');
16
- let sourceIdx = 0;
17
- if (source) {
18
- sourceIdx = nodeMap[source];
19
- }
20
- let targetIdx = 0;
21
- if (target) {
22
- targetIdx = nodeMap[target];
23
- }
24
- const child = nodes[sourceIdx].children;
25
- const parent = nodes[targetIdx].parent;
26
- child.push(nodes[targetIdx].id);
27
- parent.push(nodes[sourceIdx].id);
28
- });
29
- }
30
- else {
31
- edges.forEach((e) => {
32
- const source = getEdgeTerminal(e, 'source');
33
- const target = getEdgeTerminal(e, 'target');
34
- let sourceIdx = 0;
35
- if (source) {
36
- sourceIdx = nodeMap[source];
37
- }
38
- let targetIdx = 0;
39
- if (target) {
40
- targetIdx = nodeMap[target];
41
- }
42
- const sourceChildren = nodes[sourceIdx].children;
43
- const targetChildren = nodes[targetIdx].children;
44
- sourceChildren.push(nodes[targetIdx].id);
45
- targetChildren.push(nodes[sourceIdx].id);
46
- });
47
- }
48
- }
49
- function connect(a, b, edges) {
50
- const m = edges.length;
51
- for (let i = 0; i < m; i++) {
52
- const source = getEdgeTerminal(edges[i], 'source');
53
- const target = getEdgeTerminal(edges[i], 'target');
54
- if ((a.id === source && b.id === target) ||
55
- (b.id === source && a.id === target)) {
56
- return true;
57
- }
58
- }
59
- return false;
60
- }
61
- function compareDegree(a, b) {
62
- const aDegree = a.degree;
63
- const bDegree = b.degree;
64
- if (aDegree < bDegree) {
65
- return -1;
66
- }
67
- if (aDegree > bDegree) {
68
- return 1;
69
- }
70
- return 0;
71
- }
72
- /**
73
- * 圆形布局
74
- */
75
- export class CircularLayout extends Base {
76
- constructor(options) {
77
- super();
78
- /** 固定半径,若设置了 radius,则 startRadius 与 endRadius 不起效 */
79
- this.radius = null;
80
- /** 节点大小,配合 nodeSpacing,一起用于计算 radius。若不配置,节点大小默认为 30 */
81
- this.nodeSize = undefined;
82
- /** 起始半径 */
83
- this.startRadius = null;
84
- /** 终止半径 */
85
- this.endRadius = null;
86
- /** 起始角度 */
87
- this.startAngle = 0;
88
- /** 终止角度 */
89
- this.endAngle = 2 * Math.PI;
90
- /** 是否顺时针 */
91
- this.clockwise = true;
92
- /** 节点在环上分成段数(几个段将均匀分布),在 endRadius - startRadius != 0 时生效 */
93
- this.divisions = 1;
94
- /** 节点在环上排序的依据,可选: 'topology', 'degree', 'null' */
95
- this.ordering = null;
96
- /** how many 2*pi from first to last nodes */
97
- this.angleRatio = 1;
98
- this.nodes = [];
99
- this.edges = [];
100
- this.nodeMap = {};
101
- this.degrees = [];
102
- this.width = 300;
103
- this.height = 300;
104
- this.updateCfg(options);
105
- }
106
- getDefaultCfg() {
107
- return {
108
- radius: null,
109
- startRadius: null,
110
- endRadius: null,
111
- startAngle: 0,
112
- endAngle: 2 * Math.PI,
113
- clockwise: true,
114
- divisions: 1,
115
- ordering: null,
116
- angleRatio: 1
117
- };
118
- }
119
- /**
120
- * 执行布局
121
- */
122
- execute() {
123
- var _a;
124
- const self = this;
125
- const nodes = self.nodes;
126
- const edges = self.edges;
127
- const n = nodes.length;
128
- if (n === 0) {
129
- if (self.onLayoutEnd)
130
- self.onLayoutEnd();
131
- return;
132
- }
133
- if (!self.width && typeof window !== "undefined") {
134
- self.width = window.innerWidth;
135
- }
136
- if (!self.height && typeof window !== "undefined") {
137
- self.height = window.innerHeight;
138
- }
139
- if (!self.center) {
140
- self.center = [self.width / 2, self.height / 2];
141
- }
142
- const center = self.center;
143
- if (n === 1) {
144
- nodes[0].x = center[0];
145
- nodes[0].y = center[1];
146
- if (self.onLayoutEnd)
147
- self.onLayoutEnd();
148
- return;
149
- }
150
- let { radius, startRadius, endRadius } = self;
151
- const { divisions, startAngle, endAngle, angleRatio, ordering, clockwise, nodeSpacing: paramNodeSpacing, nodeSize: paramNodeSize } = self;
152
- const angleStep = (endAngle - startAngle) / n;
153
- // layout
154
- const nodeMap = {};
155
- nodes.forEach((node, i) => {
156
- nodeMap[node.id] = i;
157
- });
158
- self.nodeMap = nodeMap;
159
- const degrees = getDegree(nodes.length, nodeMap, edges);
160
- self.degrees = degrees;
161
- if (paramNodeSpacing) {
162
- const nodeSpacing = getFuncByUnknownType(10, paramNodeSpacing);
163
- const nodeSize = getFuncByUnknownType(10, paramNodeSize);
164
- let maxNodeSize = -Infinity;
165
- nodes.forEach((node) => {
166
- const nSize = nodeSize(node);
167
- if (maxNodeSize < nSize)
168
- maxNodeSize = nSize;
169
- });
170
- let length = 0;
171
- nodes.forEach((node, i) => {
172
- if (i === 0)
173
- length += (maxNodeSize || 10);
174
- else
175
- length += (nodeSpacing(node) || 0) + (maxNodeSize || 10);
176
- });
177
- radius = length / (2 * Math.PI);
178
- }
179
- else if (!radius && !startRadius && !endRadius) {
180
- radius = self.height > self.width ? self.width / 2 : self.height / 2;
181
- }
182
- else if (!startRadius && endRadius) {
183
- startRadius = endRadius;
184
- }
185
- else if (startRadius && !endRadius) {
186
- endRadius = startRadius;
187
- }
188
- const astep = angleStep * angleRatio;
189
- let layoutNodes = [];
190
- if (ordering === "topology") {
191
- // layout according to the topology
192
- layoutNodes = self.topologyOrdering();
193
- }
194
- else if (ordering === "topology-directed") {
195
- // layout according to the topology
196
- layoutNodes = self.topologyOrdering(true);
197
- }
198
- else if (ordering === "degree") {
199
- // layout according to the descent order of degrees
200
- layoutNodes = self.degreeOrdering();
201
- }
202
- else {
203
- // layout according to the original order in the data.nodes
204
- layoutNodes = nodes;
205
- }
206
- const divN = Math.ceil(n / divisions); // node number in each division
207
- for (let i = 0; i < n; ++i) {
208
- let r = radius;
209
- if (!r && startRadius !== null && endRadius !== null) {
210
- r = startRadius + (i * (endRadius - startRadius)) / (n - 1);
211
- }
212
- if (!r) {
213
- r = 10 + (i * 100) / (n - 1);
214
- }
215
- let angle = startAngle +
216
- (i % divN) * astep +
217
- ((2 * Math.PI) / divisions) * Math.floor(i / divN);
218
- if (!clockwise) {
219
- angle =
220
- endAngle -
221
- (i % divN) * astep -
222
- ((2 * Math.PI) / divisions) * Math.floor(i / divN);
223
- }
224
- layoutNodes[i].x = center[0] + Math.cos(angle) * r;
225
- layoutNodes[i].y = center[1] + Math.sin(angle) * r;
226
- layoutNodes[i].weight = degrees[i].all;
227
- }
228
- (_a = self.onLayoutEnd) === null || _a === void 0 ? void 0 : _a.call(self);
229
- return {
230
- nodes: layoutNodes,
231
- edges: this.edges
232
- };
233
- }
234
- /**
235
- * 根据节点的拓扑结构排序
236
- * @return {array} orderedNodes 排序后的结果
237
- */
238
- topologyOrdering(directed = false) {
239
- const self = this;
240
- const degrees = self.degrees;
241
- const edges = self.edges;
242
- const nodes = self.nodes;
243
- const cnodes = clone(nodes);
244
- const nodeMap = self.nodeMap;
245
- const orderedCNodes = [cnodes[0]];
246
- const resNodes = [nodes[0]];
247
- const pickFlags = [];
248
- const n = nodes.length;
249
- pickFlags[0] = true;
250
- initHierarchy(cnodes, edges, nodeMap, directed);
251
- let k = 0;
252
- cnodes.forEach((cnode, i) => {
253
- if (i !== 0) {
254
- if ((i === n - 1 ||
255
- degrees[i].all !== degrees[i + 1].all ||
256
- connect(orderedCNodes[k], cnode, edges)) &&
257
- !pickFlags[i]) {
258
- orderedCNodes.push(cnode);
259
- resNodes.push(nodes[nodeMap[cnode.id]]);
260
- pickFlags[i] = true;
261
- k++;
262
- }
263
- else {
264
- const children = orderedCNodes[k].children;
265
- let foundChild = false;
266
- for (let j = 0; j < children.length; j++) {
267
- const childIdx = nodeMap[children[j]];
268
- if (degrees[childIdx].all === degrees[i].all && !pickFlags[childIdx]) {
269
- orderedCNodes.push(cnodes[childIdx]);
270
- resNodes.push(nodes[nodeMap[cnodes[childIdx].id]]);
271
- pickFlags[childIdx] = true;
272
- foundChild = true;
273
- break;
274
- }
275
- }
276
- let ii = 0;
277
- while (!foundChild) {
278
- if (!pickFlags[ii]) {
279
- orderedCNodes.push(cnodes[ii]);
280
- resNodes.push(nodes[nodeMap[cnodes[ii].id]]);
281
- pickFlags[ii] = true;
282
- foundChild = true;
283
- }
284
- ii++;
285
- if (ii === n) {
286
- break;
287
- }
288
- }
289
- }
290
- }
291
- });
292
- return resNodes;
293
- }
294
- /**
295
- * 根据节点度数大小排序
296
- * @return {array} orderedNodes 排序后的结果
297
- */
298
- degreeOrdering() {
299
- const self = this;
300
- const nodes = self.nodes;
301
- const orderedNodes = [];
302
- const degrees = self.degrees;
303
- nodes.forEach((node, i) => {
304
- node.degree = degrees[i].all;
305
- orderedNodes.push(node);
306
- });
307
- orderedNodes.sort(compareDegree);
308
- return orderedNodes;
309
- }
310
- getType() {
311
- return "circular";
312
- }
313
- }
314
- //# sourceMappingURL=circular.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"circular.js","sourceRoot":"","sources":["../../src/layout/circular.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAUH,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAUlF,SAAS,aAAa,CACpB,KAAc,EACd,KAAa,EACb,OAAiB,EACjB,QAAiB;IAEjB,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAS,EAAE,EAAE;QAC7B,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,GAAG,EAAE,CAAC;QACvB,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,EAAE,CAAC;IACvB,CAAC,CAAC,CAAC;IACH,IAAI,QAAQ,EAAE;QACZ,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE;YAClB,MAAM,MAAM,GAAG,eAAe,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;YAC5C,MAAM,MAAM,GAAG,eAAe,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;YAC5C,IAAI,SAAS,GAAG,CAAC,CAAC;YAClB,IAAI,MAAM,EAAE;gBACV,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;aAC7B;YACD,IAAI,SAAS,GAAG,CAAC,CAAC;YAClB,IAAI,MAAM,EAAE;gBACV,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;aAC7B;YACD,MAAM,KAAK,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC,QAAS,CAAC;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F"}
@@ -1,54 +0,0 @@
1
- /**
2
- * @fileOverview Combo force layout
3
- * @author shiwu.wyy@antfin.com
4
- */
5
- import { Edge, Combo, OutNode, PointTuple, ComboTree, ComboCombinedLayoutOptions } from "./types";
6
- import { Base } from "./base";
7
- import { CircularLayout, ConcentricLayout, GridLayout, RadialLayout } from ".";
8
- type Node = OutNode & {
9
- depth?: number;
10
- itemType?: string;
11
- comboId?: string;
12
- fx?: number;
13
- fy?: number;
14
- mass?: number;
15
- };
16
- /**
17
- * combined two layouts (inner and outer) for graph with combos
18
- */
19
- export declare class ComboCombinedLayout extends Base {
20
- /** 布局中心 */
21
- center: PointTuple;
22
- /** 内部计算参数 */
23
- nodes: Node[];
24
- edges: Edge[];
25
- combos: Combo[];
26
- comboEdges: Edge[];
27
- /** 节点大小,用于防止节点之间的重叠 */
28
- nodeSize: number | number[] | ((d?: unknown) => number) | undefined;
29
- /** 节点/combo最小间距,防止重叠时的间隙 */
30
- spacing: ((d?: unknown) => number) | number | undefined;
31
- /** 最外层的布局算法,需要使用同步的布局算法,默认为 forceAtlas2 */
32
- outerLayout: any;
33
- /** combo 内部的布局算法,默认为 concentric */
34
- innerLayout: ConcentricLayout | CircularLayout | GridLayout | RadialLayout;
35
- /** Combo 内部的 padding */
36
- comboPadding: ((d?: unknown) => number) | number | number[] | undefined;
37
- comboTrees: ComboTree[];
38
- constructor(options?: ComboCombinedLayoutOptions);
39
- getDefaultCfg(): {};
40
- /**
41
- * 执行布局
42
- */
43
- execute(): void;
44
- run(): {
45
- nodes: Node[];
46
- edges: Edge[];
47
- combos: Combo[];
48
- comboEdges: Edge[];
49
- };
50
- private getInnerGraphs;
51
- private initVals;
52
- getType(): string;
53
- }
54
- export {};