decided on final look

This commit is contained in:
2026-03-04 10:36:34 +11:00
parent 14517a4ba3
commit 98bb4fcc36
6 changed files with 913 additions and 14 deletions

View File

@@ -1,23 +1,15 @@
from pyvis.network import Network
import pyvis
from random import randint
pyvis.__version__
def random_colour():
return f"rgb({randint(0,255)},{randint(0,255)},{randint(0,255)})"
def main():
net = Network(notebook=False, cdn_resources="remote", neighborhood_highlight=True, bgcolor="#222222", font_color="#FAFAFA", layout="hierarchical")
net = Network(notebook=False, cdn_resources="local", neighborhood_highlight=True, bgcolor="#222222", font_color="#FAFAFA", layout="hierarchical")
net.add_nodes([0,1,2,3,4], label=['1','2','3','4','5'])
net.add_nodes([0,1,2,3,4], label=['1','2','3','4','5'],color=['#E0E0FF','#E0FFE0','#E0E0FF','#E0E0FF','#E0E0FF'])
net.add_edge(0, 1, length=500)
net.add_edge(0, 2, length=500)
net.add_edge(0, 3, length=500)
net.add_edge(2, 3, length=250)
net.add_edge(3, 4, length=500)
net.add_edge(1, 2, length=750)
net.add_edge(2, 3, length=500)
net.add_edge(3, 4, length=250)
net.add_edge(2, 4, length=250)
net.write_html("network.html", notebook=False)