multiple lines for a node label

606 views
Skip to first unread message

javid dadashkarimi

unread,
Jan 17, 2017, 9:14:30 AM1/17/17
to cytoscape-helpdesk
Hi,
I hope you are doing great. I use cytoscape 3.40 and I want to draw a figure like the file attached below. I guess I should write multi-line labels for the rectangles. But, it seems there is no support for that. Is there any suggestion for a better idea.
Best,
-Javid
1.PNG

Alexander Pico

unread,
Jan 19, 2017, 5:39:51 PM1/19/17
to cytoscape-helpdesk
Hi Javid,

I thought this might be possible with Annotations (e.g., right-click on background and choose Add>Text bounded annotation), but the text doesn't parse "\n" characters either.

Hmm.  I know the author of Enhanced Graphics is looking into supporting multiple node labels. These *may* work with \n (not sure).   In the meantime, I'll file it as a feature request and cc you on the ticket.

Thanks!
 - Alex

Alex Pico

unread,
Jul 7, 2017, 5:30:54 PM7/7/17
to cytoscape-helpdesk
I was asked about this again recently and I tried to generate a multi-line node label (rather than an annotation)... and got it to work!

You can copy/paste a newline from a text editor into the Table Panel cell and it will be rendered as a new line.  If you have a CSV file of labels you want to import, you simply need to encode them as follows (using your example):

label, key
address, node 1
utilities, node 2
"water
garbage
included
paid
utilities", node 3

Thus, rather than using annotations, you can add a rectangular node with this multi-line label and draw a dashed line to connect to the utilities node.
 - Alex

P.S. I know this is 7 month too late, but perhaps will help others....
Reply all
Reply to author
Forward
0 new messages