Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SVGLinkedNode

A SVGNode linked/attached to a DOM element, which will therefore instantly apply any changes to the DOM, and fetch up to date properties of the SVGNode

Hierarchy

Index

Constructors

constructor

Accessors

attributes

  • get attributes(): AttributeMap

children

element

  • get element(): SVGElement
  • Fetch the raw element on the DOM

    Returns SVGElement

events

  • get events(): SVGManagerEventDefinition[]

innerText

  • get innerText(): string

tagName

  • get tagName(): SVGTag

tags

  • get tags(): string[]

Methods

animate

append

class

  • class(className: string): this

clearEvents

  • clearEvents(eventName?: SVGEventName): this

copy

cx

  • cx(val: AttributeValue): this

cy

  • cy(val: AttributeValue): this

destruct

  • destruct(): void
  • Will remove the element from the DOM and deactivate this variable

    Returns void

equals

fill

  • fill(color: AttributeValue, opacity?: AttributeValue): this
  • Shortcut for setting fill attributes

    Parameters

    • color: AttributeValue
    • Optional opacity: AttributeValue

    Returns this

fillDef

  • fillDef(definition: SVGManagerDefinition, opacity?: AttributeValue): this

get

  • get(attr: SVGAttribute): AttributeValue | undefined

map

  • map(attr: SVGAttribute, f: (_value: AttributeValue) => AttributeValue): SVGNode
  • Mutates the SVGNode to change an attribute attr by putting its value through the function f. Then, it returns itself, for easy programming.

    Note

    If the attribute was not set, the call still succeeds but does nothing.

    Parameters

    • attr: SVGAttribute
    • f: (_value: AttributeValue) => AttributeValue
        • (_value: AttributeValue): AttributeValue
        • Parameters

          • _value: AttributeValue

          Returns AttributeValue

    Returns SVGNode

on

  • on(eventName: SVGEventName, func: SVGManagerEventHandler): this

r

  • r(radius: AttributeValue): this
  • Setter for the r attribute

    Parameters

    • radius: AttributeValue

    Returns this

removeChild

  • removeChild(index: number): this

removeChildren

  • removeChildren(): this

render

  • Renders a figure to the SVG using a SVGNode

    Parameters

    Returns this

set

  • set(attr: SVGAttribute, value: AttributeValue): this

shallowEquals

  • shallowEquals(node: SVGNode): boolean

stroke

  • stroke(color: AttributeValue, width?: AttributeValue, opacity?: AttributeValue): this
  • Shortcut for setting stroke attributes

    Parameters

    • color: AttributeValue
    • Optional width: AttributeValue
    • Optional opacity: AttributeValue

    Returns this

strokeDef

  • strokeDef(definition: SVGManagerDefinition, width?: AttributeValue, opacity?: AttributeValue): this
  • Shortcut for setting stroke attributes to a definition (See more at SVGManager.define)

    Parameters

    • definition: SVGManagerDefinition
    • Optional width: AttributeValue
    • Optional opacity: AttributeValue

    Returns this

tag

  • tag(tag: string): this

tagged

text

  • text(s: string): this

toHTML

  • toHTML(): SVGElement

toHash

  • toHash(): string

untag

  • untag(tag: string): this
  • Removes tag from node, if it does not exist it does nothing.

    Parameters

    • tag: string

    Returns this

x

  • x(val: AttributeValue): this
  • Setter for the x attribute

    Parameters

    • val: AttributeValue

    Returns this

y

  • y(val: AttributeValue): this
  • Setter for the y attribute

    Parameters

    • val: AttributeValue

    Returns this

Generated using TypeDoc