LCApp: LCApp class

Description Methods


Object of this class represents the entire linked-charts app. It stores all charts, client sessions and local variables. You can create and manage interactive apps solely by creating new instances of this class and utilizing their methods. There are no limitations on the number of apps simultaneously running in one R session. However, it is also possible to create and manage app via the wrapper functions provided in this package. In this case an instance of LCApp class is initialized and stored in the package's namespace. Therefore, only one app can be active simultaneously. You can always retrieve the active app with the getPage function. The LCApp class inherits from the App class of the jrc package.



Removes a chart with the given ID from the app. See also removeChart.

removeLayer(chartId, layerId)

Removes a layer from a chart by their IDs. See also removeLayer.

setProperties(data, chartId, layerId = NULL)

Changes or sets properties for a given chart and layer. For more information, please, check setProperties.

updateCharts(chartId = NULL, layerId = NULL, updateOnly = NULL, sessionId = NULL)

Updates charts or specific layers for one or multiple users. For more information on the arguments, please, check updateCharts.

chartEvent(d, chartId, layerId = "main", event, sessionId = NULL)

Triggers a reaction to mouse event on a web page. Generally, this method is not supposed to be called explicitly. It is called internally each time, client clicks or hovers over an interactive chart element. However, experienced users can use this method to simulate mouse events on the R side. For more information on the arguments, please, check chartEvent.


Prints a list of all existing charts and their layers. See also listCharts.

getMarked(chartId = NULL, layerId = NULL, sessionId = NULL)

Returns a vector of indices of all currently marked elements of a certain chart and layer and from a given client. For more information, please, check getMarked.

mark(elements, chartId = NULL, layerId = NULL, preventEvent = TRUE, sessionId = NULL)

Marks elements of a given chart and layer on one of the currently opened web pages. Please, check mark for more information on the arguments.

setChart(chartType, data, ..., place = NULL, chartId = NULL, layerId = NULL, [...])

Adds a new chart (or replaces an existing one) to the app. This is the main method of the package, that allows to define any chart and all its properties. There are multiple wrappers for this method - one for each type of chart. Here is a full list:

  • lc_scatter

  • lc_beeswarm

  • lc_line

  • lc_path

  • lc_ribbon

  • lc_bars

  • lc_hist

  • lc_dens

  • lc_heatmap

  • lc_colourSlider

  • lc_abLine

  • lc_vLine

  • lc_html

  • lc_input

You can check the wrapper functions for information about arguments and available properties. Compared to them, this method gets additional argument chartType, which is always the same as the second part of the name of a corresponding wrapper function (lc_'chartType'). In all other aspects, wrapper functions and the setChart method are the same.

new(layout = NULL, beforeLoad = function(s) {}, afterLoad = function(s) {}, ...)

Creates new instance of class LCApp. Most of its arguments are inherited from method new of class App from the jrc package. There are only three arguments specific for the LCApp class. layout sets a default layout for each new webpage (currently only tables of arbitrary size are supported). beforeLoad and afterLoad replace onStart from the App class. For more information, please, check openPage.

rlc documentation built on Jan. 5, 2022, 1:11 a.m.

Related to LCApp in rlc...