Skip to content

Commit aed24fd

Browse files
committed
nicer looking format
1 parent 10293fa commit aed24fd

File tree

2 files changed

+232
-2
lines changed

2 files changed

+232
-2
lines changed

dodecahedron.json

Lines changed: 231 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,231 @@
1-
{"directed": false, "multigraph": false, "graph": {"name": "Dodecahedral Graph"}, "nodes": [{"x": 0.9510565162951535, "y": -0.3090169943749474, "id": 0}, {"x": 0.5877852522924732, "y": 0.8090169943749473, "id": 1}, {"x": -0.5877852522924732, "y": 0.8090169943749473, "id": 2}, {"x": -0.9510565162951535, "y": -0.3090169943749475, "id": 3}, {"x": -1.902113032590307, "y": -0.618033988749895, "id": 4}, {"x": -2.853169548885461, "y": 0.9270509831248419, "id": 5}, {"x": -1.1755705045849465, "y": 1.6180339887498947, "id": 6}, {"x": -5.51091059616309e-16, "y": 3.0, "id": 7}, {"x": 1.1755705045849465, "y": 1.6180339887498947, "id": 8}, {"x": 2.8531695488854605, "y": 0.9270509831248421, "id": 9}, {"x": 1.902113032590307, "y": -0.6180339887498948, "id": 10}, {"x": 1.7633557568774196, "y": -2.427050983124842, "id": 11}, {"x": 2.9389262614623664, "y": -4.045084971874736, "id": 12}, {"x": 4.755282581475767, "y": 1.545084971874737, "id": 13}, {"x": -9.184850993605148e-16, "y": 5.0, "id": 14}, {"x": -4.755282581475768, "y": 1.5450849718747364, "id": 15}, {"x": -2.938926261462365, "y": -4.045084971874737, "id": 16}, {"x": -1.7633557568774192, "y": -2.4270509831248424, "id": 17}, {"x": 1.2246467991473532e-16, "y": -2.0, "id": 18}, {"x": 6.123233995736766e-17, "y": -1.0, "id": 19}], "links": [{"source": 0, "target": 1}, {"source": 0, "target": 19}, {"source": 0, "target": 10}, {"source": 1, "target": 2}, {"source": 1, "target": 8}, {"source": 2, "target": 3}, {"source": 2, "target": 6}, {"source": 3, "target": 4}, {"source": 3, "target": 19}, {"source": 4, "target": 5}, {"source": 4, "target": 17}, {"source": 5, "target": 6}, {"source": 5, "target": 15}, {"source": 6, "target": 7}, {"source": 7, "target": 8}, {"source": 7, "target": 14}, {"source": 8, "target": 9}, {"source": 9, "target": 10}, {"source": 9, "target": 13}, {"source": 10, "target": 11}, {"source": 11, "target": 12}, {"source": 11, "target": 18}, {"source": 12, "target": 13}, {"source": 12, "target": 16}, {"source": 13, "target": 14}, {"source": 14, "target": 15}, {"source": 15, "target": 16}, {"source": 16, "target": 17}, {"source": 17, "target": 18}, {"source": 18, "target": 19}]}
1+
{
2+
"directed": false,
3+
"graph": {
4+
"name": "Dodecahedral Graph"
5+
},
6+
"links": [
7+
{
8+
"source": 0,
9+
"target": 1
10+
},
11+
{
12+
"source": 0,
13+
"target": 19
14+
},
15+
{
16+
"source": 0,
17+
"target": 10
18+
},
19+
{
20+
"source": 1,
21+
"target": 2
22+
},
23+
{
24+
"source": 1,
25+
"target": 8
26+
},
27+
{
28+
"source": 2,
29+
"target": 3
30+
},
31+
{
32+
"source": 2,
33+
"target": 6
34+
},
35+
{
36+
"source": 3,
37+
"target": 4
38+
},
39+
{
40+
"source": 3,
41+
"target": 19
42+
},
43+
{
44+
"source": 4,
45+
"target": 5
46+
},
47+
{
48+
"source": 4,
49+
"target": 17
50+
},
51+
{
52+
"source": 5,
53+
"target": 6
54+
},
55+
{
56+
"source": 5,
57+
"target": 15
58+
},
59+
{
60+
"source": 6,
61+
"target": 7
62+
},
63+
{
64+
"source": 7,
65+
"target": 8
66+
},
67+
{
68+
"source": 7,
69+
"target": 14
70+
},
71+
{
72+
"source": 8,
73+
"target": 9
74+
},
75+
{
76+
"source": 9,
77+
"target": 10
78+
},
79+
{
80+
"source": 9,
81+
"target": 13
82+
},
83+
{
84+
"source": 10,
85+
"target": 11
86+
},
87+
{
88+
"source": 11,
89+
"target": 12
90+
},
91+
{
92+
"source": 11,
93+
"target": 18
94+
},
95+
{
96+
"source": 12,
97+
"target": 13
98+
},
99+
{
100+
"source": 12,
101+
"target": 16
102+
},
103+
{
104+
"source": 13,
105+
"target": 14
106+
},
107+
{
108+
"source": 14,
109+
"target": 15
110+
},
111+
{
112+
"source": 15,
113+
"target": 16
114+
},
115+
{
116+
"source": 16,
117+
"target": 17
118+
},
119+
{
120+
"source": 17,
121+
"target": 18
122+
},
123+
{
124+
"source": 18,
125+
"target": 19
126+
}
127+
],
128+
"multigraph": false,
129+
"nodes": [
130+
{
131+
"id": 0,
132+
"x": 0.9510565162951535,
133+
"y": -0.3090169943749474
134+
},
135+
{
136+
"id": 1,
137+
"x": 0.5877852522924732,
138+
"y": 0.8090169943749473
139+
},
140+
{
141+
"id": 2,
142+
"x": -0.5877852522924732,
143+
"y": 0.8090169943749473
144+
},
145+
{
146+
"id": 3,
147+
"x": -0.9510565162951535,
148+
"y": -0.3090169943749475
149+
},
150+
{
151+
"id": 4,
152+
"x": -1.902113032590307,
153+
"y": -0.618033988749895
154+
},
155+
{
156+
"id": 5,
157+
"x": -2.853169548885461,
158+
"y": 0.9270509831248419
159+
},
160+
{
161+
"id": 6,
162+
"x": -1.1755705045849465,
163+
"y": 1.6180339887498947
164+
},
165+
{
166+
"id": 7,
167+
"x": -5.51091059616309e-16,
168+
"y": 3.0
169+
},
170+
{
171+
"id": 8,
172+
"x": 1.1755705045849465,
173+
"y": 1.6180339887498947
174+
},
175+
{
176+
"id": 9,
177+
"x": 2.8531695488854605,
178+
"y": 0.9270509831248421
179+
},
180+
{
181+
"id": 10,
182+
"x": 1.902113032590307,
183+
"y": -0.6180339887498948
184+
},
185+
{
186+
"id": 11,
187+
"x": 1.7633557568774196,
188+
"y": -2.427050983124842
189+
},
190+
{
191+
"id": 12,
192+
"x": 2.9389262614623664,
193+
"y": -4.045084971874736
194+
},
195+
{
196+
"id": 13,
197+
"x": 4.755282581475767,
198+
"y": 1.545084971874737
199+
},
200+
{
201+
"id": 14,
202+
"x": -9.184850993605148e-16,
203+
"y": 5.0
204+
},
205+
{
206+
"id": 15,
207+
"x": -4.755282581475768,
208+
"y": 1.5450849718747364
209+
},
210+
{
211+
"id": 16,
212+
"x": -2.938926261462365,
213+
"y": -4.045084971874737
214+
},
215+
{
216+
"id": 17,
217+
"x": -1.7633557568774192,
218+
"y": -2.4270509831248424
219+
},
220+
{
221+
"id": 18,
222+
"x": 1.2246467991473532e-16,
223+
"y": -2.0
224+
},
225+
{
226+
"id": 19,
227+
"x": 6.123233995736766e-17,
228+
"y": -1.0
229+
}
230+
]
231+
}

make_dodecahedron_graph.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
node_link_data = nx.node_link_data(G)
6363

6464
with open('dodecahedron.json','w') as f:
65-
json.dump(node_link_data,f)
65+
json.dump(node_link_data,f,indent=2,sort_keys=True)
6666

6767
fig.savefig('dodecahedron.png',dpi=150)
6868

0 commit comments

Comments
 (0)