Options
All
  • Public
  • Public/Protected
  • All
Menu

Describes methods for creating textual elements.

Hierarchy

Implemented by

Index

Constructors

constructor

Properties

classList

classList: DOMTokenList

Class attribute for the root element.

root

root: SVGElement

The root element of this element.

style

style: CSSStyleDeclaration

Style for the root element.

update

update: function

The update function describes how this element should update itself

Type declaration

    • (): void
    • Returns void

Static controller

controller: Controller = new Controller()

The controller manages the dependencies between elements. Every element is added to this controller upon creation.

Static count

count: number = 0

This number uniquely identifes elements

Static disable

disable: boolean = false

Allows for the events attatched to elements to be disabled.

Accessors

id

id:

Returns the unique generated identifier associated with this element.

Methods

addDependency

  • Declares this element dependent on the provided element(s).

    Parameters

    Returns void

appendChild

  • appendChild<T>(child: T): T
  • Appends the element as a child within this element.

    Type parameters

    Parameters

    • child: T

    Returns T

clear

  • clear(): void
  • Removes all child elements from this element.

    Returns void

contains

  • contains(element: Element): boolean
  • Returns true if this element contains the argument element.

    Parameters

    Returns boolean

getAttribute

  • Returns the value associated with the attribute.

    Parameters

    Returns string

getBoundingBox

  • getBoundingBox(): SVGRect
  • Returns the bounding box of this element. Note, this is different from the getBoundingClientRect method since the bounding box is affected by the current viewPort.

    If this element's root is not a SVGGraphics element as is the case for the marker, title, and more element, then null is returned instead of a DOMRect.

    Returns SVGRect

prependChild

  • prependChild<T>(child: T): T
  • Inserts the element before the first child within this element.

    Type parameters

    Parameters

    • child: T

    Returns T

remove

  • remove(): void
  • Removes this element from the DOM and from the Element controller.

    Returns void

setAttribute

  • Sets the provided attribute with the value. WARNING: Elements are given a unique id by default. Changing the id may have unintended consequences. Similarily, the style and class attributes should be accessed through the properties "style" and "classList".

    Parameters

    Returns Element

text

  • text(x: number, y: number, str: string): Text
  • Creates and appends a text element within this element.

    Parameters

    • x: number
    • y: number
    • str: string

    Returns Text

updateDependents

  • updateDependents(): void
  • Updates all of the elements that depend on this element.

    Returns void

Static clear

  • clear(disable?: boolean): void
  • Clears the static data structures holding elements and resets the count.

    Parameters

    • Default value disable: boolean = false

    Returns void

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • 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