My diagram is listening to “InitialLayoutCompleted” event.
What I’m trying to do is position the diagram at the center of div horizontally and vertically.
Another thing, the diagram can’t be in the top 50 pixels of the div. please see the following example:
The problem starts when the size of the diagram (documentBounds) is larger than the size of the div.
In this case, I would like to change the height of the diagram. smaller than the height of the div.
How do I change the diagram size (documentBounds) and fit the zoom to the new size?
I’m setting the Diagram.padding with the following values: new go.Margin(50, 0 , 0, 0)
When I test it on a smaller browser’s screen the top margin looks smaller then 50 pixel
Well, the Diagram.padding is in document coordinates, so the apparent distance depends on the Diagram.scale. I suppose in your “InitialLayoutCompleted” DiagramEvent listener you could set the Diagram.padding depending on the Diagram.scale.