ipycytoscape
ipycytoscape copied to clipboard
Ability to export/save graphs
It would be great to implement the cytoscape functions for saving the current view as an image https://js.cytoscape.org/#core/export
This may be tricky because if there are multiple views of the object that have diverged it's not clear which one should be used.
Related: I've now used this widget to create a graph I thought justified saving!
This may be tricky because if there are multiple views of the object that have diverged it's not clear which one should be used.
Yeah, I just tested it and I had never noticed this.
For some reason it only updates the first instance of the graph. I'm thinking if this was a regression of something we done recently, because afai remember we had all the instances of a graph synchronized.
Maybe @wolfv knows why this kind of problem is happening? I created a screen recording of the problem:
As you can see only the first instance updates. This shouldn't happen right?
If I rerender the second instance than it also turns yellow.
Regarding adding the ability to do that, if this is an expected behavior we could just save the image of the first instance. (But I don't think it is).
For saving: https://stackoverflow.com/a/39173400/835607
Did you find a solution? I'm searching for a way to export images too. Additionally to PNG, it'd be great to have PDF or SVG for higher quality.
@fpom have you taken a look into the different ways you can export a notebook? Not sure if it's useful for you as I imagine you want just the one output of a cell, correct? And sorry I haven't looked into it yet.
If you find some alternative in the "expanded universe" of Jupyter Widgets I'll be happy to hear about it and think about ways of integrating it! :)
@fpom have you taken a look into the different ways you can export a notebook? Not sure if it's useful for you as I imagine you want just the one output of a cell, correct? And sorry I haven't looked into it yet.
Unfortunately, I need to export just one graph. Typically to be included in a paper.
If you find some alternative in the "expanded universe" of Jupyter Widgets I'll be happy to hear about it and think about ways of integrating it! :)
So far, screenshot remains the best solution. I've experimented with getting PNG directly from the canvas in JavaScript, but it does not give a better resolution than a simple screenshot.