On deserialization of diagram, links are not getting rendered
getDiagram(){
let engine = this.props.app.getDiagramEngine();
let model = engine.getDiagramModel();
model.deSerializeDiagram(JSON.parse(layout), engine);
engine.setDiagramModel(model);
this.forceUpdate();
}
I am using this code, to render the diagram from saved model. The links are initially not visible, they only appear after a user's click on the canvas. Any suggestions to why this could be happening?
I just started using this package, but I think calling this is worth a try:
engine.repaintCanvas();
@jackietieu thanks for the suggestion, however, I also had to add a delay to make it work. It was related to the links taking time to establish relation between nodes. So I added a delay like so, to render the links as well:
setTimeout(() => {
engine.repaintCanvas();
this.forceUpdate();
});
This should be fixed in the 6 beta, gonna close this for now (I overhauled the system entirely)