(If I got it right) it seems after using a map function there is an access by index which throws an error in python 3.x as map no longer returns a list.
`
if layout is not None:
pos = map(lambda position:
{'x': position[0]scale, 'y': position[1]scale},
layout.values())
nodes = g.nodes()
if isinstance(g, nx.MultiDiGraph) or isinstance(g, nx.MultiGraph):
edges = g.edges(data=True, keys=True)
edge_builder = __build_multi_edge
else:
edges = g.edges(data=True)
edge_builder = __build_edge
# Map network table data
cygraph[DATA] = __map_table_data(g.graph.keys(), g.graph)
for i, node_id in enumerate(nodes):
new_node = __create_node(g.node[node_id], node_id)
if layout is not None:
new_node['position'] = pos[i]
I second a from_networkx function. This would make py2cytoscape much more usable for a lot of python users who already use networkx for the main data structure. (Also needs to bundle node and edge attributes!)
Hi,
(If I got it right) it seems after using a map function there is an access by index which throws an error in python 3.x as map no longer returns a list.
` if layout is not None: pos = map(lambda position: {'x': position[0]scale, 'y': position[1]scale}, layout.values())
`