Documentation
¶
Index ¶
Constants ¶
View Source
const ( MaxRouteAttempts = 200 LabelOffsetX = 2 )
Variables ¶
This section is empty.
Functions ¶
func DrawRoute ¶
func DrawRoute(rd RouteDrawer, conn d2target.Connection)
Types ¶
type Boundary ¶
func NewBoundary ¶
type RouteDrawer ¶
type RouteDrawer interface {
GetCanvas() *asciicanvas.Canvas
GetChars() charset.Set
GetDiagram() *d2target.Diagram
GetFontWidth() float64
GetFontHeight() float64
GetScale() float64
GetBoundaryForShape(s d2target.Shape) (Point, Point)
CalibrateXY(x, y float64) (float64, float64)
GetContext() context.Context
}
type RouteLabelPosition ¶
type RouteLabelPosition struct {
I int // Index of route segment
X int // X coordinate for label
Y int // Y coordinate offset
MaxDiff float64 // Maximum difference for the segment
}
RouteLabelPosition holds calculated position for route label
func (*RouteLabelPosition) ShouldDrawAt ¶
func (pos *RouteLabelPosition) ShouldDrawAt(currentIndex, x, y int, ax, ay, sx, sy float64) bool
Click to show internal directories.
Click to hide internal directories.