-
Notifications
You must be signed in to change notification settings - Fork 82
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
Interactive plots do not fill the plot area until redrawn by switching focus #4245
Comments
The plot height seems to be stuck at 450px, which I think is the default for Plotly when no height is specified. The width seems to be set to the view's width when first showing the plot. Plotly won't resize when it has a set size on the container. It should be triggering the resize event but that doesn't seem to happen. Rendering the plot with the fig.show(
config={'responsive': True}
) Plotly generates a container where the width is 100% and height is 450px. fig.show() Plotly generates a container where the width is the plot view's width and height is 450px. |
### Description A follow-up to #4806 to revert `src/vs/workbench/services/languageRuntime/common/languageRuntimeUiClient.ts` back to using a proxy for interactive plots. A generic HTTP proxy was added via #4855, so server plots can be proxied appropriately in Server Web and Workbench. Related to - #4804 - #4274 - #4245 ### QA Notes On Server Web and Workbench, running the following in the corresponding consoles: ##### Python `pip install plotly nbformat pandas` ```python import plotly.express as px fig = px.bar(x=["a", "b", "c"], y=[1, 3, 2]) fig.show() ``` ##### R `install.packages('plotly')` ```r library(plotly) fig <- plot_ly(data = iris, x = ~Sepal.Length, y = ~Petal.Length) fig ``` #### Expected Result The corresponding interactive plots should display in the plots pane and be interact-able!
@timtmok , despite toggling Screen.Recording.2024-10-04.at.10.43.08.AM.mov |
I'm going to take a closer look. I don't think any of these changes affected it but there seems to be something wrong with reading the preference value. I couldn't reproduce until I toggled the preference on/off. Then I couldn't open in the Plots view no matter what was set with the preference. |
I see the same behavior as @midleman , no matter the setting the plotly plots always show in the viewer. Windows 11 Note, I also restarted Positron after playing with the setting and no change in behavior |
I'll create a new issue for this regression. It occurs when showing the figure with |
Verified FixedPositron Version(s) : 2024.10.0-13 Test scenario(s)Confirmed expected behavior by using Link(s) to TestRail test cases run or created:n/a |
### Description A follow-up to #4806 to revert `src/vs/workbench/services/languageRuntime/common/languageRuntimeUiClient.ts` back to using a proxy for interactive plots. A generic HTTP proxy was added via #4855, so server plots can be proxied appropriately in Server Web and Workbench. Related to - #4804 - #4274 - #4245 ### QA Notes On Server Web and Workbench, running the following in the corresponding consoles: ##### Python `pip install plotly nbformat pandas` ```python import plotly.express as px fig = px.bar(x=["a", "b", "c"], y=[1, 3, 2]) fig.show() ``` ##### R `install.packages('plotly')` ```r library(plotly) fig <- plot_ly(data = iris, x = ~Sepal.Length, y = ~Petal.Length) fig ``` #### Expected Result The corresponding interactive plots should display in the plots pane and be interact-able!
### Description A follow-up to #4806 to revert `src/vs/workbench/services/languageRuntime/common/languageRuntimeUiClient.ts` back to using a proxy for interactive plots. A generic HTTP proxy was added via #4855, so server plots can be proxied appropriately in Server Web and Workbench. Related to - #4804 - #4274 - #4245 ### QA Notes On Server Web and Workbench, running the following in the corresponding consoles: ##### Python `pip install plotly nbformat pandas` ```python import plotly.express as px fig = px.bar(x=["a", "b", "c"], y=[1, 3, 2]) fig.show() ``` ##### R `install.packages('plotly')` ```r library(plotly) fig <- plot_ly(data = iris, x = ~Sepal.Length, y = ~Petal.Length) fig ``` #### Expected Result The corresponding interactive plots should display in the plots pane and be interact-able!
System details:
Positron Version: 2024.07.0 (Universal) build 125
Code - OSS Version: 1.91.0
Commit: cae4905
Date: 2024-08-01T00:27:06.019Z
Electron: 29.4.0
Chromium: 122.0.6261.156
Node.js: 20.9.0
V8: 12.2.281.27-electron.0
OS: Darwin arm64 23.5.0
Interpreter details:
Python 3.12.0
Describe the issue:
Interactive graphics like
plotly
do not resize/redraw to fit the space until a plot other than Session pane is loaded.Steps to reproduce the issue:
Screen.Cast.2024-08-05.at.1.56.12.PM.mp4
Expected or desired behavior:
Given interactive graphics can be dynamic to the size, for example in RStudio's plot pane or in a web browser, it should also fit to the Plot pane.
Screen.Cast.2024-08-05.at.2.03.22.PM.mp4
Were there any error messages in the UI, Output panel, or Developer Tools console?
The text was updated successfully, but these errors were encountered: