Linear constraints on layout, allowing rotation

127 views
Skip to first unread message

Joakim Knudsen

unread,
May 30, 2022, 6:18:29 AM5/30/22
to cytoscape-helpdesk
Cytoscape allows constraints on sets of nodes, but these have to be either horizontal or vertical. Consider a compound node, consisting of, say, 4 nodes. I want the graph layout to be able to rotate this compound node, while preserving a linear layout (and initial ordering) of the nodes. If I constrain the layout to horizontal, then Cytoscape (using fcose) won't be able to rotate this set of nodes to facilitate edge routing; it remains horizontal.

Is there any way to specify only a linear layout, which would mean "these 4 nodes should remain in a straight line (and not be reordered internally)" but should be positioned and rotated freely as a compound node? Ideally, I'd like to be able to specify linear layouts in two dimensions (primary and secondary axis), such that I could even create two-column compound nodes (representing a microcontroller, with, for example, 20 legs/nodes down each side).




Joakim

Scooter Morris

unread,
Jun 2, 2022, 9:59:08 AM6/2/22
to cytoscape-helpdesk
Hi Joakim,

From reading your stackoverflow message, you seem to be talking about cytoscape.js -- this particular group is for Cytoscape desktop...

-- scooter

Joakim Knudsen

unread,
Jun 3, 2022, 2:53:29 AM6/3/22
to cytoscape-helpdesk
Sorry for the confusion; I have indeed been looking at the desktop application. However, I was under the impression that both the desktop and the JS library apply the same graph algorithms, 
and, as such, the question applies in either case? I'm essentially looking for any tool/library/algorithm which is able to do graph layout, while preserving subgraph shapes (under rotation).

Thanks for replying!

Joakim

Scooter Morris

unread,
Jun 9, 2022, 10:46:17 AM6/9/22
to cytoscape-helpdesk
Hi Joakim,

Cytoscape.js and Cytoscape share the name "Cytoscape" and the teams overlap somewhat, but they don't share much beyond that.  I would direct you to the work of Michael Wybrow and Tim Dwyer at the University of Monash -- their WebCoLa code may be close to what you want, and it's available in cytoscape.js.  In general, that group tends to put out excellent work on graph constraints.  Do don't know of anything in Cytoscape desktop that does the same kinds of things other than the manual node rotation in the Layout Tools.

-- scooter

Joakim Knudsen

unread,
Jun 10, 2022, 4:21:26 PM6/10/22
to cytoscape-helpdesk
Thanks a lot, this is very interesting :)
Reply all
Reply to author
Forward
0 new messages