iVis-at-Bilkent / cytoscape.js-fcose

fCoSE: a fast Compound Spring Embedder
MIT License
134 stars 25 forks source link

Is there a way to define <= relativePlacementConstraint ? #65

Closed dumbPy closed 10 months ago

dumbPy commented 10 months ago

I would like to limit the total width (or height) of a graph and hence would like to define less-than-or-equal (<=) relative placement constraints where the distance between 2 points in a given dimension is not more than the defined value (as opposed to be above the given gap value).

ugurdogrusoz commented 10 months ago

@dumbPy fCoSE does not support such a constraint at the moment. may be you can use other constraints to sort of emulate this but I am not sure how.

dumbPy commented 10 months ago

Thanks a lot @ugurdogrusoz . After quite a bit of experimentation, realised that I can add virtual nodes L0 and R0 and fix them at x=0 and x=pageWidth respectively and add relativePlacementConstraint to keep all nodes right of L0 and left of R0. Works like a charm.