package geometry

Import Path
	github.com/d2lang/elk-go/internal/geometry (on go.dev)

Dependency Relation
	imports 5 packages, and imported by 25 packages

Involved Source Files Package geometry implements ELK's core two-dimensional data types.
Package-Level Type Names (total 4)
/* sort by: | */
Chain is ELK's ordered KVectorChain. ( Chain) Clone() Chain ( Chain) HasInfinite() bool ( Chain) HasNaN() bool ( Chain) Length() float64 ( Chain) Offset(offset Point) Chain PointAt returns a point at distance from the start, or from the end when distance is negative. ( Chain) Reverse() Chain ( Chain) Scale(factor float64) Chain ( Chain) ScaleXY(x, y float64) Chain ( Chain) String() string Chain : expvar.Var Chain : fmt.Stringer func ParseChain(input string) (Chain, error) func Chain.Clone() Chain func Chain.Offset(offset Point) Chain func Chain.Reverse() Chain func Chain.Scale(factor float64) Chain func Chain.ScaleXY(x, y float64) Chain func github.com/d2lang/elk-go/internal/common/elkutil.DetermineJunctionPoints(model *graph.Model, edgeID graph.EdgeID) (Chain, error) func github.com/d2lang/elk-go/internal/graph.(*Model).SectionChain(section graph.SectionID) Chain func github.com/d2lang/elk-go/internal/layered/intermediate/loops/routing.CutPolylineCorners(points Chain, distance float64) Chain func github.com/d2lang/elk-go/internal/layered/p5edges.CubicNUBToBezier(points Chain) Chain func github.com/d2lang/elk-go/internal/common/elkutil.ApplyVectorChain(model *graph.Model, sectionID graph.SectionID, chain Chain) func github.com/d2lang/elk-go/internal/layered/intermediate/loops/routing.CutPolylineCorners(points Chain, distance float64) Chain func github.com/d2lang/elk-go/internal/layered/p5edges.CubicNUBToBezier(points Chain) Chain
Point is the Go counterpart of ELK's KVector. X float64 Y float64 ( Point) Add(q Point) Point ( Point) Angle(q Point) float64 ( Point) Bound(lowX, lowY, highX, highY float64) Point ( Point) Cross(q Point) float64 ( Point) Degrees() float64 ( Point) Distance(q Point) float64 ( Point) Dot(q Point) float64 ( Point) FuzzyEqual(q Point, tolerance float64) bool ( Point) IsInfinite() bool ( Point) IsNaN() bool ( Point) Length() float64 ( Point) LengthSquared() float64 ( Point) Negate() Point ( Point) Normalize() Point Radians returns an angle in [0, 2*pi), matching KVector.toRadians. ( Point) Rotate(angle float64) Point ( Point) Scale(factor float64) Point ( Point) ScaleToLength(length float64) Point ( Point) ScaleXY(x, y float64) Point ( Point) String() string ( Point) Sub(q Point) Point Point : expvar.Var Point : fmt.Stringer func Between(start, end Point) Point func FromAngle(angle float64) Point func NewPoint(x, y float64) Point func ParsePoint(input string) (Point, error) func Chain.PointAt(distance float64) Point func Point.Add(q Point) Point func Point.Bound(lowX, lowY, highX, highY float64) Point func Point.Negate() Point func Point.Normalize() Point func Point.Rotate(angle float64) Point func Point.Scale(factor float64) Point func Point.ScaleToLength(length float64) Point func Point.ScaleXY(x, y float64) Point func Point.Sub(q Point) Point func Rectangle.BottomLeft() Point func Rectangle.BottomRight() Point func Rectangle.Center() Point func Rectangle.Position() Point func Rectangle.TopRight() Point func github.com/d2lang/elk-go/internal/common/elkutil.EffectiveMinSizeConstraintFor(model *graph.Model, nodeID graph.NodeID) Point func github.com/d2lang/elk-go/internal/common/elkutil.ResizeNode(model *graph.Model, nodeID graph.NodeID, width, height float64, movePorts, moveLabels bool) Point func github.com/d2lang/elk-go/internal/common/nodespacing.ProcessNodeSize(model *graph.Model, parent, nodeID graph.NodeID, apply bool, _ bool) Point func github.com/d2lang/elk-go/internal/force.(*FEdge).SourcePoint() Point func github.com/d2lang/elk-go/internal/force.(*FEdge).TargetPoint() Point func github.com/d2lang/elk-go/internal/graph.Shape.Position() Point func github.com/d2lang/elk-go/internal/layered.(*LGraphArena).ExternalPortPosition(graphID layered.LGraphID, dummyID layered.LNodeID, portWidth, portHeight float64) Point func github.com/d2lang/elk-go/internal/layered.(*LGraphArena).GraphActualSize(graphID layered.LGraphID) Point func Between(start, end Point) Point func Chain.Offset(offset Point) Chain func Point.Add(q Point) Point func Point.Angle(q Point) float64 func Point.Cross(q Point) float64 func Point.Distance(q Point) float64 func Point.Dot(q Point) float64 func Point.FuzzyEqual(q Point, tolerance float64) bool func Point.Sub(q Point) Point func Rectangle.Move(offset Point) Rectangle func github.com/d2lang/elk-go/internal/common/elkutil.TranslateAligned(model *graph.Model, parent graph.NodeID, newSize, oldSize Point) func github.com/d2lang/elk-go/internal/core.TranslateSection(model *graph.Model, sectionID graph.SectionID, offset Point) func github.com/d2lang/elk-go/internal/layered.(*LGraphArena).CreateExternalPortDummy(propertyHolder *basegraph.PropertyMap, portConstraints layered.PortConstraints, portSide layered.PortSide, netFlow int, portNodeSize *Point, portPosition *Point, portSize Point, layoutDirection layered.Direction, graphID layered.LGraphID) layered.LNodeID func github.com/d2lang/elk-go/internal/layered.(*LGraphArena).CreateExternalPortDummy(propertyHolder *basegraph.PropertyMap, portConstraints layered.PortConstraints, portSide layered.PortSide, netFlow int, portNodeSize *Point, portPosition *Point, portSize Point, layoutDirection layered.Direction, graphID layered.LGraphID) layered.LNodeID func github.com/d2lang/elk-go/internal/layered.(*LGraphArena).CreateExternalPortDummy(propertyHolder *basegraph.PropertyMap, portConstraints layered.PortConstraints, portSide layered.PortSide, netFlow int, portNodeSize *Point, portPosition *Point, portSize Point, layoutDirection layered.Direction, graphID layered.LGraphID) layered.LNodeID func github.com/d2lang/elk-go/internal/layered.(*LGraphArena).ResizeNode(nodeID layered.LNodeID, newSize Point, movePorts, moveLabels bool) func github.com/d2lang/elk-go/internal/layered/intermediate/loops.(*Labels).ApplyPlacement(arena *layered.LGraphArena, offset Point)
Rectangle is an axis-aligned rectangle. Height float64 Width float64 X float64 Y float64 ( Rectangle) BottomLeft() Point ( Rectangle) BottomRight() Point ( Rectangle) Center() Point ( Rectangle) Intersects(other Rectangle) bool ( Rectangle) MaxX() float64 ( Rectangle) MaxY() float64 ( Rectangle) Move(offset Point) Rectangle ( Rectangle) Position() Point ( Rectangle) TopRight() Point ( Rectangle) Union(other Rectangle) Rectangle func Rectangle.Move(offset Point) Rectangle func Rectangle.Union(other Rectangle) Rectangle func github.com/d2lang/elk-go/internal/graph.Shape.Rectangle() Rectangle func Rectangle.Intersects(other Rectangle) bool func Rectangle.Union(other Rectangle) Rectangle
Spacing is used for both ELK padding and margin values. Bottom float64 Left float64 Right float64 Top float64 ( Spacing) Horizontal() float64 ( Spacing) String() string ( Spacing) Vertical() float64 Spacing : expvar.Var Spacing : fmt.Stringer func LRBTSpacing(horizontal, vertical float64) Spacing func ParseSpacing(input string) (Spacing, error) func UniformSpacing(value float64) Spacing
Package-Level Functions (total 8)
Between returns the vector pointing from start to end.
FromAngle returns a unit vector at the given angle in radians.
func LRBTSpacing(horizontal, vertical float64) Spacing
func NewPoint(x, y float64) Point
func ParseChain(input string) (Chain, error)
func ParsePoint(input string) (Point, error)