Search code examples
pythonjupyter-notebookipycytoscape

Is there a way to save ipycytoscape (javascript based object) in jupyter notebook(python)?


I was creating a graph through ipycytoscape https://ipycytoscape.readthedocs.io/en/latest/

I have created an interactive graph through the package, in jupyter notebook with my python code.
However, is there a way to save this javascript originated graph as an image?

below is an example code.

import networkx as nx
G = nx.complete_graph(5)
cyto = ipycytoscape.CytoscapeWidget()
cyto.graph.add_graph_from_networkx(G)
display(cyto)

Solution

  • thanks for the question. I found something that might be a start for you: https://nbconvert.readthedocs.io/en/latest/nbconvert_library.html#Extracting-Figures-using-the-HTML-Exporter If you wanna keep discussing this I'd recommend to open an issue in our github https://github.com/QuantStack/ipycytoscape/issues Cheers!