Linnet · latest
On this page

LayoutStream

symbolica.community.graph 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, spring_length_scale: float = 1.0, external_pull: float = 0.0, external_pull_balance: float = 1.0, external_pull_attachment: float = 1.0, initial_repulsion: float = 1.0, repulsion_growth: float = 0.7, 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. spring_length_scale changes spring rest lengths without scaling repulsion. external_pull_attachment multiplies the extra demand from distributed owners sharing an external X coordinate; zero disables that correction. external_pull applies a constant left/right pull for mixed external flows, or a radial pull when all flows agree. external_pull_balance is a finite nonnegative exponent on topology weights: 0 gives uniform pull, 1 (the default) balances topology, and values above 1 strengthen balancing. It does not change radial pull. initial_repulsion grows to one over the repulsion_growth fraction of the iteration budget.

Parameters

NameTypeDefaultDescription
dotstr——
everyint4—
stepsint200—
epochsint8—
seedint1—
stepfloat0.02—
coolfloat0.85—
spring_strengthfloat1.0—
repulsionfloat1.5—
length_scalefloat1.0—
spring_length_scalefloat1.0—
external_pullfloat0.0—
external_pull_balancefloat1.0—
external_pull_attachmentfloat1.0—
initial_repulsionfloat1.0—
repulsion_growthfloat0.7—
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.