I am trying to centre the diagram in the viewport after loading a new diagram using the toJson() method on the model.
I have tried using a combination of the autoScale, contentAlignment, initialContentAlignment, initialDocumentSpot and initialViewportSpot properties, but each time I load a diagram that is smaller than my viewport, I get scroll bars and the diagram/document is not centred.
If I click on the diagram/viewport, the document jumps into the centre and the scroll bars disappear.
I have also tried using the diagram update() and invalidateLayout() Methods which don’t work!
Any suggestions anyone?!?!