Closed istemi-bahceci closed 8 years ago
@istemi-bahceci I haven't tried the demo you pasted yet, but I suspect the issue is using the ready
field at init. There are subtle issues with using ready in certain cases (for one, because ready is on layoutready rather than layoutstop), which is why it's now deprecated/undocumented. It's safer to use cy.ready()
after the init call. I'll try out the demo in a bit, but I suspect this is the issue.
@maxkfranz Well I also tried the code piece in the ready field in somewhere else after initialization. It seems that problem still occurs
@istemi-bahceci The issue is that the style is applied using a diff-patch strategy for performance. When you change a node's parent state, that doesn't necessarily change the style context stack. This is the case in your example.
I've added an extra step for parent nodes where their width and height are always set to auto -- outside of the stylesheet.
Try this snapshot and let me know if it works for you : http://js.cytoscape.org/download/cytoscape.js-snapshot-459b73d90e-1462908712644.zip
@istemi-bahceci Is the snapshot with the change working for you?
@maxkfranz sorry for late response, yes it is working fine now. Thanks for the quick fix :) :+1:
Great, I'll close this and I'll release later today so you can use the regular release from npm etc.
That would be great ! Thanks again :)
Hi,
I am trying to create a compound node and move some elements to that compound node by using eles.move( ) function. I observed that when width or height attribute is set for nodes, eles.move( ) produces problematic results.
If you try following options for ready function and style, when initializing cytoscape in cytoscape examples you can see the problem:
Notice the compound in the center of the graph, according to the ready function this compound should have all the other nodes inside it: