Skip to main content

Class: SvgList

This helper class is to wrap multiple Svg elements into a list where you can call the Svg functions on all elements in the list with one call. This is helpful when you'd like to perform calls with Svg on multiple elements. An instance of this class is also returned by Svg.querySelectorAll.

Implements

  • SvgListMethods

Properties

svgElements

Private svgElements: Svg[] = []

Defined in

svg/SvgList.ts:25

Constructors

constructor

new SvgList(nodeList)

Parameters

NameTypeDescription
nodeListArrayLike<Element>An Array of SVG DOM nodes or a SVG DOM NodeList (as returned by document.querySelectorAll)

Defined in

svg/SvgList.ts:30

Methods

call

Private call<T>(method, args): SvgList

Type parameters

NameType
Textends SvgMethods

Parameters

NameType
methodT
argsParameters<Svg[T]>

Returns

SvgList

Defined in

svg/SvgList.ts:36


attr

attr(...args): SvgList

Parameters

NameType
...args[attributes: Attributes]

Returns

SvgList

Implementation of

SvgListMethods.attr

Defined in

svg/SvgList.ts:43


elem

elem(...args): SvgList

Parameters

NameType
...args[name: string, attributes?: Attributes, className?: string, insertFirst: boolean]

Returns

SvgList

Implementation of

SvgListMethods.elem

Defined in

svg/SvgList.ts:47


root

root(...args): SvgList

Parameters

NameType
...args[]

Returns

SvgList

Implementation of

SvgListMethods.root

Defined in

svg/SvgList.ts:51


getNode

getNode(...args): SvgList

Parameters

NameType
...args[]

Returns

SvgList

Implementation of

SvgListMethods.getNode

Defined in

svg/SvgList.ts:55


foreignObject

foreignObject(...args): SvgList

Parameters

NameType
...args[content: string | Node, attributes?: Attributes, className?: string, insertFirst: boolean]

Returns

SvgList

Implementation of

SvgListMethods.foreignObject

Defined in

svg/SvgList.ts:59


text

text(...args): SvgList

Parameters

NameType
...args[t: string]

Returns

SvgList

Implementation of

SvgListMethods.text

Defined in

svg/SvgList.ts:63


empty

empty(...args): SvgList

Parameters

NameType
...args[]

Returns

SvgList

Implementation of

SvgListMethods.empty

Defined in

svg/SvgList.ts:67


remove

remove(...args): SvgList

Parameters

NameType
...args[]

Returns

SvgList

Implementation of

SvgListMethods.remove

Defined in

svg/SvgList.ts:71


addClass

addClass(...args): SvgList

Parameters

NameType
...args[names: string]

Returns

SvgList

Implementation of

SvgListMethods.addClass

Defined in

svg/SvgList.ts:75


removeClass

removeClass(...args): SvgList

Parameters

NameType
...args[names: string]

Returns

SvgList

Implementation of

SvgListMethods.removeClass

Defined in

svg/SvgList.ts:79


removeAllClasses

removeAllClasses(...args): SvgList

Parameters

NameType
...args[]

Returns

SvgList

Implementation of

SvgListMethods.removeAllClasses

Defined in

svg/SvgList.ts:83


animate

animate(...args): SvgList

Parameters

NameType
...args[animations: Record<string, AnimationDefinition | AnimationDefinition[]>, guided: boolean, eventEmitter?: EventEmitter]

Returns

SvgList

Implementation of

SvgListMethods.animate

Defined in

svg/SvgList.ts:87