Mind Map connector.

Hierarchy

Constructors

Properties

_labelText: string = ''
andgledCorners: boolean = true

When set to true the last segment connected to the corner ports is drawn at a 45 degree angle.

arrow1: SVGPolygonElement

SVG polygon for the start tip arrow.

arrow2: SVGPolygonElement

SVG polygon for the end tip arrow.

arrowBaseHeight: number = 10

Arrow height.

arrowBaseWidth: number = 10

Arrow width.

arrowType: ArrowType = 'none'

Defines location of arrows on a connector.

  • both - arrows displayed on both ends of a connector.
  • start - arrow displayend on the start side of a connector.
  • end - arrow displayed on the end side of a connector.
  • none - no arrows are displayed.
container: SVGGElement

SVG group containing all the SVG elements for this connector.

endPort?: Port

Reference to the stencil connector port and the end tip of this connector.

endStencil?: StencilBase

Reference to the stencil at the end tip of this connector.

selectorLine: SVGLineElement | SVGPathElement

Invisible wider connector line used to improve selection accuracy.

startPort?: Port

Reference to the stencil connector port and the start tip of this connector.

startStencil?: StencilBase

Reference to the stencil at the start tip of this connector.

strokeColor: string = '#000'

Connector line color.

strokeDasharray: string = ''

Connector line dash array.

strokeWidth: number = 1

Connector line width.

textBlock: TextBlock = ...

Text block displaying the connector label.

textBoundingBox: DOMRect = ...

Bounding box for the label text.

visibleLine: SVGLineElement | SVGPathElement

Visible connector line.

visual: SVGGraphicsElement = ...

The top level SVG element (group) of the connector's visual.

x1: number = 0

X coordinate of the start tip.

x2: number = 0

X coordinate of the end tip.

y1: number = 0

Y coordinate of the start tip.

y2: number = 0

Y coordinate of the end tip.

typeName: string = 'MindMapConnector'

A string representation of the type used in diagram configuration (state) JSON.

Accessors

  • get IId(): number
  • Internal connector identifier used in state/configuration JSON as reference to this connector.

    Returns number

  • get labelText(): string
  • Gets label text for the connector.

    Returns string

  • set labelText(value): void
  • Sets label text for the connector.

    Parameters

    • value: string

    Returns void

  • get typeName(): string
  • A string representation of the type used in diagram configuration (state) JSON.

    Remarks

    Instance accessor returning the value of static typeName.

    Returns string

Methods

  • Adds an element to the connector's container. The elements are inserted in the beggining (lowest layer) of the stack.

    Parameters

    • element: SVGElement

      element to add.

    Returns void

  • Adjusts connector visual based on updated position and other circumnstances.

    Returns void

  • Gets coordinates of connector's line ending depending on the arrow types and other factors.

    Parameters

    • baseEnding: IPoint

      base connector ending (as if there were no arrows, etc.)

    • Optional port: Port

      port to which the connector is connected.

    Returns IPoint

    • adjusted coordinates of connector line ending.
  • Moves label to supplied offset coordinates.

    Parameters

    • offsetX: number = 0

      horizontal offset from the auto-calculated position

    • offsetY: number = 0

      vertical offset from the auto-calculated position.

    Returns void

  • Returns true if manipulation target belongs to this connector.

    Parameters

    • el: EventTarget

    Returns boolean

  • Restores connector settings from a previously saved state (configuration).

    Parameters

    Returns void

  • Rotates arrows based on the connector tip position, connected ports, etc.

    Returns void

  • Scales the connector based on supplied scale factors.

    Parameters

    • scaleX: number

      horizontal scale factor.

    • scaleY: number

      vertical scale factor.

    Returns void

  • Sets end tip position to supplied coordinates.

    Parameters

    • point: IPoint

      new tip position.

    Returns void

  • Sets the color of the connector's visual

    Parameters

    • color: string

      CSS compatible color.

    Returns void

  • Sets the dash array of the connector's visual

    Parameters

    • dashes: string

      stroke dash array values.

    Returns void

  • Sets the stroke width of the connector's visual

    Parameters

    • width: string | number

      stroke (line) width.

    Returns void

  • Returns connector thumbnail used to define the shape of the connector in the DiagramEditor.

    Parameters

    • width: number

      thumbnail image width

    • height: number

      thumbnail image height

    Returns SVGSVGElement

    SVG image of the thumbnail.

Generated using TypeDoc