Performs offline 3D layout of large graphs and saves results to the disk. This is somewhat experimental.
The results are saved into
data folder by default.
// Assume you have a huge graph (instance of ngraph.graph):var graph = ;var createLayout = ;var layout = ;layout;
This will run the 3d
force-based layout for
500 iterations. Each
iteration is saved into
The layout can be configured with options argument:
// run only 100 iterationsvar layout =;
After all iterations are completed, the final
positions.bin file will be
outDir. This file consists of Int32's written in Little Endian format.
Each node of the graph is given three integers in the output file. The order
of positions matches the order of graph traversal for
outDir contains data from previous run the layouter will attempt to resume
based on the last saved iteration. If you don't want this, you can tell it to
overwrite existing files:
var overwrite = true; layout.run(overwrite);
With npm do:
npm install ngraph.offline.layout