question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support for ipycytoscape in Google Colab

See original GitHub issue

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 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:closed
  • Created 3 years ago
  • Comments:14 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
bloiscommented, Aug 29, 2020

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.

1reaction
timkpainecommented, Mar 30, 2021

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Support for ipycytoscape · Issue #1524 · googlecolab ...
I'd love to use ipycytoscape to work with network graphs in Colab. I'm able to install it without a problem, but when I...
Read more >
examples.ipynb - Colaboratory
import ipycytoscape import json ... fig = ipycytoscape.CytoscapeWidget() ... workaround since ipycytoscape does not export JSON declaration
Read more >
How do I install Cytoscape on Google Colab?
1 Answer 1 ... For anyone else who runs into this issue, I learned that instead of using this approach, an easier one...
Read more >
QuantStack/Lobby
I'm trying to run this in a Google Colab notebook. Specifically, I want to use ipycytoscape to open .xgmml files in the notebooks...
Read more >
ipycytoscape 1.0.3 documentation - Read the Docs
Visualize graphs using Cytoscape.js in a Jupyter Notebook. You can either create graphs using the ipycytoscape API or create them from: NetworkX. JSON....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found