d2layouts

package
v0.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 7, 2026 License: MPL-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultRouter

func DefaultRouter(ctx context.Context, graph *d2graph.Graph, edges []*d2graph.Edge) error

func ExtractSubgraph

func ExtractSubgraph(container *d2graph.Object, includeSelf bool) (nestedGraph *d2graph.Graph, externalEdges []*d2graph.Edge, externalEdgeIDs []edgeIDs)

func FitToGraph

func FitToGraph(container *d2graph.Object, nestedGraph *d2graph.Graph, padding geo.Spacing)

func InjectNested

func InjectNested(container *d2graph.Object, nestedGraph *d2graph.Graph, isRoot bool)

func LayoutNested

func LayoutNested(ctx context.Context, g *d2graph.Graph, graphInfo GraphInfo, coreLayout d2graph.LayoutGraph, edgeRouter d2graph.RouteEdges) error

func PositionNested

func PositionNested(container *d2graph.Object, nestedGraph *d2graph.Graph)

func SaveChildrenOrder

func SaveChildrenOrder(container *d2graph.Object) (restoreOrder func())

func SaveOrder

func SaveOrder(g *d2graph.Graph) (restoreOrder func())

Types

type DiagramType

type DiagramType string
const (
	DefaultGraphType  DiagramType = ""
	ConstantNearGraph DiagramType = "constant-near"
	GridDiagram       DiagramType = "grid-diagram"
	SequenceDiagram   DiagramType = "sequence-diagram"
)

a grid diagram at a constant near is

type GraphInfo

type GraphInfo struct {
	IsConstantNear bool
	DiagramType    DiagramType
}

func NestedGraphInfo

func NestedGraphInfo(obj *d2graph.Object) (gi GraphInfo)

Directories

Path Synopsis
Package d2elklayout adapts D2 graphs to the native Go port of ELK.
Package d2elklayout adapts D2 graphs to the native Go port of ELK.
Package d2layoutfeatures contains legacy string names for layout plugin capabilities.
Package d2layoutfeatures contains legacy string names for layout plugin capabilities.
d2near applies near keywords when they're constants Intended to be run as the last stage of layout after the diagram has already undergone layout
d2near applies near keywords when they're constants Intended to be run as the last stage of layout after the diagram has already undergone layout
Package d2talalayout adapts D2 graphs to TALA's layout and edge-routing engine.
Package d2talalayout adapts D2 graphs to TALA's layout and edge-routing engine.
internal/engine
Package engine composes TALA's layout stages into one deterministic layout.
Package engine composes TALA's layout stages into one deterministic layout.
internal/graphbounds
Package graphbounds computes work-accounted bounds for mutable TALA nodes.
Package graphbounds computes work-accounted bounds for mutable TALA nodes.
internal/graphjson
Package graphjson serializes and reconstructs TALA layout graphs.
Package graphjson serializes and reconstructs TALA layout graphs.
internal/grouping
Package grouping discovers and manages layout groups that temporarily move as a single vessel.
Package grouping discovers and manages layout groups that temporarily move as a single vessel.
internal/hierarchy
Package hierarchy discovers DAG-like subgraphs, ranks their nodes, and places them in layers.
Package hierarchy discovers DAG-like subgraphs, ranks their nodes, and places them in layers.
internal/invariant
Package invariant classifies violations of TALA's internal layout invariants.
Package invariant classifies violations of TALA's internal layout invariants.
internal/labelgeom
Package labelgeom contains renderer-compatible label geometry that is shared by the mutable graph bounds and label-placement domains.
Package labelgeom contains renderer-compatible label geometry that is shared by the mutable graph bounds and label-placement domains.
internal/labeling
Package labeling places node, icon, edge, and arrowhead labels on a routed layout graph.
Package labeling places node, icon, edge, and arrowhead labels on a routed layout graph.
internal/layoutgraph
Package layoutgraph defines the mutable state used by TALA's layout algorithms.
Package layoutgraph defines the mutable state used by TALA's layout algorithms.
internal/limits
Package limits provides the engine's topology ceilings and reusable work accounting primitives.
Package limits provides the engine's topology ceilings and reusable work accounting primitives.
internal/loops
Package loops computes deterministic self-edge routes and the node extents those routes reserve during placement.
Package loops computes deterministic self-edge routes and the node extents those routes reserve during placement.
internal/nodeshape
Package nodeshape defines the shape-specific port and label-placement policy used by TALA nodes.
Package nodeshape defines the shape-specific port and label-placement policy used by TALA nodes.
internal/packing
Package packing arranges and compacts disconnected graph components without changing their internal layout or routed edge geometry.
Package packing arranges and compacts disconnected graph components without changing their internal layout or routed edge geometry.
internal/placement
Package placement positions nodes and refines their geometry before routing.
Package placement positions nodes and refines their geometry before routing.
internal/placementcost
Package placementcost evaluates candidate node geometry for placement and refinement algorithms.
Package placementcost evaluates candidate node geometry for placement and refinement algorithms.
internal/proximity
Package proximity discovers layout relationships between nearby nodes.
Package proximity discovers layout relationships between nearby nodes.
internal/quality
Package quality evaluates completed TALA layouts.
Package quality evaluates completed TALA layouts.
internal/routing
Package routing builds orthogonal visibility graphs, searches them for edge routes, and applies the routing post-processing stages.
Package routing builds orthogonal visibility graphs, searches them for edge routes, and applies the routing post-processing stages.
internal/trees
Package trees owns TALA's tree discovery, preprocessing, orientation, and placement algorithms.
Package trees owns TALA's tree discovery, preprocessing, orientation, and placement algorithms.
internal/typedpool
Package typedpool provides a type-safe wrapper around sync.Pool.
Package typedpool provides a type-safe wrapper around sync.Pool.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL