Support for ipycytoscape in Google Colab
See original GitHub issueHello,
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 required jupyter-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 the ipycytoscape
team and @blois we can figure them out, possibly resulting in a new extension colab-cytoscape
.
More info on portable widgets for Colab here
Related to colabtools/issues/1524. Possibly tangentially related to #80.
Issue Analytics
- State:
- Created 3 years ago
- Comments:14 (5 by maintainers)
Top GitHub Comments
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
window.Jupyter
and when that is defined will make broad assumptions about executing within Jupyter Notebook.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.