...

Package d2near

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

Overview ▾

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

Variables

var HorizontalCenterNears = set{
    "center-left":  {},
    "center-right": {},
}
var NonCenterNears = set{
    "top-left":     {},
    "top-right":    {},
    "bottom-left":  {},
    "bottom-right": {},
}
var VerticalCenterNears = set{
    "top-center":    {},
    "bottom-center": {},
}

func Layout

func Layout(ctx context.Context, g *d2graph.Graph, constantNearGraphs []*d2graph.Graph) error

Layout finds the shapes which are assigned constant near keywords and places them.