chartEvent {rlc} | R Documentation |
Trigger an event
Description
This function is called whenever any interactive element of a chart is activated by clicking, marking,
hovering, etc. In turn,
it calls a corresponding callback function, if any has been specified. This function
is meant to be used internally. However, an experienced user can still use it to simulate mouse events,
even those triggered by non-existing elements. This function is a wrapper around method
chartEvent
of class LCApp
.
Usage
chartEvent(d, chartId, layerId = "main", event, sessionId = .id, app = .app)
Arguments
d |
Value that is used to identify an interactive element or its state.
A single numeric index for a point or a line, vector or row and column indices
of a cell for a heatmap, value for an input block (please, check |
chartId |
ID of the chart. |
layerId |
ID of the layer. You can print IDs of all charts and their layers with |
event |
Type of event. Must be one of |
sessionId |
ID of the session (opened client page) that triggered the event. The default value uses a local session
variable. This must be a single session ID. You can get a list of IDs of all currently active with the
method |
app |
Object of class |
Examples
## Not run: x <- rnorm(50)
lc_scatter(x = x, y = 2*x + rnorm(50, 0.1), on_click = function(d) print(d))
chartEvent(51, "Chart1", "Layer1", "click")
## End(Not run)