示例#1
0
def iGraphLayout(G, name, fit=1000):
    iG = asIGraph(G)
    index_to_name = {i: n.attributes()["name"] for (i, n) in enumerate(iG.vs)}
    L = iG.layout(name)
    L.fit_into([0, 0, fit, fit])
    D = {index_to_name[i]: pos(xy[0], xy[1]) for (i, xy) in enumerate(L)}
    return D
示例#2
0
def iGraphLayout(G, name, fit=1000):
    iG = asIGraph(G)
    index_to_name = {i: n.attributes()["name"]
                     for (i, n) in enumerate(iG.vs)}
    L = iG.layout(name)
    L.fit_into([0, 0, fit, fit])
    D = {index_to_name[i]: pos(xy[0], xy[1])
         for (i,xy) in enumerate(L)}
    return D
示例#3
0
 def from_json_value(jlayout):
     return {k.lower(): pos(*jlayout[k]) for k in jlayout}
示例#4
0
 def from_json_value(jlayout):
     return {k: pos(*jlayout[k]) for k in jlayout}