@antv/layout 0.3.11 → 1.0.0-alpha.0
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.
- package/README.md +45 -32
- package/dist/3a54d760230d1933f953.worker.js +2 -0
- package/dist/3a54d760230d1933f953.worker.js.map +1 -0
- package/dist/index.min.js +2 -0
- package/dist/index.min.js.map +1 -0
- package/lib/Circular.d.ts +40 -0
- package/lib/Supervisor.d.ts +65 -0
- package/lib/index.d.ts +3 -3
- package/lib/registry.d.ts +3 -0
- package/lib/types.d.ts +128 -0
- package/lib/util/gpu.d.ts +22 -22
- package/lib/util/index.d.ts +6 -6
- package/lib/util/math.d.ts +9 -4
- package/lib/worker.d.ts +3 -0
- package/package.json +21 -95
- package/dist/layout.min.js +0 -3
- package/dist/layout.min.js.LICENSE.txt +0 -1
- package/dist/layout.min.js.map +0 -1
- package/es/index.d.ts +0 -3
- package/es/index.js +0 -6
- package/es/index.js.map +0 -1
- package/es/layout/base.d.ts +0 -22
- package/es/layout/base.js +0 -51
- package/es/layout/base.js.map +0 -1
- package/es/layout/circular.d.ts +0 -80
- package/es/layout/circular.js +0 -314
- package/es/layout/circular.js.map +0 -1
- package/es/layout/comboCombined.d.ts +0 -54
- package/es/layout/comboCombined.js +0 -348
- package/es/layout/comboCombined.js.map +0 -1
- package/es/layout/comboForce.d.ts +0 -134
- package/es/layout/comboForce.js +0 -801
- package/es/layout/comboForce.js.map +0 -1
- package/es/layout/concentric.d.ts +0 -67
- package/es/layout/concentric.js +0 -219
- package/es/layout/concentric.js.map +0 -1
- package/es/layout/constants.d.ts +0 -12
- package/es/layout/constants.js +0 -22
- package/es/layout/constants.js.map +0 -1
- package/es/layout/dagre/graph.d.ts +0 -91
- package/es/layout/dagre/graph.js +0 -4
- package/es/layout/dagre/graph.js.map +0 -1
- package/es/layout/dagre/index.d.ts +0 -8
- package/es/layout/dagre/index.js +0 -31
- package/es/layout/dagre/index.js.map +0 -1
- package/es/layout/dagre/src/acyclic.d.ts +0 -6
- package/es/layout/dagre/src/acyclic.js +0 -52
- package/es/layout/dagre/src/acyclic.js.map +0 -1
- package/es/layout/dagre/src/add-border-segments.d.ts +0 -3
- package/es/layout/dagre/src/add-border-segments.js +0 -32
- package/es/layout/dagre/src/add-border-segments.js.map +0 -1
- package/es/layout/dagre/src/coordinate-system.d.ts +0 -6
- package/es/layout/dagre/src/coordinate-system.js +0 -69
- package/es/layout/dagre/src/coordinate-system.js.map +0 -1
- package/es/layout/dagre/src/data/list.d.ts +0 -12
- package/es/layout/dagre/src/data/list.js +0 -48
- package/es/layout/dagre/src/data/list.js.map +0 -1
- package/es/layout/dagre/src/debug.d.ts +0 -3
- package/es/layout/dagre/src/debug.js +0 -24
- package/es/layout/dagre/src/debug.js.map +0 -1
- package/es/layout/dagre/src/greedy-fas.d.ts +0 -3
- package/es/layout/dagre/src/greedy-fas.js +0 -114
- package/es/layout/dagre/src/greedy-fas.js.map +0 -1
- package/es/layout/dagre/src/layout.d.ts +0 -3
- package/es/layout/dagre/src/layout.js +0 -518
- package/es/layout/dagre/src/layout.js.map +0 -1
- package/es/layout/dagre/src/nesting-graph.d.ts +0 -6
- package/es/layout/dagre/src/nesting-graph.js +0 -117
- package/es/layout/dagre/src/nesting-graph.js.map +0 -1
- package/es/layout/dagre/src/normalize.d.ts +0 -6
- package/es/layout/dagre/src/normalize.js +0 -89
- package/es/layout/dagre/src/normalize.js.map +0 -1
- package/es/layout/dagre/src/order/add-subgraph-constraints.d.ts +0 -3
- package/es/layout/dagre/src/order/add-subgraph-constraints.js +0 -27
- package/es/layout/dagre/src/order/add-subgraph-constraints.js.map +0 -1
- package/es/layout/dagre/src/order/barycenter.d.ts +0 -11
- package/es/layout/dagre/src/order/barycenter.js +0 -24
- package/es/layout/dagre/src/order/barycenter.js.map +0 -1
- package/es/layout/dagre/src/order/build-layer-graph.d.ts +0 -3
- package/es/layout/dagre/src/order/build-layer-graph.js +0 -71
- package/es/layout/dagre/src/order/build-layer-graph.js.map +0 -1
- package/es/layout/dagre/src/order/cross-count.d.ts +0 -3
- package/es/layout/dagre/src/order/cross-count.js +0 -65
- package/es/layout/dagre/src/order/cross-count.js.map +0 -1
- package/es/layout/dagre/src/order/index.d.ts +0 -3
- package/es/layout/dagre/src/order/index.js +0 -91
- package/es/layout/dagre/src/order/index.js.map +0 -1
- package/es/layout/dagre/src/order/init-data-order.d.ts +0 -6
- package/es/layout/dagre/src/order/init-data-order.js +0 -25
- package/es/layout/dagre/src/order/init-data-order.js.map +0 -1
- package/es/layout/dagre/src/order/init-order.d.ts +0 -3
- package/es/layout/dagre/src/order/init-order.js +0 -52
- package/es/layout/dagre/src/order/init-order.js.map +0 -1
- package/es/layout/dagre/src/order/resolve-conflicts.d.ts +0 -19
- package/es/layout/dagre/src/order/resolve-conflicts.js +0 -93
- package/es/layout/dagre/src/order/resolve-conflicts.js.map +0 -1
- package/es/layout/dagre/src/order/sort-subgraph.d.ts +0 -7
- package/es/layout/dagre/src/order/sort-subgraph.js +0 -85
- package/es/layout/dagre/src/order/sort-subgraph.js.map +0 -1
- package/es/layout/dagre/src/order/sort.d.ts +0 -7
- package/es/layout/dagre/src/order/sort.js +0 -68
- package/es/layout/dagre/src/order/sort.js.map +0 -1
- package/es/layout/dagre/src/parent-dummy-chains.d.ts +0 -3
- package/es/layout/dagre/src/parent-dummy-chains.js +0 -81
- package/es/layout/dagre/src/parent-dummy-chains.js.map +0 -1
- package/es/layout/dagre/src/position/bk.d.ts +0 -23
- package/es/layout/dagre/src/position/bk.js +0 -370
- package/es/layout/dagre/src/position/bk.js.map +0 -1
- package/es/layout/dagre/src/position/index.d.ts +0 -3
- package/es/layout/dagre/src/position/index.js +0 -51
- package/es/layout/dagre/src/position/index.js.map +0 -1
- package/es/layout/dagre/src/rank/feasible-tree.d.ts +0 -9
- package/es/layout/dagre/src/rank/feasible-tree.js +0 -148
- package/es/layout/dagre/src/rank/feasible-tree.js.map +0 -1
- package/es/layout/dagre/src/rank/index.d.ts +0 -3
- package/es/layout/dagre/src/rank/index.js +0 -53
- package/es/layout/dagre/src/rank/index.js.map +0 -1
- package/es/layout/dagre/src/rank/network-simplex.d.ts +0 -9
- package/es/layout/dagre/src/rank/network-simplex.js +0 -195
- package/es/layout/dagre/src/rank/network-simplex.js.map +0 -1
- package/es/layout/dagre/src/rank/util.d.ts +0 -11
- package/es/layout/dagre/src/rank/util.js +0 -141
- package/es/layout/dagre/src/rank/util.js.map +0 -1
- package/es/layout/dagre/src/util.d.ts +0 -31
- package/es/layout/dagre/src/util.js +0 -261
- package/es/layout/dagre/src/util.js.map +0 -1
- package/es/layout/dagre.d.ts +0 -71
- package/es/layout/dagre.js +0 -433
- package/es/layout/dagre.js.map +0 -1
- package/es/layout/dagreCompound.d.ts +0 -121
- package/es/layout/dagreCompound.js +0 -391
- package/es/layout/dagreCompound.js.map +0 -1
- package/es/layout/er/core.d.ts +0 -1
- package/es/layout/er/core.js +0 -107
- package/es/layout/er/core.js.map +0 -1
- package/es/layout/er/forceGrid.d.ts +0 -8
- package/es/layout/er/forceGrid.js +0 -88
- package/es/layout/er/forceGrid.js.map +0 -1
- package/es/layout/er/grid.d.ts +0 -26
- package/es/layout/er/grid.js +0 -162
- package/es/layout/er/grid.js.map +0 -1
- package/es/layout/er/index.d.ts +0 -29
- package/es/layout/er/index.js +0 -54
- package/es/layout/er/index.js.map +0 -1
- package/es/layout/er/mysqlWorkbench.d.ts +0 -6
- package/es/layout/er/mysqlWorkbench.js +0 -324
- package/es/layout/er/mysqlWorkbench.js.map +0 -1
- package/es/layout/er/type.d.ts +0 -35
- package/es/layout/er/type.js +0 -2
- package/es/layout/er/type.js.map +0 -1
- package/es/layout/force/force-in-a-box.d.ts +0 -28
- package/es/layout/force/force-in-a-box.js +0 -330
- package/es/layout/force/force-in-a-box.js.map +0 -1
- package/es/layout/force/force.d.ts +0 -100
- package/es/layout/force/force.js +0 -340
- package/es/layout/force/force.js.map +0 -1
- package/es/layout/force/index.d.ts +0 -1
- package/es/layout/force/index.js +0 -2
- package/es/layout/force/index.js.map +0 -1
- package/es/layout/force2/ForceNBody.d.ts +0 -7
- package/es/layout/force2/ForceNBody.js +0 -94
- package/es/layout/force2/ForceNBody.js.map +0 -1
- package/es/layout/force2/index.d.ts +0 -119
- package/es/layout/force2/index.js +0 -608
- package/es/layout/force2/index.js.map +0 -1
- package/es/layout/forceAtlas2/body.d.ts +0 -33
- package/es/layout/forceAtlas2/body.js +0 -89
- package/es/layout/forceAtlas2/body.js.map +0 -1
- package/es/layout/forceAtlas2/index.d.ts +0 -115
- package/es/layout/forceAtlas2/index.js +0 -484
- package/es/layout/forceAtlas2/index.js.map +0 -1
- package/es/layout/forceAtlas2/quad.d.ts +0 -27
- package/es/layout/forceAtlas2/quad.js +0 -96
- package/es/layout/forceAtlas2/quad.js.map +0 -1
- package/es/layout/forceAtlas2/quadTree.d.ts +0 -20
- package/es/layout/forceAtlas2/quadTree.js +0 -103
- package/es/layout/forceAtlas2/quadTree.js.map +0 -1
- package/es/layout/fruchterman.d.ts +0 -73
- package/es/layout/fruchterman.js +0 -296
- package/es/layout/fruchterman.js.map +0 -1
- package/es/layout/gForce.d.ts +0 -96
- package/es/layout/gForce.js +0 -399
- package/es/layout/gForce.js.map +0 -1
- package/es/layout/gpu/fruchterman.d.ts +0 -57
- package/es/layout/gpu/fruchterman.js +0 -267
- package/es/layout/gpu/fruchterman.js.map +0 -1
- package/es/layout/gpu/fruchtermanShader.d.ts +0 -4
- package/es/layout/gpu/fruchtermanShader.js +0 -201
- package/es/layout/gpu/fruchtermanShader.js.map +0 -1
- package/es/layout/gpu/gForce.d.ts +0 -68
- package/es/layout/gpu/gForce.js +0 -330
- package/es/layout/gpu/gForce.js.map +0 -1
- package/es/layout/gpu/gForceShader.d.ts +0 -4
- package/es/layout/gpu/gForceShader.js +0 -218
- package/es/layout/gpu/gForceShader.js.map +0 -1
- package/es/layout/grid.d.ts +0 -83
- package/es/layout/grid.js +0 -317
- package/es/layout/grid.js.map +0 -1
- package/es/layout/index.d.ts +0 -22
- package/es/layout/index.js +0 -25
- package/es/layout/index.js.map +0 -1
- package/es/layout/layout.d.ts +0 -26
- package/es/layout/layout.js +0 -97
- package/es/layout/layout.js.map +0 -1
- package/es/layout/mds.d.ts +0 -39
- package/es/layout/mds.js +0 -122
- package/es/layout/mds.js.map +0 -1
- package/es/layout/radial/index.d.ts +0 -1
- package/es/layout/radial/index.js +0 -2
- package/es/layout/radial/index.js.map +0 -1
- package/es/layout/radial/mds.d.ts +0 -15
- package/es/layout/radial/mds.js +0 -38
- package/es/layout/radial/mds.js.map +0 -1
- package/es/layout/radial/radial.d.ts +0 -74
- package/es/layout/radial/radial.js +0 -420
- package/es/layout/radial/radial.js.map +0 -1
- package/es/layout/radial/radialNonoverlapForce.d.ts +0 -50
- package/es/layout/radial/radialNonoverlapForce.js +0 -123
- package/es/layout/radial/radialNonoverlapForce.js.map +0 -1
- package/es/layout/random.d.ts +0 -35
- package/es/layout/random.js +0 -62
- package/es/layout/random.js.map +0 -1
- package/es/layout/types.d.ts +0 -432
- package/es/layout/types.js +0 -2
- package/es/layout/types.js.map +0 -1
- package/es/registy/index.d.ts +0 -3
- package/es/registy/index.js +0 -41
- package/es/registy/index.js.map +0 -1
- package/es/util/array.d.ts +0 -1
- package/es/util/array.js +0 -2
- package/es/util/array.js.map +0 -1
- package/es/util/function.d.ts +0 -6
- package/es/util/function.js +0 -56
- package/es/util/function.js.map +0 -1
- package/es/util/gpu.d.ts +0 -52
- package/es/util/gpu.js +0 -239
- package/es/util/gpu.js.map +0 -1
- package/es/util/index.d.ts +0 -6
- package/es/util/index.js +0 -7
- package/es/util/index.js.map +0 -1
- package/es/util/math.d.ts +0 -43
- package/es/util/math.js +0 -253
- package/es/util/math.js.map +0 -1
- package/es/util/number.d.ts +0 -3
- package/es/util/number.js +0 -7
- package/es/util/number.js.map +0 -1
- package/es/util/object.d.ts +0 -2
- package/es/util/object.js +0 -25
- package/es/util/object.js.map +0 -1
- package/es/util/string.d.ts +0 -2
- package/es/util/string.js +0 -16
- package/es/util/string.js.map +0 -1
- package/lib/index.js +0 -24
- package/lib/index.js.map +0 -1
- package/lib/layout/base.d.ts +0 -22
- package/lib/layout/base.js +0 -56
- package/lib/layout/base.js.map +0 -1
- package/lib/layout/circular.d.ts +0 -80
- package/lib/layout/circular.js +0 -337
- package/lib/layout/circular.js.map +0 -1
- package/lib/layout/comboCombined.d.ts +0 -54
- package/lib/layout/comboCombined.js +0 -384
- package/lib/layout/comboCombined.js.map +0 -1
- package/lib/layout/comboForce.d.ts +0 -134
- package/lib/layout/comboForce.js +0 -826
- package/lib/layout/comboForce.js.map +0 -1
- package/lib/layout/concentric.d.ts +0 -67
- package/lib/layout/concentric.js +0 -243
- package/lib/layout/concentric.js.map +0 -1
- package/lib/layout/constants.d.ts +0 -12
- package/lib/layout/constants.js +0 -25
- package/lib/layout/constants.js.map +0 -1
- package/lib/layout/dagre/graph.d.ts +0 -91
- package/lib/layout/dagre/graph.js +0 -28
- package/lib/layout/dagre/graph.js.map +0 -1
- package/lib/layout/dagre/index.d.ts +0 -8
- package/lib/layout/dagre/index.js +0 -36
- package/lib/layout/dagre/index.js.map +0 -1
- package/lib/layout/dagre/src/acyclic.d.ts +0 -6
- package/lib/layout/dagre/src/acyclic.js +0 -57
- package/lib/layout/dagre/src/acyclic.js.map +0 -1
- package/lib/layout/dagre/src/add-border-segments.d.ts +0 -3
- package/lib/layout/dagre/src/add-border-segments.js +0 -34
- package/lib/layout/dagre/src/add-border-segments.js.map +0 -1
- package/lib/layout/dagre/src/coordinate-system.d.ts +0 -6
- package/lib/layout/dagre/src/coordinate-system.js +0 -71
- package/lib/layout/dagre/src/coordinate-system.js.map +0 -1
- package/lib/layout/dagre/src/data/list.d.ts +0 -12
- package/lib/layout/dagre/src/data/list.js +0 -52
- package/lib/layout/dagre/src/data/list.js.map +0 -1
- package/lib/layout/dagre/src/debug.d.ts +0 -3
- package/lib/layout/dagre/src/debug.js +0 -26
- package/lib/layout/dagre/src/debug.js.map +0 -1
- package/lib/layout/dagre/src/greedy-fas.d.ts +0 -3
- package/lib/layout/dagre/src/greedy-fas.js +0 -144
- package/lib/layout/dagre/src/greedy-fas.js.map +0 -1
- package/lib/layout/dagre/src/layout.d.ts +0 -3
- package/lib/layout/dagre/src/layout.js +0 -535
- package/lib/layout/dagre/src/layout.js.map +0 -1
- package/lib/layout/dagre/src/nesting-graph.d.ts +0 -6
- package/lib/layout/dagre/src/nesting-graph.js +0 -119
- package/lib/layout/dagre/src/nesting-graph.js.map +0 -1
- package/lib/layout/dagre/src/normalize.d.ts +0 -6
- package/lib/layout/dagre/src/normalize.js +0 -91
- package/lib/layout/dagre/src/normalize.js.map +0 -1
- package/lib/layout/dagre/src/order/add-subgraph-constraints.d.ts +0 -3
- package/lib/layout/dagre/src/order/add-subgraph-constraints.js +0 -29
- package/lib/layout/dagre/src/order/add-subgraph-constraints.js.map +0 -1
- package/lib/layout/dagre/src/order/barycenter.d.ts +0 -11
- package/lib/layout/dagre/src/order/barycenter.js +0 -26
- package/lib/layout/dagre/src/order/barycenter.js.map +0 -1
- package/lib/layout/dagre/src/order/build-layer-graph.d.ts +0 -3
- package/lib/layout/dagre/src/order/build-layer-graph.js +0 -73
- package/lib/layout/dagre/src/order/build-layer-graph.js.map +0 -1
- package/lib/layout/dagre/src/order/cross-count.d.ts +0 -3
- package/lib/layout/dagre/src/order/cross-count.js +0 -67
- package/lib/layout/dagre/src/order/cross-count.js.map +0 -1
- package/lib/layout/dagre/src/order/index.d.ts +0 -3
- package/lib/layout/dagre/src/order/index.js +0 -96
- package/lib/layout/dagre/src/order/index.js.map +0 -1
- package/lib/layout/dagre/src/order/init-data-order.d.ts +0 -6
- package/lib/layout/dagre/src/order/init-data-order.js +0 -27
- package/lib/layout/dagre/src/order/init-data-order.js.map +0 -1
- package/lib/layout/dagre/src/order/init-order.d.ts +0 -3
- package/lib/layout/dagre/src/order/init-order.js +0 -54
- package/lib/layout/dagre/src/order/init-order.js.map +0 -1
- package/lib/layout/dagre/src/order/resolve-conflicts.d.ts +0 -19
- package/lib/layout/dagre/src/order/resolve-conflicts.js +0 -98
- package/lib/layout/dagre/src/order/resolve-conflicts.js.map +0 -1
- package/lib/layout/dagre/src/order/sort-subgraph.d.ts +0 -7
- package/lib/layout/dagre/src/order/sort-subgraph.js +0 -90
- package/lib/layout/dagre/src/order/sort-subgraph.js.map +0 -1
- package/lib/layout/dagre/src/order/sort.d.ts +0 -7
- package/lib/layout/dagre/src/order/sort.js +0 -70
- package/lib/layout/dagre/src/order/sort.js.map +0 -1
- package/lib/layout/dagre/src/parent-dummy-chains.d.ts +0 -3
- package/lib/layout/dagre/src/parent-dummy-chains.js +0 -83
- package/lib/layout/dagre/src/parent-dummy-chains.js.map +0 -1
- package/lib/layout/dagre/src/position/bk.d.ts +0 -23
- package/lib/layout/dagre/src/position/bk.js +0 -409
- package/lib/layout/dagre/src/position/bk.js.map +0 -1
- package/lib/layout/dagre/src/position/index.d.ts +0 -3
- package/lib/layout/dagre/src/position/index.js +0 -64
- package/lib/layout/dagre/src/position/index.js.map +0 -1
- package/lib/layout/dagre/src/rank/feasible-tree.d.ts +0 -9
- package/lib/layout/dagre/src/rank/feasible-tree.js +0 -152
- package/lib/layout/dagre/src/rank/feasible-tree.js.map +0 -1
- package/lib/layout/dagre/src/rank/index.d.ts +0 -3
- package/lib/layout/dagre/src/rank/index.js +0 -58
- package/lib/layout/dagre/src/rank/index.js.map +0 -1
- package/lib/layout/dagre/src/rank/network-simplex.d.ts +0 -9
- package/lib/layout/dagre/src/rank/network-simplex.js +0 -205
- package/lib/layout/dagre/src/rank/network-simplex.js.map +0 -1
- package/lib/layout/dagre/src/rank/util.d.ts +0 -11
- package/lib/layout/dagre/src/rank/util.js +0 -146
- package/lib/layout/dagre/src/rank/util.js.map +0 -1
- package/lib/layout/dagre/src/util.d.ts +0 -31
- package/lib/layout/dagre/src/util.js +0 -280
- package/lib/layout/dagre/src/util.js.map +0 -1
- package/lib/layout/dagre.d.ts +0 -71
- package/lib/layout/dagre.js +0 -462
- package/lib/layout/dagre.js.map +0 -1
- package/lib/layout/dagreCompound.d.ts +0 -121
- package/lib/layout/dagreCompound.js +0 -429
- package/lib/layout/dagreCompound.js.map +0 -1
- package/lib/layout/er/core.d.ts +0 -1
- package/lib/layout/er/core.js +0 -147
- package/lib/layout/er/core.js.map +0 -1
- package/lib/layout/er/forceGrid.d.ts +0 -8
- package/lib/layout/er/forceGrid.js +0 -97
- package/lib/layout/er/forceGrid.js.map +0 -1
- package/lib/layout/er/grid.d.ts +0 -26
- package/lib/layout/er/grid.js +0 -177
- package/lib/layout/er/grid.js.map +0 -1
- package/lib/layout/er/index.d.ts +0 -29
- package/lib/layout/er/index.js +0 -80
- package/lib/layout/er/index.js.map +0 -1
- package/lib/layout/er/mysqlWorkbench.d.ts +0 -6
- package/lib/layout/er/mysqlWorkbench.js +0 -326
- package/lib/layout/er/mysqlWorkbench.js.map +0 -1
- package/lib/layout/er/type.d.ts +0 -35
- package/lib/layout/er/type.js +0 -3
- package/lib/layout/er/type.js.map +0 -1
- package/lib/layout/force/force-in-a-box.d.ts +0 -28
- package/lib/layout/force/force-in-a-box.js +0 -357
- package/lib/layout/force/force-in-a-box.js.map +0 -1
- package/lib/layout/force/force.d.ts +0 -100
- package/lib/layout/force/force.js +0 -388
- package/lib/layout/force/force.js.map +0 -1
- package/lib/layout/force/index.d.ts +0 -1
- package/lib/layout/force/index.js +0 -18
- package/lib/layout/force/index.js.map +0 -1
- package/lib/layout/force2/ForceNBody.d.ts +0 -7
- package/lib/layout/force2/ForceNBody.js +0 -98
- package/lib/layout/force2/ForceNBody.js.map +0 -1
- package/lib/layout/force2/index.d.ts +0 -119
- package/lib/layout/force2/index.js +0 -643
- package/lib/layout/force2/index.js.map +0 -1
- package/lib/layout/forceAtlas2/body.d.ts +0 -33
- package/lib/layout/forceAtlas2/body.js +0 -93
- package/lib/layout/forceAtlas2/body.js.map +0 -1
- package/lib/layout/forceAtlas2/index.d.ts +0 -115
- package/lib/layout/forceAtlas2/index.js +0 -509
- package/lib/layout/forceAtlas2/index.js.map +0 -1
- package/lib/layout/forceAtlas2/quad.d.ts +0 -27
- package/lib/layout/forceAtlas2/quad.js +0 -100
- package/lib/layout/forceAtlas2/quad.js.map +0 -1
- package/lib/layout/forceAtlas2/quadTree.d.ts +0 -20
- package/lib/layout/forceAtlas2/quadTree.js +0 -107
- package/lib/layout/forceAtlas2/quadTree.js.map +0 -1
- package/lib/layout/fruchterman.d.ts +0 -73
- package/lib/layout/fruchterman.js +0 -320
- package/lib/layout/fruchterman.js.map +0 -1
- package/lib/layout/gForce.d.ts +0 -96
- package/lib/layout/gForce.js +0 -421
- package/lib/layout/gForce.js.map +0 -1
- package/lib/layout/gpu/fruchterman.d.ts +0 -57
- package/lib/layout/gpu/fruchterman.js +0 -361
- package/lib/layout/gpu/fruchterman.js.map +0 -1
- package/lib/layout/gpu/fruchtermanShader.d.ts +0 -4
- package/lib/layout/gpu/fruchtermanShader.js +0 -8
- package/lib/layout/gpu/fruchtermanShader.js.map +0 -1
- package/lib/layout/gpu/gForce.d.ts +0 -68
- package/lib/layout/gpu/gForce.js +0 -415
- package/lib/layout/gpu/gForce.js.map +0 -1
- package/lib/layout/gpu/gForceShader.d.ts +0 -4
- package/lib/layout/gpu/gForceShader.js +0 -8
- package/lib/layout/gpu/gForceShader.js.map +0 -1
- package/lib/layout/grid.d.ts +0 -83
- package/lib/layout/grid.js +0 -339
- package/lib/layout/grid.js.map +0 -1
- package/lib/layout/index.d.ts +0 -22
- package/lib/layout/index.js +0 -59
- package/lib/layout/index.js.map +0 -1
- package/lib/layout/layout.d.ts +0 -26
- package/lib/layout/layout.js +0 -102
- package/lib/layout/layout.js.map +0 -1
- package/lib/layout/mds.d.ts +0 -39
- package/lib/layout/mds.js +0 -144
- package/lib/layout/mds.js.map +0 -1
- package/lib/layout/radial/index.d.ts +0 -1
- package/lib/layout/radial/index.js +0 -18
- package/lib/layout/radial/index.js.map +0 -1
- package/lib/layout/radial/mds.d.ts +0 -15
- package/lib/layout/radial/mds.js +0 -42
- package/lib/layout/radial/mds.js.map +0 -1
- package/lib/layout/radial/radial.d.ts +0 -74
- package/lib/layout/radial/radial.js +0 -445
- package/lib/layout/radial/radial.js.map +0 -1
- package/lib/layout/radial/radialNonoverlapForce.d.ts +0 -50
- package/lib/layout/radial/radialNonoverlapForce.js +0 -127
- package/lib/layout/radial/radialNonoverlapForce.js.map +0 -1
- package/lib/layout/random.d.ts +0 -35
- package/lib/layout/random.js +0 -84
- package/lib/layout/random.js.map +0 -1
- package/lib/layout/types.d.ts +0 -432
- package/lib/layout/types.js +0 -3
- package/lib/layout/types.js.map +0 -1
- package/lib/registy/index.d.ts +0 -3
- package/lib/registy/index.js +0 -65
- package/lib/registy/index.js.map +0 -1
- package/lib/util/array.js +0 -5
- package/lib/util/array.js.map +0 -1
- package/lib/util/function.js +0 -65
- package/lib/util/function.js.map +0 -1
- package/lib/util/gpu.js +0 -250
- package/lib/util/gpu.js.map +0 -1
- package/lib/util/index.js +0 -23
- package/lib/util/index.js.map +0 -1
- package/lib/util/math.js +0 -266
- package/lib/util/math.js.map +0 -1
- package/lib/util/number.js +0 -13
- package/lib/util/number.js.map +0 -1
- package/lib/util/object.js +0 -43
- package/lib/util/object.js.map +0 -1
- package/lib/util/string.js +0 -20
- package/lib/util/string.js.map +0 -1
- package/src/index.ts +0 -7
- package/src/layout/base.ts +0 -57
- package/src/layout/circular.ts +0 -370
- package/src/layout/comboCombined.ts +0 -391
- package/src/layout/comboForce.ts +0 -873
- package/src/layout/concentric.ts +0 -289
- package/src/layout/constants.ts +0 -22
- package/src/layout/dagre/graph.ts +0 -104
- package/src/layout/dagre/index.ts +0 -31
- package/src/layout/dagre/src/acyclic.ts +0 -58
- package/src/layout/dagre/src/add-border-segments.ts +0 -47
- package/src/layout/dagre/src/coordinate-system.ts +0 -77
- package/src/layout/dagre/src/data/list.ts +0 -60
- package/src/layout/dagre/src/debug.ts +0 -30
- package/src/layout/dagre/src/greedy-fas.ts +0 -144
- package/src/layout/dagre/src/layout.ts +0 -579
- package/src/layout/dagre/src/nesting-graph.ts +0 -143
- package/src/layout/dagre/src/normalize.ts +0 -96
- package/src/layout/dagre/src/order/add-subgraph-constraints.ts +0 -29
- package/src/layout/dagre/src/order/barycenter.ts +0 -26
- package/src/layout/dagre/src/order/build-layer-graph.ts +0 -82
- package/src/layout/dagre/src/order/cross-count.ts +0 -77
- package/src/layout/dagre/src/order/index.ts +0 -105
- package/src/layout/dagre/src/order/init-data-order.ts +0 -27
- package/src/layout/dagre/src/order/init-order.ts +0 -56
- package/src/layout/dagre/src/order/resolve-conflicts.ts +0 -152
- package/src/layout/dagre/src/order/sort-subgraph.ts +0 -105
- package/src/layout/dagre/src/order/sort.ts +0 -76
- package/src/layout/dagre/src/parent-dummy-chains.ts +0 -102
- package/src/layout/dagre/src/position/bk.ts +0 -493
- package/src/layout/dagre/src/position/index.ts +0 -82
- package/src/layout/dagre/src/rank/feasible-tree.ts +0 -165
- package/src/layout/dagre/src/rank/index.ts +0 -54
- package/src/layout/dagre/src/rank/network-simplex.ts +0 -225
- package/src/layout/dagre/src/rank/util.ts +0 -166
- package/src/layout/dagre/src/util.ts +0 -309
- package/src/layout/dagre.ts +0 -460
- package/src/layout/dagreCompound.ts +0 -518
- package/src/layout/er/core.ts +0 -117
- package/src/layout/er/forceGrid.ts +0 -95
- package/src/layout/er/grid.ts +0 -185
- package/src/layout/er/index.ts +0 -68
- package/src/layout/er/mysqlWorkbench.ts +0 -345
- package/src/layout/er/type.ts +0 -39
- package/src/layout/force/force-in-a-box.ts +0 -400
- package/src/layout/force/force.ts +0 -391
- package/src/layout/force/index.ts +0 -1
- package/src/layout/force2/ForceNBody.ts +0 -128
- package/src/layout/force2/index.ts +0 -741
- package/src/layout/forceAtlas2/body.ts +0 -115
- package/src/layout/forceAtlas2/index.ts +0 -556
- package/src/layout/forceAtlas2/quad.ts +0 -115
- package/src/layout/forceAtlas2/quadTree.ts +0 -107
- package/src/layout/fruchterman.ts +0 -361
- package/src/layout/gForce.ts +0 -488
- package/src/layout/gpu/fruchterman.ts +0 -314
- package/src/layout/gpu/fruchtermanShader.ts +0 -203
- package/src/layout/gpu/gForce.ts +0 -407
- package/src/layout/gpu/gForceShader.ts +0 -220
- package/src/layout/grid.ts +0 -404
- package/src/layout/index.ts +0 -47
- package/src/layout/layout.ts +0 -110
- package/src/layout/mds.ts +0 -140
- package/src/layout/radial/index.ts +0 -1
- package/src/layout/radial/mds.ts +0 -51
- package/src/layout/radial/radial.ts +0 -500
- package/src/layout/radial/radialNonoverlapForce.ts +0 -189
- package/src/layout/random.ts +0 -75
- package/src/layout/types.ts +0 -496
- package/src/registy/index.ts +0 -43
- package/src/util/array.ts +0 -1
- package/src/util/function.ts +0 -64
- package/src/util/gpu.ts +0 -256
- package/src/util/index.ts +0 -6
- package/src/util/math.ts +0 -272
- package/src/util/number.ts +0 -8
- package/src/util/object.ts +0 -28
- package/src/util/string.ts +0 -18
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { Graph } from "@antv/graphlib";
|
|
2
|
+
import type { CircularLayoutOptions, SyncLayout, LayoutMapping, PointTuple, OutNode } from "./types";
|
|
3
|
+
type INodeData = OutNode & {
|
|
4
|
+
degree: number;
|
|
5
|
+
size: number | PointTuple;
|
|
6
|
+
weight: number;
|
|
7
|
+
children: string[];
|
|
8
|
+
parent: string[];
|
|
9
|
+
};
|
|
10
|
+
type IEdgeData = {};
|
|
11
|
+
/**
|
|
12
|
+
* Layout arranging the nodes in a circle.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* // Assign layout options when initialization.
|
|
16
|
+
* const layout = new CircularLayout({ radius: 10 });
|
|
17
|
+
* const positions = layout.execute(graph); // { nodes: [], edges: [] }
|
|
18
|
+
*
|
|
19
|
+
* // Or use different options later.
|
|
20
|
+
* const layout = new CircularLayout({ radius: 10 });
|
|
21
|
+
* const positions = layout.execute(graph, { radius: 20 }); // { nodes: [], edges: [] }
|
|
22
|
+
*
|
|
23
|
+
* // If you want to assign the positions directly to the nodes, use assign method.
|
|
24
|
+
* layout.assign(graph, { radius: 20 });
|
|
25
|
+
*/
|
|
26
|
+
export declare class CircularLayout implements SyncLayout<CircularLayoutOptions> {
|
|
27
|
+
options: CircularLayoutOptions;
|
|
28
|
+
id: string;
|
|
29
|
+
constructor(options?: CircularLayoutOptions);
|
|
30
|
+
/**
|
|
31
|
+
* Return the positions of nodes and edges(if needed).
|
|
32
|
+
*/
|
|
33
|
+
execute(graph: Graph<INodeData, IEdgeData>, options?: CircularLayoutOptions): LayoutMapping;
|
|
34
|
+
/**
|
|
35
|
+
* To directly assign the positions to the nodes.
|
|
36
|
+
*/
|
|
37
|
+
assign(graph: Graph<INodeData, IEdgeData>, options?: CircularLayoutOptions): void;
|
|
38
|
+
private genericCircularLayout;
|
|
39
|
+
}
|
|
40
|
+
export {};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import EventEmitter from 'eventemitter3';
|
|
2
|
+
import { Graph, Node, Edge } from "@antv/graphlib";
|
|
3
|
+
import type { SyncLayout } from "./types";
|
|
4
|
+
/**
|
|
5
|
+
* The payload transferred from main thread to the worker.
|
|
6
|
+
*/
|
|
7
|
+
export interface Payload {
|
|
8
|
+
layout: {
|
|
9
|
+
id: string;
|
|
10
|
+
options: any;
|
|
11
|
+
};
|
|
12
|
+
nodes: Node<any>[];
|
|
13
|
+
edges: Edge<any>[];
|
|
14
|
+
}
|
|
15
|
+
export declare const SupervisorEvent: {
|
|
16
|
+
/**
|
|
17
|
+
* Get triggerred when each iteration finished.
|
|
18
|
+
*/
|
|
19
|
+
LAYOUT_ITERATION: string;
|
|
20
|
+
/**
|
|
21
|
+
* Get triggerred when layout calculation is done.
|
|
22
|
+
*/
|
|
23
|
+
LAYOUT_END: string;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* @example
|
|
27
|
+
* const graph = new Graph();
|
|
28
|
+
* const layout = new CircularLayout();
|
|
29
|
+
*
|
|
30
|
+
* const supervisor = new Supervisor(graph, layout, { auto: true });
|
|
31
|
+
* supervisor.start();
|
|
32
|
+
* supervisor.stop();
|
|
33
|
+
* supervisor.kill();
|
|
34
|
+
*
|
|
35
|
+
* // lifecycle
|
|
36
|
+
* supervisor.on('tick', () => {
|
|
37
|
+
* });
|
|
38
|
+
* supervisor.on('layoutend', () => {
|
|
39
|
+
* });
|
|
40
|
+
*
|
|
41
|
+
* // Re-layout when graph changed.
|
|
42
|
+
* graph.addNodes([{ id: 'node1' }, { id: 'node2' }]);
|
|
43
|
+
*
|
|
44
|
+
* // TODO: Custom layout.
|
|
45
|
+
*/
|
|
46
|
+
export declare class Supervisor extends EventEmitter {
|
|
47
|
+
private graph;
|
|
48
|
+
private layout;
|
|
49
|
+
/**
|
|
50
|
+
* Internal worker.
|
|
51
|
+
*/
|
|
52
|
+
private worker;
|
|
53
|
+
/**
|
|
54
|
+
* Flag of running state.
|
|
55
|
+
*/
|
|
56
|
+
private running;
|
|
57
|
+
constructor(graph: Graph<any, any>, layout: SyncLayout<any>, options: {
|
|
58
|
+
auto: boolean;
|
|
59
|
+
});
|
|
60
|
+
spawnWorker(): void;
|
|
61
|
+
start(): this;
|
|
62
|
+
stop(): this;
|
|
63
|
+
kill(): void;
|
|
64
|
+
isRunning(): boolean;
|
|
65
|
+
}
|
package/lib/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
export * from "./
|
|
1
|
+
export * from "./circular";
|
|
2
|
+
export * from "./supervisor";
|
|
3
|
+
export * from "./registry";
|
package/lib/types.d.ts
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import type { Graph, PlainObject } from "@antv/graphlib";
|
|
2
|
+
export interface Node extends PlainObject {
|
|
3
|
+
id: string;
|
|
4
|
+
}
|
|
5
|
+
export interface OutNode extends Node {
|
|
6
|
+
x: number;
|
|
7
|
+
y: number;
|
|
8
|
+
fx?: number;
|
|
9
|
+
fy?: number;
|
|
10
|
+
comboId?: string;
|
|
11
|
+
layer?: number;
|
|
12
|
+
_order?: number;
|
|
13
|
+
layout?: boolean;
|
|
14
|
+
size?: number | number[] | undefined;
|
|
15
|
+
}
|
|
16
|
+
export interface Edge {
|
|
17
|
+
source: string;
|
|
18
|
+
target: string;
|
|
19
|
+
}
|
|
20
|
+
export interface Combo {
|
|
21
|
+
id: string;
|
|
22
|
+
parentId?: string;
|
|
23
|
+
x?: number;
|
|
24
|
+
y?: number;
|
|
25
|
+
name?: string | number;
|
|
26
|
+
cx?: number;
|
|
27
|
+
cy?: number;
|
|
28
|
+
count?: number;
|
|
29
|
+
depth?: number;
|
|
30
|
+
children?: any[];
|
|
31
|
+
empty?: boolean;
|
|
32
|
+
minX?: number;
|
|
33
|
+
maxX?: number;
|
|
34
|
+
minY?: number;
|
|
35
|
+
maxY?: number;
|
|
36
|
+
size?: number;
|
|
37
|
+
r?: number;
|
|
38
|
+
itemType?: string;
|
|
39
|
+
collapsed?: boolean;
|
|
40
|
+
}
|
|
41
|
+
export interface Model {
|
|
42
|
+
nodes?: Node[];
|
|
43
|
+
edges?: Edge[];
|
|
44
|
+
combos?: Combo[];
|
|
45
|
+
comboEdges?: Edge[];
|
|
46
|
+
hiddenNodes?: Node[];
|
|
47
|
+
hiddenEdges?: Edge[];
|
|
48
|
+
hiddenCombos?: Combo[];
|
|
49
|
+
vedges?: Edge[];
|
|
50
|
+
}
|
|
51
|
+
export interface OutModel extends Model {
|
|
52
|
+
nodes?: OutNode[];
|
|
53
|
+
}
|
|
54
|
+
export interface Size {
|
|
55
|
+
width: number;
|
|
56
|
+
height: number;
|
|
57
|
+
}
|
|
58
|
+
export type IndexMap = {
|
|
59
|
+
[key: string]: number;
|
|
60
|
+
};
|
|
61
|
+
export type INode = OutNode & {
|
|
62
|
+
degree: number;
|
|
63
|
+
size: number | PointTuple;
|
|
64
|
+
};
|
|
65
|
+
export type NodeMap = {
|
|
66
|
+
[key: string]: INode;
|
|
67
|
+
};
|
|
68
|
+
export type Matrix = number[];
|
|
69
|
+
export type Point = {
|
|
70
|
+
x: number;
|
|
71
|
+
y: number;
|
|
72
|
+
};
|
|
73
|
+
export type Degree = {
|
|
74
|
+
in: number;
|
|
75
|
+
out: number;
|
|
76
|
+
all: number;
|
|
77
|
+
};
|
|
78
|
+
export interface ComboTree {
|
|
79
|
+
id: string;
|
|
80
|
+
children?: ComboTree[];
|
|
81
|
+
depth?: number;
|
|
82
|
+
parentId?: string;
|
|
83
|
+
itemType?: "node" | "combo";
|
|
84
|
+
[key: string]: unknown;
|
|
85
|
+
}
|
|
86
|
+
export interface ComboConfig {
|
|
87
|
+
id: string;
|
|
88
|
+
parentId?: string;
|
|
89
|
+
children?: ComboTree[];
|
|
90
|
+
depth?: number;
|
|
91
|
+
}
|
|
92
|
+
export type PointTuple = [number, number];
|
|
93
|
+
export type LayoutMapping = {
|
|
94
|
+
nodes: OutNode[];
|
|
95
|
+
edges: Edge[];
|
|
96
|
+
};
|
|
97
|
+
export interface SyncLayout<LayoutOptions> {
|
|
98
|
+
assign(graph: Graph<any, any>, options?: LayoutOptions): void;
|
|
99
|
+
execute(graph: Graph<any, any>, options?: LayoutOptions): LayoutMapping;
|
|
100
|
+
options: LayoutOptions;
|
|
101
|
+
id: string;
|
|
102
|
+
}
|
|
103
|
+
export interface SyncLayoutConstructor<LayoutOptions> {
|
|
104
|
+
new (options?: LayoutOptions): SyncLayout<LayoutOptions>;
|
|
105
|
+
}
|
|
106
|
+
export interface LayoutSupervisor {
|
|
107
|
+
start(): void;
|
|
108
|
+
stop(): void;
|
|
109
|
+
kill(): void;
|
|
110
|
+
}
|
|
111
|
+
export interface CircularLayoutOptions {
|
|
112
|
+
center?: PointTuple;
|
|
113
|
+
width?: number;
|
|
114
|
+
height?: number;
|
|
115
|
+
radius?: number | null;
|
|
116
|
+
startRadius?: number | null;
|
|
117
|
+
endRadius?: number | null;
|
|
118
|
+
clockwise?: boolean;
|
|
119
|
+
divisions?: number;
|
|
120
|
+
ordering?: "topology" | "topology-directed" | "degree" | null;
|
|
121
|
+
angleRatio?: number;
|
|
122
|
+
workerEnabled?: boolean;
|
|
123
|
+
startAngle?: number;
|
|
124
|
+
endAngle?: number;
|
|
125
|
+
nodeSpacing?: ((d?: unknown) => number) | number;
|
|
126
|
+
nodeSize?: number;
|
|
127
|
+
onLayoutEnd?: () => void;
|
|
128
|
+
}
|
package/lib/util/gpu.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OutNode, Edge } from
|
|
1
|
+
import { OutNode, Edge } from "../types";
|
|
2
2
|
/**
|
|
3
3
|
* 将 number | Function 类型的参数转换为 return number 的 Function
|
|
4
4
|
* @param {number | Function} value 需要被转换的值
|
|
@@ -17,36 +17,36 @@ export declare const buildTextureData: (nodes: OutNode[], edges: Edge[]) => {
|
|
|
17
17
|
maxEdgePerVetex: number;
|
|
18
18
|
};
|
|
19
19
|
/**
|
|
20
|
-
* 将节点和边数据转换为 GPU 可读的数组,每条边带有一个属性。并返回 maxEdgePerVetex,每个节点上最多的边数
|
|
21
|
-
* @param {NodeConfig[]} nodes 节点数组
|
|
22
|
-
* @param {EdgeConfig[]} edges 边数组
|
|
23
|
-
* @param {Function} attrs 读取边属性的函数
|
|
24
|
-
* @return {Object} 转换后的数组及 maxEdgePerVetex 组成的对象
|
|
25
|
-
*/
|
|
20
|
+
* 将节点和边数据转换为 GPU 可读的数组,每条边带有一个属性。并返回 maxEdgePerVetex,每个节点上最多的边数
|
|
21
|
+
* @param {NodeConfig[]} nodes 节点数组
|
|
22
|
+
* @param {EdgeConfig[]} edges 边数组
|
|
23
|
+
* @param {Function} attrs 读取边属性的函数
|
|
24
|
+
* @return {Object} 转换后的数组及 maxEdgePerVetex 组成的对象
|
|
25
|
+
*/
|
|
26
26
|
/**
|
|
27
|
-
* 将节点和边数据转换为 GPU 可读的数组,每条边带有一个以上属性。并返回 maxEdgePerVetex,每个节点上最多的边数
|
|
28
|
-
* @param {NodeConfig[]} nodes 节点数组
|
|
29
|
-
* @param {EdgeConfig[]} edges 边数组
|
|
30
|
-
* @param {Function} attrs 读取边属性的函数
|
|
31
|
-
* @return {Object} 转换后的数组及 maxEdgePerVetex 组成的对象
|
|
32
|
-
*/
|
|
27
|
+
* 将节点和边数据转换为 GPU 可读的数组,每条边带有一个以上属性。并返回 maxEdgePerVetex,每个节点上最多的边数
|
|
28
|
+
* @param {NodeConfig[]} nodes 节点数组
|
|
29
|
+
* @param {EdgeConfig[]} edges 边数组
|
|
30
|
+
* @param {Function} attrs 读取边属性的函数
|
|
31
|
+
* @return {Object} 转换后的数组及 maxEdgePerVetex 组成的对象
|
|
32
|
+
*/
|
|
33
33
|
export declare const buildTextureDataWithTwoEdgeAttr: (nodes: OutNode[], edges: Edge[], attrs1: Function, attrs2: Function) => {
|
|
34
34
|
array: Float32Array;
|
|
35
35
|
maxEdgePerVetex: number;
|
|
36
36
|
};
|
|
37
37
|
/**
|
|
38
|
-
* transform the extended attributes of nodes or edges to a texture array
|
|
39
|
-
* @param {string[]} attributeNames attributes' name to be read from items and put into output array
|
|
40
|
-
* @param {ModelConfig[]} items the items to be read
|
|
41
|
-
* @return {Float32Array} the attributes' value array to be read by GPU
|
|
42
|
-
*/
|
|
38
|
+
* transform the extended attributes of nodes or edges to a texture array
|
|
39
|
+
* @param {string[]} attributeNames attributes' name to be read from items and put into output array
|
|
40
|
+
* @param {ModelConfig[]} items the items to be read
|
|
41
|
+
* @return {Float32Array} the attributes' value array to be read by GPU
|
|
42
|
+
*/
|
|
43
43
|
export declare const attributesToTextureData: (attributeNames: string[], items: any[]) => {
|
|
44
44
|
array: Float32Array;
|
|
45
45
|
count: number;
|
|
46
46
|
};
|
|
47
47
|
/**
|
|
48
|
-
* transform the number array format of extended attributes of nodes or edges to a texture array
|
|
49
|
-
* @param {string[]} attributeNames attributes' name to be read from items and put into output array
|
|
50
|
-
* @return {Float32Array} the attributes' value array to be read by GPU
|
|
51
|
-
*/
|
|
48
|
+
* transform the number array format of extended attributes of nodes or edges to a texture array
|
|
49
|
+
* @param {string[]} attributeNames attributes' name to be read from items and put into output array
|
|
50
|
+
* @return {Float32Array} the attributes' value array to be read by GPU
|
|
51
|
+
*/
|
|
52
52
|
export declare const arrayToTextureData: (valueArrays: number[][]) => Float32Array;
|
package/lib/util/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
1
|
+
export * from "./string";
|
|
2
|
+
export * from "./array";
|
|
3
|
+
export * from "./number";
|
|
4
|
+
export * from "./math";
|
|
5
|
+
export * from "./object";
|
|
6
|
+
export * from "./function";
|
package/lib/util/math.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Matrix, Model, IndexMap, Edge, Node, OutNode, Degree, NodeMap } from
|
|
2
|
-
export declare const getEdgeTerminal: (edge: Edge, type:
|
|
1
|
+
import { Matrix, Model, IndexMap, Edge, Node, OutNode, Degree, NodeMap } from "../types";
|
|
2
|
+
export declare const getEdgeTerminal: (edge: Edge, type: "source" | "target") => any;
|
|
3
3
|
export declare const getDegree: (n: number, nodeIdxMap: IndexMap, edges: Edge[] | null) => Degree[];
|
|
4
4
|
export declare const getDegreeMap: (nodes: Node[], edges: Edge[] | null) => {
|
|
5
5
|
[id: string]: Degree;
|
|
@@ -19,7 +19,12 @@ export declare const scaleMatrix: (matrix: Matrix[], ratio: number) => Matrix[];
|
|
|
19
19
|
export declare const traverseTreeUp: <T extends {
|
|
20
20
|
children?: T[] | undefined;
|
|
21
21
|
}>(data: T, fn: (param: T) => boolean) => void;
|
|
22
|
-
|
|
22
|
+
/**
|
|
23
|
+
* calculate the bounding box for the nodes according to their x, y, and size
|
|
24
|
+
* @param nodes nodes in the layout
|
|
25
|
+
* @returns
|
|
26
|
+
*/
|
|
27
|
+
export declare const getLayoutBBox: (nodes: OutNode[]) => {
|
|
23
28
|
minX: number;
|
|
24
29
|
minY: number;
|
|
25
30
|
maxX: number;
|
|
@@ -34,7 +39,7 @@ export declare const getAvgNodePosition: (nodes: OutNode[]) => {
|
|
|
34
39
|
x: number;
|
|
35
40
|
y: number;
|
|
36
41
|
};
|
|
37
|
-
export declare const getCoreNodeAndRelativeLeafNodes: (type:
|
|
42
|
+
export declare const getCoreNodeAndRelativeLeafNodes: (type: "leaf" | "all", node: Node, edges: Edge[], nodeClusterBy: string, degreesMap: {
|
|
38
43
|
[id: string]: Degree;
|
|
39
44
|
}, nodeMap: NodeMap) => {
|
|
40
45
|
coreNode: Node;
|
package/lib/worker.d.ts
ADDED
package/package.json
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antv/layout",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0-alpha.0",
|
|
4
4
|
"description": "graph layout algorithm",
|
|
5
|
-
"main": "
|
|
6
|
-
"module": "
|
|
5
|
+
"main": "dist/index.min.js",
|
|
6
|
+
"module": "dist/index.min.js",
|
|
7
7
|
"types": "lib/index.d.ts",
|
|
8
|
-
"unpkg": "dist/
|
|
8
|
+
"unpkg": "dist/index.min.js",
|
|
9
9
|
"files": [
|
|
10
|
-
"
|
|
11
|
-
"
|
|
10
|
+
"package.json",
|
|
11
|
+
"dist",
|
|
12
12
|
"lib",
|
|
13
|
-
"
|
|
13
|
+
"LICENSE",
|
|
14
|
+
"README.md"
|
|
14
15
|
],
|
|
15
16
|
"keywords": [
|
|
16
17
|
"graph",
|
|
@@ -18,98 +19,23 @@
|
|
|
18
19
|
"algorithm",
|
|
19
20
|
"antv"
|
|
20
21
|
],
|
|
21
|
-
"scripts": {
|
|
22
|
-
"clean": "rimraf es lib dist",
|
|
23
|
-
"lint:es": "eslint --ext .js --fix",
|
|
24
|
-
"lint:ts": "tslint -c tslint.json -p tsconfig.json --fix",
|
|
25
|
-
"lint": "npm run lint:ts && npm run lint:es",
|
|
26
|
-
"build:esm": "tsc --module esnext --target es2015 --outDir ./es",
|
|
27
|
-
"build:cjs": "tsc --module commonjs --target es5 --outDir ./lib",
|
|
28
|
-
"build:umd": "webpack --config webpack.config.js --mode production",
|
|
29
|
-
"build": "npm run clean && npm run build:cjs && npm run build:esm && npm run build:umd",
|
|
30
|
-
"build:watch": "npm build:esm --w",
|
|
31
|
-
"precommit": "lint-staged",
|
|
32
|
-
"release": "release-it",
|
|
33
|
-
"test": "jest",
|
|
34
|
-
"coverage": "jest --coverage",
|
|
35
|
-
"test-live": "DEBUG_MODE=1 jest --watch __tests__/g6/dagre-g6-test.ts"
|
|
36
|
-
},
|
|
37
|
-
"lint-staged": {
|
|
38
|
-
"*.js": [
|
|
39
|
-
"eslint --fix"
|
|
40
|
-
],
|
|
41
|
-
"src/**/*.ts": [
|
|
42
|
-
"tslint -c tslint.json -p ./tsconfig.json --fix"
|
|
43
|
-
]
|
|
44
|
-
},
|
|
45
22
|
"dependencies": {
|
|
46
|
-
"@antv/
|
|
47
|
-
"@
|
|
48
|
-
"
|
|
49
|
-
"d3-quadtree": "^2.0.0",
|
|
50
|
-
"dagre-compound": "^0.0.11",
|
|
51
|
-
"ml-matrix": "^6.5.0"
|
|
23
|
+
"@antv/graphlib": "^2.0.0-alpha.0",
|
|
24
|
+
"@naoak/workerize-transferable": "^0.1.0",
|
|
25
|
+
"eventemitter3": "^4.0.0"
|
|
52
26
|
},
|
|
53
27
|
"devDependencies": {
|
|
54
|
-
"@
|
|
55
|
-
"@
|
|
56
|
-
"@babel/
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"@babel/preset-typescript": "*",
|
|
60
|
-
"@types/d3-force": "^2.1.0",
|
|
61
|
-
"@types/graphlib": "^2.1.8",
|
|
62
|
-
"@types/jest": "^25.2.1",
|
|
63
|
-
"@types/d3-quadtree": "^2.0.0",
|
|
64
|
-
"babel-jest": "28.1.3",
|
|
65
|
-
"babel-loader": "^8.2.2",
|
|
66
|
-
"eslint": "^7.11.0",
|
|
67
|
-
"eslint-config-airbnb-base": "^14.0.0",
|
|
68
|
-
"eslint-config-prettier": "^6.7.0",
|
|
69
|
-
"eslint-plugin-import": "^2.18.2",
|
|
70
|
-
"jest": "^26.0.1",
|
|
71
|
-
"jest-electron": "^0.1.7",
|
|
72
|
-
"jest-extended": "^0.11.2",
|
|
73
|
-
"lint-staged": "^10.2.2",
|
|
74
|
-
"release-it": "^14.0.1",
|
|
75
|
-
"rimraf": "^3.0.0",
|
|
76
|
-
"ts-jest": "^24.1.0",
|
|
77
|
-
"ts-loader": "^8.0.17",
|
|
78
|
-
"tslint": "^6.1.3",
|
|
79
|
-
"tslint-config-airbnb": "^5.11.2",
|
|
80
|
-
"tslint-config-prettier": "^1.18.0",
|
|
81
|
-
"tslint-eslint-rules": "^5.4.0",
|
|
28
|
+
"@babel/core": "^7.7.7",
|
|
29
|
+
"@babel/plugin-proposal-class-properties": "^7.1.0",
|
|
30
|
+
"@babel/preset-react": "^7.7.4",
|
|
31
|
+
"babel-loader": "^8.0.6",
|
|
32
|
+
"ts-loader": "^7.0.3",
|
|
82
33
|
"typescript": "^4.0.3",
|
|
83
|
-
"webpack": "^5.
|
|
84
|
-
"webpack-
|
|
85
|
-
"
|
|
86
|
-
"webpack-dev-server": "^3.11.2"
|
|
87
|
-
},
|
|
88
|
-
"release-it": {
|
|
89
|
-
"git": {
|
|
90
|
-
"commitMessage": ":sparkles: Release ${version}"
|
|
91
|
-
},
|
|
92
|
-
"github": {
|
|
93
|
-
"release": true
|
|
94
|
-
},
|
|
95
|
-
"hooks": {
|
|
96
|
-
"before:init": [
|
|
97
|
-
"yarn run build"
|
|
98
|
-
]
|
|
99
|
-
}
|
|
34
|
+
"webpack": "^5.38.1",
|
|
35
|
+
"webpack-cli": "^4.7.2",
|
|
36
|
+
"workerize-loader": "^2.0.2"
|
|
100
37
|
},
|
|
101
|
-
"
|
|
102
|
-
|
|
103
|
-
"homepage": "https://github.com/antvis/layout",
|
|
104
|
-
"bugs": {
|
|
105
|
-
"url": "https://github.com/antvis/layout/issues"
|
|
106
|
-
},
|
|
107
|
-
"repository": {
|
|
108
|
-
"type": "git",
|
|
109
|
-
"url": "https://github.com/antvis/layout.git"
|
|
110
|
-
},
|
|
111
|
-
"publishConfig": {
|
|
112
|
-
"access": "public",
|
|
113
|
-
"registry": "https://registry.npmjs.org"
|
|
38
|
+
"scripts": {
|
|
39
|
+
"build:umd": "webpack --config webpack.config.js --mode production"
|
|
114
40
|
}
|
|
115
41
|
}
|