@antv/layout 2.0.0 → 2.0.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.
- package/dist/index.js +135 -196
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist/worker.js +1 -1
- package/dist/worker.js.map +1 -1
- package/esm/algorithm/antv-dagre/acyclic.js +40 -0
- package/esm/algorithm/antv-dagre/acyclic.js.map +1 -0
- package/esm/algorithm/antv-dagre/add-border-segments.js +42 -0
- package/esm/algorithm/antv-dagre/add-border-segments.js.map +1 -0
- package/esm/algorithm/antv-dagre/coordinate-system.js +66 -0
- package/esm/algorithm/antv-dagre/coordinate-system.js.map +1 -0
- package/esm/algorithm/antv-dagre/data/list.js +50 -0
- package/esm/algorithm/antv-dagre/data/list.js.map +1 -0
- package/esm/algorithm/antv-dagre/graph.js +429 -0
- package/esm/algorithm/antv-dagre/graph.js.map +1 -0
- package/esm/algorithm/antv-dagre/greedy-fas.js +139 -0
- package/esm/algorithm/antv-dagre/greedy-fas.js.map +1 -0
- package/esm/algorithm/antv-dagre/index.js +340 -0
- package/esm/algorithm/antv-dagre/index.js.map +1 -0
- package/esm/algorithm/antv-dagre/layout.js +471 -0
- package/esm/algorithm/antv-dagre/layout.js.map +1 -0
- package/esm/algorithm/antv-dagre/nesting-graph.js +154 -0
- package/esm/algorithm/antv-dagre/nesting-graph.js.map +1 -0
- package/esm/algorithm/antv-dagre/normalize.js +100 -0
- package/esm/algorithm/antv-dagre/normalize.js.map +1 -0
- package/esm/algorithm/antv-dagre/order/add-subgraph-constraints.js +47 -0
- package/esm/algorithm/antv-dagre/order/add-subgraph-constraints.js.map +1 -0
- package/esm/algorithm/antv-dagre/order/barycenter.js +25 -0
- package/esm/algorithm/antv-dagre/order/barycenter.js.map +1 -0
- package/esm/algorithm/antv-dagre/order/build-layer-graph.js +89 -0
- package/esm/algorithm/antv-dagre/order/build-layer-graph.js.map +1 -0
- package/esm/algorithm/antv-dagre/order/cross-count.js +66 -0
- package/esm/algorithm/antv-dagre/order/cross-count.js.map +1 -0
- package/esm/algorithm/antv-dagre/order/index.js +94 -0
- package/esm/algorithm/antv-dagre/order/index.js.map +1 -0
- package/esm/algorithm/antv-dagre/order/init-data-order.js +29 -0
- package/esm/algorithm/antv-dagre/order/init-data-order.js.map +1 -0
- package/esm/algorithm/antv-dagre/order/init-order.js +49 -0
- package/esm/algorithm/antv-dagre/order/init-order.js.map +1 -0
- package/esm/algorithm/antv-dagre/order/resolve-conflicts.js +119 -0
- package/esm/algorithm/antv-dagre/order/resolve-conflicts.js.map +1 -0
- package/esm/algorithm/antv-dagre/order/sort-subgraph.js +87 -0
- package/esm/algorithm/antv-dagre/order/sort-subgraph.js.map +1 -0
- package/esm/algorithm/antv-dagre/order/sort.js +77 -0
- package/esm/algorithm/antv-dagre/order/sort.js.map +1 -0
- package/esm/algorithm/antv-dagre/parent-dummy-chains.js +82 -0
- package/esm/algorithm/antv-dagre/parent-dummy-chains.js.map +1 -0
- package/esm/algorithm/antv-dagre/position/bk.js +366 -0
- package/esm/algorithm/antv-dagre/position/bk.js.map +1 -0
- package/esm/algorithm/antv-dagre/position/index.js +54 -0
- package/esm/algorithm/antv-dagre/position/index.js.map +1 -0
- package/esm/algorithm/antv-dagre/rank/feasible-tree.js +166 -0
- package/esm/algorithm/antv-dagre/rank/feasible-tree.js.map +1 -0
- package/esm/algorithm/antv-dagre/rank/index.js +51 -0
- package/esm/algorithm/antv-dagre/rank/index.js.map +1 -0
- package/esm/algorithm/antv-dagre/rank/network-simplex.js +234 -0
- package/esm/algorithm/antv-dagre/rank/network-simplex.js.map +1 -0
- package/esm/algorithm/antv-dagre/rank/util.js +139 -0
- package/esm/algorithm/antv-dagre/rank/util.js.map +1 -0
- package/esm/algorithm/antv-dagre/util.js +265 -0
- package/esm/algorithm/antv-dagre/util.js.map +1 -0
- package/esm/algorithm/base-layout.js +89 -0
- package/esm/algorithm/base-layout.js.map +1 -0
- package/esm/algorithm/base-simulation.js +75 -0
- package/esm/algorithm/base-simulation.js.map +1 -0
- package/esm/algorithm/circular/index.js +110 -0
- package/esm/algorithm/circular/index.js.map +1 -0
- package/esm/algorithm/combo-combined/index.js +306 -0
- package/esm/algorithm/combo-combined/index.js.map +1 -0
- package/esm/algorithm/concentric/index.js +187 -0
- package/esm/algorithm/concentric/index.js.map +1 -0
- package/esm/algorithm/d3-force/force-in-a-box.js +340 -0
- package/esm/algorithm/d3-force/force-in-a-box.js.map +1 -0
- package/esm/algorithm/d3-force/index.js +505 -0
- package/esm/algorithm/d3-force/index.js.map +1 -0
- package/esm/algorithm/d3-force-3d/index.js +65 -0
- package/esm/algorithm/d3-force-3d/index.js.map +1 -0
- package/esm/algorithm/dagre/index.js +143 -0
- package/esm/algorithm/dagre/index.js.map +1 -0
- package/esm/algorithm/force/attractive.js +60 -0
- package/esm/algorithm/force/attractive.js.map +1 -0
- package/esm/algorithm/force/centripetal.js +87 -0
- package/esm/algorithm/force/centripetal.js.map +1 -0
- package/esm/algorithm/force/collide.js +172 -0
- package/esm/algorithm/force/collide.js.map +1 -0
- package/esm/algorithm/force/gravity.js +50 -0
- package/esm/algorithm/force/gravity.js.map +1 -0
- package/esm/algorithm/force/index.js +462 -0
- package/esm/algorithm/force/index.js.map +1 -0
- package/esm/algorithm/force/repulsive.js +142 -0
- package/esm/algorithm/force/repulsive.js.map +1 -0
- package/esm/algorithm/force/simulation.js +137 -0
- package/esm/algorithm/force/simulation.js.map +1 -0
- package/esm/algorithm/force-atlas2/body.js +91 -0
- package/esm/algorithm/force-atlas2/body.js.map +1 -0
- package/esm/algorithm/force-atlas2/index.js +157 -0
- package/esm/algorithm/force-atlas2/index.js.map +1 -0
- package/esm/algorithm/force-atlas2/quad-tree.js +106 -0
- package/esm/algorithm/force-atlas2/quad-tree.js.map +1 -0
- package/esm/algorithm/force-atlas2/quad.js +98 -0
- package/esm/algorithm/force-atlas2/quad.js.map +1 -0
- package/esm/algorithm/force-atlas2/simulation.js +388 -0
- package/esm/algorithm/force-atlas2/simulation.js.map +1 -0
- package/esm/algorithm/fruchterman/index.js +92 -0
- package/esm/algorithm/fruchterman/index.js.map +1 -0
- package/esm/algorithm/fruchterman/simulation.js +357 -0
- package/esm/algorithm/fruchterman/simulation.js.map +1 -0
- package/esm/algorithm/grid/index.js +239 -0
- package/esm/algorithm/grid/index.js.map +1 -0
- package/esm/algorithm/mds/index.js +129 -0
- package/esm/algorithm/mds/index.js.map +1 -0
- package/esm/algorithm/radial/index.js +279 -0
- package/esm/algorithm/radial/index.js.map +1 -0
- package/esm/algorithm/radial/radial-nonoverlap-force.js +127 -0
- package/esm/algorithm/radial/radial-nonoverlap-force.js.map +1 -0
- package/esm/algorithm/random/index.js +43 -0
- package/esm/algorithm/random/index.js.map +1 -0
- package/esm/index.js +30 -0
- package/{lib/_virtual → esm}/index.js.map +1 -1
- package/esm/model/data.js +281 -0
- package/esm/model/data.js.map +1 -0
- package/esm/registry.js +32 -0
- package/esm/registry.js.map +1 -0
- package/esm/runtime/context.js +29 -0
- package/esm/runtime/context.js.map +1 -0
- package/esm/runtime/supervisor.js +89 -0
- package/esm/runtime/supervisor.js.map +1 -0
- package/esm/util/array.js +4 -0
- package/esm/util/array.js.map +1 -0
- package/esm/util/common.js +20 -0
- package/esm/util/common.js.map +1 -0
- package/esm/util/expr.js +26 -0
- package/esm/util/expr.js.map +1 -0
- package/esm/util/format.js +113 -0
- package/esm/util/format.js.map +1 -0
- package/esm/util/math.js +272 -0
- package/esm/util/math.js.map +1 -0
- package/esm/util/object.js +44 -0
- package/esm/util/object.js.map +1 -0
- package/esm/util/order.js +109 -0
- package/esm/util/order.js.map +1 -0
- package/esm/util/point.js +11 -0
- package/esm/util/point.js.map +1 -0
- package/esm/util/size.js +23 -0
- package/esm/util/size.js.map +1 -0
- package/esm/util/viewport.js +17 -0
- package/esm/util/viewport.js.map +1 -0
- package/esm/worker.js +9170 -0
- package/esm/worker.js.map +1 -0
- package/lib/algorithm/antv-dagre/acyclic.js +3 -3
- package/lib/algorithm/antv-dagre/acyclic.js.map +1 -1
- package/lib/algorithm/antv-dagre/coordinate-system.js +2 -2
- package/lib/algorithm/antv-dagre/coordinate-system.js.map +1 -1
- package/lib/algorithm/antv-dagre/index.js +7 -7
- package/lib/algorithm/antv-dagre/index.js.map +1 -1
- package/lib/algorithm/antv-dagre/layout.js +1 -1
- package/lib/algorithm/antv-dagre/nesting-graph.js +2 -2
- package/lib/algorithm/antv-dagre/nesting-graph.js.map +1 -1
- package/lib/algorithm/antv-dagre/order/index.js +1 -1
- package/lib/algorithm/antv-dagre/util.js +4 -4
- package/lib/algorithm/antv-dagre/util.js.map +1 -1
- package/lib/algorithm/base-layout.js +1 -1
- package/lib/algorithm/base-simulation.js +1 -1
- package/lib/algorithm/circular/index.js +6 -5
- package/lib/algorithm/circular/index.js.map +1 -1
- package/lib/algorithm/combo-combined/index.js +3 -2
- package/lib/algorithm/combo-combined/index.js.map +1 -1
- package/lib/algorithm/concentric/index.js +7 -6
- package/lib/algorithm/concentric/index.js.map +1 -1
- package/lib/algorithm/d3-force/force-in-a-box.js +9 -12
- package/lib/algorithm/d3-force/force-in-a-box.js.map +1 -1
- package/lib/algorithm/d3-force/index.js +18 -25
- package/lib/algorithm/d3-force/index.js.map +1 -1
- package/lib/algorithm/d3-force-3d/index.js +1 -9
- package/lib/algorithm/d3-force-3d/index.js.map +1 -1
- package/lib/algorithm/dagre/index.js +5 -7
- package/lib/algorithm/dagre/index.js.map +1 -1
- package/lib/algorithm/force/centripetal.js +1 -1
- package/lib/algorithm/force/collide.js +2 -2
- package/lib/algorithm/force/index.js +5 -5
- package/lib/algorithm/force/index.js.map +1 -1
- package/lib/algorithm/force/repulsive.js +2 -2
- package/lib/algorithm/force/simulation.js +1 -1
- package/lib/algorithm/force-atlas2/index.js +6 -5
- package/lib/algorithm/force-atlas2/index.js.map +1 -1
- package/lib/algorithm/force-atlas2/simulation.js +4 -4
- package/lib/algorithm/force-atlas2/simulation.js.map +1 -1
- package/lib/algorithm/fruchterman/index.js +5 -4
- package/lib/algorithm/fruchterman/index.js.map +1 -1
- package/lib/algorithm/fruchterman/simulation.js +4 -4
- package/lib/algorithm/fruchterman/simulation.js.map +1 -1
- package/lib/algorithm/grid/index.js +3 -2
- package/lib/algorithm/grid/index.js.map +1 -1
- package/lib/algorithm/mds/index.js +10 -9
- package/lib/algorithm/mds/index.js.map +1 -1
- package/lib/algorithm/radial/index.js +3 -2
- package/lib/algorithm/radial/index.js.map +1 -1
- package/lib/algorithm/radial/radial-nonoverlap-force.js +3 -3
- package/lib/algorithm/radial/radial-nonoverlap-force.js.map +1 -1
- package/lib/algorithm/random/index.js +3 -2
- package/lib/algorithm/random/index.js.map +1 -1
- package/lib/model/data.js +1 -1
- package/lib/runtime/supervisor.js +2 -2
- package/lib/util/expr.js +3 -3
- package/lib/util/expr.js.map +1 -1
- package/lib/util/format.js +1 -4
- package/lib/util/format.js.map +1 -1
- package/lib/util/math.js +1 -1
- package/lib/util/object.js +1 -2
- package/lib/util/object.js.map +1 -1
- package/lib/util/order.js +4 -4
- package/lib/util/order.js.map +1 -1
- package/lib/util/size.js +1 -1
- package/lib/worker.js +3002 -26176
- package/lib/worker.js.map +1 -1
- package/package.json +4 -2
- package/lib/_virtual/_cloneBuffer.js +0 -4
- package/lib/_virtual/_cloneBuffer.js.map +0 -1
- package/lib/_virtual/_commonjs-dynamic-modules.js +0 -6
- package/lib/_virtual/_commonjs-dynamic-modules.js.map +0 -1
- package/lib/_virtual/_commonjsHelpers.js +0 -37
- package/lib/_virtual/_commonjsHelpers.js.map +0 -1
- package/lib/_virtual/_nodeUtil.js +0 -4
- package/lib/_virtual/_nodeUtil.js.map +0 -1
- package/lib/_virtual/index.js +0 -8
- package/lib/_virtual/index2.js +0 -7
- package/lib/_virtual/index2.js.map +0 -1
- package/lib/_virtual/index3.js +0 -7
- package/lib/_virtual/index3.js.map +0 -1
- package/lib/_virtual/isBuffer.js +0 -4
- package/lib/_virtual/isBuffer.js.map +0 -1
- package/lib/_virtual/matrix.js +0 -8
- package/lib/_virtual/matrix.js.map +0 -1
- package/lib/_virtual/matrix2.js +0 -4
- package/lib/_virtual/matrix2.js.map +0 -1
- package/lib/node_modules/@antv/event-emitter/esm/index.js +0 -107
- package/lib/node_modules/@antv/event-emitter/esm/index.js.map +0 -1
- package/lib/node_modules/@antv/expr/dist/index.esm.js +0 -4
- package/lib/node_modules/@antv/expr/dist/index.esm.js.map +0 -1
- package/lib/node_modules/@antv/util/esm/lodash/clone.js +0 -34
- package/lib/node_modules/@antv/util/esm/lodash/clone.js.map +0 -1
- package/lib/node_modules/@antv/util/esm/lodash/deep-mix.js +0 -54
- package/lib/node_modules/@antv/util/esm/lodash/deep-mix.js.map +0 -1
- package/lib/node_modules/@antv/util/esm/lodash/each.js +0 -30
- package/lib/node_modules/@antv/util/esm/lodash/each.js.map +0 -1
- package/lib/node_modules/@antv/util/esm/lodash/get-type.js +0 -10
- package/lib/node_modules/@antv/util/esm/lodash/get-type.js.map +0 -1
- package/lib/node_modules/@antv/util/esm/lodash/get.js +0 -19
- package/lib/node_modules/@antv/util/esm/lodash/get.js.map +0 -1
- package/lib/node_modules/@antv/util/esm/lodash/is-array-like.js +0 -12
- package/lib/node_modules/@antv/util/esm/lodash/is-array-like.js.map +0 -1
- package/lib/node_modules/@antv/util/esm/lodash/is-array.js +0 -10
- package/lib/node_modules/@antv/util/esm/lodash/is-array.js.map +0 -1
- package/lib/node_modules/@antv/util/esm/lodash/is-boolean.js +0 -14
- package/lib/node_modules/@antv/util/esm/lodash/is-boolean.js.map +0 -1
- package/lib/node_modules/@antv/util/esm/lodash/is-empty.js +0 -39
- package/lib/node_modules/@antv/util/esm/lodash/is-empty.js.map +0 -1
- package/lib/node_modules/@antv/util/esm/lodash/is-function.js +0 -10
- package/lib/node_modules/@antv/util/esm/lodash/is-function.js.map +0 -1
- package/lib/node_modules/@antv/util/esm/lodash/is-nil.js +0 -10
- package/lib/node_modules/@antv/util/esm/lodash/is-nil.js.map +0 -1
- package/lib/node_modules/@antv/util/esm/lodash/is-number.js +0 -10
- package/lib/node_modules/@antv/util/esm/lodash/is-number.js.map +0 -1
- package/lib/node_modules/@antv/util/esm/lodash/is-object-like.js +0 -12
- package/lib/node_modules/@antv/util/esm/lodash/is-object-like.js.map +0 -1
- package/lib/node_modules/@antv/util/esm/lodash/is-object.js +0 -13
- package/lib/node_modules/@antv/util/esm/lodash/is-object.js.map +0 -1
- package/lib/node_modules/@antv/util/esm/lodash/is-plain-object.js +0 -25
- package/lib/node_modules/@antv/util/esm/lodash/is-plain-object.js.map +0 -1
- package/lib/node_modules/@antv/util/esm/lodash/is-prototype.js +0 -9
- package/lib/node_modules/@antv/util/esm/lodash/is-prototype.js.map +0 -1
- package/lib/node_modules/@antv/util/esm/lodash/is-string.js +0 -10
- package/lib/node_modules/@antv/util/esm/lodash/is-string.js.map +0 -1
- package/lib/node_modules/@antv/util/esm/lodash/is-type.js +0 -5
- package/lib/node_modules/@antv/util/esm/lodash/is-type.js.map +0 -1
- package/lib/node_modules/@antv/util/esm/lodash/pick.js +0 -19
- package/lib/node_modules/@antv/util/esm/lodash/pick.js.map +0 -1
- package/lib/node_modules/@antv/util/esm/lodash/set.js +0 -30
- package/lib/node_modules/@antv/util/esm/lodash/set.js.map +0 -1
- package/lib/node_modules/comlink/dist/esm/comlink.js +0 -351
- package/lib/node_modules/comlink/dist/esm/comlink.js.map +0 -1
- package/lib/node_modules/d3-binarytree/src/add.js +0 -71
- package/lib/node_modules/d3-binarytree/src/add.js.map +0 -1
- package/lib/node_modules/d3-binarytree/src/binarytree.js +0 -71
- package/lib/node_modules/d3-binarytree/src/binarytree.js.map +0 -1
- package/lib/node_modules/d3-binarytree/src/cover.js +0 -39
- package/lib/node_modules/d3-binarytree/src/cover.js.map +0 -1
- package/lib/node_modules/d3-binarytree/src/data.js +0 -10
- package/lib/node_modules/d3-binarytree/src/data.js.map +0 -1
- package/lib/node_modules/d3-binarytree/src/extent.js +0 -8
- package/lib/node_modules/d3-binarytree/src/extent.js.map +0 -1
- package/lib/node_modules/d3-binarytree/src/find.js +0 -61
- package/lib/node_modules/d3-binarytree/src/find.js.map +0 -1
- package/lib/node_modules/d3-binarytree/src/half.js +0 -8
- package/lib/node_modules/d3-binarytree/src/half.js.map +0 -1
- package/lib/node_modules/d3-binarytree/src/remove.js +0 -59
- package/lib/node_modules/d3-binarytree/src/remove.js.map +0 -1
- package/lib/node_modules/d3-binarytree/src/root.js +0 -6
- package/lib/node_modules/d3-binarytree/src/root.js.map +0 -1
- package/lib/node_modules/d3-binarytree/src/size.js +0 -10
- package/lib/node_modules/d3-binarytree/src/size.js.map +0 -1
- package/lib/node_modules/d3-binarytree/src/visit.js +0 -17
- package/lib/node_modules/d3-binarytree/src/visit.js.map +0 -1
- package/lib/node_modules/d3-binarytree/src/visitAfter.js +0 -22
- package/lib/node_modules/d3-binarytree/src/visitAfter.js.map +0 -1
- package/lib/node_modules/d3-binarytree/src/x.js +0 -10
- package/lib/node_modules/d3-binarytree/src/x.js.map +0 -1
- package/lib/node_modules/d3-dispatch/src/dispatch.js +0 -85
- package/lib/node_modules/d3-dispatch/src/dispatch.js.map +0 -1
- package/lib/node_modules/d3-force/src/center.js +0 -43
- package/lib/node_modules/d3-force/src/center.js.map +0 -1
- package/lib/node_modules/d3-force/src/collide.js +0 -103
- package/lib/node_modules/d3-force/src/collide.js.map +0 -1
- package/lib/node_modules/d3-force/src/constant.js +0 -8
- package/lib/node_modules/d3-force/src/constant.js.map +0 -1
- package/lib/node_modules/d3-force/src/jiggle.js +0 -6
- package/lib/node_modules/d3-force/src/jiggle.js.map +0 -1
- package/lib/node_modules/d3-force/src/lcg.js +0 -12
- package/lib/node_modules/d3-force/src/lcg.js.map +0 -1
- package/lib/node_modules/d3-force/src/link.js +0 -120
- package/lib/node_modules/d3-force/src/link.js.map +0 -1
- package/lib/node_modules/d3-force/src/manyBody.js +0 -119
- package/lib/node_modules/d3-force/src/manyBody.js.map +0 -1
- package/lib/node_modules/d3-force/src/radial.js +0 -60
- package/lib/node_modules/d3-force/src/radial.js.map +0 -1
- package/lib/node_modules/d3-force/src/simulation.js +0 -159
- package/lib/node_modules/d3-force/src/simulation.js.map +0 -1
- package/lib/node_modules/d3-force/src/x.js +0 -44
- package/lib/node_modules/d3-force/src/x.js.map +0 -1
- package/lib/node_modules/d3-force/src/y.js +0 -44
- package/lib/node_modules/d3-force/src/y.js.map +0 -1
- package/lib/node_modules/d3-force-3d/src/center.js +0 -52
- package/lib/node_modules/d3-force-3d/src/center.js.map +0 -1
- package/lib/node_modules/d3-force-3d/src/collide.js +0 -135
- package/lib/node_modules/d3-force-3d/src/collide.js.map +0 -1
- package/lib/node_modules/d3-force-3d/src/constant.js +0 -8
- package/lib/node_modules/d3-force-3d/src/constant.js.map +0 -1
- package/lib/node_modules/d3-force-3d/src/jiggle.js +0 -6
- package/lib/node_modules/d3-force-3d/src/jiggle.js.map +0 -1
- package/lib/node_modules/d3-force-3d/src/lcg.js +0 -12
- package/lib/node_modules/d3-force-3d/src/lcg.js.map +0 -1
- package/lib/node_modules/d3-force-3d/src/link.js +0 -127
- package/lib/node_modules/d3-force-3d/src/link.js.map +0 -1
- package/lib/node_modules/d3-force-3d/src/manyBody.js +0 -142
- package/lib/node_modules/d3-force-3d/src/manyBody.js.map +0 -1
- package/lib/node_modules/d3-force-3d/src/radial.js +0 -70
- package/lib/node_modules/d3-force-3d/src/radial.js.map +0 -1
- package/lib/node_modules/d3-force-3d/src/simulation.js +0 -202
- package/lib/node_modules/d3-force-3d/src/simulation.js.map +0 -1
- package/lib/node_modules/d3-force-3d/src/x.js +0 -44
- package/lib/node_modules/d3-force-3d/src/x.js.map +0 -1
- package/lib/node_modules/d3-force-3d/src/y.js +0 -44
- package/lib/node_modules/d3-force-3d/src/y.js.map +0 -1
- package/lib/node_modules/d3-force-3d/src/z.js +0 -44
- package/lib/node_modules/d3-force-3d/src/z.js.map +0 -1
- package/lib/node_modules/d3-octree/src/add.js +0 -101
- package/lib/node_modules/d3-octree/src/add.js.map +0 -1
- package/lib/node_modules/d3-octree/src/cover.js +0 -55
- package/lib/node_modules/d3-octree/src/cover.js.map +0 -1
- package/lib/node_modules/d3-octree/src/data.js +0 -10
- package/lib/node_modules/d3-octree/src/data.js.map +0 -1
- package/lib/node_modules/d3-octree/src/extent.js +0 -8
- package/lib/node_modules/d3-octree/src/extent.js.map +0 -1
- package/lib/node_modules/d3-octree/src/find.js +0 -85
- package/lib/node_modules/d3-octree/src/find.js.map +0 -1
- package/lib/node_modules/d3-octree/src/findAll.js +0 -29
- package/lib/node_modules/d3-octree/src/findAll.js.map +0 -1
- package/lib/node_modules/d3-octree/src/octant.js +0 -12
- package/lib/node_modules/d3-octree/src/octant.js.map +0 -1
- package/lib/node_modules/d3-octree/src/octree.js +0 -83
- package/lib/node_modules/d3-octree/src/octree.js.map +0 -1
- package/lib/node_modules/d3-octree/src/remove.js +0 -71
- package/lib/node_modules/d3-octree/src/remove.js.map +0 -1
- package/lib/node_modules/d3-octree/src/root.js +0 -6
- package/lib/node_modules/d3-octree/src/root.js.map +0 -1
- package/lib/node_modules/d3-octree/src/size.js +0 -10
- package/lib/node_modules/d3-octree/src/size.js.map +0 -1
- package/lib/node_modules/d3-octree/src/visit.js +0 -23
- package/lib/node_modules/d3-octree/src/visit.js.map +0 -1
- package/lib/node_modules/d3-octree/src/visitAfter.js +0 -28
- package/lib/node_modules/d3-octree/src/visitAfter.js.map +0 -1
- package/lib/node_modules/d3-octree/src/x.js +0 -10
- package/lib/node_modules/d3-octree/src/x.js.map +0 -1
- package/lib/node_modules/d3-octree/src/y.js +0 -10
- package/lib/node_modules/d3-octree/src/y.js.map +0 -1
- package/lib/node_modules/d3-octree/src/z.js +0 -10
- package/lib/node_modules/d3-octree/src/z.js.map +0 -1
- package/lib/node_modules/d3-quadtree/src/add.js +0 -87
- package/lib/node_modules/d3-quadtree/src/add.js.map +0 -1
- package/lib/node_modules/d3-quadtree/src/cover.js +0 -46
- package/lib/node_modules/d3-quadtree/src/cover.js.map +0 -1
- package/lib/node_modules/d3-quadtree/src/data.js +0 -10
- package/lib/node_modules/d3-quadtree/src/data.js.map +0 -1
- package/lib/node_modules/d3-quadtree/src/extent.js +0 -8
- package/lib/node_modules/d3-quadtree/src/extent.js.map +0 -1
- package/lib/node_modules/d3-quadtree/src/find.js +0 -73
- package/lib/node_modules/d3-quadtree/src/find.js.map +0 -1
- package/lib/node_modules/d3-quadtree/src/quad.js +0 -10
- package/lib/node_modules/d3-quadtree/src/quad.js.map +0 -1
- package/lib/node_modules/d3-quadtree/src/quadtree.js +0 -76
- package/lib/node_modules/d3-quadtree/src/quadtree.js.map +0 -1
- package/lib/node_modules/d3-quadtree/src/remove.js +0 -65
- package/lib/node_modules/d3-quadtree/src/remove.js.map +0 -1
- package/lib/node_modules/d3-quadtree/src/root.js +0 -6
- package/lib/node_modules/d3-quadtree/src/root.js.map +0 -1
- package/lib/node_modules/d3-quadtree/src/size.js +0 -10
- package/lib/node_modules/d3-quadtree/src/size.js.map +0 -1
- package/lib/node_modules/d3-quadtree/src/visit.js +0 -19
- package/lib/node_modules/d3-quadtree/src/visit.js.map +0 -1
- package/lib/node_modules/d3-quadtree/src/visitAfter.js +0 -24
- package/lib/node_modules/d3-quadtree/src/visitAfter.js.map +0 -1
- package/lib/node_modules/d3-quadtree/src/x.js +0 -10
- package/lib/node_modules/d3-quadtree/src/x.js.map +0 -1
- package/lib/node_modules/d3-quadtree/src/y.js +0 -10
- package/lib/node_modules/d3-quadtree/src/y.js.map +0 -1
- package/lib/node_modules/d3-timer/src/timer.js +0 -113
- package/lib/node_modules/d3-timer/src/timer.js.map +0 -1
- package/lib/node_modules/dagre/index.js +0 -50
- package/lib/node_modules/dagre/index.js.map +0 -1
- package/lib/node_modules/dagre/lib/acyclic.js +0 -80
- package/lib/node_modules/dagre/lib/acyclic.js.map +0 -1
- package/lib/node_modules/dagre/lib/add-border-segments.js +0 -52
- package/lib/node_modules/dagre/lib/add-border-segments.js.map +0 -1
- package/lib/node_modules/dagre/lib/coordinate-system.js +0 -84
- package/lib/node_modules/dagre/lib/coordinate-system.js.map +0 -1
- package/lib/node_modules/dagre/lib/data/list.js +0 -67
- package/lib/node_modules/dagre/lib/data/list.js.map +0 -1
- package/lib/node_modules/dagre/lib/debug.js +0 -49
- package/lib/node_modules/dagre/lib/debug.js.map +0 -1
- package/lib/node_modules/dagre/lib/graphlib.js +0 -31
- package/lib/node_modules/dagre/lib/graphlib.js.map +0 -1
- package/lib/node_modules/dagre/lib/greedy-fas.js +0 -133
- package/lib/node_modules/dagre/lib/greedy-fas.js.map +0 -1
- package/lib/node_modules/dagre/lib/layout.js +0 -415
- package/lib/node_modules/dagre/lib/layout.js.map +0 -1
- package/lib/node_modules/dagre/lib/lodash.js +0 -83
- package/lib/node_modules/dagre/lib/lodash.js.map +0 -1
- package/lib/node_modules/dagre/lib/nesting-graph.js +0 -146
- package/lib/node_modules/dagre/lib/nesting-graph.js.map +0 -1
- package/lib/node_modules/dagre/lib/normalize.js +0 -103
- package/lib/node_modules/dagre/lib/normalize.js.map +0 -1
- package/lib/node_modules/dagre/lib/order/add-subgraph-constraints.js +0 -66
- package/lib/node_modules/dagre/lib/order/add-subgraph-constraints.js.map +0 -1
- package/lib/node_modules/dagre/lib/order/barycenter.js +0 -40
- package/lib/node_modules/dagre/lib/order/barycenter.js.map +0 -1
- package/lib/node_modules/dagre/lib/order/build-layer-graph.js +0 -87
- package/lib/node_modules/dagre/lib/order/build-layer-graph.js.map +0 -1
- package/lib/node_modules/dagre/lib/order/cross-count.js +0 -79
- package/lib/node_modules/dagre/lib/order/cross-count.js.map +0 -1
- package/lib/node_modules/dagre/lib/order/index.js +0 -98
- package/lib/node_modules/dagre/lib/order/index.js.map +0 -1
- package/lib/node_modules/dagre/lib/order/init-order.js +0 -50
- package/lib/node_modules/dagre/lib/order/init-order.js.map +0 -1
- package/lib/node_modules/dagre/lib/order/resolve-conflicts.js +0 -134
- package/lib/node_modules/dagre/lib/order/resolve-conflicts.js.map +0 -1
- package/lib/node_modules/dagre/lib/order/sort-subgraph.js +0 -92
- package/lib/node_modules/dagre/lib/order/sort-subgraph.js.map +0 -1
- package/lib/node_modules/dagre/lib/order/sort.js +0 -71
- package/lib/node_modules/dagre/lib/order/sort.js.map +0 -1
- package/lib/node_modules/dagre/lib/parent-dummy-chains.js +0 -99
- package/lib/node_modules/dagre/lib/parent-dummy-chains.js.map +0 -1
- package/lib/node_modules/dagre/lib/position/bk.js +0 -433
- package/lib/node_modules/dagre/lib/position/bk.js.map +0 -1
- package/lib/node_modules/dagre/lib/position/index.js +0 -43
- package/lib/node_modules/dagre/lib/position/index.js.map +0 -1
- package/lib/node_modules/dagre/lib/rank/feasible-tree.js +0 -103
- package/lib/node_modules/dagre/lib/rank/feasible-tree.js.map +0 -1
- package/lib/node_modules/dagre/lib/rank/index.js +0 -62
- package/lib/node_modules/dagre/lib/rank/index.js.map +0 -1
- package/lib/node_modules/dagre/lib/rank/network-simplex.js +0 -250
- package/lib/node_modules/dagre/lib/rank/network-simplex.js.map +0 -1
- package/lib/node_modules/dagre/lib/rank/util.js +0 -75
- package/lib/node_modules/dagre/lib/rank/util.js.map +0 -1
- package/lib/node_modules/dagre/lib/util.js +0 -251
- package/lib/node_modules/dagre/lib/util.js.map +0 -1
- package/lib/node_modules/dagre/lib/version.js +0 -12
- package/lib/node_modules/dagre/lib/version.js.map +0 -1
- package/lib/node_modules/graphlib/index.js +0 -53
- package/lib/node_modules/graphlib/index.js.map +0 -1
- package/lib/node_modules/graphlib/lib/alg/components.js +0 -40
- package/lib/node_modules/graphlib/lib/alg/components.js.map +0 -1
- package/lib/node_modules/graphlib/lib/alg/dfs.js +0 -55
- package/lib/node_modules/graphlib/lib/alg/dfs.js.map +0 -1
- package/lib/node_modules/graphlib/lib/alg/dijkstra-all.js +0 -24
- package/lib/node_modules/graphlib/lib/alg/dijkstra-all.js.map +0 -1
- package/lib/node_modules/graphlib/lib/alg/dijkstra.js +0 -68
- package/lib/node_modules/graphlib/lib/alg/dijkstra.js.map +0 -1
- package/lib/node_modules/graphlib/lib/alg/find-cycles.js +0 -24
- package/lib/node_modules/graphlib/lib/alg/find-cycles.js.map +0 -1
- package/lib/node_modules/graphlib/lib/alg/floyd-warshall.js +0 -63
- package/lib/node_modules/graphlib/lib/alg/floyd-warshall.js.map +0 -1
- package/lib/node_modules/graphlib/lib/alg/index.js +0 -36
- package/lib/node_modules/graphlib/lib/alg/index.js.map +0 -1
- package/lib/node_modules/graphlib/lib/alg/is-acyclic.js +0 -28
- package/lib/node_modules/graphlib/lib/alg/is-acyclic.js.map +0 -1
- package/lib/node_modules/graphlib/lib/alg/postorder.js +0 -20
- package/lib/node_modules/graphlib/lib/alg/postorder.js.map +0 -1
- package/lib/node_modules/graphlib/lib/alg/preorder.js +0 -20
- package/lib/node_modules/graphlib/lib/alg/preorder.js.map +0 -1
- package/lib/node_modules/graphlib/lib/alg/prim.js +0 -67
- package/lib/node_modules/graphlib/lib/alg/prim.js.map +0 -1
- package/lib/node_modules/graphlib/lib/alg/tarjan.js +0 -60
- package/lib/node_modules/graphlib/lib/alg/tarjan.js.map +0 -1
- package/lib/node_modules/graphlib/lib/alg/topsort.js +0 -48
- package/lib/node_modules/graphlib/lib/alg/topsort.js.map +0 -1
- package/lib/node_modules/graphlib/lib/data/priority-queue.js +0 -165
- package/lib/node_modules/graphlib/lib/data/priority-queue.js.map +0 -1
- package/lib/node_modules/graphlib/lib/graph.js +0 -544
- package/lib/node_modules/graphlib/lib/graph.js.map +0 -1
- package/lib/node_modules/graphlib/lib/index.js +0 -19
- package/lib/node_modules/graphlib/lib/index.js.map +0 -1
- package/lib/node_modules/graphlib/lib/json.js +0 -80
- package/lib/node_modules/graphlib/lib/json.js.map +0 -1
- package/lib/node_modules/graphlib/lib/lodash.js +0 -63
- package/lib/node_modules/graphlib/lib/lodash.js.map +0 -1
- package/lib/node_modules/graphlib/lib/version.js +0 -12
- package/lib/node_modules/graphlib/lib/version.js.map +0 -1
- package/lib/node_modules/is-any-array/lib-esm/index.js +0 -15
- package/lib/node_modules/is-any-array/lib-esm/index.js.map +0 -1
- package/lib/node_modules/lodash/_DataView.js +0 -21
- package/lib/node_modules/lodash/_DataView.js.map +0 -1
- package/lib/node_modules/lodash/_Hash.js +0 -49
- package/lib/node_modules/lodash/_Hash.js.map +0 -1
- package/lib/node_modules/lodash/_ListCache.js +0 -49
- package/lib/node_modules/lodash/_ListCache.js.map +0 -1
- package/lib/node_modules/lodash/_Map.js +0 -21
- package/lib/node_modules/lodash/_Map.js.map +0 -1
- package/lib/node_modules/lodash/_MapCache.js +0 -49
- package/lib/node_modules/lodash/_MapCache.js.map +0 -1
- package/lib/node_modules/lodash/_Promise.js +0 -21
- package/lib/node_modules/lodash/_Promise.js.map +0 -1
- package/lib/node_modules/lodash/_Set.js +0 -21
- package/lib/node_modules/lodash/_Set.js.map +0 -1
- package/lib/node_modules/lodash/_SetCache.js +0 -42
- package/lib/node_modules/lodash/_SetCache.js.map +0 -1
- package/lib/node_modules/lodash/_Stack.js +0 -45
- package/lib/node_modules/lodash/_Stack.js.map +0 -1
- package/lib/node_modules/lodash/_Symbol.js +0 -19
- package/lib/node_modules/lodash/_Symbol.js.map +0 -1
- package/lib/node_modules/lodash/_Uint8Array.js +0 -19
- package/lib/node_modules/lodash/_Uint8Array.js.map +0 -1
- package/lib/node_modules/lodash/_WeakMap.js +0 -21
- package/lib/node_modules/lodash/_WeakMap.js.map +0 -1
- package/lib/node_modules/lodash/_apply.js +0 -33
- package/lib/node_modules/lodash/_apply.js.map +0 -1
- package/lib/node_modules/lodash/_arrayEach.js +0 -34
- package/lib/node_modules/lodash/_arrayEach.js.map +0 -1
- package/lib/node_modules/lodash/_arrayFilter.js +0 -37
- package/lib/node_modules/lodash/_arrayFilter.js.map +0 -1
- package/lib/node_modules/lodash/_arrayIncludes.js +0 -30
- package/lib/node_modules/lodash/_arrayIncludes.js.map +0 -1
- package/lib/node_modules/lodash/_arrayIncludesWith.js +0 -34
- package/lib/node_modules/lodash/_arrayIncludesWith.js.map +0 -1
- package/lib/node_modules/lodash/_arrayLikeKeys.js +0 -67
- package/lib/node_modules/lodash/_arrayLikeKeys.js.map +0 -1
- package/lib/node_modules/lodash/_arrayMap.js +0 -33
- package/lib/node_modules/lodash/_arrayMap.js.map +0 -1
- package/lib/node_modules/lodash/_arrayPush.js +0 -32
- package/lib/node_modules/lodash/_arrayPush.js.map +0 -1
- package/lib/node_modules/lodash/_arrayReduce.js +0 -38
- package/lib/node_modules/lodash/_arrayReduce.js.map +0 -1
- package/lib/node_modules/lodash/_arraySome.js +0 -35
- package/lib/node_modules/lodash/_arraySome.js.map +0 -1
- package/lib/node_modules/lodash/_asciiSize.js +0 -25
- package/lib/node_modules/lodash/_asciiSize.js.map +0 -1
- package/lib/node_modules/lodash/_assignMergeValue.js +0 -34
- package/lib/node_modules/lodash/_assignMergeValue.js.map +0 -1
- package/lib/node_modules/lodash/_assignValue.js +0 -42
- package/lib/node_modules/lodash/_assignValue.js.map +0 -1
- package/lib/node_modules/lodash/_assocIndexOf.js +0 -34
- package/lib/node_modules/lodash/_assocIndexOf.js.map +0 -1
- package/lib/node_modules/lodash/_baseAssign.js +0 -31
- package/lib/node_modules/lodash/_baseAssign.js.map +0 -1
- package/lib/node_modules/lodash/_baseAssignIn.js +0 -31
- package/lib/node_modules/lodash/_baseAssignIn.js.map +0 -1
- package/lib/node_modules/lodash/_baseAssignValue.js +0 -38
- package/lib/node_modules/lodash/_baseAssignValue.js.map +0 -1
- package/lib/node_modules/lodash/_baseClone.js +0 -200
- package/lib/node_modules/lodash/_baseClone.js.map +0 -1
- package/lib/node_modules/lodash/_baseCreate.js +0 -43
- package/lib/node_modules/lodash/_baseCreate.js.map +0 -1
- package/lib/node_modules/lodash/_baseEach.js +0 -28
- package/lib/node_modules/lodash/_baseEach.js.map +0 -1
- package/lib/node_modules/lodash/_baseExtremum.js +0 -45
- package/lib/node_modules/lodash/_baseExtremum.js.map +0 -1
- package/lib/node_modules/lodash/_baseFilter.js +0 -34
- package/lib/node_modules/lodash/_baseFilter.js.map +0 -1
- package/lib/node_modules/lodash/_baseFindIndex.js +0 -36
- package/lib/node_modules/lodash/_baseFindIndex.js.map +0 -1
- package/lib/node_modules/lodash/_baseFlatten.js +0 -52
- package/lib/node_modules/lodash/_baseFlatten.js.map +0 -1
- package/lib/node_modules/lodash/_baseFor.js +0 -29
- package/lib/node_modules/lodash/_baseFor.js.map +0 -1
- package/lib/node_modules/lodash/_baseForOwn.js +0 -30
- package/lib/node_modules/lodash/_baseForOwn.js.map +0 -1
- package/lib/node_modules/lodash/_baseGet.js +0 -38
- package/lib/node_modules/lodash/_baseGet.js.map +0 -1
- package/lib/node_modules/lodash/_baseGetAllKeys.js +0 -34
- package/lib/node_modules/lodash/_baseGetAllKeys.js.map +0 -1
- package/lib/node_modules/lodash/_baseGetTag.js +0 -43
- package/lib/node_modules/lodash/_baseGetTag.js.map +0 -1
- package/lib/node_modules/lodash/_baseGt.js +0 -26
- package/lib/node_modules/lodash/_baseGt.js.map +0 -1
- package/lib/node_modules/lodash/_baseHas.js +0 -31
- package/lib/node_modules/lodash/_baseHas.js.map +0 -1
- package/lib/node_modules/lodash/_baseHasIn.js +0 -25
- package/lib/node_modules/lodash/_baseHasIn.js.map +0 -1
- package/lib/node_modules/lodash/_baseIndexOf.js +0 -35
- package/lib/node_modules/lodash/_baseIndexOf.js.map +0 -1
- package/lib/node_modules/lodash/_baseIsArguments.js +0 -32
- package/lib/node_modules/lodash/_baseIsArguments.js.map +0 -1
- package/lib/node_modules/lodash/_baseIsEqual.js +0 -42
- package/lib/node_modules/lodash/_baseIsEqual.js.map +0 -1
- package/lib/node_modules/lodash/_baseIsEqualDeep.js +0 -103
- package/lib/node_modules/lodash/_baseIsEqualDeep.js.map +0 -1
- package/lib/node_modules/lodash/_baseIsMap.js +0 -32
- package/lib/node_modules/lodash/_baseIsMap.js.map +0 -1
- package/lib/node_modules/lodash/_baseIsMatch.js +0 -76
- package/lib/node_modules/lodash/_baseIsMatch.js.map +0 -1
- package/lib/node_modules/lodash/_baseIsNaN.js +0 -24
- package/lib/node_modules/lodash/_baseIsNaN.js.map +0 -1
- package/lib/node_modules/lodash/_baseIsNative.js +0 -63
- package/lib/node_modules/lodash/_baseIsNative.js.map +0 -1
- package/lib/node_modules/lodash/_baseIsSet.js +0 -32
- package/lib/node_modules/lodash/_baseIsSet.js.map +0 -1
- package/lib/node_modules/lodash/_baseIsTypedArray.js +0 -75
- package/lib/node_modules/lodash/_baseIsTypedArray.js.map +0 -1
- package/lib/node_modules/lodash/_baseIteratee.js +0 -48
- package/lib/node_modules/lodash/_baseIteratee.js.map +0 -1
- package/lib/node_modules/lodash/_baseKeys.js +0 -44
- package/lib/node_modules/lodash/_baseKeys.js.map +0 -1
- package/lib/node_modules/lodash/_baseKeysIn.js +0 -48
- package/lib/node_modules/lodash/_baseKeysIn.js.map +0 -1
- package/lib/node_modules/lodash/_baseLt.js +0 -26
- package/lib/node_modules/lodash/_baseLt.js.map +0 -1
- package/lib/node_modules/lodash/_baseMap.js +0 -36
- package/lib/node_modules/lodash/_baseMap.js.map +0 -1
- package/lib/node_modules/lodash/_baseMatches.js +0 -37
- package/lib/node_modules/lodash/_baseMatches.js.map +0 -1
- package/lib/node_modules/lodash/_baseMatchesProperty.js +0 -52
- package/lib/node_modules/lodash/_baseMatchesProperty.js.map +0 -1
- package/lib/node_modules/lodash/_baseMerge.js +0 -61
- package/lib/node_modules/lodash/_baseMerge.js.map +0 -1
- package/lib/node_modules/lodash/_baseMergeDeep.js +0 -121
- package/lib/node_modules/lodash/_baseMergeDeep.js.map +0 -1
- package/lib/node_modules/lodash/_baseOrderBy.js +0 -70
- package/lib/node_modules/lodash/_baseOrderBy.js.map +0 -1
- package/lib/node_modules/lodash/_basePick.js +0 -33
- package/lib/node_modules/lodash/_basePick.js.map +0 -1
- package/lib/node_modules/lodash/_basePickBy.js +0 -45
- package/lib/node_modules/lodash/_basePickBy.js.map +0 -1
- package/lib/node_modules/lodash/_baseProperty.js +0 -26
- package/lib/node_modules/lodash/_baseProperty.js.map +0 -1
- package/lib/node_modules/lodash/_basePropertyDeep.js +0 -29
- package/lib/node_modules/lodash/_basePropertyDeep.js.map +0 -1
- package/lib/node_modules/lodash/_baseRange.js +0 -40
- package/lib/node_modules/lodash/_baseRange.js.map +0 -1
- package/lib/node_modules/lodash/_baseReduce.js +0 -35
- package/lib/node_modules/lodash/_baseReduce.js.map +0 -1
- package/lib/node_modules/lodash/_baseRest.js +0 -32
- package/lib/node_modules/lodash/_baseRest.js.map +0 -1
- package/lib/node_modules/lodash/_baseSet.js +0 -68
- package/lib/node_modules/lodash/_baseSet.js.map +0 -1
- package/lib/node_modules/lodash/_baseSetToString.js +0 -37
- package/lib/node_modules/lodash/_baseSetToString.js.map +0 -1
- package/lib/node_modules/lodash/_baseSortBy.js +0 -33
- package/lib/node_modules/lodash/_baseSortBy.js.map +0 -1
- package/lib/node_modules/lodash/_baseTimes.js +0 -32
- package/lib/node_modules/lodash/_baseTimes.js.map +0 -1
- package/lib/node_modules/lodash/_baseToString.js +0 -50
- package/lib/node_modules/lodash/_baseToString.js.map +0 -1
- package/lib/node_modules/lodash/_baseTrim.js +0 -32
- package/lib/node_modules/lodash/_baseTrim.js.map +0 -1
- package/lib/node_modules/lodash/_baseUnary.js +0 -26
- package/lib/node_modules/lodash/_baseUnary.js.map +0 -1
- package/lib/node_modules/lodash/_baseUniq.js +0 -90
- package/lib/node_modules/lodash/_baseUniq.js.map +0 -1
- package/lib/node_modules/lodash/_baseValues.js +0 -32
- package/lib/node_modules/lodash/_baseValues.js.map +0 -1
- package/lib/node_modules/lodash/_baseZipObject.js +0 -35
- package/lib/node_modules/lodash/_baseZipObject.js.map +0 -1
- package/lib/node_modules/lodash/_cacheHas.js +0 -25
- package/lib/node_modules/lodash/_cacheHas.js.map +0 -1
- package/lib/node_modules/lodash/_castFunction.js +0 -27
- package/lib/node_modules/lodash/_castFunction.js.map +0 -1
- package/lib/node_modules/lodash/_castPath.js +0 -37
- package/lib/node_modules/lodash/_castPath.js.map +0 -1
- package/lib/node_modules/lodash/_cloneArrayBuffer.js +0 -29
- package/lib/node_modules/lodash/_cloneArrayBuffer.js.map +0 -1
- package/lib/node_modules/lodash/_cloneBuffer.js +0 -52
- package/lib/node_modules/lodash/_cloneBuffer.js.map +0 -1
- package/lib/node_modules/lodash/_cloneDataView.js +0 -29
- package/lib/node_modules/lodash/_cloneDataView.js.map +0 -1
- package/lib/node_modules/lodash/_cloneRegExp.js +0 -29
- package/lib/node_modules/lodash/_cloneRegExp.js.map +0 -1
- package/lib/node_modules/lodash/_cloneSymbol.js +0 -31
- package/lib/node_modules/lodash/_cloneSymbol.js.map +0 -1
- package/lib/node_modules/lodash/_cloneTypedArray.js +0 -29
- package/lib/node_modules/lodash/_cloneTypedArray.js.map +0 -1
- package/lib/node_modules/lodash/_compareAscending.js +0 -54
- package/lib/node_modules/lodash/_compareAscending.js.map +0 -1
- package/lib/node_modules/lodash/_compareMultiple.js +0 -57
- package/lib/node_modules/lodash/_compareMultiple.js.map +0 -1
- package/lib/node_modules/lodash/_copyArray.js +0 -32
- package/lib/node_modules/lodash/_copyArray.js.map +0 -1
- package/lib/node_modules/lodash/_copyObject.js +0 -54
- package/lib/node_modules/lodash/_copyObject.js.map +0 -1
- package/lib/node_modules/lodash/_copySymbols.js +0 -30
- package/lib/node_modules/lodash/_copySymbols.js.map +0 -1
- package/lib/node_modules/lodash/_copySymbolsIn.js +0 -30
- package/lib/node_modules/lodash/_copySymbolsIn.js.map +0 -1
- package/lib/node_modules/lodash/_coreJsData.js +0 -19
- package/lib/node_modules/lodash/_coreJsData.js.map +0 -1
- package/lib/node_modules/lodash/_createAssigner.js +0 -51
- package/lib/node_modules/lodash/_createAssigner.js.map +0 -1
- package/lib/node_modules/lodash/_createBaseEach.js +0 -45
- package/lib/node_modules/lodash/_createBaseEach.js.map +0 -1
- package/lib/node_modules/lodash/_createBaseFor.js +0 -37
- package/lib/node_modules/lodash/_createBaseFor.js.map +0 -1
- package/lib/node_modules/lodash/_createFind.js +0 -40
- package/lib/node_modules/lodash/_createFind.js.map +0 -1
- package/lib/node_modules/lodash/_createRange.js +0 -45
- package/lib/node_modules/lodash/_createRange.js.map +0 -1
- package/lib/node_modules/lodash/_createSet.js +0 -34
- package/lib/node_modules/lodash/_createSet.js.map +0 -1
- package/lib/node_modules/lodash/_defineProperty.js +0 -24
- package/lib/node_modules/lodash/_defineProperty.js.map +0 -1
- package/lib/node_modules/lodash/_equalArrays.js +0 -99
- package/lib/node_modules/lodash/_equalArrays.js.map +0 -1
- package/lib/node_modules/lodash/_equalByTag.js +0 -130
- package/lib/node_modules/lodash/_equalByTag.js.map +0 -1
- package/lib/node_modules/lodash/_equalObjects.js +0 -103
- package/lib/node_modules/lodash/_equalObjects.js.map +0 -1
- package/lib/node_modules/lodash/_flatRest.js +0 -31
- package/lib/node_modules/lodash/_flatRest.js.map +0 -1
- package/lib/node_modules/lodash/_freeGlobal.js +0 -18
- package/lib/node_modules/lodash/_freeGlobal.js.map +0 -1
- package/lib/node_modules/lodash/_getAllKeys.js +0 -31
- package/lib/node_modules/lodash/_getAllKeys.js.map +0 -1
- package/lib/node_modules/lodash/_getAllKeysIn.js +0 -32
- package/lib/node_modules/lodash/_getAllKeysIn.js.map +0 -1
- package/lib/node_modules/lodash/_getMapData.js +0 -31
- package/lib/node_modules/lodash/_getMapData.js.map +0 -1
- package/lib/node_modules/lodash/_getMatchData.js +0 -38
- package/lib/node_modules/lodash/_getMatchData.js.map +0 -1
- package/lib/node_modules/lodash/_getNative.js +0 -31
- package/lib/node_modules/lodash/_getNative.js.map +0 -1
- package/lib/node_modules/lodash/_getPrototype.js +0 -19
- package/lib/node_modules/lodash/_getPrototype.js.map +0 -1
- package/lib/node_modules/lodash/_getRawTag.js +0 -59
- package/lib/node_modules/lodash/_getRawTag.js.map +0 -1
- package/lib/node_modules/lodash/_getSymbols.js +0 -44
- package/lib/node_modules/lodash/_getSymbols.js.map +0 -1
- package/lib/node_modules/lodash/_getSymbolsIn.js +0 -41
- package/lib/node_modules/lodash/_getSymbolsIn.js.map +0 -1
- package/lib/node_modules/lodash/_getTag.js +0 -77
- package/lib/node_modules/lodash/_getTag.js.map +0 -1
- package/lib/node_modules/lodash/_getValue.js +0 -25
- package/lib/node_modules/lodash/_getValue.js.map +0 -1
- package/lib/node_modules/lodash/_hasPath.js +0 -57
- package/lib/node_modules/lodash/_hasPath.js.map +0 -1
- package/lib/node_modules/lodash/_hasUnicode.js +0 -38
- package/lib/node_modules/lodash/_hasUnicode.js.map +0 -1
- package/lib/node_modules/lodash/_hashClear.js +0 -28
- package/lib/node_modules/lodash/_hashClear.js.map +0 -1
- package/lib/node_modules/lodash/_hashDelete.js +0 -29
- package/lib/node_modules/lodash/_hashDelete.js.map +0 -1
- package/lib/node_modules/lodash/_hashGet.js +0 -43
- package/lib/node_modules/lodash/_hashGet.js.map +0 -1
- package/lib/node_modules/lodash/_hashHas.js +0 -36
- package/lib/node_modules/lodash/_hashHas.js.map +0 -1
- package/lib/node_modules/lodash/_hashSet.js +0 -36
- package/lib/node_modules/lodash/_hashSet.js.map +0 -1
- package/lib/node_modules/lodash/_initCloneArray.js +0 -38
- package/lib/node_modules/lodash/_initCloneArray.js.map +0 -1
- package/lib/node_modules/lodash/_initCloneByTag.js +0 -94
- package/lib/node_modules/lodash/_initCloneByTag.js.map +0 -1
- package/lib/node_modules/lodash/_initCloneObject.js +0 -33
- package/lib/node_modules/lodash/_initCloneObject.js.map +0 -1
- package/lib/node_modules/lodash/_isFlattenable.js +0 -35
- package/lib/node_modules/lodash/_isFlattenable.js.map +0 -1
- package/lib/node_modules/lodash/_isIndex.js +0 -37
- package/lib/node_modules/lodash/_isIndex.js.map +0 -1
- package/lib/node_modules/lodash/_isIterateeCall.js +0 -46
- package/lib/node_modules/lodash/_isIterateeCall.js.map +0 -1
- package/lib/node_modules/lodash/_isKey.js +0 -43
- package/lib/node_modules/lodash/_isKey.js.map +0 -1
- package/lib/node_modules/lodash/_isKeyable.js +0 -27
- package/lib/node_modules/lodash/_isKeyable.js.map +0 -1
- package/lib/node_modules/lodash/_isMasked.js +0 -33
- package/lib/node_modules/lodash/_isMasked.js.map +0 -1
- package/lib/node_modules/lodash/_isPrototype.js +0 -30
- package/lib/node_modules/lodash/_isPrototype.js.map +0 -1
- package/lib/node_modules/lodash/_isStrictComparable.js +0 -28
- package/lib/node_modules/lodash/_isStrictComparable.js.map +0 -1
- package/lib/node_modules/lodash/_listCacheClear.js +0 -25
- package/lib/node_modules/lodash/_listCacheClear.js.map +0 -1
- package/lib/node_modules/lodash/_listCacheDelete.js +0 -48
- package/lib/node_modules/lodash/_listCacheDelete.js.map +0 -1
- package/lib/node_modules/lodash/_listCacheGet.js +0 -32
- package/lib/node_modules/lodash/_listCacheGet.js.map +0 -1
- package/lib/node_modules/lodash/_listCacheHas.js +0 -29
- package/lib/node_modules/lodash/_listCacheHas.js.map +0 -1
- package/lib/node_modules/lodash/_listCacheSet.js +0 -39
- package/lib/node_modules/lodash/_listCacheSet.js.map +0 -1
- package/lib/node_modules/lodash/_mapCacheClear.js +0 -36
- package/lib/node_modules/lodash/_mapCacheClear.js.map +0 -1
- package/lib/node_modules/lodash/_mapCacheDelete.js +0 -31
- package/lib/node_modules/lodash/_mapCacheDelete.js.map +0 -1
- package/lib/node_modules/lodash/_mapCacheGet.js +0 -29
- package/lib/node_modules/lodash/_mapCacheGet.js.map +0 -1
- package/lib/node_modules/lodash/_mapCacheHas.js +0 -29
- package/lib/node_modules/lodash/_mapCacheHas.js.map +0 -1
- package/lib/node_modules/lodash/_mapCacheSet.js +0 -35
- package/lib/node_modules/lodash/_mapCacheSet.js.map +0 -1
- package/lib/node_modules/lodash/_mapToArray.js +0 -30
- package/lib/node_modules/lodash/_mapToArray.js.map +0 -1
- package/lib/node_modules/lodash/_matchesStrictComparable.js +0 -32
- package/lib/node_modules/lodash/_matchesStrictComparable.js.map +0 -1
- package/lib/node_modules/lodash/_memoizeCapped.js +0 -39
- package/lib/node_modules/lodash/_memoizeCapped.js.map +0 -1
- package/lib/node_modules/lodash/_nativeCreate.js +0 -19
- package/lib/node_modules/lodash/_nativeCreate.js.map +0 -1
- package/lib/node_modules/lodash/_nativeKeys.js +0 -19
- package/lib/node_modules/lodash/_nativeKeys.js.map +0 -1
- package/lib/node_modules/lodash/_nativeKeysIn.js +0 -32
- package/lib/node_modules/lodash/_nativeKeysIn.js.map +0 -1
- package/lib/node_modules/lodash/_nodeUtil.js +0 -47
- package/lib/node_modules/lodash/_nodeUtil.js.map +0 -1
- package/lib/node_modules/lodash/_objectToString.js +0 -34
- package/lib/node_modules/lodash/_objectToString.js.map +0 -1
- package/lib/node_modules/lodash/_overArg.js +0 -27
- package/lib/node_modules/lodash/_overArg.js.map +0 -1
- package/lib/node_modules/lodash/_overRest.js +0 -49
- package/lib/node_modules/lodash/_overRest.js.map +0 -1
- package/lib/node_modules/lodash/_root.js +0 -22
- package/lib/node_modules/lodash/_root.js.map +0 -1
- package/lib/node_modules/lodash/_safeGet.js +0 -33
- package/lib/node_modules/lodash/_safeGet.js.map +0 -1
- package/lib/node_modules/lodash/_setCacheAdd.js +0 -31
- package/lib/node_modules/lodash/_setCacheAdd.js.map +0 -1
- package/lib/node_modules/lodash/_setCacheHas.js +0 -26
- package/lib/node_modules/lodash/_setCacheHas.js.map +0 -1
- package/lib/node_modules/lodash/_setToArray.js +0 -30
- package/lib/node_modules/lodash/_setToArray.js.map +0 -1
- package/lib/node_modules/lodash/_setToString.js +0 -28
- package/lib/node_modules/lodash/_setToString.js.map +0 -1
- package/lib/node_modules/lodash/_shortOut.js +0 -49
- package/lib/node_modules/lodash/_shortOut.js.map +0 -1
- package/lib/node_modules/lodash/_stackClear.js +0 -28
- package/lib/node_modules/lodash/_stackClear.js.map +0 -1
- package/lib/node_modules/lodash/_stackDelete.js +0 -30
- package/lib/node_modules/lodash/_stackDelete.js.map +0 -1
- package/lib/node_modules/lodash/_stackGet.js +0 -26
- package/lib/node_modules/lodash/_stackGet.js.map +0 -1
- package/lib/node_modules/lodash/_stackHas.js +0 -26
- package/lib/node_modules/lodash/_stackHas.js.map +0 -1
- package/lib/node_modules/lodash/_stackSet.js +0 -49
- package/lib/node_modules/lodash/_stackSet.js.map +0 -1
- package/lib/node_modules/lodash/_strictIndexOf.js +0 -35
- package/lib/node_modules/lodash/_strictIndexOf.js.map +0 -1
- package/lib/node_modules/lodash/_stringSize.js +0 -33
- package/lib/node_modules/lodash/_stringSize.js.map +0 -1
- package/lib/node_modules/lodash/_stringToPath.js +0 -40
- package/lib/node_modules/lodash/_stringToPath.js.map +0 -1
- package/lib/node_modules/lodash/_toKey.js +0 -31
- package/lib/node_modules/lodash/_toKey.js.map +0 -1
- package/lib/node_modules/lodash/_toSource.js +0 -38
- package/lib/node_modules/lodash/_toSource.js.map +0 -1
- package/lib/node_modules/lodash/_trimmedEndIndex.js +0 -31
- package/lib/node_modules/lodash/_trimmedEndIndex.js.map +0 -1
- package/lib/node_modules/lodash/_unicodeSize.js +0 -56
- package/lib/node_modules/lodash/_unicodeSize.js.map +0 -1
- package/lib/node_modules/lodash/clone.js +0 -49
- package/lib/node_modules/lodash/clone.js.map +0 -1
- package/lib/node_modules/lodash/cloneDeep.js +0 -42
- package/lib/node_modules/lodash/cloneDeep.js.map +0 -1
- package/lib/node_modules/lodash/constant.js +0 -38
- package/lib/node_modules/lodash/constant.js.map +0 -1
- package/lib/node_modules/lodash/defaults.js +0 -80
- package/lib/node_modules/lodash/defaults.js.map +0 -1
- package/lib/node_modules/lodash/each.js +0 -14
- package/lib/node_modules/lodash/each.js.map +0 -1
- package/lib/node_modules/lodash/eq.js +0 -49
- package/lib/node_modules/lodash/eq.js.map +0 -1
- package/lib/node_modules/lodash/filter.js +0 -68
- package/lib/node_modules/lodash/filter.js.map +0 -1
- package/lib/node_modules/lodash/find.js +0 -56
- package/lib/node_modules/lodash/find.js.map +0 -1
- package/lib/node_modules/lodash/findIndex.js +0 -70
- package/lib/node_modules/lodash/findIndex.js.map +0 -1
- package/lib/node_modules/lodash/flatten.js +0 -35
- package/lib/node_modules/lodash/flatten.js.map +0 -1
- package/lib/node_modules/lodash/forEach.js +0 -57
- package/lib/node_modules/lodash/forEach.js.map +0 -1
- package/lib/node_modules/lodash/forIn.js +0 -54
- package/lib/node_modules/lodash/forIn.js.map +0 -1
- package/lib/node_modules/lodash/get.js +0 -46
- package/lib/node_modules/lodash/get.js.map +0 -1
- package/lib/node_modules/lodash/has.js +0 -49
- package/lib/node_modules/lodash/has.js.map +0 -1
- package/lib/node_modules/lodash/hasIn.js +0 -48
- package/lib/node_modules/lodash/hasIn.js.map +0 -1
- package/lib/node_modules/lodash/identity.js +0 -33
- package/lib/node_modules/lodash/identity.js.map +0 -1
- package/lib/node_modules/lodash/isArguments.js +0 -50
- package/lib/node_modules/lodash/isArguments.js.map +0 -1
- package/lib/node_modules/lodash/isArray.js +0 -38
- package/lib/node_modules/lodash/isArray.js.map +0 -1
- package/lib/node_modules/lodash/isArrayLike.js +0 -47
- package/lib/node_modules/lodash/isArrayLike.js.map +0 -1
- package/lib/node_modules/lodash/isArrayLikeObject.js +0 -47
- package/lib/node_modules/lodash/isArrayLikeObject.js.map +0 -1
- package/lib/node_modules/lodash/isBuffer.js +0 -56
- package/lib/node_modules/lodash/isBuffer.js.map +0 -1
- package/lib/node_modules/lodash/isEmpty.js +0 -97
- package/lib/node_modules/lodash/isEmpty.js.map +0 -1
- package/lib/node_modules/lodash/isFunction.js +0 -51
- package/lib/node_modules/lodash/isFunction.js.map +0 -1
- package/lib/node_modules/lodash/isLength.js +0 -47
- package/lib/node_modules/lodash/isLength.js.map +0 -1
- package/lib/node_modules/lodash/isMap.js +0 -42
- package/lib/node_modules/lodash/isMap.js.map +0 -1
- package/lib/node_modules/lodash/isObject.js +0 -43
- package/lib/node_modules/lodash/isObject.js.map +0 -1
- package/lib/node_modules/lodash/isObjectLike.js +0 -41
- package/lib/node_modules/lodash/isObjectLike.js.map +0 -1
- package/lib/node_modules/lodash/isPlainObject.js +0 -77
- package/lib/node_modules/lodash/isPlainObject.js.map +0 -1
- package/lib/node_modules/lodash/isSet.js +0 -42
- package/lib/node_modules/lodash/isSet.js.map +0 -1
- package/lib/node_modules/lodash/isString.js +0 -45
- package/lib/node_modules/lodash/isString.js.map +0 -1
- package/lib/node_modules/lodash/isSymbol.js +0 -43
- package/lib/node_modules/lodash/isSymbol.js.map +0 -1
- package/lib/node_modules/lodash/isTypedArray.js +0 -42
- package/lib/node_modules/lodash/isTypedArray.js.map +0 -1
- package/lib/node_modules/lodash/isUndefined.js +0 -34
- package/lib/node_modules/lodash/isUndefined.js.map +0 -1
- package/lib/node_modules/lodash/keys.js +0 -52
- package/lib/node_modules/lodash/keys.js.map +0 -1
- package/lib/node_modules/lodash/keysIn.js +0 -47
- package/lib/node_modules/lodash/keysIn.js.map +0 -1
- package/lib/node_modules/lodash/last.js +0 -32
- package/lib/node_modules/lodash/last.js.map +0 -1
- package/lib/node_modules/lodash/map.js +0 -69
- package/lib/node_modules/lodash/map.js.map +0 -1
- package/lib/node_modules/lodash/mapValues.js +0 -58
- package/lib/node_modules/lodash/mapValues.js.map +0 -1
- package/lib/node_modules/lodash/max.js +0 -44
- package/lib/node_modules/lodash/max.js.map +0 -1
- package/lib/node_modules/lodash/memoize.js +0 -86
- package/lib/node_modules/lodash/memoize.js.map +0 -1
- package/lib/node_modules/lodash/merge.js +0 -53
- package/lib/node_modules/lodash/merge.js.map +0 -1
- package/lib/node_modules/lodash/min.js +0 -44
- package/lib/node_modules/lodash/min.js.map +0 -1
- package/lib/node_modules/lodash/minBy.js +0 -49
- package/lib/node_modules/lodash/minBy.js.map +0 -1
- package/lib/node_modules/lodash/noop.js +0 -29
- package/lib/node_modules/lodash/noop.js.map +0 -1
- package/lib/node_modules/lodash/now.js +0 -36
- package/lib/node_modules/lodash/now.js.map +0 -1
- package/lib/node_modules/lodash/pick.js +0 -39
- package/lib/node_modules/lodash/pick.js.map +0 -1
- package/lib/node_modules/lodash/property.js +0 -48
- package/lib/node_modules/lodash/property.js.map +0 -1
- package/lib/node_modules/lodash/range.js +0 -59
- package/lib/node_modules/lodash/range.js.map +0 -1
- package/lib/node_modules/lodash/reduce.js +0 -68
- package/lib/node_modules/lodash/reduce.js.map +0 -1
- package/lib/node_modules/lodash/size.js +0 -63
- package/lib/node_modules/lodash/size.js.map +0 -1
- package/lib/node_modules/lodash/sortBy.js +0 -64
- package/lib/node_modules/lodash/sortBy.js.map +0 -1
- package/lib/node_modules/lodash/stubArray.js +0 -35
- package/lib/node_modules/lodash/stubArray.js.map +0 -1
- package/lib/node_modules/lodash/stubFalse.js +0 -30
- package/lib/node_modules/lodash/stubFalse.js.map +0 -1
- package/lib/node_modules/lodash/toFinite.js +0 -55
- package/lib/node_modules/lodash/toFinite.js.map +0 -1
- package/lib/node_modules/lodash/toInteger.js +0 -49
- package/lib/node_modules/lodash/toInteger.js.map +0 -1
- package/lib/node_modules/lodash/toNumber.js +0 -79
- package/lib/node_modules/lodash/toNumber.js.map +0 -1
- package/lib/node_modules/lodash/toPlainObject.js +0 -46
- package/lib/node_modules/lodash/toPlainObject.js.map +0 -1
- package/lib/node_modules/lodash/toString.js +0 -41
- package/lib/node_modules/lodash/toString.js.map +0 -1
- package/lib/node_modules/lodash/transform.js +0 -87
- package/lib/node_modules/lodash/transform.js.map +0 -1
- package/lib/node_modules/lodash/union.js +0 -42
- package/lib/node_modules/lodash/union.js.map +0 -1
- package/lib/node_modules/lodash/uniqueId.js +0 -41
- package/lib/node_modules/lodash/uniqueId.js.map +0 -1
- package/lib/node_modules/lodash/values.js +0 -48
- package/lib/node_modules/lodash/values.js.map +0 -1
- package/lib/node_modules/lodash/zipObject.js +0 -38
- package/lib/node_modules/lodash/zipObject.js.map +0 -1
- package/lib/node_modules/ml-array-max/lib-es6/index.js +0 -37
- package/lib/node_modules/ml-array-max/lib-es6/index.js.map +0 -1
- package/lib/node_modules/ml-array-min/lib-es6/index.js +0 -37
- package/lib/node_modules/ml-array-min/lib-es6/index.js.map +0 -1
- package/lib/node_modules/ml-array-rescale/lib-es6/index.js +0 -52
- package/lib/node_modules/ml-array-rescale/lib-es6/index.js.map +0 -1
- package/lib/node_modules/ml-matrix/matrix.js +0 -8
- package/lib/node_modules/ml-matrix/matrix.js.map +0 -1
- package/lib/node_modules/ml-matrix/matrix2.js +0 -5660
- package/lib/node_modules/ml-matrix/matrix2.js.map +0 -1
- package/lib/node_modules/tslib/tslib.es6.js +0 -46
- package/lib/node_modules/tslib/tslib.es6.js.map +0 -1
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { __awaiter } from 'tslib';
|
|
2
|
+
import { Matrix, SingularValueDecomposition } from 'ml-matrix';
|
|
3
|
+
import { BaseLayout } from '../base-layout.js';
|
|
4
|
+
import { applySingleNodeLayout } from '../../util/common.js';
|
|
5
|
+
import '@antv/expr';
|
|
6
|
+
import '@antv/util';
|
|
7
|
+
import { getAdjList, johnson, scaleMatrix } from '../../util/math.js';
|
|
8
|
+
import { normalizeViewport } from '../../util/viewport.js';
|
|
9
|
+
|
|
10
|
+
const DEFAULTS_LAYOUT_OPTIONS = {
|
|
11
|
+
center: [0, 0],
|
|
12
|
+
linkDistance: 50,
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* <zh/> 多维缩放算法布局
|
|
16
|
+
*
|
|
17
|
+
* <en/> Multidimensional scaling layout
|
|
18
|
+
*/
|
|
19
|
+
class MDSLayout extends BaseLayout {
|
|
20
|
+
constructor() {
|
|
21
|
+
super(...arguments);
|
|
22
|
+
this.id = 'mds';
|
|
23
|
+
}
|
|
24
|
+
getDefaultOptions() {
|
|
25
|
+
return DEFAULTS_LAYOUT_OPTIONS;
|
|
26
|
+
}
|
|
27
|
+
layout() {
|
|
28
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
29
|
+
const { linkDistance = DEFAULTS_LAYOUT_OPTIONS.linkDistance } = this.options;
|
|
30
|
+
const { center } = normalizeViewport(this.options);
|
|
31
|
+
const n = this.model.nodeCount();
|
|
32
|
+
if (n === 0 || n === 1) {
|
|
33
|
+
applySingleNodeLayout(this.model, center);
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
// the graph-theoretic distance (shortest path distance) matrix
|
|
37
|
+
const adjList = getAdjList(this.model, false);
|
|
38
|
+
const distances = johnson(adjList);
|
|
39
|
+
handleInfinity(distances);
|
|
40
|
+
// scale the ideal edge length acoording to linkDistance
|
|
41
|
+
const scaledD = scaleMatrix(distances, linkDistance);
|
|
42
|
+
// get positions by MDS
|
|
43
|
+
const positions = runMDS(scaledD);
|
|
44
|
+
let i = 0;
|
|
45
|
+
this.model.forEachNode((node) => {
|
|
46
|
+
const p = positions[i++];
|
|
47
|
+
node.x = p[0] + center[0];
|
|
48
|
+
node.y = p[1] + center[1];
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Handle Infinity values in the distance matrix by replacing them with the maximum finite distance.
|
|
55
|
+
*/
|
|
56
|
+
const handleInfinity = (distances) => {
|
|
57
|
+
let maxDistance = Number.NEGATIVE_INFINITY;
|
|
58
|
+
const infList = [];
|
|
59
|
+
const n = distances.length;
|
|
60
|
+
for (let i = 0; i < n; i++) {
|
|
61
|
+
const row = distances[i];
|
|
62
|
+
const m = row.length;
|
|
63
|
+
for (let j = 0; j < m; j++) {
|
|
64
|
+
const value = row[j];
|
|
65
|
+
if (value === Infinity) {
|
|
66
|
+
infList.push([i, j]);
|
|
67
|
+
}
|
|
68
|
+
else if (maxDistance < value) {
|
|
69
|
+
maxDistance = value;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
for (let k = 0; k < infList.length; k++) {
|
|
74
|
+
const [i, j] = infList[k];
|
|
75
|
+
distances[i][j] = maxDistance;
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* Mds Algorithm
|
|
80
|
+
* @param {array} distances Adjacency matrix of distances
|
|
81
|
+
* @param {number} dimension Dimension of layout, default 2
|
|
82
|
+
* @param {number} linkDistance Ideal length of edges
|
|
83
|
+
* @returns {array} positions Positions of nodes
|
|
84
|
+
*/
|
|
85
|
+
const runMDS = (distances, dimension = 2, linkDistance = DEFAULTS_LAYOUT_OPTIONS.linkDistance) => {
|
|
86
|
+
try {
|
|
87
|
+
// square distances
|
|
88
|
+
const N = distances.length;
|
|
89
|
+
const M = new Matrix(N, N);
|
|
90
|
+
for (let i = 0; i < N; i++) {
|
|
91
|
+
for (let j = 0; j < N; j++) {
|
|
92
|
+
const d = distances[i][j];
|
|
93
|
+
M.set(i, j, -0.5 * d * d);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
// double centre the rows/columns
|
|
97
|
+
const rowMeans = M.mean('row');
|
|
98
|
+
const colMeans = M.mean('column');
|
|
99
|
+
const totalMean = M.mean();
|
|
100
|
+
M.add(totalMean).subRowVector(rowMeans).subColumnVector(colMeans);
|
|
101
|
+
// take the SVD of the double centred matrix, and return the
|
|
102
|
+
// points from it
|
|
103
|
+
const ret = new SingularValueDecomposition(M);
|
|
104
|
+
const eigenValues = Matrix.sqrt(ret.diagonalMatrix).diagonal();
|
|
105
|
+
const U = ret.leftSingularVectors;
|
|
106
|
+
const λ = eigenValues;
|
|
107
|
+
const results = [];
|
|
108
|
+
for (let i = 0; i < U.rows; i++) {
|
|
109
|
+
const pt = [];
|
|
110
|
+
for (let k = 0; k < dimension; k++) {
|
|
111
|
+
pt.push(U.get(i, k) * λ[k]);
|
|
112
|
+
}
|
|
113
|
+
results.push(pt);
|
|
114
|
+
}
|
|
115
|
+
return results;
|
|
116
|
+
}
|
|
117
|
+
catch (_a) {
|
|
118
|
+
const results = [];
|
|
119
|
+
for (let i = 0; i < distances.length; i++) {
|
|
120
|
+
const x = Math.random() * linkDistance;
|
|
121
|
+
const y = Math.random() * linkDistance;
|
|
122
|
+
results.push([x, y]);
|
|
123
|
+
}
|
|
124
|
+
return results;
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
export { MDSLayout, runMDS };
|
|
129
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/algorithm/mds/src/algorithm/mds/index.ts"],"sourcesContent":[null],"names":["MLMatrix"],"mappings":";;;;;;;;;AASA,MAAM,uBAAuB,GAA8B;AACzD,IAAA,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;AACd,IAAA,YAAY,EAAE,EAAE;CACjB;AAED;;;;AAIG;AACG,MAAO,SAAU,SAAQ,UAA4B,CAAA;AAA3D,IAAA,WAAA,GAAA;;QACE,IAAA,CAAA,EAAE,GAAG,KAAK;IAmCZ;IAjCY,iBAAiB,GAAA;AACzB,QAAA,OAAO,uBAAuB;IAChC;IAEgB,MAAM,GAAA;;YACpB,MAAM,EAAE,YAAY,GAAG,uBAAuB,CAAC,YAAY,EAAE,GAC3D,IAAI,CAAC,OAAO;YACd,MAAM,EAAE,MAAM,EAAE,GAAG,iBAAiB,CAAC,IAAI,CAAC,OAAO,CAAC;YAElD,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE;AAChC,YAAA,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE;AACtB,gBAAA,qBAAqB,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,CAAC;gBACzC;AACD,YAAA;;YAGD,MAAM,OAAO,GAAG,UAAU,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC;AAC7C,YAAA,MAAM,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC;YAClC,cAAc,CAAC,SAAS,CAAC;;YAGzB,MAAM,OAAO,GAAG,WAAW,CAAC,SAAS,EAAE,YAAa,CAAC;;AAGrD,YAAA,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC;YAEjC,IAAI,C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AAM,CAAC,GAAG,GAAG,CAAC,mBAAmB;QACjC,MAAM,CAAC,GAAG,WAAW;QAErB,MAAM,OAAO,GAAY,EAAE;AAC3B,QAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE;YAC/B,MAAM,EAAE,GAAa,EAAE;YACvB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,EAAE,CAAC,EAAE,EAAE;AAClC,gBAAA,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AAC5B,YAAA;AACD,YAAA,OAAO,CAAC,IAAI,CAAC,EAAW,CAAC;AAC1B,QAAA;AACD,QAAA,OAAO,OAAO;AACf,IAAA;IAAC,OAAA,EAAA,EAAM;QACN,MAAM,OAAO,GAAY,EAAE;AAC3B,QAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACzC,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,YAAY;YACtC,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,YAAY;YACtC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AACrB,QAAA;AACD,QAAA,OAAO,OAAO;AACf,IAAA;AACH;;;;"}
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
import { __awaiter } from 'tslib';
|
|
2
|
+
import { applySingleNodeLayout } from '../../util/common.js';
|
|
3
|
+
import '@antv/expr';
|
|
4
|
+
import { formatNodeSizeFn, formatFn } from '../../util/format.js';
|
|
5
|
+
import { getAdjList, johnson } from '../../util/math.js';
|
|
6
|
+
import '@antv/util';
|
|
7
|
+
import { normalizeViewport } from '../../util/viewport.js';
|
|
8
|
+
import { BaseLayout } from '../base-layout.js';
|
|
9
|
+
import { runMDS } from '../mds/index.js';
|
|
10
|
+
import { radialNonoverlapForce } from './radial-nonoverlap-force.js';
|
|
11
|
+
|
|
12
|
+
const DEFAULTS_LAYOUT_OPTIONS = {
|
|
13
|
+
focusNode: null,
|
|
14
|
+
linkDistance: 50,
|
|
15
|
+
maxIteration: 1000,
|
|
16
|
+
maxPreventOverlapIteration: 200,
|
|
17
|
+
preventOverlap: false,
|
|
18
|
+
sortStrength: 10,
|
|
19
|
+
strictRadial: true,
|
|
20
|
+
unitRadius: null,
|
|
21
|
+
nodeSize: 10,
|
|
22
|
+
nodeSpacing: 0,
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* <zh/> 径向布局
|
|
26
|
+
*
|
|
27
|
+
* <en/> Radial layout
|
|
28
|
+
*/
|
|
29
|
+
class RadialLayout extends BaseLayout {
|
|
30
|
+
constructor() {
|
|
31
|
+
super(...arguments);
|
|
32
|
+
this.id = 'radial';
|
|
33
|
+
}
|
|
34
|
+
getDefaultOptions() {
|
|
35
|
+
return DEFAULTS_LAYOUT_OPTIONS;
|
|
36
|
+
}
|
|
37
|
+
layout() {
|
|
38
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
39
|
+
const { width, height, center } = normalizeViewport(this.options);
|
|
40
|
+
const n = this.model.nodeCount();
|
|
41
|
+
if (!n || n === 1) {
|
|
42
|
+
return applySingleNodeLayout(this.model, center);
|
|
43
|
+
}
|
|
44
|
+
const { focusNode: propsFocusNode, linkDistance = DEFAULTS_LAYOUT_OPTIONS.linkDistance, maxIteration = DEFAULTS_LAYOUT_OPTIONS.maxIteration, maxPreventOverlapIteration = DEFAULTS_LAYOUT_OPTIONS.maxPreventOverlapIteration, nodeSize, nodeSpacing, preventOverlap, sortBy, sortStrength = DEFAULTS_LAYOUT_OPTIONS.sortStrength, strictRadial, unitRadius: propsUnitRadius, } = this.options;
|
|
45
|
+
const focusNode = (propsFocusNode && this.model.node(propsFocusNode)) ||
|
|
46
|
+
this.model.firstNode();
|
|
47
|
+
// the index of the focusNode in data
|
|
48
|
+
const focusIndex = this.model.nodeIndexOf(focusNode.id);
|
|
49
|
+
// the graph-theoretic distance (shortest path distance) matrix
|
|
50
|
+
const adjList = getAdjList(this.model, false);
|
|
51
|
+
const distances = johnson(adjList);
|
|
52
|
+
const maxDistance = maxToFocus(distances, focusIndex);
|
|
53
|
+
// replace first node in unconnected component to the circle at (maxDistance + 1)
|
|
54
|
+
handleInfinity(distances, focusIndex, maxDistance + 1);
|
|
55
|
+
// the shortest path distance from each node to focusNode
|
|
56
|
+
const focusNodeD = distances[focusIndex];
|
|
57
|
+
const semiWidth = (width - center[0] > center[0] ? center[0] : width - center[0]) ||
|
|
58
|
+
width / 2;
|
|
59
|
+
const semiHeight = (height - center[1] > center[1] ? center[1] : height - center[1]) ||
|
|
60
|
+
height / 2;
|
|
61
|
+
// the maxRadius of the graph
|
|
62
|
+
const maxRadius = Math.min(semiWidth, semiHeight);
|
|
63
|
+
const maxD = Math.max(...focusNodeD);
|
|
64
|
+
// the radius for each nodes away from focusNode
|
|
65
|
+
const radii = [];
|
|
66
|
+
const radiiMap = new Map();
|
|
67
|
+
const unitRadius = propsUnitRadius !== null && propsUnitRadius !== void 0 ? propsUnitRadius : maxRadius / maxD;
|
|
68
|
+
focusNodeD.forEach((value, i) => {
|
|
69
|
+
const v = value * unitRadius;
|
|
70
|
+
radii.push(v);
|
|
71
|
+
radiiMap.set(this.model.nodeAt(i).id, v);
|
|
72
|
+
});
|
|
73
|
+
const idealDistances = eIdealDisMatrix(this.model, distances, linkDistance, radii, unitRadius, sortBy, sortStrength);
|
|
74
|
+
// the initial positions from mds, move the graph to origin, centered at focusNode
|
|
75
|
+
const mdsResult = runMDS(idealDistances, 2, linkDistance);
|
|
76
|
+
const mdsFocus = mdsResult[focusIndex];
|
|
77
|
+
let i = 0;
|
|
78
|
+
this.model.forEachNode((node) => {
|
|
79
|
+
const p = mdsResult[i];
|
|
80
|
+
node.x = p[0] - mdsFocus[0];
|
|
81
|
+
node.y = p[1] - mdsFocus[1];
|
|
82
|
+
i++;
|
|
83
|
+
});
|
|
84
|
+
this.run(maxIteration, idealDistances, radii, focusIndex);
|
|
85
|
+
this.model.forEachNode((node) => {
|
|
86
|
+
node.x += center[0];
|
|
87
|
+
node.y += center[1];
|
|
88
|
+
});
|
|
89
|
+
// stagger the overlapped nodes
|
|
90
|
+
if (preventOverlap) {
|
|
91
|
+
const nodeSizeFunc = formatNodeSizeFn(nodeSize, nodeSpacing, DEFAULTS_LAYOUT_OPTIONS.nodeSize, DEFAULTS_LAYOUT_OPTIONS.nodeSpacing);
|
|
92
|
+
const nonoverlapForceParams = {
|
|
93
|
+
nodeSizeFunc,
|
|
94
|
+
radiiMap,
|
|
95
|
+
width,
|
|
96
|
+
strictRadial: Boolean(strictRadial),
|
|
97
|
+
focusNode,
|
|
98
|
+
maxIteration: maxPreventOverlapIteration,
|
|
99
|
+
k: n / 4.5,
|
|
100
|
+
};
|
|
101
|
+
radialNonoverlapForce(this.model, nonoverlapForceParams);
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
run(maxIteration, idealDistances, radii, focusIndex) {
|
|
106
|
+
const weights = getWeightMatrix(idealDistances);
|
|
107
|
+
const n = this.model.nodeCount();
|
|
108
|
+
const nodes = this.model.nodes();
|
|
109
|
+
const xs = new Float64Array(n);
|
|
110
|
+
const ys = new Float64Array(n);
|
|
111
|
+
for (let i = 0; i < n; i++) {
|
|
112
|
+
xs[i] = nodes[i].x;
|
|
113
|
+
ys[i] = nodes[i].y;
|
|
114
|
+
}
|
|
115
|
+
for (let i = 0; i <= maxIteration; i++) {
|
|
116
|
+
const param = i / maxIteration;
|
|
117
|
+
const vparam = 1 - param;
|
|
118
|
+
for (let i = 0; i < n; i++) {
|
|
119
|
+
if (i === focusIndex)
|
|
120
|
+
continue;
|
|
121
|
+
const vx = xs[i];
|
|
122
|
+
const vy = ys[i];
|
|
123
|
+
const originDis = Math.sqrt(vx * vx + vy * vy);
|
|
124
|
+
const reciODis = originDis === 0 ? 0 : 1 / originDis;
|
|
125
|
+
let xMolecule = 0;
|
|
126
|
+
let yMolecule = 0;
|
|
127
|
+
let denominator = 0;
|
|
128
|
+
for (let j = 0; j < n; j++) {
|
|
129
|
+
// u
|
|
130
|
+
if (i === j)
|
|
131
|
+
continue;
|
|
132
|
+
const ux = xs[j];
|
|
133
|
+
const uy = ys[j];
|
|
134
|
+
// the euclidean distance between v and u
|
|
135
|
+
const edis = Math.sqrt((vx - ux) * (vx - ux) + (vy - uy) * (vy - uy));
|
|
136
|
+
const reciEdis = edis === 0 ? 0 : 1 / edis;
|
|
137
|
+
const idealDis = idealDistances[j][i];
|
|
138
|
+
// same for x and y
|
|
139
|
+
denominator += weights[i][j];
|
|
140
|
+
// x
|
|
141
|
+
xMolecule += weights[i][j] * (ux + idealDis * (vx - ux) * reciEdis);
|
|
142
|
+
// y
|
|
143
|
+
yMolecule += weights[i][j] * (uy + idealDis * (vy - uy) * reciEdis);
|
|
144
|
+
}
|
|
145
|
+
const reciR = radii[i] === 0 ? 0 : 1 / radii[i];
|
|
146
|
+
denominator *= vparam;
|
|
147
|
+
denominator += param * reciR * reciR;
|
|
148
|
+
// x
|
|
149
|
+
xMolecule *= vparam;
|
|
150
|
+
xMolecule += param * reciR * vx * reciODis;
|
|
151
|
+
// y
|
|
152
|
+
yMolecule *= vparam;
|
|
153
|
+
yMolecule += param * reciR * vy * reciODis;
|
|
154
|
+
xs[i] = xMolecule / denominator;
|
|
155
|
+
ys[i] = yMolecule / denominator;
|
|
156
|
+
nodes[i].x = xs[i];
|
|
157
|
+
nodes[i].y = ys[i];
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
const eIdealDisMatrix = (model, distances, linkDistance, radii, unitRadius, sortBy, sortStrength) => {
|
|
163
|
+
const n = distances.length;
|
|
164
|
+
const result = new Array(n);
|
|
165
|
+
const radiusScale = new Array(n);
|
|
166
|
+
for (let i = 0; i < n; i++)
|
|
167
|
+
radiusScale[i] = radii[i] / unitRadius;
|
|
168
|
+
const baseLink = (linkDistance + unitRadius) / 2;
|
|
169
|
+
const sortCache = new Map();
|
|
170
|
+
const sortFn = !sortBy || sortBy === 'data' ? null : formatFn(sortBy, ['node']);
|
|
171
|
+
const isDataSort = sortBy === 'data';
|
|
172
|
+
for (let i = 0; i < n; i++) {
|
|
173
|
+
const row = distances[i];
|
|
174
|
+
const newRow = new Array(n);
|
|
175
|
+
result[i] = newRow;
|
|
176
|
+
const riScale = radiusScale[i] || 1;
|
|
177
|
+
for (let j = 0; j < n; j++) {
|
|
178
|
+
if (i === j) {
|
|
179
|
+
newRow[j] = 0;
|
|
180
|
+
continue;
|
|
181
|
+
}
|
|
182
|
+
const v = row[j];
|
|
183
|
+
if (radii[i] === radii[j]) {
|
|
184
|
+
if (isDataSort) {
|
|
185
|
+
newRow[j] = (v * Math.abs(i - j) * sortStrength) / riScale;
|
|
186
|
+
}
|
|
187
|
+
else if (sortFn) {
|
|
188
|
+
// cache node attribute values
|
|
189
|
+
const nodeI = model.nodeAt(i);
|
|
190
|
+
const nodeJ = model.nodeAt(j);
|
|
191
|
+
let iv = sortCache.get(nodeI.id);
|
|
192
|
+
if (iv === undefined) {
|
|
193
|
+
const raw = sortFn(nodeI._original) || 0;
|
|
194
|
+
iv = typeof raw === 'string' ? raw.charCodeAt(0) : Number(raw || 0);
|
|
195
|
+
sortCache.set(nodeI.id, iv);
|
|
196
|
+
}
|
|
197
|
+
let jv = sortCache.get(nodeJ.id);
|
|
198
|
+
if (jv === undefined) {
|
|
199
|
+
const raw = sortFn(nodeJ._original) || 0;
|
|
200
|
+
jv = typeof raw === 'string' ? raw.charCodeAt(0) : Number(raw || 0);
|
|
201
|
+
sortCache.set(nodeJ.id, jv);
|
|
202
|
+
}
|
|
203
|
+
newRow[j] = (v * Math.abs(iv - jv) * sortStrength) / riScale;
|
|
204
|
+
}
|
|
205
|
+
else {
|
|
206
|
+
newRow[j] = (v * linkDistance) / riScale;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
else {
|
|
210
|
+
newRow[j] = v * baseLink;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
return result;
|
|
215
|
+
};
|
|
216
|
+
const getWeightMatrix = (idealDistances) => {
|
|
217
|
+
const rows = idealDistances.length;
|
|
218
|
+
const cols = idealDistances[0].length;
|
|
219
|
+
const result = [];
|
|
220
|
+
for (let i = 0; i < rows; i++) {
|
|
221
|
+
const row = [];
|
|
222
|
+
for (let j = 0; j < cols; j++) {
|
|
223
|
+
if (idealDistances[i][j] !== 0) {
|
|
224
|
+
row.push(1 / (idealDistances[i][j] * idealDistances[i][j]));
|
|
225
|
+
}
|
|
226
|
+
else {
|
|
227
|
+
row.push(0);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
result.push(row);
|
|
231
|
+
}
|
|
232
|
+
return result;
|
|
233
|
+
};
|
|
234
|
+
const handleInfinity = (matrix, focusIndex, step) => {
|
|
235
|
+
const n = matrix.length;
|
|
236
|
+
for (let i = 0; i < n; i++) {
|
|
237
|
+
// matrix 关注点对应行的 Inf 项
|
|
238
|
+
if (matrix[focusIndex][i] === Infinity) {
|
|
239
|
+
matrix[focusIndex][i] = step;
|
|
240
|
+
matrix[i][focusIndex] = step;
|
|
241
|
+
// 遍历 matrix 中的 i 行,i 行中非 Inf 项若在 focus 行为 Inf,则替换 focus 行的那个 Inf
|
|
242
|
+
for (let j = 0; j < n; j++) {
|
|
243
|
+
if (matrix[i][j] !== Infinity && matrix[focusIndex][j] === Infinity) {
|
|
244
|
+
matrix[focusIndex][j] = step + matrix[i][j];
|
|
245
|
+
matrix[j][focusIndex] = step + matrix[i][j];
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
// 处理其他行的 Inf。根据该行对应点与 focus 距离以及 Inf 项点 与 focus 距离,决定替换值
|
|
251
|
+
for (let i = 0; i < n; i++) {
|
|
252
|
+
if (i === focusIndex) {
|
|
253
|
+
continue;
|
|
254
|
+
}
|
|
255
|
+
for (let j = 0; j < n; j++) {
|
|
256
|
+
if (matrix[i][j] === Infinity) {
|
|
257
|
+
let minus = Math.abs(matrix[focusIndex][i] - matrix[focusIndex][j]);
|
|
258
|
+
minus = minus === 0 ? 1 : minus;
|
|
259
|
+
matrix[i][j] = minus;
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
};
|
|
264
|
+
/**
|
|
265
|
+
* Get the maximum finite distance from the focus node to other nodes
|
|
266
|
+
*/
|
|
267
|
+
const maxToFocus = (matrix, focusIndex) => {
|
|
268
|
+
const row = matrix[focusIndex];
|
|
269
|
+
let max = 0;
|
|
270
|
+
for (let i = 0; i < row.length; i++) {
|
|
271
|
+
if (row[i] === Infinity)
|
|
272
|
+
continue;
|
|
273
|
+
max = Math.max(max, row[i]);
|
|
274
|
+
}
|
|
275
|
+
return max;
|
|
276
|
+
};
|
|
277
|
+
|
|
278
|
+
export { RadialLayout };
|
|
279
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/algorithm/radial/src/algorithm/radial/index.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;AAeA,MAAM,uBAAuB,GAAiC;AAC5D,IAAA,SAAS,EAAE,IAAI;AACf,IAAA,YAAY,EAAE,EAAE;AAChB,IAAA,YAAY,EAAE,IAAI;AAClB,IAAA,0BAA0B,EAAE,GAAG;AAC/B,IAAA,cAAc,EAAE,KAAK;AACrB,IAAA,YAAY,EAAE,EAAE;AAChB,IAAA,YAAY,EAAE,IAAI;AAClB,IAAA,UAAU,EAAE,IAAI;AAChB,IAAA,QAAQ,EAAE,EAAE;AACZ,IAAA,WAAW,EAAE,CAAC;CACf;AAED;;;;AAIG;AACG,MAAO,YAA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0 +1,127 @@
|
|
|
1
|
+
const SPEED_DIVISOR = 800;
|
|
2
|
+
const DEFAULTS_LAYOUT_OPTIONS = {
|
|
3
|
+
maxIteration: 10,
|
|
4
|
+
width: 10,
|
|
5
|
+
speed: 100,
|
|
6
|
+
gravity: 10,
|
|
7
|
+
k: 5,
|
|
8
|
+
};
|
|
9
|
+
const radialNonoverlapForce = (model, options) => {
|
|
10
|
+
const mergedOptions = Object.assign(Object.assign({}, DEFAULTS_LAYOUT_OPTIONS), options);
|
|
11
|
+
const { maxIteration, width, k, speed = DEFAULTS_LAYOUT_OPTIONS.speed, strictRadial, focusNode, radiiMap, nodeSizeFunc, } = mergedOptions;
|
|
12
|
+
const earlyStopThreshold = k * 0.002;
|
|
13
|
+
const displacements = new Map();
|
|
14
|
+
const maxDisplacement = width / 10;
|
|
15
|
+
for (let i = 0; i < maxIteration; i++) {
|
|
16
|
+
model.forEachNode((node) => {
|
|
17
|
+
displacements.set(node.id, { x: 0, y: 0 });
|
|
18
|
+
});
|
|
19
|
+
// 给重叠的节点增加斥力
|
|
20
|
+
getRepulsion(model, displacements, k, radiiMap, nodeSizeFunc);
|
|
21
|
+
const avgDisplacement = updatePositions(model, displacements, speed, strictRadial, focusNode, maxDisplacement, radiiMap);
|
|
22
|
+
if (avgDisplacement < earlyStopThreshold) {
|
|
23
|
+
break;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
const getRepulsion = (model, displacements, k, radiiMap, nodeSizeFunc) => {
|
|
28
|
+
let i = 0;
|
|
29
|
+
model.forEachNode((nodeU) => {
|
|
30
|
+
let j = 0;
|
|
31
|
+
model.forEachNode((nodeV) => {
|
|
32
|
+
if (j <= i) {
|
|
33
|
+
j++;
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
if (nodeU.id === nodeV.id)
|
|
37
|
+
return;
|
|
38
|
+
// nodeU and nodeV are not on the same circle, return
|
|
39
|
+
if (radiiMap.get(nodeU.id) !== radiiMap.get(nodeV.id))
|
|
40
|
+
return;
|
|
41
|
+
let vecx = nodeU.x - nodeV.x;
|
|
42
|
+
let vecy = nodeU.y - nodeV.y;
|
|
43
|
+
let vecLength = Math.sqrt(vecx * vecx + vecy * vecy);
|
|
44
|
+
// If the two nodes are exactly at the same position, we set a small distance between them
|
|
45
|
+
if (vecLength === 0) {
|
|
46
|
+
vecLength = 1;
|
|
47
|
+
const sign = i > j ? 1 : -1;
|
|
48
|
+
vecx = 0.01 * sign;
|
|
49
|
+
vecy = 0.01 * sign;
|
|
50
|
+
}
|
|
51
|
+
const nodeSizeU = Math.max(...nodeSizeFunc(nodeU._original));
|
|
52
|
+
const nodeSizeV = Math.max(...nodeSizeFunc(nodeV._original));
|
|
53
|
+
// these two nodes overlap
|
|
54
|
+
if (vecLength < nodeSizeV / 2 + nodeSizeU / 2) {
|
|
55
|
+
const common = (k * k) / vecLength;
|
|
56
|
+
const dispU = displacements.get(nodeU.id);
|
|
57
|
+
const dispV = displacements.get(nodeV.id);
|
|
58
|
+
const deltaX = (vecx / vecLength) * common;
|
|
59
|
+
const deltaY = (vecy / vecLength) * common;
|
|
60
|
+
displacements.set(nodeU.id, {
|
|
61
|
+
x: dispU.x + deltaX,
|
|
62
|
+
y: dispU.y + deltaY,
|
|
63
|
+
});
|
|
64
|
+
displacements.set(nodeV.id, {
|
|
65
|
+
x: dispV.x - deltaX,
|
|
66
|
+
y: dispV.y - deltaY,
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
j++;
|
|
70
|
+
});
|
|
71
|
+
i++;
|
|
72
|
+
});
|
|
73
|
+
};
|
|
74
|
+
const updatePositions = (model, displacements, speed, strictRadial, focusNode, maxDisplacement, radiiMap) => {
|
|
75
|
+
if (strictRadial) {
|
|
76
|
+
model.forEachNode((node) => {
|
|
77
|
+
const vx = node.x - focusNode.x;
|
|
78
|
+
const vy = node.y - focusNode.y;
|
|
79
|
+
const vLength = Math.sqrt(vx * vx + vy * vy);
|
|
80
|
+
let vpx = vy / vLength;
|
|
81
|
+
let vpy = -vx / vLength;
|
|
82
|
+
const disp = displacements.get(node.id);
|
|
83
|
+
const diLength = Math.sqrt(disp.x * disp.x + disp.y * disp.y);
|
|
84
|
+
let alpha = Math.acos((vpx * disp.x + vpy * disp.y) / diLength);
|
|
85
|
+
if (alpha > Math.PI / 2) {
|
|
86
|
+
alpha -= Math.PI / 2;
|
|
87
|
+
vpx *= -1;
|
|
88
|
+
vpy *= -1;
|
|
89
|
+
}
|
|
90
|
+
const tdispLength = Math.cos(alpha) * diLength;
|
|
91
|
+
displacements.set(node.id, {
|
|
92
|
+
x: vpx * tdispLength,
|
|
93
|
+
y: vpy * tdispLength,
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
// move
|
|
98
|
+
let totalDisplacement = 0;
|
|
99
|
+
let nodeCount = 0;
|
|
100
|
+
model.forEachNode((node) => {
|
|
101
|
+
if (node.id === focusNode.id) {
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
const disp = displacements.get(node.id);
|
|
105
|
+
const distLength = Math.sqrt(disp.x * disp.x + disp.y * disp.y);
|
|
106
|
+
if (distLength > 0) {
|
|
107
|
+
const limitedDist = Math.min(maxDisplacement * (speed / SPEED_DIVISOR), distLength);
|
|
108
|
+
node.x += (disp.x / distLength) * limitedDist;
|
|
109
|
+
node.y += (disp.y / distLength) * limitedDist;
|
|
110
|
+
if (strictRadial) {
|
|
111
|
+
let vx = node.x - focusNode.x;
|
|
112
|
+
let vy = node.y - focusNode.y;
|
|
113
|
+
const nfDis = Math.sqrt(vx * vx + vy * vy);
|
|
114
|
+
vx = (vx / nfDis) * radiiMap.get(node.id);
|
|
115
|
+
vy = (vy / nfDis) * radiiMap.get(node.id);
|
|
116
|
+
node.x = focusNode.x + vx;
|
|
117
|
+
node.y = focusNode.y + vy;
|
|
118
|
+
}
|
|
119
|
+
totalDisplacement += limitedDist;
|
|
120
|
+
nodeCount++;
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
return nodeCount > 0 ? totalDisplacement / nodeCount : 0;
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
export { radialNonoverlapForce };
|
|
127
|
+
//# sourceMappingURL=radial-nonoverlap-force.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radial-nonoverlap-force.js","sources":["../../../src/algorithm/radial/src/algorithm/radial/radial-nonoverlap-force.ts"],"sourcesContent":[null],"names":[],"mappings":"AASA,MAAM,aAAa,GAAG,GAAG;AAuBzB,MAAM,uBAAuB,GAA0C;AACrE,IAAA,YAAY,EAAE,EAAE;AAChB,IAAA,KAAK,EAAE,EAAE;AACT,IAAA,KAAK,EAAE,GAAG;AACV,IAAA,OAAO,EAAE,EAAE;AACX,IAAA,CAAC,EAAE,CAAC;CACL;MAEY,qBAAqB,GAAG,CACnC,KAAe,EACf,OAAqC,KACnC;AACF,IAAA,MAAM,aAAa,GAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAQ,uBAAuB,CAAA,EAAK,OAAO,CAAE;IAEhE,MAAM,EACJ,YAAY,EACZ,KAAK,EACL,CAAC,EACD,KAAK,GAAG,uBAAuB,CAAC,KAAK,EACrC,YAAY,EACZ,SAAS,EACT,QAAQ,EACR,YAAY,GACb,GAAG,aAAa;AACjB,IAAA,MAAM,kBAAkB,GAAG,CAAC,GAAG,KAAK;AAEpC,IAAA,MAAM,aAAa,GAAoB,IAAI,GAAG,EAAE;AAChD,IAAA,MAAM,eAAe,GAAG,KAAK,GAAG,EAAE;IAElC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,YAAY,EAAE,CAAC,EAAE,EAAE;AACrC,QAAA,KAAK,CAAC,WAAW,CAAC,CAAC,IAAI,KAAI;AACzB,YAAA,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE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KAAK,IAAI,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAE;gBAC1C,IAAI,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,GAAG,EAAE;gBACzB,IAAI,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,GAAG,EAAE;AAC1B,YAAA;YAED,iBAAiB,IAAI,WAAW;AAChC,YAAA,SAAS,EAAE;AACZ,QAAA;AACH,IAAA,CAAC,CAAC;AAEF,IAAA,OAAO,SAAS,GAAG,CAAC,GAAG,iBAAiB,GAAG,SAAS,GAAG,CAAC;AAC1D,CAAC;;;;"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { __awaiter } from 'tslib';
|
|
2
|
+
import '@antv/expr';
|
|
3
|
+
import '@antv/util';
|
|
4
|
+
import { normalizeViewport } from '../../util/viewport.js';
|
|
5
|
+
import { BaseLayout } from '../base-layout.js';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* <zh/> 随机布局
|
|
9
|
+
*
|
|
10
|
+
* <en/> Random layout
|
|
11
|
+
*/
|
|
12
|
+
class RandomLayout extends BaseLayout {
|
|
13
|
+
constructor() {
|
|
14
|
+
super(...arguments);
|
|
15
|
+
this.id = 'random';
|
|
16
|
+
}
|
|
17
|
+
getDefaultOptions() {
|
|
18
|
+
return {
|
|
19
|
+
center: [0, 0],
|
|
20
|
+
width: 300,
|
|
21
|
+
height: 300,
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
layout() {
|
|
25
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
26
|
+
const { width, height, center } = normalizeViewport(this.options);
|
|
27
|
+
this.model.forEachNode((node) => {
|
|
28
|
+
node.x = randomCoord(width) + center[0];
|
|
29
|
+
node.y = randomCoord(height) + center[1];
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
const layoutScale = 0.9;
|
|
35
|
+
/**
|
|
36
|
+
* <zh/> 生成随机坐标
|
|
37
|
+
*
|
|
38
|
+
* <en/> Generate random coordinates
|
|
39
|
+
*/
|
|
40
|
+
const randomCoord = (size) => (Math.random() - 0.5) * layoutScale * size;
|
|
41
|
+
|
|
42
|
+
export { RandomLayout };
|
|
43
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/algorithm/random/src/algorithm/random/index.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;AAMA;;;;AAIG;AACG,MAAO,YAAa,SAAQ,UAA+B,CAAA;AAAjE,IAAA,WAAA,GAAA;;QACE,IAAA,CAAA,EAAE,GAAG,QAAQ;IAkBf;IAhBY,iBAAiB,GAAA;QACzB,OAAO;AACL,YAAA,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;AACd,YAAA,KAAK,EAAE,GAAG;AACV,YAAA,MAAM,EAAE,GAAG;SACZ;IACH;IAEgB,MAAM,GAAA;;AACpB,YAAA,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,iBAAiB,CAAC,IAAI,CAAC,OAAO,CAAC;YAEjE,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,IAAI,KAAI;AAC9B,gBAAA,IAAI,CAAC,CAAC,GAAG,WAAW,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC;AACvC,gBAAA,IAAI,CAAC,CAAC,GAAG,WAAW,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC;AAC1C,YAAA,CAAC,CAAC;QACJ,CAAC,CAAA;AAAA,IAAA;AACF;AAED,MAAM,WAAW,GAAG,GAAG;AAEvB;;;;AAIG;AACH,MAAM,WAAW,GAAG,CAAC,IAAY,KAC/B,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,GAAG,IAAI,WAAW,GAAG,IAAI;;;;"}
|
package/esm/index.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export { AntVDagreLayout } from './algorithm/antv-dagre/index.js';
|
|
2
|
+
export { BaseLayout, isLayoutWithIterations } from './algorithm/base-layout.js';
|
|
3
|
+
export { CircularLayout } from './algorithm/circular/index.js';
|
|
4
|
+
export { ComboCombinedLayout } from './algorithm/combo-combined/index.js';
|
|
5
|
+
export { ConcentricLayout } from './algorithm/concentric/index.js';
|
|
6
|
+
export { D3ForceLayout } from './algorithm/d3-force/index.js';
|
|
7
|
+
export { D3Force3DLayout } from './algorithm/d3-force-3d/index.js';
|
|
8
|
+
export { DagreLayout } from './algorithm/dagre/index.js';
|
|
9
|
+
export { ForceLayout } from './algorithm/force/index.js';
|
|
10
|
+
export { ForceAtlas2Layout } from './algorithm/force-atlas2/index.js';
|
|
11
|
+
export { FruchtermanLayout } from './algorithm/fruchterman/index.js';
|
|
12
|
+
export { GridLayout } from './algorithm/grid/index.js';
|
|
13
|
+
export { MDSLayout } from './algorithm/mds/index.js';
|
|
14
|
+
export { RadialLayout } from './algorithm/radial/index.js';
|
|
15
|
+
export { RandomLayout } from './algorithm/random/index.js';
|
|
16
|
+
export { GraphLib, initNodePosition } from './model/data.js';
|
|
17
|
+
export { registry } from './registry.js';
|
|
18
|
+
export { RuntimeContext } from './runtime/context.js';
|
|
19
|
+
export { Supervisor } from './runtime/supervisor.js';
|
|
20
|
+
export { isArray } from './util/array.js';
|
|
21
|
+
export { applySingleNodeLayout } from './util/common.js';
|
|
22
|
+
export { evaluateExpression } from './util/expr.js';
|
|
23
|
+
export { formatFn, formatNodeSizeFn, formatNumberFn, formatSizeFn } from './util/format.js';
|
|
24
|
+
export { floydWarshall, getAdjList, getAdjMatrix, getEuclideanDistance, getLayoutBBox, graphTreeDfs, johnson, scaleMatrix } from './util/math.js';
|
|
25
|
+
export { assignDefined, getNestedValue, setNestedValue } from './util/object.js';
|
|
26
|
+
export { orderByDegree, orderById, orderBySorter, orderByTopology } from './util/order.js';
|
|
27
|
+
export { parsePoint, toPointObject } from './util/point.js';
|
|
28
|
+
export { isSize, parseSize } from './util/size.js';
|
|
29
|
+
export { normalizeViewport } from './util/viewport.js';
|
|
30
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|