Skip to main content

Module layout

Module layout 

Source
Expand description

The grid view’s automatic layout (Cytoscape’s cose is quadratic in the nodes on every iteration: RealGrid’s 4875 substations do not finish).

Each connected component is projected by PivotMDS, which keeps graph distances (a force layout alone, even multilevel, leaves a large grid folded), then refined by local forces — Fruchterman–Reingold with repulsion only between nodes in neighbouring cells, so a step is linear — which pull apart what the projection put on top of each other. Linear in nodes and edges times the pivots, and deterministic on one target: the same grid, the same layout. Between targets sin, cos and powf round differently, and the steps amplify it: RealGrid on wasm is the same picture as natively, each node a fifth of a line’s length or so away.

Functions§

force
Positions for n nodes joined by edges, in units of [K]: each connected component by [pivot_mds], refined by local forces, the components packed in rows, the largest first.