Skip to main content

map()

iterates through all items of the diagram

map(callback: DataCallback<T>): T[];

Parameters:

  • callback: function - a function that will be called for each item of a diagram

Returns:

A new array of items where each item is the result of the callback function.

Example

//getting ids of all items of the diagram (shapes, links, groups, swimlanes)
diagram.data.map(function(item){
console.log(item.id);
});