Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Element<SVG, ATTRIBUTES, EVENTS>

Type parameters

Hierarchy

Index

Constructors

constructor

  • new Element(context: Context, el: SVG, attrs?: Partial<ATTRIBUTES>): Element
  • new Element(context: Context, name: string, attrs?: Partial<ATTRIBUTES>, id?: undefined | string): Element
  • new Element(context: Context, el: string | SVG, attrs?: Partial<ATTRIBUTES>, id?: undefined | string): Element
  • Parameters

    • context: Context
    • el: SVG
    • Optional attrs: Partial<ATTRIBUTES>

    Returns Element

  • Parameters

    • context: Context
    • name: string
    • Optional attrs: Partial<ATTRIBUTES>
    • Optional id: undefined | string

    Returns Element

  • Parameters

    • context: Context
    • el: string | SVG
    • Optional attrs: Partial<ATTRIBUTES>
    • Optional id: undefined | string

    Returns Element

Properties

Private _id

_id: string

Private _linkedAttributes

_linkedAttributes: object

Type declaration

Protected _node

_node: SVG

Private _pendingRenders

_pendingRenders: Promise<number>[] = []

Protected _style

_style: CSSStyleDeclaration

context

context: Context

Accessors

boundingBox

  • get boundingBox(): Box

id

  • get id(): string

node

  • get node(): SVG

Methods

add

  • add(el: Element<SVGElement> | SVGElement): void

animateAttribute

  • animateAttribute<Attr>(name: Attr, val: ATTRIBUTES[Attr], duration: number, easing: EasingFunction): Promise<number> | undefined
  • Type parameters

    • Attr: keyof ATTRIBUTES

    Parameters

    • name: Attr
    • val: ATTRIBUTES[Attr]
    • duration: number
    • easing: EasingFunction

    Returns Promise<number> | undefined

clone

  • clone(deep?: boolean, id?: string): Element<SVG, ATTRIBUTES, EVENTS>
  • Parameters

    • Default value deep: boolean = true
    • Default value id: string = randomShortStringId()

    Returns Element<SVG, ATTRIBUTES, EVENTS>

Protected cloneNode

  • cloneNode(deep?: boolean): SVG
  • Parameters

    • Default value deep: boolean = true

    Returns SVG

copyStyleFrom

  • copyStyleFrom(el: Element<SVGElement, ATTRIBUTES, any>): void
  • copyStyleFrom(el: Element<SVGElement, ATTRIBUTES, any>, includeExclude: object, defaultInclude: boolean): void
  • Parameters

    • el: Element<SVGElement, ATTRIBUTES, any>

    Returns void

  • Parameters

    • el: Element<SVGElement, ATTRIBUTES, any>
    • includeExclude: object
    • defaultInclude: boolean

    Returns void

destroy

  • destroy(): void

flush

  • flush(): Promise<number>

getAttribute

  • getAttribute<Attr>(name: Attr): string | null
  • Type parameters

    • Attr: keyof ATTRIBUTES

    Parameters

    • name: Attr

    Returns string | null

getChildren

  • getChildren(): Element<SVGElement>[]

getEvent

  • getEvent<EVENT>(event: EVENT): Observable<EVENTS[EVENT]>
  • Type parameters

    • EVENT: keyof EVENTS

    Parameters

    • event: EVENT

    Returns Observable<EVENTS[EVENT]>

getEvents

  • getEvents(...events: keyof EVENTS[]): Observable<Event>
  • Parameters

    • Rest ...events: keyof EVENTS[]

    Returns Observable<Event>

linkDynamicAttribute

  • linkDynamicAttribute<Attr>(name: Attr, val: Observable<ATTRIBUTES[Attr]>): Subscription
  • Type parameters

    • Attr: keyof ATTRIBUTES

    Parameters

    • name: Attr
    • val: Observable<ATTRIBUTES[Attr]>

    Returns Subscription

renderAttribute

  • renderAttribute<Attr>(name: Attr, val: ATTRIBUTES[Attr]): void
  • Type parameters

    • Attr: keyof ATTRIBUTES

    Parameters

    • name: Attr
    • val: ATTRIBUTES[Attr]

    Returns void

setAttribute

  • setAttribute<Attr>(name: Attr, val: ATTRIBUTES[Attr]): void
  • Type parameters

    • Attr: keyof ATTRIBUTES

    Parameters

    • name: Attr
    • val: ATTRIBUTES[Attr]

    Returns void

setAttributes

  • setAttributes(attrs: Partial<ATTRIBUTES>): void
  • Parameters

    • attrs: Partial<ATTRIBUTES>

    Returns void

toString

  • toString(): string

Generated using TypeDoc