Skip to main content

getItem()

returns the object of an item by its id

getItem(id: Id): T;

Parameters:

id: string | number - the id of a selected item

Returns:

The object of an item.

Example

const shape = diagram.data.getItem(123);

You can access the original properties of an item like this:

// accessing the properties of the shape
const shape = diagram.data.getItem(123);
const text = shape.text;

Getting an item