Type class
A base class for all SVG elements. Provides low-level DOM functionality.
All visual elements extend this class.
Sources
AMElement can be used (imported) via one of the following packages.
/** * -------------------------------------------------------- * Import from: "core.ts" * Use like: am4core.AMElement * -------------------------------------------------------- */ import * as am4core from "@amcharts/amcharts4/core";
/** * -------------------------------------------------------- * Include via: <script src="core.js"></script> * Access items like: am4.AMElement * -------------------------------------------------------- */
Inheritance
AMElement does not extend any other symbol.
AMElement is extended by Group
.
Properties
content # |
Type Element's SVG contents. Returns element's contents as SVG markup. |
---|---|
node # |
Type An SVG node of the element. |
rotation # |
Type Element's rotation in degrees. |
scale # |
Type Element's scale where 1 is original size. Setting to 0.5 will reduce element's size by 50%, 2 will make element twice as large, etc. |
textContent # |
Type Text contents of the SVG element. |
x # |
Type Element's X position in pixels. |
y # |
Type Element's Y position in pixels. |
Methods
addClass( name: ) |
Returns Adds a class to element. |
---|---|
addStyle( attributes: ) |
Returns Adds style attributes to element's node. |
attr( attributes: ) |
Returns Sets a set of attributes on a element. |
attrNS( ns: ) |
Returns Sets a single attribute of the element's node using namesspace. |
constructor( element: ) |
Returns Constructor creates a new element or uses the one that was passed in. |
dispose() |
Returns Disposes element. |
getAttr( attribute: ) |
Returns Returns a value of a node attribute. |
getAttrNS( ns: ) |
Returns Returns a namespaced attribute value from node. |
getBBox() |
Returns Returns bounding box of the element. ATTENTION: Bounding box calculations are extremely costly so should be used sparingly and cached whenever possible. |
getStyle( attribute: ) |
Returns Returns style attribute value. |
isDisposed() |
Returns Was this element already been disposed? |
moveTo( point: ) |
Returns Moves the element to new coordinates. |
removeAttr( attribute: ) |
Returns Removes an attribute from element. |
removeChildNodes() |
Returns Removes all element's child nodes, basically leaving it empty. |
removeClass( name: ) |
Returns Removes a class from element. |
removeNode() |
Returns Removes element's node from DOM. |
removeStyle( attribute: ) |
Returns Removes |
setClass( name: ) |
Returns Sets a class name on element. |
Events
AMElement does not have any events.
Adapters
AMElement does not have any adapters.