methods-AmObject: AmObject methods

Description Usage Arguments Details Value Examples

Description

Methods for inherited classes.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
addListener(.Object, name, expression)

## S4 method for signature 'AmObject,character,character'
addListener(.Object, name, expression)

resetProperties(.Object, ...)

## S4 method for signature 'AmObject'
resetProperties(.Object, ...)

setProperties(.Object, list_prop, ...)

## S4 method for signature 'AmObject'
setProperties(.Object, list_prop, ...)

Arguments

.Object

AmObject.

name

character, name of the listener.

expression

character, associated function event.

...

other properties

list_prop

(Optional) list containing properties to set. The former properties will be overwritten.

Details

Former properties will be overwritten.

Former properties will be overwritten.

Value

The updated object.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
addListener(.Object = amPieChart(),
            name = "clickSlice" ,
            expression = "function(event){ alert('ok !'); }")
            
addListener(.Object = amLegend(),
            name = "select",
            expression = paste0("function onSelect (properties) {",
                                "alert('selected nodes: ' + properties.nodes);",
                                "}"))
library(pipeR)
amPlot(runif(10)) %>>% resetProperties("categoryAxis") %>>% print(withDetail = FALSE)
library(pipeR)
# either you can set a list
ls <- list(categoryAxis = list(gridPosition = "start"), fontSize = 15)
amSerialChart() %>>% setProperties(list = ls)  %>>% print()

# or you can set one or more properties
amPieChart() %>>% setProperties(handDrawn = TRUE, fontSize = 15) %>>% print()

# overwrite a property
amPieChart() %>>%  setProperties(fontSize = 15) %>>%  setProperties(fontSize = 12) %>>% print()

# Carefull if you try to set a property which is a slot...
# in that case, use the setter methods 'setXX' or 'addXX' which check the validity
## Not run: 
amPieChart() 

## End(Not run)

amPieChart() %>>% setExport()

rAmCharts documentation built on Dec. 6, 2019, 5:11 p.m.