Class

SVGButton

SVGButton()

A Button Element

Constructor

# new SVGButton()

View Source index.js, line 3489

Extends

Methods

# createSVGElement(c) → {HTMLElement}

Puts together the HTML element with all it's sub element, ready to be added to a parent.

Parameters:
Name Type Default Description
c HTMLElement null

(Optional) Equivalent to setting the .renderContainer property.

Overrides:

View Source index.js, line 162

Returns the HTML element, containing all the children.

HTMLElement

# hide() → {void}

Makes the component invisible. Interactions shouldn't be possible anymore.

Overrides:

View Source index.js, line 51

void

# move(deltaX, deltaY) → {Position}

Move the component relative to its current position.

Parameters:
Name Type Description
deltaX number

The amount of

deltaY number

description

Overrides:

View Source index.js, line 192

The new position

Position

# moveToTop() → {boolean}

Moves the svg container to the top of the parent. The parent has to be specified earlier by setting .renderContainer to an HTML element

Overrides:

View Source index.js, line 127

Wether moving could be done or not. Returns false, if renderContainer isn't set.

boolean

# setComponentScale(newScale) → {number}

Scales the component and its children.

Parameters:
Name Type Description
newScale number

The new scale of the component

Overrides:
Deprecated:
  • Broken in many ways, use .setViewboxScale() instead.

View Source index.js, line 207

The new scale.

number

# setPosition(pos) → {object}

Change the coordinates in the parent svg element

Parameters:
Name Type Description
pos object

The new position object

x number

X coordinate

y number

Y coordinate

Overrides:

View Source index.js, line 149

The new position

object

# setViewboxScale(newScale) → {void}

Change the scale of the element using the viewBox property.

Parameters:
Name Type Description
newScale number

The new scale of the element

Overrides:

View Source index.js, line 232

void

# show() → {void}

Reverts hide

Overrides:

View Source index.js, line 59

void

# updateAttributes() → {void}

Updates the attributes of the SVG element in the DOM

Overrides:

View Source index.js, line 68

Void

void