package labeling
Import Path
github.com/pancsta/d2/d2layouts/d2talalayout/internal/labeling (on go.dev)
Dependency Relation
imports 10 packages, and imported by 4 packages
Involved Source Files
arrowhead.go
guard.go
Package labeling places node, icon, edge, and arrowhead labels on a routed
layout graph. It owns placement policy and search; layoutgraph owns the
mutable graph records and geometry primitives.
placement.go
Package-Level Type Names (only one)
PositionedArrowheadLabel is the rendered box reserved beside one end of an
edge route.
Box geo.Box
Box.Height float64
Box.TopLeft *geo.Point
Box.Width float64
Edge *layoutgraph.Edge
IsTarget bool
Text string
(*PositionedArrowheadLabel) Center() *geo.Point
(*PositionedArrowheadLabel) Contains(p *geo.Point) bool
(*PositionedArrowheadLabel) Copy() *geo.Box
(*PositionedArrowheadLabel) Intersections(s geo.Segment) []*geo.Point
Intersects returns true if the segment comes within buffer of the box
( PositionedArrowheadLabel) Overlaps(b2 geo.Box) bool
(*PositionedArrowheadLabel) ToString() string
*PositionedArrowheadLabel : github.com/pancsta/d2/lib/geo.Intersectable
func PositionArrowheadLabel(edge *layoutgraph.Edge, isTarget bool, route geo.Route) *PositionedArrowheadLabel
Package-Level Functions (total 4)
Initialize reserves each explicit/default node-label and icon position
before placement begins.
Place chooses positions for every movable node label, icon, and routed edge
label in graph.
PlaceNewEdges chooses label positions only for edges, preserving all
existing label placements in graph as obstacles.
PositionArrowheadLabel derives the renderer-compatible label box for one
arrowhead. A nil result means that endpoint has no arrowhead label.
Package-Level Constants (only one)
![]() |
The pages are generated with Golds v0.8.7. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |