-
Notifications
You must be signed in to change notification settings - Fork 67
/
Copy pathdgraph.py
59 lines (47 loc) · 1.9 KB
/
dgraph.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
from diagrams import Cluster, Diagram, Edge
from diagrams.programming.language import Go, Nodejs, Python
from diagrams.custom import Custom
graph_attr = {
"layout":"dot",
"compound":"true",
"splines":"spline",
}
zeros_attr = {
"icon_path":"./dgraphlg.png"
}
ec2_attr = {
"icon_path":"./dgraphlgEC2.png"
}
with Diagram("\ndgraph", show=False, direction="TB", graph_attr=graph_attr, outformat='png') as diag:
with Cluster("RAFT Groups / Cluster (Baremetal example)"):
with Cluster("0", graph_attr={"label":"Zero Group"}):
a = Custom("Zero 2", **zeros_attr)
b = Custom("Zero 1", **zeros_attr)
c = Custom("Zero 0", **zeros_attr)
with Cluster("1", graph_attr={"label":"Alpha Group"}):
e = Custom("Alpha 4", **ec2_attr)
f = Custom("Alpha 5", **ec2_attr)
g = Custom("Alpha 6", **ec2_attr)
h = Custom("Alpha 3", **ec2_attr)
i = Custom("Alpha 2", **ec2_attr)
j = Custom("Alpha 1", **ec2_attr)
h = Custom("Alpha 0", **ec2_attr)
with Cluster("2", graph_attr={"label":"APIs"}):
e1 = Custom("RAW HTTP", "./http.png")
f1 = Custom("gRPC", "./grpc.png")
g1 = Custom("GraphQL ", "./GraphQL_Logo.png")
with Cluster("3", graph_attr={"label":"Special Node(EE)"}):
Learner = Custom("Learner 0", **ec2_attr)
with Cluster("4", graph_attr={"label":"Clients"}):
client2 = Custom("Apollo GraphQL ", "./apollo.png")
client3 = Nodejs("Dgraph-JS")
client4 = Python("Pydgraph")
client0 = Go("Dgo")
client1 = Custom("Curl", "./curl.png")
b >> Edge(lhead="cluster_1") >> f
g >> Edge(ltail="cluster_1") >> Learner
e >> Edge(ltail="cluster_2") >> e1
g1 >> Edge(lhead="cluster_4") >> client2
f1 >> Edge(lhead="cluster_4") >> client0
e1 >> Edge(lhead="cluster_4") >> client1
diag