d2sequence

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: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LIFELINE_Z_INDEX = 1
	SPAN_Z_INDEX     = 2
	GROUP_Z_INDEX    = 3
	MESSAGE_Z_INDEX  = 4
	NOTE_Z_INDEX     = 5
)
View Source
const EDGE_GROUP_LABEL_PADDING = 20.
View Source
const GROUP_CONTAINER_PADDING = 12.
View Source
const HORIZONTAL_PAD = 40.

units of space on the left/right when computing the space required between actors

View Source
const LABEL_HORIZONTAL_PAD = 60.
View Source
const LIFELINE_LABEL_PAD = 5.

pad when the actor has the label placed OutsideMiddleBottom so that the lifeline is not so close to the text

View Source
const LIFELINE_STROKE_DASH int = 6
View Source
const LIFELINE_STROKE_WIDTH int = 2
View Source
const MIN_ACTOR_DISTANCE = 150.
View Source
const MIN_ACTOR_WIDTH = 100.
View Source
const MIN_MESSAGE_DISTANCE = 30.

min vertical distance between messages

View Source
const MIN_SPAN_HEIGHT = 30.

when a span has a single messages

View Source
const SELF_MESSAGE_HORIZONTAL_TRAVEL = 80.
View Source
const SPAN_BASE_WIDTH = 12.

default size

View Source
const SPAN_DEPTH_GROWTH_FACTOR = 8.

as the spans start getting nested, their size grows

View Source
const SPAN_MESSAGE_PAD = 10.
View Source
const VERTICAL_PAD = 40.

units of space on the top/bottom when computing the space required between messages TODO lower

Variables

This section is empty.

Functions

func IsLifelineEnd

func IsLifelineEnd(obj *d2graph.Object) bool

IsLifelineEnd reports whether obj is a synthetic sequence-diagram lifeline endpoint.

func Layout

func Layout(ctx context.Context, g *d2graph.Graph, layout d2graph.LayoutGraph) error

Layout runs the sequence diagram layout engine on objects of shape sequence_diagram

1. Run layout on sequence diagrams 2. Set the resulting dimensions to the main graph shape

func LifelineEndID added in v0.9.0

func LifelineEndID(actorID string) string

LifelineEndID returns the synthetic endpoint ID for an actor's lifeline. The hash is formatted as an unsigned 32-bit value so the ID is stable across architectures.

Types

This section is empty.

Jump to

Keyboard shortcuts

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