Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi view plots do not resize correctly #3757

Open
sroy3 opened this issue Apr 25, 2023 · 5 comments
Open

Multi view plots do not resize correctly #3757

sroy3 opened this issue Apr 25, 2023 · 5 comments
Labels
A: plots Area: plots webview, side panel and everything related blocked Issue or pull request blocked due to other dependencies or issues priority-p2 Future feature, less priority for now

Comments

@sroy3
Copy link
Contributor

sroy3 commented Apr 25, 2023

Vegalite has limitations on responsive resizing (using the size of the plot's container). These limitations are on multi view plots. There are multiple workarounds to fix this. Some might fix everything, but might be to expensive performance-wise. Others might be more performant, but not make the plots inside resize like other plots completely.

  • Change the size in the template. This will have to be done on each window resize as well as plot resize after the size is calculated. The size will need to be calculated in the webview, but the template is in the extension. A delay might appear between the resize of the window or plots and the resize of the actual plot. Changing the template on the webview side might be even worse as it might block the thread.
  • We can edit the size of the SVG after its creation. We can go and resize everything needed, but that might be really complicated not knowing how VegaLite calculates everything. We can at least make sure the width and height of the SVG are not smaller than the dimensions of its container.
  • We can look into the internals of VegaLite and either fork, patch, or open a pull request to fix the problem.
@sroy3
Copy link
Contributor Author

sroy3 commented Apr 25, 2023

I'll create quick prototypes to test for the best solution.

@sroy3 sroy3 self-assigned this Apr 25, 2023
@sroy3 sroy3 added priority-p1 Regular product backlog A: plots Area: plots webview, side panel and everything related labels Apr 25, 2023
@sroy3 sroy3 added this to To do in VS Code Apr 17 via automation Apr 25, 2023
@sroy3 sroy3 moved this from To do to In progress in VS Code Apr 17 Apr 25, 2023
@sroy3 sroy3 added this to In progress in VS Code Apr 25 Apr 25, 2023
@sroy3
Copy link
Contributor Author

sroy3 commented May 2, 2023

There is already an issue opened for this on the Vegalite repo. There is even a PR that is requiring some help getting merged. We can maybe take a look at it and help if we can.

@mattseddon mattseddon added blocked Issue or pull request blocked due to other dependencies or issues priority-p2 Future feature, less priority for now and removed priority-p1 Regular product backlog labels Aug 8, 2023
@mattseddon
Copy link
Member

Decision needs to be made on whether or not we will move to Plotly and when.

@mattseddon
Copy link
Member

Change the size in the template. This will have to be done on each window resize as well as plot resize after the size is calculated. The size will need to be calculated in the webview, but the template is in the extension. A delay might appear between the resize of the window or plots and the resize of the actual plot. Changing the template on the webview side might be even worse as it might block the thread.

@sroy3 do you remember if this calculation would be difficult? If we reliably knew where to insert the correct width for a single revision into the plot would this be doable? For some context, we are going to be filling the template on the webview side now. We're also adding anchors for a few different things. If we had an anchor to update the width of an individual plot would that make this achievable?

@sroy3
Copy link
Contributor Author

sroy3 commented Oct 5, 2023

Change the size in the template. This will have to be done on each window resize as well as plot resize after the size is calculated. The size will need to be calculated in the webview, but the template is in the extension. A delay might appear between the resize of the window or plots and the resize of the actual plot. Changing the template on the webview side might be even worse as it might block the thread.

@sroy3 do you remember if this calculation would be difficult? If we reliably knew where to insert the correct width for a single revision into the plot would this be doable? For some context, we are going to be filling the template on the webview side now. We're also adding anchors for a few different things. If we had an anchor to update the width of an individual plot would that make this achievable?

I think this could work. Off the top of my head, I don't see why this would be hard to do, but it's been a while since I've been in the codebase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A: plots Area: plots webview, side panel and everything related blocked Issue or pull request blocked due to other dependencies or issues priority-p2 Future feature, less priority for now
Projects
No open projects
VS Code Apr 17
In progress
VS Code Apr 25
In progress
Development

No branches or pull requests

2 participants