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) 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
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 (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) IsShapePosition ¶
func (Position) IsUnlocked ¶
Click to show internal directories.
Click to hide internal directories.