d2layouts

package
v0.6.8 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultRouter added in v0.6.2

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
d2elklayout is a wrapper around the Javascript port of ELK.
d2elklayout is a wrapper around the Javascript port of ELK.
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