['attribute-circle', 'stacked-node-layout', 'degree-circle', 'circular', 'attributes-layout', 'kamada-kawai', 'force-directed', 'grid', 'hierarchical', 'fruchterman-rheingold', 'isom']
Once I have the name of the layout, I should be able to apply it by using a command like:
requests.get(BASE + 'apply/layouts/force-directed/' + str(new_suid))
In cytoscape, if I am manually applying the layout, I need to select the "Edge attribute that contains the weights". How can this be included in a get call?
Many thanks in advance,
D.
Hello David,
Your first observation is correct; unfortunately, there is an incongruity between the name of the layout in the GUI, and its layout in command-line and consequently CyREST. This means ‘Prefuse Force Directed Layout’ appears as ‘force-directed’ to CyREST.
To access the column parameter, you can add it to the URL as follows (for an example network ’52’ with an edge column ‘EdgeBetweenness’):
/v1/apply/layouts/force-directed/52?column=EdgeBetweenness
All other parameters can be set by sending a PUT request with a JSON payload to the following URL:
/v1/apply/layouts/force-directed/parameters
An example payload can be the following, where the Default Spring Length is set to 100:
[
{
"name": "numIterations",
"description": "Number of Iterations:",
"type": "int",
"value": 100
},
{
"name": "defaultSpringCoefficient",
"description": "Default Spring Coefficient:",
"type": "double",
"value": 0.0001
},
{
"name": "defaultSpringLength",
"description": "Default Spring Length:",
"type": "double",
"value": 100
},
{
"name": "defaultNodeMass",
"description": "Default Node Mass:",
"type": "double",
"value": 3
},
{
"name": "isDeterministic",
"description": "Force deterministic layouts (slower):",
"type": "boolean",
"value": false
},
{
"name": "singlePartition",
"description": "Don't partition graph before layout:",
"type": "boolean",
"value": false
}
]
Let me know if this is helpful.
Sincerely,
David Otasek