createVisualStyle: Create a visual style from components

Description Usage Arguments Details Value See Also Examples

View source: R/Styles.R

Description

Create a style from defaults and predefined mappings.

Usage

1
createVisualStyle(style.name, defaults, mappings, base.url = .defaultBaseUrl)

Arguments

style.name

(char) name for style

defaults

(list) key-value pairs for default mappings.

mappings

(list) visual property mappings, see mapVisualProperty

base.url

(optional) Ignore unless you need to specify a custom domain, port or version to connect to the CyREST API. Default is http://localhost:1234 and the latest version of the CyREST API supported by this version of RCy3.

Details

Requires attribute mappings to be previously created, see mapVisualProperty.

Value

None

See Also

applyStyle, mapVisualProperty

Examples

 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(createNetworkFromDataFrames)

#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
createVisualStyle(style.name, defaults, list(nodeLabels,nodeFills,arrowShapes,edgeWidth))

#finsh by applying the style
setVisualStyle(style.name)

RCy3 documentation built on Nov. 21, 2020, 2 a.m.