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:
Returns the HTML element, containing all the children.
HTMLElement
# hide() → {void}
Makes the component invisible. Interactions shouldn't be possible anymore.
- Overrides:
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:
The new 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:
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.
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:
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:
void
# updateAttributes() → {void}
Updates the attributes of the SVG element in the DOM
- Overrides:
Void
void