Accessing Viewport Information on the server side #1558
-
Hey there, I'm trying to center the nodes on the canvas after triggering a layout. However I'm having trouble accessing the Viewport from the server side, in the layout operation handler. I tried injecting the ActionDispatcher and sending a GetViewportAction but this appears to have no response. Is there any way I can access this information? I originally considered triggering a CenterSelection, however as far as I can see this simply moves the viewport, which means that the node positions are not changed and hence on reload the nodes go back to where they were before. Using glsp-server-node and glsp-vscode-integration. Cheers! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Hi @jmenzies12, you are right, the For what you are trying to achieve, dispatching a |
Beta Was this translation helpful? Give feedback.
Hey @martin-fleck-at,
Thanks for the response and your suggestions. I ended up with a fairly good solution but let me know your thoughts.
The trigger action for layout in the vscode-integration, triggers LayoutOperation in the configuration-utils, as far as I'm aware this has no access to the viewport, and then LayoutOperation is sent direct to the server.
I had to do the following: