CSS and Diagram attribute values of TreeModel map are as below:
width : 100%;
height : 250px;
border : 1px solid black;
margin : 2px
initialAutoScale : go.Diagram.UniformToFill,
maxScale : 0.25,
contentAlignment : go.Spot.Center,
“animationManager.isEnabled” : false,
Layout : $(go.TreeLayout,
Question: How to re-center GoJS Tree Model diagram auto/dynamically after expanding the width of the view area ?
Scenario : GoJS TreeModel diagram completed “InitialLayoutCompleted” event and gets drawn on web page. The web page contains Notification area + Inspect Element along with GoJS diagram covering around 40% of the entire page.
So let’s say GoJS took 60% of the page width to draw Local View map diagram centered at (x1,y1) and Notification area + Inspect element took 40% of the entire page on the right side.
Now if I close Notification area + Inspect element dynamically after drawing Local View map, I am getting full 100% width of the page for Local View diagram with new page center (x2,y2), but it is not getting redrawn automatically. Instead it just stays in the old page center (x1,y1) without moving to the middle of the page as shown below:
Initial rendering with less space:
After closing Notification and inspect element: (Map is still centered in the old center)
Please suggest me a solution for this problem.