Fit node to label text?

190 views
Skip to first unread message

michael.ri...@gmail.com

unread,
Dec 17, 2018, 5:58:14 PM12/17/18
to cytoscape-helpdesk
Is it possible to have a node size automatically fit to the label text?

Scooter Morris

unread,
Dec 20, 2018, 11:17:10 AM12/20/18
to cytoscape-helpdesk
Hi Michael,
   Not easily, but there is a bit of a workaround.  You can set the width of your label and labels larger than that width will wrap.   It's not optimal, but at least that will give you some control.  Beyond that, we would need to write an app to do it.  A pretty simple app overall, so maybe we'll add a "fancy label app" to our summer student list...

-- scooter

Michael Brent

unread,
Dec 20, 2018, 1:43:19 PM12/20/18
to cytoscape...@googlegroups.com
Thanks.

--
You received this message because you are subscribed to the Google Groups "cytoscape-helpdesk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cytoscape-helpd...@googlegroups.com.
To post to this group, send email to cytoscape...@googlegroups.com.
Visit this group at https://groups.google.com/group/cytoscape-helpdesk.
To view this discussion on the web visit https://groups.google.com/d/msgid/cytoscape-helpdesk/16d1ddbf-0cf1-45b9-bc7e-615088bdd74e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Alex Pico

unread,
Dec 20, 2018, 5:23:06 PM12/20/18
to cytoscape...@googlegroups.com
Hi Michael,

In addition to Scooter’s answer there is also the option of scripting a solution for Cytoscape. Here’s an R script, for example, that will read the current labels and sizes from your network and style, and then calculate and apply a new node width mapping (attached).

It’s current set to work with the Yeast Perturbation.cys sample session file, if you want to try opening that and then running the script.

To run this on any arbitrary network, you will just need to alter the name of the style that you want to based the calculation on. See the section of CUSTOMIZABLE PARAMETERS in the script. You’ll find other options you can tweak in that same section.

Let me know if this works for you or if you get stuck.
 - Alex

labels.R

Michael Brent

unread,
Dec 21, 2018, 10:30:34 AM12/21/18
to cytoscape...@googlegroups.com
Thank you!

--
You received this message because you are subscribed to the Google Groups "cytoscape-helpdesk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cytoscape-helpd...@googlegroups.com.
To post to this group, send email to cytoscape...@googlegroups.com.
Visit this group at https://groups.google.com/group/cytoscape-helpdesk.

For more options, visit https://groups.google.com/d/optout.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "cytoscape-helpdesk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cytoscape-helpd...@googlegroups.com.
To post to this group, send email to cytoscape...@googlegroups.com.
Visit this group at https://groups.google.com/group/cytoscape-helpdesk.
Reply all
Reply to author
Forward
0 new messages