Skip to content
This repository has been archived by the owner on Mar 29, 2024. It is now read-only.

Jupyter inline integration of Tulip #17

Closed
renoust opened this issue Sep 8, 2017 · 2 comments
Closed

Jupyter inline integration of Tulip #17

renoust opened this issue Sep 8, 2017 · 2 comments

Comments

@renoust
Copy link

renoust commented Sep 8, 2017

I wonder if there is a way to integrate nicely export of views to Jupyter.
Of course there is the following workaround of calling

from IPython.display import Image
...
view.saveSnapshot('some_path')
Image("some_path")

but I wonder if we could do some better integration, to this purpose, maybe we could have a method (saveSnapshot with a None path?) that returns a view's Image content instead of writing it into a file?

This would have great potential for tutorials

Edit: I forgot to add that the view needs of course to be set invisible (view = tlpgui.createView("Node Link Diagram view", graph, {}, False),
B.t.w. keyword argument show unfortunately doesn't work.

>>> tlpgui.createView("Node Link Diagram view", graph, show= False)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: createView() takes no keyword arguments
@anlambert
Copy link
Contributor

Check this out : https://github.com/anlambert/tulip_python_notebook

This is a module that enable to embed WebGL visualizations of Tulip graphs inside a Jupyter notebook.

I do not consider this stable yet but it should work.

@renoust
Copy link
Author

renoust commented Sep 8, 2017

Thanks! It looks very promising!
It sorts of work here, but I'll keep questions for the other github project.
Although your solution is very elegant, it heavily relies on the third-party library that is tulipjs.
Still, I think the image approach has a a more "what you see is what you get" advantage, in addition to the fact that an image can be further processed by other software. I guess these two approaches may serve different purposes.

p-mary referenced this issue in anlambert/talipot Jan 3, 2020
QOpenGL module is marked as deprecated since a while now so it is time
to remove its use from the Talipot codebase and promote the use of
QOpenGL* classes directly integrated in the QtGui module.

The big difference between QOpenGL and QtOpenGL from Qt5 is that all
rendering is performed in framebuffer objects, there is no more direct
rendering in the underlying os windows with its own OpenGL context.

Talipot OpenGL rendering also follows that idiom, all renderings are performed
offscreen using a shared OpenGL context. This also means that there is no
more QGLWidget as viewport for QGraphicsView. Talipot OpenGL scene are
now converted to QImage in order to display them using the default Qt raster
rendering engine. This should fixes the numerous rendering glitches observed
on MacOS.

First thing observed after the migration is a consequent performance boost
in OpenGL rendering when using an Intel GPU on a Linux host machine (especially
when selecting elements, it is now 10 times faster on debian stable).
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants