Skip to main content


adds a new item to the diagram

add(new_item: IDataItem | IDataItem[]): Id | Id[];


new_item: object | array - the object of a new item or an array of item objects


Either a string with the item's id or an array of string values with ids of items.

Example{ id: "3.2", text: "New Item", parent: "3" });

Related sample: Diagram. Data. Add/delete item


There are two ways to link shapes, you can add a shape with a parent ID defined:{ id: "3.2", text: "New Item", type: "card", parent: "3" });

or you can add a shape and a connector line objects:{ type: "card", id: "3.2", text: "New Item" });{ type: "line", from: "3", to: "3.2" });

Adding an item