Closed gmhhope closed 1 year ago
Hi --
Yes, I think there would be (at least) two ways of doing this ... this is more a Cytoscape question first, and then you'll be able to see how this is reflected in py4cytoscape.
1) Select a node, then use the Style (aka visual mapper) to locate the Label property, then double-click on Label's Bypass button and enter your value.
2) Create a new column (e.g., NewName) and use Style to locate the Label property, then double-click on Label's Map button. You should see that the Common column is selected for a Passthru mapping. Instead of Common, choose the NewName column. Finally, select a node and enter your value in the NewName column for your node.
The above description is shorthand, and if you're stuck, I'm happy to explain more.
Given the above, I'd focus on:
set_node_label_bypass() set_node_label_mapping() load_table_data()
Feel free to ask questions
@bdemchak Oh wait, I pasted the CD4<sup>+</sup> M CCR6<sup>-</sup> CXCR3<sup>+</sup> (%)
in the bypass. It doesn't render what you have there
Did you convert to the markdown-format before copying into the box?
I see ... no, I posted exactly the characters but not with markup.
I'd be very surprised to see markup being rendered here. That type of rendering is a very heavyweight operation, and Cytoscape is trying to display thousands or even millions of nodes. Markup wouldn't be the common case, but it could drag down all cases.
A more reasonable way of displaying markup would be with an Annotation, but I see that even that doesn't do markup rendering.
I'll ask around to see if anyone has suggestions.
While I'm asking around, I also played with this a little.
This can be done by choosing a font that has superscript or subscript characters. TimesNewRoman has them (e.g., characters 207A). See the result:
Is this what you're looking for?
Great to hear this can work out! I will try out. Thanks for the efforts!
Problem solved!
Hi Barry,
Just a general question, can cytoscape render markdown text in the labeling of the nodes? e.g.,
CD4<sup>+</sup> M CCR6<sup>-</sup> CXCR3<sup>+</sup> (%)
. It might run over py4cyotoscape but I guess you might have clues?Thanks, Minghao Gong