graph.getModel().beginUpdate();
// Adds cells to the model in a single step
var layout = new mxHierarchicalLayout(graph)
graph.getModel().beginUpdate()
graph.removeCells(graph.getChildVertices(parent));
try {
graph.setHtmlLabels(true)
for (var node_id = 0; node_id < num_of_nodes; node_id++) {
this.view_node(node_id);
}
for (var i = 0; i < num_of_edges; i++) {
this.view_edge(i)
}
layout.execute(parent)
} finally {
// Updates the display
graph.getModel().endUpdate()
}
graph.zoomOut() // commenting these two lines results in disappear of the graph.
graph.zoomIn()
I don't know why this happens.