Description Usage Arguments Details Value See Also Examples
Creates a style from defaults and predefined mappings.
1 2 | createStyle(style.name, defaults, mappings,
base.url = "http://localhost:1234/v1")
|
style.name |
(char) name for style |
defaults |
(list) key-value pairs for default mappings. |
mappings |
(list) visual property mappings, see mapVisualProperty |
base.url |
cyrest base url for communicating with cytoscape |
Requires attribute mappings to be previously created, see mapVisualProperty.
None
applyStyle, mapVisualProperty
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | #first there has to be a network to apply style to
example(createNetwork)
#then prepare style variables
style.name = "myStyle"
defaults <- list(NODE_SHAPE="diamond",
NODE_SIZE=30,
EDGE_TRANSPARENCY=120,
NODE_LABEL_POSITION="W,E,c,0.00,0.00")
nodeLabels <- mapVisualProperty('node label','id','p')
nodeFills <- mapVisualProperty('node fill color','group','d',c("A","B"), c("#FF9900","#66AAAA"))
arrowShapes <- mapVisualProperty('Edge Target Arrow Shape','interaction','d',
c("activates","inhibits","interacts"),c("Arrow","T","None"))
edgeWidth <- mapVisualProperty('edge width','weight','p')
#and then create the style
createStyle(style.name, defaults, list(nodeLabels,nodeFills,arrowShapes,edgeWidth))
#finsh by applying the style
example(applyStyle)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.