cytoscape / cytoscape.js-cose-bilkent

The CoSE layout for Cytoscape.js by Bilkent with enhanced compound node placement.
MIT License
123 stars 45 forks source link

cose-bilkent does not respect locked nodes #50

Open JLHwung opened 7 years ago

JLHwung commented 7 years ago

Correct me if I am wrong, but I search locked in the codebase and find nothing.

In cose layout, the gravitational/repulsion force takes locked into consideration, see https://github.com/cytoscape/cytoscape.js/blob/master/src/extensions/layout/cose.js#L357 and https://github.com/cytoscape/cytoscape.js/blob/master/src/extensions/layout/cose.js#L529.

However, I did not see any locked in https://github.com/cytoscape/cytoscape.js-cose-bilkent/blob/master/src/Layout/FDLayout.js#L208 and https://github.com/cytoscape/cytoscape.js-cose-bilkent/blob/master/src/Layout/FDLayout.js#L281.

I can work on a PR to respect locked nodes. Is there any algorithmic difficult on locked nodes? Thank you.

ugurdogrusoz commented 7 years ago

@JLHwung feel free to work on locking specified nodes. This is where you need to disallow movement of nodes. However notice that prior to layout starting you should resolve any inconsistencies. For instance, locking a parent compound node with children unlocked will create problems.