Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Index

Constructors

constructor

Accessors

attributes

  • get attributes(): AttributeMap

children

events

  • get events(): SVGManagerEventDefinition[]

innerText

  • get innerText(): string

tagName

  • get tagName(): SVGTag

tags

  • get tags(): string[]

Methods

animate

append

  • Mutates the SVGNode to append an child SVGNode child to the children of the current SVGNode. Then, it returns itself, for easy programming.

    Parameters

    Returns this

class

  • class(className: string): this

clearEvents

  • clearEvents(eventName?: SVGEventName): this
  • Remove either all events from 1 SVGEventName, or all if not given a name

    Parameters

    • Optional eventName: SVGEventName

    Returns this

copy

cx

  • cx(val: AttributeValue): this

cy

  • cy(val: AttributeValue): this

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
  • Fetch a specific attribute's value

    Parameters

    • attr: SVGAttribute

    Returns AttributeValue | undefined

gradientTransform

  • gradientTransform(value: AttributeValue): this

gradientUnits

  • gradientUnits(value: "userSpaceOnUse" | "objectBoundingBox"): this
  • Set the gradientUnits attribute of the Gradient

    Parameters

    • value: "userSpaceOnUse" | "objectBoundingBox"

      Either 'userSpaceOnUse' or 'objectBoundingBox'

    Returns this

href

  • href(value: AttributeValue): this

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
  • Mutates the SVGNode to add an event. Multiple functions can be set for the same event. Then, it returns itself, for easy programming.

    Parameters

    • eventName: SVGEventName
    • func: SVGManagerEventHandler

    Returns this

r

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

    Parameters

    • radius: AttributeValue

    Returns this

removeChild

  • removeChild(index: number): this

removeChildren

  • removeChildren(): this

set

  • set(attr: SVGAttribute, value: AttributeValue): this
  • Mutates the SVGNode to add/change an attribute attr to value. Then, it returns itself, for easy programming.

    Parameters

    • attr: SVGAttribute
    • value: AttributeValue

    Returns this

shallowEquals

  • shallowEquals(node: SVGNode): boolean

spreadMethod

  • spreadMethod(value: "pad" | "reflect" | "repeat"): this

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
  • Give tag to the SVGNode to mention later

    Parameters

    • tag: string

      Tag given to SVGNode

    Returns this

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

x1

  • x1(length: AttributeValue): this
  • Set the x1 attribute of the Linear Gradient

    Parameters

    • length: AttributeValue

      Length from 0-1

    Returns this

x2

  • x2(length: AttributeValue): this
  • Set the x2 attribute of the Linear Gradient

    Parameters

    • length: AttributeValue

      Length from 0-1

    Returns this

y

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

    Parameters

    • val: AttributeValue

    Returns this

y1

  • y1(length: AttributeValue): this
  • Set the y1 attribute of the Linear Gradient

    Parameters

    • length: AttributeValue

      Length from 0-1

    Returns this

y2

  • y2(length: AttributeValue): this
  • Set the y2 attribute of the Linear Gradient

    Parameters

    • length: AttributeValue

      Length from 0-1

    Returns this

Generated using TypeDoc