-
Notifications
You must be signed in to change notification settings - Fork 739
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 #1524
Comments
More specifically this is #498. 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) but |
Great, happy to hear it can be done! I'm still pretty new to coding and this JS stuff is way over my head, but here's my interpretation of what I need to do:
But I got an error
Sorry for such basic questions, and thanks very much for helping! |
Unfortunately it's a bit more involved than that- |
I see, so that means that at this point it's entirely an |
Just wanted to pop over here and say this thread is incorrect. Widget based extensions that don't have specific JLab dependencies (e.g. they dont include a jupyterlab mimerenderer or interact with JupyterLab app or leverage the windowing system, etc) work in all widget contexts. |
@timkpaine - there are a couple of points of difficulty here-
I believe it should be possible to create a custom widget manager on top of the stable comms APIs Colab exposes. With this each custom widget could declare its own widget manager with info about where to load the module from and control the versioning itself. If we took this approach and provided a widget manager which could be used by custom widgets, how many widgets would take advantage of it? Should we instead invest in addressing more of the versioning and packaging issues? |
Getting every end package to integrate with proprietary APIs is unlikely to be successful. Open source a widget manager and integrate that widget manager to export frontend assets into the open source cookiecutters (e.g. here). Ideally, make such a manager completely natively compatible with widgets (e.g. |
To be clear- the goal has been to not have proprietary APIs but instead to work towards a common stable API that works in more environments.
In our context there are no frontend assets at all. Aside from the minimal public API visualizations need to include all of their dependencies. What I'm basically saying above is essentially a widget manager who's API to the host is limited to just something along the lines of https://github.com/Quansight-Labs/jupyter-output-spec, then either loading that before the custom widget (initiated by user code), or just bundling that with the custom widget in a standalone binary which would have to be >800K. In my view the widget manager and widget are tightly coupled due to the significant API surface area of widgets and their requirement of a common build tool (when using webpack's module federation), thus they should be distributed together. Colab already uses a widget manager per cell execution using browser broadcast channels to coordinate, I don't think it would be impossible to do a widget manager per widget? Then just include some esbuild created binary of the standalone binary in the widget cookie cutter and be free of the versioning issues? (I'm sure I'm oversimplifying here). We had hoped 1) to get consensus on the stable APIs necessary to support this so it could be used by other hosts and 2) to have a more minimal API to remove that large binary size. |
These should now be working in Colab, see #498 (comment). An example is https://colab.research.google.com/gist/blois/665fb53f06c09d6dd380b934eaea15f4/ipycytoscape.ipynb. |
Bug report for Colab: http://colab.research.google.com/. Related to #60.
Describe the expected behavior:
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 try to display a network graph, nothing shows up. Reminiscent of trying to display a HoloViews plot without having run
hv.extension('bokeh')
in the cell.The web browser you are using (Chrome, Firefox, Safari, etc.):
Chrome 84.0.4147.135
Link (not screenshot!) to a minimal, public, self-contained notebook that
reproduces this issue (click the Share button, then Get Shareable Link):
Here's a self-contained example from their website (you can find it and others here). After running the last line I would expect to see a network graph, but nothing shows up.
They provide some installation tips here that might be helpful, including how to run tests locally.
The text was updated successfully, but these errors were encountered: