Closed louisgv closed 7 years ago
Work around:
var cy = cytoscape();
cy.add({
data: {
id: 'user',
weight: 0
},
position: { // the model position of the node (optional on init, mandatory after)
x: u_gp.longitude(),
y: u_gp.latitude()
}
});
I've confirmed that the positions are set properly when using the preset
layout at init. Are you sure you're setting a valid position and that you don't have any race conditions?
Hi,
I initialized my graph like so:
The first console.log shown that the u_gp does return the position correctly. The final log output shown that the position of the user stays at 0:
Did I do something wrong? How do I specify the position of the starting node? Thanks!