positron
positron copied to clipboard
Interactive plots do not fill the plot area until redrawn by switching focus
System details:
Positron Version: 2024.07.0 (Universal) build 125
Code - OSS Version: 1.91.0 Commit: cae4905332a0f41a6233e196b48a6679b832000a 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:
- In a Python script run the following code
import plotly.express as px
fig = px.bar(x=["a", "b", "c"], y=[1, 3, 2])
fig
- Note that the dimensions of the JavaScript/HTML output are essentially fixed, even with resizing of the plot-pane.
- Change the overall height and width of the Plot pane, then move focus away from the Session pane to the Viewer pane or Help pane, and then return to the Session > Plot pane.
- Notice that the interactive plot has redrawn to fit the new dimensions.
https://github.com/user-attachments/assets/9224da76-d7f9-42df-a051-e6cb290658b3
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.
https://github.com/user-attachments/assets/eceb6b5b-ab1a-4157-bd1c-75c64661464e