Open keizer619 opened 8 years ago
Imagine there are 3 nodes namely node1, node2 and node3. Then set node3 as the parent of node2. Then i need to create an edge from from node1 to node3. I wrote following code and it gives TypeError: label is undefined.
g.setNode("node1", {label: "node2"}); g.setNode("node2", {label: "node2"}); g.setNode("node3", {label: "node3", clusterLabelPos: "top", style: "fill: #ffd47f"}); g.setParent("node2", "node3"); g.setEdge("node1", "node3");
if i comment g.setParent('node2', 'node3'); or g.setEdge('node1', 'node3'); graph will be drawn. Apparently we cannot do both for a node.
https://jsfiddle.net/keizer619/6f1dxpa2/
Imagine there are 3 nodes namely node1, node2 and node3. Then set node3 as the parent of node2. Then i need to create an edge from from node1 to node3. I wrote following code and it gives TypeError: label is undefined.
g.setNode("node1", {label: "node2"}); g.setNode("node2", {label: "node2"}); g.setNode("node3", {label: "node3", clusterLabelPos: "top", style: "fill: #ffd47f"}); g.setParent("node2", "node3"); g.setEdge("node1", "node3");
if i comment g.setParent('node2', 'node3'); or g.setEdge('node1', 'node3'); graph will be drawn. Apparently we cannot do both for a node.
https://jsfiddle.net/keizer619/6f1dxpa2/