-
Notifications
You must be signed in to change notification settings - Fork 0
/
spineDecomosition.py
executable file
·499 lines (382 loc) · 38.4 KB
/
spineDecomosition.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
from tulip import *
import json
class Spine():
def __init__(self, graph, rootgraph):
#Definition of general graph properties
self.viewColor = graph.getColorProperty("viewColor")
self.viewMetric = graph.getDoubleProperty("viewMetric")
self.Depth = graph.getDoubleProperty("Depth")
self.abelloRank = graph.getDoubleProperty("abelloRank")
self.accumulatedWeight = graph.getDoubleProperty("accumulatedWeight")
self.accumulatedWeightSize = graph.getDoubleProperty("accumulatedWeight/Size")
self.betweenness_centrality = graph.getDoubleProperty("betweenness centrality")
self.chaine = graph.getStringProperty("chaine")
self.chapeau = graph.getStringProperty("chapeau")
self.clusterGraphID = graph.getDoubleProperty("clusterGraphID")
self.coloration = graph.getDoubleProperty("coloration")
self.complex_ = graph.getBooleanProperty("complex")
self.component = graph.getDoubleProperty("component")
self.date = graph.getIntegerProperty("date")
self.dateString = graph.getStringProperty("dateString")
self.degree = graph.getDoubleProperty("degree")
self.descripteurs = graph.getStringProperty("descripteurs")
self.distance = graph.getDoubleProperty("distance")
self.docId = graph.getStringProperty("docId")
self.intrication = graph.getDoubleProperty("intrication")
self.length = graph.getDoubleProperty("length")
self.nbSimilarities = graph.getDoubleProperty("nbSimilarities")
self.nodeOccurence = graph.getDoubleProperty("nodeOccurence")
self.nodetype = graph.getDoubleProperty("nodetype")
self.occurence = graph.getDoubleProperty("occurence")
self.outDegree = graph.getDoubleProperty("outDegree")
self.round_ = graph.getDoubleProperty("round")
self.size = graph.getDoubleProperty("size")
self.temporaryNode = graph.getBooleanProperty("temporaryNode")
self.titre_propre = graph.getStringProperty("titre_propre")
self.treated = graph.getBooleanProperty("treated")
self.turn = graph.getDoubleProperty("turn")
self.typeName = graph.getStringProperty("typeName")
self.viewBorderColor = graph.getColorProperty("viewBorderColor")
self.viewBorderWidth = graph.getDoubleProperty("viewBorderWidth")
self.viewColorBcp = graph.getColorProperty("viewColorBcp")
self.viewFont = graph.getStringProperty("viewFont")
self.viewFontSize = graph.getIntegerProperty("viewFontSize")
self.viewLabel = graph.getStringProperty("viewLabel")
self.viewLabelBorderColor = graph.getColorProperty("viewLabelBorderColor")
self.viewLabelBorderWidth = graph.getDoubleProperty("viewLabelBorderWidth")
self.viewLabelColor = graph.getColorProperty("viewLabelColor")
self.viewLabelPosition = graph.getIntegerProperty("viewLabelPosition")
self.viewLayout = graph.getLayoutProperty("viewLayout")
self.viewMetaGraph = graph.getGraphProperty("viewMetaGraph")
self.viewRotation = graph.getDoubleProperty("viewRotation")
self.viewSelection = graph.getBooleanProperty("viewSelection")
self.viewShape = graph.getIntegerProperty("viewShape")
self.viewSize = graph.getSizeProperty("viewSize")
self.viewSrcAnchorShape = graph.getIntegerProperty("viewSrcAnchorShape")
self.viewSrcAnchorSize = graph.getSizeProperty("viewSrcAnchorSize")
self.viewTexture = graph.getStringProperty("viewTexture")
self.viewTgtAnchorShape = graph.getIntegerProperty("viewTgtAnchorShape")
self.viewTgtAnchorSize = graph.getSizeProperty("viewTgtAnchorSize")
self.induceP = graph.getBooleanProperty("inducedP")
# Setting useful color scales
self.colorbrewer = {\
#sequential multihue
"YlGn":{3:[[247,252,185],[173,221,142],[49,163,84]],4:[[255,255,204],[194,230,153],[120,198,121],[35,132,67]],5:[[255,255,204],[194,230,153],[120,198,121],[49,163,84],[0,104,55]],6:[[255,255,204],[217,240,163],[173,221,142],[120,198,121],[49,163,84],[0,104,55]],7:[[255,255,204],[217,240,163],[173,221,142],[120,198,121],[65,171,93],[35,132,67],[0,90,50]],8:[[255,255,229],[247,252,185],[217,240,163],[173,221,142],[120,198,121],[65,171,93],[35,132,67],[0,90,50]],9:[[255,255,229],[247,252,185],[217,240,163],[173,221,142],[120,198,121],[65,171,93],[35,132,67],[0,104,55],[0,69,41]]},\
"YlGnBu":{3:[[237,248,177],[127,205,187],[44,127,184]],4:[[255,255,204],[161,218,180],[65,182,196],[34,94,168]],5:[[255,255,204],[161,218,180],[65,182,196],[44,127,184],[37,52,148]],6:[[255,255,204],[199,233,180],[127,205,187],[65,182,196],[44,127,184],[37,52,148]],7:[[255,255,204],[199,233,180],[127,205,187],[65,182,196],[29,145,192],[34,94,168],[12,44,132]],8:[[255,255,217],[237,248,177],[199,233,180],[127,205,187],[65,182,196],[29,145,192],[34,94,168],[12,44,132]],9:[[255,255,217],[237,248,177],[199,233,180],[127,205,187],[65,182,196],[29,145,192],[34,94,168],[37,52,148],[8,29,88]]},\
"GnBu":{3:[[224,243,219],[168,221,181],[67,162,202]],4:[[240,249,232],[186,228,188],[123,204,196],[43,140,190]],5:[[240,249,232],[186,228,188],[123,204,196],[67,162,202],[8,104,172]],6:[[240,249,232],[204,235,197],[168,221,181],[123,204,196],[67,162,202],[8,104,172]],7:[[240,249,232],[204,235,197],[168,221,181],[123,204,196],[78,179,211],[43,140,190],[8,88,158]],8:[[247,252,240],[224,243,219],[204,235,197],[168,221,181],[123,204,196],[78,179,211],[43,140,190],[8,88,158]],9:[[247,252,240],[224,243,219],[204,235,197],[168,221,181],[123,204,196],[78,179,211],[43,140,190],[8,104,172],[8,64,129]]},\
"BuGn":{3:[[229,245,249],[153,216,201],[44,162,95]],4:[[237,248,251],[178,226,226],[102,194,164],[35,139,69]],5:[[237,248,251],[178,226,226],[102,194,164],[44,162,95],[0,109,44]],6:[[237,248,251],[204,236,230],[153,216,201],[102,194,164],[44,162,95],[0,109,44]],7:[[237,248,251],[204,236,230],[153,216,201],[102,194,164],[65,174,118],[35,139,69],[0,88,36]],8:[[247,252,253],[229,245,249],[204,236,230],[153,216,201],[102,194,164],[65,174,118],[35,139,69],[0,88,36]],9:[[247,252,253],[229,245,249],[204,236,230],[153,216,201],[102,194,164],[65,174,118],[35,139,69],[0,109,44],[0,68,27]]},\
"PuBuGn":{3:[[236,226,240],[166,189,219],[28,144,153]],4:[[246,239,247],[189,201,225],[103,169,207],[2,129,138]],5:[[246,239,247],[189,201,225],[103,169,207],[28,144,153],[1,108,89]],6:[[246,239,247],[208,209,230],[166,189,219],[103,169,207],[28,144,153],[1,108,89]],7:[[246,239,247],[208,209,230],[166,189,219],[103,169,207],[54,144,192],[2,129,138],[1,100,80]],8:[[255,247,251],[236,226,240],[208,209,230],[166,189,219],[103,169,207],[54,144,192],[2,129,138],[1,100,80]],9:[[255,247,251],[236,226,240],[208,209,230],[166,189,219],[103,169,207],[54,144,192],[2,129,138],[1,108,89],[1,70,54]]},\
"PuBu":{3:[[236,231,242],[166,189,219],[43,140,190]],4:[[241,238,246],[189,201,225],[116,169,207],[5,112,176]],5:[[241,238,246],[189,201,225],[116,169,207],[43,140,190],[4,90,141]],6:[[241,238,246],[208,209,230],[166,189,219],[116,169,207],[43,140,190],[4,90,141]],7:[[241,238,246],[208,209,230],[166,189,219],[116,169,207],[54,144,192],[5,112,176],[3,78,123]],8:[[255,247,251],[236,231,242],[208,209,230],[166,189,219],[116,169,207],[54,144,192],[5,112,176],[3,78,123]],9:[[255,247,251],[236,231,242],[208,209,230],[166,189,219],[116,169,207],[54,144,192],[5,112,176],[4,90,141],[2,56,88]]},\
"BuPu":{3:[[224,236,244],[158,188,218],[136,86,167]],4:[[237,248,251],[179,205,227],[140,150,198],[136,65,157]],5:[[237,248,251],[179,205,227],[140,150,198],[136,86,167],[129,15,124]],6:[[237,248,251],[191,211,230],[158,188,218],[140,150,198],[136,86,167],[129,15,124]],7:[[237,248,251],[191,211,230],[158,188,218],[140,150,198],[140,107,177],[136,65,157],[110,1,107]],8:[[247,252,253],[224,236,244],[191,211,230],[158,188,218],[140,150,198],[140,107,177],[136,65,157],[110,1,107]],9:[[247,252,253],[224,236,244],[191,211,230],[158,188,218],[140,150,198],[140,107,177],[136,65,157],[129,15,124],[77,0,75]]},\
"RdPu":{3:[[253,224,221],[250,159,181],[197,27,138]],4:[[254,235,226],[251,180,185],[247,104,161],[174,1,126]],5:[[254,235,226],[251,180,185],[247,104,161],[197,27,138],[122,1,119]],6:[[254,235,226],[252,197,192],[250,159,181],[247,104,161],[197,27,138],[122,1,119]],7:[[254,235,226],[252,197,192],[250,159,181],[247,104,161],[221,52,151],[174,1,126],[122,1,119]],8:[[255,247,243],[253,224,221],[252,197,192],[250,159,181],[247,104,161],[221,52,151],[174,1,126],[122,1,119]],9:[[255,247,243],[253,224,221],[252,197,192],[250,159,181],[247,104,161],[221,52,151],[174,1,126],[122,1,119],[73,0,106]]},\
"PuRd":{3:[[231,225,239],[201,148,199],[221,28,119]],4:[[241,238,246],[215,181,216],[223,101,176],[206,18,86]],5:[[241,238,246],[215,181,216],[223,101,176],[221,28,119],[152,0,67]],6:[[241,238,246],[212,185,218],[201,148,199],[223,101,176],[221,28,119],[152,0,67]],7:[[241,238,246],[212,185,218],[201,148,199],[223,101,176],[231,41,138],[206,18,86],[145,0,63]],8:[[247,244,249],[231,225,239],[212,185,218],[201,148,199],[223,101,176],[231,41,138],[206,18,86],[145,0,63]],9:[[247,244,249],[231,225,239],[212,185,218],[201,148,199],[223,101,176],[231,41,138],[206,18,86],[152,0,67],[103,0,31]]},\
"OrRd":{3:[[254,232,200],[253,187,132],[227,74,51]],4:[[254,240,217],[253,204,138],[252,141,89],[215,48,31]],5:[[254,240,217],[253,204,138],[252,141,89],[227,74,51],[179,0,0]],6:[[254,240,217],[253,212,158],[253,187,132],[252,141,89],[227,74,51],[179,0,0]],7:[[254,240,217],[253,212,158],[253,187,132],[252,141,89],[239,101,72],[215,48,31],[153,0,0]],8:[[255,247,236],[254,232,200],[253,212,158],[253,187,132],[252,141,89],[239,101,72],[215,48,31],[153,0,0]],9:[[255,247,236],[254,232,200],[253,212,158],[253,187,132],[252,141,89],[239,101,72],[215,48,31],[179,0,0],[127,0,0]]},\
"YlOrRd":{3:[[255,237,160],[254,178,76],[240,59,32]],4:[[255,255,178],[254,204,92],[253,141,60],[227,26,28]],5:[[255,255,178],[254,204,92],[253,141,60],[240,59,32],[189,0,38]],6:[[255,255,178],[254,217,118],[254,178,76],[253,141,60],[240,59,32],[189,0,38]],7:[[255,255,178],[254,217,118],[254,178,76],[253,141,60],[252,78,42],[227,26,28],[177,0,38]],8:[[255,255,204],[255,237,160],[254,217,118],[254,178,76],[253,141,60],[252,78,42],[227,26,28],[177,0,38]],9:[[255,255,204],[255,237,160],[254,217,118],[254,178,76],[253,141,60],[252,78,42],[227,26,28],[189,0,38],[128,0,38]]},\
"YlOrBr":{3:[[255,247,188],[254,196,79],[217,95,14]],4:[[255,255,212],[254,217,142],[254,153,41],[204,76,2]],5:[[255,255,212],[254,217,142],[254,153,41],[217,95,14],[153,52,4]],6:[[255,255,212],[254,227,145],[254,196,79],[254,153,41],[217,95,14],[153,52,4]],7:[[255,255,212],[254,227,145],[254,196,79],[254,153,41],[236,112,20],[204,76,2],[140,45,4]],8:[[255,255,229],[255,247,188],[254,227,145],[254,196,79],[254,153,41],[236,112,20],[204,76,2],[140,45,4]],9:[[255,255,229],[255,247,188],[254,227,145],[254,196,79],[254,153,41],[236,112,20],[204,76,2],[153,52,4],[102,37,6]]},\
#sequential single hue
"Purples":{3:[[239,237,245],[188,189,220],[117,107,177]],4:[[242,240,247],[203,201,226],[158,154,200],[106,81,163]],5:[[242,240,247],[203,201,226],[158,154,200],[117,107,177],[84,39,143]],6:[[242,240,247],[218,218,235],[188,189,220],[158,154,200],[117,107,177],[84,39,143]],7:[[242,240,247],[218,218,235],[188,189,220],[158,154,200],[128,125,186],[106,81,163],[74,20,134]],8:[[252,251,253],[239,237,245],[218,218,235],[188,189,220],[158,154,200],[128,125,186],[106,81,163],[74,20,134]],9:[[252,251,253],[239,237,245],[218,218,235],[188,189,220],[158,154,200],[128,125,186],[106,81,163],[84,39,143],[63,0,125]]},\
"Blues":{3:[[222,235,247],[158,202,225],[49,130,189]],4:[[239,243,255],[189,215,231],[107,174,214],[33,113,181]],5:[[239,243,255],[189,215,231],[107,174,214],[49,130,189],[8,81,156]],6:[[239,243,255],[198,219,239],[158,202,225],[107,174,214],[49,130,189],[8,81,156]],7:[[239,243,255],[198,219,239],[158,202,225],[107,174,214],[66,146,198],[33,113,181],[8,69,148]],8:[[247,251,255],[222,235,247],[198,219,239],[158,202,225],[107,174,214],[66,146,198],[33,113,181],[8,69,148]],9:[[247,251,255],[222,235,247],[198,219,239],[158,202,225],[107,174,214],[66,146,198],[33,113,181],[8,81,156],[8,48,107]]},\
"Greens":{3:[[229,245,224],[161,217,155],[49,163,84]],4:[[237,248,233],[186,228,179],[116,196,118],[35,139,69]],5:[[237,248,233],[186,228,179],[116,196,118],[49,163,84],[0,109,44]],6:[[237,248,233],[199,233,192],[161,217,155],[116,196,118],[49,163,84],[0,109,44]],7:[[237,248,233],[199,233,192],[161,217,155],[116,196,118],[65,171,93],[35,139,69],[0,90,50]],8:[[247,252,245],[229,245,224],[199,233,192],[161,217,155],[116,196,118],[65,171,93],[35,139,69],[0,90,50]],9:[[247,252,245],[229,245,224],[199,233,192],[161,217,155],[116,196,118],[65,171,93],[35,139,69],[0,109,44],[0,68,27]]},\
"Oranges":{3:[[254,230,206],[253,174,107],[230,85,13]],4:[[254,237,222],[253,190,133],[253,141,60],[217,71,1]],5:[[254,237,222],[253,190,133],[253,141,60],[230,85,13],[166,54,3]],6:[[254,237,222],[253,208,162],[253,174,107],[253,141,60],[230,85,13],[166,54,3]],7:[[254,237,222],[253,208,162],[253,174,107],[253,141,60],[241,105,19],[217,72,1],[140,45,4]],8:[[255,245,235],[254,230,206],[253,208,162],[253,174,107],[253,141,60],[241,105,19],[217,72,1],[140,45,4]],9:[[255,245,235],[254,230,206],[253,208,162],[253,174,107],[253,141,60],[241,105,19],[217,72,1],[166,54,3],[127,39,4]]},\
"Reds":{3:[[254,224,210],[252,146,114],[222,45,38]],4:[[254,229,217],[252,174,145],[251,106,74],[203,24,29]],5:[[254,229,217],[252,174,145],[251,106,74],[222,45,38],[165,15,21]],6:[[254,229,217],[252,187,161],[252,146,114],[251,106,74],[222,45,38],[165,15,21]],7:[[254,229,217],[252,187,161],[252,146,114],[251,106,74],[239,59,44],[203,24,29],[153,0,13]],8:[[255,245,240],[254,224,210],[252,187,161],[252,146,114],[251,106,74],[239,59,44],[203,24,29],[153,0,13]],9:[[255,245,240],[254,224,210],[252,187,161],[252,146,114],[251,106,74],[239,59,44],[203,24,29],[165,15,21],[103,0,13]]},\
"Greys":{3:[[240,240,240],[189,189,189],[99,99,99]],4:[[247,247,247],[204,204,204],[150,150,150],[82,82,82]],5:[[247,247,247],[204,204,204],[150,150,150],[99,99,99],[37,37,37]],6:[[247,247,247],[217,217,217],[189,189,189],[150,150,150],[99,99,99],[37,37,37]],7:[[247,247,247],[217,217,217],[189,189,189],[150,150,150],[115,115,115],[82,82,82],[37,37,37]],8:[[255,255,255],[240,240,240],[217,217,217],[189,189,189],[150,150,150],[115,115,115],[82,82,82],[37,37,37]],9:[[255,255,255],[240,240,240],[217,217,217],[189,189,189],[150,150,150],[115,115,115],[82,82,82],[37,37,37],[0,0,0]]},\
#diverging
"PuOr":{3:[[241,163,64],[247,247,247],[153,142,195]],4:[[230,97,1],[253,184,99],[178,171,210],[94,60,153]],5:[[230,97,1],[253,184,99],[247,247,247],[178,171,210],[94,60,153]],6:[[179,88,6],[241,163,64],[254,224,182],[216,218,235],[153,142,195],[84,39,136]],7:[[179,88,6],[241,163,64],[254,224,182],[247,247,247],[216,218,235],[153,142,195],[84,39,136]],8:[[179,88,6],[224,130,20],[253,184,99],[254,224,182],[216,218,235],[178,171,210],[128,115,172],[84,39,136]],9:[[179,88,6],[224,130,20],[253,184,99],[254,224,182],[247,247,247],[216,218,235],[178,171,210],[128,115,172],[84,39,136]],10:[[127,59,8],[179,88,6],[224,130,20],[253,184,99],[254,224,182],[216,218,235],[178,171,210],[128,115,172],[84,39,136],[45,0,75]],11:[[127,59,8],[179,88,6],[224,130,20],[253,184,99],[254,224,182],[247,247,247],[216,218,235],[178,171,210],[128,115,172],[84,39,136],[45,0,75]]},\
"BrBG":{3:[[216,179,101],[245,245,245],[90,180,172]],4:[[166,97,26],[223,194,125],[128,205,193],[1,133,113]],5:[[166,97,26],[223,194,125],[245,245,245],[128,205,193],[1,133,113]],6:[[140,81,10],[216,179,101],[246,232,195],[199,234,229],[90,180,172],[1,102,94]],7:[[140,81,10],[216,179,101],[246,232,195],[245,245,245],[199,234,229],[90,180,172],[1,102,94]],8:[[140,81,10],[191,129,45],[223,194,125],[246,232,195],[199,234,229],[128,205,193],[53,151,143],[1,102,94]],9:[[140,81,10],[191,129,45],[223,194,125],[246,232,195],[245,245,245],[199,234,229],[128,205,193],[53,151,143],[1,102,94]],10:[[84,48,5],[140,81,10],[191,129,45],[223,194,125],[246,232,195],[199,234,229],[128,205,193],[53,151,143],[1,102,94],[0,60,48]],11:[[84,48,5],[140,81,10],[191,129,45],[223,194,125],[246,232,195],[245,245,245],[199,234,229],[128,205,193],[53,151,143],[1,102,94],[0,60,48]]},\
"PRGn":{3:[[175,141,195],[247,247,247],[127,191,123]],4:[[123,50,148],[194,165,207],[166,219,160],[0,136,55]],5:[[123,50,148],[194,165,207],[247,247,247],[166,219,160],[0,136,55]],6:[[118,42,131],[175,141,195],[231,212,232],[217,240,211],[127,191,123],[27,120,55]],7:[[118,42,131],[175,141,195],[231,212,232],[247,247,247],[217,240,211],[127,191,123],[27,120,55]],8:[[118,42,131],[153,112,171],[194,165,207],[231,212,232],[217,240,211],[166,219,160],[90,174,97],[27,120,55]],9:[[118,42,131],[153,112,171],[194,165,207],[231,212,232],[247,247,247],[217,240,211],[166,219,160],[90,174,97],[27,120,55]],10:[[64,0,75],[118,42,131],[153,112,171],[194,165,207],[231,212,232],[217,240,211],[166,219,160],[90,174,97],[27,120,55],[0,68,27]],11:[[64,0,75],[118,42,131],[153,112,171],[194,165,207],[231,212,232],[247,247,247],[217,240,211],[166,219,160],[90,174,97],[27,120,55],[0,68,27]]},\
"PiYG":{3:[[233,163,201],[247,247,247],[161,215,106]],4:[[208,28,139],[241,182,218],[184,225,134],[77,172,38]],5:[[208,28,139],[241,182,218],[247,247,247],[184,225,134],[77,172,38]],6:[[197,27,125],[233,163,201],[253,224,239],[230,245,208],[161,215,106],[77,146,33]],7:[[197,27,125],[233,163,201],[253,224,239],[247,247,247],[230,245,208],[161,215,106],[77,146,33]],8:[[197,27,125],[222,119,174],[241,182,218],[253,224,239],[230,245,208],[184,225,134],[127,188,65],[77,146,33]],9:[[197,27,125],[222,119,174],[241,182,218],[253,224,239],[247,247,247],[230,245,208],[184,225,134],[127,188,65],[77,146,33]],10:[[142,1,82],[197,27,125],[222,119,174],[241,182,218],[253,224,239],[230,245,208],[184,225,134],[127,188,65],[77,146,33],[39,100,25]],11:[[142,1,82],[197,27,125],[222,119,174],[241,182,218],[253,224,239],[247,247,247],[230,245,208],[184,225,134],[127,188,65],[77,146,33],[39,100,25]]},\
"RdBu":{3:[[239,138,98],[247,247,247],[103,169,207]],4:[[202,0,32],[244,165,130],[146,197,222],[5,113,176]],5:[[202,0,32],[244,165,130],[247,247,247],[146,197,222],[5,113,176]],6:[[178,24,43],[239,138,98],[253,219,199],[209,229,240],[103,169,207],[33,102,172]],7:[[178,24,43],[239,138,98],[253,219,199],[247,247,247],[209,229,240],[103,169,207],[33,102,172]],8:[[178,24,43],[214,96,77],[244,165,130],[253,219,199],[209,229,240],[146,197,222],[67,147,195],[33,102,172]],9:[[178,24,43],[214,96,77],[244,165,130],[253,219,199],[247,247,247],[209,229,240],[146,197,222],[67,147,195],[33,102,172]],10:[[103,0,31],[178,24,43],[214,96,77],[244,165,130],[253,219,199],[209,229,240],[146,197,222],[67,147,195],[33,102,172],[5,48,97]],11:[[103,0,31],[178,24,43],[214,96,77],[244,165,130],[253,219,199],[247,247,247],[209,229,240],[146,197,222],[67,147,195],[33,102,172],[5,48,97]]},\
"RdGy":{3:[[239,138,98],[255,255,255],[153,153,153]],4:[[202,0,32],[244,165,130],[186,186,186],[64,64,64]],5:[[202,0,32],[244,165,130],[255,255,255],[186,186,186],[64,64,64]],6:[[178,24,43],[239,138,98],[253,219,199],[224,224,224],[153,153,153],[77,77,77]],7:[[178,24,43],[239,138,98],[253,219,199],[255,255,255],[224,224,224],[153,153,153],[77,77,77]],8:[[178,24,43],[214,96,77],[244,165,130],[253,219,199],[224,224,224],[186,186,186],[135,135,135],[77,77,77]],9:[[178,24,43],[214,96,77],[244,165,130],[253,219,199],[255,255,255],[224,224,224],[186,186,186],[135,135,135],[77,77,77]],10:[[103,0,31],[178,24,43],[214,96,77],[244,165,130],[253,219,199],[224,224,224],[186,186,186],[135,135,135],[77,77,77],[26,26,26]],11:[[103,0,31],[178,24,43],[214,96,77],[244,165,130],[253,219,199],[255,255,255],[224,224,224],[186,186,186],[135,135,135],[77,77,77],[26,26,26]]},\
"RdYlBu":{3:[[252,141,89],[255,255,191],[145,191,219]],4:[[215,25,28],[253,174,97],[171,217,233],[44,123,182]],5:[[215,25,28],[253,174,97],[255,255,191],[171,217,233],[44,123,182]],6:[[215,48,39],[252,141,89],[254,224,144],[224,243,248],[145,191,219],[69,117,180]],7:[[215,48,39],[252,141,89],[254,224,144],[255,255,191],[224,243,248],[145,191,219],[69,117,180]],8:[[215,48,39],[244,109,67],[253,174,97],[254,224,144],[224,243,248],[171,217,233],[116,173,209],[69,117,180]],9:[[215,48,39],[244,109,67],[253,174,97],[254,224,144],[255,255,191],[224,243,248],[171,217,233],[116,173,209],[69,117,180]],10:[[165,0,38],[215,48,39],[244,109,67],[253,174,97],[254,224,144],[224,243,248],[171,217,233],[116,173,209],[69,117,180],[49,54,149]],11:[[165,0,38],[215,48,39],[244,109,67],[253,174,97],[254,224,144],[255,255,191],[224,243,248],[171,217,233],[116,173,209],[69,117,180],[49,54,149]]},\
"RdYlGn":{3:[[252,141,89],[255,255,191],[145,207,96]],4:[[215,25,28],[253,174,97],[166,217,106],[26,150,65]],5:[[215,25,28],[253,174,97],[255,255,191],[166,217,106],[26,150,65]],6:[[215,48,39],[252,141,89],[254,224,139],[217,239,139],[145,207,96],[26,152,80]],7:[[215,48,39],[252,141,89],[254,224,139],[255,255,191],[217,239,139],[145,207,96],[26,152,80]],8:[[215,48,39],[244,109,67],[253,174,97],[254,224,139],[217,239,139],[166,217,106],[102,189,99],[26,152,80]],9:[[215,48,39],[244,109,67],[253,174,97],[254,224,139],[255,255,191],[217,239,139],[166,217,106],[102,189,99],[26,152,80]],10:[[165,0,38],[215,48,39],[244,109,67],[253,174,97],[254,224,139],[217,239,139],[166,217,106],[102,189,99],[26,152,80],[0,104,55]],11:[[165,0,38],[215,48,39],[244,109,67],[253,174,97],[254,224,139],[255,255,191],[217,239,139],[166,217,106],[102,189,99],[26,152,80],[0,104,55]]},\
"Spectral":{3:[[252,141,89],[255,255,191],[153,213,148]],4:[[215,25,28],[253,174,97],[171,221,164],[43,131,186]],5:[[215,25,28],[253,174,97],[255,255,191],[171,221,164],[43,131,186]],6:[[213,62,79],[252,141,89],[254,224,139],[230,245,152],[153,213,148],[50,136,189]],7:[[213,62,79],[252,141,89],[254,224,139],[255,255,191],[230,245,152],[153,213,148],[50,136,189]],8:[[213,62,79],[244,109,67],[253,174,97],[254,224,139],[230,245,152],[171,221,164],[102,194,165],[50,136,189]],9:[[213,62,79],[244,109,67],[253,174,97],[254,224,139],[255,255,191],[230,245,152],[171,221,164],[102,194,165],[50,136,189]],10:[[158,1,66],[213,62,79],[244,109,67],[253,174,97],[254,224,139],[230,245,152],[171,221,164],[102,194,165],[50,136,189],[94,79,162]],11:[[158,1,66],[213,62,79],[244,109,67],[253,174,97],[254,224,139],[255,255,191],[230,245,152],[171,221,164],[102,194,165],[50,136,189],[94,79,162]]},\
#qualitative
"Accent":{3:[[127,201,127],[190,174,212],[253,192,134]],4:[[127,201,127],[190,174,212],[253,192,134],[255,255,153]],5:[[127,201,127],[190,174,212],[253,192,134],[255,255,153],[56,108,176]],6:[[127,201,127],[190,174,212],[253,192,134],[255,255,153],[56,108,176],[240,2,127]],7:[[127,201,127],[190,174,212],[253,192,134],[255,255,153],[56,108,176],[240,2,127],[191,91,23]],8:[[127,201,127],[190,174,212],[253,192,134],[255,255,153],[56,108,176],[240,2,127],[191,91,23],[102,102,102]]},\
"Dark2":{3:[[27,158,119],[217,95,2],[117,112,179]],4:[[27,158,119],[217,95,2],[117,112,179],[231,41,138]],5:[[27,158,119],[217,95,2],[117,112,179],[231,41,138],[102,166,30]],6:[[27,158,119],[217,95,2],[117,112,179],[231,41,138],[102,166,30],[230,171,2]],7:[[27,158,119],[217,95,2],[117,112,179],[231,41,138],[102,166,30],[230,171,2],[166,118,29]],8:[[27,158,119],[217,95,2],[117,112,179],[231,41,138],[102,166,30],[230,171,2],[166,118,29],[102,102,102]]},\
"Paired":{3:[[166,206,227],[31,120,180],[178,223,138]],4:[[166,206,227],[31,120,180],[178,223,138],[51,160,44]],5:[[166,206,227],[31,120,180],[178,223,138],[51,160,44],[251,154,153]],6:[[166,206,227],[31,120,180],[178,223,138],[51,160,44],[251,154,153],[227,26,28]],7:[[166,206,227],[31,120,180],[178,223,138],[51,160,44],[251,154,153],[227,26,28],[253,191,111]],8:[[166,206,227],[31,120,180],[178,223,138],[51,160,44],[251,154,153],[227,26,28],[253,191,111],[255,127,0]],9:[[166,206,227],[31,120,180],[178,223,138],[51,160,44],[251,154,153],[227,26,28],[253,191,111],[255,127,0],[202,178,214]],10:[[166,206,227],[31,120,180],[178,223,138],[51,160,44],[251,154,153],[227,26,28],[253,191,111],[255,127,0],[202,178,214],[106,61,154]],11:[[166,206,227],[31,120,180],[178,223,138],[51,160,44],[251,154,153],[227,26,28],[253,191,111],[255,127,0],[202,178,214],[106,61,154],[255,255,153]]},\
"Pastel1":{3:[[251,180,174],[179,205,227],[204,235,197]],4:[[251,180,174],[179,205,227],[204,235,197],[222,203,228]],5:[[251,180,174],[179,205,227],[204,235,197],[222,203,228],[254,217,166]],6:[[251,180,174],[179,205,227],[204,235,197],[222,203,228],[254,217,166],[255,255,204]],7:[[251,180,174],[179,205,227],[204,235,197],[222,203,228],[254,217,166],[255,255,204],[229,216,189]],8:[[251,180,174],[179,205,227],[204,235,197],[222,203,228],[254,217,166],[255,255,204],[229,216,189],[253,218,236]],9:[[251,180,174],[179,205,227],[204,235,197],[222,203,228],[254,217,166],[255,255,204],[229,216,189],[253,218,236],[242,242,242]]},\
"Pastel2":{3:[[179,226,205],[253,205,172],[203,213,232]],4:[[179,226,205],[253,205,172],[203,213,232],[244,202,228]] ,5:[[179,226,205],[253,205,172],[203,213,232],[244,202,228],[230,245,201]],6:[[179,226,205],[253,205,172],[203,213,232],[244,202,228],[230,245,201],[255,242,174]],7:[[179,226,205],[253,205,172],[203,213,232],[244,202,228],[230,245,201],[255,242,174],[241,226,204]],8:[[179,226,205],[253,205,172],[203,213,232],[244,202,228],[230,245,201],[255,242,174],[241,226,204],[204,204,204]]},\
"Set1":{3:[[228,26,28],[55,126,184],[77,175,74]],4:[[228,26,28],[55,126,184],[77,175,74],[152,78,163]],5:[[228,26,28],[55,126,184],[77,175,74],[152,78,163],[255,127,0]],6:[[228,26,28],[55,126,184],[77,175,74],[152,78,163],[255,127,0],[255,255,51]],7:[[228,26,28],[55,126,184],[77,175,74],[152,78,163],[255,127,0],[255,255,51],[166,86,40]],8:[[228,26,28],[55,126,184],[77,175,74],[152,78,163],[255,127,0],[255,255,51],[166,86,40],[247,129,191]],9:[[228,26,28],[55,126,184],[77,175,74],[152,78,163],[255,127,0],[255,255,51],[166,86,40],[247,129,191],[153,153,153]]},\
"Set2":{3:[[102,194,165],[252,141,98],[141,160,203]],4:[[102,194,165],[252,141,98],[141,160,203],[231,138,195]],5:[[ 102,194,165],[252,141,98],[141,160,203],[231,138,195],[166,216,84]],6:[[102,194,165],[252,141,98],[141,160,203],[231,138,195],[166,216,84],[255,217,47]],7:[[102,194,165],[252,141,98],[141,160,203],[231,138,195],[166,216,84],[255,217,47],[229,196,148]],8:[[102,194,165],[252,141,98],[141,160,203],[231,138,195],[166,216,84],[255,217,47],[229,196,148],[179,179,179]]},\
"Set3":{3:[[141,211,199],[255,255,179],[190,186,218]],4:[[141,211,199],[255,255,179],[190,186,218],[251,128,114]],5:[[141,211,199],[255,255,179],[190,186,218],[251,128,114],[128,177,211]],6:[[141,211,199],[255,255,179],[190,186,218],[251,128,114],[128,177,211],[253,180,98]],7:[[141,211,199],[255,255,179],[190,186,218],[251,128,114],[128,177,211],[253,180,98],[179,222,105]],8:[[141,211,199],[255,255,179],[190,186,218],[251,128,114],[128,177,211],[253,180,98],[179,222,105],[252,205,229]],9:[[141,211,199],[255,255,179],[190,186,218],[251,128,114],[128,177,211],[253,180,98],[179,222,105],[252,205,229],[217,217,217]],10:[[141,211,199],[255,255,179],[190,186,218],[251,128,114],[128,177,211],[253,180,98],[179,222,105],[252,205,229],[217,217,217],[188,128,189]],11:[[141,211,199],[255,255,179],[190,186,218],[251,128,114],[128,177,211],[253,180,98],[179,222,105],[252,205,229],[217,217,217],[188,128,189],[204,235,197]],12:[[141,211,199],[255,255,179],[190,186,218],[251,128,114],[128,177,211],[253,180,98],[179,222,105],[252,205,229],[217,217,217],[188,128,189],[204,235,197],[255,237,111]]}\
}
# The final object we will use for output
self.dump = {}
# The maximum size for a samll connected component to be considered as leftover
self.limit = 5
self.execLabel = ""
self.level = 0
self.rootgraph = rootgraph
self.snlP = self.rootgraph.getStringProperty("spine node level")
# Basically launches the algorithm
def construct(self, cgraph, depthExec, prefix):
# resets the selections if any
self.viewSelection.setAllEdgeValue(False)
self.viewSelection.setAllNodeValue(False)
# sets some local graph variable
self.viewColor = cgraph.getLocalColorProperty("viewColor")
self.spineLevel = cgraph.getLocalDoubleProperty("spineLevel")
self.spineLabel = cgraph.getStringProperty("spineLabel")
self.checkComponents(cgraph, depthExec)
# returns the object constructed for JSON export
return self.dump
# Checks for components to compute spine or not
def checkComponents(self, cgraph, depthExec):
# gets the lsit of connected components (list of list of nodes)
components = tlp.ConnectedTest.computeConnectedComponents(cgraph)
# stores the smallest components, that will not be analyzed in search for spine
leftOvers = []
# the current component
componentNumber = 0
# for each connected component
for c in components:
indgraph = cgraph.inducedSubGraph(c)
indgraph.setName("component "+str(componentNumber))
# cheks if the component is too small or worth analyzing
if indgraph.numberOfNodes() <= self.limit or indgraph.numberOfEdges() == indgraph.numberOfNodes() -1:
for n in indgraph.getNodes():
# appends the nodes to the leftovers
leftOvers.append(n)
# attempt to store the nodes' dependency to the current spine (deprecated)
if self.spineLabel[n] == "":
spineLabels = [str(depthExec)]
else:
spineLabels = self.spineLabel[n].split("/")
spineLabels.append(str(depthExec))
self.spineLabel[n] = "/".join(spineLabels)
for e in indgraph.getEdges():
# attempt to store the edges' dependency to the current spine (deprecated)
if self.spineLabel[e] == "":
spineLabels = [str(depthExec)+"."+str(componentNumber)]
else:
spineLabels = self.spineLabel[e].split("/")
spineLabels.append(str(depthExec)+"."+str(componentNumber))
self.spineLabel[e] = "/".join(spineLabels)
# the subgraph needs no further analysis and is discarded
cgraph.delSubGraph(indgraph)
else:
# the component is big enough and not a tree so we look for its spine
self.componentAnalysis(indgraph, componentNumber, depthExec, cgraph)
# just keeping track of the component number
componentNumber += 1
# we store the list of left overs aside for later analysis
left = cgraph.inducedSubGraph(leftOvers)
left.setName("leftOvers")
# we draw them with Sugiyama
vL = left.getLocalLayoutProperty("viewLayout")
left.computeLayoutProperty("Sugiyama (OGDF)", vL)
# we store the results
self.dump["leftOvers"] = appendToDump(left, cgraph)
# Anlayse one connected component
def componentAnalysis(self, indgraph, componentNumber, depthExec, parentgraph):
# We compute the DAG level of each node
Dag = indgraph.getDoubleProperty("Dag Level - (viewMetric)")
indgraph.computeDoubleProperty("Dag Level", Dag)
# We set the spine levels of all nodes to 0 (deprecated?)
for n in indgraph.getNodes():
self.spineLevel[n] = 0
for e in indgraph.getEdges():
self.spineLevel[e] = 0
# This will store the list of spine nodes
spineNodeList = []
# Resets the colors of all nodes to blue (deprecated?)
for n in indgraph.getNodes():
self.viewColor[n] = tlp.Color(0,0,255,255)
# Gets the maximum spine level (will insure the flow)
maxLevel = int(Dag.getNodeMax())
currentDag = maxLevel
# Gets all the current sinks (with spine level maximum)
sinks = [n for n in indgraph.getNodes() if Dag[n] == currentDag]
#sinks = [n for n in indgraph.getNodes() if indgraph.outdeg(n) == 0]
# Selects them all
for n in sinks:
self.viewSelection[n] = True
# If there is no sink, there is nothing else to do, the sinks have been selected
# Maybe here we should return an empty list of sinks ?
if len(sinks) == 0:
return
initSinks = sinks
self.viewSelection[sinks[0]] = True
# we will descend from highest dag level to lowest
itera = range(currentDag-1, -1, -1)
# This iterative process insures a difference of 1 in dag level
for n in initSinks:
sinks = [n]
# We iterate for each DAG level from top to bottom to find the 'core' flow
for i in itera:
newSinks = []
# we start with all the sinks and get all nodes at DAG distance 1 from them
for n in sinks:
spineNodeList.append(n)
# spineLevel is deprecated, we used to tag also all other node with their DAG distance
self.spineLevel[n] = 1
# draw them in red
self.viewColor[n] = tlp.Color(255,0,0,255)
# get all in nodes
inNodes = indgraph.getInNodes(n)
# get all in nodes of DAG level i
maxNodes = [n2 for n2 in inNodes if Dag[n2] == i]
# they will be the new iteration of sinks
newSinks.extend(maxNodes)
# gets all the induced edges
for n2 in maxNodes:
e = indgraph.existEdge(n, n2, False)
if e.isValid():
# appends edges and nodes to spine
spineNodeList.append(n2)
# draw them in red
self.viewColor[n2] = tlp.Color(255,0,0,255)
self.spineLevel[n2] = 1
self.viewSelection[n2] = True
self.viewColor[e] = tlp.Color(255,0,0,255)
self.viewSelection[e] = True
self.spineLevel[e] = 1
self.induceP[e] = True
# swap the sinks
if len(newSinks) != 0:
sinks = newSinks
#else:
# print "there are no new nodes"
#for n in set(spineNodeList):
# sList = self.snlP[n]
# if sList == "":
# sList = []
# else:
# print sList
# sList = sList.split(";")
# sList.append(str(depthExec))
# print sList
# self.snlP[n] = ";".join(sList)
self.extractSpine(indgraph, maxLevel, set(spineNodeList), parentgraph)
# This is the function to update and include the backward connections to spine nodes
# It used to take care of the coloration but all of that is deprecated
# Only the drawing part is still useful
def extractSpine(self, curgraph, maxLevel, spineNodeList, parentgraph):
# initiating color sets
colorList = self.colorbrewer["RdYlBu"][6]
colorList2 = self.colorbrewer["PRGn"][6]
#if curgraph.getName() == "spine2":
# for sg in curgraph.getSubGraphs():
# curgraph.delSubGraph(sg)
vS = curgraph.getBooleanProperty("currentSelection")
isSpine = curgraph.getLocalBooleanProperty("spineNode")
spineList = curgraph.getStringProperty("spineList")
# some part deprecated, we used to check every level as DAG difference on edges
#for i in range():
for i in [1]:
vS.setAllEdgeValue(False)
vS.setAllNodeValue(False)
for e in curgraph.getEdges():
if self.spineLevel[e] == i:
vS[e] = True
vS[curgraph.source(e)] = True
vS[curgraph.target(e)] = True
isSpine[curgraph.source(e)] = True
isSpine[curgraph.target(e)] = True
# extracts the subgraph induced by the spine (we used to difference levels of spines...)
sg = curgraph.addSubGraph(vS, "spine "+str(i))
vL = sg.getLocalLayoutProperty("viewLayout")
sg.computeLayoutProperty("Sugiyama (OGDF)", vL)
# checks the number of connected components within the subgraph induced by the spine
ccspine = tlp.ConnectedTest.computeConnectedComponents(sg)
# This is not working anymore, here we should identify to which different spines a node is subsumed
for j in range(len(ccspine)):
c = ccspine[j]
for ns in c:
for n2 in curgraph.getInOutNodes(ns):
if isSpine[n2]:
spineL = []
if len(spineList[n2]) >0:
spineL = spineList[n2].split(';')
if str(j) not in spineL:
spineL.append(str(j))
spineList[n2] = ';'.join(spineL)
# here we should probably align connected components
if i == 1:
# with i == 1 (DAG different of 1) we are in the case of a regular spine
# that we want to sump for further visualization
self.dump["spine"] = appendToDump(sg, parentgraph)
# saves in the graph hierarchy the induced spine subgraph
curgraph.computeBooleanProperty("Induced Sub-Graph", self.viewSelection)
curgraph.addSubGraph(self.viewSelection, "induced spine")
self.viewSelection.setAllNodeValue(False)
# duplicates the graph for further analysis
# then remove all spine edges in order to repeat recursively the analysis
lower = curgraph.addCloneSubGraph("lower step")
for e in lower.getEdges():
if self.viewSelection[e] == True:
lower.delEdge(e)
# Simply dumps a graph with its basic visual properties under a JSON formatting for
# later visualization purpose (and load into a clean view...)
def appendToDump(graph, parentgraph):
graphDump = {"nodes":[], "edges":[]}
viewLabel = graph.getStringProperty("viewLabel")
viewLayout = graph.getLocalLayoutProperty("viewLayout")
for n in graph.getNodes():
neighbors = [n2.id for n2 in parentgraph.getInOutNodes(n)]
pos = [viewLayout[n][0], viewLayout[n][1]]
graphDump["nodes"].append({"id":n.id, "label":viewLabel[n], "pos":pos, "neighbors":neighbors})
for e in graph.getEdges():
graphDump["edges"].append({"s":graph.source(e).id, "t":graph.target(e).id})
return graphDump
# The main function, launches the algorithm
# The script must be executed on a prepared graph (see DAGTransformation.py)
def main(graph):
outputFile = "/work/abello_spine_twitte2r_temp.json"
snlP = graph.getStringProperty("spine node level")
snlP.setAllNodeValue("")
snlP.setAllEdgeValue("")
dumping = {}
workGraph = graph
index = 0
s = Spine(workGraph, graph)
dumping[0] = {}
dumping[index] = s.construct(workGraph, 0, "")
thereExistANewSpine = False
vSel = workGraph.getBooleanProperty("viewSelection")
for e in workGraph.getEdges():
if vSel[e] == True:
isTrue = True
break
sg = None
while thereExistANewSpine:
index += 1
nextGraph = None
compgraph = None
for sg in workGraph.getSubGraphs():
if "component " in sg.getName():
compgraph = sg
for ssg in sg.getSubGraphs():
if ssg.getName() == "lower step":
nextGraph = ssg
if nextGraph == None:
print "no next graph"
return
workGraph = nextGraph
s = Spine(workGraph, graph)
dumping[index] = {}
dumping[index] = s.construct(workGraph, index, "")
isTrue = False
vSel = workGraph.getBooleanProperty("viewSelection")
for e in workGraph.getEdges():
if vSel[e] == True:
isTrue = True
break
if isTrue == False:
for sg in workGraph.getSubGraphs():
if "component " in sg.getName():
compgraph = sg
vL = compgraph.getLocalLayoutProperty("viewLayout")
#dS = tlp.getDefaultPluginParameters("Sugiyama (OGDF)", compgraph)
#dS["node distance"] = 1
compgraph.computeLayoutProperty("FM^3 (OGDF)", vL)#"Sugiyama (OGDF)", vL, dS)
inNodes = [n for n in compgraph.getNodes() if compgraph.outdeg(n) == 0]
outNodes = [n for n in compgraph.getNodes() if compgraph.indeg(n) == 0]
#if len(inNodes) + len(outNodes) == compgraph.numberOfNodes():
# print "complete bipartite"
#print len(inNodes),"/", len(outNodes),"/", compgraph.numberOfNodes()
dumping[index]["spine"] = appendToDump(compgraph, compgraph)
# Dumping the indentified content
f = open(outputFile, "w")
f.write(json.dumps(dumping, indent=2))
f.close()