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
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
def from_json_value(jlayout): return {k.lower(): pos(*jlayout[k]) for k in jlayout}
def from_json_value(jlayout): return {k: pos(*jlayout[k]) for k in jlayout}