parse()
Description
Loads data into the editor from a local data source
Usage
parse(data: array): void;
Parameters
data
- (required) the data that should be parsed into the editor
You can load data in any supported data format. See the details in the parse() article.
Example
const data = [
// shapes
{
"id": "a",
"x": 50,
"y": 53,
"type": "triangle",
"text": "Shape 1",
"height": 50,
"width": 50
},
{
"id": "b",
"x": 367,
"y": 158,
"type": "rectangle",
"text": "Shape 2"
},
// connector line
{
"id": "ab",
"from":"a",
"to":"b",
"type": "line"
},
];
const editor = new dhx.DiagramEditor("editor_container");
editor.parse(data);
Related samples: