Python: Add support for additional widget types (in viewer or plots pane)
Once #1918 is merged, we will have basic support for the widgets such as ipywidgets, ipydatagrid, and ipyleaflet in the plot pane. Still not working ❌ is:
- %matplotlib widget mode
- bqplot
- ipycanvas
- pythreejs
- ipytree
Here is a gist of all the different widgets, for testing purposes
CC: @jgutman
@isabelizimm I imagine these were all tested prior to the switchover to the later version of html-manager, it might be worth us re-testing to see whether there are any changes in what works/what doesn't after the update -- we should also specify here the module version of the above widget types that we tested, since we know now that makes a difference to whether it's compatible or not
In order to support matplotlib widgets and others that require a live Python kernel, we need to enable an actual non-stubbed RendererContext.
See current TODO in https://github.com/posit-dev/positron/blob/aa6476a862089ffa5b720ef37ca14f40bf175278/src/vs/workbench/contrib/positronOutputWebview/browser/notebookOutputWebviewServiceImpl.ts#L189-L193
and stubbed RendererContext https://github.com/posit-dev/positron/blob/aa6476a862089ffa5b720ef37ca14f40bf175278/src/vs/workbench/contrib/positronOutputWebview/browser/notebookOutputWebviewServiceImpl.ts#L208-L219
Also see how this gets handled for ipywidgets in the jupyter extension https://github.com/microsoft/vscode-jupyter/blob/4ca00b28cf3b890593e9c84d73b65e67f51a8061/src/webviews/webview-side/ipywidgets/renderer/index.ts#L244-L257
Does this cover plotly / bokeh plots?
@peekxc I believe that plotly works:
Are you observing something different?
For bokeh, I do not believe we have that working correctly right now (the plot opens in an external browser).
For bokeh, I do not believe we have that working correctly right now (the plot opens in an external browser).
Ahh, I was talking about bokeh; sorry, I assumed the behavior would be identical
https://github.com/posit-dev/positron/pull/4172 and https://github.com/posit-dev/positron/pull/4208 should get the following widgets working:
-
anywidget -
bqplot -
drawdata -
ipydatagrid -
ipyleaflet -
ipympl -
ipytree -
ipywidgets– all widget types exceptOutputwhich needs special handling -
pythreejs
There may be smaller issues with those, which we can log separately.
I haven't yet figured out why ipycanvas isn't working.
Verified Fixed
Positron Version(s) : 2024.08.0-24
OS Version : OSX
Test scenario(s)
Validated with everything here: https://gist.github.com/isabelizimm/02f7ba16dc74b202935f6d3e9ed6b892 Everything looks good except ipycanvas, which is noted above
Link(s) to TestRail test cases run or created: N/A