EpivizChartMgr-class: Class providing chart manager for epiviz app
Description
Class providing chart manager for epiviz app
Methods
add_chart(chart_object, send_request = TRUE)
- Add a chart to the chart manager.
- chart_object
- an object of class
EpivizChart
- send_request
- send request to app through websocket
get_chart_colors(chart_object_or_id)
- List colors used in a specific chart object.
- chart_object_or_id
- An object of class
EpivizChart
or a
string indicating the chart's id assigned by chart manager
get_chart_settings(chart_object_or_id)
- List chart settings for a specific chart object.
- chart_object_or_id
- An object of class
EpivizChart
or a
string indicating the chart's id assigned by chart manager
is_server_closed()
- Returns
TRUE
if underlying server is closed.
See is_closed
method in class EpivizServer
. list_chart_type_colors(chart_type)
- List colors currently used in given chart type
list_chart_type_settings(chart_type)
- List available settings for a specific chart type.
- chart_type
- the name for a chart type in R (e.g., 'BlocksTrack', 'StackedLineTrack')
list_chart_types(col_width = 80)
- List charts types registered in epivizr with their default settings and colors.
Returns a
data.frame
listing available chart types and a summary of the
settings that can be modified.
- col_width
- Maximum length of settings list displayed.
list_charts()
- Return
data.frame
describing charts loaded by chart manager num_charts()
- Return the number of charts currently loaded through manager.
plot(measurement_object, settings = NULL, colors = NULL,
send_request = TRUE)
- Visualize data in an
EpivizData
object using its default chart type.
The method get_default_chart_type
in class EpivizData
is used
to determine which chart type is used.
- measurement_object
- an object of class
EpivizData
- settings
- list of settings to use in chart (uses default chart settings if NULL)
- colors
- character vector of HEX colors to use in chart (uses default chart colors if NULL)
print_chart(chart_object_or_id, file_name = NULL, file_type = c("pdf",
"png"))
- Print specific chart to file.
- chart_object_or_id
- An object of class
EpivizChart
or a
string indicating the chart's id assigned by chart manager. - file_name
- Name of file to print to.
- file_type
- Type of file to print. One of
pdf
or png
.
print_chart_info(chart_object_or_id)
- Print settings and colors used in a specific chart object.
- chart_object_or_id
- An object of class
EpivizChart
or a
string indicating the chart's id assigned by chart manager
print_chart_type_info(chart_type)
- Print settings and color information for a given chart type
- chart_type
- the name for a chart type in R (e.g., 'BlocksTrack', 'StackedLineTrack')
register_chart_type(chart_type,
js_chart_type = paste0("epiviz.plugins.charts.", chart_type),
js_chart_settings = list(), js_chart_colors = character())
- Register a chart type name to a JavaScript chart type in the epiviz app.
- chart_type
- the name to use for chart type in R (e.g., 'BlocksTrack')
- js_chart_type
- the full JavaScript class name of the corresponding chart type
(e.g. 'epiviz.plugins.charts.BlocksTrack'). If missing it is taken from the
chart_type
argument - js_chart_settings
- custom settings that can be applied to this chart type in JS.
- js_chart_colors
- default color palette applied to this chart type in JS.
rm_all_charts()
- Remove all charts loaded by chart manager.
rm_chart(chart_object_or_id)
- Remove chart from chart manager.
- chart_object_or_id
- An object of class
EpivizChart
or a
string indicating the chart's id assigned by chart manager
set_chart_settings(chart_object_or_id, settings = NULL, colors = NULL)
- Apply custom chart settings or colors to a chart object.
- chart_object_or_id
- An object of class
EpivizChart
or a
string indicating the chart's id assigned by chart manager - settings
- a list of settings to apply to the chart
- colors
- a list of (HEX code) colors to use in the chart
visualize(chart_type, measurements = NULL, datasource = NULL,
settings = NULL, colors = NULL, send_request = TRUE, ...)
- Visualize data use the given chart type. One of arguments
measurements
or datasource
must be non-NULL
. If measurements
is NULL
, the get_measurements
method in class EpivizData
is used to decide which measurements are used in the chart
- chart_type
- a chart type registered using the
register_chart_type
method - measurements
- a list of
EpivizMeasurement
objects
describing measurements to include in the chart - datasource
- an object of class
EpivizData
, all available
measurements from datasource are used as appropriate