Options
All
  • Public
  • Public/Protected
  • All
Menu

Text is a basic element containing string contents

Hierarchy

Implements

Index

Constructors

constructor

  • new Text(x: number, y: number, str?: string): Text
  • Constructs text at the position (x,y) with the provided string

    Parameters

    • x: number
    • y: number
    • Default value str: string = ""

    Returns Text

Properties

classList

classList: DOMTokenList

Class attribute for the root element.

root

root: SVGTextElement

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

contents

contents:

Sets the contents of this element Sets the contents of this element

id

id:

Returns the unique generated identifier associated with this element.

length

length:

Returns the length of the text

x

x:

Gets the x position of this element Sets the x position of this element

y

y:

Gets the y position of this element Sets the y position of this element

Methods

addDependency

appendChild

  • appendChild<T>(child: T): 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

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

remove

  • remove(): void

setAttribute

text

  • text(x: number, y: number, str: string): Text
  • Parameters

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

    Returns Text

tspan

  • tspan(text: string): TSpan
  • Parameters

    • text: string

    Returns TSpan

updateDependents

  • updateDependents(): 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