crosstool: Create a generic HTML crosstalk user interface endpoint.

Description Usage Arguments Value Receiver-specific options Transmitter-specific options Transceiver-specific options Note Examples

View source: R/crosstool.r

Description

Use crosstool to define generic HTML elements with limited crosstalk functionality. These elements can be used to control crosstalk-enabled applications and to transcode key values across multiple crosstalk groups.

Usage

1
2
crosstool(data, class = c("transmitter", "receiver", "transceiver"),
  html = "", value = "value", ..., width = NULL, height = NULL)

Arguments

data

A crosstalk SharedData object. Currently only used for the crosstalk group.

class

The transmitter and receiever widgets use limited uni-directional crosstalk communication. Transceiver widgets are more like normal crosstalk widgets.

html

A valid HTML element string.

value

The HTML object's I/O field name, for instance 'value' for some 'input' HTML elements.

...

Additional arguments passed directly to the JavaScript code (see the notes).

width

Widget width.

height

Widget height.

Value

An HTML widget object.

Receiver-specific options

Transmitter-specific options

Note that the HTML object values specified by the value argument are transmitted.

Transceiver-specific options

Note

Crosstool behaves differently than many other crosstalk widgets. They generally communicate uni-directionally and only on a single crosstalk channel (Filter, Select) at a time to other widgets, optionally receiving from and sending to different crosstalk groups. They may transmit raw HTML element values, say from sliders or drop-down menus. They can transcode crosstalk keys through optional lookup vectors.

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
31
32
33
34
## Not run: 
# Debug/display crosstalk filter key state:
library(crosstalk)
library(crosstool)
library(htmltools)
library(d3scatter) # devtools::install_github("jcheng5/d3scatter")

x = iris[sample(150, 50), ]
rownames(x) = NULL
x$key = state.name
sd = SharedData$new(x, key=~key)
d1 = d3scatter(sd, x=~Petal.Length, y=~Petal.Width, color=~Species, width="100%")
d2 = d3scatter(sd, x=~Sepal.Length, y=~Sepal.Width, color=~Species, width="100%")

rx = crosstool(sd, "receiver",  html="<span style='font-size:14pt;'/>", value="innerText", width="100%")
bscols(d1, d2, rx, widths=c(4,4,4))


# Use 'transmitter' to set initial selection state:
x = iris[sample(150, 50), ]
rownames(x) = NULL
x$key = state.name
sd = SharedData$new(x, key=~key)
d1 = d3scatter(sd, x=~Petal.Length, y=~Petal.Width, color=~Species, width="100%")
d2 = d3scatter(sd, x=~Sepal.Length, y=~Sepal.Width, color=~Species, width="100%")

rx = crosstool(sd, "receiver",  html="<span style='font-size:14pt;'/>", value="innerText", width="100%")

Make an initial random selection and use the 'init' option
i = sample(state.name, 10)
tx = crosstool(sd, "transmitter", init=i)
bscols(d1, d2, rx, tx, widths=c(4,4,4,0))

## End(Not run)

bwlewis/uiwidgets documentation built on July 13, 2017, 2:20 p.m.