-
Notifications
You must be signed in to change notification settings - Fork 62
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
Support for ipycytoscape in Google Colab #148
Comments
Hi @rchurt, I agree that this would be great! Unfortunately, my reading of the linked issues is that this is more of a google colab problem than an ipycytoscape problem. I think the suggestion in those threads is that with the new colab support for comms you can work around colab not supporting widgets by injecting javascript via I definitely could be wrong/misreading things here though. I'd be happy to be shown how this is in fact possible. |
It depends on how much Javascript is needed- some libraries will directly inject the javascript using |
jupyterlab extensions that dont rely on jupyterlab-specific windowing or apis should work out of the box, which includes most ipywidgets based libraries. |
e.g. ipycytoscape exports jupyter notebook compatible js assets here: https://github.com/QuantStack/ipycytoscape/blob/master/webpack.config.js#L19 |
in general though, google colab is a proprietary product and the onus is really on google to support what the open source community deems as standards |
I am definitely open to suggestions on improving the situation- some background can be found at https://github.com/nteract/nes/tree/master/portable-widgets. I'm not sure what the standards are here- I don't think there's any feasible way to make JupyterLab extensions work outside of JupyterLab. If there is no desire to support anything other than JupyterLab then that is fine. You can see my goals in the background section of the above link and I do believe that those goals would be beneficial to everyone. Also take a look at https://github.com/Quansight-Labs/jupyter-output-spec which I've been helping out on as well and is an approach for the issue. I did a prototype implementation of this for Jupyter Lab at https://github.com/blois/js-module-renderer. The basic model that we've been using is to display visualizations with HTML/JS then if comms are available to enable bi-directional kernel communication. The comms APIs in Colab are intended to be similar to those in Jupyter Notebook to allow more portability, but unfortunately they cannot be identical since there is a lot of code which looks for |
@blois My take on this is that I'd like to have ipycytoscape supported to colab because I think it'd be beneficial for the community but I have to agree with @timkpaine, colab is a proprietary product and the onus to support it belongs to google. Also, if I was to make these changes I'd have to learn a few things about the low level functioning of Jupyter, so it wouldn't be trivial for me. This seems very interesting: https://github.com/blois/js-module-renderer
@rchurt |
Hey @marimeireles, I am the original author of https://github.com/Quansight-Labs/jupyter-output-spec which @blois's work builds on. If you are interested in helping move this forward, I am happy to try to explain here the state of things or get on a call. I think it would do a lot to help the whole Jupyter community by improving interop between the frontends and making them less siloed. However, I don't have the bandwidth right now to work on it alone. |
Nteract, voila, Sphinx, nbconvert, jupyter, and jupyterlab all work out of the box with the widget cookiecutter assuming you don't need to do anything super custom. I would say this issue should probably be closed as it doesn't make too much sense to build custom functionality here instead of in the cookiecutter that we all rely on underneath. |
I very much agree with this. Unless @marimeireles disagrees I think we should close this and move this discussion over to the jupyter-widgets organization. As for
I'm all for more widgets in more places! @saulshanabrook I think a good place to discuss that may be the jupyter-widgets meetings: https://github.com/jupyter-widgets/team-compass#bi-weekly-team-meetings-every-other-week |
Yes, seems like a good one :) |
edit: actually, thinking this further, I'm not so sure if it'd be a good idea to incorporate it to the main cookiecutter. |
Hello,
I've been hoping to use
ipycytoscape
in Google Colab for a while, and it looks like it's finally possible now that Colab has started supporting custom widgets. Specifically, as @blois explained, "Colab recently started exposing Jupyter Comms channels so custom visualizations can use them for communicating with the kernel (see https://colab.sandbox.google.com/notebooks/snippets/advanced_outputs.ipynb#scrollTo=YOd4khppTskD)." However, because the requiredjupyter-cytoscape
extension is written for JupyterLab, some changes need to be made for it to work with Colab. I'm not sure exactly what those are, but I'm hoping that between theipycytoscape
team and @blois we can figure them out, possibly resulting in a new extensioncolab-cytoscape
.More info on portable widgets for Colab here
Related to colabtools/issues/1524. Possibly tangentially related to #80.
The text was updated successfully, but these errors were encountered: