I was playing with GitHub - robert-haas/gravis: Interactive graph visualizations with Python and HTML/CSS/JS..
It works nicely, but I would like to capture the output in panel.
The relevant code is in gravis/gravis/_internal/plotting/data_structures.py at master · robert-haas/gravis · GitHub
def display(self, inline=False):
if inline:
import IPython
html_text = self.to_html_partial()
html_object = IPython.display.HTML(html_text)
IPython.display.display(html_object)
else:
html_text = self.to_html_standalone()
_operating_system.open_in_webbrowser(html_text)
anybody know how I would need to modify this?
# small examplt to produce a figure
import gravis as gv
import networkx as nx
G = nx.les_miserables_graph()
fig = gv.vis(G)
# fig.display()