ElementProxy

An element is anything on a Lucid document that can have properties and shape data:

Extends

Extended by


Constructors

new ElementProxy()

new ElementProxy(id, client): ElementProxy

Parameters

ParameterTypeDescription
idstringID of this element
clientEditorClient

Returns

ElementProxy

Overrides

PropertyStoreProxy.constructor


Properties

allShapeData

readonly allShapeData: MapProxy<string, SerializedFieldType | DataError>;

All shape data accessible on this element, including shape data inherited from the page or a containing group.
This collection is read-only.


client

protected readonly client: EditorClient;

Inherited from

PropertyStoreProxy.client


id

readonly id: string;

ID of this element

Inherited from

PropertyStoreProxy.id


properties

readonly properties: WriteableMapProxy<string, JsonSerializable, void, JsonSerializable>;

All properties available on this element, organized by name.
Not all properties are writeable (e.g. "ClassName" on a block).
To move or resize elements, use setLocation() or setBoundingBox() or offset() instead.

Inherited from

PropertyStoreProxy.properties


referenceKeys

readonly referenceKeys: MapProxy<string | number, ReferenceKeyProxy>;

The set of reference keys, organized by their ID, which can be either a string or number.

For more information, see the Developer Guide.


shapeData

readonly shapeData: ShapeDataProxy;

The shape data set directly on this element (not including any shape data inherited from the page or a containing group).


Methods

executeFormula()

executeFormula(formula): SerializedFieldType | DataError

Execute a formula in the context of this element

Parameters

ParameterTypeDescription
formulastringThe formula text, e.g. "@a + @b" to add together the shape data values a and b.

Returns

SerializedFieldType | DataError

The result of the formula, or an error.


exists()

exists(): boolean

Returns

boolean

true if this element still exists on the document, or false otherwise


removeReferenceKey()

removeReferenceKey(key): void

Remove the specified reference key from this element.

Parameters

ParameterTypeDescription
keystring | number

Returns

void


setReferenceKey()

setReferenceKey(key, settings): void

Set a reference key on this element, replacing any existing reference at the specified key.

Parameters

ParameterTypeDescription
keystring | number
settingsReferenceKeyDefinition

Returns

void