package label
Import Path
oss.terrastruct.com/d2/lib/label (on go.dev)
Dependency Relation
imports 2 packages, and imported by 11 packages
Involved Source Files
label.go
Package-Level Type Names (only one)
( Position) GetPointOnBox(box *geo.Box, padding, width, height float64) *geo.Point
return the top left point of a width x height label at the given label position on the route
also return the index of the route segment that point is on
( Position) IsEdgePosition() bool
( Position) IsOnEdge() bool
( Position) IsOutside() bool
( Position) IsShapePosition() bool
( Position) IsUnlocked() bool
( Position) Mirrored() Position
( Position) String() string
Position : expvar.Var
Position : fmt.Stringer
func FromString(s string) Position
func Position.Mirrored() Position
const InsideBottomCenter
const InsideBottomLeft
const InsideBottomRight
const InsideMiddleCenter
const InsideMiddleLeft
const InsideMiddleRight
const InsideTopCenter
const InsideTopLeft
const InsideTopRight
const OutsideBottomCenter
const OutsideBottomLeft
const OutsideBottomRight
const OutsideLeftBottom
const OutsideLeftMiddle
const OutsideLeftTop
const OutsideRightBottom
const OutsideRightMiddle
const OutsideRightTop
const OutsideTopCenter
const OutsideTopLeft
const OutsideTopRight
const UnlockedBottom
const UnlockedMiddle
const UnlockedTop
const Unset
Package-Level Functions (only one)
func FromString(s string) Position
Package-Level Constants (total 29)
const CENTER_LABEL_POSITION = 0.5 const InsideBottomCenter Position = 20 const InsideBottomLeft Position = 19 const InsideBottomRight Position = 21 const InsideMiddleCenter Position = 17 const InsideMiddleLeft Position = 16 const InsideMiddleRight Position = 18 const InsideTopCenter Position = 14 const InsideTopLeft Position = 13 const InsideTopRight Position = 15
These are % locations where labels will be placed along the connection
const OutsideBottomCenter Position = 11 const OutsideBottomLeft Position = 10 const OutsideBottomRight Position = 12 const OutsideLeftBottom Position = 6 const OutsideLeftMiddle Position = 5 const OutsideLeftTop Position = 4 const OutsideRightBottom Position = 9 const OutsideRightMiddle Position = 8 const OutsideRightTop Position = 7 const OutsideTopCenter Position = 2 const OutsideTopLeft Position = 1 const OutsideTopRight Position = 3
This is the space between a node border and its outside label
const RIGHT_LABEL_POSITION = 0.75 const UnlockedBottom Position = 24 const UnlockedMiddle Position = 23 const UnlockedTop Position = 22![]() |
The pages are generated with Golds v0.8.2. (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. |