SlideShare une entreprise Scribd logo
1  sur  15
VISUALIZATION TEAM PRESENTATION
ROYA LOTFI, HASFA MOONTARI ALI
GRAPH VISUALIZATION
• Transaction Graph
• Address Graph
• Composite Graph
• Path
• Cluster Graph
LIBRARY
• https://github.com/WestHealth/pyvis
• https://visjs.org/
TRANSACTION GRAPH
def add_transaction(self,input, output, in_time, out_time, amount):
input_edge = zip(input, in_time, output, out_time, amount)
for i in input_edge:
input_node = i[0]
time_in = i[1]
output_node = i[2]
time_out = i[3]
weight = i[4]
self.graph.add_node(input_node, level=time_in, shape="square")
self.graph.add_node(output_node, level=time_out, shape="square")
self.graph.add_edge(input_node, output_node, value=weight, title = weight)
def show_graph(self):
dirOutput = "output"
if not os.path.exists(dirOutput):
os.makedirs("output")
self.graph.show("outputtransaction_gragh.html")
class transaction_graph:
ADDRESS GRAPH
def add_address_node(self, input, output, amount):
input_edge = zip(input, output, amount)
for i in input_edge:
input = i[0]
output = i[1]
weight = i[2]
self.graph.add_node(input)
self.graph.add_node(output)
self.graph.add_edge(input, output, value=weight, title = weight)
self.graph.options = self.composite_options
def show_graph(self):
dirOutput = "output"
if not os.path.exists(dirOutput):
os.makedirs("output")
self.graph.show("outputaddress_gragh.html")
class address_graph:
COMPOSITE GRAPH
def add_composite_nodes(self, input,amount_in, output,amount_out,time):
level_input = time + time - 1
level_trans = level_input + 1
level_output = level_input + 2
T = "T"+str(level_trans)
self.graph.add_node(T, level=level_trans, shape="square", color ="rgb(28,163,236)")
input_edge = zip(input, amount_in)
for i in input_edge:
input = i[0] + str(level_input)
label = i[0]
weight = i[1]
self.graph.add_node(input, level=level_input, label =label)
self.graph.add_edge(input, T, value = weight)
output_edge = zip(output, amount_out)
for j in output_edge:
label = j[0]
output = j[0] + str(level_output)
weight = j[1]
self.graph.add_node(output, level=level_output, label = label)
self.graph.add_edge(T, output, value=weight, title = weight)
def show_graph(self):
class composite_graph:
PATH
def add_path(self, input, amount):
input_edge = zip(input[0:len(input) - 1], input[1:len(input)], amount)
for i in input_edge:
input = i[0]
output = i[1]
weight = i[2]
self.graph.add_node(input)
self.graph.add_node(output)
self.graph.add_edge(input, output, value=weight, title=weight)
class show_path:
def show_graph(self):
CLUSTER
def colors(self,n):
ret = []
r = int(random.random() * 256)
g = int(random.random() * 256)
b = int(random.random() * 256)
step = 256 / n
for i in range(n):
r += step
g += step
b += step
r = int(r) % 256
g = int(g) % 256
b = int(b) % 256
ret.append((r, g, b))
return ret
def cluster_addresses(self, address, cluster):
color_num = max(cluster)
print(color_num)
colors = self.colors(4)
for i in self.graph.nodes:
try:
idx = address.index(i["id"])
value = cluster[address.index(i["id"])]
print(i, " id ", value)
print(str(colors[value - 1]))
i["color"] = "rgb" + str(colors[value - 1])
except Exception:
pass
LAYOUT
"arrowStrikethrough" : false
},
"layout": {
"hierarchical": {
"enabled": false,
"sortMethod": "directed"
}
},
"interaction": {
"navigationButtons": true
},
"physics": {
"hierarchicalRepulsion": {
"centralGravity": 0,
"springLength": 75,
"nodeDistance": 145,
"damping": 0.2
},
"maxVelocity": 28,
"minVelocity": 0.75,
"solver": "hierarchicalRepulsion"
}
}
{
"nodes": {
"size": 20,
"color" : {
"color" : "rgb(116,204,244)",
"highlight": "#F9A602",
"hover": "#F9A602",
"inherit": "from",
"opacity" :1.0
}
},
"edges": {
"arrows": {
"to": {
"enable":true,
"type" : "vee",
"scaleFactor": 0.2
}
},
"color" : {
"color" : "rgb(28,163,236)",
"highlight": "#F9A602",
"hover": "#F9A602",
"inherit": "from",
"opacity" :1.0
},
"smooth": {
"enabled" : true,
"type": "curvedCCW",
GRAPH PLOTTING
Scatter Plot
Box Plot
Scatter Plot
Box Plot
THANK YOU

Contenu connexe

Tendances

Делаем пользовательское Api на базе Shapeless
Делаем пользовательское Api на базе ShapelessДелаем пользовательское Api на базе Shapeless
Делаем пользовательское Api на базе Shapeless
Вадим Челышов
 
Functional Programming
Functional ProgrammingFunctional Programming
Functional Programming
chriseidhof
 

Tendances (20)

Quill - 一個 Scala 的資料庫存取利器
Quill - 一個 Scala 的資料庫存取利器Quill - 一個 Scala 的資料庫存取利器
Quill - 一個 Scala 的資料庫存取利器
 
Kwp2 091217
Kwp2 091217Kwp2 091217
Kwp2 091217
 
Munihac 2018 - Beautiful Template Haskell
Munihac 2018 - Beautiful Template HaskellMunihac 2018 - Beautiful Template Haskell
Munihac 2018 - Beautiful Template Haskell
 
MIPS Instruction Set
MIPS Instruction SetMIPS Instruction Set
MIPS Instruction Set
 
Pistache: A π-Calculus Internal Domain Specific Language for Scala
Pistache: A π-Calculus Internal Domain Specific Language for ScalaPistache: A π-Calculus Internal Domain Specific Language for Scala
Pistache: A π-Calculus Internal Domain Specific Language for Scala
 
Dvst
DvstDvst
Dvst
 
Go
GoGo
Go
 
Делаем пользовательское Api на базе Shapeless
Делаем пользовательское Api на базе ShapelessДелаем пользовательское Api на базе Shapeless
Делаем пользовательское Api на базе Shapeless
 
Proga 0518
Proga 0518Proga 0518
Proga 0518
 
Basics of Computer graphics lab
Basics of Computer graphics labBasics of Computer graphics lab
Basics of Computer graphics lab
 
Why The Free Monad isn't Free
Why The Free Monad isn't FreeWhy The Free Monad isn't Free
Why The Free Monad isn't Free
 
Functional Programming
Functional ProgrammingFunctional Programming
Functional Programming
 
Building a Functional Stream in Scala
Building a Functional Stream in ScalaBuilding a Functional Stream in Scala
Building a Functional Stream in Scala
 
Seg code
Seg codeSeg code
Seg code
 
Om (Cont.)
Om (Cont.)Om (Cont.)
Om (Cont.)
 
F(3)
F(3)F(3)
F(3)
 
A Shiny Example-- R
A Shiny Example-- RA Shiny Example-- R
A Shiny Example-- R
 
ggplot2: An Extensible Platform for Publication-quality Graphics
ggplot2: An Extensible Platform for Publication-quality Graphicsggplot2: An Extensible Platform for Publication-quality Graphics
ggplot2: An Extensible Platform for Publication-quality Graphics
 
Regex, Python & Twitter
Regex, Python & TwitterRegex, Python & Twitter
Regex, Python & Twitter
 
10 - Scala. Co-product type (sum type)
10 - Scala. Co-product type (sum type)10 - Scala. Co-product type (sum type)
10 - Scala. Co-product type (sum type)
 

Similaire à Visualization team presentation

R + Hadoop = Big Data Analytics. How Revolution Analytics' RHadoop Project Al...
R + Hadoop = Big Data Analytics. How Revolution Analytics' RHadoop Project Al...R + Hadoop = Big Data Analytics. How Revolution Analytics' RHadoop Project Al...
R + Hadoop = Big Data Analytics. How Revolution Analytics' RHadoop Project Al...
Revolution Analytics
 
ECMAScript 6 major changes
ECMAScript 6 major changesECMAScript 6 major changes
ECMAScript 6 major changes
hayato
 
Social network-analysis-in-python
Social network-analysis-in-pythonSocial network-analysis-in-python
Social network-analysis-in-python
Joe OntheRocks
 

Similaire à Visualization team presentation (20)

Retos de Programación en Python
Retos de Programación en PythonRetos de Programación en Python
Retos de Programación en Python
 
Loom & Functional Graphs in Clojure @ LambdaConf 2015
Loom & Functional Graphs in Clojure @ LambdaConf 2015Loom & Functional Graphs in Clojure @ LambdaConf 2015
Loom & Functional Graphs in Clojure @ LambdaConf 2015
 
D9 Process Book_Expedition Mars
D9 Process Book_Expedition MarsD9 Process Book_Expedition Mars
D9 Process Book_Expedition Mars
 
How to extend map? Or why we need collections redesign? - Scalar 2017
How to extend map? Or why we need collections redesign? - Scalar 2017How to extend map? Or why we need collections redesign? - Scalar 2017
How to extend map? Or why we need collections redesign? - Scalar 2017
 
Swift for tensorflow
Swift for tensorflowSwift for tensorflow
Swift for tensorflow
 
[Let'Swift 2019] 실용적인 함수형 프로그래밍 워크샵
[Let'Swift 2019] 실용적인 함수형 프로그래밍 워크샵[Let'Swift 2019] 실용적인 함수형 프로그래밍 워크샵
[Let'Swift 2019] 실용적인 함수형 프로그래밍 워크샵
 
20191116 custom operators in swift
20191116 custom operators in swift20191116 custom operators in swift
20191116 custom operators in swift
 
Advanced geoprocessing with Python
Advanced geoprocessing with PythonAdvanced geoprocessing with Python
Advanced geoprocessing with Python
 
Foliumcheatsheet
FoliumcheatsheetFoliumcheatsheet
Foliumcheatsheet
 
Power of functions in a typed world
Power of functions in a typed worldPower of functions in a typed world
Power of functions in a typed world
 
Monoids - Part 1 - with examples using Scalaz and Cats
Monoids - Part 1 - with examples using Scalaz and CatsMonoids - Part 1 - with examples using Scalaz and Cats
Monoids - Part 1 - with examples using Scalaz and Cats
 
Python 101 language features and functional programming
Python 101 language features and functional programmingPython 101 language features and functional programming
Python 101 language features and functional programming
 
R + Hadoop = Big Data Analytics. How Revolution Analytics' RHadoop Project Al...
R + Hadoop = Big Data Analytics. How Revolution Analytics' RHadoop Project Al...R + Hadoop = Big Data Analytics. How Revolution Analytics' RHadoop Project Al...
R + Hadoop = Big Data Analytics. How Revolution Analytics' RHadoop Project Al...
 
Oh, All the things you'll traverse
Oh, All the things you'll traverseOh, All the things you'll traverse
Oh, All the things you'll traverse
 
TRICK
TRICKTRICK
TRICK
 
ECMAScript 6 major changes
ECMAScript 6 major changesECMAScript 6 major changes
ECMAScript 6 major changes
 
Scala intro workshop
Scala intro workshopScala intro workshop
Scala intro workshop
 
Social network-analysis-in-python
Social network-analysis-in-pythonSocial network-analysis-in-python
Social network-analysis-in-python
 
Scala: Functioneel programmeren in een object georiënteerde wereld
Scala: Functioneel programmeren in een object georiënteerde wereldScala: Functioneel programmeren in een object georiënteerde wereld
Scala: Functioneel programmeren in een object georiënteerde wereld
 
Pythonic Graphics
Pythonic GraphicsPythonic Graphics
Pythonic Graphics
 

Dernier

Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
amitlee9823
 
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men 🔝Bangalore🔝 Esc...
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men  🔝Bangalore🔝   Esc...➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men  🔝Bangalore🔝   Esc...
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men 🔝Bangalore🔝 Esc...
amitlee9823
 
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
amitlee9823
 
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night StandCall Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
amitlee9823
 
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
amitlee9823
 
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
amitlee9823
 
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
amitlee9823
 

Dernier (20)

Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
 
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men 🔝Bangalore🔝 Esc...
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men  🔝Bangalore🔝   Esc...➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men  🔝Bangalore🔝   Esc...
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men 🔝Bangalore🔝 Esc...
 
Week-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interactionWeek-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interaction
 
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
 
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort ServiceBDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
 
Mature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxMature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptx
 
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
 
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
 
Discover Why Less is More in B2B Research
Discover Why Less is More in B2B ResearchDiscover Why Less is More in B2B Research
Discover Why Less is More in B2B Research
 
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night StandCall Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
 
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
 
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
 
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
 
Accredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdfAccredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdf
 
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
 
Halmar dropshipping via API with DroFx
Halmar  dropshipping  via API with DroFxHalmar  dropshipping  via API with DroFx
Halmar dropshipping via API with DroFx
 
April 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's AnalysisApril 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's Analysis
 
Capstone Project on IBM Data Analytics Program
Capstone Project on IBM Data Analytics ProgramCapstone Project on IBM Data Analytics Program
Capstone Project on IBM Data Analytics Program
 
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
 

Visualization team presentation

  • 1. VISUALIZATION TEAM PRESENTATION ROYA LOTFI, HASFA MOONTARI ALI
  • 2. GRAPH VISUALIZATION • Transaction Graph • Address Graph • Composite Graph • Path • Cluster Graph
  • 4. TRANSACTION GRAPH def add_transaction(self,input, output, in_time, out_time, amount): input_edge = zip(input, in_time, output, out_time, amount) for i in input_edge: input_node = i[0] time_in = i[1] output_node = i[2] time_out = i[3] weight = i[4] self.graph.add_node(input_node, level=time_in, shape="square") self.graph.add_node(output_node, level=time_out, shape="square") self.graph.add_edge(input_node, output_node, value=weight, title = weight) def show_graph(self): dirOutput = "output" if not os.path.exists(dirOutput): os.makedirs("output") self.graph.show("outputtransaction_gragh.html") class transaction_graph:
  • 5. ADDRESS GRAPH def add_address_node(self, input, output, amount): input_edge = zip(input, output, amount) for i in input_edge: input = i[0] output = i[1] weight = i[2] self.graph.add_node(input) self.graph.add_node(output) self.graph.add_edge(input, output, value=weight, title = weight) self.graph.options = self.composite_options def show_graph(self): dirOutput = "output" if not os.path.exists(dirOutput): os.makedirs("output") self.graph.show("outputaddress_gragh.html") class address_graph:
  • 6. COMPOSITE GRAPH def add_composite_nodes(self, input,amount_in, output,amount_out,time): level_input = time + time - 1 level_trans = level_input + 1 level_output = level_input + 2 T = "T"+str(level_trans) self.graph.add_node(T, level=level_trans, shape="square", color ="rgb(28,163,236)") input_edge = zip(input, amount_in) for i in input_edge: input = i[0] + str(level_input) label = i[0] weight = i[1] self.graph.add_node(input, level=level_input, label =label) self.graph.add_edge(input, T, value = weight) output_edge = zip(output, amount_out) for j in output_edge: label = j[0] output = j[0] + str(level_output) weight = j[1] self.graph.add_node(output, level=level_output, label = label) self.graph.add_edge(T, output, value=weight, title = weight) def show_graph(self): class composite_graph:
  • 7. PATH def add_path(self, input, amount): input_edge = zip(input[0:len(input) - 1], input[1:len(input)], amount) for i in input_edge: input = i[0] output = i[1] weight = i[2] self.graph.add_node(input) self.graph.add_node(output) self.graph.add_edge(input, output, value=weight, title=weight) class show_path: def show_graph(self):
  • 8. CLUSTER def colors(self,n): ret = [] r = int(random.random() * 256) g = int(random.random() * 256) b = int(random.random() * 256) step = 256 / n for i in range(n): r += step g += step b += step r = int(r) % 256 g = int(g) % 256 b = int(b) % 256 ret.append((r, g, b)) return ret def cluster_addresses(self, address, cluster): color_num = max(cluster) print(color_num) colors = self.colors(4) for i in self.graph.nodes: try: idx = address.index(i["id"]) value = cluster[address.index(i["id"])] print(i, " id ", value) print(str(colors[value - 1])) i["color"] = "rgb" + str(colors[value - 1]) except Exception: pass
  • 9. LAYOUT "arrowStrikethrough" : false }, "layout": { "hierarchical": { "enabled": false, "sortMethod": "directed" } }, "interaction": { "navigationButtons": true }, "physics": { "hierarchicalRepulsion": { "centralGravity": 0, "springLength": 75, "nodeDistance": 145, "damping": 0.2 }, "maxVelocity": 28, "minVelocity": 0.75, "solver": "hierarchicalRepulsion" } } { "nodes": { "size": 20, "color" : { "color" : "rgb(116,204,244)", "highlight": "#F9A602", "hover": "#F9A602", "inherit": "from", "opacity" :1.0 } }, "edges": { "arrows": { "to": { "enable":true, "type" : "vee", "scaleFactor": 0.2 } }, "color" : { "color" : "rgb(28,163,236)", "highlight": "#F9A602", "hover": "#F9A602", "inherit": "from", "opacity" :1.0 }, "smooth": { "enabled" : true, "type": "curvedCCW",
  • 12.
  • 14.