label

package
v0.6.5 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 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 int8
const (
	Unset Position = iota

	OutsideTopLeft
	OutsideTopCenter
	OutsideTopRight

	OutsideLeftTop
	OutsideLeftMiddle
	OutsideLeftBottom

	OutsideRightTop
	OutsideRightMiddle
	OutsideRightBottom

	OutsideBottomLeft
	OutsideBottomCenter
	OutsideBottomRight

	InsideTopLeft
	InsideTopCenter
	InsideTopRight

	InsideMiddleLeft
	InsideMiddleCenter
	InsideMiddleRight

	InsideBottomLeft
	InsideBottomCenter
	InsideBottomRight

	UnlockedTop
	UnlockedMiddle
	UnlockedBottom
)

func FromString added in v0.6.2

func FromString(s string) Position

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 added in v0.6.0

func (position Position) IsEdgePosition() bool

func (Position) IsOnEdge

func (position Position) IsOnEdge() bool

func (Position) IsOutside

func (position Position) IsOutside() bool

func (Position) IsShapePosition added in v0.6.0

func (position Position) IsShapePosition() bool

func (Position) IsUnlocked

func (position Position) IsUnlocked() bool

func (Position) Mirrored

func (position Position) Mirrored() Position

func (Position) String added in v0.6.2

func (position Position) String() string

Jump to

Keyboard shortcuts

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