d2layouts

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2026 License: MPL-2.0 Imports: 14 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

Jump to

Keyboard shortcuts

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