package geo

Import Path
	github.com/pancsta/d2/lib/geo (on go.dev)

Dependency Relation
	imports 4 packages, and imported by 36 packages


Package-Level Type Names (total 12)
/* sort by: | */
( BezierCurve) At(point float64) *Point ( BezierCurve) Intersections(segment Segment) []*Point BezierCurve : Intersectable func NewBezierCurve(points []*Point) *BezierCurve
Height float64 TopLeft *Point Width float64 (*Box) Center() *Point (*Box) Contains(p *Point) bool (*Box) Copy() *Box (*Box) Intersections(s Segment) []*Point Intersects returns true if the segment comes within buffer of the box ( Box) Overlaps(b2 Box) bool (*Box) ToString() string *Box : Intersectable func NewBox(tl *Point, width, height float64) *Box func (*Box).Copy() *Box func github.com/pancsta/d2/lib/shape.Shape.GetBox() *Box func github.com/pancsta/d2/lib/shape.Shape.GetInnerBox() *Box func github.com/pancsta/d2/lib/shape.Shape.GetInnerBoxForContent(width, height float64) *Box func github.com/pancsta/d2/d2layouts/d2talalayout/internal/layoutgraph.(*Node).InnerBox() *Box func github.com/pancsta/d2/d2layouts/d2talalayout/internal/nodeshape.Shape.GetBox() *Box func github.com/pancsta/d2/d2layouts/d2talalayout/internal/nodeshape.Shape.GetInnerBox() *Box func github.com/pancsta/d2/d2layouts/d2talalayout/internal/nodeshape.Shape.GetInnerBoxForContent(width, height float64) *Box func Box.Overlaps(b2 Box) bool func github.com/pancsta/d2/lib/label.Position.GetPointOnBox(box *Box, padding, width, height float64) *Point func github.com/pancsta/d2/lib/shape.NewC4Person(box *Box) shape.Shape func github.com/pancsta/d2/lib/shape.NewCallout(box *Box) shape.Shape func github.com/pancsta/d2/lib/shape.NewCircle(box *Box) shape.Shape func github.com/pancsta/d2/lib/shape.NewClass(box *Box) shape.Shape func github.com/pancsta/d2/lib/shape.NewCloud(box *Box) shape.Shape func github.com/pancsta/d2/lib/shape.NewCode(box *Box) shape.Shape func github.com/pancsta/d2/lib/shape.NewCylinder(box *Box) shape.Shape func github.com/pancsta/d2/lib/shape.NewDiamond(box *Box) shape.Shape func github.com/pancsta/d2/lib/shape.NewDocument(box *Box) shape.Shape func github.com/pancsta/d2/lib/shape.NewHexagon(box *Box) shape.Shape func github.com/pancsta/d2/lib/shape.NewImage(box *Box) shape.Shape func github.com/pancsta/d2/lib/shape.NewOval(box *Box) shape.Shape func github.com/pancsta/d2/lib/shape.NewPackage(box *Box) shape.Shape func github.com/pancsta/d2/lib/shape.NewPage(box *Box) shape.Shape func github.com/pancsta/d2/lib/shape.NewParallelogram(box *Box) shape.Shape func github.com/pancsta/d2/lib/shape.NewPerson(box *Box) shape.Shape func github.com/pancsta/d2/lib/shape.NewQueue(box *Box) shape.Shape func github.com/pancsta/d2/lib/shape.NewRealSquare(box *Box) shape.Shape func github.com/pancsta/d2/lib/shape.NewShape(shapeType string, box *Box) shape.Shape func github.com/pancsta/d2/lib/shape.NewSquare(box *Box) shape.Shape func github.com/pancsta/d2/lib/shape.NewStep(box *Box) shape.Shape func github.com/pancsta/d2/lib/shape.NewStoredData(box *Box) shape.Shape func github.com/pancsta/d2/lib/shape.NewTable(box *Box) shape.Shape func github.com/pancsta/d2/lib/shape.NewText(box *Box) shape.Shape func github.com/pancsta/d2/d2layouts/d2talalayout/internal/layoutgraph.Covers(outer, inner *Box) bool func github.com/pancsta/d2/d2layouts/d2talalayout/internal/layoutgraph.LabelBoxFits(outer, inner *Box) bool func github.com/pancsta/d2/d2layouts/d2talalayout/internal/nodeshape.New(typeName string, box *Box) (nodeshape.Shape, nodeshape.Kind, bool) func github.com/pancsta/d2/d2layouts/d2talalayout/internal/packing.CombineSubgraphs(ctx context.Context, masterGraph *layoutgraph.Graph, graphs []*layoutgraph.Graph, ancestorObstacles []Box) (_ *layoutgraph.Graph, err error) func github.com/pancsta/d2/d2target.GetIconSize(box *Box, position string) int
Center *Point Rx float64 Ry float64 ( Ellipse) Intersections(segment Segment) []*Point Ellipse : Intersectable func NewEllipse(center *Point, rx, ry float64) *Ellipse
( Intersectable) Intersections(segment Segment) []*Point BezierCurve *Box Ellipse Segment github.com/pancsta/d2/d2graph.Object *github.com/pancsta/d2/d2layouts/d2talalayout/internal/labeling.PositionedArrowheadLabel github.com/pancsta/d2/d2layouts/d2talalayout/internal/layoutgraph.EdgeSegment *github.com/pancsta/d2/d2layouts/d2talalayout/internal/layoutgraph.Node func github.com/pancsta/d2/lib/shape.Shape.Perimeter() []Intersectable func github.com/pancsta/d2/d2layouts/d2talalayout/internal/nodeshape.Shape.Perimeter() []Intersectable
( Orientation) GetOpposite() Orientation ( Orientation) IsDiagonal() bool ( Orientation) IsHorizontal() bool ( Orientation) IsVertical() bool ( Orientation) SameSide(o2 Orientation) bool ( Orientation) ToString() string func Orientation.GetOpposite() Orientation func (*Point).GetOrientation(pTo *Point) Orientation func github.com/pancsta/d2/d2layouts/d2talalayout/internal/layoutgraph.(*Edge).FacingTablePortValues(from, to *layoutgraph.Node) (Point, Point, bool, bool, Orientation) func github.com/pancsta/d2/d2layouts/d2talalayout/internal/layoutgraph.(*Graph).Direction(container *layoutgraph.Node) Orientation func github.com/pancsta/d2/d2layouts/d2talalayout/internal/layoutgraph.(*Node).ContainerDirection() Orientation func github.com/pancsta/d2/d2layouts/d2talalayout/internal/layoutgraph.(*Node).Orientation(other *layoutgraph.Node) Orientation func github.com/pancsta/d2/d2layouts/d2talalayout/internal/layoutgraph.(*Node).PortOrientation(point *Point) Orientation func Orientation.SameSide(o2 Orientation) bool func github.com/pancsta/d2/d2layouts/d2talalayout/internal/layoutgraph.(*Node).PortsByOrientation(orientation Orientation) []Point func github.com/pancsta/d2/d2layouts/d2talalayout/internal/nodeshape.TableColumnPortValue(s nodeshape.Shape, orientation Orientation, columnIndex int) (port Point, ok bool) func github.com/pancsta/d2/d2layouts/d2talalayout/internal/nodeshape.TablePortIndex(s nodeshape.Shape, orientation Orientation, columnIndex int) (index int, ok bool) func github.com/pancsta/d2/d2layouts/d2talalayout/internal/nodeshape.Shape.CenterPortIndex(orientation Orientation) int func github.com/pancsta/d2/d2layouts/d2talalayout/internal/nodeshape.Shape.PortIndices(orientation Orientation) []int func github.com/pancsta/d2/d2layouts/d2talalayout/internal/proximity.CanUseBothSides(node *layoutgraph.Node, orientation Orientation) bool const Bottom const BottomLeft const BottomRight const Left const NONE const Right const Top const TopLeft const TopRight
X float64 Y float64 Moves the given point by Vector (*Point) Compare(p2 *Point) int (*Point) Copy() *Point https://stackoverflow.com/questions/849211/shortest-distance-between-a-point-and-a-line-segment (*Point) Equals(p2 *Point) bool (*Point) FormattedCoordinates() string GetOrientation gets orientation of pFrom to pTo E.g. pFrom ---> pTo, here, pFrom is to the left of pTo, so Left would be returned point t% of the way between a and b returns true if point p is on orthogonal segment between points a and b (*Point) ToString() string Creates a Vector pointing to point (*Point) Transpose() (*Point) TruncateDecimals() (*Point) TruncateFloat32() Creates a Vector of the size between start and endpoint, pointing to endpoint func ComputeIntersections(px, py, lx, ly []float64) []*Point func IntersectionPoint(u0, u1, v0, v1 *Point) *Point func NewPoint(x, y float64) *Point func BezierCurve.At(point float64) *Point func BezierCurve.Intersections(segment Segment) []*Point func (*Box).Center() *Point func (*Box).Intersections(s Segment) []*Point func Ellipse.Intersections(segment Segment) []*Point func Intersectable.Intersections(segment Segment) []*Point func (*Point).AddVector(v Vector) *Point func (*Point).Copy() *Point func (*Point).Interpolate(b *Point, t float64) *Point func Points.GetMedian() *Point func Route.GetBoundingBox() (tl, br *Point) func Route.GetPointAtDistance(distance float64) (*Point, int) func Segment.Intersections(otherSegment Segment) []*Point func Vector.ToPoint() *Point func github.com/pancsta/d2/lib/label.Position.GetPointOnBox(box *Box, padding, width, height float64) *Point func github.com/pancsta/d2/lib/label.Position.GetPointOnRoute(route Route, strokeWidth, labelPercentage, width, height float64) (point *Point, index int) func github.com/pancsta/d2/lib/shape.TraceToShapeBorder(shape shape.Shape, rectBorderPoint, prevPoint *Point) *Point func github.com/pancsta/d2/lib/shape.Shape.GetInsidePlacement(width, height, paddingX, paddingY float64) Point func github.com/pancsta/d2/lib/svg.BezierCurveSegment(p1, p2, p3, p4 *Point, t0, t1 float64) (Point, Point, Point, Point) func github.com/pancsta/d2/lib/svg.BezierCurveSegment(p1, p2, p3, p4 *Point, t0, t1 float64) (Point, Point, Point, Point) func github.com/pancsta/d2/lib/svg.BezierCurveSegment(p1, p2, p3, p4 *Point, t0, t1 float64) (Point, Point, Point, Point) func github.com/pancsta/d2/lib/svg.BezierCurveSegment(p1, p2, p3, p4 *Point, t0, t1 float64) (Point, Point, Point, Point) func github.com/pancsta/d2/lib/svg.(*SvgPathContext).Absolute(x, y float64) *Point func github.com/pancsta/d2/lib/svg.(*SvgPathContext).Relative(base *Point, dx, dy float64) *Point func github.com/pancsta/d2/d2graph.(*Object).GetIconTopLeft() *Point func github.com/pancsta/d2/d2graph.(*Object).GetLabelTopLeft() *Point func github.com/pancsta/d2/d2layouts/d2talalayout/internal/graphbounds.BoundingBox(nodes layoutgraph.Nodes, guard graphbounds.WorkStepper) (*Point, *Point, error) func github.com/pancsta/d2/d2layouts/d2talalayout/internal/graphbounds.BoundingBox(nodes layoutgraph.Nodes, guard graphbounds.WorkStepper) (*Point, *Point, error) func github.com/pancsta/d2/d2layouts/d2talalayout/internal/graphbounds.FixedBoundingBox(nodes layoutgraph.Nodes, guard graphbounds.WorkStepper) (*Point, *Point, error) func github.com/pancsta/d2/d2layouts/d2talalayout/internal/graphbounds.FixedBoundingBox(nodes layoutgraph.Nodes, guard graphbounds.WorkStepper) (*Point, *Point, error) func github.com/pancsta/d2/d2layouts/d2talalayout/internal/graphbounds.NodeBoundingBox(node *layoutgraph.Node, allNodes layoutgraph.Nodes, guard graphbounds.WorkStepper) (*Point, *Point, error) func github.com/pancsta/d2/d2layouts/d2talalayout/internal/graphbounds.NodeBoundingBox(node *layoutgraph.Node, allNodes layoutgraph.Nodes, guard graphbounds.WorkStepper) (*Point, *Point, error) func github.com/pancsta/d2/d2layouts/d2talalayout/internal/labelgeom.ArrowheadTopLeft(route Route, isTarget bool, sourceArrowhead, targetArrowhead string, width, height float64) *Point func github.com/pancsta/d2/d2layouts/d2talalayout/internal/layoutgraph.(*Edge).BoundingBox() (*Point, *Point) func github.com/pancsta/d2/d2layouts/d2talalayout/internal/layoutgraph.(*Edge).BoundingBox() (*Point, *Point) func github.com/pancsta/d2/d2layouts/d2talalayout/internal/layoutgraph.(*Edge).BoundingBoxValues() (Point, Point) func github.com/pancsta/d2/d2layouts/d2talalayout/internal/layoutgraph.(*Edge).BoundingBoxValues() (Point, Point) func github.com/pancsta/d2/d2layouts/d2talalayout/internal/layoutgraph.(*Edge).FacingTablePortValues(from, to *layoutgraph.Node) (Point, Point, bool, bool, Orientation) func github.com/pancsta/d2/d2layouts/d2talalayout/internal/layoutgraph.(*Edge).FacingTablePortValues(from, to *layoutgraph.Node) (Point, Point, bool, bool, Orientation) func github.com/pancsta/d2/d2layouts/d2talalayout/internal/layoutgraph.(*Edge).LabelTopLeft(labelPosition label.Position, width, height float64) *Point func github.com/pancsta/d2/d2layouts/d2talalayout/internal/layoutgraph.(*Edge).SourcePort() *Point func github.com/pancsta/d2/d2layouts/d2talalayout/internal/layoutgraph.(*Edge).TargetPort() *Point func github.com/pancsta/d2/d2layouts/d2talalayout/internal/layoutgraph.Edges.PortEdges(node *layoutgraph.Node) map[Point][]*layoutgraph.Edge func github.com/pancsta/d2/d2layouts/d2talalayout/internal/layoutgraph.(*Graph).BoundingBox() (*Point, *Point) func github.com/pancsta/d2/d2layouts/d2talalayout/internal/layoutgraph.(*Graph).BoundingBox() (*Point, *Point) func github.com/pancsta/d2/d2layouts/d2talalayout/internal/layoutgraph.(*Graph).ContainerFixedOrigin(container *layoutgraph.Node) *Point func github.com/pancsta/d2/d2layouts/d2talalayout/internal/layoutgraph.(*Node).BoundingBox(allNodes layoutgraph.Nodes) (*Point, *Point) func github.com/pancsta/d2/d2layouts/d2talalayout/internal/layoutgraph.(*Node).BoundingBox(allNodes layoutgraph.Nodes) (*Point, *Point) func github.com/pancsta/d2/d2layouts/d2talalayout/internal/layoutgraph.(*Node).Center() *Point func github.com/pancsta/d2/d2layouts/d2talalayout/internal/layoutgraph.(*Node).CenterPorts() []Point func github.com/pancsta/d2/d2layouts/d2talalayout/internal/layoutgraph.(*Node).FixedOrigin() *Point func github.com/pancsta/d2/d2layouts/d2talalayout/internal/layoutgraph.(*Node).InsidePlacement(width, height float64, padding layoutgraph.Spacing) Point func github.com/pancsta/d2/d2layouts/d2talalayout/internal/layoutgraph.(*Node).LabelTopLeft(labelPosition label.Position, width, height float64) *Point func github.com/pancsta/d2/d2layouts/d2talalayout/internal/layoutgraph.(*Node).MirroredPorts() map[Point]Point func github.com/pancsta/d2/d2layouts/d2talalayout/internal/layoutgraph.(*Node).MirroredPorts() map[Point]Point func github.com/pancsta/d2/d2layouts/d2talalayout/internal/layoutgraph.(*Node).OverlappingPorts(other *layoutgraph.Node) map[Point]bool func github.com/pancsta/d2/d2layouts/d2talalayout/internal/layoutgraph.(*Node).Ports() []Point func github.com/pancsta/d2/d2layouts/d2talalayout/internal/layoutgraph.(*Node).PortsByOrientation(orientation Orientation) []Point func github.com/pancsta/d2/d2layouts/d2talalayout/internal/layoutgraph.Nodes.BoundingBox() (*Point, *Point) func github.com/pancsta/d2/d2layouts/d2talalayout/internal/layoutgraph.Nodes.BoundingBox() (*Point, *Point) func github.com/pancsta/d2/d2layouts/d2talalayout/internal/layoutgraph.Nodes.BoundingBoxWithWorkGuard(guard *limits.WorkGuard) (*Point, *Point, error) func github.com/pancsta/d2/d2layouts/d2talalayout/internal/layoutgraph.Nodes.BoundingBoxWithWorkGuard(guard *limits.WorkGuard) (*Point, *Point, error) func github.com/pancsta/d2/d2layouts/d2talalayout/internal/layoutgraph.Nodes.Center() *Point func github.com/pancsta/d2/d2layouts/d2talalayout/internal/layoutgraph.Nodes.CenterWithWorkGuard(guard *limits.WorkGuard) (*Point, error) func github.com/pancsta/d2/d2layouts/d2talalayout/internal/layoutgraph.Nodes.FixedBoundingBox() (*Point, *Point) func github.com/pancsta/d2/d2layouts/d2talalayout/internal/layoutgraph.Nodes.FixedBoundingBox() (*Point, *Point) func github.com/pancsta/d2/d2layouts/d2talalayout/internal/nodeshape.TableColumnPortValue(s nodeshape.Shape, orientation Orientation, columnIndex int) (port Point, ok bool) func github.com/pancsta/d2/d2layouts/d2talalayout/internal/nodeshape.Shape.GetInsidePlacement(width, height, paddingX, paddingY float64) Point func github.com/pancsta/d2/d2target.(*Connection).GetArrowheadLabelPosition(isDst bool) *Point func github.com/pancsta/d2/d2target.(*Connection).GetIconPosition() *Point func github.com/pancsta/d2/d2target.(*Connection).GetLabelTopLeft() *Point func IntersectionPoint(u0, u1, v0, v1 *Point) *Point func NewBezierCurve(points []*Point) *BezierCurve func NewBox(tl *Point, width, height float64) *Box func NewEllipse(center *Point, rx, ry float64) *Ellipse func NewSegment(from, to *Point) *Segment func (*Box).Contains(p *Point) bool func (*Point).Compare(p2 *Point) int func (*Point).DistanceToLine(p1, p2 *Point) float64 func (*Point).Equals(p2 *Point) bool func (*Point).GetOrientation(pTo *Point) Orientation func (*Point).Interpolate(b *Point, t float64) *Point func (*Point).OnOrthogonalSegment(a, b *Point) bool func (*Point).VectorTo(endpoint *Point) Vector func github.com/pancsta/d2/lib/shape.TraceToShapeBorder(shape shape.Shape, rectBorderPoint, prevPoint *Point) *Point func github.com/pancsta/d2/lib/svg.BezierCurveSegment(p1, p2, p3, p4 *Point, t0, t1 float64) (Point, Point, Point, Point) func github.com/pancsta/d2/lib/svg.NewSVGPathContext(tl *Point, sx, sy float64) *svg.SvgPathContext func github.com/pancsta/d2/lib/svg.(*SvgPathContext).Relative(base *Point, dx, dy float64) *Point func github.com/pancsta/d2/lib/svg.(*SvgPathContext).StartAt(p *Point) func github.com/pancsta/d2/d2graph.(*Edge).TraceToShape(points []*Point, startIndex, endIndex int) (newStart, newEnd int) func github.com/pancsta/d2/d2layouts/d2talalayout/internal/layoutgraph.NewEdgeSegment(start, end *Point, edge *layoutgraph.Edge) *layoutgraph.EdgeSegment func github.com/pancsta/d2/d2layouts/d2talalayout/internal/layoutgraph.SegmentsCross(u0, u1, v0, v1 *Point) bool func github.com/pancsta/d2/d2layouts/d2talalayout/internal/layoutgraph.(*Graph).WouldOverlapWithWorkGuard(node *layoutgraph.Node, point *Point, exceptions []*layoutgraph.Node, pairwiseExceptions map[*layoutgraph.Node]map[*layoutgraph.Node]struct{}, guard *limits.WorkGuard) (bool, error) func github.com/pancsta/d2/d2layouts/d2talalayout/internal/layoutgraph.(*Node).ContainsPoint(point *Point, padding float64) bool func github.com/pancsta/d2/d2layouts/d2talalayout/internal/layoutgraph.(*Node).ContainsPointOnBox(point *Point) bool func github.com/pancsta/d2/d2layouts/d2talalayout/internal/layoutgraph.(*Node).DeltaTo(other *layoutgraph.Node, at *Point) int func github.com/pancsta/d2/d2layouts/d2talalayout/internal/layoutgraph.(*Node).DoesOverlapAt(other *layoutgraph.Node, point *Point) bool func github.com/pancsta/d2/d2layouts/d2talalayout/internal/layoutgraph.(*Node).FitToBoundingBox(topLeft, bottomRight *Point, padding layoutgraph.Spacing) func github.com/pancsta/d2/d2layouts/d2talalayout/internal/layoutgraph.(*Node).IsPointNear(point *Point) bool func github.com/pancsta/d2/d2layouts/d2talalayout/internal/layoutgraph.(*Node).IsWithinBounds(topLeft, bottomRight *Point) bool func github.com/pancsta/d2/d2layouts/d2talalayout/internal/layoutgraph.(*Node).OverlapsLine(start, end *Point, delta float64) bool func github.com/pancsta/d2/d2layouts/d2talalayout/internal/layoutgraph.(*Node).PassesThrough(first, second *Point) bool func github.com/pancsta/d2/d2layouts/d2talalayout/internal/layoutgraph.(*Node).PortOrientation(point *Point) Orientation func github.com/pancsta/d2/d2layouts/d2talalayout/internal/routing.NewOVGNode(p *Point) *routing.OVGNode func github.com/pancsta/d2/d2renderers/d2sketch.Arrowheads(connection d2target.Connection, srcAdj, dstAdj *Point) (string, error)
( Points) Equals(other Points) bool ( Points) GetMedian() *Point ( Points) ToString() string func RemovePoints(points Points, toRemove []bool) Points func RemovePoints(points Points, toRemove []bool) Points func Points.Equals(other Points) bool
XPercentage float64 YPercentage float64 func NewRelativePoint(xPercentage, yPercentage float64) *RelativePoint func github.com/pancsta/d2/d2layouts/d2talalayout/internal/nodeshape.Shape.SnapPointPercentages() [][]*RelativePoint
( Route) GetBoundingBox() (tl, br *Point) return the point at _distance_ along the route, and the index of the segment it's on ( Route) Length() float64 func github.com/pancsta/d2/lib/label.Position.GetPointOnRoute(route Route, strokeWidth, labelPercentage, width, height float64) (point *Point, index int) func github.com/pancsta/d2/d2layouts/d2talalayout/internal/labelgeom.ArrowheadTopLeft(route Route, isTarget bool, sourceArrowhead, targetArrowhead string, width, height float64) *Point func github.com/pancsta/d2/d2layouts/d2talalayout/internal/labeling.PositionArrowheadLabel(edge *layoutgraph.Edge, isTarget bool, route Route) *labeling.PositionedArrowheadLabel
End *Point Start *Point getBounds takes a segment and returns the floor and ceil of where it can shift to If there is no floor or ceiling, negative or positive infinity is used, respectively The direction is inferred, e.g. b/c the passed in segment is vertical, it's inferred we want horizontal bounds buffer says how close the segment can be, on both axes, to other segments given . │ │ . │ │ . │ │ . │ │ . │ non-overlap . │ . │ . │ . │ segment . │ │ . │ │ ceil . │ │ │ . │ │ . floor │ │ . │ . │ . │ . │ NOTE: the assumption is that all segments given are orthogonal ( Segment) Intersections(otherSegment Segment) []*Point ( Segment) Intersects(otherSegment Segment) bool ( Segment) Length() float64 ( Segment) Overlaps(otherS Segment, isHorizontal bool, buffer float64) bool ( Segment) ToString() string ( Segment) ToVector() Vector Segment : Intersectable func NewSegment(from, to *Point) *Segment func BezierCurve.Intersections(segment Segment) []*Point func (*Box).Intersections(s Segment) []*Point func (*Box).Intersects(s Segment, buffer float64) bool func Ellipse.Intersections(segment Segment) []*Point func Intersectable.Intersections(segment Segment) []*Point func (*Segment).GetBounds(segments []*Segment, buffer float64) (float64, float64) func Segment.Intersections(otherSegment Segment) []*Point func Segment.Intersects(otherSegment Segment) bool func Segment.Overlaps(otherS Segment, isHorizontal bool, buffer float64) bool
Bottom float64 Left float64 Right float64 Top float64 func github.com/pancsta/d2/d2graph.(*Object).GetMargin() Spacing func github.com/pancsta/d2/d2graph.(*Object).Spacing() (margin, padding Spacing) func github.com/pancsta/d2/d2graph.(*Object).SpacingOpt(labelPadding, iconPadding float64, maxIconSize bool) (margin, padding Spacing) func github.com/pancsta/d2/d2layouts.FitToGraph(container *d2graph.Object, nestedGraph *d2graph.Graph, padding Spacing)
A N-Dimensional Vector with components (x, y, z, ...) based on the origin ( Vector) Add(b Vector) Vector Creates a Vector by extending the length of the current one by length ( Vector) Degrees() float64 ( Vector) Length() float64 ( Vector) Minus(b Vector) Vector ( Vector) Multiply(v float64) Vector ( Vector) Radians() float64 ( Vector) Reverse() Vector ( Vector) ToPoint() *Point Creates an unit Vector pointing in the same direction of this Vector func NewVector(components ...float64) Vector func NewVectorFromProperties(length float64, angleInRadians float64) Vector func (*Point).ToVector() Vector func (*Point).VectorTo(endpoint *Point) Vector func Segment.ToVector() Vector func Vector.Add(b Vector) Vector func Vector.AddLength(length float64) Vector func Vector.Minus(b Vector) Vector func Vector.Multiply(v float64) Vector func Vector.Reverse() Vector func Vector.Unit() Vector func (*Point).AddVector(v Vector) *Point func Vector.Add(b Vector) Vector func Vector.Minus(b Vector) Vector var github.com/pancsta/d2/d2target.BorderOffset
Package-Level Functions (total 16)
nolint
func EuclideanDistance(x1, y1, x2, y2 float64) float64
func GetUnitNormalVector(x1, y1, x2, y2 float64) (float64, float64)
get the point of intersection between line segments u and v (or nil if they do not intersect)
func NewBezierCurve(points []*Point) *BezierCurve
func NewBox(tl *Point, width, height float64) *Box
func NewEllipse(center *Point, rx, ry float64) *Ellipse
func NewPoint(x, y float64) *Point
func NewRelativePoint(xPercentage, yPercentage float64) *RelativePoint
func NewSegment(from, to *Point) *Segment
New Vector from components
New Vector of length and pointing in the direction of angle
compare a and b and consider them equal if difference is less than precision e (e.g. e=0.001)
RemovePoints returns a new Points slice without the points in toRemove
func Sign(i float64) int
TruncateDecimals truncates floats to keep up to 3 digits after decimal, to avoid issues with floats on different machines. Since we're not launching rockets, 3 decimals is enough precision for what we're doing
Package-Level Constants (total 10)
const Bottom Orientation = 6
const Left Orientation = 7
const NONE Orientation = 8
How precise should comparisons be, avoid being too precise due to floating point issues
const Right Orientation = 5
const Top Orientation = 4
const TopLeft Orientation = 0