MEP02

from topologicpy.Vertex import Vertex
from topologicpy.Edge import Edge
from topologicpy.Wire import Wire
from topologicpy.Face import Face
from topologicpy.Shell import Shell
from topologicpy.Cell import Cell
from topologicpy.CellComplex import CellComplex
from topologicpy.Cluster import Cluster
from topologicpy.Topology import Topology
from topologicpy.Graph import Graph
from topologicpy.Dictionary import Dictionary
from topologicpy.Vector import Vector
from topologicpy.Helper import Helper
from topologicpy.Plotly import Plotly
a = Vertex.ByCoordinates(0, 0, 0)
dt = Dictionary.ByKeysValues(["TOPOLOGIC_ID", "outposts"],["A", ["B"]])
a = Topology.SetDictionary(a, dt)

b = Vertex.ByCoordinates(10,0,0)
dt = Dictionary.ByKeysValues(["TOPOLOGIC_ID", "outposts"],["B", ["C", "D", "E"]])
b = Topology.SetDictionary(b, dt)

c = Vertex.ByCoordinates(15,5,0)
dt = Dictionary.ByKeysValues(["TOPOLOGIC_ID", "outposts"],["C", ["F"]])
c = Topology.SetDictionary(c, dt)

d = Vertex.ByCoordinates(15,0,0)
dt = Dictionary.ByKeysValues(["TOPOLOGIC_ID", "outposts"],["D", ["G"]])
d = Topology.SetDictionary(d, dt)

e = Vertex.ByCoordinates(15,-5,0)
dt = Dictionary.ByKeysValues(["TOPOLOGIC_ID", "outposts"],["E", ["H"]])
e = Topology.SetDictionary(e, dt)

f = Vertex.ByCoordinates(20,5,0)
dt = Dictionary.ByKeyValue("TOPOLOGIC_ID","F")
f = Topology.SetDictionary(f, dt)

g = Vertex.ByCoordinates(20,0,0)
dt = Dictionary.ByKeyValue("TOPOLOGIC_ID","G")
g = Topology.SetDictionary(g, dt)

h = Vertex.ByCoordinates(20,-5,0)
dt = Dictionary.ByKeysValues(["TOPOLOGIC_ID", "outposts"],["H", ["I","J"]])
h = Topology.SetDictionary(h, dt)

i = Vertex.ByCoordinates(25,-3,0)
dt = Dictionary.ByKeyValue("TOPOLOGIC_ID","I")
i = Topology.SetDictionary(i, dt)

j = Vertex.ByCoordinates(25,-7,0)
dt = Dictionary.ByKeyValue("TOPOLOGIC_ID","J")
j = Topology.SetDictionary(j, dt)

cluster = Cluster.ByTopologies(a,b,c,d,e,f,g,h,i,j)
graph = Graph.ByTopology(cluster, toOutposts=True)
Topology.Show(graph, vertexSize=3, camera=[0,0,3], up=[0,1,0])
status = Graph.PyvisGraph(graph, "mep02-vis.html", vertexLabelKey="TOPOLOGIC_ID")
mep02-vis.html
from IPython.display import IFrame

IFrame("mep02-vis.html", width=1200, height = 1200)