We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Remember and set view position

Hello,
is there any way to remember and then set view position, aka how user views a diagram?

I have tried the following

const { verticalOffset, horizontalOffset, currentZoom, } = diagram.scrollSettings;

and then

diagram.pan(horizontalOffs, verticalOffset);
diagram.zoom(currentZoom);

But diagram does not behave as expected and view is not as requested

Is this the recommended solution?
Thank you

7 Replies

SG Shyam G Syncfusion Team February 5, 2020 09:24 AM UTC

Hi Gabo, 

Please confirm us whether you need to update the diagram size at runtime or need to move the scrollbar programatically. We could not able to understand your exact requirement. Could you please elaborate your requirement in detail with the screenshot or video. 

Regards, 
Shyam G 



GE Gabo EE February 5, 2020 03:44 PM UTC

Hi,
I am trying to close diagram and after that opening it. Problem is that users is seeing different view, because diagram has moved to initial position and diagram is not in position (view) as user remembers it.


SG Shyam G Syncfusion Team February 6, 2020 12:44 PM UTC

Hi Gabo, 
 
Before closing the diagram, you can save the diagram using saveDiagram method. After opening a new page, you can load the diagram using loadDiagram method. The saved diagram position will be retained while loading the diagram. Please refer to a below sample and the help documentation below. 
 


 
Regards, 
Shyam G 



GE Gabo EE February 7, 2020 02:17 PM UTC

Sorry, but I do not want to save diagram. Data representing diagram may change between closing and opening.


SG Shyam G Syncfusion Team February 10, 2020 07:03 AM UTC

Hi Gabo,
Could you please confirm us whether you need a collaborative diagram which means when you perform a diagram interactions in one machine should change in the other machine. If yes, we don’t have a support for it. If we misunderstood your requirement, please share us more details such as elaborate your exact requirement in detail with the screenshot or video. 

Regards, 
Shyam G 



GE Gabo EE February 10, 2020 02:03 PM UTC

I am not talking about real time changes among multiple users, just about changes made by one user, who may decide to close diagram at one moment and open it few seconds later with saved view position, so diagram does not appear as jumping


SG Shyam G Syncfusion Team February 11, 2020 10:05 AM UTC

Hi Gabo, 
 
We don’t have any other option to retain the state of the diagram except saveDiagram and loadDiagram method. As mentioned earlier, Before closing the diagram, you can save the diagram using saveDiagram method. After opening a new page, you can load the diagram using loadDiagram method. The saved diagram position will be retained while loading the diagram. Please refer to a  help documentation below.  
   
 
 
 
Regards, 
Shyam G 


Loader.
Live Chat Icon For mobile
Up arrow icon