Skip to content

Interface: Graph3dTraceForce ​

Options of the force layout in three dimensions: of arrangement: 'force', and of the nodes within their planes with 'layered' (where linkdistance defaults to layered.ranksep). Lengths are layout units.

Properties ​

PropertyTypeDefault valueDescription
algorithm?"spring" | "forceatlas2""spring"The model of the simulation. 'spring': links are springs with a rest length and every two nodes repel (the d3-force model); even link lengths, the usual choice. 'forceatlas2': links pull in proportion to their length and nodes repel in proportion to their degrees (ForceAtlas2); it pulls communities apart better in graphs with hubs.
charge?number-60'spring': the strength of the force between every two nodes: negative values push them apart (the more negative, the larger and more open the layout), positive ones pull them together.
collide?booleantrueKeep nodes from overlapping, each taken as a circle around its marker or box.
collidepadding?number2With collide: the room left between two nodes, in layout units. Minimum: 0
gravity?numberundefinedThe pull toward the center, which keeps the parts of a graph that are not linked from drifting apart. 'spring': each connected part is pulled as a whole (default 0.05). 'forceatlas2': every node is pulled, the more links it has the harder (default 1). Minimum: 0
groupstrength?number0The pull of every node toward the middle of its group (node.group), which keeps the nodes of a group together even where the links do not. 0.05 to 0.3 are usual values. Minimum: 0
linkdistance?number30'spring': the rest length of a link, in layout units (CSS px before the graph is fitted to the plot area). Links end up longer where the repulsion of their nodes stretches them. Minimum: 0
linkstrength?numberundefined'spring': how hard a link pulls its nodes to its rest length, 0 to 1. Default: per link, 1 / the smaller degree of its two nodes, so that the links of a hub do not crush its neighbours onto it. Range: 0 – 1
linkweight?"none" | "strength" | "distance""strength"What link.value does to a link: 'strength': a larger value pulls harder; 'distance': a larger value makes the link shorter ('spring' only; as 'strength' for 'forceatlas2'); 'none': nothing.
linlog?booleanfalse'forceatlas2': links pull with the logarithm of their length instead of the length: tighter and better separated clusters.
scalingratio?numberundefined'forceatlas2': the repulsion between nodes; a larger value gives a larger, more open layout. Default: 10, or 1 with linlog. Minimum: 0
seed?number1Seed of the generator that separates nodes at the same place. The layout is deterministic: the same figure gives the same positions everywhere; another seed gives another, equally valid, layout of graphs that have such nodes. Minimum: 0
ticks?numberundefinedSteps of the simulation from its start to rest; the cooling is spread over them. More steps untangle a graph better and take longer. Default: 600 up to 500 nodes, fewer for larger graphs (300 from 1,000 to 3,000 nodes, 90 at 10,000). Minimum: 1

Released under the MIT License.