Skip to content

@graphty/layout / index / bfs

Function: bfs() ​

bfs(s, options?): LayoutResult

Defined in: indexed/bfs.ts:66

Nodes in layers by hop distance from start, laid out as the multipartite layout lays out its layers: with vertical alignment layer k is a column, its nodes in the order the search reached them. In 3D the layout lies in the plane of the centre's z.

Parameters ​

s ​

GraphSnapshot

the snapshot; a directed one is read as its undirected derived graph

options? ​

BfsLayoutOptions = {}

scale is the distance of the farthest node from the centre; start the first layer

Returns ​

LayoutResult

the layout

Throws ​

when the graph is not connected