label

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 19, 2022 License: MPL-2.0 Imports: 2 Imported by: 9

Documentation

Index

Constants

View Source
const CENTER_LABEL_POSITION = 2.0 / 4.0
View Source
const LEFT_LABEL_POSITION = 1.0 / 4.0

These are % locations where labels will be placed along the connection

View Source
const PADDING = 5

This is the space between a node border and its outside label

View Source
const RIGHT_LABEL_POSITION = 3.0 / 4.0

Variables

This section is empty.

Functions

This section is empty.

Types

type Position

type Position string
const (
	OutsideTopLeft   Position = "OUTSIDE_TOP_LEFT"
	OutsideTopCenter Position = "OUTSIDE_TOP_CENTER"
	OutsideTopRight  Position = "OUTSIDE_TOP_RIGHT"

	OutsideLeftTop    Position = "OUTSIDE_LEFT_TOP"
	OutsideLeftMiddle Position = "OUTSIDE_LEFT_MIDDLE"
	OutsideLeftBottom Position = "OUTSIDE_LEFT_BOTTOM"

	OutsideRightTop    Position = "OUTSIDE_RIGHT_TOP"
	OutsideRightMiddle Position = "OUTSIDE_RIGHT_MIDDLE"
	OutsideRightBottom Position = "OUTSIDE_RIGHT_BOTTOM"

	OutsideBottomLeft   Position = "OUTSIDE_BOTTOM_LEFT"
	OutsideBottomCenter Position = "OUTSIDE_BOTTOM_CENTER"
	OutsideBottomRight  Position = "OUTSIDE_BOTTOM_RIGHT"

	InsideTopLeft   Position = "INSIDE_TOP_LEFT"
	InsideTopCenter Position = "INSIDE_TOP_CENTER"
	InsideTopRight  Position = "INSIDE_TOP_RIGHT"

	InsideMiddleLeft   Position = "INSIDE_MIDDLE_LEFT"
	InsideMiddleCenter Position = "INSIDE_MIDDLE_CENTER"
	InsideMiddleRight  Position = "INSIDE_MIDDLE_RIGHT"

	InsideBottomLeft   Position = "INSIDE_BOTTOM_LEFT"
	InsideBottomCenter Position = "INSIDE_BOTTOM_CENTER"
	InsideBottomRight  Position = "INSIDE_BOTTOM_RIGHT"

	UnlockedTop    Position = "UNLOCKED_TOP"
	UnlockedMiddle Position = "UNLOCKED_MIDDLE"
	UnlockedBottom Position = "UNLOCKED_BOTTOM"
)

func (Position) GetPointOnBox

func (labelPosition Position) GetPointOnBox(box *geo.Box, padding, width, height float64) *geo.Point

func (Position) GetPointOnRoute

func (labelPosition Position) GetPointOnRoute(route geo.Route, strokeWidth, labelPercentage, width, height float64) *geo.Point

return the top left point of a width x height label at the given label position on the route

func (Position) IsOnEdge

func (position Position) IsOnEdge() bool

func (Position) IsOutside

func (position Position) IsOutside() bool

func (Position) IsUnlocked

func (position Position) IsUnlocked() bool

func (Position) Mirrored

func (position Position) Mirrored() Position

Jump to

Keyboard shortcuts

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