posit-dev / positron

Positron, a next-generation data science IDE
Other
2.31k stars 68 forks source link

Python: Add support for additional widget types (in viewer or plots pane) #1924

Closed isabelizimm closed 4 weeks ago

isabelizimm commented 9 months ago

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:

Here is a gist of all the different widgets, for testing purposes

CC: @jgutman

jgutman commented 9 months ago

@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

jgutman commented 7 months ago

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

peekxc commented 2 months ago

Does this cover plotly / bokeh plots?

juliasilge commented 2 months ago

@peekxc I believe that plotly works:

plotly

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).

peekxc commented 2 months ago

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

Screenshot 2024-07-06 at 9 21 29 AM
seeM commented 1 month ago

https://github.com/posit-dev/positron/pull/4172 and https://github.com/posit-dev/positron/pull/4208 should get the following widgets working:

There may be smaller issues with those, which we can log separately.

I haven't yet figured out why ipycanvas isn't working.

testlabauto commented 4 weeks ago

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