const data = {
nodes: [{
id: 'node1',
x: 100,
y: 200
},{
id: 'node2',
x: 300,
y: 200
}],
edges: [{
id: 'edge1',
target: 'node2',
source: 'node1'
}]
};
const editor = new G6Editor();
const toolBar = new G6Editor.Toolbar({
graph: {
container: 'toolBar',
width: 500,
height: 1000,
}
});
const flow = new G6Editor.Flow({
container: 'mountNode',
width: 500,
height: 500
});
editor.add(flow);
editor.add(toolBar);
flow.read(data);
<div>
<div id="toolBar">
</div>
<div id="mountNode"></div>
</div>