If the web page is open on multiple places (e.g. one in web browser, the other in VSCode WebView), the resize of one viewer might cause all viewers to resize, or sometimes the viewer falls into resizing to different sizes endlessly.
I'm curious if there's a good way to handle multiple viewer while apparently the R session could only replay the plot (I'm not 100% sure if the resizing is implemented by replay?) for one certain size.
The text was updated successfully, but these errors were encountered:
Having multiple graphics views to compare plots sounds very exciting.
The server state is currently designed to be synchronized with both the state of the R graphics engine as well as the (JS) client. This means right now no two clients can display different resolutions or display different plots in the plot history. (Yes each resize requires a replay.)
I think the API can be made stateless so this can be solved on the client side. To be fully stateless this will however require the websockets implementation I am working on right now (to push server events). Then the plot history navigation just needs to be changed slightly.
I have just pushed an changes that make the API stateless. Multiple clients can have different resolutions and show different plots of the history. The server now figures out by itself if it needs to redraw. This also made the API a lot simpler. (Websockets are not in yet, but will follow soon.)
Edit: Just fixed a race condition. Writing multithreaded code is hard.