Documentation
¶
Index ¶
- Constants
- type Position
- func (labelPosition Position) GetPointOnBox(box *geo.Box, padding, width, height float64) *geo.Point
- func (labelPosition Position) GetPointOnRoute(route geo.Route, strokeWidth, labelPercentage, width, height float64) (point *geo.Point, index int)
- func (position Position) IsBorder() bool
- func (position Position) IsEdgePosition() bool
- func (position Position) IsOnEdge() bool
- func (position Position) IsOutside() bool
- func (position Position) IsShapePosition() bool
- func (position Position) IsUnlocked() bool
- func (position Position) Mirrored() Position
- func (position Position) String() string
Constants ¶
const CENTER_LABEL_POSITION = 2.0 / 4.0
const LEFT_LABEL_POSITION = 1.0 / 4.0
These are % locations where labels will be placed along the connection
const PADDING = 5
This is the space between a node border and its outside label
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 BorderTopLeft BorderTopCenter BorderTopRight BorderLeftTop BorderLeftMiddle BorderLeftBottom BorderRightTop BorderRightMiddle BorderRightBottom BorderBottomLeft BorderBottomCenter BorderBottomRight UnlockedTop UnlockedMiddle UnlockedBottom )
func FromString ¶
func (Position) GetPointOnBox ¶
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