label

package
v0.0.0-...-e815181 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2023 License: MPL-2.0 Imports: 2 Imported by: 0

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) (point *geo.Point, index int)

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

func (Position) IsEdgePosition

func (position Position) IsEdgePosition() bool

func (Position) IsOnEdge

func (position Position) IsOnEdge() bool

func (Position) IsOutside

func (position Position) IsOutside() bool

func (Position) IsShapePosition

func (position Position) IsShapePosition() 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