Options
All
  • Public
  • Public/Protected
  • All
Menu

Visual representation of an Edge. Crafts and manipulates DOM elements needed to present the edge.

Hierarchy

Index

Constructors

constructor

  • Parameters

    • source: SvgVertex

      Visual representation of vertex from which edge originates.

    • target: SvgVertex | null

      Visual representation of vertex at which edge ends.

    • Default value weight: number | null = null

      Weight of the edge. Can be null if edge has no weight.

    Returns SvgEdge

Properties

edgeSvg

edgeSvg: SVGPathElement

SVG path element that visualizes the edge.

Private end

end: Point

End point of the edge. Used in case target vertex is not set (temp edge).

source

source: Vertex

Vertex from which edge originates.

Private sourceSvg

sourceSvg: SvgVertex

Visual representation of vertex from which edge originates.

target

target: Vertex | null

Vertex at which edge ends.

Private targetSvg

targetSvg: SvgVertex | null

Visual representation of vertex at which edge ends.

textPathSvg

textPathSvg: SVGTextPathElement

SVG text path used to link weightSvg to edgeSvg so that weight would be displayed on the edge.

weight

weight: number | null

Weight of the edge. Can be null if edge has no weight.

weightSvg

weightSvg: SVGTextElement

SVG text element that visualizes the weight of the edge.

Methods

Private getPathCoordinates

  • Calculates start and end ponits of edge path. Accounts for edges starting at boundary of vertex circle rather than the center by offseting the start/end points.

    Returns [Point, Point]

    Start and end points of edge path.

setEnd

  • setEnd(endPoint: Point): void
  • Sets the end point for this edge. It will be used in case edge does not have a target vertex (temporary edge).

    Parameters

    • endPoint: Point

      New end point for edge.

    Returns void

setWeight

  • setWeight(weight: number | null): void
  • Sets weight for the edge and updates its visual representatation.

    Parameters

    • weight: number | null

      New weight for the edge.

    Returns void

update

  • update(): void
  • Recalculates edge path coordinates and updates the DOM elements.

    Returns void

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc