Elements API
Elements are the main building blocks of layers. Each layer must have one element, which can be of several types defined with ElementType
enumeration. In the table below, you can see all element names, their ElementType
and information if that element has default middleware implementation or not.
Name | Type | Default middleware |
---|---|---|
Text element | TEXT | ✅ |
Image element | IMAGE | |
Image sequence element | IMAGE_SEQUENCE | |
Image loader element | IMAGE_LOADER | ✅ |
Rectangle element | RECTANGLE | |
Ellipse element | ELLIPSE | |
Path element | PATH | |
Composition element | COMPOSITION |
All element types are described in detail on their dedicated pages.
Below are listed all properties that are shared across all element types. Note that different element types may have their own specific properties and methods together with the common ones.
Properties
id
Read-Only
- Type: string
ID of the element.
key
- Type: undefined | string
Unique key of the element. The key is used for querying the element using findElementByKey
method.
type
Read-Only
- Type: ElementType
Type of the element, as described in the introduction
domNode
Read-Only
- Type: HTMLElement
Reference to DOM element representing an element in DOM structure.
style
Read-Only
- Type: Object
Object containing all element style properties which define its final style. This object is not the same for all element types, for example text element style properties are only available for Text element object. For detailed list of all properties, check the list of all style properties.