Skip to main content

DataCollection overview

A set of APIs that allow you to work with data of a diagram. The API can be used both in the diagram and in the editor.


add()adds a new item to the diagram
copy()creates a copy of an item at the defined position
eachChild()iterates through the children of the specified item
eachParent()iterates through all parents of the specified item
exists()checks whether the specified item exists in the diagram
filter()filters items in the diagram
find()finds the item that corresponds to the specified parameters
findAll()finds all the items that correspond to the specified parameters
getId()returns the id of the item by its index
getIndex()returns the index of the item by its id
getItem()returns the object of an item by its id
getNearId()looks for a nearest item relative to the specified one
getRoot()returns the id of the root item by the id of its child
getRoots()returns an array with ids of all root items of the diagram
load()loads data from an external file
map()iterates through all items of the diagram
move()moves an item to the defined position
parse()loads data from a local data source
remove()deletes the specified item from the diagram
removeAll()deletes all items from the diagram
serialize()serializes the diagram data into an array of JSON objects
update()updates properties of the item


afterAddfires after adding an item
beforeAddfires before adding an item
changefires on changes in the dataset of the diagram
loadfires when data is loaded into the diagram