On this page

LayoutStream

linnet_py Class

LayoutStream()

A synchronous iterator that advances the native force solver in batches.

Topology is fixed for the lifetime of the stream. Frames contain only coordinates and progress, so notebook viewers can retain their SVG elements.

Member details

node_names

Property · read-only
#
node_names: list[str]

Node names in the same stable index order as every frame's coordinates.

endpoints

Property · read-only
#
endpoints: list[tuple[Optional[int], Optional[int]]]

Source and sink node indices; a missing endpoint denotes a dangling edge.

from_dot

Static method
#
from_dot(dot: str, *, every: int = 4, steps: int = 200, epochs: int = 8, seed: int = 1, step: float = 0.02, cool: float = 0.85, spring_strength: float = 1.0, repulsion: float = 1.5, length_scale: float = 1.0, depth_scale: float = 1.0, flattening_end: float = 0.5, delta: float = 0.1, early_tolerance: float = 1e-06) -> LayoutStream

Start a force-layout preview from a single DOT graph.

This preview uses native graph geometry, without Typst label measurement or final edge-label relaxation. A new stream restarts from the same seed.

Parameters

NameTypeDefaultDescription
dotstr——
everyint4—
stepsint200—
epochsint8—
seedint1—
stepfloat0.02—
coolfloat0.85—
spring_strengthfloat1.0—
repulsionfloat1.5—
length_scalefloat1.0—
depth_scalefloat1.0—
flattening_endfloat0.5—
deltafloat0.1—
early_tolerancefloat1e-06—

__iter__

Method
#
__iter__() -> LayoutStream

No description is available for this member.

__next__

Method
#
__next__() -> LayoutFrame

No description is available for this member.