How to unlock node size, and apply force directed layout in Cytoscape app?

172 views
Skip to first unread message

Tib Tony

unread,
Mar 13, 2014, 12:01:37 AM3/13/14
to cytoscape...@googlegroups.com
Hi,

I am a Cytoscape 3 app developer. After create network and view, I cannot find a place to uncheck the lock node size option to make the node ellipse. In old API there is a NODE_SIZE_LOCKED property but I couldn't find the counterpart in 3. Also, where is the counterpart to apply force directed layout in 3?

Thanks for saving my day!

Tony

Tim Hull

unread,
Mar 13, 2014, 4:29:54 PM3/13/14
to cytoscape...@googlegroups.com
In Cytoscape 3.1, this should be right on the Style tab (in the Node section). In 3.0.x, you will have to click on Defaults and then the Dependency tab. To change these programmatically, I'd call the getAllVisualPropertyDependencies() method and look for one for which getDisplayName returns "nodeSizeLocked". Then, set that one to true opt false depending on what you want.

As for force-directed layout, it is there - look for "Prefuse Force Directed Layout" on the Layout menu. You can also get it programmatically by calling getLayout("force-directed") from a CyLayoutAlgorithmManager.

Hope this helps...

Tim


--
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 http://groups.google.com/group/cytoscape-helpdesk.
For more options, visit https://groups.google.com/d/optout.

Tib Tony

unread,
Mar 13, 2014, 5:21:45 PM3/13/14
to cytoscape...@googlegroups.com
Thanks Tim!

I am trying the layout programmatically. So I registered the CyLayoutAlgorithmManager clam in Cyctivator and pass it down to the function where I need to apply layout.

getLayout("force-directed") gets the algorithm, but how to "apply" it to the view I generated using addNetworkView? Sorry I am really inexperienced in sorting out java docs.


On Thursday, March 13, 2014 4:29:54 PM UTC-4, Tim Hull wrote:
In Cytoscape 3.1, this should be right on the Style tab (in the Node section). In 3.0.x, you will have to click on Defaults and then the Dependency tab. To change these programmatically, I'd call the getAllVisualPropertyDependencies() method and look for one for which getDisplayName returns "nodeSizeLocked". Then, set that one to true opt false depending on what you want.

As for force-directed layout, it is there - look for "Prefuse Force Directed Layout" on the Layout menu. You can also get it programmatically by calling getLayout("force-directed") from a CyLayoutAlgorithmManager.

Hope this helps...

Tim


On Wed, Mar 12, 2014 at 9:01 PM, Tib Tony <tony...@gmail.com> wrote:
Hi,

I am a Cytoscape 3 app developer. After create network and view, I cannot find a place to uncheck the lock node size option to make the node ellipse. In old API there is a NODE_SIZE_LOCKED property but I couldn't find the counterpart in 3. Also, where is the counterpart to apply force directed layout in 3?

Thanks for saving my day!

Tony

--
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-helpdesk+unsub...@googlegroups.com.

Tim Hull

unread,
Mar 13, 2014, 5:30:45 PM3/13/14
to cytoscape...@googlegroups.com
The visual style has an apply method that accepts a CyNetworkView - that should work, though you may have to call the view's updateView method afterwards...

Tim


To unsubscribe from this group and stop receiving emails from it, send an email to cytoscape-helpd...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages