sets values for Diagram Editor
data | object | object with data fields |
const data = $$("diagram").serialize(true);
$$("editor").setValues(data);
As a parameter the method expects an object with the following fields:
const data = {
data: [
{ id: "start", type: "circle", value: "start", x: 0, y: 80 },
// other blocks
],
links: [
{ source: "start", target: "search", id: 132 },
// other links
],
shapes: [
{
backgroundColor: "#65C0B7", fontColor: "#fff",
group: "block", id: "circle",
lineColor: "#65C0B7", name: "Circle",
svg: "svg_code"
},
// other shapes
],
item: {
height: 50, width: 100
},
linkItem: {
arrowSize: 6, arrow: false,
mode: "edges", backgroundColor: "magenta"
}
};
$$("editor").setValues(data);