Googled this problem but have not found a solution that works.
I am trying to use pyvis to generate interactive network graphs.
The pyvis functions output an HTML file. I have tried several approaches
but not found anything that works for something that should be simple.
Here is my sample code:
> from pyvis.network import Network
> from IPython.display import HTML
> import networkx as nx
> import os
> nx_graph = nx.cycle_graph(10)
> nx_graph.nodes['title'] = 'Number 1'
> nx_graph.nodes['group'] = 1
> nx_graph.nodes['title'] = 'I belong to a different group!'
> nx_graph.nodes['group'] = 10
> nx_graph.add_node(20, size=20, title='couple', group=2)
> nx_graph.add_node(21, size=15, title='couple', group=2)
> nx_graph.add_edge(20, 21, weight=5)
> nx_graph.add_node(25, size=25, label='lonely', title='lonely node',
> nt = Network("500px", "500px",notebook=True)
> # populates the nodes and edges data structures
> file = open("/tmp/nx.html")
So I was able to get this to work.
But if I have a subsequent note paragraph to display a different
graph the graph in the first note is overwritten.
Surely there is a better approach and I am looking for suggestions
on approaches and ways to get multiple graphs to display.
========= mailto:[hidden email] ============
David W. Boyd
VP, Data Solutions
10432 Balls Ford, Suite 240
Manassas, VA 20109
============== http://www.incadencecorp.com/ ============
ISO/IEC JTC1 SC42/WG2, editor ISO/IEC 20546, ISO/IEC 20547-1
Chair INCITS TG Big Data
Co-chair NIST Big Data Public Working Group Reference Architecture
First Robotic Mentor - FRC, FTC - www.iliterobotics.org
Board Member- USSTEM Foundation - www.usstem.org
The information contained in this message may be privileged
and/or confidential and protected from disclosure.
If the reader of this message is not the intended recipient
or an employee or agent responsible for delivering this message
to the intended recipient, you are hereby notified that any
dissemination, distribution or copying of this communication
is strictly prohibited. If you have received this communication
in error, please notify the sender immediately by replying to
this message and deleting the material from any computer.