...

Package d2dagrelayout

import "oss.terrastruct.com/d2/d2layouts/d2dagrelayout"
Overview
Index

Overview ▾

Constants

const (
    MIN_RANK_SEP    = 60
    EDGE_LABEL_GAP  = 20
    DEFAULT_PADDING = 30.
    MIN_SPACING     = 10.
)

Variables

var DefaultOpts = ConfigurableOpts{
    NodeSep: 60,
    EdgeSep: 20,
}

func DefaultLayout

func DefaultLayout(ctx context.Context, g *d2graph.Graph) (err error)

func Layout

func Layout(ctx context.Context, g *d2graph.Graph, opts *ConfigurableOpts) (err error)

func NewObjectMapper

func NewObjectMapper() *objectMapper

type ConfigurableOpts

type ConfigurableOpts struct {
    NodeSep int `json:"nodesep"`
    EdgeSep int `json:"edgesep"`
}

type DagreEdge

type DagreEdge struct {
    Points []*geo.Point `json:"points"`
}

type DagreNode

type DagreNode struct {
    ID     string  `json:"id"`
    X      float64 `json:"x"`
    Y      float64 `json:"y"`
    Width  float64 `json:"width"`
    Height float64 `json:"height"`
}