Skip to content

Interface: LayoutGraph ​

A graph as a layout sees it: node and link counts and one typed array per property.

Properties ​

PropertyModifierTypeDescription
group?readonlyInt32Array<ArrayBufferLike>Index of each node's group (node.group), -1 for none; groups is the number of groups.
groups?readonlynumber-
halfHeightreadonlyFloat64Array-
halfWidthreadonlyFloat64ArrayHalf the extent of each node along x and y, in layout units: a marker's radius twice, or half a box node's width and height. Layouts keep nodes at least this far apart (plus their own spacing options).
nodesreadonlynumberNumber of nodes; nodes are 0 … nodes − 1.
parent?readonlyInt32Array<ArrayBufferLike>Tree input (ids / parents, as the hierarchical traces take): each node's parent, -1 for a root. When absent, a tree layout derives the parents from the links (a spanning forest from the nodes without incoming links).
sourcereadonlyInt32ArrayNode index of each link's source and target. Only links between two existing nodes are here (the trace drops the others), self-links (source[k] === target[k]) and parallel links included: a layout that cannot use them skips them.
targetreadonlyInt32Array-
value?readonlyFloat64Array<ArrayBufferLike>A value per node that a layout may place by (a dendrogram's branch height). NaN: none.
weightreadonlyFloat64Arraylink.value of each link, 1 where it has none. Finite and positive.
xreadonlyFloat64ArrayPositions the figure gives (node.x, node.y, and node.z for graph3d), NaN where it gives none. A node with all of its coordinates given is pinned: a layout that moves nodes (force) leaves it there and lets it act on the others; a layout that places every node itself (layered, tree) ignores these. A node with some coordinates given is held on those and free along the others.
yreadonlyFloat64Array-
z?readonlyFloat64Array<ArrayBufferLike>-

Released under the MIT License.