Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SVGElement

Hierarchy

Index

Constructors

  • new SVGElement(document: Document, node?: HTMLElement, captureTextNodes?: boolean): SVGElement

Properties

animationFrozen: boolean = false
animationFrozenValue: string = ''
attributes: Record<string, Property<unknown>> = {}
captureTextNodes: boolean = false
children: Element[] = []
document: Document
node?: HTMLElement
parent: Element = null
root: boolean = false
styles: Record<string, Property<unknown>> = {}
stylesSpecificity: Record<string, string> = {}
type: string = 'svg'
ignoreChildTypes: string[] = ...

Methods

  • addChild(childNode: HTMLElement | Element): void
  • addStylesFromStyleDefinition(): void
  • calculateOpacity(): number
  • getAttribute(name: string, createIfNotExists?: boolean): Property<unknown>
  • getStyle(name: string, createIfNotExists?: boolean, skipAncestors?: boolean): Property<unknown>
  • isFirstChild(): boolean
  • matchesSelector(selector: string): boolean
  • removeStyles(element: Element, ignoreStyles: string[]): [string, string][]
  • resize(width: number, height?: number, preserveAspectRatio?: string | boolean): void
  • Resize SVG to fit in given size.

    Parameters

    • width: number
    • height: number = width
    • preserveAspectRatio: string | boolean = false

    Returns void

  • restoreStyles(element: Element, styles: [string, string][]): void

Generated using TypeDoc