mapVisualProperty {RCy3} | R Documentation

## Creates a mapping between an attribute and a visual property

### Description

Generates the appropriate data structure for the "mapping" parameter in updateStyleMapping.

### Usage

    mapVisualProperty(
      visual.prop,
      table.column,
      mapping.type,
      table.column.values,
      visual.prop.values,
      network = NULL,
      base.url = .defaultBaseUrl
    )

### Arguments

`visual.prop` | (char) name of visual property to map
`table.column` | (char) name of table column to map
`mapping.type` | (char) continuous, discrete or passthrough (c,d,p)
`table.column.values` | (list) list of values paired with visual.prop.values; skip for passthrough mapping
`visual.prop.values` | (list) list of values paired with table.column.values; skip for passthrough mapping
`network` | (optional) Name or SUID of the network. Default is the "current" network active in Cytoscape.
`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

The paired list of values must be of the same length or mapping will fail. For gradient mapping, you may include two additional visual.prop.values in the first and last positions to map respectively to values less than and greater than those specified in table.column.values. Mapping will also fail if the data type of table.column.values does not match that of the existing table.column. Note that all imported numeric data are stored as Integers or Doubles in Cytosacpe tables; and character or mixed data are stored as Strings.

### Value

(network=network, base.url=base.url) ready to convert into JSON by style mapping operations

### List of visual properties

Node Border Stroke | Edge Bend | Network Background Paint
Node Border Paint | Edge Curved | Network Center X Location
Node Border Transparency | Edge Label | Network Center Y Location
Node Border Width | Edge Label Color | Network Center Z Location
Node CustomGraphics 1-9 | Edge Label Font Face | Network Depth
Node CustomGraphics Position 1-9 | Edge Label Font Size | Network Edge Selection
Node CustomGraphics Size 1-9 | Edge Label Transparency | Network Height
Node CustomPaint 1-9 | Edge Label Width | Network Node Selection
Node Depth | Edge Line Type | Network Scale Factor
Node Fill Color | Edge Paint | Network Size
Node Height | Edge Selected | Network Title
Node Label | Edge Selected Paint | Network Width
Node Label Color | Edge Source Arrow Selected Paint |
Node Label Font Face | Edge Source Arrow Shape |
Node Label Font Size | Edge Source Arrow Size |
Node Label Position | Edge Source Arrow Unselected Paint |
Node Label Transparency | Edge Stroke Selected Paint |
Node Label Width | Edge Stroke Unselected Paint |
Node Network Image Visible | Edge Target Arrow Selected Paint |
Node Paint | Edge Target Arrow Shape |
Node Selected | Edge Target Arrow Size |
Node Selected Paint | Edge Target Arrow Unselected Paint |
Node Shape | Edge Tooltip |
Node Size | Edge Transparency |
Node Tooltip | Edge Unselected Paint |
Node Transparency | Edge Visible |
Node Visible | Edge Visual Property |
Node Width | Edge Width |
Node X Location |  |
Node Y Location |  |
Node Z Location |  |

### See Also

updateStyleMapping getVisualPropertyNames

### Examples

    mapVisualProperty('node fill color','score','c',c(-4.0,0.0,9.0),c('#99CCFF','#FFFFFF','#FF7777'))
    mapVisualProperty('node shape','type','d',c('protein','metabolite'),c('ellipse','rectangle'))
    mapVisualProperty('node label','alias','p')

[Package RCy3 version 2.6.3 Index]