-
Notifications
You must be signed in to change notification settings - Fork 172
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
ipywidgets cannot be displayed in the SimplifiedOutputArea widget in the kernel-output
example
#107
Comments
@yidong72 which version of JupyterLab are you using? Also are there any errors in the browser dev tools console? |
i am also seeing this in jupyter lab version 4.0.6. to repro, you can put the code to execute as In the jupyterlab main panel, the output is |
Following up on this discussion again. From the debugger on the dev tools, I have identified that the exception opening new comm is - "Error: Object 'jupyter.widget' not found in registry at .." The specific message is -
I would expect the basic models to be registered, do I need to somehow register them again in my jupyterlab extension? @jtpio do you have any suggestions? |
Just to double check it's not related to a recent |
i am using ipywidgets==8.1.1 and jupyterlab-widgets==3.0.9 |
I was able to make some progress by following the code in https://github.com/jupyter-widgets/ipywidgets/blob/303cae4dc268640a01ce08bf6e22da6c5cd201e4/python/jupyterlab_widgets/src/plugin.ts . The missing pieces were -
rendermime.removeMimeType(WIDGET_VIEW_MIMETYPE);
const manager = new KernelWidgetManager(this._sessionContext.session!.kernel!, rendermime);
rendermime.addFactory(
{
safe: true,
mimeTypes: [WIDGET_VIEW_MIMETYPE],
createRenderer: (options) => new WidgetRenderer(options, manager)
},
-10
);
WIDGET_REGISTRY.forEach((data) => manager!.register(data));
is this the right approach? I have a follow-up request - for point 2, the WIDGET_REGISTRY list is not exported https://github.com/jupyter-widgets/ipywidgets/blob/303cae4dc268640a01ce08bf6e22da6c5cd201e4/python/jupyterlab_widgets/src/plugin.ts#L62C24-L62C50 . could we export it, or better enhance the IJupyterWidgetRegistry interface to add a method to fetch all the registered widgets? |
I filed the same issue #2926 at the ipywidget repo. No response yet.
I followed the example at
https://github.com/jupyterlab/extension-examples/tree/master/advanced/kernel-output
The ipywidgets can be displayed fine in the notebook cells, but not in the SimpliedOutputArea from @jupyterlab/outputarea created manually. I checked the rendermime, it contains the mimetypes for ipywidgets.
Not sure what I need to do to make it work. Please help. Thanks.
The text was updated successfully, but these errors were encountered: