-
Notifications
You must be signed in to change notification settings - Fork 5
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
Supporting renderers that use comms #7
Comments
This is a good question! Currently, ipywidgets gets special cased, but we should ideally find a solution that works for all Comm-based mime-renderers with all contexts that have a kernel associated with it. While this is being solved, a workaround is to require the tracker: TVoilaTracker;
tracker.widgetAdded.connect((tracker_, widget) => {
(await widget.content.session.connected).kernel
}); |
Thank you vidar for the workaround, that's great! So I guess for an extension that supports both lab and phoila it could require the voila tracker notebook tracker and make them both optional |
Yup, but I still think we should try to come up with a more generic solution to this. It could help clean up some of the logic in the ipywidgets lab manager as well! cc @jasongrout |
@vidartf unfortunately I don't see the
|
Ah, it might not have made it to a released version yet. A new version is right around the corner though. |
Thank you Vidar. Let me know if I can help with anything. |
I have a mimerender extension that opens comms from the client side to communicate with the server (https://github.com/Quansight/ibis-vega-transform). xref vidartf/phoila#11 vidartf/phoila#7 Quansight/ibis-vega-transform#15
I have a lab extension that adds a renderer that uses comms. It displays interactive vega charts that call back to the backend to recompile expressions as the user interacts with the data (https://github.com/Quansight/ibis-vega-transform).
Currently it uses the notebook tracker to get the kernel for the current kernel and register a comm handler
https://github.com/Quansight/ibis-vega-transform/blob/c59d36ab575e0f0eb5d6fbee5e2aa8b420cde6d9/src/index.ts#L28-L40
This was inspired by @gnestor's PR to add even handling support to the vdom extension which was in turn inspired by @jasongrout
What would be the best way to support this in phoila? One option would be to add the notebook tracker extension and keep the extensions the same. Another option would be for JupyterLab to expose a higher level way of creating a comm in a mime render extension.
The text was updated successfully, but these errors were encountered: