Open marimeireles opened 3 years ago
I have to jump out for now and will be out for the wknd, but hopefully I can pick this up again a bit on Monday!
You might want to check if this code is executed properly with a console.log
? https://github.com/QuantStack/ipycytoscape/blob/master/src/graph.ts#L176
I managed to assign positions to nodes proceeding as follows:
cy = CytoscapeWidget()
# ... populate your graph
pos = {...} # map nodes id to pairs of floats.
for node in cy.graph.nodes:
x, y = pos[node.data["id"]]
node.position = {"x" : x, "y" : y}
cy.relayout()
You can create a
Node
instance and try to set a position with:Or do something completely else, the node will appear in the same place in the screen.
I have to read more into it but I wonder if it's because we're not interacting with Phosphor correctly. I don't think the problem is related with the spectate problem of deep objects like dictionaries not being sync. because we have other examples in the code like the
data
attr. that's also a dict, but it's working fine.This bug was first issued by @DnlRKorn on the QS channel. Thanks @DnlRKorn! :)