| Title: | Schema-Driven Interactive Charts, Network Graphs, and Maps |
|---|---|
| Description: | Create interactive statistical charts, network graphs and choropleth maps. Charts are rendered with the 'ECharts' 'JavaScript' library, networks with 'Sigma.js' and maps with 'MapLibre GL JS'. A high-level interface of plotting functions builds a complete visualization from data in a single call, while a low-level interface gives full control over every option. Both are based on the same type-checked and validated 'S7' configuration objects. Configurations can be saved to and restored from 'JSON' files, and each chart type has a published 'JSON Schema' that other interfaces can implement. Visualizations display as 'htmlwidgets' that automatically adapt to light and dark themes, work in 'R Markdown', 'Quarto' and 'shiny', and can be exported to Scalable Vector Graphics (SVG) files using 'Node.js'. |
| Authors: | E.D. Gennatas [aut, cre, cph] (ORCID: <https://orcid.org/0000-0001-9280-3609>) |
| Maintainer: | E.D. Gennatas <[email protected]> |
| License: | BSD_3_clause + file LICENSE |
| Version: | 0.5.3 |
| Built: | 2026-10-13 23:51:57 UTC |
| Source: | https://github.com/cran/rtemis.draw |
Create interactive statistical charts, network graphs and choropleth maps. Charts are rendered with 'ECharts', networks with 'Sigma.js' and maps with 'MapLibre GL JS'. Every visualization is an 'htmlwidgets' widget that automatically follows the light or dark theme of wherever it is shown, and can be exported to a Scalable Vector Graphics (SVG) file.
Distributions and comparisons: draw_scatter(), draw_line(),
draw_bar(), draw_boxplot(), draw_violin(), draw_histogram(),
draw_density(), draw_pie(), draw_heatmap(), draw_sankey().
Time: draw_ts(), draw_xt(), draw_gantt(), draw_spectrogram().
Three dimensions: draw_scatter3d(), with draw_add_surface().
Model evaluation: draw_roc(), draw_calibration(), draw_confusion(),
draw_fit(), draw_varimp(), draw_metric(), draw_learning_curve().
Time-to-event: draw_survival(), draw_survfit().
Significance testing: draw_volcano(), draw_manhattan(),
draw_pvals().
Sequences: draw_protein(), draw_a3().
Add fitted lines, reference lines, bands and labels with draw_add_fit()
and draw_annotate(), and arrange several charts into one figure with
draw_panels().
draw_network() draws a network from an adjacency or correlation matrix, or
from an edge list, with 'Sigma.js'.
draw_choropleth() colors countries, U.S. states or U.S. counties by a
value, with 'MapLibre GL JS'. Boundaries are bundled with the package, so
maps need no network access.
Each draw_*() function builds a validated 'S7' configuration object,
e.g. from setup_ScatterConfig(), and renders it. Configurations can be
written to and read from 'JSON' files with write_chart_config() and
read_chart_config(), and chart_schema() returns the 'JSON' Schema that
such files validate against. draw() renders a complete low-level option
object directly.
By default, visualizations detect whether they are shown on a light or dark
background in 'RStudio', 'VS Code', 'Quarto' and the browser, style
themselves to match, and switch when the viewer changes theme, e.g. with the
'Quarto' light/dark toggle or the operating system setting. Networks and
maps keep their current pan and zoom when they switch. Pass theme_light()
or theme_dark() as theme to fix a theme.
Visualizations display in the 'RStudio' and 'VS Code' viewers, 'R Markdown'
and 'Quarto' documents, and 'shiny' apps (see drawOutput() and
renderDraw()). All 'JavaScript' is bundled with the package, so HTML
output works offline. save_drawing() exports a visualization to an SVG
file using 'Node.js'.
Maintainer: E.D. Gennatas [email protected] (ORCID) [copyright holder]
Authors:
E.D. Gennatas [email protected] (ORCID) [copyright holder]
Useful links:
Report bugs at https://github.com/rtemis-org/draw/issues
A serializable description of an A3 protein diagram. Build one with
setup_A3Config() rather than calling this constructor directly.
A3Config( dat_path = NULL, title = NULL, origin = NULL, writer = NULL, n_per_row = 21L, position_every = 10L, ptm_placement = "radial", zoom = TRUE, residue_spacing = 0.3, marker_size = 28, font_size = 18, line_width = 2, show_markers = TRUE, show_labels = TRUE, region_opacity = 0.3, residue_fill = NULL, residue_stroke = NULL, label_color = NULL, pos_label_color = NULL, variant_color = NULL, disease_variant_color = NULL )A3Config( dat_path = NULL, title = NULL, origin = NULL, writer = NULL, n_per_row = 21L, position_every = 10L, ptm_placement = "radial", zoom = TRUE, residue_spacing = 0.3, marker_size = 28, font_size = 18, line_width = 2, show_markers = TRUE, show_labels = TRUE, region_opacity = 0.3, residue_fill = NULL, residue_stroke = NULL, label_color = NULL, pos_label_color = NULL, variant_color = NULL, disease_variant_color = NULL )
dat_path |
Optional Character: Path to the data, read at draw time. The
serializable alternative to passing |
title |
Optional Character: Chart title. Declared here because it is the
one property every chart type has; |
origin |
Optional Named character {"user", "default", "derived"}: Where each value came from, one entry per settable property. Absent on an authored config; written by the interface that resolved it. |
writer |
Optional Named character: Which interface wrote the config, as
|
n_per_row |
Integer |
position_every |
Integer |
ptm_placement |
Character: How post-translational modifications are placed relative to the backbone. |
zoom |
Logical: Enable the zoom control. |
residue_spacing |
Numeric |
marker_size |
Numeric |
font_size |
Numeric |
line_width |
Numeric |
show_markers, show_labels
|
Logical: Whether to draw each. |
region_opacity |
Numeric |
residue_fill, residue_stroke
|
Optional Character: Residue marker colors. |
label_color, pos_label_color
|
Optional Character: Label colors. |
variant_color, disease_variant_color
|
Optional Character: Variant marker colors.
|
The bound data is an A3 object, created with rtemis.a3::create_A3().
A3Config object.
EDG
setup_A3Config(n_per_row = 30L)@typesetup_A3Config(n_per_row = 30L)@type
Portable, materialized annotation geometry. Corresponds to MarkLineOption, MarkAreaOption, and ScatterSeriesOption in ECharts src/component/marker and src/chart/scatter. Coordinates are data values (epoch milliseconds for time axes); categorical coordinates may be category names. Layers are independent of group legend selection.
AnnotationLayer( hline = NULL, vline = NULL, x = numeric(0), y = numeric(0), text = NULL, bands = list(), color = "#888888", line_type = "dashed", opacity = 0.15, x_axis = 0L, y_axis = 0L )AnnotationLayer( hline = NULL, vline = NULL, x = numeric(0), y = numeric(0), text = NULL, bands = list(), color = "#888888", line_type = "dashed", opacity = 0.15, x_axis = 0L, y_axis = 0L )
hline, vline
|
Numeric: Horizontal and vertical reference positions. |
x, y
|
Numeric or Character: Coordinates for text annotations. |
text |
Character: One label per coordinate pair. |
bands |
List: Numeric length-two x intervals to shade. |
color |
Character: Annotation color. |
line_type |
Character |
opacity |
Numeric |
x_axis, y_axis
|
Integer |
AnnotationLayer: Validated annotation geometry.
AnnotationLayer(hline = 0, text = "Peak", x = 2, y = 3)AnnotationLayer(hline = 0, text = "Peak", x = 2, y = 3)
Fill styling for areas (polygons, area under curves, etc.).
AreaStyle( color = NULL, opacity = NULL, origin = NULL, shadow_blur = NULL, shadow_color = NULL, shadow_offset_x = NULL, shadow_offset_y = NULL )AreaStyle( color = NULL, opacity = NULL, origin = NULL, shadow_blur = NULL, shadow_color = NULL, shadow_offset_x = NULL, shadow_offset_y = NULL )
color |
Optional Character: CSS fill color. |
opacity |
Optional Numeric |
origin |
Optional Character {"auto", "start", "end"} or Numeric: Area origin. |
shadow_blur |
Optional Numeric |
shadow_color |
Optional Character: Shadow color. |
shadow_offset_x |
Optional Numeric: Shadow horizontal offset. |
shadow_offset_y |
Optional Numeric: Shadow vertical offset. |
Corresponds to AreaStyleOption in src/util/types.ts (line 1169).
ECharts docs: https://echarts.apache.org/en/option.html#series-line.areaStyle
AreaStyle object.
AreaStyle(color = "#16a085", opacity = 0.3)AreaStyle(color = "#16a085", opacity = 0.3)
Configuration for a cartesian axis (xAxis or yAxis). Combines fields from
AxisBaseOptionCommon, NumericAxisBaseOptionCommon, CategoryAxisBaseOption,
ValueAxisBaseOption, LogAxisBaseOption, and TimeAxisBaseOption.
Axis( type = NULL, show = NULL, inverse = NULL, name = NULL, name_location = NULL, name_rotate = NULL, name_gap = NULL, name_text_style = NULL, silent = NULL, trigger_event = NULL, min = NULL, max = NULL, scale = NULL, split_number = NULL, interval = NULL, min_interval = NULL, max_interval = NULL, align_ticks = NULL, log_base = NULL, boundary_gap = NULL, data = NULL, axis_line = NULL, axis_tick = NULL, minor_tick = NULL, axis_label = NULL, split_line = NULL, minor_split_line = NULL, split_area = NULL, axis_pointer = NULL, position = NULL, grid_index = NULL )Axis( type = NULL, show = NULL, inverse = NULL, name = NULL, name_location = NULL, name_rotate = NULL, name_gap = NULL, name_text_style = NULL, silent = NULL, trigger_event = NULL, min = NULL, max = NULL, scale = NULL, split_number = NULL, interval = NULL, min_interval = NULL, max_interval = NULL, align_ticks = NULL, log_base = NULL, boundary_gap = NULL, data = NULL, axis_line = NULL, axis_tick = NULL, minor_tick = NULL, axis_label = NULL, split_line = NULL, minor_split_line = NULL, split_area = NULL, axis_pointer = NULL, position = NULL, grid_index = NULL )
type |
Optional Character {"value", "category", "time", "log"}: Axis type. |
show |
Optional Logical: Whether to show the axis. |
inverse |
Optional Logical: Whether to invert the axis. |
name |
Optional Character: Axis name. |
name_location |
Optional Character {"start", "middle", "center", "end"}: Axis name location. |
name_rotate |
Optional Numeric: Axis name rotation angle in degrees. |
name_gap |
Optional Numeric |
name_text_style |
Optional TextStyle: Axis name text style. |
silent |
Optional Logical: Whether the axis is silent. |
trigger_event |
Optional Logical: Whether the axis triggers events. |
min |
Optional Numeric or Character {"dataMin", "dataMax"}: Minimum axis value. |
max |
Optional Numeric or Character {"dataMin", "dataMax"}: Maximum axis value. |
scale |
Optional Logical: Whether a value axis should avoid forcing zero. |
split_number |
Optional Numeric |
interval |
Optional Numeric |
min_interval |
Optional Numeric |
max_interval |
Optional Numeric |
align_ticks |
Optional Logical: Whether to align ticks with the first axis. |
log_base |
Optional Numeric |
boundary_gap |
Optional Logical, Numeric, or Character: Gap at axis boundaries. Logical (category) or length-2 vector of numbers/strings (numeric axes). |
data |
Optional Vector: Category data. |
axis_line |
Optional AxisLine: Axis line configuration. |
axis_tick |
Optional AxisTick: Axis tick configuration. |
minor_tick |
Optional MinorTick: Minor tick configuration. |
axis_label |
Optional AxisLabel: Axis label configuration. |
split_line |
Optional SplitLine: Split line configuration. |
minor_split_line |
Optional MinorSplitLine: Minor split line configuration. |
split_area |
Optional SplitArea: Split area configuration. |
axis_pointer |
Optional list: Interactive mouse-following axis guide
( |
position |
Optional Character {"left", "right", "top", "bottom"}: Axis position.
For |
grid_index |
Optional Numeric |
Corresponds to AxisBaseOption in src/coord/axisCommonTypes.ts (line 376).
ECharts docs: https://echarts.apache.org/en/option.html#xAxis
Axis object.
Axis(type = "category", data = c("Mon", "Tue", "Wed"))Axis(type = "category", data = c("Mon", "Tue", "Wed"))
Configuration for axis labels. Combines label-specific positioning with text styling (flattened in to_list like LabelOption).
AxisLabel( show = NULL, inside = NULL, rotate = NULL, margin = NULL, formatter = NULL, show_min_label = NULL, show_max_label = NULL, hide_overlap = NULL, interval = NULL, text_style = NULL )AxisLabel( show = NULL, inside = NULL, rotate = NULL, margin = NULL, formatter = NULL, show_min_label = NULL, show_max_label = NULL, hide_overlap = NULL, interval = NULL, text_style = NULL )
show |
Optional Logical: Whether to show axis labels. |
inside |
Optional Logical: Whether labels are inside the grid. |
rotate |
Optional Numeric: Label rotation angle in degrees. |
margin |
Optional Numeric |
formatter |
Optional Character or function: Label formatter. |
show_min_label |
Optional Logical: Whether to show the label at the minimum end. |
show_max_label |
Optional Logical: Whether to show the label at the maximum end. |
hide_overlap |
Optional Logical: Whether to hide overlapping labels. |
interval |
Optional Numeric or Character {"auto"}: Label interval. |
text_style |
Optional TextStyle: Text appearance. |
Corresponds to AxisLabelBaseOption in src/coord/axisCommonTypes.ts (line 312).
ECharts docs: https://echarts.apache.org/en/option.html#xAxis.axisLabel
AxisLabel object.
AxisLabel(show = TRUE, rotate = 45, margin = 8)AxisLabel(show = TRUE, rotate = 45, margin = 8)
Configuration for the axis line itself.
AxisLine( show = NULL, on_zero = NULL, on_zero_axis_index = NULL, symbol = NULL, symbol_size = NULL, symbol_offset = NULL, line_style = NULL )AxisLine( show = NULL, on_zero = NULL, on_zero_axis_index = NULL, symbol = NULL, symbol_size = NULL, symbol_offset = NULL, line_style = NULL )
show |
Optional Logical or Character {"auto"}: Whether to show the axis line. |
on_zero |
Optional Logical: Whether the axis line is on the zero position of the other axis. |
on_zero_axis_index |
Optional Numeric |
symbol |
Optional Character: Arrow symbols at both ends. |
symbol_size |
Optional Numeric: Arrow symbol size. |
symbol_offset |
Optional Numeric or Character: Arrow symbol offset. |
line_style |
Optional LineStyle: Line styling. |
Corresponds to AxisLineOption in src/coord/axisCommonTypes.ts (line 231).
ECharts docs: https://echarts.apache.org/en/option.html#xAxis.axisLine
AxisLine object.
AxisLine(show = TRUE, line_style = LineStyle(color = "#888888"))AxisLine(show = TRUE, line_style = LineStyle(color = "#888888"))
Configuration for axis tick marks.
AxisTick( show = NULL, inside = NULL, length = NULL, align_with_label = NULL, line_style = NULL )AxisTick( show = NULL, inside = NULL, length = NULL, align_with_label = NULL, line_style = NULL )
show |
Optional Logical or Character {"auto"}: Whether to show ticks. |
inside |
Optional Logical: Whether ticks are inside the grid. |
length |
Optional Numeric |
align_with_label |
Optional Logical: Whether to align ticks with labels. |
line_style |
Optional LineStyle: Line styling. |
Corresponds to AxisTickOption in src/coord/axisCommonTypes.ts (line 244).
ECharts docs: https://echarts.apache.org/en/option.html#xAxis.axisTick
AxisTick object.
AxisTick(show = TRUE, length = 5, align_with_label = TRUE)AxisTick(show = TRUE, length = 5, align_with_label = TRUE)
A serializable description of a bar chart. Build one with
setup_BarConfig() rather than calling this constructor directly.
BarConfig( dat_path = NULL, title = NULL, origin = NULL, writer = NULL, legend_position = "top", legend_placement = "outside", x = NULL, y = NULL, order = "input", stack = FALSE, horizontal = FALSE, bar_width = NULL, palette = NULL, xlab = NULL, ylab = NULL, margin_top = NULL, margin_right = NULL, margin_bottom = NULL, margin_left = NULL )BarConfig( dat_path = NULL, title = NULL, origin = NULL, writer = NULL, legend_position = "top", legend_placement = "outside", x = NULL, y = NULL, order = "input", stack = FALSE, horizontal = FALSE, bar_width = NULL, palette = NULL, xlab = NULL, ylab = NULL, margin_top = NULL, margin_right = NULL, margin_bottom = NULL, margin_left = NULL )
dat_path |
Optional Character: Path to the data, read at draw time. The
serializable alternative to passing |
title |
Optional Character: Chart title. Declared here because it is the
one property every chart type has; |
origin |
Optional Named character {"user", "default", "derived"}: Where each value came from, one entry per settable property. Absent on an authored config; written by the interface that resolved it. |
writer |
Optional Named character: Which interface wrote the config, as
|
legend_position |
Character {"top", "bottom", "left", "right", "top-left", "top-right", "bottom-left", "bottom-right"}: Legend anchor. Top/bottom anchors use horizontal rows; left/right anchors use a vertical column. Corner anchors align within the top or bottom row. |
legend_placement |
Character {"outside", "inside"}: Relation to the plotting area. Outside placement reserves space for the complete legend; inside placement overlays the data. Neither setting adds a missing legend. |
x |
Optional Character: Column holding the categories. |
y |
Optional Character: Columns holding the values, one series each. |
order |
Character |
stack |
Logical: If TRUE, stack the series instead of grouping them. |
horizontal |
Logical: If TRUE, draw the bars horizontally. |
bar_width |
Optional Numeric |
palette |
Optional Character: Series colors, overriding the theme
palette for this chart. |
xlab, ylab
|
Optional Character: Axis labels. |
margin_top, margin_right, margin_bottom, margin_left
|
Optional Integer
|
x names the column holding the categories. y names one or more
columns, one series each – a single column draws one set of bars, several
draw a grouped or stacked chart with the column names as the series names.
That is the difference from ScatterConfig, whose x and y each name
exactly one column.
Fixed thickness maps to barWidth in ECharts' BaseBarSeriesOption
(src/chart/bar/BaseBarSeries.ts). It applies to either orientation.
BarConfig object.
EDG
setup_BarConfig(x = "cyl", y = "mpg")@typesetup_BarConfig(x = "cyl", y = "mpg")@type
Configuration for a bar chart series.
BarSeries( name = NULL, data = NULL, x_axis_index = NULL, y_axis_index = NULL, stack = NULL, silent = NULL, legend_hover_link = NULL, color = NULL, z_level = NULL, z = NULL, clip = NULL, bar_width = NULL, bar_max_width = NULL, bar_min_width = NULL, bar_min_height = NULL, bar_gap = NULL, bar_category_gap = NULL, round_cap = NULL, show_background = NULL, item_style = NULL, label = NULL )BarSeries( name = NULL, data = NULL, x_axis_index = NULL, y_axis_index = NULL, stack = NULL, silent = NULL, legend_hover_link = NULL, color = NULL, z_level = NULL, z = NULL, clip = NULL, bar_width = NULL, bar_max_width = NULL, bar_min_width = NULL, bar_min_height = NULL, bar_gap = NULL, bar_category_gap = NULL, round_cap = NULL, show_background = NULL, item_style = NULL, label = NULL )
name |
Optional Character: Series name for legend display. |
data |
Optional Vector or list: Data values. |
x_axis_index |
Optional Numeric |
y_axis_index |
Optional Numeric |
stack |
Optional Character: Stack group name. |
silent |
Optional Logical: Whether the series is silent. |
legend_hover_link |
Optional Logical: Whether to highlight related legends on hover. |
color |
Optional Character: Series color override. |
z_level |
Optional Numeric: Canvas layer index. |
z |
Optional Numeric: Front-back order within the same layer. |
clip |
Optional Logical: Whether to clip overflow. |
bar_width |
Optional Numeric or Character: Bar width. |
bar_max_width |
Optional Numeric or Character: Maximum bar width. |
bar_min_width |
Optional Numeric or Character: Minimum bar width. |
bar_min_height |
Optional Numeric |
bar_gap |
Optional Numeric or Character: Gap between bars in the same category. |
bar_category_gap |
Optional Numeric or Character: Gap between categories. |
round_cap |
Optional Logical: Whether to use a round cap. |
show_background |
Optional Logical: Whether to show the bar background. |
item_style |
Optional ItemStyle: Bar styling. |
label |
Optional LabelOption: Data-label configuration. |
Corresponds to BarSeriesOption in src/chart/bar/BarSeries.ts (line 68)
and BaseBarSeriesOption in src/chart/bar/BaseBarSeries.ts (line 38).
ECharts docs: https://echarts.apache.org/en/option.html#series-bar
BarSeries object.
BarSeries(name = "Counts", data = c(3, 7, 2))BarSeries(name = "Counts", data = c(3, 7, 2))
A serializable description of a boxplot. Build one with
setup_BoxplotConfig() rather than calling this constructor directly.
BoxplotConfig( dat_path = NULL, title = NULL, origin = NULL, writer = NULL, legend_position = "top", legend_placement = "outside", x = NULL, group = NULL, observation = NULL, order = "input", transform = "none", geometry = "box", bandwidth = NULL, adjust = 1, density_points = 128L, paired = FALSE, pair_alpha = 0.35, pair_width = 1, comparisons = NULL, quartiles = "linear", whisker = 1.5, boxpoints = "none", point_size = 5, point_alpha = 0.6, point_spread = 0.5, horizontal = FALSE, na_rm = TRUE, labels = NULL, palette = NULL, fill_alpha = 0.25, xlab = NULL, ylab = NULL, margin_top = NULL, margin_right = NULL, margin_bottom = NULL, margin_left = NULL )BoxplotConfig( dat_path = NULL, title = NULL, origin = NULL, writer = NULL, legend_position = "top", legend_placement = "outside", x = NULL, group = NULL, observation = NULL, order = "input", transform = "none", geometry = "box", bandwidth = NULL, adjust = 1, density_points = 128L, paired = FALSE, pair_alpha = 0.35, pair_width = 1, comparisons = NULL, quartiles = "linear", whisker = 1.5, boxpoints = "none", point_size = 5, point_alpha = 0.6, point_spread = 0.5, horizontal = FALSE, na_rm = TRUE, labels = NULL, palette = NULL, fill_alpha = 0.25, xlab = NULL, ylab = NULL, margin_top = NULL, margin_right = NULL, margin_bottom = NULL, margin_left = NULL )
dat_path |
Optional Character: Path to the data, read at draw time. The
serializable alternative to passing |
title |
Optional Character: Chart title. |
origin |
Optional Named character {"user", "default", "derived"}: Where each value came from, one entry per settable property. Absent on an authored config; written by the interface that resolved it. |
writer |
Optional Named character: Which interface wrote the config, as
|
legend_position |
Character {"top", "bottom", "left", "right", "top-left", "top-right", "bottom-left", "bottom-right"}: Legend anchor. Top/bottom anchors use horizontal rows; left/right anchors use a vertical column. Corner anchors align within the top or bottom row. |
legend_placement |
Character {"outside", "inside"}: Relation to the plotting area. Outside placement reserves space for the complete legend; inside placement overlays the data. Neither setting adds a missing legend. |
x |
Optional Character: Columns to summarize, one box each. |
group |
Optional Character: Column that splits each box by level. |
observation |
Optional Character: Column identifying observations for tooltips and pairing. |
order |
Character |
transform |
Character |
geometry |
Character {"box", "violin", "both"}: Distribution geometry. |
bandwidth |
Optional Numeric |
adjust |
Numeric |
density_points |
Integer |
paired |
Logical: Connect explicit IDs across adjacent categories. |
pair_alpha |
Numeric |
pair_width |
Numeric |
comparisons |
Optional Character: Name of a comparison data frame in the
bound data list. Its columns follow |
quartiles |
Character {"linear", "hinges"}: Quartile convention. |
whisker |
Numeric |
boxpoints |
Character {"none", "all", "outliers"}: Values to overlay. |
point_size |
Numeric |
point_alpha |
Numeric |
point_spread |
Numeric |
horizontal |
Logical: Draw the boxes horizontally. |
na_rm |
Logical: Remove missing values. FALSE rejects missing input. |
labels |
Optional Character: Box labels. |
palette |
Optional Character: Box colors, overriding the theme palette
for this chart. |
fill_alpha |
Numeric |
xlab, ylab
|
Optional Character: Axis labels. |
margin_top, margin_right, margin_bottom, margin_left
|
Optional Integer
|
x names one or more columns, one box each. group optionally names a
column that splits every box into one per level. Statistics and point
placement follow draw_boxplot(). Compiles to BoxplotSeriesOption and
CustomSeriesOption in ECharts src/chart/boxplot/BoxplotSeries.ts and
src/chart/custom/CustomSeries.ts.
BoxplotConfig object.
EDG
setup_BoxplotConfig(x = c("mpg", "hp"))@typesetup_BoxplotConfig(x = c("mpg", "hp"))@type
Configuration for a boxplot chart series.
BoxplotSeries( name = NULL, data = NULL, x_axis_index = NULL, y_axis_index = NULL, silent = NULL, legend_hover_link = NULL, color = NULL, z_level = NULL, z = NULL, layout = NULL, box_width = NULL, item_style = NULL, label = NULL )BoxplotSeries( name = NULL, data = NULL, x_axis_index = NULL, y_axis_index = NULL, silent = NULL, legend_hover_link = NULL, color = NULL, z_level = NULL, z = NULL, layout = NULL, box_width = NULL, item_style = NULL, label = NULL )
name |
Optional Character: Series name. |
data |
Optional list: Boxplot data. Each element is |
x_axis_index |
Optional Numeric |
y_axis_index |
Optional Numeric |
silent |
Optional Logical: Whether the series is silent. |
legend_hover_link |
Optional Logical: Whether to highlight related legends on hover. |
color |
Optional Character: Series color override. |
z_level |
Optional Numeric: Canvas layer index. |
z |
Optional Numeric: Front-back order within the same layer. |
layout |
Optional Character {"horizontal", "vertical"}: Layout orientation. |
box_width |
Optional Numeric or Character: Box-width range as a length-2 vector. |
item_style |
Optional ItemStyle: Boxplot styling. |
label |
Optional LabelOption: Data-label configuration. |
Corresponds to BoxplotSeriesOption in src/chart/boxplot/BoxplotSeries.ts (line 59).
ECharts docs: https://echarts.apache.org/en/option.html#series-boxplot
BoxplotSeries object.
# Each element is one box, given as its five-number summary. BoxplotSeries( name = "Distribution", data = list(c(850, 940, 960, 980, 1070), c(750, 800, 840, 890, 1020)) )# Each element is one box, given as its five-number summary. BoxplotSeries( name = "Distribution", data = list(c(850, 940, 960, 980, 1070), c(750, 800, 840, 890, 1020)) )
Bind binary observation records to a reliability diagram. Each row contains an observed outcome (zero or one) and its predicted probability, optionally grouped by sample or model. Configuration carries column names, not data.
CalibrationConfig( dat_path = NULL, title = NULL, origin = NULL, writer = NULL, legend_position = "top", legend_placement = "outside", observed = "observed", probability = "probability", group = NULL, n_bins = 10L, bin_method = "quantile", na_rm = TRUE, mode = "lines+markers", show_brier = TRUE, rug = TRUE, rug_size = 8, rug_opacity = 0.3, point_size = 7, line_width = 2, digits = 3L, diagonal = TRUE, diagonal_color = "#888888", palette = NULL, legend = TRUE, square = TRUE, xlab = "Mean predicted probability", ylab = "Observed proportion" )CalibrationConfig( dat_path = NULL, title = NULL, origin = NULL, writer = NULL, legend_position = "top", legend_placement = "outside", observed = "observed", probability = "probability", group = NULL, n_bins = 10L, bin_method = "quantile", na_rm = TRUE, mode = "lines+markers", show_brier = TRUE, rug = TRUE, rug_size = 8, rug_opacity = 0.3, point_size = 7, line_width = 2, digits = 3L, diagonal = TRUE, diagonal_color = "#888888", palette = NULL, legend = TRUE, square = TRUE, xlab = "Mean predicted probability", ylab = "Observed proportion" )
dat_path |
Optional Character: Path to the data, read at draw time. The
serializable alternative to passing |
title |
Optional Character: Chart title. |
origin |
Optional Named character {"user", "default", "derived"}: Where each value came from, one entry per settable property. Absent on an authored config; written by the interface that resolved it. |
writer |
Optional Named character: Which interface wrote the config, as
|
legend_position |
Character {"top", "bottom", "left", "right", "top-left", "top-right", "bottom-left", "bottom-right"}: Legend anchor. Top/bottom anchors use horizontal rows; left/right anchors use a vertical column. Corner anchors align within the top or bottom row. |
legend_placement |
Character {"outside", "inside"}: Relation to the plotting area. Outside placement reserves space for the complete legend; inside placement overlays the data. Neither setting adds a missing legend. |
observed |
Character: Column containing binary outcomes, zero or one. |
probability |
Character: Column containing predicted probabilities. |
group |
Optional Character: Column identifying samples or models. |
n_bins |
Integer |
bin_method |
Character {"quantile", "equidistant"}: Binning rule. |
na_rm |
Logical: Remove incomplete observation/probability pairs. |
mode |
Character {"lines", "markers", "lines+markers"}: Curve display. |
show_brier |
Logical: Include each sample's Brier score in its legend label. |
rug |
Logical: Show the distribution of individual probabilities. |
rug_size |
Numeric |
rug_opacity |
Numeric |
point_size |
Numeric |
line_width |
Numeric: Curve stroke width in pixels. |
digits |
Integer: Decimal places for AUC labels and tooltip values. |
diagonal |
Logical: Show an independent chance diagonal. |
diagonal_color |
Character: Chance-line color. |
palette |
Optional Character: Group colors; unset uses the chart theme. |
legend |
Logical: Show group labels and AUC summaries. |
square |
Logical: Keep the plotting grid square. |
xlab |
Character: Horizontal axis label. |
ylab |
Character: Vertical axis label. |
Compiles to LineSeriesOption in src/chart/line/LineSeries.ts and
ScatterSeriesOption in src/chart/scatter/ScatterSeries.ts.
ECharts docs: https://echarts.apache.org/en/option.html#series-line
A CalibrationConfig object.
Bins are computed independently within each group. Equidistant bins partition
the unit interval. Quantile bins use linear interpolation at positions
(n - 1) * p + 1 in the sorted probabilities (R quantile type 7).
Repeated boundaries are collapsed without splitting tied scores. Intervals
include their lower boundary and exclude their upper boundary, except that
the final interval includes its upper boundary. Constant probabilities form
one bin. Empty bins are omitted; lines join the remaining bin means.
Each point is the mean predicted probability and mean observed outcome in
its bin. The Brier score is the mean squared probability error across all
complete observations, before binning. It is not an average of bin errors.
Missing pairs are removed together when na_rm is true; invalid finite
ranges and infinite values are always rejected. A group with no complete
observations is rejected. The probability rug uses those same complete
observations and sits just inside the lower plotting edge.
Both axes span zero to one. Display precision does not round plotted values.
A one-bin curve remains visible as a point even in lines-only mode.
config <- setup_CalibrationConfig(n_bins = 2L, bin_method = "equidistant") draw(config, data = data.frame(observed = c(0, 1), probability = c(.2, .8)))config <- setup_CalibrationConfig(n_bins = 2L, bin_method = "equidistant") draw(config, data = data.frame(observed = c(0, 1), probability = c(.2, .8)))
Convert a chart config to a plain list
chart_config_to_list(config, complete = FALSE)chart_config_to_list(config, complete = FALSE)
config |
ChartConfig: The chart configuration. |
complete |
Logical: If TRUE, emit the output-config form: every property, plus provenance. |
Two forms, matching the two the schema publishes:
complete = FALSE (default) drops unset properties, so an authored config
stays as small as it was authored. type is always kept: it carries the
document's shape and is the one key the schema requires.
complete = TRUE keeps every property, unset ones included, so they
serialize as explicit nulls – and stamps the writer. A consumer of such
a document can read every key directly instead of reproducing this
package's defaults. Requires a full origin map; see write_chart_config().
Named list, ready for jsonlite::toJSON().
EDG
chart_config_to_list(setup_ScatterConfig(x = "wt", y = "mpg"))chart_config_to_list(setup_ScatterConfig(x = "wt", y = "mpg"))
The family's entry point: a document is a chart if it matches exactly one of
the leaf schemas, selected by its type.
chart_dispatcher_schema(classes, id, leaf_ids, title, description)chart_dispatcher_schema(classes, id, leaf_ids, title, description)
classes |
List: ChartConfig subclasses. |
id |
Character: The dispatcher's |
leaf_ids |
Character: |
title |
Character: Human-readable schema title. |
description |
Character: What the family is. |
Named list: The JSON Schema, ready for jsonlite::toJSON().
EDG
schema <- chart_dispatcher_schema( classes = list(ScatterConfig, BarConfig), id = "https://schemas.rtemis.org/draw/chart.schema.json", leaf_ids = c( "https://schemas.rtemis.org/draw/scatter.schema.json", "https://schemas.rtemis.org/draw/bar.schema.json" ), title = "Chart", description = "Any rtemis.draw chart." ) schema[["properties"]][["type"]][["enum"]]schema <- chart_dispatcher_schema( classes = list(ScatterConfig, BarConfig), id = "https://schemas.rtemis.org/draw/chart.schema.json", leaf_ids = c( "https://schemas.rtemis.org/draw/scatter.schema.json", "https://schemas.rtemis.org/draw/bar.schema.json" ), title = "Chart", description = "Any rtemis.draw chart." ) schema[["properties"]][["type"]][["enum"]]
Maps each chart type to the class that models it and the setup_* that
builds one. Read at run time by read_chart_config(), and at generation time
by data-raw/generate_schemas.R, so the two cannot disagree about which
chart types exist.
chart_registry()chart_registry()
Named list, one entry per chart type, each with cls and setup.
EDG
names(chart_registry())names(chart_registry())
Emits the schema for one ChartConfig subclass: every property it declares
or inherits, typed from its PropertySpec, plus a constant for the type
discriminator. The result is self-contained – it validates a chart document
on its own, without the family dispatcher.
chart_schema(cls, id, title, description, complete = FALSE)chart_schema(cls, id, title, description, complete = FALSE)
cls |
S7 class: A ChartConfig subclass. |
id |
Character: The schema's |
title |
Character: Human-readable schema title. |
description |
Character: What this chart is. |
complete |
Logical: If TRUE, emit the output-config kind, requiring every property. |
Two kinds, differing only in what they require:
complete = FALSE (an input config) requires only type. The author
sets a subset and the interface fills in the rest.
complete = TRUE (an output config) requires every property, so a
document that claims to be complete can be checked rather than trusted. The
chart's own properties may still be null – "this chart has no title" is a
fact worth recording – but the provenance maps may not: a document that
cannot say where its values came from is not complete, whatever it claims.
Neither emits a default: what an interface fills in is not a fact about
the document. Shared structural class rules are emitted in allOf, including
inherited rules. Input schemas allow omitted values to be resolved by an
interface; record schemas require every value. Numeric ordering, bound-column
contents, and statistical/data-dependent checks still run during construction
or compilation and cannot be inferred from JSON Schema validation alone.
Named list: The JSON Schema, ready for jsonlite::toJSON().
EDG
schema <- chart_schema( ScatterConfig, id = "https://schema.rtemis.org/chart/scatter/v1/schema.json", title = "rtemis ScatterConfig", description = "Scatter chart." ) names(schema[["properties"]])schema <- chart_schema( ScatterConfig, id = "https://schema.rtemis.org/chart/scatter/v1/schema.json", title = "rtemis ScatterConfig", description = "Scatter chart." ) names(schema[["properties"]])
Abstract base for every chart config. Subclasses override type with a
constant, which is the discriminator the published schema dispatches on.
ChartConfig( type = NULL, dat_path = NULL, title = NULL, origin = NULL, writer = NULL )ChartConfig( type = NULL, dat_path = NULL, title = NULL, origin = NULL, writer = NULL )
type |
Character: Chart type. Set by each subclass, not by the user. |
dat_path |
Optional Character: Path to the data, read at draw time. The
serializable alternative to passing |
title |
Optional Character: Chart title. Declared here because it is the
one property every chart type has; |
origin |
Optional Named character {"user", "default", "derived"}: Where each value came from, one entry per settable property. Absent on an authored config; written by the interface that resolved it. |
writer |
Optional Named character: Which interface wrote the config, as
|
ChartConfig object.
EDG
# ChartConfig is abstract: build one of its subclasses. config <- setup_ScatterConfig(x = "wt", y = "mpg") S7::S7_inherits(config, ChartConfig)# ChartConfig is abstract: build one of its subclasses. config <- setup_ScatterConfig(x = "wt", y = "mpg") S7::S7_inherits(config, ChartConfig)
A serializable description of a choropleth map. Build one with
setup_ChoroplethConfig() rather than calling this constructor directly.
ChoroplethConfig( dat_path = NULL, title = NULL, origin = NULL, writer = NULL, location = NULL, value = NULL, tooltip = NULL, resolution = "country", classification = "quantile", num_classes = 5, colormap = "blues", opacity = 1, show_boundaries = TRUE, outline_width = 0.2, show_legend = TRUE, legend_position = "bottom-right", tooltip_position = "top-right", value_label = NULL )ChoroplethConfig( dat_path = NULL, title = NULL, origin = NULL, writer = NULL, location = NULL, value = NULL, tooltip = NULL, resolution = "country", classification = "quantile", num_classes = 5, colormap = "blues", opacity = 1, show_boundaries = TRUE, outline_width = 0.2, show_legend = TRUE, legend_position = "bottom-right", tooltip_position = "top-right", value_label = NULL )
dat_path |
Optional Character: Path to the data, read at draw time. The
serializable alternative to passing |
title |
Optional Character: Chart title. Declared here because it is the
one property every chart type has; |
origin |
Optional Named character {"user", "default", "derived"}: Where each value came from, one entry per settable property. Absent on an authored config; written by the interface that resolved it. |
writer |
Optional Named character: Which interface wrote the config, as
|
location |
Optional Character: Column holding the region identifiers. |
value |
Optional Character: Column holding the value to shade by. |
tooltip |
Optional Character: Column holding per-region tooltip text. |
resolution |
Character {"country", "state", "county"}: Which boundary set the locations refer to. |
classification |
Character {"quantile", "equal", "jenks"}: How values are binned into classes. |
num_classes |
Numeric |
colormap |
Character: Continuous color scheme for the classes. |
opacity |
Numeric |
show_boundaries, show_legend
|
Logical: Whether to draw each. |
outline_width |
Numeric |
legend_position, tooltip_position
|
Character: Corner each overlay is anchored to. |
value_label |
Optional Character: Label for the value in the legend and
tooltip. |
ChoroplethConfig object.
EDG
setup_ChoroplethConfig(location = "st", value = "v")@typesetup_ChoroplethConfig(location = "st", value = "v")@type
Turns a ChartConfig into the backend option object draw() renders –
an EChartsOption for ECharts charts. This is where a config's column names
are resolved against actual data.
compile(config, data = NULL, ...)compile(config, data = NULL, ...)
config |
ChartConfig: The chart configuration. |
data |
Optional Data frame or named list: The data to plot. When |
... |
Passed to methods. |
The generic does the two steps every chart needs before its own translation
can start, so that no method can forget one: it materializes the data (from
data, or from the config's dat_path) and resolve()s the config against
it. Methods therefore always receive a resolved config and non-NULL
data, and are pure translation.
Render option object, e.g. EChartsOption.
EDG
config <- setup_ScatterConfig(x = "wt", y = "mpg") option <- compile(config, data = mtcars) option@x_axis@nameconfig <- setup_ScatterConfig(x = "wt", y = "mpg") option <- compile(config, data = mtcars) option@x_axis@name
Retains missing-label frequencies so omission is visible after serialization. Matrix dimnames carry class identity; columns are matched by name, never by an assumed diagonal position. No model dependency is needed for data inputs.
confusion_input(x, y = NULL, classes = NULL)confusion_input(x, y = NULL, classes = NULL)
x |
Matrix, table, data frame, list of matrices, or vector: Counts or labels. |
y |
Optional vector: Predicted labels paired with reference labels in x. |
classes |
Optional Character vector: Explicit class order. |
Data frame with reference, predicted, n, and optionally panel columns.
confusion_input(factor(c("yes", "no")), factor(c("yes", "yes")))confusion_input(factor(c("yes", "no")), factor(c("yes", "yes")))
Portable confusion counts with reference rows and predicted columns.
Data consists of long records with class labels and a frequency, optionally
grouped into panels. Missing class labels represent omitted pairs; absent
class combinations have zero frequency. All panels use the same class order.
Compiles to HeatmapSeriesOption in src/chart/heatmap/HeatmapSeries.ts,
GridOption in src/coord/cartesian/GridModel.ts, and continuous visual maps.
to_list() emits semantic config keys; compile() emits ECharts options.
draw() fits square count cells with aligned marginal summaries to the
available canvas. Missing-pair omissions are reported in the console.
The cell counts show included observations without a separate sample-size label. Color fades and
marginal backgrounds follow the active theme unless explicitly overridden.
ConfusionConfig( dat_path = NULL, title = NULL, origin = NULL, writer = NULL, reference = "reference", predicted = "predicted", count = "n", panel = NULL, classes = NULL, show_metrics = TRUE, digits = 2L, ncol = 2L, correct_color = "#0F6A66", incorrect_color = "#BE2E5F", low_color = NULL, summary_color = NULL, font_size = 12, xlab = "Predicted", ylab = "Reference" )ConfusionConfig( dat_path = NULL, title = NULL, origin = NULL, writer = NULL, reference = "reference", predicted = "predicted", count = "n", panel = NULL, classes = NULL, show_metrics = TRUE, digits = 2L, ncol = 2L, correct_color = "#0F6A66", incorrect_color = "#BE2E5F", low_color = NULL, summary_color = NULL, font_size = 12, xlab = "Predicted", ylab = "Reference" )
dat_path |
Optional Character: Path to the data, read at draw time. The
serializable alternative to passing |
title |
Optional Character: Chart title. Declared here because it is the
one property every chart type has; |
origin |
Optional Named character {"user", "default", "derived"}: Where each value came from, one entry per settable property. Absent on an authored config; written by the interface that resolved it. |
writer |
Optional Named character: Which interface wrote the config, as
|
reference |
Character: Column containing reference class labels. |
predicted |
Character: Column containing predicted class labels. |
count |
Character: Column containing nonnegative integer frequencies. |
panel |
Optional Character: Optional panel-label column; unset draws one matrix. |
classes |
Optional Character vector: Ordered class labels shared by every panel; unset preserves first appearance. |
show_metrics |
Logical: Show per-class rates, accuracy, and balanced accuracy. |
digits |
Integer: Decimal places for rates in cells and hover text. |
ncol |
Integer: Maximum number of panels per row. |
correct_color |
Character: Six-digit hex color at unit fraction for correct predictions. |
incorrect_color |
Character: Six-digit hex color at unit fraction for incorrect predictions. |
low_color |
Optional Character: Six-digit hex color at zero row fraction; unset uses the active theme background. |
summary_color |
Optional Character: Six-digit hex background for metric cells; unset uses a faint neutral tint of the active theme background. |
font_size |
Numeric: Preferred cell-label font size in pixels. Constrained surfaces reduce text to fit, down to 8 pixels. Long class labels wrap and column labels rotate when needed. Increase figure dimensions if labels and metrics cannot fit without overlap. |
xlab |
Character: Predicted-class axis label. |
ylab |
Character: Reference-class axis label. |
A ConfusionConfig object.
Color intensity is the fraction within each reference row; labels show raw counts. Sensitivity, specificity, PPV, and NPV are one-versus-rest rates for each named class. Balanced accuracy is mean class recall, including every declared class. Zero denominators produce NA, never zero; consequently balanced accuracy is NA if any declared class has no reference observations. Summaries of pooled resamples describe pooled predictions, not mean fold performance. Repeated observations are counted each time they appear.
cfg <- setup_ConfusionConfig() draw(cfg, data = data.frame(reference = c("yes", "no"), predicted = c("yes", "no"), n = c(8, 12)))cfg <- setup_ConfusionConfig() draw(cfg, data = data.frame(reference = c("yes", "no"), predicted = c("yes", "no"), n = c(8, 12)))
Axis-range zoom component. ECharts renders dataZoom as an array; common
usage pairs a "slider" (visible scrollbar) with an "inside" (mouse-wheel
/ drag) entry targeting the same axis. Unused styling / mouse-behavior
fields stay NULL and are dropped from the serialized output.
DataZoom( type = "slider", id = NULL, disabled = NULL, x_axis_index = NULL, y_axis_index = NULL, radius_axis_index = NULL, angle_axis_index = NULL, single_axis_index = NULL, filter_mode = NULL, start = NULL, end = NULL, start_value = NULL, end_value = NULL, min_span = NULL, max_span = NULL, min_value_span = NULL, max_value_span = NULL, orient = NULL, throttle = NULL, range_mode = NULL, show = NULL, background_color = NULL, left = NULL, right = NULL, top = NULL, bottom = NULL, width = NULL, height = NULL, zoom_lock = NULL, zoom_on_mouse_wheel = NULL, move_on_mouse_move = NULL, move_on_mouse_wheel = NULL, prevent_default_mouse_move = NULL )DataZoom( type = "slider", id = NULL, disabled = NULL, x_axis_index = NULL, y_axis_index = NULL, radius_axis_index = NULL, angle_axis_index = NULL, single_axis_index = NULL, filter_mode = NULL, start = NULL, end = NULL, start_value = NULL, end_value = NULL, min_span = NULL, max_span = NULL, min_value_span = NULL, max_value_span = NULL, orient = NULL, throttle = NULL, range_mode = NULL, show = NULL, background_color = NULL, left = NULL, right = NULL, top = NULL, bottom = NULL, width = NULL, height = NULL, zoom_lock = NULL, zoom_on_mouse_wheel = NULL, move_on_mouse_move = NULL, move_on_mouse_wheel = NULL, prevent_default_mouse_move = NULL )
type |
Character {"slider", "inside"}: Zoom type. |
id |
Optional Character: Component identifier used for updates. |
disabled |
Optional Logical: Whether the component is disabled. |
x_axis_index |
Optional Numeric, numeric vector, or Character {"all"}: Index of the x-axis (or axes) this zoom targets. |
y_axis_index |
Optional Numeric, numeric vector, or Character {"all"}: Index of the y-axis (or axes) this zoom targets. |
radius_axis_index |
Optional Numeric, numeric vector, or Character {"all"}: Polar radius axis index. |
angle_axis_index |
Optional Numeric, numeric vector, or Character {"all"}: Polar angle axis index. |
single_axis_index |
Optional Numeric, numeric vector, or Character {"all"}: Single-axis index. |
filter_mode |
Optional Character {"filter", "weakFilter", "empty", "none"}: How out-of-window data points are handled. |
start |
Optional Numeric [0, 100]: Left/start position as a percentage of the full data range. |
end |
Optional Numeric [0, 100]: Right/end position as a percentage of the full data range. |
start_value |
Optional Numeric, Character, or Date: Absolute start
value (alternative to |
end_value |
Optional Numeric, Character, or Date: Absolute end value
(alternative to |
min_span |
Optional Numeric [0, 100]: Minimum window size, as a percentage. |
max_span |
Optional Numeric [0, 100]: Maximum window size, as a percentage. |
min_value_span |
Optional Numeric or Character: Minimum window size in data units. |
max_value_span |
Optional Numeric or Character: Maximum window size in data units. |
orient |
Optional Character {"horizontal", "vertical"}: Layout orientation. Defaults are inferred from the axis the zoom targets. |
throttle |
Optional Numeric [0, Inf): Throttle delay in milliseconds for zoom events. |
range_mode |
Optional length-2 Character vector of {"value", "percent"}: Per-boundary interpretation for start/end. |
show |
Optional Logical: Whether the slider is visible (slider type only). |
background_color |
Optional Character: Slider background color. |
left |
Optional Numeric or Character: Slider left position. |
right |
Optional Numeric or Character: Slider right position. |
top |
Optional Numeric or Character: Slider top position. |
bottom |
Optional Numeric or Character: Slider bottom position. |
width |
Optional Numeric or Character: Slider width. |
height |
Optional Numeric or Character: Slider height. |
zoom_lock |
Optional Logical: Whether to lock the window size (allow move but not zoom). |
zoom_on_mouse_wheel |
Optional Logical or Character {"shift", "ctrl", "alt"}: Whether/how the mouse wheel zooms (inside type only). |
move_on_mouse_move |
Optional Logical or Character {"shift", "ctrl", "alt"}: Whether/how mouse drag pans (inside type only). |
move_on_mouse_wheel |
Optional Logical or Character {"shift", "ctrl", "alt"}: Whether/how the mouse wheel pans (inside type only). |
prevent_default_mouse_move |
Optional Logical: Whether to call
|
Corresponds to DataZoomOption in
src/component/dataZoom/DataZoomModel.ts (line 38),
SliderDataZoomOption in src/component/dataZoom/SliderZoomModel.ts
(line 38), and InsideDataZoomOption in
src/component/dataZoom/InsideZoomModel.ts (line 23).
ECharts docs: https://echarts.apache.org/en/option.html#dataZoom
DataZoom object.
DataZoom(type = "slider", start = 0, end = 50)DataZoom(type = "slider", start = 0, end = 50)
A serializable description of a kernel density chart. Build one with
setup_DensityConfig() rather than calling this constructor directly.
DensityConfig( dat_path = NULL, title = NULL, origin = NULL, writer = NULL, legend_position = "top", legend_placement = "outside", x = NULL, group = NULL, mode = "overlap", order = "input", n = 512L, bw = "nrd0", bandwidth = NULL, kernel = "gaussian", adjust = 1, fill_alpha = 0.25, na_rm = TRUE, palette = NULL, xlab = NULL, ylab = NULL, margin_top = NULL, margin_right = NULL, margin_bottom = NULL, margin_left = NULL )DensityConfig( dat_path = NULL, title = NULL, origin = NULL, writer = NULL, legend_position = "top", legend_placement = "outside", x = NULL, group = NULL, mode = "overlap", order = "input", n = 512L, bw = "nrd0", bandwidth = NULL, kernel = "gaussian", adjust = 1, fill_alpha = 0.25, na_rm = TRUE, palette = NULL, xlab = NULL, ylab = NULL, margin_top = NULL, margin_right = NULL, margin_bottom = NULL, margin_left = NULL )
dat_path |
Optional Character: Path to the data, read at draw time. The
serializable alternative to passing |
title |
Optional Character: Chart title. Declared here because it is the
one property every chart type has; |
origin |
Optional Named character {"user", "default", "derived"}: Where each value came from, one entry per settable property. Absent on an authored config; written by the interface that resolved it. |
writer |
Optional Named character: Which interface wrote the config, as
|
legend_position |
Character {"top", "bottom", "left", "right", "top-left", "top-right", "bottom-left", "bottom-right"}: Legend anchor. Top/bottom anchors use horizontal rows; left/right anchors use a vertical column. Corner anchors align within the top or bottom row. |
legend_placement |
Character {"outside", "inside"}: Relation to the plotting area. Outside placement reserves space for the complete legend; inside placement overlays the data. Neither setting adds a missing legend. |
x |
Optional Character: Columns to estimate, one distribution per column. |
group |
Optional Character: Column to split the estimate by. |
mode |
Character |
order |
Character |
n |
Integer |
bw |
Character or Numeric: Bandwidth selector ( |
bandwidth |
Optional Numeric |
kernel |
Character: One of |
adjust |
Numeric |
fill_alpha |
Numeric |
na_rm |
Logical: If TRUE, drop |
palette |
Optional Character: Series colors, overriding the theme
palette for this chart. |
xlab, ylab
|
Optional Character: Axis labels. |
margin_top, margin_right, margin_bottom, margin_left
|
Optional Integer
|
x names one or more numeric columns. group optionally names a
column to split it by, drawing one curve per level. The output uses
LineSeriesOption in ECharts src/chart/line/LineSeries.ts.
DensityConfig object.
EDG
setup_DensityConfig(x = "mpg")@typesetup_DensityConfig(x = "mpg")@type
draw() renders chart configurations and backend option objects as
interactive visualizations. It is an 'S7' generic that dispatches on the
class of option:
draw( option, theme = NULL, width = NULL, height = NULL, element_id = NULL, filename = NULL, animation = NULL, ... )draw( option, theme = NULL, width = NULL, height = NULL, element_id = NULL, filename = NULL, animation = NULL, ... )
option |
ChartConfig subclass, EChartsOption, SigmaOption, MapLibreOption, or named list: Chart configuration or render spec to draw. All concrete chart configuration classes listed below are supported. |
theme |
Optional Theme, list, or |
width |
Optional Character or Numeric: Widget width. |
height |
Optional Character or Numeric: Widget height. |
element_id |
Optional Character: Explicit element ID. |
filename |
Optional Character: If provided, the widget is also written to
this file via |
animation |
Optional Logical: Whether ECharts animates the chart.
|
... |
Named arguments for the selected method. For ChartConfig
subclasses, Additional arguments are passed to the rendering backend. ECharts accepts
Two
|
ChartConfig subclasses -> compile the configuration with its data, then render using the corresponding backend.
EChartsOption -> 'ECharts' (rtemis-draw widget).
SigmaOption -> 'Sigma.js' (rtemis-graph widget).
MapLibreOption -> 'MapLibre' (rtemis-map widget).
A plain named list is treated as a raw 'ECharts' option.
Theme handling is uniform across backends and lives on draw(), not on the
option object: pass NULL (default) for light/dark auto-detection (from VS
Code, RStudio, or the browser's prefers-color-scheme), NA for no theme
(raw backend defaults), or a Theme / list to force one.
htmlwidget: Widget object.
Supported ChartConfig subclasses are A3Config, BarConfig,
BoxplotConfig, CalibrationConfig, ChoroplethConfig, ConfusionConfig,
DensityConfig, GanttConfig, HeatmapConfig, HistogramConfig,
LineConfig, NetworkConfig, PieConfig, ROCConfig, SankeyConfig,
ScatterConfig, Scatter3DConfig, SignificanceConfig, SpectrogramConfig,
SurvivalConfig, and TimeSeriesConfig. Use their setup_*() functions to
create configurations, then pass the data to draw() with data = or set
dat_path on the configuration. See compile() to obtain the backend option
without rendering it.
# Render a chart configuration with data. config <- setup_ScatterConfig(x = "wt", y = "mpg") draw(config, data = mtcars) # Render a backend option directly. option <- EChartsOption( x_axis = Axis(type = "category", data = c("Mon", "Tue", "Wed")), y_axis = Axis(type = "value"), series = BarSeries(data = c(120, 200, 150)) ) draw(option)# Render a chart configuration with data. config <- setup_ScatterConfig(x = "wt", y = "mpg") draw(config, data = mtcars) # Render a backend option directly. option <- EChartsOption( x_axis = Axis(type = "category", data = c("Mon", "Tue", "Wed")), y_axis = Axis(type = "value"), series = BarSeries(data = c(120, 200, 150)) ) draw(option)
Renders an A3 object (from rtemis.a3) as an interactive ECharts
amino-acid sequence diagram. The sequence is wrapped into rows in a
meander/serpentine path, with optional site, region, PTM, processing, and
variant annotations overlaid as distinct series and collected in an
upper-right annotation column, matching rtemislive. Legend headings use
native rich text and remain available
in vector SVG exports through save_drawing().
draw_a3( x, n_per_row = 21L, residue_spacing = 0.3, marker_size = 28, font_size = 18, line_width = 2, show_markers = TRUE, show_labels = TRUE, position_every = 10L, region_opacity = 0.3, ptm_placement = "radial", residue_fill = NULL, residue_stroke = NULL, label_color = NULL, pos_label_color = NULL, variant_color = NULL, disease_variant_color = NULL, enable_zoom = TRUE, title = NULL, grid = NULL, theme = NULL, width = NULL, height = NULL, element_id = NULL, filename = NULL )draw_a3( x, n_per_row = 21L, residue_spacing = 0.3, marker_size = 28, font_size = 18, line_width = 2, show_markers = TRUE, show_labels = TRUE, position_every = 10L, region_opacity = 0.3, ptm_placement = "radial", residue_fill = NULL, residue_stroke = NULL, label_color = NULL, pos_label_color = NULL, variant_color = NULL, disease_variant_color = NULL, enable_zoom = TRUE, title = NULL, grid = NULL, theme = NULL, width = NULL, height = NULL, element_id = NULL, filename = NULL )
x |
|
n_per_row |
Integer |
residue_spacing |
Numeric |
marker_size |
Numeric |
font_size |
Numeric |
line_width |
Numeric |
show_markers |
Logical: Whether to render the backbone line and residue circles. |
show_labels |
Logical: Whether to render single-letter residue labels. |
position_every |
Optional Integer |
region_opacity |
Numeric |
ptm_placement |
Character |
residue_fill |
Optional Character: Residue circle fill color. |
residue_stroke |
Optional Character: Residue circle stroke and backbone line color. |
label_color |
Optional Character: Default residue label text color. |
pos_label_color |
Optional Character: Position label text color. |
variant_color |
Optional Character: Label color for variant residues. |
disease_variant_color |
Optional Character: Label color for disease-associated
variant residues (takes precedence over |
enable_zoom |
Logical: Whether to enable Shift+scroll zoom. |
title |
Optional Character: Chart title. |
grid |
Optional Grid: Override any plot-area margin. The defaults
(margins matching rtemislive, with |
theme |
Optional Theme: Theme override. |
width |
Optional Numeric or Character: Widget width. |
height |
Optional Numeric or Character: Widget height. Auto-computed
from layout bounds and |
element_id |
Optional Character: Explicit DOM element ID for the widget
container. |
filename |
Optional Character: If provided, save the widget to this
file via |
The annotation column stays at the upper right on every surface. Residue
markers, labels, and annotations shrink together to avoid overlap. Row
wrapping remains fixed. Browser height follows the layout unless supplied;
SVG and panel dimensions remain bounded. A custom grid retains its layout.
Corresponds to createA3EChartsOption() in
src/lib/a3/visualization/echarts.ts.
htmlwidget: Widget object.
if (requireNamespace("rtemis.a3", quietly = TRUE)) { a <- rtemis.a3::create_A3( "MAEPRQEFEVMEDHAGTYGLGDRK", site = list( Active_site = rtemis.a3::annotation_position(c(5L, 17L)) ), region = list( Domain = rtemis.a3::annotation_range( matrix(c(3L, 10L, 15L, 22L), ncol = 2, byrow = TRUE) ) ) ) draw_a3(a) }if (requireNamespace("rtemis.a3", quietly = TRUE)) { a <- rtemis.a3::create_A3( "MAEPRQEFEVMEDHAGTYGLGDRK", site = list( Active_site = rtemis.a3::annotation_position(c(5L, 17L)) ), region = list( Domain = rtemis.a3::annotation_range( matrix(c(3L, 10L, 15L, 22L), ncol = 2, byrow = TRUE) ) ) ) draw_a3(a) }
Accepts predictions from any model without keeping a fitted R object in the
chart. Existing axis limits are preserved, including explicitly requested
limits. Annotate child drawings before composing panels. For built-in GLM or
GAM estimation, use draw_scatter() or draw_fit().
draw_add_fit( plot, x = NULL, y = NULL, lower = NULL, upper = NULL, name = "Fit", color = "#6ca3a0", line_width = 2, opacity = 0.2, x_axis = 0L, y_axis = 0L, layer = NULL )draw_add_fit( plot, x = NULL, y = NULL, lower = NULL, upper = NULL, name = "Fit", color = "#6ca3a0", line_width = 2, opacity = 0.2, x_axis = 0L, y_axis = 0L, layer = NULL )
plot |
htmlwidget: Existing Cartesian ECharts drawing. |
x, y
|
Numeric: Finite curve coordinates with distinct x values. |
lower, upper
|
Optional Numeric: Paired finite interval bounds at every x. |
name |
Character: Legend label; a matching observation label links selection. |
color |
Character: Curve and interval color. |
line_width |
Numeric |
opacity |
Numeric |
x_axis, y_axis
|
Integer |
layer |
Optional FitLayer: Complete geometry; do not combine with other settings. |
htmlwidget: Drawing with native vector curve and interval layers.
draw_add_fit(draw_scatter(1:3, c(2, 4, 5)), 1:3, c(2.1, 3.8, 5.1), name = "Predicted")draw_add_fit(draw_scatter(1:3, c(2, 4, 5)), 1:3, c(2.1, 3.8, 5.1), name = "Predicted")
Fits are computed explicitly before drawing. Supply predictions from any
model on a rectangular grid; fitted R objects and callbacks are not stored
in the drawing. The prediction grid may extend the original axis ranges.
Add surfaces before composing drawings with draw_panels().
draw_add_surface( plot, x = NULL, y = NULL, z = NULL, name = "Surface", color = "#6ca3a0", opacity = 0.35, layer = NULL, expand = TRUE )draw_add_surface( plot, x = NULL, y = NULL, z = NULL, name = "Surface", color = "#6ca3a0", opacity = 0.35, layer = NULL, expand = TRUE )
plot |
htmlwidget: Existing Cartesian ECharts-GL drawing. |
x, y
|
Numeric: Finite, distinct grid coordinates, at least two per axis. |
z |
Numeric matrix: Predictions, with x along rows and y along columns. NA removes adjacent cells. At least one complete grid cell is required. |
name |
Character: Legend label; matching names link legend selection. |
color |
Character: Surface fill color. |
opacity |
Numeric |
layer |
Optional SurfaceLayer: Complete geometry, supplied alone. |
expand |
Logical: Extend axis ranges to include surface coordinates. When false, all finite surface coordinates must already lie within them. |
htmlwidget: Drawing with native interactive and vector surface layers.
x <- y <- seq(-1, 1, length.out = 5) draw_add_surface(draw_scatter3d(c(-1, 1), c(-1, 1), c(-1, 1)), x, y, outer(x, y, `+`), name = "Predicted")x <- y <- seq(-1, 1, length.out = 5) draw_add_surface(draw_scatter3d(c(-1, 1), c(-1, 1), c(-1, 1)), x, y, outer(x, y, `+`), name = "Predicted")
Adds independent native ECharts layers to an existing drawing. For panels, annotate the children before composition. Annotation coordinates use the existing axes and may extend their automatic ranges; explicit limits remain authoritative. References and bands do not alter data summaries.
draw_annotate( plot, hline = NULL, vline = NULL, x = numeric(), y = numeric(), text = NULL, bands = list(), color = "#888888", line_type = "dashed", opacity = 0.15, x_axis = 0L, y_axis = 0L, layer = NULL )draw_annotate( plot, hline = NULL, vline = NULL, x = numeric(), y = numeric(), text = NULL, bands = list(), color = "#888888", line_type = "dashed", opacity = 0.15, x_axis = 0L, y_axis = 0L, layer = NULL )
plot |
htmlwidget: An ECharts drawing. |
hline, vline
|
Numeric: Horizontal and vertical reference positions. |
x, y
|
Numeric or Character: Coordinates for text annotations. |
text |
Character: One label per coordinate pair. |
bands |
List: Numeric length-two x intervals to shade. |
color |
Character: Annotation color. |
line_type |
Character |
opacity |
Numeric |
x_axis, y_axis
|
Integer |
layer |
Optional AnnotationLayer: Complete geometry. Do not combine with annotation convenience arguments. |
htmlwidget: The drawing with an additional vector annotation layer.
draw_annotate(draw_scatter(1:5, c(2, 3, 1, 5, 4)), hline = 3)draw_annotate(draw_scatter(1:5, c(2, 3, 1, 5, 4)), hline = 3)
Quick bar chart from x/y data.
draw_bar( x, y = NULL, palette = NULL, stack = FALSE, horizontal = FALSE, xlab = NULL, ylab = NULL, title = NULL, theme = NULL, margins = DEFAULT_MARGINS, width = NULL, height = NULL, element_id = NULL, filename = NULL, bar_width = NULL, order = "input", legend_position = "top", legend_placement = "outside" )draw_bar( x, y = NULL, palette = NULL, stack = FALSE, horizontal = FALSE, xlab = NULL, ylab = NULL, title = NULL, theme = NULL, margins = DEFAULT_MARGINS, width = NULL, height = NULL, element_id = NULL, filename = NULL, bar_width = NULL, order = "input", legend_position = "top", legend_placement = "outside" )
x |
Character or Numeric: Category labels, or values when y is omitted. A matrix or two-dimensional table supplies categories in rows and series in columns. A one-dimensional table supplies counts and category names. |
y |
Numeric or named list: Bar heights. |
palette |
Optional Character: Bar color or colors. For multiple series,
colors are applied per series and recycled as needed. For a single series,
a single color styles the whole series; multiple colors are recycled
across individual bars. |
stack |
Logical: Whether to stack bars. |
horizontal |
Logical: Whether to draw horizontal bars. |
xlab |
Optional Character: X-axis title (bottom axis). |
ylab |
Optional Character: Y-axis title (left axis). |
title |
Optional Character: Chart title. |
theme |
Optional Theme: Theme override. The palette inside the theme can be
overridden per-chart with the |
margins |
Optional Named numeric vector or named list: Plot margins in
pixels (or percentage strings) for any of |
width |
Optional Character or Numeric: Widget width. |
height |
Optional Character or Numeric: Widget height. |
element_id |
Optional Character: Explicit DOM element ID for the widget
container. |
filename |
Optional Character: If provided, save the widget to this file via
|
bar_width |
Optional Numeric |
order |
Character |
legend_position |
Character {"top", "bottom", "left", "right", "top-left", "top-right", "bottom-left", "bottom-right"}: Legend anchor. Top/bottom anchors use horizontal rows; left/right anchors use a vertical column. Corner anchors align within the top or bottom row. |
legend_placement |
Character {"outside", "inside"}: Relation to the plotting area. Outside placement reserves space for the complete legend; inside placement overlays the data. Neither setting adds a missing legend. |
htmlwidget: Widget object.
draw_bar(x = c("A", "B", "C"), y = c(3, 7, 2), title = "Counts")draw_bar(x = c("A", "B", "C"), y = c(3, 7, 2), title = "Counts")
Draw one box per numeric vector, optionally split by groups. Statistics use
linear-interpolation quartiles (stats::quantile(type = 7)) or Tukey hinges
(stats::fivenum()). Whiskers extend to observations within the quartiles
plus/minus whisker times their difference, including the quartiles
themselves. whisker = 0 uses the full observed range. Values strictly
outside the fences are outliers; they are never removed from the quartiles.
draw_boxplot( x, labels = NULL, group = NULL, horizontal = FALSE, palette = NULL, fill_alpha = 0.25, na_rm = TRUE, xlab = NULL, ylab = NULL, title = NULL, theme = NULL, margins = DEFAULT_MARGINS, width = NULL, height = NULL, verbosity = 1L, element_id = NULL, filename = NULL, observation = NULL, quartiles = "linear", whisker = 1.5, boxpoints = "none", point_size = 5, point_alpha = 0.6, point_spread = 0.5, legend_position = "top", legend_placement = "outside", geometry = "box", bandwidth = NULL, adjust = 1, density_points = 128L, paired = FALSE, pair_alpha = 0.35, pair_width = 1, comparisons = NULL, order = "input", transform = "none" )draw_boxplot( x, labels = NULL, group = NULL, horizontal = FALSE, palette = NULL, fill_alpha = 0.25, na_rm = TRUE, xlab = NULL, ylab = NULL, title = NULL, theme = NULL, margins = DEFAULT_MARGINS, width = NULL, height = NULL, verbosity = 1L, element_id = NULL, filename = NULL, observation = NULL, quartiles = "linear", whisker = 1.5, boxpoints = "none", point_size = 5, point_alpha = 0.6, point_spread = 0.5, legend_position = "top", legend_placement = "outside", geometry = "box", bandwidth = NULL, adjust = 1, density_points = 128L, paired = FALSE, pair_alpha = 0.35, pair_width = 1, comparisons = NULL, order = "input", transform = "none" )
x |
Numeric or List: Numeric vectors, one per box; named lists supply
category labels. With |
labels |
Optional Character: One category label per vector. A single grouped vector uses group labels instead. |
group |
Optional Atomic vector or single-column data frame: Group identities in first-appearance order. The column name does not add a legend or heading; both input forms produce the same plot. |
horizontal |
Logical: Draw horizontal boxes. |
palette |
Optional Character: Box colors, recycled across boxes or groups. |
fill_alpha |
Numeric |
na_rm |
Logical: Remove missing values. FALSE rejects missing input. |
xlab, ylab
|
Optional Character: Axis labels. |
title |
Optional Character: Chart title. |
theme |
Optional Theme: Theme override. The palette inside the theme can be
overridden per-chart with the |
margins |
Optional Named numeric vector or named list: Plot margins in
pixels (or percentage strings) for any of |
width |
Optional Character or Numeric: Widget width. |
height |
Optional Character or Numeric: Widget height. |
verbosity |
Integer |
element_id |
Optional Character: Explicit DOM element ID for the widget
container. |
filename |
Optional Character: If provided, save the widget to this file via
|
observation |
Optional Atomic vector: Observation identifiers in tooltips, aligned to every input vector. Required for pairing; otherwise unset uses original row numbers. |
quartiles |
Character {"linear", "hinges"}: Quartile convention. |
whisker |
Numeric |
boxpoints |
Character {"none", "all", "outliers"}: Values to overlay. |
point_size |
Numeric |
point_alpha |
Numeric |
point_spread |
Numeric |
legend_position |
Character {"top", "bottom", "left", "right", "top-left", "top-right", "bottom-left", "bottom-right"}: Legend anchor. Top/bottom anchors use horizontal rows; left/right anchors use a vertical column. Corner anchors align within the top or bottom row. |
legend_placement |
Character {"outside", "inside"}: Relation to the plotting area. Outside placement reserves space for the complete legend; inside placement overlays the data. Neither setting adds a missing legend. |
geometry |
Character {"box", "violin", "both"}: Distribution geometry. |
bandwidth |
Optional Numeric |
adjust |
Numeric |
density_points |
Integer |
paired |
Logical: Connect explicit IDs across adjacent categories. |
pair_alpha |
Numeric |
pair_width |
Numeric |
comparisons |
Optional Data frame: Category endpoints and comparison labels. |
order |
Character |
transform |
Character |
All-NA and empty boxes retain their category without a mark; entirely
unavailable input is an error. Missing values are reported in the console
according to verbosity and never replaced with zero. Missing group
assignments are excluded. Axis titles are centered. The category-axis
baseline is shown only when the plotted value range includes zero.
Every category label is shown so boxes remain identifiable in narrow plots.
Use a horizontal layout or a larger figure for many or long category names.
With point overlays, padded range endpoints are unlabeled; interior ticks
retain the backend's numeric formatting and plotted values are unchanged.
Points retain their exact value coordinate. Their perpendicular offsets use
a deterministic base-two sequence in input row order within point_spread
times the box width. Zero spread centers every point; coincident points can
overlap. No random state is read or changed. Browser and SVG share the same
named point renderer, including grouped-box offsets and legend filtering.
Violin densities use a Gaussian kernel with stats::bw.nrd0() unless a
numeric bandwidth is supplied, multiplied by adjust. They are evaluated
over the observed range and each is scaled to the same maximum width;
widths do not encode sample size or comparable density across groups.
Singleton and constant samples appear as crossbars, without an invented
density. geometry = "both" overlays a narrow box on each violin.
Paired lines join matching explicit observation IDs in adjacent categories only, within groups for multiple grouped vectors. A missing measurement leaves a gap. IDs must be unique within each category/group. Lines meet visible observation points at their deterministic offsets.
Comparison records annotate supplied results; no statistical test or
multiplicity adjustment is performed. from and to name categories;
label supplies the displayed text. Multiple grouped vectors also require
from_group and to_group. Optional finite position values place brackets
on the value axis; otherwise brackets stack above the observed geometry.
References must identify distinct, nonempty cells. Brackets disappear when
either endpoint's group is hidden. Long labels may require a larger figure.
htmlwidget: ECharts boxes with optional vector point overlays.
draw_boxplot(list(Training = c(.8, .9, .85), Test = c(.7, .8, .75)), boxpoints = "all", observation = c("Fold1", "Fold2", "Fold3")) draw_boxplot(iris["Sepal.Length"], group = iris["Species"])draw_boxplot(list(Training = c(.8, .9, .85), Test = c(.7, .8, .75)), boxpoints = "all", observation = c("Fold1", "Fold2", "Fold3")) draw_boxplot(iris["Sepal.Length"], group = iris["Species"])
Compare mean predicted probability with observed frequency. Accepts binary
labels and probabilities, named lists of paired samples, or individual
observation records with observed, probability, and optional group.
Named lists are aligned by name. Binary class identity and probability
columns follow draw_roc(): positive names the event, and otherwise the
second factor level is selected. Named probability columns identify their
classes. Samples must share the same positive class.
draw_calibration( true_labels, predicted_prob = NULL, positive = NULL, ..., group = NULL, legend_position = "top", legend_placement = "outside", theme = NULL, width = NULL, height = NULL, element_id = NULL, filename = NULL )draw_calibration( true_labels, predicted_prob = NULL, positive = NULL, ..., group = NULL, legend_position = "top", legend_placement = "outside", theme = NULL, width = NULL, height = NULL, element_id = NULL, filename = NULL )
true_labels |
Factor, vector, list, or data frame: Binary labels or observation records. |
predicted_prob |
Optional Numeric vector, matrix, or list: Predicted probabilities. |
positive |
Optional Character: Positive class label. |
... |
Additional named settings for |
group |
Optional Character: Group column for observation records. When
omitted, a column named |
legend_position |
Character {"top", "bottom", "left", "right", "top-left", "top-right", "bottom-left", "bottom-right"}: Legend anchor. Top/bottom anchors use horizontal rows; left/right anchors use a vertical column. Corner anchors align within the top or bottom row. |
legend_placement |
Character {"outside", "inside"}: Relation to the plotting area. Outside placement reserves space for the complete legend; inside placement overlays the data. Neither setting adds a missing legend. |
theme |
Optional Theme: Chart theme. |
width, height
|
Optional Numeric or Character: Widget dimensions. |
element_id |
Optional Character: HTML element identifier. |
filename |
Optional Character: Static output path, currently SVG. |
An ECharts htmlwidget with vector SVG export.
Bins are computed independently within each group. Equidistant bins partition
the unit interval. Quantile bins use linear interpolation at positions
(n - 1) * p + 1 in the sorted probabilities (R quantile type 7).
Repeated boundaries are collapsed without splitting tied scores. Intervals
include their lower boundary and exclude their upper boundary, except that
the final interval includes its upper boundary. Constant probabilities form
one bin. Empty bins are omitted; lines join the remaining bin means.
Each point is the mean predicted probability and mean observed outcome in
its bin. The Brier score is the mean squared probability error across all
complete observations, before binning. It is not an average of bin errors.
Missing pairs are removed together when na_rm is true; invalid finite
ranges and infinite values are always rejected. A group with no complete
observations is rejected. The probability rug uses those same complete
observations and sits just inside the lower plotting edge.
Both axes span zero to one. Display precision does not round plotted values.
A one-bin curve remains visible as a point even in lines-only mode.
labels <- factor(c("no", "yes", "no", "yes"), levels = c("no", "yes")) draw_calibration(labels, c(.1, .8, .4, .9), n_bins = 2L)labels <- factor(c("no", "yes", "no", "yes"), levels = c("no", "yes")) draw_calibration(labels, c(.1, .8, .4, .9), n_bins = 2L)
Render a choropleth map with MapLibre GL: regions shaded by a value, joined
to vendored administrative boundaries (countries by ISO-A3, US states /
counties by FIPS). No basemap tiles – boundaries render on the themed
background, with light/dark auto-detection like the rest of draw_*.
draw_choropleth( x, location, value, resolution = c("country", "state", "county"), tooltip = NULL, value_label = NULL, classification = "quantile", colormap = "blues", num_classes = 5, opacity = 1, show_boundaries = TRUE, outline_width = 0.2, show_legend = TRUE, legend_position = "bottom-right", tooltip_position = "top-right", title = NULL, theme = NULL, width = NULL, height = NULL, element_id = NULL, filename = NULL )draw_choropleth( x, location, value, resolution = c("country", "state", "county"), tooltip = NULL, value_label = NULL, classification = "quantile", colormap = "blues", num_classes = 5, opacity = 1, show_boundaries = TRUE, outline_width = 0.2, show_legend = TRUE, legend_position = "bottom-right", tooltip_position = "top-right", title = NULL, theme = NULL, width = NULL, height = NULL, element_id = NULL, filename = NULL )
x |
Data frame: One row per region. |
location |
Character: Name of the column holding the location key (FIPS / ISO / name). |
value |
Character: Name of the numeric column to color by. |
resolution |
Character {"country", "state", "county"}: Administrative resolution selecting the geometry and the join key. |
tooltip |
Optional Character: Names of extra columns to show in the hover tooltip, in order. |
value_label |
Optional Character: Label for the value column in the
legend / tooltip; defaults to |
classification |
Character {"quantile", "equal", "jenks"}: Class-break
method. |
colormap |
Character: Color ramp. One of the sequential schemes
|
num_classes |
Numeric [2, 12]: Number of color classes. |
opacity |
Numeric [0, 1]: Region fill opacity. |
show_boundaries |
Logical: Whether to draw region outlines. |
outline_width |
Numeric [0, Inf): Region outline width in pixels. |
show_legend |
Logical: Whether to show the legend. |
legend_position |
Character {"top-left", "top-right", "bottom-left", "bottom-right"}: Legend corner. |
tooltip_position |
Character {"top-left", "top-right", "bottom-left", "bottom-right"}: Hover tooltip corner. |
title |
Optional Character: Title (currently surfaced via the value label; reserved for future use). |
theme |
Optional Theme, list, or |
width |
Optional Character or Numeric: Widget width. |
height |
Optional Character or Numeric: Widget height. |
element_id |
Optional Character: Explicit element ID. |
filename |
Optional Character: Static export of map widgets is not yet supported. Supplying a path raises an error. |
The location column is matched to the geometry in the renderer, which
accepts ISO-A3 / ISO-A2 / country code for countries, and FIPS / postal
abbreviation / full name for US states (5-digit FIPS for counties). A
join report in the corner surfaces any unmatched keys.
htmlwidget.
# Country choropleth from ISO-A3 codes df <- data.frame( iso = c("USA", "CAN", "MEX", "BRA", "FRA"), gdp = c(25.5, 2.1, 1.4, 1.9, 2.9) ) draw_choropleth(df, location = "iso", value = "gdp") # US states by postal abbreviation, natural-breaks classification states <- data.frame( st = state.abb, pop = as.numeric(state.x77[, "Population"]) ) draw_choropleth( states, location = "st", value = "pop", resolution = "state", classification = "jenks", colormap = "viridis" )# Country choropleth from ISO-A3 codes df <- data.frame( iso = c("USA", "CAN", "MEX", "BRA", "FRA"), gdp = c(25.5, 2.1, 1.4, 1.9, 2.9) ) draw_choropleth(df, location = "iso", value = "gdp") # US states by postal abbreviation, natural-breaks classification states <- data.frame( st = state.abb, pop = as.numeric(state.x77[, "Population"]) ) draw_choropleth( states, location = "st", value = "pop", resolution = "state", classification = "jenks", colormap = "viridis" )
Accepts a square count matrix, a named list of count matrices, long frequency
records (reference, predicted, n, optional panel), or paired reference
and predicted label vectors. Model packages can add support for metrics
objects through confusion_input(). Matrix columns are aligned by label identity;
their physical order need not match rows. All panels share one class order.
draw_confusion( x, y = NULL, classes = NULL, ..., theme = NULL, width = NULL, height = NULL, element_id = NULL, filename = NULL )draw_confusion( x, y = NULL, classes = NULL, ..., theme = NULL, width = NULL, height = NULL, element_id = NULL, filename = NULL )
x |
Matrix, table, data frame, named list, metrics object, or vector: Counts or reference labels. |
y |
Optional vector: Predicted labels when x contains reference labels. |
classes |
Optional Character vector: Ordered class labels shared by every panel; unset preserves first appearance. |
... |
Additional named settings for |
theme |
Optional Theme: Chart theme. Color fades and marginal backgrounds follow the active theme unless overridden in the config. |
width, height
|
Optional Numeric or Character: Widget dimensions. |
element_id |
Optional Character: HTML element identifier. |
filename |
Optional Character: Static output path, currently SVG. |
An ECharts htmlwidget containing every requested panel.
Color intensity is the fraction within each reference row; labels show raw counts. Sensitivity, specificity, PPV, and NPV are one-versus-rest rates for each named class. Balanced accuracy is mean class recall, including every declared class. Zero denominators produce NA, never zero; consequently balanced accuracy is NA if any declared class has no reference observations. Summaries of pooled resamples describe pooled predictions, not mean fold performance. Repeated observations are counted each time they appear.
draw_confusion(factor(c("yes", "yes", "no")), c("yes", "no", "no")) draw_confusion(matrix(c(8, 2, 1, 9), 2, dimnames = list(c("yes", "no"), c("yes", "no"))))draw_confusion(factor(c("yes", "yes", "no")), c("yes", "no", "no")) draw_confusion(matrix(c(8, 2, 1, 9), 2, dimnames = list(c("yes", "no"), c("yes", "no"))))
Kernel density estimation plot from numeric data, with optional grouping
for multiple traces. A list input creates one density trace per vector when
ungrouped, or one trace per variable/group combination when group is
supplied. Curves use stats::density() with its bandwidth-scaled kernels
and evaluation range extending three bandwidths beyond the data. Empty
samples retain their identity without a curve. Singleton and constant
samples require an explicit bandwidth; no spread is inferred for them.
Missing groups are excluded, and infinite/nonnumeric observations rejected.
draw_density( x, group = NULL, n = 512, bw = "nrd0", na_rm = TRUE, palette = NULL, xlab = NULL, ylab = NULL, title = NULL, theme = NULL, margins = DEFAULT_MARGINS, width = NULL, height = NULL, verbosity = 1L, element_id = NULL, filename = NULL, legend_position = "top", legend_placement = "outside", bandwidth = NULL, kernel = "gaussian", adjust = 1, fill_alpha = 0.25, mode = "overlap", order = "input" )draw_density( x, group = NULL, n = 512, bw = "nrd0", na_rm = TRUE, palette = NULL, xlab = NULL, ylab = NULL, title = NULL, theme = NULL, margins = DEFAULT_MARGINS, width = NULL, height = NULL, verbosity = 1L, element_id = NULL, filename = NULL, legend_position = "top", legend_placement = "outside", bandwidth = NULL, kernel = "gaussian", adjust = 1, fill_alpha = 0.25, mode = "overlap", order = "input" )
x |
Numeric or list: Values used for density estimation. An ungrouped
list creates one density trace per element; with |
group |
Optional Atomic vector or single-column data frame: Grouping variable for multiple density traces. |
n |
Integer |
bw |
Character or Numeric: Bandwidth selector ( |
na_rm |
Logical: Whether to remove |
palette |
Optional Character: Series colors, overriding the theme
palette for this chart. |
xlab |
Optional Character: X-axis title. |
ylab |
Optional Character: Y-axis title. |
title |
Optional Character: Chart title. |
theme |
Optional Theme: Theme override. |
margins |
Optional Named numeric vector or named list: Plot margins in
pixels (or percentage strings) for any of |
width |
Optional Character or Numeric: Widget width. |
height |
Optional Character or Numeric: Widget height. |
verbosity |
Integer |
element_id |
Optional Character: Explicit DOM element ID for the widget
container. |
filename |
Optional Character: If provided, save the widget to this file via
|
legend_position |
Character {"top", "bottom", "left", "right", "top-left", "top-right", "bottom-left", "bottom-right"}: Legend anchor. Top/bottom anchors use horizontal rows; left/right anchors use a vertical column. Corner anchors align within the top or bottom row. |
legend_placement |
Character {"outside", "inside"}: Relation to the plotting area. Outside placement reserves space for the complete legend; inside placement overlays the data. Neither setting adds a missing legend. |
bandwidth |
Optional Numeric |
kernel |
Character: One of |
adjust |
Numeric |
fill_alpha |
Numeric |
mode |
Character |
order |
Character |
htmlwidget: Widget object.
draw_density(iris[["Sepal.Length"]], xlab = "Sepal length")draw_density(iris[["Sepal.Length"]], xlab = "Sepal length")
Draw paired observations with a fitted line, standard-error band, and an identity line. The plotting box is square and both axes share an interval. Named lists support samples of different lengths, with one fit per sample.
draw_fit( x, y, group = NULL, fit = "glm", se = TRUE, se_times = 1.96, rsq = TRUE, diagonal = TRUE, diagonal_color = NULL, square = TRUE, equal_axes = TRUE, xlab = "True", ylab = "Predicted", ..., legend_position = "top", legend_placement = "outside" )draw_fit( x, y, group = NULL, fit = "glm", se = TRUE, se_times = 1.96, rsq = TRUE, diagonal = TRUE, diagonal_color = NULL, square = TRUE, equal_axes = TRUE, xlab = "True", ylab = "Predicted", ..., legend_position = "top", legend_placement = "outside" )
x |
Numeric vector, single-column matrix, or list: True values. |
y |
Numeric vector, single-column matrix, or list: Predicted values. |
group |
Optional Atomic vector or single-column data frame: Grouping variable for multiple series. |
fit |
Optional Character: Model fitted to |
se |
Logical: Whether to show the standard-error band. Algorithms without standard errors (every rtemis algorithm except GLM, GAM and a few others) draw the line alone. |
se_times |
Numeric |
rsq |
Logical: Include the fitted model's R-squared in series labels.
This describes the overlay fit, not predictive performance against the
identity line. Constant responses have undefined R-squared, labeled |
diagonal |
Logical: Draw a dashed identity line within the axis limits. |
diagonal_color |
Optional Character: Identity-line color. |
square |
Logical: If TRUE, draw the plotting box square – equal height and width in pixels, excluding axis labels and margins. |
equal_axes |
Logical: If TRUE, give one data unit the same size in pixels on both axes. Set both for a plot that is square and to scale, such as a true-versus-predicted plot whose identity line should run at 45 degrees; the two axes are then made to span the same interval. See Details. |
xlab |
Optional Character: X-axis title. |
ylab |
Optional Character: Y-axis title. |
... |
Additional arguments to |
legend_position |
Character {"top", "bottom", "left", "right", "top-left", "top-right", "bottom-left", "bottom-right"}: Legend anchor. Top/bottom anchors use horizontal rows; left/right anchors use a vertical column. Corner anchors align within the top or bottom row. |
legend_placement |
Character {"outside", "inside"}: Relation to the plotting area. Outside placement reserves space for the complete legend; inside placement overlays the data. Neither setting adds a missing legend. |
The overlay uses the same implementation as draw_scatter() and
ScatterConfig. The fit is GLM, GAM, or an rtemis learner named in fit;
fit = NULL disables it. Missing pairs and observations with missing groups
are dropped together. Infinite values, unequal pair lengths, and multiple
response columns are rejected. List names are matched before drawing;
unnamed lists are paired by position.
Paired NULL entries in lists represent unavailable sets and are omitted.
The equivalent portable configuration is a ScatterConfig binding true,
predicted, and sample columns, with fit, se, rsq, diagonal, square,
and equal_axes set explicitly. Model objects are not needed to render it.
htmlwidget: ECharts drawing.
draw_fit(1:5, c(1.2, 1.8, 3.3, 3.8, 5.2)) draw_fit( list(Training = 1:5, Test = 2:5), list(Training = c(1.2, 1.8, 3.3, 3.8, 5.2), Test = c(2.2, 2.7, 4.3, 4.8)) )draw_fit(1:5, c(1.2, 1.8, 3.3, 3.8, 5.2)) draw_fit( list(Training = 1:5, Test = 2:5), list(Training = c(1.2, 1.8, 3.3, 3.8, 5.2), Test = c(2.2, 2.7, 4.3, 4.8)) )
Draw a timeline (Gantt) chart: one horizontal bar per task, positioned by
start and end on a value or time x-axis and grouped into rows by label
on the y-axis. Implemented as an ECharts custom series (ECharts has no
native Gantt series).
draw_gantt( tasks, group = NULL, axis_type = "value", bar_height = 0.6, bar_radius = 0, guides = TRUE, zoom = TRUE, tooltip = NULL, border = NULL, border_color = "#E53935", border_width = 1.5, xlab = NULL, title = NULL, palette = NULL, theme = NULL, width = NULL, height = NULL, element_id = NULL, filename = NULL, legend_position = "top", legend_placement = "outside" )draw_gantt( tasks, group = NULL, axis_type = "value", bar_height = 0.6, bar_radius = 0, guides = TRUE, zoom = TRUE, tooltip = NULL, border = NULL, border_color = "#E53935", border_width = 1.5, xlab = NULL, title = NULL, palette = NULL, theme = NULL, width = NULL, height = NULL, element_id = NULL, filename = NULL, legend_position = "top", legend_placement = "outside" )
tasks |
Tabular data (data.frame, data.table, or tibble): One row per
task bar. Must contain columns |
group |
Optional Character: Name of a column in |
axis_type |
Character {"value", "time"}: Type of the x-axis. Use
|
bar_height |
Numeric |
bar_radius |
Numeric |
guides |
Logical: If |
zoom |
Logical: If |
tooltip |
Optional Character: Name of a column in |
border |
Optional Character: Name of a logical column in |
border_color |
Character: Outline color for bars flagged by |
border_width |
Numeric |
xlab |
Optional Character: x-axis label. |
title |
Optional Character: Chart title. |
palette |
Optional Character: Color palette as a single color or character vector overriding the theme palette. Groups are colored in order. |
theme |
Optional Theme: Theme override. |
width |
Optional Character or Numeric: Widget width. |
height |
Optional Character or Numeric: Widget height. |
element_id |
Optional Character: Explicit DOM element ID for the widget
container. |
filename |
Optional Character: If provided, save the widget to this file
via |
legend_position |
Character {"top", "bottom", "left", "right", "top-left", "top-right", "bottom-left", "bottom-right"}: Legend anchor. Top/bottom anchors use horizontal rows; left/right anchors use a vertical column. Corner anchors align within the top or bottom row. |
legend_placement |
Character {"outside", "inside"}: Relation to the plotting area. Outside placement reserves space for the complete legend; inside placement overlays the data. Neither setting adds a missing legend. |
The legend uses the shared position/placement controls and reserves enough
room for the time axis. Tick density follows the available plotting width,
and long task labels are truncated. Default bar tooltips retain the full task
text.
Browser resizing, panel figures, and SVG export share this layout behavior.
Increase height when a timeline contains many task rows.
htmlwidget: Widget object.
EDG
tasks <- data.frame( label = c("load", "clean", "train", "predict"), start = c(0, 12, 30, 95), end = c(12, 30, 95, 100), status = c("ok", "ok", "ok", "error") ) draw_gantt(tasks, group = "status")tasks <- data.frame( label = c("load", "clean", "train", "predict"), start = c(0, 12, 30, 95), end = c(12, 30, 95, 100), status = c("ok", "ok", "ok", "error") ) draw_gantt(tasks, group = "status")
Low-level renderer: takes a GraphModel (or a plain list with nodes,
edges, directed) and produces an interactive network htmlwidget backed by
Sigma.js + graphology. Most users call draw_network() instead.
draw_graph( model, layout = "force", node_size = 10, edge_scale = 3, node_opacity = 0.95, edge_opacity = 0.4, show_labels = TRUE, scale_by_degree = TRUE, color_by_group = FALSE, resolution = 1, blend_edges = FALSE, palette = palette_colors(rtemis_colors), node_color = rtemis_colors[["teal"]], positive_color = rtemis_colors[["teal"]], negative_color = "#ff9e1f", title = NULL, theme = NULL, width = NULL, height = NULL, element_id = NULL, filename = NULL )draw_graph( model, layout = "force", node_size = 10, edge_scale = 3, node_opacity = 0.95, edge_opacity = 0.4, show_labels = TRUE, scale_by_degree = TRUE, color_by_group = FALSE, resolution = 1, blend_edges = FALSE, palette = palette_colors(rtemis_colors), node_color = rtemis_colors[["teal"]], positive_color = rtemis_colors[["teal"]], negative_color = "#ff9e1f", title = NULL, theme = NULL, width = NULL, height = NULL, element_id = NULL, filename = NULL )
model |
GraphModel or named list: The graph to render. |
layout |
Character {"force", "circular", "circlepack", "random"}:
Layout algorithm. |
node_size |
Numeric [0, Inf): Base node radius in screen pixels. |
edge_scale |
Numeric [0, Inf): Multiplier mapping normalized edge weight to stroke width. |
node_opacity |
Numeric [0, 1]: Node fill opacity. |
edge_opacity |
Numeric [0, 1]: Edge stroke opacity. |
show_labels |
Logical: Whether to render node labels. |
scale_by_degree |
Logical: Scale each node's radius by its |
color_by_group |
Logical: Color nodes by detected community (Louvain) instead of a single hue. |
resolution |
Numeric [0, Inf): Louvain resolution; higher yields more, smaller communities. |
blend_edges |
Logical: Color each edge as the blend of its two endpoint node colors instead of by sign. |
palette |
Character: Categorical colors for communities. |
node_color |
Character: Single node color used when |
positive_color |
Character: Edge color for positive-sign edges. |
negative_color |
Character: Edge color for negative-sign edges. |
title |
Optional Character: Title shown above the network. |
theme |
Optional Theme, list, or |
width |
Optional Character or Numeric: Widget width. |
height |
Optional Character or Numeric: Widget height. |
element_id |
Optional Character: Explicit element ID. |
filename |
Optional Character: Static export of network widgets is not yet supported. Supplying a path raises an error. |
htmlwidget.
model <- GraphModel( nodes = list(GraphNode(id = "a"), GraphNode(id = "b")), edges = list(GraphEdge(source = "a", target = "b")), directed = FALSE ) draw_graph(model)model <- GraphModel( nodes = list(GraphNode(id = "a"), GraphNode(id = "b")), edges = list(GraphEdge(source = "a", target = "b")), directed = FALSE ) draw_graph(model)
Quick heatmap from a numeric matrix. Designed to handle all common use cases including correlation matrices (square cells, diverging color scale), general rectangular heatmaps, and clustered heatmaps.
draw_heatmap( x, row_names = NULL, col_names = NULL, triangle = NULL, cluster_rows = FALSE, cluster_cols = FALSE, dist_method = "euclidean", hclust_method = "complete", show_row_dendro = TRUE, show_col_dendro = TRUE, dendro_row_width = 60, dendro_col_height = 60, dendro_color = NULL, dendro_uniform = FALSE, dendro_row_side = "right", dendro_col_side = "top", square_cells = NULL, colormap = NULL, zlim = NULL, show_values = FALSE, value_digits = 2L, show_colorbar = TRUE, colorbar_orient = "vertical", title = NULL, theme = NULL, margins = NULL, width = NULL, height = NULL, element_id = NULL, filename = NULL, legend_position = if (colorbar_orient == "horizontal") "bottom" else "right", legend_placement = "outside", row_tree = NULL, col_tree = NULL, cell_notes = NULL, row_colors = NULL, col_colors = NULL, show_notes = FALSE, row_cut = NULL, col_cut = NULL )draw_heatmap( x, row_names = NULL, col_names = NULL, triangle = NULL, cluster_rows = FALSE, cluster_cols = FALSE, dist_method = "euclidean", hclust_method = "complete", show_row_dendro = TRUE, show_col_dendro = TRUE, dendro_row_width = 60, dendro_col_height = 60, dendro_color = NULL, dendro_uniform = FALSE, dendro_row_side = "right", dendro_col_side = "top", square_cells = NULL, colormap = NULL, zlim = NULL, show_values = FALSE, value_digits = 2L, show_colorbar = TRUE, colorbar_orient = "vertical", title = NULL, theme = NULL, margins = NULL, width = NULL, height = NULL, element_id = NULL, filename = NULL, legend_position = if (colorbar_orient == "horizontal") "bottom" else "right", legend_placement = "outside", row_tree = NULL, col_tree = NULL, cell_notes = NULL, row_colors = NULL, col_colors = NULL, show_notes = FALSE, row_cut = NULL, col_cut = NULL )
x |
Numeric matrix: Input data. Rows map to y-axis categories and columns to x-axis categories. |
row_names |
Optional Character: Row labels. Defaults to |
col_names |
Optional Character: Column labels. Defaults to |
triangle |
Optional Character {"upper", "lower"}: Mask one triangle of the
matrix to |
cluster_rows |
Logical: Whether to reorder rows via hierarchical clustering. |
cluster_cols |
Logical: Whether to reorder columns via hierarchical clustering. |
dist_method |
Character: Distance method passed to |
hclust_method |
Character: Linkage method passed to |
show_row_dendro |
Logical: Whether to render the row dendrogram panel
when |
show_col_dendro |
Logical: Whether to render the col dendrogram panel
when |
dendro_row_width |
Optional Numeric |
dendro_col_height |
Optional Numeric |
dendro_color |
Optional Character: Stroke color for dendrogram branch
lines. |
dendro_uniform |
Logical: Whether to render dendrograms with uniform level
heights — each merge step occupies equal visual space — rather than heights
proportional to actual merge distances. |
dendro_row_side |
Character {"right", "left"}: Side of the heatmap on which
the row dendrogram is placed. |
dendro_col_side |
Character {"top", "bottom"}: Side of the heatmap on which
the column dendrogram is placed. |
square_cells |
Optional Logical: Whether to compute widget dimensions so
cells are square in the browser and SVG exports. In panels and exports,
the matrix and dendrograms fit within the allocated canvas.
|
colormap |
Optional Character: Color palette — a vector of 2 or more colors
defining the continuous color scale from |
zlim |
Optional Numeric: Length-2 vector |
show_values |
Logical: Whether to print the cell value as a label inside each cell. |
value_digits |
Integer: Decimal places used in cell labels and the tooltip. |
show_colorbar |
Logical: Whether to display the continuous color-scale bar. |
colorbar_orient |
Character {"vertical", "horizontal"}: Orientation of the color bar. |
title |
Optional Character: Chart title. |
theme |
Optional Theme: Theme override. |
margins |
Optional Named numeric vector or named list: Override the
auto-computed heatmap plot-area margins in pixels (or percentage strings)
for any of |
width |
Optional Character or Numeric: Widget width. |
height |
Optional Character or Numeric: Widget height. |
element_id |
Optional Character: Explicit DOM element ID for the widget
container. |
filename |
Optional Character: If provided, save the widget to this file via
|
legend_position |
Character {"top", "bottom", "left", "right", "top-left", "top-right", "bottom-left", "bottom-right"}: Legend anchor. Top/bottom anchors use horizontal rows; left/right anchors use a vertical column. Corner anchors align within the top or bottom row. |
legend_placement |
Character {"outside", "inside"}: Relation to the plotting area. Outside placement reserves space for the complete legend; inside placement overlays the data. Neither setting adds a missing legend. |
row_tree, col_tree
|
Optional hclust, dendrogram or List: Supplied trees.
A plain tree record contains |
cell_notes |
Optional Character matrix: Literal cell notes for hover. Named dimensions align to original matrix identities; otherwise positional. |
row_colors, col_colors
|
Optional Character vector, matrix or Data frame: R colors, one row per matrix row/column and one column per annotation track. Row names, when supplied, match the original matrix identities. |
show_notes |
Logical: Print cell notes instead of numeric value labels. Long notes truncate to the cell width; hover retains the full text. |
row_cut, col_cut
|
Optional Integer: Number of clusters for branch coloring.
A cut requires a supplied or computed tree. Cross-cluster branches stay gray
(or |
Color encoding is driven by a continuous VisualMap component.
Hierarchical clustering is performed in R via hclust(); rows and columns
are reordered accordingly. When cluster_rows or cluster_cols is TRUE
(and the corresponding show_*_dendro flag is not FALSE), a dendrogram
panel is rendered alongside the heatmap as an ECharts custom series.
htmlwidget: Widget object.
draw_heatmap(cor(mtcars[, 1:5]), title = "Correlation")draw_heatmap(cor(mtcars[, 1:5]), title = "Correlation")
Histogram from numeric data, with optional grouping for multiple traces.
Bins are computed using graphics::hist() with consistent break points
across groups. Rectangles span their actual numeric intervals, including
unequal widths. Grouped samples overlap with translucent fills. Intervals
are right-closed, with the lowest edge included, using hist() boundary
tolerance. Missing groups are excluded; empty samples have zero counts.
draw_histogram( x, group = NULL, breaks = "Sturges", palette = NULL, xlab = NULL, ylab = NULL, title = NULL, theme = NULL, margins = DEFAULT_MARGINS, width = NULL, height = NULL, element_id = NULL, filename = NULL, legend_position = "top", legend_placement = "outside", bins = NULL, bin_edges = NULL, normalization = "count", density = FALSE, n = 512L, bw = "nrd0", bandwidth = NULL, kernel = "gaussian", adjust = 1, fill_alpha = 0.25, na_rm = TRUE, verbosity = 1L, mode = "overlap", order = "input", bin_stat = "count", bar_mode = "overlay" )draw_histogram( x, group = NULL, breaks = "Sturges", palette = NULL, xlab = NULL, ylab = NULL, title = NULL, theme = NULL, margins = DEFAULT_MARGINS, width = NULL, height = NULL, element_id = NULL, filename = NULL, legend_position = "top", legend_placement = "outside", bins = NULL, bin_edges = NULL, normalization = "count", density = FALSE, n = 512L, bw = "nrd0", bandwidth = NULL, kernel = "gaussian", adjust = 1, fill_alpha = 0.25, na_rm = TRUE, verbosity = 1L, mode = "overlap", order = "input", bin_stat = "count", bar_mode = "overlay" )
x |
Numeric or List: Values or named numeric vectors to bin. |
group |
Optional Atomic vector or single-column data frame: Grouping variable for multiple series. |
breaks |
Numeric, Character, or Numeric vector: Binning method. A single number (number of bins), a character
string naming an algorithm (e.g. |
palette |
Optional Character: Series colors, overriding the theme
palette for this chart. |
xlab |
Optional Character: X-axis title. |
ylab |
Optional Character: Y-axis title. |
title |
Optional Character: Chart title. |
theme |
Optional Theme: Theme override. |
margins |
Optional Named numeric vector or named list: Plot margins in
pixels (or percentage strings) for any of |
width |
Optional Character or Numeric: Widget width. |
height |
Optional Character or Numeric: Widget height. |
element_id |
Optional Character: Explicit DOM element ID for the widget
container. |
filename |
Optional Character: If provided, save the widget to this file via
|
legend_position |
Character {"top", "bottom", "left", "right", "top-left", "top-right", "bottom-left", "bottom-right"}: Legend anchor. Top/bottom anchors use horizontal rows; left/right anchors use a vertical column. Corner anchors align within the top or bottom row. |
legend_placement |
Character {"outside", "inside"}: Relation to the plotting area. Outside placement reserves space for the complete legend; inside placement overlays the data. Neither setting adds a missing legend. |
bins |
Optional Integer |
bin_edges |
Optional Numeric vector: Finite, strictly increasing edges
spanning every retained observation. Overrides |
normalization |
Character: |
density |
Logical: Overlay a kernel density in histogram units. |
n |
Integer |
bw |
Character or Numeric: Bandwidth selector ( |
bandwidth |
Optional Numeric |
kernel |
Character: One of |
adjust |
Numeric |
fill_alpha |
Numeric |
na_rm |
Logical: Whether to remove |
verbosity |
Integer |
mode |
Character |
order |
Character |
bin_stat |
Character |
bar_mode |
Character |
Normalization is within each sample: "count" is the raw count;
"probability" and "percent" divide by sample size (and multiply by 100
for percent). "density" divides by sample size and bin width, so total
area is one. "count_density" divides only by width, so area is sample size.
Unequal-width bins require one of the two density scales.
With density = TRUE, each curve uses the same settings as draw_density()
and is scaled to the chosen histogram units. Count, probability, and percent
curves multiply the estimated density by the common bin width and the
appropriate sample-size factor. Density/count-density curves need no width
factor. The histogram and curve share a color and legend toggle.
htmlwidget: Widget object.
draw_histogram(iris[["Sepal.Length"]], xlab = "Sepal length")draw_histogram(iris[["Sepal.Length"]], xlab = "Sepal length")
Draw training and validation losses against training progress using a LineConfig. This function accepts an ordinary table and does not require rtemis. Supply a data frame containing its recorded learning curve.
draw_learning_curve( data, unit = attr(data, "unit", exact = TRUE), selected = attr(data, "selected", exact = TRUE), xlab = NULL, ylab = "Loss", title = NULL, theme = NULL, width = NULL, height = NULL, element_id = NULL, filename = NULL, ..., legend_position = "top", legend_placement = "outside" )draw_learning_curve( data, unit = attr(data, "unit", exact = TRUE), selected = attr(data, "selected", exact = TRUE), xlab = NULL, ylab = "Loss", title = NULL, theme = NULL, width = NULL, height = NULL, element_id = NULL, filename = NULL, ..., legend_position = "top", legend_placement = "outside" )
data |
Data frame: Numeric |
unit |
Optional Character: Unit of progress, such as |
selected |
Optional Numeric: Selected step. Read from the table's
|
xlab |
Optional Character: Horizontal axis label, overriding |
ylab |
Optional Character: Vertical axis label. |
title |
Optional Character: Chart title. |
theme |
Optional Theme: Theme override. Set |
width |
Optional Character or Numeric: Widget width. |
height |
Optional Character or Numeric: Widget height. |
element_id |
Optional Character: Explicit DOM element ID for the widget
container. |
filename |
Optional Character: If provided, save the widget to this file via
|
... |
Additional appearance and axis arguments to |
legend_position |
Character {"top", "bottom", "left", "right", "top-left", "top-right", "bottom-left", "bottom-right"}: Legend anchor. Top/bottom anchors use horizontal rows; left/right anchors use a vertical column. Corner anchors align within the top or bottom row. |
legend_placement |
Character {"outside", "inside"}: Relation to the plotting area. Outside placement reserves space for the complete legend; inside placement overlays the data. Neither setting adds a missing legend. |
Steps are sorted numerically. With a tree column, losses are averaged at
each step over trees with a nonmissing loss for that series. Trees that have
stopped contribute no value at later steps. Entirely missing series are
omitted; missing values within a series remain gaps.
The selected point uses training loss if that series exists, otherwise
validation loss. An absent step or missing loss produces no selected marker.
selected = NULL disables it. The marker follows the line config's points
setting, so points = FALSE hides it along with the other point symbols.
For another interface, materialize columns iteration, Training,
Validation, and optionally Selected (missing except at the selected
step), omitting unavailable loss columns. Bind these with setup_LineConfig()
using x = "iteration" and y naming the loss columns. Store the unit as
xlab. That data and config reproduce the chart without R attributes or a
fitted model; aggregation is performed before rendering.
htmlwidget: ECharts learning curve.
losses <- data.frame( iteration = 1:4, loss_training = c(4, 2, 1, 0.5), loss_validation = c(4.5, 2.5, 2, 2.2) ) draw_learning_curve(losses, unit = "epochs", selected = 3)losses <- data.frame( iteration = 1:4, loss_training = c(4, 2, 1, 0.5), loss_validation = c(4.5, 2.5, 2, 2.2) ) draw_learning_curve(losses, unit = "epochs", selected = 3)
Quick line chart from x/y data.
draw_line( x, y, names = NULL, group = NULL, smooth = FALSE, area = FALSE, points = TRUE, blocks = NULL, block_color = NULL, block_opacity = 0.2, palette = NULL, line_style = NULL, pad = DEFAULT_PAD, xlim = NULL, ylim = NULL, square = FALSE, equal_axes = FALSE, xlab = NULL, ylab = NULL, title = NULL, theme = NULL, zoom = FALSE, margins = DEFAULT_MARGINS, width = NULL, height = NULL, element_id = NULL, filename = NULL, legend_position = "top", legend_placement = "outside" )draw_line( x, y, names = NULL, group = NULL, smooth = FALSE, area = FALSE, points = TRUE, blocks = NULL, block_color = NULL, block_opacity = 0.2, palette = NULL, line_style = NULL, pad = DEFAULT_PAD, xlim = NULL, ylim = NULL, square = FALSE, equal_axes = FALSE, xlab = NULL, ylab = NULL, title = NULL, theme = NULL, zoom = FALSE, margins = DEFAULT_MARGINS, width = NULL, height = NULL, element_id = NULL, filename = NULL, legend_position = "top", legend_placement = "outside" )
x |
Vector: X-axis values. Numeric values get a value axis. |
y |
Numeric or named list: Y values. |
names |
Optional Character: Series names used when |
group |
Optional Atomic vector or single-column data frame: Grouping
variable, one value per point. Splits a single |
smooth |
Logical: Whether to smooth lines. |
area |
Logical: Whether to show area fill. |
points |
Logical: Whether to show point markers on each data value.
Defaults to |
blocks |
Optional factor, integer, character, or logical of length
|
block_color |
Optional Character vector or list of length k, where
k is the number of unique levels in |
block_opacity |
Numeric [0, 1]: Fill opacity applied to all bands.
Defaults to |
palette |
Optional Character: Series color palette — a single color string or
character vector that overrides the theme palette for this chart.
|
line_style |
Optional Character {"solid", "dashed", "dotted"}: Line dash style — one value per series, recycled to match the number of series. |
pad |
Numeric |
xlim |
Optional Numeric, Date, or POSIXct [length 2]: X-axis limits
|
ylim |
Optional Numeric [length 2]: Y-axis limits |
square |
Logical: If TRUE, draw the plotting box square – equal height and width in pixels, excluding axis labels and margins. |
equal_axes |
Logical: If TRUE, give one data unit the same size in
pixels on both axes. Set both for a plot that is square and to scale,
such as an ROC curve; the two axes are then made to span the same
interval. Requires a numeric |
xlab |
Optional Character: X-axis title. |
ylab |
Optional Character: Y-axis title. |
title |
Optional Character: Chart title. |
theme |
Optional Theme: Theme override. The palette inside the theme can be
overridden per-chart with the |
zoom |
Logical, DataZoom, or list of DataZoom: Enable x-axis zoom.
|
margins |
Optional Named numeric vector or named list: Plot margins in
pixels (or percentage strings) for any of |
width |
Optional Character or Numeric: Widget width. |
height |
Optional Character or Numeric: Widget height. |
element_id |
Optional Character: Explicit DOM element ID for the widget
container. |
filename |
Optional Character: If provided, save the widget to this file via
|
legend_position |
Character {"top", "bottom", "left", "right", "top-left", "top-right", "bottom-left", "bottom-right"}: Legend anchor. Top/bottom anchors use horizontal rows; left/right anchors use a vertical column. Corner anchors align within the top or bottom row. |
legend_placement |
Character {"outside", "inside"}: Relation to the plotting area. Outside placement reserves space for the complete legend; inside placement overlays the data. Neither setting adds a missing legend. |
Axis baselines emphasize zero only when it is in the visible orthogonal range. Categorical x axes follow the same rule as numeric and time axes.
htmlwidget: Widget object.
square and equal_axes are separate requests. square is about the
shape of the plotting box: equal height and width in pixels, measured on
the box itself, not including axis labels or margins. equal_axes is about
scale: one data unit occupies the same number of pixels on both axes, so a
45-degree line really is a slope of 1.
Either works alone. equal_axes on a chart whose x spans ten units and whose
y spans one gives a wide, short box, which is what equal scaling means there.
Asking for both is a statement about the limits, since the only square box in
which both axes are equally scaled is one whose axes span the same interval.
So both axes are made to span one interval: over all the values when neither
limit was given, or the one you gave when you gave exactly one. Giving both
xlim and ylim as different intervals is an error rather than a silent
override.
The box itself is solved in the browser, which is the only side that knows how wide the container is, and re-solved whenever it resizes.
# An ROC curve is square by nature, on axes that share their [0, 1] range. draw_line( x = c(0, 0.2, 0.6, 1), y = c(0, 0.55, 0.85, 1), square = TRUE, equal_axes = TRUE, xlab = "False positive rate", ylab = "True positive rate" )# An ROC curve is square by nature, on axes that share their [0, 1] range. draw_line( x = c(0, 0.2, 0.6, 1), y = c(0, 0.55, 0.85, 1), square = TRUE, equal_axes = TRUE, xlab = "False positive rate", ylab = "True positive rate" )
Plot signed estimates and raw p-values through SignificanceConfig. The Manhattan view places outcomes in input order; it does not use genomic coordinates. Missing pairs have no marks but remain in the testing family.
draw_manhattan( x, pvals, xnames = NULL, p_adjust_method = "holm", p_transform = "neg_log10", p_thresh = 0.05, x_thresh = 0, annotate_n = 7L, ..., legend_position = "top", legend_placement = "outside", theme = NULL, width = NULL, height = NULL, element_id = NULL, filename = NULL, group = NULL )draw_manhattan( x, pvals, xnames = NULL, p_adjust_method = "holm", p_transform = "neg_log10", p_thresh = 0.05, x_thresh = 0, annotate_n = 7L, ..., legend_position = "top", legend_placement = "outside", theme = NULL, width = NULL, height = NULL, element_id = NULL, filename = NULL, group = NULL )
x |
Numeric vector: Signed estimates; NA values have no plotted mark. |
pvals |
Numeric vector: Raw p-values in |
xnames |
Optional Character vector: One outcome label per estimate. |
p_adjust_method |
Character: Method from stats::p.adjust.methods. Adjustment precedes transformation. |
p_transform |
Character {"neg_log10", "identity", "one_minus"}: Named display transform of adjusted p-values. |
p_thresh |
Numeric (0, 1]: Significance threshold on adjusted p-values; the comparison is strict. |
x_thresh |
Numeric: Effect threshold separating low and high significant results. |
annotate_n |
Integer [0, Inf): Maximum significant feature labels per side in the volcano view, ranked by raw p-value with input-order ties. |
... |
Additional named settings for |
legend_position |
Character {"top", "bottom", "left", "right", "top-left", "top-right", "bottom-left", "bottom-right"}: Legend anchor. Top/bottom anchors use horizontal rows; left/right anchors use a vertical column. Corner anchors align within the top or bottom row. |
legend_placement |
Character {"outside", "inside"}: Relation to the plotting area. Outside placement reserves space for the complete legend; inside placement overlays the data. Neither setting adds a missing legend. |
theme |
Optional Theme: Widget/export theme. |
width, height
|
Optional Numeric or Character: Widget dimensions. |
element_id |
Optional Character: HTML element identifier. |
filename |
Optional Character: Static output path, currently SVG. |
group |
Optional vector: One display-group label per outcome; unset uses significance and direction. Missing groups omit marks but retain the testing family. |
An ECharts htmlwidget.
P-values are adjusted once over the full supplied family before rows with
missing estimates or p-values are omitted from the marks. Missing hypotheses
still count in n_tests; they do not become observed p-values of one.
Raw and adjusted values remain in the compiled data. Function-valued
transforms are not accepted by this portable configuration.
Under neg_log10, zero p-values have infinite mathematical height. They
retain their zero value but are displayed at zero_cap, identified by
triangles and a caption. No positive p-value is clamped. For identity and
one-minus transforms, zeros are finite and no cap is used.
draw_manhattan(c(-2, 0.1, 3), c(0.001, 0.6, 0.002), xnames = c("A", "B", "C"), p_adjust_method = "holm")draw_manhattan(c(-2, 0.1, 3), c(0.001, 0.6, 0.002), xnames = c("A", "B", "C"), p_adjust_method = "holm")
Mid-level builder: takes a MapModel (or a plain list with rows,
resolution, ...) plus styling, assembles a MapLibreOption, and dispatches
through draw(). Most users call draw_choropleth() instead.
draw_map( model, classification = "quantile", colormap = "blues", num_classes = 5, opacity = 1, show_boundaries = TRUE, outline_width = 0.2, show_legend = TRUE, legend_position = "bottom-right", tooltip_position = "top-right", title = NULL, theme = NULL, width = NULL, height = NULL, element_id = NULL, filename = NULL )draw_map( model, classification = "quantile", colormap = "blues", num_classes = 5, opacity = 1, show_boundaries = TRUE, outline_width = 0.2, show_legend = TRUE, legend_position = "bottom-right", tooltip_position = "top-right", title = NULL, theme = NULL, width = NULL, height = NULL, element_id = NULL, filename = NULL )
model |
MapModel or named list: The choropleth data to render. |
classification |
Character {"quantile", "equal", "jenks"}: Class-break
method. |
colormap |
Character: Color ramp. One of the sequential schemes
|
num_classes |
Numeric [2, 12]: Number of color classes. |
opacity |
Numeric [0, 1]: Region fill opacity. |
show_boundaries |
Logical: Whether to draw region outlines. |
outline_width |
Numeric [0, Inf): Region outline width in pixels. |
show_legend |
Logical: Whether to show the legend. |
legend_position |
Character {"top-left", "top-right", "bottom-left", "bottom-right"}: Legend corner. |
tooltip_position |
Character {"top-left", "top-right", "bottom-left", "bottom-right"}: Hover tooltip corner. |
title |
Optional Character: Title (currently surfaced via the value label; reserved for future use). |
theme |
Optional Theme, list, or |
width |
Optional Character or Numeric: Widget width. |
height |
Optional Character or Numeric: Widget height. |
element_id |
Optional Character: Explicit element ID. |
filename |
Optional Character: Static export of map widgets is not yet supported. Supplying a path raises an error. |
htmlwidget.
model <- MapModel( rows = list( MapRow(location = "USA", value = 25.5), MapRow(location = "CAN", value = 12.1) ) ) draw_map(model)model <- MapModel( rows = list( MapRow(location = "USA", value = 25.5), MapRow(location = "CAN", value = 12.1) ) ) draw_map(model)
Draw stored fold scores using BoxplotConfig, with every available observation overlaid. Fold scores carry equal weight; this is a distribution of recorded scores, not a metric recomputed from pooled predictions or a confidence interval. Negative and unbounded metrics such as R-squared are not clipped to the unit interval.
draw_metric( data, metric = NULL, boxpoints = "all", horizontal = FALSE, xlab = if (horizontal) labelify(metric) else NULL, ylab = if (!horizontal) labelify(metric) else NULL, theme = NULL, width = NULL, height = NULL, element_id = NULL, filename = NULL, ..., legend_position = "top", legend_placement = "outside" )draw_metric( data, metric = NULL, boxpoints = "all", horizontal = FALSE, xlab = if (horizontal) labelify(metric) else NULL, ylab = if (!horizontal) labelify(metric) else NULL, theme = NULL, width = NULL, height = NULL, element_id = NULL, filename = NULL, ..., legend_position = "top", legend_placement = "outside" )
data |
Data frame: Long records with character |
metric |
Optional Character: Metric to select. May be omitted when the table contains one metric. |
boxpoints |
Character {"none", "all", "outliers"}: Values to overlay. |
horizontal |
Logical: Draw horizontal distributions. |
xlab, ylab
|
Optional Character: Axis labels. The value axis derives its label from the selected metric when omitted; explicit NULL omits it. |
theme |
Optional Theme: Theme override. The palette inside the theme can be
overridden per-chart with the |
width |
Optional Character or Numeric: Widget width. |
height |
Optional Character or Numeric: Widget height. |
element_id |
Optional Character: Explicit DOM element ID for the widget
container. |
filename |
Optional Character: If provided, save the widget to this file via
|
... |
Additional arguments to |
legend_position |
Character {"top", "bottom", "left", "right", "top-left", "top-right", "bottom-left", "bottom-right"}: Legend anchor. Top/bottom anchors use horizontal rows; left/right anchors use a vertical column. Corner anchors align within the top or bottom row. |
legend_placement |
Character {"outside", "inside"}: Relation to the plotting area. Outside placement reserves space for the complete legend; inside placement overlays the data. Neither setting adds a missing legend. |
Select one metric per chart. Sample and fold order follow first appearance.
Absent sample/fold pairs and explicit NA scores remain missing; available
values alone define each box. Entirely unavailable samples retain an empty
category, and missing values are reported in the console. Entirely
unavailable input is an error. See draw_boxplot() for exact quartile,
whisker, and point-placement semantics.
The portable result uses one numeric column per split and one observation
identifier column, bound through setup_BoxplotConfig(). No fitted object,
R callback, or attribute is needed to render it in another interface.
htmlwidget: Metric distributions with optional point overlays.
scores <- data.frame(fold = rep(c("Fold1", "Fold2", "Fold3"), 2), split = rep(c("Training", "Test"), each = 3), metric = "rsq", value = c(.9, .85, .8, .7, .65, .6)) draw_metric(scores)scores <- data.frame(fold = rep(c("Fold1", "Fold2", "Fold3"), 2), split = rep(c("Training", "Test"), each = 3), metric = "rsq", value = c(.9, .85, .8, .7, .65, .6)) draw_metric(scores)
Render a network with Sigma.js. Accepts either a square weight / adjacency
matrix (e.g. a correlation matrix) or an edge-list data frame, dispatching on
the type of x. Communities are detected with Louvain and laid out with
ForceAtlas2 by default.
draw_network( x, nodes = NULL, directed = FALSE, threshold = NULL, self_loops = FALSE, layout = "force", node_size = 10, edge_scale = 3, node_opacity = 0.95, edge_opacity = 0.4, show_labels = TRUE, scale_by_degree = TRUE, color_by_group = FALSE, resolution = 1, blend_edges = FALSE, palette = palette_colors(rtemis_colors), node_color = rtemis_colors[["teal"]], positive_color = rtemis_colors[["teal"]], negative_color = "#ff9e1f", title = NULL, theme = NULL, width = NULL, height = NULL, element_id = NULL, filename = NULL )draw_network( x, nodes = NULL, directed = FALSE, threshold = NULL, self_loops = FALSE, layout = "force", node_size = 10, edge_scale = 3, node_opacity = 0.95, edge_opacity = 0.4, show_labels = TRUE, scale_by_degree = TRUE, color_by_group = FALSE, resolution = 1, blend_edges = FALSE, palette = palette_colors(rtemis_colors), node_color = rtemis_colors[["teal"]], positive_color = rtemis_colors[["teal"]], negative_color = "#ff9e1f", title = NULL, theme = NULL, width = NULL, height = NULL, element_id = NULL, filename = NULL )
x |
Numeric matrix or data.frame: A square weight / adjacency matrix, or
an edge-list data frame with |
nodes |
Optional Data frame: Node attributes ( |
directed |
Logical: Whether the graph is directed. |
threshold |
Optional Numeric [0, Inf): For matrix input, drop edges whose absolute weight is below this value. |
self_loops |
Logical: For matrix input, whether to keep diagonal self-edges. |
layout |
Character {"force", "circular", "circlepack", "random"}:
Layout algorithm. |
node_size |
Numeric [0, Inf): Base node radius in screen pixels. |
edge_scale |
Numeric [0, Inf): Multiplier mapping normalized edge weight to stroke width. |
node_opacity |
Numeric [0, 1]: Node fill opacity. |
edge_opacity |
Numeric [0, 1]: Edge stroke opacity. |
show_labels |
Logical: Whether to render node labels. |
scale_by_degree |
Logical: Scale each node's radius by its |
color_by_group |
Logical: Color nodes by detected community (Louvain) instead of a single hue. |
resolution |
Numeric [0, Inf): Louvain resolution; higher yields more, smaller communities. |
blend_edges |
Logical: Color each edge as the blend of its two endpoint node colors instead of by sign. |
palette |
Character: Categorical colors for communities. |
node_color |
Character: Single node color used when |
positive_color |
Character: Edge color for positive-sign edges. |
negative_color |
Character: Edge color for negative-sign edges. |
title |
Optional Character: Title shown above the network. |
theme |
Optional Theme, list, or |
width |
Optional Character or Numeric: Widget width. |
height |
Optional Character or Numeric: Widget height. |
element_id |
Optional Character: Explicit element ID. |
filename |
Optional Character: Static export of network widgets is not yet supported. Supplying a path raises an error. |
htmlwidget.
# Correlation matrix draw_network(cor(mtcars), threshold = 0.5) # Edge list edges <- data.frame( source = c("a", "a", "b"), target = c("b", "c", "c"), weight = c(1, 2, 0.5) ) draw_network(edges)# Correlation matrix draw_network(cor(mtcars), threshold = 0.5) # Edge list edges <- data.frame( source = c("a", "a", "b"), target = c("b", "c", "c"), weight = c(1, 2, 0.5) ) draw_network(edges)
Arrange independent ECharts widgets in a row-major grid. Each panel keeps its own legend, tooltips, zoom, axes, and custom layers. No linked zoom or legend selection is implied. SVG export includes all panels in one vector file and uses the same layout calculation as the browser.
draw_panels( plots, ncol = 1L, gap = 12, padding = 0, layout = NULL, width = 900, height = NULL, element_id = NULL, filename = NULL )draw_panels( plots, ncol = 1L, gap = 12, padding = 0, layout = NULL, width = 900, height = NULL, element_id = NULL, filename = NULL )
plots |
List: One or more ECharts widgets from draw_*() functions. |
ncol, gap, padding
|
See PanelLayout. |
layout |
Optional PanelLayout: Complete layout overriding the three convenience settings; do not supply both forms. |
width |
Optional Character or Numeric: Total figure width. |
height |
Optional Numeric: Total figure height. Unset allocates 360 pixels per row plus padding and gaps. |
element_id |
Optional Character: Figure DOM identifier. |
filename |
Optional Character: Export the complete figure with |
Child widget widths and heights are replaced by equally sized layout cells. Fixed-aspect and square-cell heatmap grids fit within both cell dimensions. Dendrograms remain aligned with their heatmap. Give panels enough space for their labels and legends. Explicit child themes are kept; automatic themes follow the browser, and resolve to light for SVG export. Padding and gaps use the common child background when all panels agree; mixed-background figures remain transparent. This also applies to SVG export. Nested layouts, Sigma/MapLibre, and child JavaScript hooks are not supported by this initial composition API.
htmlwidget: A figure containing independent chart panels.
draw_panels(list(draw_bar(c("A", "B"), c(2, 4)), draw_boxplot(list(A = 1:5, B = 3:7), boxpoints = "all")), ncol = 2)draw_panels(list(draw_bar(c("A", "B"), c(2, 4)), draw_boxplot(list(A = 1:5, B = 3:7), boxpoints = "all")), ncol = 2)
Quick pie chart from values and labels.
draw_pie( values, labels = NULL, radius = "75%", rose_type = NULL, palette = NULL, title = NULL, theme = NULL, width = NULL, height = NULL, element_id = NULL, filename = NULL, legend_position = "top", legend_placement = "outside", label_format = "name", percent_digits = 1L )draw_pie( values, labels = NULL, radius = "75%", rose_type = NULL, palette = NULL, title = NULL, theme = NULL, width = NULL, height = NULL, element_id = NULL, filename = NULL, legend_position = "top", legend_placement = "outside", label_format = "name", percent_digits = 1L )
values |
Numeric or data frame: Slice values, or a two-column table containing labels followed by values. Values must be finite and nonnegative with a positive total. |
labels |
Optional Character: Slice labels; names(values) when omitted. |
radius |
Numeric or Character: Pie radius. |
rose_type |
Optional Character {"radius", "area"}: Nightingale chart type. |
palette |
Optional Character: Series color palette — a single color string or
character vector that overrides the theme palette for this chart.
|
title |
Optional Character: Chart title. |
theme |
Optional Theme: Theme override. The palette inside the theme can be
overridden per-chart with the |
width |
Optional Character or Numeric: Widget width. |
height |
Optional Character or Numeric: Widget height. |
element_id |
Optional Character: Explicit DOM element ID for the widget
container. |
filename |
Optional Character: If provided, save the widget to this file via
|
legend_position |
Character {"top", "bottom", "left", "right", "top-left", "top-right", "bottom-left", "bottom-right"}: Legend anchor. Top/bottom anchors use horizontal rows; left/right anchors use a vertical column. Corner anchors align within the top or bottom row. |
legend_placement |
Character {"outside", "inside"}: Relation to the plotting area. Outside placement reserves space for the complete legend; inside placement overlays the data. Neither setting adds a missing legend. |
label_format |
Character |
percent_digits |
Integer |
htmlwidget: Widget object.
draw_pie( values = c(1048, 735, 580), labels = c("Chrome", "Firefox", "Safari") )draw_pie( values = c(1048, 735, 580), labels = c("Chrome", "Firefox", "Safari") )
Adapts sequence strings, residue vectors, protein records, and local JSON to
the shared A3 representation used by draw_a3(). Named legacy annotation
vectors enumerate one-based residues. Region vectors preserve contiguous
runs; isolated region residues are drawn as sites. Modern specifications from
rtemis.a3 annotation_position/annotation_range/annotation_variant are accepted.
The common meander layout, theme, legends, and SVG path match rtemislive.
Fetch accession records explicitly with rtemis.a3 before plotting; a sequence
string never initiates a network request.
draw_protein( x, site = list(), region = list(), ptm = list(), cleavage_site = list(), variant = list(), disease_variants = NULL, ... )draw_protein( x, site = list(), region = list(), ptm = list(), cleavage_site = list(), variant = list(), disease_variants = NULL, ... )
x |
Character, list, or A3: Sequence, protein record, local JSON path, or A3. |
site, region, ptm, cleavage_site
|
List: Named annotation vectors or modern specifications. |
variant |
List: Records with position plus optional variant metadata. |
disease_variants |
Optional Numeric: Disease-associated residue positions. |
... |
Additional display settings passed to |
htmlwidget: Annotated protein diagram.
draw_protein("MAEPRQEFEVMEDHAGTYGLGDRK", site = list(Active = c(5L, 17L)), region = list(Domain = 3:10), ptm = list(Phosphorylation = 2L))draw_protein("MAEPRQEFEVMEDHAGTYGLGDRK", site = list(Active = c(5L, 17L)), region = list(Domain = 3:10), ptm = list(Phosphorylation = 2L))
A convenience view of SignificanceConfig. Adjustment uses the full supplied testing family, including missing slots; missing p-values are not plotted. The reference is at one minus the significance threshold.
draw_pvals( x, xnames = names(x), p_adjust_method = "none", pval_hline = 0.05, ... )draw_pvals( x, xnames = names(x), p_adjust_method = "none", pval_hline = 0.05, ... )
x |
Numeric: P-values in |
xnames |
Optional Character: Feature labels, otherwise names of x. |
p_adjust_method |
Character: A method from stats::p.adjust.methods. |
pval_hline |
Numeric (0, 1): Significance threshold. |
... |
Additional arguments passed to |
htmlwidget: Bars showing one minus adjusted p-values.
draw_pvals(c(A = .01, B = .2, C = .04), p_adjust_method = "holm")draw_pvals(c(A = .01, B = .2, C = .04), p_adjust_method = "holm")
Accepts reference labels and predicted probabilities, matching lists of those
inputs, or a long table with fpr, tpr, and optional auc, class, split,
fold, and omitted columns. Named input lists are matched by name.
draw_roc( true_labels, predicted_prob = NULL, positive = NULL, ..., legend_position = "top", legend_placement = "outside", theme = NULL, width = NULL, height = NULL, element_id = NULL, filename = NULL )draw_roc( true_labels, predicted_prob = NULL, positive = NULL, ..., legend_position = "top", legend_placement = "outside", theme = NULL, width = NULL, height = NULL, element_id = NULL, filename = NULL )
true_labels |
Factor, vector, list, or data frame: Reference labels or ROC records. |
predicted_prob |
Optional Numeric vector, matrix, or list: Class probabilities. |
positive |
Optional Character: Positive class for binary input. |
... |
Additional named settings for |
legend_position |
Character {"top", "bottom", "left", "right", "top-left", "top-right", "bottom-left", "bottom-right"}: Legend anchor. Top/bottom anchors use horizontal rows; left/right anchors use a vertical column. Corner anchors align within the top or bottom row. |
legend_placement |
Character {"outside", "inside"}: Relation to the plotting area. Outside placement reserves space for the complete legend; inside placement overlays the data. Neither setting adds a missing legend. |
theme |
Optional Theme: Chart theme. |
width, height
|
Optional Numeric or Character: Widget dimensions. |
element_id |
Optional Character: HTML element identifier. |
filename |
Optional Character: Static output path, currently SVG. |
Binary input uses the second factor level (second level after factor conversion for
nonfactors), unless positive names the desired class. An unnamed probability
vector/column describes that class. Named columns identify their classes;
multiclass matrices use names, or factor-level order when unnamed.
Multiclass curves are one-versus-rest. Missing labels/scores are excluded
separately for each curve and disclosed. Scores must be probabilities in
[0, 1]; direction is fixed, and tied scores enter together. No observations
are deduplicated, curves smoothed, or vertices downsampled.
An ECharts htmlwidget.
The shared top/outside layout reserves a horizontal band above the plot. Choose an inside corner to overlay the legend on the data.
Vertices are ordered by FPR then TPR and joined without smoothing. Curves
must be monotone and include (0, 0) and (1, 1). Supplied AUC is authoritative
and may describe a higher-resolution curve. Without an AUC binding, the
supplied vertices define trapezoidal AUC. An undefined curve is represented
by missing FPR, TPR, and AUC and is reported in the console when omitted.
Per-resample legends report the unweighted mean and sample SD of defined
fold AUCs, with available/total curve counts. SD is NA for one defined fold.
Pooled AUC is never inferred from per-fold AUCs.
The legend uses the shared position and placement controls. Curve identity
and AUC share a line; long labels wrap to the available width. All entries
remain present in static SVG output, without a scrolling legend.
Hover describes the selected curve, including its resample identifier.
Numeric tooltip labels use digits; coordinates and AUCs retain their full
precision in the compiled data.
draw_roc(factor(c("no", "yes", "no", "yes")), c(.1, .8, .5, .5)) draw_roc(data.frame(fpr = c(0, 0, 1), tpr = c(0, 1, 1)))draw_roc(factor(c("no", "yes", "no", "yes")), c(.1, .8, .5, .5)) draw_roc(data.frame(fpr = c(0, 0, 1), tpr = c(0, 1, 1)))
Sankey diagram from a data frame of directed links. Node names are derived
automatically from the unique values in the source and target columns;
no separate node list is required.
draw_sankey( links, orient = "horizontal", node_width = NULL, node_gap = NULL, node_align = NULL, title = NULL, palette = NULL, link_color = "source", link_opacity = 0.45, margins = NULL, label_font_size = 12, theme = NULL, width = NULL, height = NULL, element_id = NULL, filename = NULL )draw_sankey( links, orient = "horizontal", node_width = NULL, node_gap = NULL, node_align = NULL, title = NULL, palette = NULL, link_color = "source", link_opacity = 0.45, margins = NULL, label_font_size = 12, theme = NULL, width = NULL, height = NULL, element_id = NULL, filename = NULL )
links |
data.frame: Directed links with columns |
orient |
Optional Character {"horizontal", "vertical"}: Flow direction. |
node_width |
Optional Numeric |
node_gap |
Optional Numeric |
node_align |
Optional Character {"justify", "left", "right"}: Node alignment within each column. |
title |
Optional Character: Chart title. |
palette |
Optional Character: Node color palette — a single color string or a character vector that overrides the theme palette for this chart. |
link_color |
Character {"source", "target", "gradient"} or a color:
How ribbons are colored. |
link_opacity |
Numeric |
margins |
Optional named list or numeric: Space around the plotting box,
as any of |
label_font_size |
Numeric: Node label font size in pixels. Also what the derived margins are estimated from. |
theme |
Optional Theme: Theme override. |
width |
Optional Character or Numeric: Widget width. |
height |
Optional Character or Numeric: Widget height. |
element_id |
Optional Character: Explicit DOM element ID for the widget
container. |
filename |
Optional Character: If provided, save the widget to this file
via |
htmlwidget: Widget object.
links <- data.frame( source = c("A", "A", "B", "C"), target = c("B", "C", "D", "D"), value = c(8, 4, 6, 3) ) draw_sankey(links)links <- data.frame( source = c("A", "A", "B", "C"), target = c("B", "C", "D", "D"), value = c(8, 4, 6, 3) ) draw_sankey(links)
Quick scatter plot from x/y data with optional fitted line and confidence band.
draw_scatter( x, y, size = NULL, group = NULL, fit = NULL, fit_params = NULL, se = TRUE, fit_alpha = 0.25, n_fit = 200L, palette = NULL, xlim = NULL, ylim = NULL, pad = DEFAULT_PAD, square = FALSE, equal_axes = FALSE, xlab = NULL, ylab = NULL, title = NULL, theme = NULL, margins = DEFAULT_MARGINS, width = NULL, height = NULL, element_id = NULL, filename = NULL, se_times = 1.96, rsq = FALSE, diagonal = FALSE, diagonal_color = NULL, legend_position = "top", legend_placement = "outside", fit_name = NULL, rug = FALSE, hover = NULL, point_alpha = NULL )draw_scatter( x, y, size = NULL, group = NULL, fit = NULL, fit_params = NULL, se = TRUE, fit_alpha = 0.25, n_fit = 200L, palette = NULL, xlim = NULL, ylim = NULL, pad = DEFAULT_PAD, square = FALSE, equal_axes = FALSE, xlab = NULL, ylab = NULL, title = NULL, theme = NULL, margins = DEFAULT_MARGINS, width = NULL, height = NULL, element_id = NULL, filename = NULL, se_times = 1.96, rsq = FALSE, diagonal = FALSE, diagonal_color = NULL, legend_position = "top", legend_placement = "outside", fit_name = NULL, rug = FALSE, hover = NULL, point_alpha = NULL )
x |
Numeric: X values. |
y |
Numeric: Y values. |
size |
Optional Numeric: Symbol sizes. |
group |
Optional Atomic vector or single-column data frame: Grouping variable for multiple series. |
fit |
Optional Character: Model fitted to |
fit_params |
Optional Named list: Arguments passed to the learner named
in |
se |
Logical: Whether to show the standard-error band. Algorithms without standard errors (every rtemis algorithm except GLM, GAM and a few others) draw the line alone. |
fit_alpha |
Numeric |
n_fit |
Integer |
palette |
Optional Character: Series color palette — a single color string or
character vector that overrides the theme palette for this chart.
When |
xlim |
Optional Numeric [length 2]: X-axis limits |
ylim |
Optional Numeric [length 2]: Y-axis limits |
pad |
Numeric |
square |
Logical: If TRUE, draw the plotting box square – equal height and width in pixels, excluding axis labels and margins. |
equal_axes |
Logical: If TRUE, give one data unit the same size in pixels on both axes. Set both for a plot that is square and to scale, such as a true-versus-predicted plot whose identity line should run at 45 degrees; the two axes are then made to span the same interval. See Details. |
xlab |
Optional Character: X-axis title. |
ylab |
Optional Character: Y-axis title. |
title |
Optional Character: Chart title. |
theme |
Optional Theme: Theme override. The palette inside the theme can be
overridden per-chart with the |
margins |
Optional Named numeric vector or named list: Plot margins in
pixels (or percentage strings) for any of |
width |
Optional Character or Numeric: Widget width. |
height |
Optional Character or Numeric: Widget height. |
element_id |
Optional Character: Explicit DOM element ID for the widget
container. |
filename |
Optional Character: If provided, save the widget to this file via
|
se_times |
Numeric |
rsq |
Logical: Include the fitted model's R-squared in series labels.
This describes the overlay fit, not predictive performance against the
identity line. Constant responses have undefined R-squared, labeled |
diagonal |
Logical: Draw a dashed identity line within the axis limits. |
diagonal_color |
Optional Character: Identity-line color. |
legend_position |
Character {"top", "bottom", "left", "right", "top-left", "top-right", "bottom-left", "bottom-right"}: Legend anchor. Top/bottom anchors use horizontal rows; left/right anchors use a vertical column. Corner anchors align within the top or bottom row. |
legend_placement |
Character {"outside", "inside"}: Relation to the plotting area. Outside placement reserves space for the complete legend; inside placement overlays the data. Neither setting adds a missing legend. |
fit_name |
Optional Character: Label for fitted layers. |
rug |
Logical: Draw marginal marks on both axes. |
hover |
Optional Character: One literal tooltip label per observation. |
point_alpha |
Optional Numeric |
htmlwidget: Widget object.
square and equal_axes are separate requests. square is about the
shape of the plotting box: equal height and width in pixels, measured on
the box itself, not including axis labels or margins. equal_axes is about
scale: one data unit occupies the same number of pixels on both axes, so a
45-degree line really is a slope of 1.
Either works alone. equal_axes on a chart whose x spans ten units and whose
y spans one gives a wide, short box, which is what equal scaling means there.
Asking for both is a statement about the limits, since the only square box in
which both axes are equally scaled is one whose axes span the same interval.
So both axes are made to span one interval: over all the values when neither
limit was given, or the one you gave when you gave exactly one. Giving both
xlim and ylim as different intervals is an error rather than a silent
override.
The box itself is solved in the browser, which is the only side that knows how wide the container is, and re-solved whenever it resizes.
# True versus predicted: square box, equal scale, identity line at 45 deg. draw_scatter( x = c(1, 2, 3, 4), y = c(1.1, 1.9, 3.4, 3.7), square = TRUE, equal_axes = TRUE, xlab = "True", ylab = "Predicted" )# True versus predicted: square box, equal scale, identity line at 45 deg. draw_scatter( x = c(1, 2, 3, 4), y = c(1.1, 1.9, 3.4, 3.7), square = TRUE, equal_axes = TRUE, xlab = "True", ylab = "Predicted" )
Uses ECharts-GL in the browser and vector circles, paths, and text for SVG. The saved view uses the configured camera, not later browser rotations. Points omit missing coordinate/group rows together. Missing coordinates break paths within each group; groups keep their input order. A data frame or matrix can supply the coordinates in its first three columns, which must be numeric.
draw_scatter3d( x, y = NULL, z = NULL, group = NULL, ..., theme = NULL, width = NULL, height = NULL, element_id = NULL, filename = NULL )draw_scatter3d( x, y = NULL, z = NULL, group = NULL, ..., theme = NULL, width = NULL, height = NULL, element_id = NULL, filename = NULL )
x |
Numeric, matrix, or data frame: X values, or three coordinate columns. |
y, z
|
Optional Numeric: Y and Z values for vector x. |
group |
Optional vector: Group identities. |
... |
Additional settings passed to |
theme |
Optional Theme: Theme override. The palette inside the theme can be
overridden per-chart with the |
width |
Optional Character or Numeric: Widget width. |
height |
Optional Character or Numeric: Widget height. |
element_id |
Optional Character: Explicit DOM element ID for the widget
container. |
filename |
Optional Character: If provided, save the widget to this file via
|
htmlwidget: Interactive, exportable 3D drawing.
draw_scatter3d(iris[1:3], group = iris$Species)draw_scatter3d(iris[1:3], group = iris$Species)
Renders an interactive time-frequency spectrogram as an ECharts heatmap
widget. Accepts either a raw signal vector (STFT is computed internally via
signal::specgram()) or a pre-computed spectrogram matrix (freq x time).
draw_spectrogram( x, sample_rate = NULL, time = NULL, frequency = NULL, n_fft = 256L, window = "hanning", overlap = NULL, power = TRUE, db = TRUE, db_range = 80, freq_scale = "linear", freq_range = NULL, freq_unit = "Hz", time_range = NULL, time_unit = "s", colormap = "magma", colormap_reverse = FALSE, n_colors = 256L, zlim = NULL, show_colorbar = TRUE, colorbar_title = NULL, title = NULL, xlab = NULL, ylab = NULL, theme = NULL, margins = NULL, width = NULL, height = NULL, element_id = NULL, filename = NULL, verbosity = 1L, legend_position = "right", legend_placement = "outside" )draw_spectrogram( x, sample_rate = NULL, time = NULL, frequency = NULL, n_fft = 256L, window = "hanning", overlap = NULL, power = TRUE, db = TRUE, db_range = 80, freq_scale = "linear", freq_range = NULL, freq_unit = "Hz", time_range = NULL, time_unit = "s", colormap = "magma", colormap_reverse = FALSE, n_colors = 256L, zlim = NULL, show_colorbar = TRUE, colorbar_title = NULL, title = NULL, xlab = NULL, ylab = NULL, theme = NULL, margins = NULL, width = NULL, height = NULL, element_id = NULL, filename = NULL, verbosity = 1L, legend_position = "right", legend_placement = "outside" )
x |
Numeric matrix (freq x time) or numeric vector (raw signal).
A matrix is used directly; |
sample_rate |
Optional Numeric |
time |
Optional Numeric: Time axis values in seconds, length |
frequency |
Optional Numeric: Frequency axis values in Hz, length
|
n_fft |
Integer |
window |
Character {"hanning", "hamming", "blackman", "bartlett",
"rectangular"} or Numeric: Window function name or a pre-built window
vector. Passed to |
overlap |
Optional Integer |
power |
Logical: Treat spectral values as power ( |
db |
Logical: Convert to dB. For power: |
db_range |
Numeric |
freq_scale |
Character {"linear", "log"}: Frequency axis scale. With
|
freq_range |
Optional Numeric[2]: Frequency range to display in Hz,
e.g. |
freq_unit |
Character {"Hz", "kHz"}: Unit for the frequency axis. |
time_range |
Optional Numeric[2]: Time range to display in seconds. |
time_unit |
Character {"s", "ms"}: Unit for the time axis. |
colormap |
Character: Color palette. Accepts a viridisLite colormap
name ( |
colormap_reverse |
Logical: Reverse the colormap direction. |
n_colors |
Integer |
zlim |
Optional Numeric[2]: Color-scale limits after all transformations (dB clipping, unit conversion). Defaults to the data range. |
show_colorbar |
Logical: Show the continuous visual-map colorbar. |
colorbar_title |
Optional Character: Colorbar label. Default: |
title |
Optional Character: Chart title. |
xlab |
Optional Character: X-axis label. Default: |
ylab |
Optional Character: Y-axis label. Default: |
theme |
Optional Theme, list, or |
margins |
Optional Named numeric or character vector / list: Plot
margins in pixels. Valid names: |
width |
Optional Numeric or Character: Widget width. |
height |
Optional Numeric or Character: Widget height. |
element_id |
Optional Character: Explicit DOM element ID for the widget
container. |
filename |
Optional Character: If provided, the widget is saved via
|
verbosity |
Integer |
legend_position |
Character {"top", "bottom", "left", "right", "top-left", "top-right", "bottom-left", "bottom-right"}: Legend anchor. Top/bottom anchors use horizontal rows; left/right anchors use a vertical column. Corner anchors align within the top or bottom row. |
legend_placement |
Character {"outside", "inside"}: Relation to the plotting area. Outside placement reserves space for the complete legend; inside placement overlays the data. Neither setting adds a missing legend. |
Corresponds to HeatmapSeriesOption in src/chart/heatmap/HeatmapSeries.ts.
ECharts docs: https://echarts.apache.org/en/option.html#series-heatmap
htmlwidget
if (requireNamespace("signal", quietly = TRUE)) { t_vec <- seq(0, 2, by = 1 / 8000) sig <- signal::chirp(t_vec, 200, 2, 2000) draw_spectrogram(sig, sample_rate = 8000) }if (requireNamespace("signal", quietly = TRUE)) { t_vec <- seq(0, 2, by = 1 / 8000) sig <- signal::chirp(t_vec, 200, 2, 2000) draw_spectrogram(sig, sample_rate = 8000) }
Adapt single-state survival::survfit estimates to draw_survival(). Stratum
labels, estimator-defined starting time, confidence bounds, and censor counts
are preserved. Matrix-valued predicted curves must be selected one at a time;
multistate and interval-censored fits require a different plotting contract.
draw_survfit(x, ..., risk_times = NULL, risk_table = !is.null(risk_times))draw_survfit(x, ..., risk_times = NULL, risk_table = !is.null(risk_times))
x |
survfit: Fitted right-censored or counting-process survival curves. |
... |
Additional named arguments for |
risk_times |
Optional Numeric vector: Times for risk-table counts.
Automatic counts require an ordinary right-censored fit. For delayed entry,
pass separately computed risk records through |
risk_table |
Logical: Draw risk counts. If requested without explicit times, uses approximately five evenly spaced times within the fit's range. |
An ECharts htmlwidget with native SVG export.
fit <- survival::survfit(survival::Surv(time, status) ~ sex, data = survival::lung) draw_survfit(fit, risk_times = c(0, 250, 500, 750, 1000))fit <- survival::survfit(survival::Surv(time, status) ~ sex, data = survival::lung) draw_survfit(fit, risk_times = c(0, 250, 500, 750, 1000))
Use draw_survfit() to draw fitted R survival objects. This interface accepts
portable records and does not require the survival package.
draw_survival( data, ..., group = NULL, lower = NULL, upper = NULL, n_censor = NULL, n_risk = NULL, legend_position = "top", legend_placement = "outside", theme = NULL, width = NULL, height = NULL, element_id = NULL, filename = NULL )draw_survival( data, ..., group = NULL, lower = NULL, upper = NULL, n_censor = NULL, n_risk = NULL, legend_position = "top", legend_placement = "outside", theme = NULL, width = NULL, height = NULL, element_id = NULL, filename = NULL )
data |
Data frame or list: Curve records, or |
... |
Additional named settings for |
group, lower, upper, n_censor, n_risk
|
Optional Character: Column bindings. When omitted, a column with the matching name is used if present. Explicit NULL disables that binding. |
legend_position |
Character {"top", "bottom", "left", "right", "top-left", "top-right", "bottom-left", "bottom-right"}: Legend anchor. Top/bottom anchors use horizontal rows; left/right anchors use a vertical column. Corner anchors align within the top or bottom row. |
legend_placement |
Character {"outside", "inside"}: Relation to the plotting area. Outside placement reserves space for the complete legend; inside placement overlays the data. Neither setting adds a missing legend. |
theme |
Optional Theme: Chart theme. |
width, height
|
Optional Numeric or Character: Widget dimensions. |
element_id |
Optional Character: HTML element identifier. |
filename |
Optional Character: Static output path, currently SVG. |
An ECharts htmlwidget with native SVG export.
Supply a curve data frame, or a list with curves and optional risk data
frames. Each curve row contains time and survival probability, with optional
group, pointwise lower/upper confidence bounds, censor counts, and risk counts.
Include the initial time/probability explicitly: the renderer never invents
an origin. Records are sorted within groups; times must be unique and finite,
probabilities nonincreasing in [0, 1]. Curves are right-continuous and stop at
their last recorded time. Missing confidence bounds produce gaps, not zeros.
A censor tick represents one or more censored observations at that time;
its tooltip retains the supplied count. Counts may be fractional for weights.
Median survival is the first crossing of 0.5; a plateau at 0.5 uses its
midpoint, including the last follow-up time if the plateau is terminal.
Comparisons to 0.5 use tolerance sqrt(.Machine$double.eps), as in survival.
Landmarks outside a group's observed time range are omitted without
extrapolation. Display precision never rounds plotted coordinates.
Risk records have fixed columns time, group, and n_risk, and state the
risk count immediately before the specified time. They must cover the same
unique times in each group. Unknown counts use NA and display as NA.
The renderer does not interpolate or infer risk sets from the curves.
All layers belonging to a group share its legend toggle, including risk rows.
draw_survival(data.frame(time = c(0, 1, 3), survival = c(1, .8, .4)))draw_survival(data.frame(time = c(0, 1, 3), survival = c(1, .8, .4)))
Draw Time Series with Rolling Summaries
draw_ts( x, time, window = 7L, group = NULL, roll_fn = "mean", align = "center", ..., theme = NULL, width = NULL, height = NULL, element_id = NULL, filename = NULL )draw_ts( x, time, window = 7L, group = NULL, roll_fn = "mean", align = "center", ..., theme = NULL, width = NULL, height = NULL, element_id = NULL, filename = NULL )
x |
Numeric or named list: Observations. |
time |
Numeric, Date, POSIXct, or list: Shared or per-series times. |
window |
Integer |
group |
Optional vector: Group identities for one series. |
roll_fn |
Character |
align |
Character |
... |
Additional settings passed to |
theme |
Optional Theme: Theme override. The palette inside the theme can be
overridden per-chart with the |
width |
Optional Character or Numeric: Widget width. |
height |
Optional Character or Numeric: Widget height. |
element_id |
Optional Character: Explicit DOM element ID for the widget
container. |
filename |
Optional Character: If provided, save the widget to this file via
|
htmlwidget: Raw observations and rolling curves with shared group legends.
draw_ts(BOD$demand, BOD$Time, window = 3L)draw_ts(BOD$demand, BOD$Time, window = 3L)
Draw signed importance summaries with BarConfig, or fold distributions
with BoxplotConfig using type = "boxplot". Numeric input
uses its names as variable labels, or row numbers when unnamed. Tables
preserve named measures and optionally identify resamples with fold.
draw_varimp( x, measure = NULL, top_n = 20L, rank_by = "magnitude", summary = "mean", absent = "missing", folds = NULL, horizontal = TRUE, xlab = NULL, ylab = NULL, title = NULL, theme = NULL, width = NULL, height = NULL, element_id = NULL, filename = NULL, type = "bar", decreasing = TRUE, ..., legend_position = "top", legend_placement = "outside" )draw_varimp( x, measure = NULL, top_n = 20L, rank_by = "magnitude", summary = "mean", absent = "missing", folds = NULL, horizontal = TRUE, xlab = NULL, ylab = NULL, title = NULL, theme = NULL, width = NULL, height = NULL, element_id = NULL, filename = NULL, type = "bar", decreasing = TRUE, ..., legend_position = "top", legend_placement = "outside" )
x |
Numeric vector, single-column matrix, or data frame: Importance
scores. Tables require |
measure |
Optional Character: Measure column. NULL selects the first
column other than |
top_n |
Optional Integer |
rank_by |
Character {"magnitude", "signed"}: Rank by absolute or signed summary, respectively. |
summary |
Character {"mean", "median"}: Summary across folds. |
absent |
Character {"missing", "zero"}: Meaning of omitted variable rows within a fold reporting the selected measure. |
folds |
Optional Character: Full set of fold IDs, including folds with
no rows. NULL uses the IDs observed in the |
horizontal |
Logical: Draw horizontal bars or boxes. |
xlab, ylab
|
Optional Character: Physical axis labels. NULL derives the score label from the measure and summary and labels the variable axis. |
title |
Optional Character: Chart title. |
theme |
Optional Theme: Theme override. Set |
width |
Optional Character or Numeric: Widget width. |
height |
Optional Character or Numeric: Widget height. NULL allocates space per selected variable for horizontal bars. |
element_id |
Optional Character: Explicit DOM element ID for the widget
container. |
filename |
Optional Character: If provided, save the widget to this file via
|
type |
Character {"bar", "boxplot"}: Summary or fold-distribution view. |
decreasing |
Logical: Select and display ranks from largest to smallest. FALSE selects and displays the smallest ranks first. |
... |
Additional settings for |
legend_position |
Character {"top", "bottom", "left", "right", "top-left", "top-right", "bottom-left", "bottom-right"}: Legend anchor. Top/bottom anchors use horizontal rows; left/right anchors use a vertical column. Corner anchors align within the top or bottom row. |
legend_placement |
Character {"outside", "inside"}: Relation to the plotting area. Outside placement reserves space for the complete legend; inside placement overlays the data. Neither setting adds a missing legend. |
Resampled scores are summarized before selection. Magnitude ranking uses
the absolute summary, not the mean absolute fold score. Signed ranking uses
the summary itself. decreasing = FALSE selects the smallest ranks first.
Ties retain first appearance in the input. The first selected variable
appears at the top of horizontal bars or the left of
vertical bars or boxes. Zero scores are retained. For distributions, the
summary controls selection and ordering only; boxes use the fold values.
Ranking direction is never inferred from a measure name. For smaller-is-better
scores, use rank_by = "signed", decreasing = FALSE. Averaging fold p-values
does not produce a combined p-value; choose a suitable summary outside this
function when the score's interpretation requires it.
Set bar_width to a pixel thickness for separate zero-to-score segments.
This uses native bars and covers the legacy importance type = "line"
geometry without connecting different variables or adding a new chart type.
Explicit NA scores and wholly unavailable folds are excluded from each
variable's summary. Variables with no available score are omitted.
absent = "zero" declares that omitted variable rows mean known zero scores
within folds reporting that measure. It never replaces an explicit NA or a
wholly unavailable fold/measure with zero. Use it only for sparse importance
tables whose producer omits zero entries. Infinite scores are rejected.
Means and medians give each contributing fold equal weight. An incomplete summary describes the available folds, not an estimate guaranteed to be unbiased for all folds. Incomplete fold coverage is reported in the console; chart labels retain only the variable and measure names. The input is never modified.
Boxplots require fold-level records. Every available score (including known
structural zeros) is overlaid by default, with its fold ID in the tooltip.
Missing values remain missing in the materialized table and are reported in
the console. Boxes describe resample variability, not a confidence interval.
See draw_boxplot() for quartiles, whiskers, and point placement. Use
whisker = 0 for full-range whiskers, as in the current live importance view.
For portable rendering, materialize the selected, summarized label
and importance columns in display order and bind them using
setup_BarConfig(x = "label", y = "importance"). Preserve variable IDs and
contributing/total fold counts alongside these columns. Set horizontal,
axis labels, and title explicitly. That table and config reproduce the view
without a fitted model or R callbacks. The raw-data summary and selection
options are not yet part of a shared visualization schema. For distributions,
use one numeric column per selected variable and an observation column for
the complete fold universe. Bind those columns and the variable
labels through setup_BoxplotConfig(). Only selected variables are widened;
selection does not discard folds needed to identify structural zeros.
htmlwidget: ECharts importance bars or fold distributions.
draw_varimp(c(age = 0.8, weight = -0.4, height = 0.2)) scores <- data.frame( variable = c("age", "weight", "age"), fold = c("A", "A", "B"), gain = c(0.8, 0.4, 0.6) ) draw_varimp(scores, measure = "gain", absent = "zero") draw_varimp(scores, measure = "gain", type = "boxplot", absent = "zero")draw_varimp(c(age = 0.8, weight = -0.4, height = 0.2)) scores <- data.frame( variable = c("age", "weight", "age"), fold = c("A", "A", "B"), gain = c(0.8, 0.4, 0.6) ) draw_varimp(scores, measure = "gain", absent = "zero") draw_varimp(scores, measure = "gain", type = "boxplot", absent = "zero")
A convenience entry point for draw_boxplot() with violin geometry.
Smoothing, grouping, observation overlays, paired lines, comparisons, and
vector export follow the same contract.
draw_violin(x, ..., show_box = FALSE)draw_violin(x, ..., show_box = FALSE)
x |
Numeric or List: Numeric vectors, one per box; named lists supply
category labels. With |
... |
Arguments passed to |
show_box |
Logical: Overlay a narrow box on each violin. |
htmlwidget: Vector violin distributions.
draw_violin(iris["Sepal.Length"], group = iris[["Species"]], show_box = TRUE)draw_violin(iris["Sepal.Length"], group = iris[["Species"]], show_box = TRUE)
Plot signed estimates and raw p-values through SignificanceConfig. The Manhattan view places outcomes in input order; it does not use genomic coordinates. Missing pairs have no marks but remain in the testing family.
draw_volcano( x, pvals, xnames = NULL, p_adjust_method = "holm", p_transform = "neg_log10", p_thresh = 0.05, x_thresh = 0, annotate_n = 7L, ..., legend_position = "top", legend_placement = "outside", theme = NULL, width = NULL, height = NULL, element_id = NULL, filename = NULL, group = NULL )draw_volcano( x, pvals, xnames = NULL, p_adjust_method = "holm", p_transform = "neg_log10", p_thresh = 0.05, x_thresh = 0, annotate_n = 7L, ..., legend_position = "top", legend_placement = "outside", theme = NULL, width = NULL, height = NULL, element_id = NULL, filename = NULL, group = NULL )
x |
Numeric vector: Signed estimates; NA values have no plotted mark. |
pvals |
Numeric vector: Raw p-values in |
xnames |
Optional Character vector: One outcome label per estimate. |
p_adjust_method |
Character: Method from stats::p.adjust.methods. Adjustment precedes transformation. |
p_transform |
Character {"neg_log10", "identity", "one_minus"}: Named display transform of adjusted p-values. |
p_thresh |
Numeric (0, 1]: Significance threshold on adjusted p-values; the comparison is strict. |
x_thresh |
Numeric: Effect threshold separating low and high significant results. |
annotate_n |
Integer [0, Inf): Maximum significant feature labels per side in the volcano view, ranked by raw p-value with input-order ties. |
... |
Additional named settings for |
legend_position |
Character {"top", "bottom", "left", "right", "top-left", "top-right", "bottom-left", "bottom-right"}: Legend anchor. Top/bottom anchors use horizontal rows; left/right anchors use a vertical column. Corner anchors align within the top or bottom row. |
legend_placement |
Character {"outside", "inside"}: Relation to the plotting area. Outside placement reserves space for the complete legend; inside placement overlays the data. Neither setting adds a missing legend. |
theme |
Optional Theme: Widget/export theme. |
width, height
|
Optional Numeric or Character: Widget dimensions. |
element_id |
Optional Character: HTML element identifier. |
filename |
Optional Character: Static output path, currently SVG. |
group |
Optional vector: One display-group label per outcome; unset uses significance and direction. Missing groups omit marks but retain the testing family. |
An ECharts htmlwidget.
P-values are adjusted once over the full supplied family before rows with
missing estimates or p-values are omitted from the marks. Missing hypotheses
still count in n_tests; they do not become observed p-values of one.
Raw and adjusted values remain in the compiled data. Function-valued
transforms are not accepted by this portable configuration.
Under neg_log10, zero p-values have infinite mathematical height. They
retain their zero value but are displayed at zero_cap, identified by
triangles and a caption. No positive p-value is clamped. For identity and
one-minus transforms, zeros are finite and no cap is used.
draw_volcano(c(-2, 0.1, 3), c(0.001, 0.6, 0.002), xnames = c("A", "B", "C"), p_adjust_method = "holm")draw_volcano(c(-2, 0.1, 3), c(0.001, 0.6, 0.002), xnames = c("A", "B", "C"), p_adjust_method = "holm")
Draw Independent Time Series on Two Value Axes
draw_xt( x, y, x2 = NULL, y2 = NULL, shade_interval = list(), shade_bin = NULL, zt = NULL, show_zt_every = 1L, ..., theme = NULL, width = NULL, height = NULL, element_id = NULL, filename = NULL )draw_xt( x, y, x2 = NULL, y2 = NULL, shade_interval = list(), shade_bin = NULL, zt = NULL, show_zt_every = 1L, ..., theme = NULL, width = NULL, height = NULL, element_id = NULL, filename = NULL )
x, y
|
Numeric, temporal vector, or named list: Primary time/value records. |
x2, y2
|
Optional vector or list: Secondary records, with independent times. When x2 is unset, secondary values share x. |
shade_interval |
List: Increasing intervals on the x scale, in epoch
milliseconds for Date/POSIXct axes. Applied using |
shade_bin |
Optional Numeric: Zero/one shading flags aligned with x. Mutually exclusive with shade_interval; contiguous runs span their first and last observation. A single observation has zero interval width. |
zt |
Optional Numeric: Zeitgeber labels aligned with a single x vector. |
show_zt_every |
Integer |
... |
Additional settings passed to |
theme |
Optional Theme: Theme override. The palette inside the theme can be
overridden per-chart with the |
width |
Optional Character or Numeric: Widget width. |
height |
Optional Character or Numeric: Widget height. |
element_id |
Optional Character: Explicit DOM element ID for the widget
container. |
filename |
Optional Character: If provided, save the widget to this file via
|
htmlwidget: Independent series sharing the time axis.
draw_xt(1:5, list(Temperature = 20:24), y2 = list(Pressure = 100:104))draw_xt(1:5, list(Temperature = 20:24), y2 = list(Pressure = 100:104))
Shiny output for draw widget
drawOutput(outputId, width = "100%", height = "400px")drawOutput(outputId, width = "100%", height = "400px")
outputId |
Character: Shiny output ID. |
width |
Character or Numeric: CSS width. |
height |
Character or Numeric: CSS height. |
Shiny output element for a draw widget.
if (requireNamespace("shiny", quietly = TRUE)) { drawOutput("chart", height = "600px") }if (requireNamespace("shiny", quietly = TRUE)) { drawOutput("chart", height = "600px") }
The top-level configuration object passed to echarts.setOption().
Holds all chart components, series, and global settings.
EChartsOption( title = NULL, legend = NULL, x_axis_3d = NULL, y_axis_3d = NULL, z_axis_3d = NULL, grid_3d = NULL, grid = NULL, x_axis = NULL, y_axis = NULL, tooltip = NULL, visual_map = NULL, graphic = NULL, toolbox = NULL, data_zoom = NULL, series = NULL, color = NULL, background_color = NULL, text_style = NULL, animation = NULL, animation_threshold = NULL, animation_duration = NULL, animation_easing = NULL, animation_delay = NULL, dark_mode = NULL, use_utc = NULL )EChartsOption( title = NULL, legend = NULL, x_axis_3d = NULL, y_axis_3d = NULL, z_axis_3d = NULL, grid_3d = NULL, grid = NULL, x_axis = NULL, y_axis = NULL, tooltip = NULL, visual_map = NULL, graphic = NULL, toolbox = NULL, data_zoom = NULL, series = NULL, color = NULL, background_color = NULL, text_style = NULL, animation = NULL, animation_threshold = NULL, animation_duration = NULL, animation_easing = NULL, animation_delay = NULL, dark_mode = NULL, use_utc = NULL )
title |
Optional Title or list: Title configuration. |
legend |
Optional Legend or list: Legend configuration. |
x_axis_3d, y_axis_3d, z_axis_3d, grid_3d
|
Optional List: ECharts-GL cartesian axes and grid, as defined by its Axis3D and Grid3DModel sources. |
grid |
Optional Grid or list: Grid configuration. |
x_axis |
Optional Axis or list: X-axis configuration ( |
y_axis |
Optional Axis or list: Y-axis configuration ( |
tooltip |
Optional Tooltip: Tooltip configuration. |
visual_map |
Optional VisualMap or list: Visual map configuration ( |
graphic |
Optional list: Native graphic annotations, corresponding to
|
toolbox |
Optional list: Toolbox configuration ( |
data_zoom |
Optional DataZoom or list of DataZoom: Axis zoom
component(s) ( |
series |
Optional series object or list: Series configuration (LineSeries, BarSeries, ScatterSeries, PieSeries, BoxplotSeries, HeatmapSeries). |
color |
Optional Character: Color palette. |
background_color |
Optional Character: Chart background color. |
text_style |
Optional TextStyle: Global default text style. |
animation |
Optional Logical: Whether to enable animation. |
animation_threshold |
Optional Numeric |
animation_duration |
Optional Numeric |
animation_easing |
Optional Character: Animation easing function name. |
animation_delay |
Optional Numeric |
dark_mode |
Optional Logical or Character {"auto"}: Dark-mode setting. |
use_utc |
Optional Logical: Whether to use UTC for time axes. |
Corresponds to EChartsOption in src/export/option.ts (line 258)
and ECUnitOption in src/util/types.ts (line 697).
EChartsOption object.
EChartsOption( title = Title(text = "Weekly sessions"), x_axis = Axis(type = "category", data = c("Mon", "Tue", "Wed")), y_axis = Axis(type = "value"), series = LineSeries(data = c(150, 230, 224), smooth = TRUE) )EChartsOption( title = Title(text = "Weekly sessions"), x_axis = Axis(type = "category", data = c("Mon", "Tue", "Wed")), y_axis = Axis(type = "value"), series = LineSeries(data = c(150, 230, 224), smooth = TRUE) )
Coordinates and optional interval bounds for a fitted curve, independent of the model or language that produced it. Uses LineSeriesOption and CustomSeriesOption in ECharts src/chart/line and src/chart/custom. Rows are sorted together by x. Missing predictions must be removed before construction; use separate layers for disconnected intervals. No fitting is performed here.
FitLayer( x = c(0, 1), y = c(0, 1), lower = NULL, upper = NULL, name = "Fit", color = "#6ca3a0", line_width = 2, opacity = 0.2, x_axis = 0L, y_axis = 0L )FitLayer( x = c(0, 1), y = c(0, 1), lower = NULL, upper = NULL, name = "Fit", color = "#6ca3a0", line_width = 2, opacity = 0.2, x_axis = 0L, y_axis = 0L )
x, y
|
Numeric: Finite curve coordinates with distinct x values. |
lower, upper
|
Optional Numeric: Paired finite interval bounds at every x. |
name |
Character: Legend label; a matching observation label links selection. |
color |
Character: Curve and interval color. |
line_width |
Numeric |
opacity |
Numeric |
x_axis, y_axis
|
Integer |
FitLayer: Validated, serializable prediction geometry.
FitLayer(x = 1:3, y = c(2, 4, 5), lower = c(1, 3, 4), upper = c(3, 5, 6))FitLayer(x = 1:3, y = c(2, 4, 5), lower = c(1, 3, 4), upper = c(3, 5, 6))
A serializable description of a Gantt chart. Build one with
setup_GanttConfig() rather than calling this constructor directly.
GanttConfig( dat_path = NULL, title = NULL, origin = NULL, writer = NULL, legend_position = "top", legend_placement = "outside", label = "label", start = "start", end = "end", group = NULL, tooltip = NULL, border = NULL, axis_type = "value", zoom = TRUE, guides = TRUE, bar_height = 0.6, bar_radius = 0, border_color = "#E53935", border_width = 1.5, palette = NULL, xlab = NULL )GanttConfig( dat_path = NULL, title = NULL, origin = NULL, writer = NULL, legend_position = "top", legend_placement = "outside", label = "label", start = "start", end = "end", group = NULL, tooltip = NULL, border = NULL, axis_type = "value", zoom = TRUE, guides = TRUE, bar_height = 0.6, bar_radius = 0, border_color = "#E53935", border_width = 1.5, palette = NULL, xlab = NULL )
dat_path |
Optional Character: Path to the data, read at draw time. The
serializable alternative to passing |
title |
Optional Character: Chart title. Declared here because it is the
one property every chart type has; |
origin |
Optional Named character {"user", "default", "derived"}: Where each value came from, one entry per settable property. Absent on an authored config; written by the interface that resolved it. |
writer |
Optional Named character: Which interface wrote the config, as
|
legend_position |
Character {"top", "bottom", "left", "right", "top-left", "top-right", "bottom-left", "bottom-right"}: Legend anchor. Top/bottom anchors use horizontal rows; left/right anchors use a vertical column. Corner anchors align within the top or bottom row. |
legend_placement |
Character {"outside", "inside"}: Relation to the plotting area. Outside placement reserves space for the complete legend; inside placement overlays the data. Neither setting adds a missing legend. |
label |
Character: Column naming each task. |
start |
Character: Column holding each task's start. |
end |
Character: Column holding each task's end. |
group |
Optional Character: Column to color bars by. |
tooltip |
Optional Character: Column holding per-bar tooltip text. |
border |
Optional Character: Logical column; |
axis_type |
Character {"value", "time"}: How the time axis is scaled. |
zoom |
Logical: Enable the zoom control. |
guides |
Logical: Show guide lines. |
bar_height |
Numeric |
bar_radius |
Numeric |
border_color |
Character: Outline color for bordered bars. |
border_width |
Numeric |
palette |
Optional Character: Bar colors, overriding the theme palette
for this chart. |
xlab |
Optional Character: Time axis label. |
The bound data is a table of tasks, one row per bar. label, start and
end name its required columns; group, tooltip and border name
optional ones.
GanttConfig object.
EDG
setup_GanttConfig()@typesetup_GanttConfig()@type
One edge (link) in a network. The R analog of the GraphEdge TypeScript
interface in rtemislive (~/Code/live/src/lib/types.ts).
GraphEdge( source = character(0), target = character(0), weight = NULL, sign = NULL )GraphEdge( source = character(0), target = character(0), weight = NULL, sign = NULL )
source |
Character: Source node id. |
target |
Character: Target node id. |
weight |
Optional Numeric: Edge magnitude; drives thickness. For a
correlation graph, the absolute value of |
sign |
Optional Numeric {-1, 1}: Sign of the underlying value (e.g.
correlation): |
GraphEdge object.
GraphEdge(source = "a", target = "b", weight = 0.8)GraphEdge(source = "a", target = "b", weight = 0.8)
A complete, renderer-agnostic network: a list of GraphNode objects, a list
of GraphEdge objects, and a directedness flag. The R analog of the
GraphModel TypeScript interface in rtemislive
(~/Code/live/src/lib/types.ts), consumed by the rtemis-graph htmlwidget.
GraphModel(nodes = list(), edges = list(), directed = logical(0))GraphModel(nodes = list(), edges = list(), directed = logical(0))
nodes |
List: List of GraphNode objects. |
edges |
List: List of GraphEdge objects. |
directed |
Logical: Whether edges are directed. |
Most users build this implicitly through draw_network(); the constructor is
exported for power users who assemble nodes and edges directly.
GraphModel object.
GraphModel( nodes = list(GraphNode(id = "a"), GraphNode(id = "b")), edges = list(GraphEdge(source = "a", target = "b")), directed = FALSE )GraphModel( nodes = list(GraphNode(id = "a"), GraphNode(id = "b")), edges = list(GraphEdge(source = "a", target = "b")), directed = FALSE )
One node (vertex) in a network. The R analog of the GraphNode TypeScript
interface in rtemislive (~/Code/live/src/lib/types.ts).
GraphNode(id = character(0), label = NULL, value = NULL, group = NULL)GraphNode(id = character(0), label = NULL, value = NULL, group = NULL)
id |
Character: Unique node identifier. Edges reference nodes by this id. |
label |
Optional Character: Display label. Defaults to |
value |
Optional Numeric: Drives node size when |
group |
Optional Character: Categorical key for node color. |
GraphNode object.
GraphNode(id = "a", label = "Node A", group = "g1")GraphNode(id = "a", label = "Node A", group = "g1")
Configuration for the cartesian coordinate grid container.
Grid( show = NULL, left = NULL, right = NULL, top = NULL, bottom = NULL, width = NULL, height = NULL, contain_label = NULL, background_color = NULL, border_width = NULL, border_color = NULL, shadow_blur = NULL, shadow_color = NULL, shadow_offset_x = NULL, shadow_offset_y = NULL )Grid( show = NULL, left = NULL, right = NULL, top = NULL, bottom = NULL, width = NULL, height = NULL, contain_label = NULL, background_color = NULL, border_width = NULL, border_color = NULL, shadow_blur = NULL, shadow_color = NULL, shadow_offset_x = NULL, shadow_offset_y = NULL )
show |
Optional Logical: Whether to show the grid border. |
left |
Optional Numeric or Character: Distance from the left side of the container. |
right |
Optional Numeric or Character: Distance from the right side of the container. |
top |
Optional Numeric or Character: Distance from the top of the container. |
bottom |
Optional Numeric or Character: Distance from the bottom of the container. |
width |
Optional Numeric or Character: Grid width. |
height |
Optional Numeric or Character: Grid height. |
contain_label |
Optional Logical: Whether the grid region contains axis labels. |
background_color |
Optional Character: Grid background color. |
border_width |
Optional Numeric |
border_color |
Optional Character: Grid border color. |
shadow_blur |
Optional Numeric |
shadow_color |
Optional Character: Shadow color. |
shadow_offset_x |
Optional Numeric: Shadow horizontal offset. |
shadow_offset_y |
Optional Numeric: Shadow vertical offset. |
Corresponds to GridOption in src/coord/cartesian/GridModel.ts (line 37).
ECharts docs: https://echarts.apache.org/en/option.html#grid
Grid object.
Grid(left = "10%", right = "10%", top = 60, bottom = 60, contain_label = TRUE)Grid(left = "10%", right = "10%", top = 60, bottom = 60, contain_label = TRUE)
A serializable description of a heatmap. Build one with
setup_HeatmapConfig() rather than calling this constructor directly.
HeatmapConfig( dat_path = NULL, title = NULL, origin = NULL, writer = NULL, legend_position = "right", legend_placement = "outside", row_names = NULL, col_names = NULL, triangle = NULL, cluster_rows = FALSE, cluster_cols = FALSE, dist_method = "euclidean", hclust_method = "complete", square_cells = NULL, show_row_dendro = TRUE, show_col_dendro = TRUE, dendro_row_width = 60, dendro_col_height = 60, dendro_color = NULL, dendro_uniform = FALSE, dendro_row_side = "right", dendro_col_side = "top", colormap = NULL, zlim = NULL, show_notes = FALSE, row_cut = NULL, col_cut = NULL, show_values = FALSE, value_digits = 2L, show_colorbar = TRUE, colorbar_orient = "vertical", margin_top = NULL, margin_right = NULL, margin_bottom = NULL, margin_left = NULL )HeatmapConfig( dat_path = NULL, title = NULL, origin = NULL, writer = NULL, legend_position = "right", legend_placement = "outside", row_names = NULL, col_names = NULL, triangle = NULL, cluster_rows = FALSE, cluster_cols = FALSE, dist_method = "euclidean", hclust_method = "complete", square_cells = NULL, show_row_dendro = TRUE, show_col_dendro = TRUE, dendro_row_width = 60, dendro_col_height = 60, dendro_color = NULL, dendro_uniform = FALSE, dendro_row_side = "right", dendro_col_side = "top", colormap = NULL, zlim = NULL, show_notes = FALSE, row_cut = NULL, col_cut = NULL, show_values = FALSE, value_digits = 2L, show_colorbar = TRUE, colorbar_orient = "vertical", margin_top = NULL, margin_right = NULL, margin_bottom = NULL, margin_left = NULL )
dat_path |
Optional Character: Path to the data, read at draw time. The
serializable alternative to passing |
title |
Optional Character: Chart title. Declared here because it is the
one property every chart type has; |
origin |
Optional Named character {"user", "default", "derived"}: Where each value came from, one entry per settable property. Absent on an authored config; written by the interface that resolved it. |
writer |
Optional Named character: Which interface wrote the config, as
|
legend_position |
Character {"top", "bottom", "left", "right", "top-left", "top-right", "bottom-left", "bottom-right"}: Legend anchor. Top/bottom anchors use horizontal rows; left/right anchors use a vertical column. Corner anchors align within the top or bottom row. |
legend_placement |
Character {"outside", "inside"}: Relation to the plotting area. Outside placement reserves space for the complete legend; inside placement overlays the data. Neither setting adds a missing legend. |
row_names, col_names
|
Optional Character: Labels overriding the matrix dimnames. |
triangle |
Optional Character {"lower", "upper"}: Show only one triangle, for a symmetric matrix. |
cluster_rows, cluster_cols
|
Logical: Reorder by hierarchical clustering. |
dist_method |
Character: Distance measure for clustering. |
hclust_method |
Character: Linkage method for clustering. |
square_cells |
Optional Logical: Force square cells, sizing the container to match. |
show_row_dendro, show_col_dendro
|
Logical: Draw each dendrogram. |
dendro_row_width, dendro_col_height
|
Numeric |
dendro_color |
Optional Character: Dendrogram line color. |
dendro_uniform |
Logical: Draw dendrograms with uniform branch heights. |
dendro_row_side |
Character {"left", "right"}: Row dendrogram side. |
dendro_col_side |
Character {"top", "bottom"}: Column dendrogram side. |
colormap |
Optional Character: Colors defining the continuous scale.
|
zlim |
Optional Numeric: Color-scale limits, length 2. |
show_notes |
Logical: Print supplied cell notes instead of numeric values. |
row_cut, col_cut
|
Optional Integer: Number of clusters for branch coloring, requiring a computed or supplied tree. |
show_values |
Logical: Print each cell's value. |
value_digits |
Integer |
show_colorbar |
Logical: Draw the color bar. |
colorbar_orient |
Character {"vertical", "horizontal"}: Color bar orientation. |
margin_top, margin_right, margin_bottom, margin_left
|
Optional Integer
|
The bound data is a numeric matrix, or a record containing values and optional
row_tree, col_tree, cell_notes, row_colors, and col_colors (see
draw_heatmap()). These annotations remain data, outside the config.
For a matrix, row_names and col_names override the
matrix's own dimnames rather than naming columns to read.
HeatmapConfig object.
EDG
setup_HeatmapConfig(cluster_rows = TRUE)@typesetup_HeatmapConfig(cluster_rows = TRUE)@type
Configuration for a heatmap chart series on Cartesian coordinates.
Each data point is a triple [col_index, row_index, value] and color
encoding is driven by a VisualMap component.
HeatmapSeries( name = NULL, data = NULL, x_axis_index = NULL, y_axis_index = NULL, silent = NULL, legend_hover_link = NULL, z_level = NULL, z = NULL, label = NULL, item_style = NULL, emphasis = NULL )HeatmapSeries( name = NULL, data = NULL, x_axis_index = NULL, y_axis_index = NULL, silent = NULL, legend_hover_link = NULL, z_level = NULL, z = NULL, label = NULL, item_style = NULL, emphasis = NULL )
name |
Optional Character: Series name. |
data |
Optional list: Heatmap data. Each element is a length-3 list
|
x_axis_index |
Optional Numeric |
y_axis_index |
Optional Numeric |
silent |
Optional Logical: Whether the series is silent (no events). |
legend_hover_link |
Optional Logical: Whether to link hover with the legend. |
z_level |
Optional Numeric: Canvas layer index. |
z |
Optional Numeric: Front-back order within the same layer. |
label |
Optional LabelOption: Cell label configuration (e.g. show the value). |
item_style |
Optional ItemStyle: Cell styling (e.g. border color/width). |
emphasis |
Optional list: Emphasis (hover) styling. A plain list passed
through to ECharts, e.g. |
Corresponds to HeatmapSeriesOption in src/chart/heatmap/HeatmapSeries.ts.
ECharts docs: https://echarts.apache.org/en/option.html#series-heatmap
HeatmapSeries object.
# Each element is one cell, as c(column index, row index, value). HeatmapSeries(name = "Density", data = list(c(0, 0, 5), c(1, 0, 3)))# Each element is one cell, as c(column index, row index, value). HeatmapSeries(name = "Density", data = list(c(0, 0, 5), c(1, 0, 3)))
A serializable description of a histogram. Build one with
setup_HistogramConfig() rather than calling this constructor directly.
HistogramConfig( dat_path = NULL, title = NULL, origin = NULL, writer = NULL, legend_position = "top", legend_placement = "outside", mode = "overlap", order = "input", n = 512L, bw = "nrd0", bandwidth = NULL, kernel = "gaussian", adjust = 1, na_rm = TRUE, fill_alpha = 0.25, x = NULL, group = NULL, breaks = "Sturges", bins = NULL, bin_edges = NULL, normalization = "count", bin_stat = "count", bar_mode = "overlay", density = FALSE, palette = NULL, xlab = NULL, ylab = NULL, margin_top = NULL, margin_right = NULL, margin_bottom = NULL, margin_left = NULL )HistogramConfig( dat_path = NULL, title = NULL, origin = NULL, writer = NULL, legend_position = "top", legend_placement = "outside", mode = "overlap", order = "input", n = 512L, bw = "nrd0", bandwidth = NULL, kernel = "gaussian", adjust = 1, na_rm = TRUE, fill_alpha = 0.25, x = NULL, group = NULL, breaks = "Sturges", bins = NULL, bin_edges = NULL, normalization = "count", bin_stat = "count", bar_mode = "overlay", density = FALSE, palette = NULL, xlab = NULL, ylab = NULL, margin_top = NULL, margin_right = NULL, margin_bottom = NULL, margin_left = NULL )
dat_path |
Optional Character: Path to the data, read at draw time. The
serializable alternative to passing |
title |
Optional Character: Chart title. Declared here because it is the
one property every chart type has; |
origin |
Optional Named character {"user", "default", "derived"}: Where each value came from, one entry per settable property. Absent on an authored config; written by the interface that resolved it. |
writer |
Optional Named character: Which interface wrote the config, as
|
legend_position |
Character {"top", "bottom", "left", "right", "top-left", "top-right", "bottom-left", "bottom-right"}: Legend anchor. Top/bottom anchors use horizontal rows; left/right anchors use a vertical column. Corner anchors align within the top or bottom row. |
legend_placement |
Character {"outside", "inside"}: Relation to the plotting area. Outside placement reserves space for the complete legend; inside placement overlays the data. Neither setting adds a missing legend. |
mode |
Character |
order |
Character |
n |
Integer |
bw |
Character or Numeric: Bandwidth selector ( |
bandwidth |
Optional Numeric |
kernel |
Character: One of |
adjust |
Numeric |
na_rm |
Logical: Whether to remove |
fill_alpha |
Numeric |
x |
Optional Character: Columns to bin, one distribution per column. |
group |
Optional Character: Column to split the bins by. |
breaks |
Numeric, Character, or Numeric vector: Binning method. A single number (number of bins), a character
string naming an algorithm (e.g. |
bins |
Optional Integer |
bin_edges |
Optional Numeric vector: Finite, strictly increasing edges
spanning every retained observation. Overrides |
normalization |
Character: |
bin_stat |
Character |
bar_mode |
Character |
density |
Logical: Overlay a kernel density in histogram units. |
palette |
Optional Character: Series colors, overriding the theme
palette for this chart. |
xlab, ylab
|
Optional Character: Axis labels. |
margin_top, margin_right, margin_bottom, margin_left
|
Optional Integer
|
x names one or more columns to bin. group names a column to split them
by, drawing one series per level. The output uses CustomSeriesOption in
ECharts src/chart/custom/CustomSeries.ts and LineSeriesOption in
src/chart/line/LineSeries.ts for optional density overlays.
HistogramConfig object.
EDG
setup_HistogramConfig(x = "mpg")@typesetup_HistogramConfig(x = "mpg")@type
Styling for graphical items (bar segments, scatter points, pie slices, etc.). Includes both fill and stroke options.
ItemStyle( color = NULL, opacity = NULL, border_color = NULL, border_width = NULL, border_type = NULL, border_cap = NULL, border_join = NULL, border_dash_offset = NULL, border_miter_limit = NULL, border_radius = NULL, decal = NULL, shadow_blur = NULL, shadow_color = NULL, shadow_offset_x = NULL, shadow_offset_y = NULL )ItemStyle( color = NULL, opacity = NULL, border_color = NULL, border_width = NULL, border_type = NULL, border_cap = NULL, border_join = NULL, border_dash_offset = NULL, border_miter_limit = NULL, border_radius = NULL, decal = NULL, shadow_blur = NULL, shadow_color = NULL, shadow_offset_x = NULL, shadow_offset_y = NULL )
color |
Optional Character: CSS fill color. |
opacity |
Optional Numeric |
border_color |
Optional Character: Border color. |
border_width |
Optional Numeric |
border_type |
Optional Character {"solid", "dashed", "dotted"}: Border line type. |
border_cap |
Optional Character {"butt", "round", "square"}: Border line cap. |
border_join |
Optional Character {"bevel", "round", "miter"}: Border line join. |
border_dash_offset |
Optional Numeric: Border dash offset. |
border_miter_limit |
Optional Numeric |
border_radius |
Optional Numeric, Character, or Numeric vector: Corner border radius. |
decal |
Optional Any: Decal pattern for accessibility. |
shadow_blur |
Optional Numeric |
shadow_color |
Optional Character: Shadow color. |
shadow_offset_x |
Optional Numeric: Shadow horizontal offset. |
shadow_offset_y |
Optional Numeric: Shadow vertical offset. |
Corresponds to ItemStyleOption in src/util/types.ts (line 1142).
ECharts docs: https://echarts.apache.org/en/option.html#series-bar.itemStyle
ItemStyle object.
ItemStyle(color = "#16a085", border_color = "#ffffff", border_width = 1)ItemStyle(color = "#16a085", border_color = "#ffffff", border_width = 1)
Connecting line between a label and its chart element (e.g. pie label lines).
LabelLine( show = NULL, show_above = NULL, length = NULL, length2 = NULL, smooth = NULL, min_turn_angle = NULL, line_style = NULL )LabelLine( show = NULL, show_above = NULL, length = NULL, length2 = NULL, smooth = NULL, min_turn_angle = NULL, line_style = NULL )
show |
Optional Logical: Whether to show the label line. |
show_above |
Optional Logical: Whether the line renders above other elements. |
length |
Optional Numeric |
length2 |
Optional Numeric |
smooth |
Optional Numeric |
min_turn_angle |
Optional Numeric: Minimum angle for turning the line. |
line_style |
Optional LineStyle: Line styling. |
Corresponds to LabelLineOption in src/util/types.ts (line 1379).
ECharts docs: https://echarts.apache.org/en/option.html#series-pie.labelLine
LabelLine object.
LabelLine(show = TRUE, length = 10, length2 = 15)LabelLine(show = TRUE, length = 10, length2 = 15)
Text label configuration for chart elements. Combines label-specific positioning (show, position, distance, rotate) with text styling.
LabelOption( show = NULL, position = NULL, distance = NULL, rotate = NULL, offset = NULL, formatter = NULL, silent = NULL, precision = NULL, value_animation = NULL, min_margin = NULL, text_style = NULL )LabelOption( show = NULL, position = NULL, distance = NULL, rotate = NULL, offset = NULL, formatter = NULL, silent = NULL, precision = NULL, value_animation = NULL, min_margin = NULL, text_style = NULL )
show |
Optional Logical: Whether to show the label. |
position |
Optional Character {"top", "left", "right", "bottom", "inside", "insideLeft", "insideRight", "insideTop", "insideBottom", "insideTopLeft", "insideBottomLeft", "insideTopRight", "insideBottomRight", "outside"} or Numeric: Label position.
|
distance |
Optional Numeric: Distance from the element. |
rotate |
Optional Numeric: Rotation angle in degrees. |
offset |
Optional Numeric: Offset |
formatter |
Optional Character or function: Label text formatter. |
silent |
Optional Logical: Whether the label is silent. |
precision |
Optional Numeric or Character {"auto"}: Numeric precision. |
value_animation |
Optional Logical: Whether to animate value changes. |
min_margin |
Optional Numeric |
text_style |
Optional TextStyle: Text appearance. |
Corresponds to SeriesLabelOption / LabelOption in src/util/types.ts
(line 1283, 1348).
ECharts docs: https://echarts.apache.org/en/option.html#series-bar.label
LabelOption object.
LabelOption(show = TRUE, position = "top", formatter = "{c}")LabelOption(show = TRUE, position = "top", formatter = "{c}")
Legend configuration for selecting/filtering series.
Legend( show = NULL, orient = NULL, align = NULL, left = NULL, right = NULL, top = NULL, bottom = NULL, width = NULL, height = NULL, padding = NULL, item_gap = NULL, item_width = NULL, item_height = NULL, icon = NULL, selected_mode = NULL, selected = NULL, formatter = NULL, inactive_color = NULL, inactive_border_color = NULL, text_style = NULL, item_style = NULL, background_color = NULL, border_color = NULL, border_width = NULL, border_radius = NULL, trigger_event = NULL, data = NULL )Legend( show = NULL, orient = NULL, align = NULL, left = NULL, right = NULL, top = NULL, bottom = NULL, width = NULL, height = NULL, padding = NULL, item_gap = NULL, item_width = NULL, item_height = NULL, icon = NULL, selected_mode = NULL, selected = NULL, formatter = NULL, inactive_color = NULL, inactive_border_color = NULL, text_style = NULL, item_style = NULL, background_color = NULL, border_color = NULL, border_width = NULL, border_radius = NULL, trigger_event = NULL, data = NULL )
show |
Optional Logical: Whether to show the legend. |
orient |
Optional Character {"horizontal", "vertical"}: Layout orientation. |
align |
Optional Character {"auto", "left", "right"}: Marker and text alignment. |
left |
Optional Numeric or Character: Left position. |
right |
Optional Numeric or Character: Right position. |
top |
Optional Numeric or Character: Top position. |
bottom |
Optional Numeric or Character: Bottom position. |
width |
Optional Numeric or Character: Legend box width. |
height |
Optional Numeric or Character: Legend box height. |
padding |
Optional Numeric: Padding inside the legend box. |
item_gap |
Optional Numeric |
item_width |
Optional Numeric |
item_height |
Optional Numeric |
icon |
Optional Character: Default legend icon. |
selected_mode |
Optional Logical or Character {"single", "multiple"}: Selection mode. |
selected |
Optional Named logical vector: Pre-selected items. |
formatter |
Optional Character or function: Label formatter. |
inactive_color |
Optional Character: Color for unselected items. |
inactive_border_color |
Optional Character: Border color for unselected items. |
text_style |
Optional TextStyle: Legend label text style. |
item_style |
Optional ItemStyle: Legend icon style. |
background_color |
Optional Character: Background color. |
border_color |
Optional Character: Border color. |
border_width |
Optional Numeric |
border_radius |
Optional Numeric: Border radius. |
trigger_event |
Optional Logical: Whether the legend emits events. |
data |
Optional Character vector or list: Legend data items. |
Corresponds to LegendOption in src/component/legend/LegendModel.ts (line 162).
ECharts docs: https://echarts.apache.org/en/option.html#legend
Legend object.
Legend(show = TRUE, orient = "vertical", left = "left")Legend(show = TRUE, orient = "vertical", left = "left")
A serializable description of a line chart. Build one with
setup_LineConfig() rather than calling this constructor directly.
LineConfig( dat_path = NULL, title = NULL, origin = NULL, writer = NULL, legend_position = "top", legend_placement = "outside", x = NULL, y = NULL, group = NULL, blocks = NULL, smooth = FALSE, area = FALSE, points = TRUE, zoom = FALSE, palette = NULL, block_color = NULL, block_opacity = 0.2, square = FALSE, equal_axes = FALSE, pad = 0.04, xlim = NULL, ylim = NULL, xlab = NULL, ylab = NULL, margin_top = NULL, margin_right = NULL, margin_bottom = NULL, margin_left = NULL )LineConfig( dat_path = NULL, title = NULL, origin = NULL, writer = NULL, legend_position = "top", legend_placement = "outside", x = NULL, y = NULL, group = NULL, blocks = NULL, smooth = FALSE, area = FALSE, points = TRUE, zoom = FALSE, palette = NULL, block_color = NULL, block_opacity = 0.2, square = FALSE, equal_axes = FALSE, pad = 0.04, xlim = NULL, ylim = NULL, xlab = NULL, ylab = NULL, margin_top = NULL, margin_right = NULL, margin_bottom = NULL, margin_left = NULL )
dat_path |
Optional Character: Path to the data, read at draw time. The
serializable alternative to passing |
title |
Optional Character: Chart title. Declared here because it is the
one property every chart type has; |
origin |
Optional Named character {"user", "default", "derived"}: Where each value came from, one entry per settable property. Absent on an authored config; written by the interface that resolved it. |
writer |
Optional Named character: Which interface wrote the config, as
|
legend_position |
Character {"top", "bottom", "left", "right", "top-left", "top-right", "bottom-left", "bottom-right"}: Legend anchor. Top/bottom anchors use horizontal rows; left/right anchors use a vertical column. Corner anchors align within the top or bottom row. |
legend_placement |
Character {"outside", "inside"}: Relation to the plotting area. Outside placement reserves space for the complete legend; inside placement overlays the data. Neither setting adds a missing legend. |
x |
Optional Character: Column along the horizontal axis. A numeric
column gets a value axis, a |
y |
Optional Character: Columns to plot, one line each. |
group |
Optional Character: Column to group and color lines by. Splits
a single |
blocks |
Optional Character: Column whose contiguous runs shade vertical background bands. |
smooth |
Logical: Draw smoothed lines. |
area |
Logical: Fill the area under each line. |
points |
Logical: Show a marker at each data value. |
zoom |
Logical: Enable the zoom control. |
palette |
Optional Character: Series colors, overriding the theme
palette for this chart. |
block_color |
Optional Character: Band colors. |
block_opacity |
Numeric |
square |
Logical: If TRUE, draw the plotting box square – equal height and width in pixels, excluding axis labels and margins. |
equal_axes |
Logical: If TRUE, give one data unit the same size in
pixels on both axes. Set with |
pad |
Numeric |
xlim, ylim
|
Optional Numeric: Axis limits, length 2. |
xlab, ylab
|
Optional Character: Axis labels. |
margin_top, margin_right, margin_bottom, margin_left
|
Optional Integer
|
x names the column along the horizontal axis. y names one or more
columns, one line each, as BarConfig does.
LineConfig object.
EDG
setup_LineConfig(x = "wt", y = "mpg")@typesetup_LineConfig(x = "wt", y = "mpg")@type
Configuration for a line chart series.
LineSeries( name = NULL, data = NULL, x_axis_index = NULL, y_axis_index = NULL, stack = NULL, silent = NULL, legend_hover_link = NULL, color = NULL, z_level = NULL, z = NULL, smooth = NULL, step = NULL, connect_nulls = NULL, clip = NULL, show_symbol = NULL, symbol = NULL, symbol_size = NULL, symbol_rotate = NULL, symbol_offset = NULL, line_style = NULL, area_style = NULL, item_style = NULL, label = NULL, mark_area = NULL )LineSeries( name = NULL, data = NULL, x_axis_index = NULL, y_axis_index = NULL, stack = NULL, silent = NULL, legend_hover_link = NULL, color = NULL, z_level = NULL, z = NULL, smooth = NULL, step = NULL, connect_nulls = NULL, clip = NULL, show_symbol = NULL, symbol = NULL, symbol_size = NULL, symbol_rotate = NULL, symbol_offset = NULL, line_style = NULL, area_style = NULL, item_style = NULL, label = NULL, mark_area = NULL )
name |
Optional Character: Series name for legend display. |
data |
Optional Numeric or list: Data values. |
x_axis_index |
Optional Numeric |
y_axis_index |
Optional Numeric |
stack |
Optional Character: Stack group name. |
silent |
Optional Logical: Whether the series is silent. |
legend_hover_link |
Optional Logical: Whether to highlight related legends on hover. |
color |
Optional Character: Series color override. |
z_level |
Optional Numeric: Canvas layer index. |
z |
Optional Numeric: Front-back order within the same layer. |
smooth |
Optional Logical or Numeric |
step |
Optional Logical or Character {"start", "end", "middle"}: Step line mode. |
connect_nulls |
Optional Logical: Whether to connect across |
clip |
Optional Logical: Whether to clip overflow. |
show_symbol |
Optional Logical: Whether to show data-point symbols. |
symbol |
Optional Character {"circle", "rect", "roundRect", "triangle", "diamond", "pin", "arrow", "none"}: Symbol type.
|
symbol_size |
Optional Numeric: Symbol size in pixels. |
symbol_rotate |
Optional Numeric: Symbol rotation in degrees,
counter-clockwise-positive. A symbol is unrotated at |
symbol_offset |
Optional Numeric or Character: Shift from the data
point as |
line_style |
Optional LineStyle: Line styling. |
area_style |
Optional AreaStyle: Area fill styling. |
item_style |
Optional ItemStyle: Data-point marker styling. |
label |
Optional LabelOption: Data-label configuration. |
mark_area |
Optional MarkArea: Shaded bands (e.g. vertical highlight regions across x-ranges). |
Corresponds to LineSeriesOption in src/chart/line/LineSeries.ts (line 74).
ECharts docs: https://echarts.apache.org/en/option.html#series-line
LineSeries object.
LineSeries(name = "Sessions", data = c(150, 230, 224), smooth = TRUE)LineSeries(name = "Sessions", data = c(150, 230, 224), smooth = TRUE)
Stroke styling for lines in series, axes, and components.
LineStyle( color = NULL, width = NULL, opacity = NULL, type = NULL, cap = NULL, join = NULL, dash_offset = NULL, miter_limit = NULL, shadow_blur = NULL, shadow_color = NULL, shadow_offset_x = NULL, shadow_offset_y = NULL )LineStyle( color = NULL, width = NULL, opacity = NULL, type = NULL, cap = NULL, join = NULL, dash_offset = NULL, miter_limit = NULL, shadow_blur = NULL, shadow_color = NULL, shadow_offset_x = NULL, shadow_offset_y = NULL )
color |
Optional Character: CSS line color. |
width |
Optional Numeric |
opacity |
Optional Numeric |
type |
Optional Character {"solid", "dashed", "dotted"}: Line type. |
cap |
Optional Character {"butt", "round", "square"}: Line cap. |
join |
Optional Character {"bevel", "round", "miter"}: Line join. |
dash_offset |
Optional Numeric: Dash offset for dashed lines. |
miter_limit |
Optional Numeric |
shadow_blur |
Optional Numeric |
shadow_color |
Optional Character: Shadow color. |
shadow_offset_x |
Optional Numeric: Shadow horizontal offset. |
shadow_offset_y |
Optional Numeric: Shadow vertical offset. |
Corresponds to LineStyleOption in src/util/types.ts (line 1154).
ECharts docs: https://echarts.apache.org/en/option.html#series-line.lineStyle
LineStyle object.
LineStyle(color = "#16a085", width = 2, type = "dashed")LineStyle(color = "#16a085", width = 2, type = "dashed")
The complete, validated render spec for a MapLibre choropleth: a MapModel
(the data) plus all visual styling and an optional title. This is the
MapLibre analog of EChartsOption / SigmaOption – the single object
draw() dispatches on to emit a rtemis-map widget. Theme is not a
property here; like every backend, theming is supplied to draw() and
resolved uniformly.
MapLibreOption( model = NULL, classification = "quantile", colormap = "blues", num_classes = 5, opacity = 1, show_boundaries = TRUE, outline_width = 0.2, show_legend = TRUE, legend_position = "bottom-right", tooltip_position = "top-right", title = NULL )MapLibreOption( model = NULL, classification = "quantile", colormap = "blues", num_classes = 5, opacity = 1, show_boundaries = TRUE, outline_width = 0.2, show_legend = TRUE, legend_position = "bottom-right", tooltip_position = "top-right", title = NULL )
model |
MapModel or named list: The choropleth data (a list must
contain a |
classification |
Character {"quantile", "equal", "jenks"}: Class-break
method. |
colormap |
Character: Color ramp. One of the sequential schemes
|
num_classes |
Numeric [2, 12]: Number of color classes. |
opacity |
Numeric [0, 1]: Region fill opacity. |
show_boundaries |
Logical: Whether to draw region outlines. |
outline_width |
Numeric [0, Inf): Region outline width in pixels. |
show_legend |
Logical: Whether to show the legend. |
legend_position |
Character {"top-left", "top-right", "bottom-left", "bottom-right"}: Legend corner. |
tooltip_position |
Character {"top-left", "top-right", "bottom-left", "bottom-right"}: Hover tooltip corner. |
title |
Optional Character: Title (currently surfaced via the value label; reserved for future use). |
Most users never touch this directly – draw_choropleth() and draw_map()
build it – but power users can construct it for full control:
draw(MapLibreOption(model = MapModel(...), colormap = "viridis")).
Its to_list() produces the { model, style, title } payload consumed by
the rtemis-map htmlwidget binding (the geometry is added by the draw()
method, since it depends only on the model's resolution).
MapLibreOption object.
model <- MapModel( rows = list( MapRow(location = "USA", value = 25.5), MapRow(location = "CAN", value = 12.1) ) ) MapLibreOption(model = model, classification = "quantile")model <- MapModel( rows = list( MapRow(location = "USA", value = 25.5), MapRow(location = "CAN", value = 12.1) ) ) MapLibreOption(model = model, classification = "quantile")
A complete, renderer-agnostic choropleth dataset: a list of MapRow objects,
the administrative resolution that selects the geometry, the label for the
value column, and the ordered tooltip field names. The R analog of the
MapModel TypeScript interface in rtemislive (~/Code/live/src/lib/types.ts),
consumed by the rtemis-map htmlwidget.
MapModel( rows = list(), resolution = "country", value_label = "value", tooltip_fields = character(0) )MapModel( rows = list(), resolution = "country", value_label = "value", tooltip_fields = character(0) )
rows |
List: List of MapRow objects. |
resolution |
Character {"country", "state", "county"}: Administrative
resolution. |
value_label |
Character: Display label for the value column (labels the legend and tooltip value). |
tooltip_fields |
Character: Ordered names of the extra fields to show in
the tooltip (keys into each MapRow's |
Most users build this implicitly through draw_choropleth(); the constructor
is exported for power users who assemble rows directly.
MapModel object.
MapModel( rows = list( MapRow(location = "USA", value = 25.5), MapRow(location = "CAN", value = 12.1) ) )MapModel( rows = list( MapRow(location = "USA", value = 25.5), MapRow(location = "CAN", value = 12.1) ) )
One region's datum in a choropleth: a raw location key, the numeric value
that colors the region, and optional extra fields to surface in the tooltip.
The R analog of the MapRow TypeScript interface in rtemislive
(~/Code/live/src/lib/types.ts).
MapRow(location = character(0), value = integer(0), extras = NULL)MapRow(location = character(0), value = integer(0), extras = NULL)
location |
Character: Raw location key (FIPS / ISO / name) before normalization. Normalization to the canonical geometry id happens in the renderer. |
value |
Numeric: The value that colors the region. |
extras |
Optional named list: Extra column values to show in the tooltip, keyed by column name. |
MapRow object.
MapRow(location = "USA", value = 25.5)MapRow(location = "USA", value = 25.5)
Container for markArea bands attached to a series. data is a list where
each element is a length-2 list of MarkAreaDataPoint (or plain named list)
defining the two opposite corners of one band.
MarkArea( data = NULL, silent = NULL, precision = NULL, item_style = NULL, label = NULL, z2 = NULL )MarkArea( data = NULL, silent = NULL, precision = NULL, item_style = NULL, label = NULL, z2 = NULL )
data |
Optional list: List of length-2 lists of MarkAreaDataPoint / plain named list. Each inner pair defines one band. |
silent |
Optional Logical: Whether hover / tooltip are disabled. |
precision |
Optional Integer |
item_style |
Optional ItemStyle: Default fill/border styling for all bands. Per-band overrides go on the first MarkAreaDataPoint of a pair. |
label |
Optional LabelOption: Default label configuration. |
z2 |
Optional Numeric: Front-back order among markers. |
Corresponds to MarkAreaOption in
src/component/marker/MarkAreaModel.ts (line 60).
ECharts docs:
https://echarts.apache.org/en/option.html#series-line.markArea
MarkArea object.
# One shaded band, defined by its two corner points. MarkArea( data = list(list( MarkAreaDataPoint(x_axis = 1), MarkAreaDataPoint(x_axis = 3) )) )# One shaded band, defined by its two corner points. MarkArea( data = list(list( MarkAreaDataPoint(x_axis = 1), MarkAreaDataPoint(x_axis = 3) )) )
One endpoint of a markArea band. Two of these — wrapped in a length-2 list
— define the opposite corners of a shaded rectangle. Supplying only
x_axis on both endpoints produces a full-height vertical band (useful for
highlighting x-ranges of a time series); supplying only y_axis produces a
full-width horizontal band.
MarkAreaDataPoint( x_axis = NULL, y_axis = NULL, name = NULL, value = NULL, item_style = NULL, label = NULL )MarkAreaDataPoint( x_axis = NULL, y_axis = NULL, name = NULL, value = NULL, item_style = NULL, label = NULL )
x_axis |
Optional Numeric or Character: Position on the x-axis. |
y_axis |
Optional Numeric or Character: Position on the y-axis. |
name |
Optional Character: Label text for the band. |
value |
Optional Numeric or Character: Fallback label value when
|
item_style |
Optional ItemStyle: Fill and border styling. Styling set on the first endpoint of a pair applies to the whole band. |
label |
Optional LabelOption: Label configuration. |
Corresponds to MarkArea2DDataItemDimOption in
src/component/marker/MarkAreaModel.ts (line 49).
ECharts docs:
https://echarts.apache.org/en/option.html#series-line.markArea.data
MarkAreaDataPoint object.
MarkAreaDataPoint(x_axis = 1, name = "Event window")MarkAreaDataPoint(x_axis = 1, name = "Event window")
Configuration for minor split lines (between main split lines).
MinorSplitLine(show = NULL, line_style = NULL)MinorSplitLine(show = NULL, line_style = NULL)
show |
Optional Logical: Whether to show minor split lines. |
line_style |
Optional LineStyle: Line styling. |
Corresponds to MinorSplitLineOption in src/coord/axisCommonTypes.ts (line 364).
ECharts docs: https://echarts.apache.org/en/option.html#xAxis.minorSplitLine
MinorSplitLine object.
MinorSplitLine(show = TRUE, line_style = LineStyle(opacity = 0.2))MinorSplitLine(show = TRUE, line_style = LineStyle(opacity = 0.2))
Configuration for minor axis tick marks (between main ticks).
MinorTick(show = NULL, split_number = NULL, length = NULL, line_style = NULL)MinorTick(show = NULL, split_number = NULL, length = NULL, line_style = NULL)
show |
Optional Logical: Whether to show minor ticks. |
split_number |
Optional Numeric |
length |
Optional Numeric |
line_style |
Optional LineStyle: Line styling. |
Corresponds to MinorTickOption in src/coord/axisCommonTypes.ts (line 346).
ECharts docs: https://echarts.apache.org/en/option.html#xAxis.minorTick
MinorTick object.
MinorTick(show = TRUE, split_number = 5)MinorTick(show = TRUE, split_number = 5)
A serializable description of a network graph. Build one with
setup_NetworkConfig() rather than calling this constructor directly.
NetworkConfig( dat_path = NULL, title = NULL, origin = NULL, writer = NULL, directed = FALSE, threshold = NULL, self_loops = FALSE, layout = "force", cluster_resolution = 1, scale_by_degree = TRUE, color_by_group = FALSE, blend_edges = FALSE, show_labels = TRUE, node_size = 10, edge_scale = 3, node_opacity = 0.95, edge_opacity = 0.4, palette = NULL, node_color = "#6CA3A0", positive_color = "#6CA3A0", negative_color = "#ff9e1f" )NetworkConfig( dat_path = NULL, title = NULL, origin = NULL, writer = NULL, directed = FALSE, threshold = NULL, self_loops = FALSE, layout = "force", cluster_resolution = 1, scale_by_degree = TRUE, color_by_group = FALSE, blend_edges = FALSE, show_labels = TRUE, node_size = 10, edge_scale = 3, node_opacity = 0.95, edge_opacity = 0.4, palette = NULL, node_color = "#6CA3A0", positive_color = "#6CA3A0", negative_color = "#ff9e1f" )
dat_path |
Optional Character: Path to the data, read at draw time. The
serializable alternative to passing |
title |
Optional Character: Chart title. Declared here because it is the
one property every chart type has; |
origin |
Optional Named character {"user", "default", "derived"}: Where each value came from, one entry per settable property. Absent on an authored config; written by the interface that resolved it. |
writer |
Optional Named character: Which interface wrote the config, as
|
directed |
Logical: Treat the matrix as directed. |
threshold |
Optional Numeric: Drop edges weaker than this. |
self_loops |
Logical: Keep self-edges. |
layout |
Character: Layout algorithm. |
cluster_resolution |
Numeric |
scale_by_degree |
Logical: Size nodes by their degree. |
color_by_group |
Logical: Color nodes by detected community. |
blend_edges |
Logical: Blend overlapping edges. |
show_labels |
Logical: Draw node labels. |
node_size |
Numeric |
edge_scale |
Numeric |
node_opacity, edge_opacity
|
Numeric |
palette |
Optional Character: Community colors, overriding the theme
palette. |
node_color |
Character: Node color when not colored by group. |
positive_color, negative_color
|
Character: Edge colors by sign. |
The bound data is an adjacency matrix, optionally with a node table:
draw(config, data = m) or
draw(config, data = list(adjacency = m, nodes = df)).
NetworkConfig object.
EDG
setup_NetworkConfig(layout = "force")@typesetup_NetworkConfig(layout = "force")@type
Uses the S7 properties' declarations and omits defaults. This is a layout
schema, separate from the chart registry and child chart/data contracts.
Resolved layouts emitted by to_list() contain every setting.
panel_layout_schema(complete = FALSE)panel_layout_schema(complete = FALSE)
complete |
Logical: Require every setting instead of allowing omissions. |
Named list: Draft 2020-12 JSON Schema.
panel_layout_schema()[["properties"]][["ncol"]]panel_layout_schema()[["properties"]][["ncol"]]
Package-owned, backend-independent layout settings. Child charts retain
separate ECharts options (EChartsOption in src/export/option.ts); this
layout does not merge or renumber their axes, series, or legends.
Rows fill from left to right, with equally sized cells. Unused final cells
remain empty. Settings serialize as ordinary JSON with to_list().
PanelLayout(ncol = 1L, gap = 12, padding = 0)PanelLayout(ncol = 1L, gap = 12, padding = 0)
ncol |
Integer |
gap |
Numeric |
padding |
Numeric |
PanelLayout: Validated layout settings.
to_list(setup_PanelLayout(ncol = 2))to_list(setup_PanelLayout(ncol = 2))
A serializable description of a pie chart. Build one with
setup_PieConfig() rather than calling this constructor directly.
PieConfig( dat_path = NULL, title = NULL, origin = NULL, writer = NULL, legend_position = "top", legend_placement = "outside", values = NULL, labels = NULL, label_format = "name", percent_digits = 1L, rose_type = NULL, radius = "75%", palette = NULL )PieConfig( dat_path = NULL, title = NULL, origin = NULL, writer = NULL, legend_position = "top", legend_placement = "outside", values = NULL, labels = NULL, label_format = "name", percent_digits = 1L, rose_type = NULL, radius = "75%", palette = NULL )
dat_path |
Optional Character: Path to the data, read at draw time. The
serializable alternative to passing |
title |
Optional Character: Chart title. Declared here because it is the
one property every chart type has; |
origin |
Optional Named character {"user", "default", "derived"}: Where each value came from, one entry per settable property. Absent on an authored config; written by the interface that resolved it. |
writer |
Optional Named character: Which interface wrote the config, as
|
legend_position |
Character {"top", "bottom", "left", "right", "top-left", "top-right", "bottom-left", "bottom-right"}: Legend anchor. Top/bottom anchors use horizontal rows; left/right anchors use a vertical column. Corner anchors align within the top or bottom row. |
legend_placement |
Character {"outside", "inside"}: Relation to the plotting area. Outside placement reserves space for the complete legend; inside placement overlays the data. Neither setting adds a missing legend. |
values |
Optional Character: Column holding the slice values. |
labels |
Optional Character: Column holding the slice labels. |
label_format |
Character |
percent_digits |
Integer |
rose_type |
Optional Character {"radius", "area"}: Draw as a
Nightingale rose chart, sizing slices by radius or by area. |
radius |
Character: Outer radius, as a CSS length or percentage. |
palette |
Optional Character: Slice colors, overriding the theme
palette for this chart. |
PieConfig object.
EDG
setup_PieConfig(values = "n", labels = "kind")@typesetup_PieConfig(values = "n", labels = "kind")@type
Outside-label alignment for pie and rose charts. Extends LabelOption.
Corresponds to PieLabelOption in src/chart/pie/PieSeries.ts.
ECharts docs: https://echarts.apache.org/en/option.html#series-pie.label
PieLabelOption( show = NULL, position = NULL, distance = NULL, rotate = NULL, offset = NULL, formatter = NULL, silent = NULL, precision = NULL, value_animation = NULL, min_margin = NULL, text_style = NULL, align_to = NULL, edge_distance = NULL, bleed_margin = NULL, distance_to_label_line = NULL )PieLabelOption( show = NULL, position = NULL, distance = NULL, rotate = NULL, offset = NULL, formatter = NULL, silent = NULL, precision = NULL, value_animation = NULL, min_margin = NULL, text_style = NULL, align_to = NULL, edge_distance = NULL, bleed_margin = NULL, distance_to_label_line = NULL )
show |
Optional Logical: Whether to show the label. |
position |
Optional Character {"top", "left", "right", "bottom", "inside", "insideLeft", "insideRight", "insideTop", "insideBottom", "insideTopLeft", "insideBottomLeft", "insideTopRight", "insideBottomRight", "outside"} or Numeric: Label position.
|
distance |
Optional Numeric: Distance from the element. |
rotate |
Optional Numeric: Rotation angle in degrees. |
offset |
Optional Numeric: Offset |
formatter |
Optional Character or function: Label text formatter. |
silent |
Optional Logical: Whether the label is silent. |
precision |
Optional Numeric or Character {"auto"}: Numeric precision. |
value_animation |
Optional Logical: Whether to animate value changes. |
min_margin |
Optional Numeric |
text_style |
Optional TextStyle: Text appearance. |
align_to |
Optional Character {"none", "labelLine", "edge"}: Outside-label alignment. |
edge_distance |
Optional Numeric or Character: Distance from the plot edge. |
bleed_margin |
Optional Numeric: Space outside labels when not edge-aligned. |
distance_to_label_line |
Optional Numeric: Gap between label and guide line. |
A PieLabelOption object.
PieLabelOption(align_to = "edge", edge_distance = 8)PieLabelOption(align_to = "edge", edge_distance = 8)
Configuration for a pie chart series.
PieSeries( name = NULL, data = NULL, silent = NULL, legend_hover_link = NULL, color = NULL, z_level = NULL, z = NULL, center = NULL, radius = NULL, rose_type = NULL, clockwise = NULL, start_angle = NULL, end_angle = NULL, pad_angle = NULL, min_angle = NULL, min_show_label_angle = NULL, selected_offset = NULL, avoid_label_overlap = NULL, percent_precision = NULL, still_show_zero_sum = NULL, animation_type = NULL, item_style = NULL, label = NULL, label_line = NULL, left = NULL, right = NULL, top = NULL, bottom = NULL )PieSeries( name = NULL, data = NULL, silent = NULL, legend_hover_link = NULL, color = NULL, z_level = NULL, z = NULL, center = NULL, radius = NULL, rose_type = NULL, clockwise = NULL, start_angle = NULL, end_angle = NULL, pad_angle = NULL, min_angle = NULL, min_show_label_angle = NULL, selected_offset = NULL, avoid_label_overlap = NULL, percent_precision = NULL, still_show_zero_sum = NULL, animation_type = NULL, item_style = NULL, label = NULL, label_line = NULL, left = NULL, right = NULL, top = NULL, bottom = NULL )
name |
Optional Character: Series name. |
data |
Optional Numeric or list: Pie data. A list of named lists with |
silent |
Optional Logical: Whether the series is silent. |
legend_hover_link |
Optional Logical: Whether to highlight related legends on hover. |
color |
Optional Character: Series color override. |
z_level |
Optional Numeric: Canvas layer index. |
z |
Optional Numeric: Front-back order within the same layer. |
center |
Optional Numeric or Character: Pie center as a length-2 vector. |
radius |
Optional Numeric or Character: Pie radius. |
rose_type |
Optional Character {"radius", "area"}: Nightingale chart type. |
clockwise |
Optional Logical: Whether to lay out sectors clockwise. |
start_angle |
Optional Numeric: Starting angle in degrees. |
end_angle |
Optional Numeric or Character {"auto"}: Ending angle in degrees. |
pad_angle |
Optional Numeric |
min_angle |
Optional Numeric |
min_show_label_angle |
Optional Numeric |
selected_offset |
Optional Numeric |
avoid_label_overlap |
Optional Logical: Whether to avoid label overlap automatically. |
percent_precision |
Optional Numeric |
still_show_zero_sum |
Optional Logical: Whether to show the pie when all values are zero. |
animation_type |
Optional Character {"expansion", "scale"}: First-render animation type. |
item_style |
Optional ItemStyle: Pie-sector styling. |
label |
Optional LabelOption: Data-label configuration. |
label_line |
Optional LabelLine: Label connector line configuration. |
left |
Optional Numeric or Character: Left position. |
right |
Optional Numeric or Character: Right position. |
top |
Optional Numeric or Character: Top position. |
bottom |
Optional Numeric or Character: Bottom position. |
Corresponds to PieSeriesOption in src/chart/pie/PieSeries.ts (line 105).
ECharts docs: https://echarts.apache.org/en/option.html#series-pie
PieSeries object.
PieSeries( name = "Browser", data = list( list(value = 1048, name = "Chrome"), list(value = 735, name = "Firefox") ), radius = "50%" )PieSeries( name = "Browser", data = list( list(value = 1048, name = "Chrome"), list(value = 735, name = "Firefox") ), radius = "50%" )
Reconstructs through the chart's setup_* function rather than its
constructor, so a document from any source – another interface, a hand-written
file, a language model – arrives resolved through the same seam a direct call
goes through.
read_chart_config(x)read_chart_config(x)
x |
Character: Path to a JSON file, or a JSON string. |
ChartConfig subclass object.
EDG
path <- tempfile(fileext = ".json") write_chart_config(setup_ScatterConfig(x = "wt", y = "mpg", fit = "glm"), path) read_chart_config(path)@fit unlink(path)path <- tempfile(fileext = ".json") write_chart_config(setup_ScatterConfig(x = "wt", y = "mpg", fit = "glm"), path) read_chart_config(path)@fit unlink(path)
Shiny render function for draw widget
renderDraw(expr, env = parent.frame(), quoted = FALSE)renderDraw(expr, env = parent.frame(), quoted = FALSE)
expr |
Expression: Expression that returns a draw widget. |
env |
Environment: Evaluation environment. |
quoted |
Logical: Whether |
Shiny render function for a draw widget.
if (requireNamespace("shiny", quietly = TRUE)) { renderDraw(draw_bar(x = c("A", "B", "C"), y = c(3, 7, 2))) }if (requireNamespace("shiny", quietly = TRUE)) { renderDraw(draw_bar(x = c("A", "B", "C"), y = c(3, 7, 2))) }
The middle step of the pipeline: partial config -> complete config ->
render. Fills in every value that can be derived from the data, and stamps
each one "derived" in the config's origin map.
resolve(config, data = NULL, ...)resolve(config, data = NULL, ...)
config |
ChartConfig: The chart configuration. |
data |
Optional Data frame or named list: The data to plot. When |
... |
Passed to methods. |
Resolution is its own step rather than a set of fallbacks inside the option builders, and that is what makes an output config honest. A value derived during rendering would have to be reconstructed to write it down; a value derived here is simply part of the document that then gets rendered. Reading a complete config and rendering it become the same operation.
Two things are deliberately not resolved:
Anything describing the display surface – width, height, aspect ratio, container geometry. Those belong to the interface, are recomputed by each one, and are never written into a document: a height computed for an IDE pane is wrong in a large web canvas.
Anything with nothing to derive from. Labels come from column names, so a config that names no columns gets no labels.
Resolving is idempotent and never overwrites a value that is already
set, so resolving twice is the same as resolving once. compile() relies on
that: it resolves up front, and a builder it shares with draw() may resolve
again without changing the result.
Data is optional. With none available, the values that need it are simply not
derived; the ones that come from the column names still are. That makes
resolve() total – it has no failing input – so a caller can always ask for
the most complete config obtainable from what it has.
ChartConfig subclass object, with every derivable value filled in.
EDG
# Axis limits come from the data; the labels come from the column names. resolve(setup_ScatterConfig(x = "wt", y = "mpg"), data = mtcars)@xlim# Axis limits come from the data; the labels come from the column names. resolve(setup_ScatterConfig(x = "wt", y = "mpg"), data = mtcars)@xlim
Normalize labels and probability columns by class identity
roc_probabilities(x, predicted_prob, positive = NULL)roc_probabilities(x, predicted_prob, positive = NULL)
x |
Factor or atomic vector: Reference labels. |
predicted_prob |
Numeric vector or matrix: Class probabilities. |
positive |
Optional Character: Binary positive class. |
List containing reference labels, class levels, selected classes, and scores.
roc_probabilities(factor(c("no", "yes")), c(0.1, 0.9))roc_probabilities(factor(c("no", "yes")), c(0.1, 0.9))
Higher scores always indicate the named positive class. Consuming a tied block at once yields trapezoidal AUC equivalent to half credit for ties. The direction is never selected from the observed performance.
roc_vertices(x)roc_vertices(x)
x |
List: Normalized labels and probabilities from roc_probabilities(). |
Data frame of class, FPR, TPR, AUC, and omitted-pair counts.
roc_vertices(roc_probabilities(factor(c("no", "yes")), c(0.1, 0.9)))roc_vertices(roc_probabilities(factor(c("no", "yes")), c(0.1, 0.9)))
Portable bindings for long ROC records. Each split/class/fold identifies one
curve. The reserved fold label aggregate identifies pooled predictions.
Compiles to LineSeriesOption in src/chart/line/LineSeries.ts,
GridOption in src/coord/cartesian/GridModel.ts, and LegendOption in
src/component/legend/LegendModel.ts.
ROCConfig( dat_path = NULL, title = NULL, origin = NULL, writer = NULL, legend_position = "top", legend_placement = "outside", fpr = "fpr", tpr = "tpr", auc = NULL, class_label = NULL, split = NULL, fold = NULL, omitted = NULL, variant = "aggregate", digits = 3L, diagonal = TRUE, diagonal_color = "#888888", palette = NULL, legend = TRUE, square = TRUE, line_width = 2, fold_opacity = 0.45, xlab = "False positive rate", ylab = "True positive rate" )ROCConfig( dat_path = NULL, title = NULL, origin = NULL, writer = NULL, legend_position = "top", legend_placement = "outside", fpr = "fpr", tpr = "tpr", auc = NULL, class_label = NULL, split = NULL, fold = NULL, omitted = NULL, variant = "aggregate", digits = 3L, diagonal = TRUE, diagonal_color = "#888888", palette = NULL, legend = TRUE, square = TRUE, line_width = 2, fold_opacity = 0.45, xlab = "False positive rate", ylab = "True positive rate" )
dat_path |
Optional Character: Path to the data, read at draw time. The
serializable alternative to passing |
title |
Optional Character: Chart title. |
origin |
Optional Named character {"user", "default", "derived"}: Where each value came from, one entry per settable property. Absent on an authored config; written by the interface that resolved it. |
writer |
Optional Named character: Which interface wrote the config, as
|
legend_position |
Character {"top", "bottom", "left", "right", "top-left", "top-right", "bottom-left", "bottom-right"}: Legend anchor. Top/bottom anchors use horizontal rows; left/right anchors use a vertical column. Corner anchors align within the top or bottom row. |
legend_placement |
Character {"outside", "inside"}: Relation to the plotting area. Outside placement reserves space for the complete legend; inside placement overlays the data. Neither setting adds a missing legend. |
fpr |
Character: Column containing false positive rates. |
tpr |
Character: Column containing true positive rates. |
auc |
Optional Character: Optional supplied AUC column; unset integrates the supplied vertices. |
class_label |
Optional Character: Optional positive-class label column. |
split |
Optional Character: Optional sample or model label column. |
fold |
Optional Character: Optional resample column; aggregate identifies pooled curves. |
omitted |
Optional Character: Optional omitted-observation count column, constant within each curve. |
variant |
Character: Draw pooled curves or separate resample curves. |
digits |
Integer: Decimal places for AUC labels and tooltip values. |
diagonal |
Logical: Show an independent chance diagonal. |
diagonal_color |
Character: Chance-line color. |
palette |
Optional Character: Group colors; unset uses the chart theme. |
legend |
Logical: Show group labels and AUC summaries. |
square |
Logical: Keep the plotting grid square. |
line_width |
Numeric: Curve stroke width in pixels. |
fold_opacity |
Numeric: Opacity of individual resample curves. |
xlab |
Character: Horizontal axis label. |
ylab |
Character: Vertical axis label. |
A ROCConfig object.
Vertices are ordered by FPR then TPR and joined without smoothing. Curves
must be monotone and include (0, 0) and (1, 1). Supplied AUC is authoritative
and may describe a higher-resolution curve. Without an AUC binding, the
supplied vertices define trapezoidal AUC. An undefined curve is represented
by missing FPR, TPR, and AUC and is reported in the console when omitted.
Per-resample legends report the unweighted mean and sample SD of defined
fold AUCs, with available/total curve counts. SD is NA for one defined fold.
Pooled AUC is never inferred from per-fold AUCs.
The legend uses the shared position and placement controls. Curve identity
and AUC share a line; long labels wrap to the available width. All entries
remain present in static SVG output, without a scrolling legend.
Hover describes the selected curve, including its resample identifier.
Numeric tooltip labels use digits; coordinates and AUCs retain their full
precision in the compiled data.
draw(setup_ROCConfig(), data = data.frame(fpr = c(0, 0, 1), tpr = c(0, 1, 1)))draw(setup_ROCConfig(), data = data.frame(fpr = c(0, 0, 1), tpr = c(0, 1, 1)))
A serializable description of a Sankey diagram. Build one with
setup_SankeyConfig() rather than calling this constructor directly.
SankeyConfig( dat_path = NULL, title = NULL, origin = NULL, writer = NULL, source = "source", target = "target", value = "value", orient = "horizontal", node_align = NULL, node_width = NULL, node_gap = NULL, palette = NULL )SankeyConfig( dat_path = NULL, title = NULL, origin = NULL, writer = NULL, source = "source", target = "target", value = "value", orient = "horizontal", node_align = NULL, node_width = NULL, node_gap = NULL, palette = NULL )
dat_path |
Optional Character: Path to the data, read at draw time. The
serializable alternative to passing |
title |
Optional Character: Chart title. Declared here because it is the
one property every chart type has; |
origin |
Optional Named character {"user", "default", "derived"}: Where each value came from, one entry per settable property. Absent on an authored config; written by the interface that resolved it. |
writer |
Optional Named character: Which interface wrote the config, as
|
source |
Character: Column naming each link's source node. |
target |
Character: Column naming each link's target node. |
value |
Character: Column holding each link's magnitude. |
orient |
Character {"horizontal", "vertical"}: Layout direction. |
node_align |
Optional Character {"left", "right", "justify"}: How nodes are aligned along the flow. |
node_width |
Optional Numeric |
node_gap |
Optional Numeric |
palette |
Optional Character: Node colors, overriding the theme palette
for this chart. |
The bound data is a table of links, one row per flow. source, target and
value name its columns.
SankeyConfig object.
EDG
setup_SankeyConfig()@typesetup_SankeyConfig()@type
One directed link (edge) in a Sankey diagram.
SankeyEdgeItem( source = NULL, target = NULL, value = NULL, line_style = NULL, edge_label = NULL, focus_node_adjacency = NULL )SankeyEdgeItem( source = NULL, target = NULL, value = NULL, line_style = NULL, edge_label = NULL, focus_node_adjacency = NULL )
source |
Optional Character: Source node name. |
target |
Optional Character: Target node name. |
value |
Optional Numeric: Flow value (determines link width). |
line_style |
Optional LineStyle or list: Link line styling. Accepts
a LineStyle object or a plain named list; a list also allows the
Sankey-specific |
edge_label |
Optional LabelOption: Label shown on the link itself. |
focus_node_adjacency |
Optional Logical or Character {"inEdges", "outEdges", "allEdges"}: Which adjacent elements to highlight on hover. |
Corresponds to SankeyEdgeItemOption in
src/chart/sankey/SankeySeries.ts (line 88).
ECharts docs:
https://echarts.apache.org/en/option.html#series-sankey.links
SankeyEdgeItem object.
SankeyEdgeItem(source = "A", target = "B", value = 5)SankeyEdgeItem(source = "A", target = "B", value = 5)
Style overrides applied to all nodes at a given column depth. depth = 0
targets the leftmost column.
SankeyLevelOption( depth = integer(0), label = NULL, item_style = NULL, line_style = NULL )SankeyLevelOption( depth = integer(0), label = NULL, item_style = NULL, line_style = NULL )
depth |
Numeric |
label |
Optional LabelOption: Node label configuration at this depth. |
item_style |
Optional ItemStyle: Node fill/border styling at this depth. |
line_style |
Optional LineStyle or list: Link styling for edges leaving
this depth. Accepts a LineStyle object or a plain list (allows |
Corresponds to SankeyLevelOption in
src/chart/sankey/SankeySeries.ts (line 96).
ECharts docs:
https://echarts.apache.org/en/option.html#series-sankey.levels
SankeyLevelOption object.
SankeyLevelOption(depth = 0L, item_style = ItemStyle(color = "#16a085"))SankeyLevelOption(depth = 0L, item_style = ItemStyle(color = "#16a085"))
One node in a Sankey diagram. Node names must match the source / target
strings used in the corresponding SankeyEdgeItem objects.
SankeyNodeItem( name = NULL, value = NULL, depth = NULL, draggable = NULL, local_x = NULL, local_y = NULL, label = NULL, item_style = NULL, focus_node_adjacency = NULL )SankeyNodeItem( name = NULL, value = NULL, depth = NULL, draggable = NULL, local_x = NULL, local_y = NULL, label = NULL, item_style = NULL, focus_node_adjacency = NULL )
name |
Optional Character: Node name (must match source/target strings). |
value |
Optional Numeric: Node value shown in tooltip. |
depth |
Optional Numeric |
draggable |
Optional Logical: Whether the node can be dragged. |
local_x |
Optional Numeric: Horizontal position inside the layout rect. |
local_y |
Optional Numeric: Vertical position inside the layout rect. |
label |
Optional LabelOption: Node label configuration. |
item_style |
Optional ItemStyle: Node fill/border styling. |
focus_node_adjacency |
Optional Logical or Character {"inEdges", "outEdges", "allEdges"}: Which adjacent elements to highlight on hover. |
Corresponds to SankeyNodeItemOption in
src/chart/sankey/SankeySeries.ts (line 73).
ECharts docs:
https://echarts.apache.org/en/option.html#series-sankey.data
SankeyNodeItem object.
SankeyNodeItem(name = "Source A", value = 10)SankeyNodeItem(name = "Source A", value = 10)
Configuration for a Sankey diagram series. Nodes and directed links are
represented as two separate lists. Node names in data must match the
source and target strings in links.
SankeySeries( name = NULL, data = NULL, links = NULL, levels = NULL, orient = NULL, node_width = NULL, node_gap = NULL, node_align = NULL, draggable = NULL, layout_iterations = NULL, sort = NULL, roam = NULL, label = NULL, edge_label = NULL, line_style = NULL, item_style = NULL, color = NULL, left = NULL, right = NULL, top = NULL, bottom = NULL, silent = NULL, z_level = NULL, z = NULL )SankeySeries( name = NULL, data = NULL, links = NULL, levels = NULL, orient = NULL, node_width = NULL, node_gap = NULL, node_align = NULL, draggable = NULL, layout_iterations = NULL, sort = NULL, roam = NULL, label = NULL, edge_label = NULL, line_style = NULL, item_style = NULL, color = NULL, left = NULL, right = NULL, top = NULL, bottom = NULL, silent = NULL, z_level = NULL, z = NULL )
name |
Optional Character: Series name for legend and tooltip. |
data |
Optional list: Nodes as a list of SankeyNodeItem objects or
plain named lists, each with at least a |
links |
Optional list: Edges as a list of SankeyEdgeItem objects or
plain named lists with |
levels |
Optional list: List of SankeyLevelOption for per-depth styling. |
orient |
Optional Character {"horizontal", "vertical"}: Flow direction. |
node_width |
Optional Numeric |
node_gap |
Optional Numeric |
node_align |
Optional Character {"justify", "left", "right"}: Node alignment within columns. |
draggable |
Optional Logical: Whether nodes can be dragged interactively. |
layout_iterations |
Optional Numeric |
sort |
Optional Character {"desc"} or |
roam |
Optional Logical or Character {"move", "scale"}: Whether to enable pan/zoom. |
label |
Optional LabelOption: Node label configuration. |
edge_label |
Optional LabelOption: Edge label configuration. |
line_style |
Optional LineStyle or list: Default link line styling.
Accepts a LineStyle object or a plain list; a plain list also allows the
Sankey-specific |
item_style |
Optional ItemStyle: Default node styling. |
color |
Optional Character: Color palette for nodes as a character vector. |
left |
Optional Numeric or Character: Series left offset. |
right |
Optional Numeric or Character: Series right offset. |
top |
Optional Numeric or Character: Series top offset. |
bottom |
Optional Numeric or Character: Series bottom offset. |
silent |
Optional Logical: Whether to disable mouse/touch events. |
z_level |
Optional Numeric: Canvas layer index. |
z |
Optional Numeric: Front-back order within the same canvas layer. |
Corresponds to SankeySeriesOption in
src/chart/sankey/SankeySeries.ts (line 100).
ECharts docs: https://echarts.apache.org/en/option.html#series-sankey
SankeySeries object.
SankeySeries( data = list(SankeyNodeItem(name = "A"), SankeyNodeItem(name = "B")), links = list(SankeyEdgeItem(source = "A", target = "B", value = 5)) )SankeySeries( data = list(SankeyNodeItem(name = "A"), SankeyNodeItem(name = "B")), links = list(SankeyEdgeItem(source = "A", target = "B", value = 5)) )
Exports a widget created by draw() (or any of the draw_*
functions) to a static file. Supports .svg for ECharts, Sigma networks, and MapLibre maps via Node.js
server-side rendering, including complete draw_panels() figures. Requires
a Node.js (>= 18) node binary on PATH.
save_drawing(widget, filename, width = NULL, height = NULL)save_drawing(widget, filename, width = NULL, height = NULL)
widget |
htmlwidget: A widget returned by |
filename |
Character scalar: Nonempty output path with an extension. |
width |
Optional Numeric scalar |
height |
Optional Numeric scalar |
Callbacks under tooltips, axis pointers, and interactive toolbox controls are omitted. Other JavaScript callbacks are rejected because discarding them could change visible content. Built-in Gantt, dendrogram, and boxplot point renderers are shared with the browser widget and use JSON parameters. Networks share their deterministic layout and styles with the interactive widget. Maps share geometry, location joins, and color scales and use a Mercator projection. Exports show the initial configured view; browser camera changes and hover states are not stored in the R widget. SVG text remains editable. Network labels are fitted to the page and suppressed when they overlap.
The filename, invisibly.
chart <- draw_bar(x = c("A", "B", "C"), y = c(3, 7, 2)) path <- file.path(tempdir(), "chart.svg") # SVG export shells out to Node.js; report instead of failing without it. tryCatch( save_drawing(chart, path), rtemis_export_error = function(e) message(conditionMessage(e)) ) unlink(path)chart <- draw_bar(x = c("A", "B", "C"), y = c(3, 7, 2)) path <- file.path(tempdir(), "chart.svg") # SVG export shells out to Node.js; report instead of failing without it. tryCatch( save_drawing(chart, path), rtemis_export_error = function(e) message(conditionMessage(e)) ) unlink(path)
Uses ECharts-GL Scatter3DSeries, Grid3DModel, Cartesian3D, and OrbitControl. Coordinates are independently scaled to equal box dimensions. The camera is orthographic: parallel lines remain parallel and exported point positions match the configured browser view. Browser rotation/zoom is interactive; saving the R widget exports its configured initial camera.
Scatter3DConfig( dat_path = NULL, title = NULL, origin = NULL, writer = NULL, x = NULL, y = NULL, z = NULL, group = NULL, alpha = 20, beta = 40, view_size = 190, point_size = 8, opacity = NULL, mode = "points", order = "input", line_width = 2, xlab = NULL, ylab = NULL, zlab = NULL, palette = NULL, fit = NULL, fit_params = NULL, n_fit = 25L, fit_alpha = 0.35 )Scatter3DConfig( dat_path = NULL, title = NULL, origin = NULL, writer = NULL, x = NULL, y = NULL, z = NULL, group = NULL, alpha = 20, beta = 40, view_size = 190, point_size = 8, opacity = NULL, mode = "points", order = "input", line_width = 2, xlab = NULL, ylab = NULL, zlab = NULL, palette = NULL, fit = NULL, fit_params = NULL, n_fit = 25L, fit_alpha = 0.35 )
dat_path |
Optional Character: Path to the data, read at draw time. The
serializable alternative to passing |
title |
Optional Character: Chart title. Declared here because it is the
one property every chart type has; |
origin |
Optional Named character {"user", "default", "derived"}: Where each value came from, one entry per settable property. Absent on an authored config; written by the interface that resolved it. |
writer |
Optional Named character: Which interface wrote the config, as
|
x, y, z
|
Optional Character: Numeric coordinate column bindings. |
group |
Optional Character: Group column binding. |
alpha |
Numeric |
beta |
Numeric |
view_size |
Numeric |
point_size |
Numeric |
opacity |
Optional Numeric |
mode |
Character |
order |
Character |
line_width |
Numeric |
xlab, ylab, zlab
|
Optional Character: Axis names. |
palette |
Optional Character: Group colors. |
fit |
Optional Character: Model of z on x and y drawn as a surface per
group: |
fit_params |
Optional Named list: Arguments passed to the learner named
in |
n_fit |
Integer |
fit_alpha |
Numeric |
Scatter3DConfig: Validated portable settings.
setup_Scatter3DConfig(x = "Sepal.Length", y = "Sepal.Width", z = "Petal.Length")setup_Scatter3DConfig(x = "Sepal.Length", y = "Sepal.Width", z = "Petal.Length")
A serializable description of a scatter chart: which columns it binds, its
semantics, and its appearance. Build one with setup_ScatterConfig() rather
than calling this constructor directly.
ScatterConfig( dat_path = NULL, title = NULL, origin = NULL, writer = NULL, legend_position = "top", legend_placement = "outside", x = NULL, y = NULL, size = NULL, group = NULL, hover = NULL, fit_name = NULL, rug = FALSE, fit = NULL, fit_params = NULL, se = TRUE, se_times = 1.96, rsq = FALSE, diagonal = FALSE, diagonal_color = NULL, n_fit = 200L, fit_alpha = 0.25, point_alpha = NULL, palette = NULL, square = FALSE, equal_axes = FALSE, pad = 0.04, xlim = NULL, ylim = NULL, xlab = NULL, ylab = NULL, margin_top = NULL, margin_right = NULL, margin_bottom = NULL, margin_left = NULL )ScatterConfig( dat_path = NULL, title = NULL, origin = NULL, writer = NULL, legend_position = "top", legend_placement = "outside", x = NULL, y = NULL, size = NULL, group = NULL, hover = NULL, fit_name = NULL, rug = FALSE, fit = NULL, fit_params = NULL, se = TRUE, se_times = 1.96, rsq = FALSE, diagonal = FALSE, diagonal_color = NULL, n_fit = 200L, fit_alpha = 0.25, point_alpha = NULL, palette = NULL, square = FALSE, equal_axes = FALSE, pad = 0.04, xlim = NULL, ylim = NULL, xlab = NULL, ylab = NULL, margin_top = NULL, margin_right = NULL, margin_bottom = NULL, margin_left = NULL )
dat_path |
Optional Character: Path to the data, read at draw time. The
serializable alternative to passing |
title |
Optional Character: Chart title. Declared here because it is the
one property every chart type has; |
origin |
Optional Named character {"user", "default", "derived"}: Where each value came from, one entry per settable property. Absent on an authored config; written by the interface that resolved it. |
writer |
Optional Named character: Which interface wrote the config, as
|
legend_position |
Character {"top", "bottom", "left", "right", "top-left", "top-right", "bottom-left", "bottom-right"}: Legend anchor. Top/bottom anchors use horizontal rows; left/right anchors use a vertical column. Corner anchors align within the top or bottom row. |
legend_placement |
Character {"outside", "inside"}: Relation to the plotting area. Outside placement reserves space for the complete legend; inside placement overlays the data. Neither setting adds a missing legend. |
x, y
|
Optional Character: Columns drawn on each axis. |
size |
Optional Character: Column giving per-point size. |
group |
Optional Character: Column to group and color points by. |
hover |
Optional Character: Column containing per-observation tooltip labels. |
fit_name |
Optional Character: Label for fitted layers. |
rug |
Logical: Show marginal marks along the x and y axes. |
fit |
Optional Character: Fit to overlay: |
fit_params |
Optional Named list: Arguments passed to the learner named
in |
se |
Logical: If TRUE, shade the fit standard-error band. |
se_times |
Numeric |
rsq |
Logical: Include the fitted model's R-squared in series labels. |
diagonal |
Logical: Draw the identity line within the axis limits. |
diagonal_color |
Optional Character: Identity-line color. |
n_fit |
Integer |
fit_alpha |
Numeric |
point_alpha |
Optional Numeric |
palette |
Optional Character: Series colors, overriding the theme
palette for this chart. |
square |
Logical: If TRUE, draw the plotting box square – equal height and width in pixels, excluding axis labels and margins. |
equal_axes |
Logical: If TRUE, give one data unit the same size in
pixels on both axes. Set with |
pad |
Numeric |
xlim, ylim
|
Optional Numeric: Axis limits, length 2. |
xlab, ylab
|
Optional Character: Axis labels. |
margin_top, margin_right, margin_bottom, margin_left
|
Optional Integer
|
The data-binding properties (x, y, size, group) hold column names,
not values. The values come from the data argument to draw(), or from the
inherited dat_path.
Margins are declared as four scalars rather than one named vector: that is
what states cleanly in a schema, while draw_scatter() keeps the convenient
margins vector. Sides left NULL fall back to the chart's own layout.
ScatterConfig object.
EDG
cfg <- setup_ScatterConfig(x = "wt", y = "mpg", fit = "glm") cfg@typecfg <- setup_ScatterConfig(x = "wt", y = "mpg", fit = "glm") cfg@type
Configuration for a scatter (point) chart series.
ScatterSeries( name = NULL, data = NULL, x_axis_index = NULL, y_axis_index = NULL, silent = NULL, legend_hover_link = NULL, color = NULL, z_level = NULL, z = NULL, clip = NULL, symbol = NULL, symbol_size = NULL, symbol_rotate = NULL, symbol_offset = NULL, large = NULL, large_threshold = NULL, item_style = NULL, label = NULL )ScatterSeries( name = NULL, data = NULL, x_axis_index = NULL, y_axis_index = NULL, silent = NULL, legend_hover_link = NULL, color = NULL, z_level = NULL, z = NULL, clip = NULL, symbol = NULL, symbol_size = NULL, symbol_rotate = NULL, symbol_offset = NULL, large = NULL, large_threshold = NULL, item_style = NULL, label = NULL )
name |
Optional Character: Series name for legend display. |
data |
Optional Vector or list: Data values. |
x_axis_index |
Optional Numeric |
y_axis_index |
Optional Numeric |
silent |
Optional Logical: Whether the series is silent. |
legend_hover_link |
Optional Logical: Whether to highlight related legends on hover. |
color |
Optional Character: Series color override. |
z_level |
Optional Numeric: Canvas layer index. |
z |
Optional Numeric: Front-back order within the same layer. |
clip |
Optional Logical: Whether to clip overflow. |
symbol |
Optional Character: Symbol type. |
symbol_size |
Optional Numeric or function: Symbol size. |
symbol_rotate |
Optional Numeric: Symbol rotation in degrees,
counter-clockwise-positive. A symbol is unrotated at |
symbol_offset |
Optional Numeric or Character: Shift from the data
point as |
large |
Optional Logical: Whether to enable large-data optimization. |
large_threshold |
Optional Numeric |
item_style |
Optional ItemStyle: Data-point marker styling. |
label |
Optional LabelOption: Data-label configuration. |
Corresponds to ScatterSeriesOption in src/chart/scatter/ScatterSeries.ts (line 64).
ECharts docs: https://echarts.apache.org/en/option.html#series-scatter
ScatterSeries object.
ScatterSeries(name = "Points", data = list(c(1, 2), c(3, 4)), symbol_size = 8)ScatterSeries(name = "Points", data = list(c(1, 2), c(3, 4)), symbol_size = 8)
The seam between convenient input and a complete, validated object. Every argument is optional, which is what lets the published schema require nothing.
setup_A3Config( n_per_row = 21L, position_every = 10L, ptm_placement = "radial", zoom = TRUE, residue_spacing = 0.3, marker_size = 28, font_size = 18, line_width = 2, show_markers = TRUE, show_labels = TRUE, region_opacity = 0.3, residue_fill = NULL, residue_stroke = NULL, label_color = NULL, pos_label_color = NULL, variant_color = NULL, disease_variant_color = NULL, title = NULL, dat_path = NULL, origin = NULL, writer = NULL )setup_A3Config( n_per_row = 21L, position_every = 10L, ptm_placement = "radial", zoom = TRUE, residue_spacing = 0.3, marker_size = 28, font_size = 18, line_width = 2, show_markers = TRUE, show_labels = TRUE, region_opacity = 0.3, residue_fill = NULL, residue_stroke = NULL, label_color = NULL, pos_label_color = NULL, variant_color = NULL, disease_variant_color = NULL, title = NULL, dat_path = NULL, origin = NULL, writer = NULL )
n_per_row |
Integer |
position_every |
Integer |
ptm_placement |
Character: How post-translational modifications are placed relative to the backbone. |
zoom |
Logical: Enable the zoom control. |
residue_spacing |
Numeric |
marker_size |
Numeric |
font_size |
Numeric |
line_width |
Numeric |
show_markers, show_labels
|
Logical: Whether to draw each. |
region_opacity |
Numeric |
residue_fill, residue_stroke
|
Optional Character: Residue marker colors. |
label_color, pos_label_color
|
Optional Character: Label colors. |
variant_color, disease_variant_color
|
Optional Character: Variant marker colors.
|
title |
Optional Character: Chart title. Declared here because it is the
one property every chart type has; |
dat_path |
Optional Character: Path to the data, read at draw time. The
serializable alternative to passing |
origin |
Optional Named character: Where each value came from. Normally computed from which arguments were supplied; pass it only when restoring a config that already carries provenance. |
writer |
Optional Named character: Which interface wrote the config. |
A3Config object.
EDG
setup_A3Config(n_per_row = 30L)@n_per_rowsetup_A3Config(n_per_row = 30L)@n_per_row
The seam between convenient input and a complete, validated object. Every argument is optional, which is what lets the published schema require nothing.
setup_BarConfig( x = NULL, y = NULL, stack = FALSE, horizontal = FALSE, palette = NULL, xlab = NULL, ylab = NULL, title = NULL, margin_top = NULL, margin_right = NULL, margin_bottom = NULL, margin_left = NULL, dat_path = NULL, origin = NULL, writer = NULL, bar_width = NULL, order = "input", legend_position = "top", legend_placement = "outside" )setup_BarConfig( x = NULL, y = NULL, stack = FALSE, horizontal = FALSE, palette = NULL, xlab = NULL, ylab = NULL, title = NULL, margin_top = NULL, margin_right = NULL, margin_bottom = NULL, margin_left = NULL, dat_path = NULL, origin = NULL, writer = NULL, bar_width = NULL, order = "input", legend_position = "top", legend_placement = "outside" )
x |
Optional Character: Column holding the categories. |
y |
Optional Character: Columns holding the values, one series each. |
stack |
Logical: If TRUE, stack the series instead of grouping them. |
horizontal |
Logical: If TRUE, draw the bars horizontally. |
palette |
Optional Character: Series colors, overriding the theme
palette for this chart. |
xlab, ylab
|
Optional Character: Axis labels. |
title |
Optional Character: Chart title. Declared here because it is the
one property every chart type has; |
margin_top, margin_right, margin_bottom, margin_left
|
Optional Integer
|
dat_path |
Optional Character: Path to the data, read at draw time. The
serializable alternative to passing |
origin |
Optional Named character: Where each value came from. Normally computed from which arguments were supplied; pass it only when restoring a config that already carries provenance. |
writer |
Optional Named character: Which interface wrote the config. |
bar_width |
Optional Numeric |
order |
Character |
legend_position |
Character {"top", "bottom", "left", "right", "top-left", "top-right", "bottom-left", "bottom-right"}: Legend anchor. Top/bottom anchors use horizontal rows; left/right anchors use a vertical column. Corner anchors align within the top or bottom row. |
legend_placement |
Character {"outside", "inside"}: Relation to the plotting area. Outside placement reserves space for the complete legend; inside placement overlays the data. Neither setting adds a missing legend. |
BarConfig object.
EDG
draw(setup_BarConfig(x = "cyl", y = "mpg"), data = aggregate(mpg ~ cyl, mtcars, mean))draw(setup_BarConfig(x = "cyl", y = "mpg"), data = aggregate(mpg ~ cyl, mtcars, mean))
The seam between convenient input and a complete, validated object. Every argument is optional, which is what lets the published schema require nothing.
setup_BoxplotConfig( x = NULL, group = NULL, labels = NULL, horizontal = FALSE, na_rm = TRUE, observation = NULL, quartiles = "linear", whisker = 1.5, boxpoints = "none", point_size = 5, point_alpha = 0.6, point_spread = 0.5, palette = NULL, fill_alpha = 0.25, xlab = NULL, ylab = NULL, title = NULL, margin_top = NULL, margin_right = NULL, margin_bottom = NULL, margin_left = NULL, dat_path = NULL, origin = NULL, writer = NULL, legend_position = "top", legend_placement = "outside", geometry = "box", bandwidth = NULL, adjust = 1, density_points = 128L, paired = FALSE, pair_alpha = 0.35, pair_width = 1, comparisons = NULL, order = "input", transform = "none" )setup_BoxplotConfig( x = NULL, group = NULL, labels = NULL, horizontal = FALSE, na_rm = TRUE, observation = NULL, quartiles = "linear", whisker = 1.5, boxpoints = "none", point_size = 5, point_alpha = 0.6, point_spread = 0.5, palette = NULL, fill_alpha = 0.25, xlab = NULL, ylab = NULL, title = NULL, margin_top = NULL, margin_right = NULL, margin_bottom = NULL, margin_left = NULL, dat_path = NULL, origin = NULL, writer = NULL, legend_position = "top", legend_placement = "outside", geometry = "box", bandwidth = NULL, adjust = 1, density_points = 128L, paired = FALSE, pair_alpha = 0.35, pair_width = 1, comparisons = NULL, order = "input", transform = "none" )
x |
Optional Character: Columns to summarize, one box each. |
group |
Optional Character: Column that splits each box by level. |
labels |
Optional Character: Box labels. |
horizontal |
Logical: Draw the boxes horizontally. |
na_rm |
Logical: Remove missing values. FALSE rejects missing input. |
observation |
Optional Character: Column identifying observations for tooltips and pairing. |
quartiles |
Character {"linear", "hinges"}: Quartile convention. |
whisker |
Numeric |
boxpoints |
Character {"none", "all", "outliers"}: Values to overlay. |
point_size |
Numeric |
point_alpha |
Numeric |
point_spread |
Numeric |
palette |
Optional Character: Box colors, overriding the theme palette
for this chart. |
fill_alpha |
Numeric |
xlab, ylab
|
Optional Character: Axis labels. |
title |
Optional Character: Chart title. |
margin_top, margin_right, margin_bottom, margin_left
|
Optional Integer
|
dat_path |
Optional Character: Path to the data, read at draw time. The
serializable alternative to passing |
origin |
Optional Named character: Where each value came from. Normally computed from which arguments were supplied; pass it only when restoring a config that already carries provenance. |
writer |
Optional Named character: Which interface wrote the config. |
legend_position |
Character {"top", "bottom", "left", "right", "top-left", "top-right", "bottom-left", "bottom-right"}: Legend anchor. Top/bottom anchors use horizontal rows; left/right anchors use a vertical column. Corner anchors align within the top or bottom row. |
legend_placement |
Character {"outside", "inside"}: Relation to the plotting area. Outside placement reserves space for the complete legend; inside placement overlays the data. Neither setting adds a missing legend. |
geometry |
Character {"box", "violin", "both"}: Distribution geometry. |
bandwidth |
Optional Numeric |
adjust |
Numeric |
density_points |
Integer |
paired |
Logical: Connect explicit IDs across adjacent categories. |
pair_alpha |
Numeric |
pair_width |
Numeric |
comparisons |
Optional Character: Name of a comparison data frame in the
bound data list. Its columns follow |
order |
Character |
transform |
Character |
BoxplotConfig object.
EDG
draw(setup_BoxplotConfig(x = c("mpg", "hp")), data = mtcars)draw(setup_BoxplotConfig(x = c("mpg", "hp")), data = mtcars)
Set Up a Calibration Plot Configuration
setup_CalibrationConfig( observed = "observed", probability = "probability", group = NULL, n_bins = 10L, bin_method = "quantile", na_rm = TRUE, mode = "lines+markers", show_brier = TRUE, rug = TRUE, rug_size = 8, rug_opacity = 0.3, point_size = 7, line_width = 2, digits = 3L, diagonal = TRUE, diagonal_color = "#888888", palette = NULL, legend = TRUE, legend_position = "top", legend_placement = "outside", square = TRUE, xlab = "Mean predicted probability", ylab = "Observed proportion", title = NULL, dat_path = NULL, origin = NULL, writer = NULL )setup_CalibrationConfig( observed = "observed", probability = "probability", group = NULL, n_bins = 10L, bin_method = "quantile", na_rm = TRUE, mode = "lines+markers", show_brier = TRUE, rug = TRUE, rug_size = 8, rug_opacity = 0.3, point_size = 7, line_width = 2, digits = 3L, diagonal = TRUE, diagonal_color = "#888888", palette = NULL, legend = TRUE, legend_position = "top", legend_placement = "outside", square = TRUE, xlab = "Mean predicted probability", ylab = "Observed proportion", title = NULL, dat_path = NULL, origin = NULL, writer = NULL )
observed |
Character: Column containing binary outcomes, zero or one. |
probability |
Character: Column containing predicted probabilities. |
group |
Optional Character: Column identifying samples or models. |
n_bins |
Integer |
bin_method |
Character {"quantile", "equidistant"}: Binning rule. |
na_rm |
Logical: Remove incomplete observation/probability pairs. |
mode |
Character {"lines", "markers", "lines+markers"}: Curve display. |
show_brier |
Logical: Include each sample's Brier score in its legend label. |
rug |
Logical: Show the distribution of individual probabilities. |
rug_size |
Numeric |
rug_opacity |
Numeric |
point_size |
Numeric |
line_width |
Numeric: Curve stroke width in pixels. |
digits |
Integer: Decimal places for AUC labels and tooltip values. |
diagonal |
Logical: Show an independent chance diagonal. |
diagonal_color |
Character: Chance-line color. |
palette |
Optional Character: Group colors; unset uses the chart theme. |
legend |
Logical: Show group labels and AUC summaries. |
legend_position |
Character {"top", "bottom", "left", "right", "top-left", "top-right", "bottom-left", "bottom-right"}: Legend anchor. Top/bottom anchors use horizontal rows; left/right anchors use a vertical column. Corner anchors align within the top or bottom row. |
legend_placement |
Character {"outside", "inside"}: Relation to the plotting area. Outside placement reserves space for the complete legend; inside placement overlays the data. Neither setting adds a missing legend. |
square |
Logical: Keep the plotting grid square. |
xlab |
Character: Horizontal axis label. |
ylab |
Character: Vertical axis label. |
title |
Optional Character: Chart title. |
dat_path |
Optional Character: Path to the data, read at draw time. The
serializable alternative to passing |
origin |
Optional Named character: Per-property provenance. |
writer |
Optional Named character: Interface name and version. |
A CalibrationConfig object.
setup_CalibrationConfig(group = "model", n_bins = 5L)setup_CalibrationConfig(group = "model", n_bins = 5L)
The seam between convenient input and a complete, validated object. Every argument is optional, which is what lets the published schema require nothing.
setup_ChoroplethConfig( location = NULL, value = NULL, tooltip = NULL, resolution = "country", classification = "quantile", num_classes = 5, colormap = "blues", opacity = 1, show_boundaries = TRUE, outline_width = 0.2, show_legend = TRUE, legend_position = "bottom-right", tooltip_position = "top-right", value_label = NULL, title = NULL, dat_path = NULL, origin = NULL, writer = NULL )setup_ChoroplethConfig( location = NULL, value = NULL, tooltip = NULL, resolution = "country", classification = "quantile", num_classes = 5, colormap = "blues", opacity = 1, show_boundaries = TRUE, outline_width = 0.2, show_legend = TRUE, legend_position = "bottom-right", tooltip_position = "top-right", value_label = NULL, title = NULL, dat_path = NULL, origin = NULL, writer = NULL )
location |
Optional Character: Column holding the region identifiers. |
value |
Optional Character: Column holding the value to shade by. |
tooltip |
Optional Character: Column holding per-region tooltip text. |
resolution |
Character {"country", "state", "county"}: Which boundary set the locations refer to. |
classification |
Character {"quantile", "equal", "jenks"}: How values are binned into classes. |
num_classes |
Numeric |
colormap |
Character: Continuous color scheme for the classes. |
opacity |
Numeric |
show_boundaries, show_legend
|
Logical: Whether to draw each. |
outline_width |
Numeric |
legend_position, tooltip_position
|
Character: Corner each overlay is anchored to. |
value_label |
Optional Character: Label for the value in the legend and
tooltip. |
title |
Optional Character: Chart title. Declared here because it is the
one property every chart type has; |
dat_path |
Optional Character: Path to the data, read at draw time. The
serializable alternative to passing |
origin |
Optional Named character: Where each value came from. Normally computed from which arguments were supplied; pass it only when restoring a config that already carries provenance. |
writer |
Optional Named character: Which interface wrote the config. |
ChoroplethConfig object.
EDG
states <- data.frame(st = c("CA", "TX", "NY"), v = c(1, 2, 3)) draw( setup_ChoroplethConfig(location = "st", value = "v", resolution = "state"), data = states )states <- data.frame(st = c("CA", "TX", "NY"), v = c(1, 2, 3)) draw( setup_ChoroplethConfig(location = "st", value = "v", resolution = "state"), data = states )
Set Up a Confusion Plot Configuration
setup_ConfusionConfig( reference = "reference", predicted = "predicted", count = "n", panel = NULL, classes = NULL, show_metrics = TRUE, digits = 2L, ncol = 2L, correct_color = "#0F6A66", incorrect_color = "#BE2E5F", low_color = NULL, summary_color = NULL, font_size = 12, xlab = "Predicted", ylab = "Reference", title = NULL, dat_path = NULL, origin = NULL, writer = NULL )setup_ConfusionConfig( reference = "reference", predicted = "predicted", count = "n", panel = NULL, classes = NULL, show_metrics = TRUE, digits = 2L, ncol = 2L, correct_color = "#0F6A66", incorrect_color = "#BE2E5F", low_color = NULL, summary_color = NULL, font_size = 12, xlab = "Predicted", ylab = "Reference", title = NULL, dat_path = NULL, origin = NULL, writer = NULL )
reference |
Character: Column containing reference class labels. |
predicted |
Character: Column containing predicted class labels. |
count |
Character: Column containing nonnegative integer frequencies. |
panel |
Optional Character: Optional panel-label column; unset draws one matrix. |
classes |
Optional Character vector: Ordered class labels shared by every panel; unset preserves first appearance. |
show_metrics |
Logical: Show per-class rates, accuracy, and balanced accuracy. |
digits |
Integer: Decimal places for rates in cells and hover text. |
ncol |
Integer: Maximum number of panels per row. |
correct_color |
Character: Six-digit hex color at unit fraction for correct predictions. |
incorrect_color |
Character: Six-digit hex color at unit fraction for incorrect predictions. |
low_color |
Optional Character: Six-digit hex color at zero row fraction; unset uses the active theme background. |
summary_color |
Optional Character: Six-digit hex background for metric cells; unset uses a faint neutral tint of the active theme background. |
font_size |
Numeric: Preferred cell-label font size in pixels. Constrained surfaces reduce text to fit, down to 8 pixels. Long class labels wrap and column labels rotate when needed. Increase figure dimensions if labels and metrics cannot fit without overlap. |
xlab |
Character: Predicted-class axis label. |
ylab |
Character: Reference-class axis label. |
title |
Optional Character: Chart title. Declared here because it is the
one property every chart type has; |
dat_path |
Optional Character: Path to the data, read at draw time. The
serializable alternative to passing |
origin |
Optional Named character: Per-property provenance. |
writer |
Optional Named character: Interface name and version. |
A ConfusionConfig object.
setup_ConfusionConfig(panel = "split", classes = c("yes", "no"))setup_ConfusionConfig(panel = "split", classes = c("yes", "no"))
The seam between convenient input and a complete, validated object. Every argument is optional, which is what lets the published schema require nothing.
setup_DensityConfig( x = NULL, group = NULL, n = 512L, bw = "nrd0", na_rm = TRUE, palette = NULL, xlab = NULL, ylab = NULL, title = NULL, margin_top = NULL, margin_right = NULL, margin_bottom = NULL, margin_left = NULL, dat_path = NULL, origin = NULL, writer = NULL, legend_position = "top", legend_placement = "outside", bandwidth = NULL, kernel = "gaussian", adjust = 1, fill_alpha = 0.25, mode = "overlap", order = "input" )setup_DensityConfig( x = NULL, group = NULL, n = 512L, bw = "nrd0", na_rm = TRUE, palette = NULL, xlab = NULL, ylab = NULL, title = NULL, margin_top = NULL, margin_right = NULL, margin_bottom = NULL, margin_left = NULL, dat_path = NULL, origin = NULL, writer = NULL, legend_position = "top", legend_placement = "outside", bandwidth = NULL, kernel = "gaussian", adjust = 1, fill_alpha = 0.25, mode = "overlap", order = "input" )
x |
Optional Character: Columns to estimate, one distribution per column. |
group |
Optional Character: Column to split the estimate by. |
n |
Integer |
bw |
Character or Numeric: Bandwidth selector ( |
na_rm |
Logical: If TRUE, drop |
palette |
Optional Character: Series colors, overriding the theme
palette for this chart. |
xlab, ylab
|
Optional Character: Axis labels. |
title |
Optional Character: Chart title. Declared here because it is the
one property every chart type has; |
margin_top, margin_right, margin_bottom, margin_left
|
Optional Integer
|
dat_path |
Optional Character: Path to the data, read at draw time. The
serializable alternative to passing |
origin |
Optional Named character: Where each value came from. Normally computed from which arguments were supplied; pass it only when restoring a config that already carries provenance. |
writer |
Optional Named character: Which interface wrote the config. |
legend_position |
Character {"top", "bottom", "left", "right", "top-left", "top-right", "bottom-left", "bottom-right"}: Legend anchor. Top/bottom anchors use horizontal rows; left/right anchors use a vertical column. Corner anchors align within the top or bottom row. |
legend_placement |
Character {"outside", "inside"}: Relation to the plotting area. Outside placement reserves space for the complete legend; inside placement overlays the data. Neither setting adds a missing legend. |
bandwidth |
Optional Numeric |
kernel |
Character: One of |
adjust |
Numeric |
fill_alpha |
Numeric |
mode |
Character |
order |
Character |
DensityConfig object.
EDG
draw(setup_DensityConfig(x = "mpg"), data = mtcars)draw(setup_DensityConfig(x = "mpg"), data = mtcars)
The seam between convenient input and a complete, validated object. Every argument is optional, which is what lets the published schema require nothing.
setup_GanttConfig( label = "label", start = "start", end = "end", group = NULL, tooltip = NULL, border = NULL, axis_type = "value", zoom = TRUE, guides = TRUE, bar_height = 0.6, bar_radius = 0, border_color = "#E53935", border_width = 1.5, palette = NULL, xlab = NULL, title = NULL, dat_path = NULL, origin = NULL, writer = NULL, legend_position = "top", legend_placement = "outside" )setup_GanttConfig( label = "label", start = "start", end = "end", group = NULL, tooltip = NULL, border = NULL, axis_type = "value", zoom = TRUE, guides = TRUE, bar_height = 0.6, bar_radius = 0, border_color = "#E53935", border_width = 1.5, palette = NULL, xlab = NULL, title = NULL, dat_path = NULL, origin = NULL, writer = NULL, legend_position = "top", legend_placement = "outside" )
label |
Character: Column naming each task. |
start |
Character: Column holding each task's start. |
end |
Character: Column holding each task's end. |
group |
Optional Character: Column to color bars by. |
tooltip |
Optional Character: Column holding per-bar tooltip text. |
border |
Optional Character: Logical column; |
axis_type |
Character {"value", "time"}: How the time axis is scaled. |
zoom |
Logical: Enable the zoom control. |
guides |
Logical: Show guide lines. |
bar_height |
Numeric |
bar_radius |
Numeric |
border_color |
Character: Outline color for bordered bars. |
border_width |
Numeric |
palette |
Optional Character: Bar colors, overriding the theme palette
for this chart. |
xlab |
Optional Character: Time axis label. |
title |
Optional Character: Chart title. Declared here because it is the
one property every chart type has; |
dat_path |
Optional Character: Path to the data, read at draw time. The
serializable alternative to passing |
origin |
Optional Named character: Where each value came from. Normally computed from which arguments were supplied; pass it only when restoring a config that already carries provenance. |
writer |
Optional Named character: Which interface wrote the config. |
legend_position |
Character {"top", "bottom", "left", "right", "top-left", "top-right", "bottom-left", "bottom-right"}: Legend anchor. Top/bottom anchors use horizontal rows; left/right anchors use a vertical column. Corner anchors align within the top or bottom row. |
legend_placement |
Character {"outside", "inside"}: Relation to the plotting area. Outside placement reserves space for the complete legend; inside placement overlays the data. Neither setting adds a missing legend. |
GanttConfig object.
EDG
tasks <- data.frame( label = c("s1", "s2"), start = c(0, 5), end = c(5, 9), kind = c("a", "b") ) draw(setup_GanttConfig(group = "kind"), data = tasks)tasks <- data.frame( label = c("s1", "s2"), start = c(0, 5), end = c(5, 9), kind = c("a", "b") ) draw(setup_GanttConfig(group = "kind"), data = tasks)
The seam between convenient input and a complete, validated object. Every argument is optional, which is what lets the published schema require nothing.
setup_HeatmapConfig( row_names = NULL, col_names = NULL, triangle = NULL, cluster_rows = FALSE, cluster_cols = FALSE, dist_method = "euclidean", hclust_method = "complete", square_cells = NULL, show_row_dendro = TRUE, show_col_dendro = TRUE, dendro_row_width = 60, dendro_col_height = 60, dendro_color = NULL, dendro_uniform = FALSE, dendro_row_side = "right", dendro_col_side = "top", colormap = NULL, zlim = NULL, show_notes = FALSE, row_cut = NULL, col_cut = NULL, show_values = FALSE, value_digits = 2L, show_colorbar = TRUE, colorbar_orient = "vertical", title = NULL, margin_top = NULL, margin_right = NULL, margin_bottom = NULL, margin_left = NULL, dat_path = NULL, origin = NULL, writer = NULL, legend_position = if (colorbar_orient == "horizontal") "bottom" else "right", legend_placement = "outside" )setup_HeatmapConfig( row_names = NULL, col_names = NULL, triangle = NULL, cluster_rows = FALSE, cluster_cols = FALSE, dist_method = "euclidean", hclust_method = "complete", square_cells = NULL, show_row_dendro = TRUE, show_col_dendro = TRUE, dendro_row_width = 60, dendro_col_height = 60, dendro_color = NULL, dendro_uniform = FALSE, dendro_row_side = "right", dendro_col_side = "top", colormap = NULL, zlim = NULL, show_notes = FALSE, row_cut = NULL, col_cut = NULL, show_values = FALSE, value_digits = 2L, show_colorbar = TRUE, colorbar_orient = "vertical", title = NULL, margin_top = NULL, margin_right = NULL, margin_bottom = NULL, margin_left = NULL, dat_path = NULL, origin = NULL, writer = NULL, legend_position = if (colorbar_orient == "horizontal") "bottom" else "right", legend_placement = "outside" )
row_names, col_names
|
Optional Character: Labels overriding the matrix dimnames. |
triangle |
Optional Character {"lower", "upper"}: Show only one triangle, for a symmetric matrix. |
cluster_rows, cluster_cols
|
Logical: Reorder by hierarchical clustering. |
dist_method |
Character: Distance measure for clustering. |
hclust_method |
Character: Linkage method for clustering. |
square_cells |
Optional Logical: Force square cells, sizing the container to match. |
show_row_dendro, show_col_dendro
|
Logical: Draw each dendrogram. |
dendro_row_width, dendro_col_height
|
Numeric |
dendro_color |
Optional Character: Dendrogram line color. |
dendro_uniform |
Logical: Draw dendrograms with uniform branch heights. |
dendro_row_side |
Character {"left", "right"}: Row dendrogram side. |
dendro_col_side |
Character {"top", "bottom"}: Column dendrogram side. |
colormap |
Optional Character: Colors defining the continuous scale.
|
zlim |
Optional Numeric: Color-scale limits, length 2. |
show_notes |
Logical: Print supplied cell notes instead of numeric values. |
row_cut, col_cut
|
Optional Integer: Number of clusters for branch coloring, requiring a computed or supplied tree. |
show_values |
Logical: Print each cell's value. |
value_digits |
Integer |
show_colorbar |
Logical: Draw the color bar. |
colorbar_orient |
Character {"vertical", "horizontal"}: Color bar orientation. |
title |
Optional Character: Chart title. Declared here because it is the
one property every chart type has; |
margin_top, margin_right, margin_bottom, margin_left
|
Optional Integer
|
dat_path |
Optional Character: Path to the data, read at draw time. The
serializable alternative to passing |
origin |
Optional Named character: Where each value came from. Normally computed from which arguments were supplied; pass it only when restoring a config that already carries provenance. |
writer |
Optional Named character: Which interface wrote the config. |
legend_position |
Character {"top", "bottom", "left", "right", "top-left", "top-right", "bottom-left", "bottom-right"}: Legend anchor. Top/bottom anchors use horizontal rows; left/right anchors use a vertical column. Corner anchors align within the top or bottom row. |
legend_placement |
Character {"outside", "inside"}: Relation to the plotting area. Outside placement reserves space for the complete legend; inside placement overlays the data. Neither setting adds a missing legend. |
HeatmapConfig object.
EDG
draw(setup_HeatmapConfig(), data = matrix(1:20, nrow = 4))draw(setup_HeatmapConfig(), data = matrix(1:20, nrow = 4))
The seam between convenient input and a complete, validated object. Every argument is optional, which is what lets the published schema require nothing.
setup_HistogramConfig( x = NULL, group = NULL, breaks = "Sturges", palette = NULL, xlab = NULL, ylab = NULL, title = NULL, margin_top = NULL, margin_right = NULL, margin_bottom = NULL, margin_left = NULL, dat_path = NULL, origin = NULL, writer = NULL, legend_position = "top", legend_placement = "outside", bins = NULL, bin_edges = NULL, normalization = "count", density = FALSE, n = 512L, bw = "nrd0", bandwidth = NULL, kernel = "gaussian", adjust = 1, fill_alpha = 0.25, na_rm = TRUE, mode = "overlap", order = "input", bin_stat = "count", bar_mode = "overlay" )setup_HistogramConfig( x = NULL, group = NULL, breaks = "Sturges", palette = NULL, xlab = NULL, ylab = NULL, title = NULL, margin_top = NULL, margin_right = NULL, margin_bottom = NULL, margin_left = NULL, dat_path = NULL, origin = NULL, writer = NULL, legend_position = "top", legend_placement = "outside", bins = NULL, bin_edges = NULL, normalization = "count", density = FALSE, n = 512L, bw = "nrd0", bandwidth = NULL, kernel = "gaussian", adjust = 1, fill_alpha = 0.25, na_rm = TRUE, mode = "overlap", order = "input", bin_stat = "count", bar_mode = "overlay" )
x |
Optional Character: Columns to bin, one distribution per column. |
group |
Optional Character: Column to split the bins by. |
breaks |
Numeric, Character, or Numeric vector: Binning method. A single number (number of bins), a character
string naming an algorithm (e.g. |
palette |
Optional Character: Series colors, overriding the theme
palette for this chart. |
xlab, ylab
|
Optional Character: Axis labels. |
title |
Optional Character: Chart title. Declared here because it is the
one property every chart type has; |
margin_top, margin_right, margin_bottom, margin_left
|
Optional Integer
|
dat_path |
Optional Character: Path to the data, read at draw time. The
serializable alternative to passing |
origin |
Optional Named character: Where each value came from. Normally computed from which arguments were supplied; pass it only when restoring a config that already carries provenance. |
writer |
Optional Named character: Which interface wrote the config. |
legend_position |
Character {"top", "bottom", "left", "right", "top-left", "top-right", "bottom-left", "bottom-right"}: Legend anchor. Top/bottom anchors use horizontal rows; left/right anchors use a vertical column. Corner anchors align within the top or bottom row. |
legend_placement |
Character {"outside", "inside"}: Relation to the plotting area. Outside placement reserves space for the complete legend; inside placement overlays the data. Neither setting adds a missing legend. |
bins |
Optional Integer |
bin_edges |
Optional Numeric vector: Finite, strictly increasing edges
spanning every retained observation. Overrides |
normalization |
Character: |
density |
Logical: Overlay a kernel density in histogram units. |
n |
Integer |
bw |
Character or Numeric: Bandwidth selector ( |
bandwidth |
Optional Numeric |
kernel |
Character: One of |
adjust |
Numeric |
fill_alpha |
Numeric |
na_rm |
Logical: Whether to remove |
mode |
Character |
order |
Character |
bin_stat |
Character |
bar_mode |
Character |
HistogramConfig object.
EDG
draw(setup_HistogramConfig(x = "mpg"), data = mtcars)draw(setup_HistogramConfig(x = "mpg"), data = mtcars)
The seam between convenient input and a complete, validated object. Every argument is optional, which is what lets the published schema require nothing.
setup_LineConfig( x = NULL, y = NULL, group = NULL, blocks = NULL, smooth = FALSE, area = FALSE, points = TRUE, zoom = FALSE, palette = NULL, block_color = NULL, block_opacity = 0.2, pad = DEFAULT_PAD, square = FALSE, equal_axes = FALSE, xlim = NULL, ylim = NULL, xlab = NULL, ylab = NULL, title = NULL, margin_top = NULL, margin_right = NULL, margin_bottom = NULL, margin_left = NULL, dat_path = NULL, origin = NULL, writer = NULL, legend_position = "top", legend_placement = "outside" )setup_LineConfig( x = NULL, y = NULL, group = NULL, blocks = NULL, smooth = FALSE, area = FALSE, points = TRUE, zoom = FALSE, palette = NULL, block_color = NULL, block_opacity = 0.2, pad = DEFAULT_PAD, square = FALSE, equal_axes = FALSE, xlim = NULL, ylim = NULL, xlab = NULL, ylab = NULL, title = NULL, margin_top = NULL, margin_right = NULL, margin_bottom = NULL, margin_left = NULL, dat_path = NULL, origin = NULL, writer = NULL, legend_position = "top", legend_placement = "outside" )
x |
Optional Character: Column along the horizontal axis. A numeric
column gets a value axis, a |
y |
Optional Character: Columns to plot, one line each. |
group |
Optional Character: Column to group and color lines by. Splits
a single |
blocks |
Optional Character: Column whose contiguous runs shade vertical background bands. |
smooth |
Logical: Draw smoothed lines. |
area |
Logical: Fill the area under each line. |
points |
Logical: Show a marker at each data value. |
zoom |
Logical: Enable the zoom control. |
palette |
Optional Character: Series colors, overriding the theme
palette for this chart. |
block_color |
Optional Character: Band colors. |
block_opacity |
Numeric |
pad |
Numeric |
square |
Logical: If TRUE, draw the plotting box square – equal height and width in pixels, excluding axis labels and margins. |
equal_axes |
Logical: If TRUE, give one data unit the same size in
pixels on both axes. Set with |
xlim, ylim
|
Optional Numeric: Axis limits, length 2. |
xlab, ylab
|
Optional Character: Axis labels. |
title |
Optional Character: Chart title. Declared here because it is the
one property every chart type has; |
margin_top, margin_right, margin_bottom, margin_left
|
Optional Integer
|
dat_path |
Optional Character: Path to the data, read at draw time. The
serializable alternative to passing |
origin |
Optional Named character: Where each value came from. Normally computed from which arguments were supplied; pass it only when restoring a config that already carries provenance. |
writer |
Optional Named character: Which interface wrote the config. |
legend_position |
Character {"top", "bottom", "left", "right", "top-left", "top-right", "bottom-left", "bottom-right"}: Legend anchor. Top/bottom anchors use horizontal rows; left/right anchors use a vertical column. Corner anchors align within the top or bottom row. |
legend_placement |
Character {"outside", "inside"}: Relation to the plotting area. Outside placement reserves space for the complete legend; inside placement overlays the data. Neither setting adds a missing legend. |
LineConfig object.
EDG
draw(setup_LineConfig(x = "wt", y = "mpg"), data = mtcars[order(mtcars$wt), ])draw(setup_LineConfig(x = "wt", y = "mpg"), data = mtcars[order(mtcars$wt), ])
The seam between convenient input and a complete, validated object. Every argument is optional, which is what lets the published schema require nothing.
setup_NetworkConfig( directed = FALSE, threshold = NULL, self_loops = FALSE, layout = "force", cluster_resolution = 1, scale_by_degree = TRUE, color_by_group = FALSE, blend_edges = FALSE, show_labels = TRUE, node_size = 10, edge_scale = 3, node_opacity = 0.95, edge_opacity = 0.4, palette = NULL, node_color = rtemis_colors[["teal"]], positive_color = rtemis_colors[["teal"]], negative_color = "#ff9e1f", title = NULL, dat_path = NULL, origin = NULL, writer = NULL )setup_NetworkConfig( directed = FALSE, threshold = NULL, self_loops = FALSE, layout = "force", cluster_resolution = 1, scale_by_degree = TRUE, color_by_group = FALSE, blend_edges = FALSE, show_labels = TRUE, node_size = 10, edge_scale = 3, node_opacity = 0.95, edge_opacity = 0.4, palette = NULL, node_color = rtemis_colors[["teal"]], positive_color = rtemis_colors[["teal"]], negative_color = "#ff9e1f", title = NULL, dat_path = NULL, origin = NULL, writer = NULL )
directed |
Logical: Treat the matrix as directed. |
threshold |
Optional Numeric: Drop edges weaker than this. |
self_loops |
Logical: Keep self-edges. |
layout |
Character: Layout algorithm. |
cluster_resolution |
Numeric |
scale_by_degree |
Logical: Size nodes by their degree. |
color_by_group |
Logical: Color nodes by detected community. |
blend_edges |
Logical: Blend overlapping edges. |
show_labels |
Logical: Draw node labels. |
node_size |
Numeric |
edge_scale |
Numeric |
node_opacity, edge_opacity
|
Numeric |
palette |
Optional Character: Community colors, overriding the theme
palette. |
node_color |
Character: Node color when not colored by group. |
positive_color, negative_color
|
Character: Edge colors by sign. |
title |
Optional Character: Chart title. Declared here because it is the
one property every chart type has; |
dat_path |
Optional Character: Path to the data, read at draw time. The
serializable alternative to passing |
origin |
Optional Named character: Where each value came from. Normally computed from which arguments were supplied; pass it only when restoring a config that already carries provenance. |
writer |
Optional Named character: Which interface wrote the config. |
NetworkConfig object.
EDG
m <- matrix( c(0, 1, 1, 1, 0, 1, 1, 1, 0), nrow = 3, dimnames = list(letters[1:3], letters[1:3]) ) draw(setup_NetworkConfig(), data = m)m <- matrix( c(0, 1, 1, 1, 0, 1, 1, 1, 0), nrow = 3, dimnames = list(letters[1:3], letters[1:3]) ) draw(setup_NetworkConfig(), data = m)
Set Up a Panel Layout
setup_PanelLayout(ncol = 1L, gap = 12, padding = 0)setup_PanelLayout(ncol = 1L, gap = 12, padding = 0)
ncol |
Integer |
gap |
Numeric |
padding |
Numeric |
PanelLayout: Validated settings.
setup_PanelLayout(ncol = 2, gap = 16)setup_PanelLayout(ncol = 2, gap = 16)
The seam between convenient input and a complete, validated object. Every argument is optional, which is what lets the published schema require nothing.
setup_PieConfig( values = NULL, labels = NULL, radius = "75%", rose_type = NULL, label_format = "name", percent_digits = 1L, palette = NULL, title = NULL, dat_path = NULL, origin = NULL, writer = NULL, legend_position = "top", legend_placement = "outside" )setup_PieConfig( values = NULL, labels = NULL, radius = "75%", rose_type = NULL, label_format = "name", percent_digits = 1L, palette = NULL, title = NULL, dat_path = NULL, origin = NULL, writer = NULL, legend_position = "top", legend_placement = "outside" )
values |
Optional Character: Column holding the slice values. |
labels |
Optional Character: Column holding the slice labels. |
radius |
Character: Outer radius, as a CSS length or percentage. |
rose_type |
Optional Character {"radius", "area"}: Draw as a
Nightingale rose chart, sizing slices by radius or by area. |
label_format |
Character |
percent_digits |
Integer |
palette |
Optional Character: Slice colors, overriding the theme
palette for this chart. |
title |
Optional Character: Chart title. Declared here because it is the
one property every chart type has; |
dat_path |
Optional Character: Path to the data, read at draw time. The
serializable alternative to passing |
origin |
Optional Named character: Where each value came from. Normally computed from which arguments were supplied; pass it only when restoring a config that already carries provenance. |
writer |
Optional Named character: Which interface wrote the config. |
legend_position |
Character {"top", "bottom", "left", "right", "top-left", "top-right", "bottom-left", "bottom-right"}: Legend anchor. Top/bottom anchors use horizontal rows; left/right anchors use a vertical column. Corner anchors align within the top or bottom row. |
legend_placement |
Character {"outside", "inside"}: Relation to the plotting area. Outside placement reserves space for the complete legend; inside placement overlays the data. Neither setting adds a missing legend. |
PieConfig object.
EDG
counts <- data.frame(kind = c("a", "b", "c"), n = c(3, 5, 2)) draw(setup_PieConfig(values = "n", labels = "kind"), data = counts)counts <- data.frame(kind = c("a", "b", "c"), n = c(3, 5, 2)) draw(setup_PieConfig(values = "n", labels = "kind"), data = counts)
Set Up a ROC Plot Configuration
setup_ROCConfig( fpr = "fpr", tpr = "tpr", auc = NULL, class_label = NULL, split = NULL, fold = NULL, omitted = NULL, variant = "aggregate", digits = 3L, diagonal = TRUE, diagonal_color = "#888888", palette = NULL, legend = TRUE, legend_position = "top", legend_placement = "outside", square = TRUE, line_width = 2, fold_opacity = 0.45, xlab = "False positive rate", ylab = "True positive rate", title = NULL, dat_path = NULL, origin = NULL, writer = NULL )setup_ROCConfig( fpr = "fpr", tpr = "tpr", auc = NULL, class_label = NULL, split = NULL, fold = NULL, omitted = NULL, variant = "aggregate", digits = 3L, diagonal = TRUE, diagonal_color = "#888888", palette = NULL, legend = TRUE, legend_position = "top", legend_placement = "outside", square = TRUE, line_width = 2, fold_opacity = 0.45, xlab = "False positive rate", ylab = "True positive rate", title = NULL, dat_path = NULL, origin = NULL, writer = NULL )
fpr |
Character: Column containing false positive rates. |
tpr |
Character: Column containing true positive rates. |
auc |
Optional Character: Optional supplied AUC column; unset integrates the supplied vertices. |
class_label |
Optional Character: Optional positive-class label column. |
split |
Optional Character: Optional sample or model label column. |
fold |
Optional Character: Optional resample column; aggregate identifies pooled curves. |
omitted |
Optional Character: Optional omitted-observation count column, constant within each curve. |
variant |
Character: Draw pooled curves or separate resample curves. |
digits |
Integer: Decimal places for AUC labels and tooltip values. |
diagonal |
Logical: Show an independent chance diagonal. |
diagonal_color |
Character: Chance-line color. |
palette |
Optional Character: Group colors; unset uses the chart theme. |
legend |
Logical: Show group labels and AUC summaries. |
legend_position |
Character {"top", "bottom", "left", "right", "top-left", "top-right", "bottom-left", "bottom-right"}: Legend anchor. Top/bottom anchors use horizontal rows; left/right anchors use a vertical column. Corner anchors align within the top or bottom row. |
legend_placement |
Character {"outside", "inside"}: Relation to the plotting area. Outside placement reserves space for the complete legend; inside placement overlays the data. Neither setting adds a missing legend. |
square |
Logical: Keep the plotting grid square. |
line_width |
Numeric: Curve stroke width in pixels. |
fold_opacity |
Numeric: Opacity of individual resample curves. |
xlab |
Character: Horizontal axis label. |
ylab |
Character: Vertical axis label. |
title |
Optional Character: Chart title. |
dat_path |
Optional Character: Path to the data, read at draw time. The
serializable alternative to passing |
origin |
Optional Named character: Per-property provenance. |
writer |
Optional Named character: Interface name and version. |
A ROCConfig object.
setup_ROCConfig(class_label = "class", split = "split", fold = "fold", auc = "auc")setup_ROCConfig(class_label = "class", split = "split", fold = "fold", auc = "auc")
The seam between convenient input and a complete, validated object. Every argument is optional, which is what lets the published schema require nothing.
setup_SankeyConfig( source = "source", target = "target", value = "value", orient = "horizontal", node_align = NULL, node_width = NULL, node_gap = NULL, palette = NULL, title = NULL, dat_path = NULL, origin = NULL, writer = NULL )setup_SankeyConfig( source = "source", target = "target", value = "value", orient = "horizontal", node_align = NULL, node_width = NULL, node_gap = NULL, palette = NULL, title = NULL, dat_path = NULL, origin = NULL, writer = NULL )
source |
Character: Column naming each link's source node. |
target |
Character: Column naming each link's target node. |
value |
Character: Column holding each link's magnitude. |
orient |
Character {"horizontal", "vertical"}: Layout direction. |
node_align |
Optional Character {"left", "right", "justify"}: How nodes are aligned along the flow. |
node_width |
Optional Numeric |
node_gap |
Optional Numeric |
palette |
Optional Character: Node colors, overriding the theme palette
for this chart. |
title |
Optional Character: Chart title. Declared here because it is the
one property every chart type has; |
dat_path |
Optional Character: Path to the data, read at draw time. The
serializable alternative to passing |
origin |
Optional Named character: Where each value came from. Normally computed from which arguments were supplied; pass it only when restoring a config that already carries provenance. |
writer |
Optional Named character: Which interface wrote the config. |
SankeyConfig object.
EDG
links <- data.frame( source = c("a", "b"), target = c("c", "c"), value = c(1, 2) ) draw(setup_SankeyConfig(), data = links)links <- data.frame( source = c("a", "b"), target = c("c", "c"), value = c(1, 2) ) draw(setup_SankeyConfig(), data = links)
Set Up a Three-Dimensional Scatter Configuration
setup_Scatter3DConfig( x = NULL, y = NULL, z = NULL, group = NULL, alpha = 20, beta = 40, view_size = 190, point_size = 8, opacity = NULL, xlab = NULL, ylab = NULL, zlab = NULL, palette = NULL, title = NULL, dat_path = NULL, origin = NULL, writer = NULL, mode = "points", order = "input", line_width = 2, fit = NULL, fit_params = NULL, n_fit = 25L, fit_alpha = 0.35 )setup_Scatter3DConfig( x = NULL, y = NULL, z = NULL, group = NULL, alpha = 20, beta = 40, view_size = 190, point_size = 8, opacity = NULL, xlab = NULL, ylab = NULL, zlab = NULL, palette = NULL, title = NULL, dat_path = NULL, origin = NULL, writer = NULL, mode = "points", order = "input", line_width = 2, fit = NULL, fit_params = NULL, n_fit = 25L, fit_alpha = 0.35 )
x, y, z
|
Optional Character: Numeric coordinate column bindings. |
group |
Optional Character: Group column binding. |
alpha |
Numeric |
beta |
Numeric |
view_size |
Numeric |
point_size |
Numeric |
opacity |
Optional Numeric |
xlab, ylab, zlab
|
Optional Character: Axis names. |
palette |
Optional Character: Group colors. |
title |
Optional Character: Chart title. Declared here because it is the
one property every chart type has; |
dat_path |
Optional Character: Path to the data, read at draw time. The
serializable alternative to passing |
origin |
Optional Named character {"user", "default", "derived"}: Where each value came from, one entry per settable property. Absent on an authored config; written by the interface that resolved it. |
writer |
Optional Named character: Which interface wrote the config, as
|
mode |
Character |
order |
Character |
line_width |
Numeric |
fit |
Optional Character: Model of z on x and y drawn as a surface per
group: |
fit_params |
Optional Named list: Arguments passed to the learner named
in |
n_fit |
Integer |
fit_alpha |
Numeric |
Scatter3DConfig: Validated settings.
draw(setup_Scatter3DConfig(x = "Sepal.Length", y = "Sepal.Width", z = "Petal.Length", group = "Species"), data = iris)draw(setup_Scatter3DConfig(x = "Sepal.Length", y = "Sepal.Width", z = "Petal.Length", group = "Species"), data = iris)
The seam between convenient input and a complete, validated object: pass the
handful of things you care about, get back a ScatterConfig with everything
else at its default.
setup_ScatterConfig( x = NULL, y = NULL, size = NULL, group = NULL, fit = NULL, fit_params = NULL, se = TRUE, n_fit = 200L, fit_alpha = 0.25, palette = NULL, pad = DEFAULT_PAD, square = FALSE, equal_axes = FALSE, xlim = NULL, ylim = NULL, xlab = NULL, ylab = NULL, title = NULL, margin_top = NULL, margin_right = NULL, margin_bottom = NULL, margin_left = NULL, dat_path = NULL, origin = NULL, writer = NULL, se_times = 1.96, rsq = FALSE, diagonal = FALSE, diagonal_color = NULL, legend_position = "top", legend_placement = "outside", fit_name = NULL, rug = FALSE, hover = NULL, point_alpha = NULL )setup_ScatterConfig( x = NULL, y = NULL, size = NULL, group = NULL, fit = NULL, fit_params = NULL, se = TRUE, n_fit = 200L, fit_alpha = 0.25, palette = NULL, pad = DEFAULT_PAD, square = FALSE, equal_axes = FALSE, xlim = NULL, ylim = NULL, xlab = NULL, ylab = NULL, title = NULL, margin_top = NULL, margin_right = NULL, margin_bottom = NULL, margin_left = NULL, dat_path = NULL, origin = NULL, writer = NULL, se_times = 1.96, rsq = FALSE, diagonal = FALSE, diagonal_color = NULL, legend_position = "top", legend_placement = "outside", fit_name = NULL, rug = FALSE, hover = NULL, point_alpha = NULL )
x, y
|
Optional Character: Columns drawn on each axis. |
size |
Optional Character: Column giving per-point size. |
group |
Optional Character: Column to group and color points by. |
fit |
Optional Character: Fit to overlay: |
fit_params |
Optional Named list: Arguments passed to the learner named
in |
se |
Logical: If TRUE, shade the fit standard-error band. |
n_fit |
Integer |
fit_alpha |
Numeric |
palette |
Optional Character: Series colors, overriding the theme
palette for this chart. |
pad |
Numeric |
square |
Logical: If TRUE, draw the plotting box square – equal height and width in pixels, excluding axis labels and margins. |
equal_axes |
Logical: If TRUE, give one data unit the same size in
pixels on both axes. Set with |
xlim, ylim
|
Optional Numeric: Axis limits, length 2. |
xlab, ylab
|
Optional Character: Axis labels. |
title |
Optional Character: Chart title. Declared here because it is the
one property every chart type has; |
margin_top, margin_right, margin_bottom, margin_left
|
Optional Integer
|
dat_path |
Optional Character: Path to the data, read at draw time. The
serializable alternative to passing |
origin |
Optional Named character: Where each value came from. Normally computed from which arguments were supplied; pass it only when restoring a config that already carries provenance. |
writer |
Optional Named character: Which interface wrote the config, as
|
se_times |
Numeric |
rsq |
Logical: Include the fitted model's R-squared in series labels. |
diagonal |
Logical: Draw the identity line within the axis limits. |
diagonal_color |
Optional Character: Identity-line color. |
legend_position |
Character {"top", "bottom", "left", "right", "top-left", "top-right", "bottom-left", "bottom-right"}: Legend anchor. Top/bottom anchors use horizontal rows; left/right anchors use a vertical column. Corner anchors align within the top or bottom row. |
legend_placement |
Character {"outside", "inside"}: Relation to the plotting area. Outside placement reserves space for the complete legend; inside placement overlays the data. Neither setting adds a missing legend. |
fit_name |
Optional Character: Label for fitted layers. |
rug |
Logical: Show marginal marks along the x and y axes. |
hover |
Optional Character: Column containing per-observation tooltip labels. |
point_alpha |
Optional Numeric |
Every argument is optional, which is what lets the published schema
require nothing: an authored config is a subset of the full set, and the
interface fills in the rest. This is a different entry point from
draw_scatter(), which takes vectors and keeps its mandatory x and y.
ScatterConfig object.
EDG
cfg <- setup_ScatterConfig(x = "wt", y = "mpg", fit = "glm", title = "Cars") draw(cfg, data = mtcars)cfg <- setup_ScatterConfig(x = "wt", y = "mpg", fit = "glm", title = "Cars") draw(cfg, data = mtcars)
Build a validated configuration with provenance for authored settings.
setup_SignificanceConfig( view = "volcano", estimate = "estimate", p_value = "p_value", label = NULL, p_adjust_method = "holm", n_tests = NULL, p_transform = "neg_log10", p_thresh = 0.05, x_thresh = 0, zero_cap = NULL, annotate_n = 7L, reference = TRUE, legend = TRUE, negative_color = "#BE2E5F", neutral_color = "#808080", positive_color = "#0F6A66", alpha = 0.8, point_size = 8, xlab = NULL, ylab = NULL, xlim = NULL, ylim = NULL, margin_top = NULL, margin_right = NULL, margin_bottom = NULL, margin_left = NULL, title = NULL, dat_path = NULL, origin = NULL, writer = NULL, legend_position = "top", legend_placement = "outside", group = NULL, palette = NULL )setup_SignificanceConfig( view = "volcano", estimate = "estimate", p_value = "p_value", label = NULL, p_adjust_method = "holm", n_tests = NULL, p_transform = "neg_log10", p_thresh = 0.05, x_thresh = 0, zero_cap = NULL, annotate_n = 7L, reference = TRUE, legend = TRUE, negative_color = "#BE2E5F", neutral_color = "#808080", positive_color = "#0F6A66", alpha = 0.8, point_size = 8, xlab = NULL, ylab = NULL, xlim = NULL, ylim = NULL, margin_top = NULL, margin_right = NULL, margin_bottom = NULL, margin_left = NULL, title = NULL, dat_path = NULL, origin = NULL, writer = NULL, legend_position = "top", legend_placement = "outside", group = NULL, palette = NULL )
view |
Character {"volcano", "manhattan"}: Scatter or categorical bar view. |
estimate |
Character: Column containing coefficients or other signed effects. |
p_value |
Character: Column containing unadjusted p-values. |
label |
Optional Character: Outcome-label column. Unset generates row labels. |
p_adjust_method |
Character: Method from stats::p.adjust.methods. Adjustment precedes transformation. |
n_tests |
Optional Integer [1, Inf): Hypothesis-family size, at least the number of supplied rows. Unset counts all rows, including missing p-values. |
p_transform |
Character {"neg_log10", "identity", "one_minus"}: Named display transform of adjusted p-values. |
p_thresh |
Numeric (0, 1]: Significance threshold on adjusted p-values; the comparison is strict. |
x_thresh |
Numeric: Effect threshold separating low and high significant results. |
zero_cap |
Optional Numeric (0, Inf): Finite display height for zero p-values under neg_log10; must exceed all finite heights and the significance reference. Unset computes a cap one unit above their rounded-up maximum. |
annotate_n |
Integer [0, Inf): Maximum significant feature labels per side in the volcano view, ranked by raw p-value with input-order ties. |
reference |
Logical: Show the transformed significance threshold and, for volcanoes, the effect threshold. |
legend |
Logical: Show the nonempty significance groups. |
negative_color |
Character: Color for significant effects below x_thresh. |
neutral_color |
Character: Color for other results, including effects equal to x_thresh. |
positive_color |
Character: Color for significant effects above x_thresh. |
alpha |
Numeric |
point_size |
Numeric (0, Inf): Scatter symbol size in pixels. |
xlab |
Optional Character: X-axis label. |
ylab |
Optional Character: Y-axis label. |
xlim |
Optional Numeric: Exactly two increasing finite volcano x-axis limits. Not used by the categorical view. |
ylim |
Optional Numeric: Exactly two increasing finite y-axis limits. |
margin_top |
Optional Integer [0, Inf): Top plot margin in pixels. |
margin_right |
Optional Integer [0, Inf): Right plot margin in pixels. |
margin_bottom |
Optional Integer [0, Inf): Bottom plot margin in pixels. |
margin_left |
Optional Integer [0, Inf): Left plot margin in pixels. |
title |
Optional Character: Chart title. Declared here because it is the
one property every chart type has; |
dat_path |
Optional Character: Path to the data, read at draw time. The
serializable alternative to passing |
origin |
Optional Named character: Per-property provenance. |
writer |
Optional Named character: Interface name and version. |
legend_position |
Character {"top", "bottom", "left", "right", "top-left", "top-right", "bottom-left", "bottom-right"}: Legend anchor. Top/bottom anchors use horizontal rows; left/right anchors use a vertical column. Corner anchors align within the top or bottom row. |
legend_placement |
Character {"outside", "inside"}: Relation to the plotting area. Outside placement reserves space for the complete legend; inside placement overlays the data. Neither setting adds a missing legend. |
group |
Optional Character: Display-group column. Unset colors by significance and effect direction. Missing groups omit marks after full-family adjustment. Groups never change significance thresholds or annotation ranking. |
palette |
Optional Character vector: Display-group colors in first-appearance order; unset uses the theme. Requires a group binding. |
A SignificanceConfig object.
setup_SignificanceConfig(view = "manhattan", p_adjust_method = "BH")setup_SignificanceConfig(view = "manhattan", p_adjust_method = "BH")
The seam between convenient input and a complete, validated object. Every argument is optional, which is what lets the published schema require nothing.
setup_SpectrogramConfig( sample_rate = NULL, n_fft = 256L, window = "hanning", overlap = NULL, power = TRUE, db = TRUE, db_range = 80, freq_scale = "linear", freq_range = NULL, time_range = NULL, freq_unit = "Hz", time_unit = "s", colormap = "magma", colormap_reverse = FALSE, n_colors = 256L, zlim = NULL, show_colorbar = TRUE, colorbar_title = NULL, xlab = NULL, ylab = NULL, title = NULL, margin_top = NULL, margin_right = NULL, margin_bottom = NULL, margin_left = NULL, dat_path = NULL, origin = NULL, writer = NULL, legend_position = "right", legend_placement = "outside" )setup_SpectrogramConfig( sample_rate = NULL, n_fft = 256L, window = "hanning", overlap = NULL, power = TRUE, db = TRUE, db_range = 80, freq_scale = "linear", freq_range = NULL, time_range = NULL, freq_unit = "Hz", time_unit = "s", colormap = "magma", colormap_reverse = FALSE, n_colors = 256L, zlim = NULL, show_colorbar = TRUE, colorbar_title = NULL, xlab = NULL, ylab = NULL, title = NULL, margin_top = NULL, margin_right = NULL, margin_bottom = NULL, margin_left = NULL, dat_path = NULL, origin = NULL, writer = NULL, legend_position = "right", legend_placement = "outside" )
sample_rate |
Optional Numeric |
n_fft |
Integer |
window |
Character: Window function. |
overlap |
Optional Numeric |
power |
Logical: Use the power spectrum rather than magnitude. |
db |
Logical: Convert to decibels. |
db_range |
Numeric |
freq_scale |
Character {"linear", "log", "mel"}: Frequency axis scale. |
freq_range, time_range
|
Optional Numeric: Axis limits, length 2. |
freq_unit, time_unit
|
Character: Axis units, for the labels. |
colormap |
Character: Continuous color scheme, or two or more hex colors defining one. |
colormap_reverse |
Logical: Reverse the color scheme. |
n_colors |
Integer |
zlim |
Optional Numeric: Color-scale limits, length 2. |
show_colorbar |
Logical: Draw the color bar. |
colorbar_title |
Optional Character: Color bar title. |
xlab, ylab
|
Optional Character: Axis labels. |
title |
Optional Character: Chart title. Declared here because it is the
one property every chart type has; |
margin_top, margin_right, margin_bottom, margin_left
|
Optional Integer
|
dat_path |
Optional Character: Path to the data, read at draw time. The
serializable alternative to passing |
origin |
Optional Named character: Where each value came from. Normally computed from which arguments were supplied; pass it only when restoring a config that already carries provenance. |
writer |
Optional Named character: Which interface wrote the config. |
legend_position |
Character {"top", "bottom", "left", "right", "top-left", "top-right", "bottom-left", "bottom-right"}: Legend anchor. Top/bottom anchors use horizontal rows; left/right anchors use a vertical column. Corner anchors align within the top or bottom row. |
legend_placement |
Character {"outside", "inside"}: Relation to the plotting area. Outside placement reserves space for the complete legend; inside placement overlays the data. Neither setting adds a missing legend. |
SpectrogramConfig object.
EDG
m <- matrix(abs(rnorm(64 * 20)) + 1, nrow = 64) draw(setup_SpectrogramConfig(), data = m)m <- matrix(abs(rnorm(64 * 20)) + 1, nrow = 64) draw(setup_SpectrogramConfig(), data = m)
Set Up a Survival Curve Configuration
setup_SurvivalConfig( time = "time", survival = "survival", group = NULL, lower = NULL, upper = NULL, n_censor = NULL, n_risk = NULL, show_ci = TRUE, show_censors = TRUE, show_median = FALSE, landmarks = NULL, risk_table = FALSE, ci_opacity = 0.15, line_width = 2, censor_size = 8, digits = 3L, palette = NULL, legend = TRUE, xlab = "Time", ylab = "Survival probability", legend_position = "top", legend_placement = "outside", title = NULL, dat_path = NULL, origin = NULL, writer = NULL )setup_SurvivalConfig( time = "time", survival = "survival", group = NULL, lower = NULL, upper = NULL, n_censor = NULL, n_risk = NULL, show_ci = TRUE, show_censors = TRUE, show_median = FALSE, landmarks = NULL, risk_table = FALSE, ci_opacity = 0.15, line_width = 2, censor_size = 8, digits = 3L, palette = NULL, legend = TRUE, xlab = "Time", ylab = "Survival probability", legend_position = "top", legend_placement = "outside", title = NULL, dat_path = NULL, origin = NULL, writer = NULL )
time |
Character: Time column in the curve records. |
survival |
Character: Survival probability column. |
group |
Optional Character: Curve group column. |
lower, upper
|
Optional Character: Pointwise confidence bound columns. |
n_censor |
Optional Character: Censor count column. |
n_risk |
Optional Character: Risk count column at recorded times. |
show_ci |
Logical: Draw available pointwise confidence bands. |
show_censors |
Logical: Draw censor ticks. |
show_median |
Logical: Draw median survival droplines when estimable. |
landmarks |
Optional Numeric vector: Finite times for survival labels. |
risk_table |
Logical: Draw supplied risk records beneath the curves. |
ci_opacity |
Numeric |
line_width |
Numeric: Curve stroke width in pixels. |
censor_size |
Numeric |
digits |
Integer: Decimal places for AUC labels and tooltip values. |
palette |
Optional Character: Group colors; unset uses the chart theme. |
legend |
Logical: Show group labels and AUC summaries. |
xlab |
Character: Horizontal axis label. |
ylab |
Character: Vertical axis label. |
legend_position |
Character {"top", "bottom", "left", "right", "top-left", "top-right", "bottom-left", "bottom-right"}: Legend anchor. Top/bottom anchors use horizontal rows; left/right anchors use a vertical column. Corner anchors align within the top or bottom row. |
legend_placement |
Character {"outside", "inside"}: Relation to the plotting area. Outside placement reserves space for the complete legend; inside placement overlays the data. Neither setting adds a missing legend. |
title |
Optional Character: Chart title. |
dat_path |
Optional Character: Path to the data, read at draw time. The
serializable alternative to passing |
origin |
Optional Named character: Per-property provenance. |
writer |
Optional Named character: Interface name and version. |
A SurvivalConfig object.
setup_SurvivalConfig(group = "treatment", show_median = TRUE)setup_SurvivalConfig(group = "treatment", show_median = TRUE)
Set Up a Time Series Configuration
setup_TimeSeriesConfig( x = NULL, y = NULL, group = NULL, x2 = NULL, y2 = NULL, window = 7L, roll_fn = "none", align = "center", roll_width = 2, roll_color = NULL, raw_opacity = 0.5, points = TRUE, xlab = NULL, ylab = NULL, y2lab = NULL, palette = NULL, zoom = FALSE, title = NULL, dat_path = NULL, origin = NULL, writer = NULL, legend_position = "top", legend_placement = "outside", zt = NULL, shade_bin = NULL, show_zt_every = 1L )setup_TimeSeriesConfig( x = NULL, y = NULL, group = NULL, x2 = NULL, y2 = NULL, window = 7L, roll_fn = "none", align = "center", roll_width = 2, roll_color = NULL, raw_opacity = 0.5, points = TRUE, xlab = NULL, ylab = NULL, y2lab = NULL, palette = NULL, zoom = FALSE, title = NULL, dat_path = NULL, origin = NULL, writer = NULL, legend_position = "top", legend_placement = "outside", zt = NULL, shade_bin = NULL, show_zt_every = 1L )
x, y
|
Optional Character: Time and value column bindings. Multiple y columns share x; group splits a single y column. |
group |
Optional Character: Group column binding. |
x2, y2
|
Optional Character: Secondary time/value bindings. Unset x2 uses x. |
window |
Integer |
roll_fn |
Character |
align |
Character |
roll_width |
Numeric |
roll_color |
Optional Character: Rolling line color; unset uses the group color. |
raw_opacity |
Numeric |
points |
Logical: Show raw points; FALSE draws raw lines. |
xlab, ylab
|
Optional Character: Axis labels. |
y2lab |
Optional Character: Secondary axis name. |
palette |
Optional Character: Series colors, overriding the theme
palette for this chart. |
zoom |
Logical: Enable the zoom control. |
title |
Optional Character: Chart title. Declared here because it is the
one property every chart type has; |
dat_path |
Optional Character: Path to the data, read at draw time. The
serializable alternative to passing |
origin |
Optional Named character {"user", "default", "derived"}: Where each value came from, one entry per settable property. Absent on an authored config; written by the interface that resolved it. |
writer |
Optional Named character: Which interface wrote the config, as
|
legend_position |
Character {"top", "bottom", "left", "right", "top-left", "top-right", "bottom-left", "bottom-right"}: Legend anchor. Top/bottom anchors use horizontal rows; left/right anchors use a vertical column. Corner anchors align within the top or bottom row. |
legend_placement |
Character {"outside", "inside"}: Relation to the plotting area. Outside placement reserves space for the complete legend; inside placement overlays the data. Neither setting adds a missing legend. |
zt, shade_bin
|
Optional Character: Columns of zeitgeber labels and zero/one shading flags. |
show_zt_every |
Integer |
TimeSeriesConfig: Validated settings.
draw(setup_TimeSeriesConfig(x = "Time", y = "demand"), data = BOD)draw(setup_TimeSeriesConfig(x = "Time", y = "demand"), data = BOD)
The complete, validated render spec for a Sigma.js network: a GraphModel
(the data) plus all visual styling and an optional title. This is the Sigma
analog of EChartsOption – the single object draw() dispatches on to emit
a rtemis-graph widget. Theme is not a property here; like every backend,
theming is supplied to draw() and resolved uniformly.
SigmaOption( model = NULL, layout = "force", node_size = 10, edge_scale = 3, node_opacity = 0.95, edge_opacity = 0.4, show_labels = TRUE, scale_by_degree = TRUE, color_by_group = FALSE, resolution = 1, blend_edges = FALSE, palette = as.character(rtemis_colors), node_color = rtemis_colors[["teal"]], positive_color = rtemis_colors[["teal"]], negative_color = "#ff9e1f", title = NULL )SigmaOption( model = NULL, layout = "force", node_size = 10, edge_scale = 3, node_opacity = 0.95, edge_opacity = 0.4, show_labels = TRUE, scale_by_degree = TRUE, color_by_group = FALSE, resolution = 1, blend_edges = FALSE, palette = as.character(rtemis_colors), node_color = rtemis_colors[["teal"]], positive_color = rtemis_colors[["teal"]], negative_color = "#ff9e1f", title = NULL )
model |
GraphModel or named list: The graph to render (a list must
contain a |
layout |
Character {"force", "circular", "circlepack", "random"}:
Layout algorithm. |
node_size |
Numeric [0, Inf): Base node radius in screen pixels. |
edge_scale |
Numeric [0, Inf): Multiplier mapping normalized edge weight to stroke width. |
node_opacity |
Numeric [0, 1]: Node fill opacity. |
edge_opacity |
Numeric [0, 1]: Edge stroke opacity. |
show_labels |
Logical: Whether to render node labels. |
scale_by_degree |
Logical: Scale each node's radius by its |
color_by_group |
Logical: Color nodes by detected community (Louvain) instead of a single hue. |
resolution |
Numeric [0, Inf): Louvain resolution; higher yields more, smaller communities. |
blend_edges |
Logical: Color each edge as the blend of its two endpoint node colors instead of by sign. |
palette |
Character: Categorical colors for communities. |
node_color |
Character: Single node color used when |
positive_color |
Character: Edge color for positive-sign edges. |
negative_color |
Character: Edge color for negative-sign edges. |
title |
Optional Character: Title shown above the network. |
Most users never touch this directly – draw_network() and draw_graph()
build it – but power users can construct it for full control:
draw(SigmaOption(model = GraphModel(...), layout = "circular")).
Its to_list() produces the { model, style, title } payload consumed by
the rtemis-graph htmlwidget binding.
SigmaOption object.
model <- GraphModel( nodes = list(GraphNode(id = "a"), GraphNode(id = "b")), edges = list(GraphEdge(source = "a", target = "b")), directed = FALSE ) SigmaOption(model = model, layout = "force")model <- GraphModel( nodes = list(GraphNode(id = "a"), GraphNode(id = "b")), edges = list(GraphEdge(source = "a", target = "b")), directed = FALSE ) SigmaOption(model = model, layout = "force")
One portable specification for volcano plots and categorical significance
bars. The latter is the MassGLM Manhattan view, not a genomic-position plot.
Compiles to ScatterSeriesOption / BarSeriesOption in ECharts
src/chart/scatter/ScatterSeries.ts and src/chart/bar/BarSeries.ts, with
MarkLineOption from src/component/marker/MarkLineModel.ts.
to_list() serializes the semantic configuration using schema keys;
compile() produces the ECharts option.
SignificanceConfig( dat_path = NULL, title = NULL, origin = NULL, writer = NULL, legend_position = "top", legend_placement = "outside", view = "volcano", estimate = "estimate", p_value = "p_value", label = NULL, group = NULL, palette = NULL, p_adjust_method = "holm", n_tests = NULL, p_transform = "neg_log10", p_thresh = 0.05, x_thresh = 0, zero_cap = NULL, annotate_n = 7L, reference = TRUE, legend = TRUE, negative_color = "#BE2E5F", neutral_color = "#808080", positive_color = "#0F6A66", alpha = 0.8, point_size = 8, xlab = NULL, ylab = NULL, xlim = NULL, ylim = NULL, margin_top = NULL, margin_right = NULL, margin_bottom = NULL, margin_left = NULL )SignificanceConfig( dat_path = NULL, title = NULL, origin = NULL, writer = NULL, legend_position = "top", legend_placement = "outside", view = "volcano", estimate = "estimate", p_value = "p_value", label = NULL, group = NULL, palette = NULL, p_adjust_method = "holm", n_tests = NULL, p_transform = "neg_log10", p_thresh = 0.05, x_thresh = 0, zero_cap = NULL, annotate_n = 7L, reference = TRUE, legend = TRUE, negative_color = "#BE2E5F", neutral_color = "#808080", positive_color = "#0F6A66", alpha = 0.8, point_size = 8, xlab = NULL, ylab = NULL, xlim = NULL, ylim = NULL, margin_top = NULL, margin_right = NULL, margin_bottom = NULL, margin_left = NULL )
dat_path |
Optional Character: Path to the data, read at draw time. The
serializable alternative to passing |
title |
Optional Character: Chart title. Declared here because it is the
one property every chart type has; |
origin |
Optional Named character {"user", "default", "derived"}: Where each value came from, one entry per settable property. Absent on an authored config; written by the interface that resolved it. |
writer |
Optional Named character: Which interface wrote the config, as
|
legend_position |
Character {"top", "bottom", "left", "right", "top-left", "top-right", "bottom-left", "bottom-right"}: Legend anchor. Top/bottom anchors use horizontal rows; left/right anchors use a vertical column. Corner anchors align within the top or bottom row. |
legend_placement |
Character {"outside", "inside"}: Relation to the plotting area. Outside placement reserves space for the complete legend; inside placement overlays the data. Neither setting adds a missing legend. |
view |
Character {"volcano", "manhattan"}: Scatter or categorical bar view. |
estimate |
Character: Column containing coefficients or other signed effects. |
p_value |
Character: Column containing unadjusted p-values. |
label |
Optional Character: Outcome-label column. Unset generates row labels. |
group |
Optional Character: Display-group column. Unset colors by significance and effect direction. Missing groups omit marks after full-family adjustment. Groups never change significance thresholds or annotation ranking. |
palette |
Optional Character vector: Display-group colors in first-appearance order; unset uses the theme. Requires a group binding. |
p_adjust_method |
Character: Method from stats::p.adjust.methods. Adjustment precedes transformation. |
n_tests |
Optional Integer [1, Inf): Hypothesis-family size, at least the number of supplied rows. Unset counts all rows, including missing p-values. |
p_transform |
Character {"neg_log10", "identity", "one_minus"}: Named display transform of adjusted p-values. |
p_thresh |
Numeric (0, 1]: Significance threshold on adjusted p-values; the comparison is strict. |
x_thresh |
Numeric: Effect threshold separating low and high significant results. |
zero_cap |
Optional Numeric (0, Inf): Finite display height for zero p-values under neg_log10; must exceed all finite heights and the significance reference. Unset computes a cap one unit above their rounded-up maximum. |
annotate_n |
Integer [0, Inf): Maximum significant feature labels per side in the volcano view, ranked by raw p-value with input-order ties. |
reference |
Logical: Show the transformed significance threshold and, for volcanoes, the effect threshold. |
legend |
Logical: Show the nonempty significance groups. |
negative_color |
Character: Color for significant effects below x_thresh. |
neutral_color |
Character: Color for other results, including effects equal to x_thresh. |
positive_color |
Character: Color for significant effects above x_thresh. |
alpha |
Numeric |
point_size |
Numeric (0, Inf): Scatter symbol size in pixels. |
xlab |
Optional Character: X-axis label. |
ylab |
Optional Character: Y-axis label. |
xlim |
Optional Numeric: Exactly two increasing finite volcano x-axis limits. Not used by the categorical view. |
ylim |
Optional Numeric: Exactly two increasing finite y-axis limits. |
margin_top |
Optional Integer [0, Inf): Top plot margin in pixels. |
margin_right |
Optional Integer [0, Inf): Right plot margin in pixels. |
margin_bottom |
Optional Integer [0, Inf): Bottom plot margin in pixels. |
margin_left |
Optional Integer [0, Inf): Left plot margin in pixels. |
A SignificanceConfig object.
P-values are adjusted once over the full supplied family before rows with
missing estimates or p-values are omitted from the marks. Missing hypotheses
still count in n_tests; they do not become observed p-values of one.
Raw and adjusted values remain in the compiled data. Function-valued
transforms are not accepted by this portable configuration.
Under neg_log10, zero p-values have infinite mathematical height. They
retain their zero value but are displayed at zero_cap, identified by
triangles and a caption. No positive p-value is clamped. For identity and
one-minus transforms, zeros are finite and no cap is used.
cfg <- setup_SignificanceConfig(estimate = "effect", p_value = "p") draw(cfg, data = data.frame(effect = c(-2, 0.1, 3), p = c(0.001, 0.6, 0.002)))cfg <- setup_SignificanceConfig(estimate = "effect", p_value = "p") draw(cfg, data = data.frame(effect = c(-2, 0.1, 3), p = c(0.001, 0.6, 0.002)))
A serializable description of a spectrogram. Build one with
setup_SpectrogramConfig() rather than calling this constructor directly.
SpectrogramConfig( dat_path = NULL, title = NULL, origin = NULL, writer = NULL, legend_position = "right", legend_placement = "outside", sample_rate = NULL, n_fft = 256L, window = "hanning", overlap = NULL, power = TRUE, db = TRUE, db_range = 80, freq_scale = "linear", freq_range = NULL, time_range = NULL, freq_unit = "Hz", time_unit = "s", colormap = "magma", colormap_reverse = FALSE, n_colors = 256L, zlim = NULL, show_colorbar = TRUE, colorbar_title = NULL, xlab = NULL, ylab = NULL, margin_top = NULL, margin_right = NULL, margin_bottom = NULL, margin_left = NULL )SpectrogramConfig( dat_path = NULL, title = NULL, origin = NULL, writer = NULL, legend_position = "right", legend_placement = "outside", sample_rate = NULL, n_fft = 256L, window = "hanning", overlap = NULL, power = TRUE, db = TRUE, db_range = 80, freq_scale = "linear", freq_range = NULL, time_range = NULL, freq_unit = "Hz", time_unit = "s", colormap = "magma", colormap_reverse = FALSE, n_colors = 256L, zlim = NULL, show_colorbar = TRUE, colorbar_title = NULL, xlab = NULL, ylab = NULL, margin_top = NULL, margin_right = NULL, margin_bottom = NULL, margin_left = NULL )
dat_path |
Optional Character: Path to the data, read at draw time. The
serializable alternative to passing |
title |
Optional Character: Chart title. Declared here because it is the
one property every chart type has; |
origin |
Optional Named character {"user", "default", "derived"}: Where each value came from, one entry per settable property. Absent on an authored config; written by the interface that resolved it. |
writer |
Optional Named character: Which interface wrote the config, as
|
legend_position |
Character {"top", "bottom", "left", "right", "top-left", "top-right", "bottom-left", "bottom-right"}: Legend anchor. Top/bottom anchors use horizontal rows; left/right anchors use a vertical column. Corner anchors align within the top or bottom row. |
legend_placement |
Character {"outside", "inside"}: Relation to the plotting area. Outside placement reserves space for the complete legend; inside placement overlays the data. Neither setting adds a missing legend. |
sample_rate |
Optional Numeric |
n_fft |
Integer |
window |
Character: Window function. |
overlap |
Optional Numeric |
power |
Logical: Use the power spectrum rather than magnitude. |
db |
Logical: Convert to decibels. |
db_range |
Numeric |
freq_scale |
Character {"linear", "log", "mel"}: Frequency axis scale. |
freq_range, time_range
|
Optional Numeric: Axis limits, length 2. |
freq_unit, time_unit
|
Character: Axis units, for the labels. |
colormap |
Character: Continuous color scheme, or two or more hex colors defining one. |
colormap_reverse |
Logical: Reverse the color scheme. |
n_colors |
Integer |
zlim |
Optional Numeric: Color-scale limits, length 2. |
show_colorbar |
Logical: Draw the color bar. |
colorbar_title |
Optional Character: Color bar title. |
xlab, ylab
|
Optional Character: Axis labels. |
margin_top, margin_right, margin_bottom, margin_left
|
Optional Integer
|
The bound data is either a numeric signal vector, which is transformed with a short-time Fourier transform, or a precomputed frequency-by-time matrix.
SpectrogramConfig object.
EDG
setup_SpectrogramConfig(n_fft = 512L)@typesetup_SpectrogramConfig(n_fft = 512L)@type
Configuration for alternating colored bands between split lines.
SplitArea(show = NULL, interval = NULL, area_style = NULL)SplitArea(show = NULL, interval = NULL, area_style = NULL)
show |
Optional Logical: Whether to show the split area. |
interval |
Optional Numeric or Character {"auto"}: Split-area interval. |
area_style |
Optional AreaStyle: Area styling. |
Corresponds to SplitAreaOption in src/coord/axisCommonTypes.ts (line 369).
ECharts docs: https://echarts.apache.org/en/option.html#xAxis.splitArea
SplitArea object.
SplitArea(show = TRUE, area_style = AreaStyle(opacity = 0.1))SplitArea(show = TRUE, area_style = AreaStyle(opacity = 0.1))
Configuration for grid split lines perpendicular to the axis.
SplitLine( show = NULL, interval = NULL, show_min_line = NULL, show_max_line = NULL, line_style = NULL )SplitLine( show = NULL, interval = NULL, show_min_line = NULL, show_max_line = NULL, line_style = NULL )
show |
Optional Logical: Whether to show split lines. |
interval |
Optional Numeric or Character {"auto"}: Split-line interval. |
show_min_line |
Optional Logical: Whether to show the split line at the minimum end. |
show_max_line |
Optional Logical: Whether to show the split line at the maximum end. |
line_style |
Optional LineStyle: Line styling. |
Corresponds to SplitLineOption in src/coord/axisCommonTypes.ts (line 353).
ECharts docs: https://echarts.apache.org/en/option.html#xAxis.splitLine
SplitLine object.
SplitLine(show = TRUE, line_style = LineStyle(type = "dashed"))SplitLine(show = TRUE, line_style = LineStyle(type = "dashed"))
A materialized grid of predictions z = f(x, y), independent of the model
that produced them. Corresponds to ECharts-GL SurfaceSeries in
src/chart/surface/SurfaceSeries.js. The grid uses flat color shading and
no wireframe, matching the rtemislive surface contract. Each grid rectangle
is split along ECharts-GL's top-left to bottom-right diagonal. Missing z
values remove every adjacent rectangle; they are not interpolated.
SurfaceLayer( x = c(0, 1), y = c(0, 1), z = NULL, name = "Surface", color = "#6ca3a0", opacity = 0.35 )SurfaceLayer( x = c(0, 1), y = c(0, 1), z = NULL, name = "Surface", color = "#6ca3a0", opacity = 0.35 )
x, y
|
Numeric: Finite, distinct grid coordinates, at least two per axis. |
z |
Numeric matrix: Predictions, with x along rows and y along columns. NA removes adjacent cells. At least one complete grid cell is required. |
name |
Character: Legend label; matching names link legend selection. |
color |
Character: Surface fill color. |
opacity |
Numeric |
Coordinates are sorted together with the prediction matrix. SVG export uses the configured orthographic camera and splits intersecting polygons to order visible surfaces, paths and points. Dense or highly intersecting surfaces may require a coarser prediction grid for practical vector output.
SurfaceLayer: Validated prediction grid.
SurfaceLayer(x = 0:2, y = 0:2, z = outer(0:2, 0:2, `+`))SurfaceLayer(x = 0:2, y = 0:2, z = outer(0:2, 0:2, `+`))
Draw precomputed survival estimates, without fitting a model in the renderer.
Corresponds to LineSeriesOption in src/chart/line/LineSeries.ts and
ScatterSeriesOption in src/chart/scatter/ScatterSeries.ts.
ECharts docs: https://echarts.apache.org/en/option.html#series-line.step
SurvivalConfig( dat_path = NULL, title = NULL, origin = NULL, writer = NULL, legend_position = "top", legend_placement = "outside", time = "time", survival = "survival", group = NULL, lower = NULL, upper = NULL, n_censor = NULL, n_risk = NULL, show_ci = TRUE, show_censors = TRUE, show_median = FALSE, landmarks = NULL, risk_table = FALSE, ci_opacity = 0.15, line_width = 2, censor_size = 8, digits = 3L, palette = NULL, legend = TRUE, xlab = "Time", ylab = "Survival probability" )SurvivalConfig( dat_path = NULL, title = NULL, origin = NULL, writer = NULL, legend_position = "top", legend_placement = "outside", time = "time", survival = "survival", group = NULL, lower = NULL, upper = NULL, n_censor = NULL, n_risk = NULL, show_ci = TRUE, show_censors = TRUE, show_median = FALSE, landmarks = NULL, risk_table = FALSE, ci_opacity = 0.15, line_width = 2, censor_size = 8, digits = 3L, palette = NULL, legend = TRUE, xlab = "Time", ylab = "Survival probability" )
dat_path |
Optional Character: Path to the data, read at draw time. The
serializable alternative to passing |
title |
Optional Character: Chart title. |
origin |
Optional Named character {"user", "default", "derived"}: Where each value came from, one entry per settable property. Absent on an authored config; written by the interface that resolved it. |
writer |
Optional Named character: Which interface wrote the config, as
|
legend_position |
Character {"top", "bottom", "left", "right", "top-left", "top-right", "bottom-left", "bottom-right"}: Legend anchor. Top/bottom anchors use horizontal rows; left/right anchors use a vertical column. Corner anchors align within the top or bottom row. |
legend_placement |
Character {"outside", "inside"}: Relation to the plotting area. Outside placement reserves space for the complete legend; inside placement overlays the data. Neither setting adds a missing legend. |
time |
Character: Time column in the curve records. |
survival |
Character: Survival probability column. |
group |
Optional Character: Curve group column. |
lower, upper
|
Optional Character: Pointwise confidence bound columns. |
n_censor |
Optional Character: Censor count column. |
n_risk |
Optional Character: Risk count column at recorded times. |
show_ci |
Logical: Draw available pointwise confidence bands. |
show_censors |
Logical: Draw censor ticks. |
show_median |
Logical: Draw median survival droplines when estimable. |
landmarks |
Optional Numeric vector: Finite times for survival labels. |
risk_table |
Logical: Draw supplied risk records beneath the curves. |
ci_opacity |
Numeric |
line_width |
Numeric: Curve stroke width in pixels. |
censor_size |
Numeric |
digits |
Integer: Decimal places for AUC labels and tooltip values. |
palette |
Optional Character: Group colors; unset uses the chart theme. |
legend |
Logical: Show group labels and AUC summaries. |
xlab |
Character: Horizontal axis label. |
ylab |
Character: Vertical axis label. |
A SurvivalConfig object.
Supply a curve data frame, or a list with curves and optional risk data
frames. Each curve row contains time and survival probability, with optional
group, pointwise lower/upper confidence bounds, censor counts, and risk counts.
Include the initial time/probability explicitly: the renderer never invents
an origin. Records are sorted within groups; times must be unique and finite,
probabilities nonincreasing in [0, 1]. Curves are right-continuous and stop at
their last recorded time. Missing confidence bounds produce gaps, not zeros.
A censor tick represents one or more censored observations at that time;
its tooltip retains the supplied count. Counts may be fractional for weights.
Median survival is the first crossing of 0.5; a plateau at 0.5 uses its
midpoint, including the last follow-up time if the plateau is terminal.
Comparisons to 0.5 use tolerance sqrt(.Machine$double.eps), as in survival.
Landmarks outside a group's observed time range are omitted without
extrapolation. Display precision never rounds plotted coordinates.
Risk records have fixed columns time, group, and n_risk, and state the
risk count immediately before the specified time. They must cover the same
unique times in each group. Unknown counts use NA and display as NA.
The renderer does not interpolate or infer risk sets from the curves.
All layers belonging to a group share its legend toggle, including risk rows.
cfg <- setup_SurvivalConfig() draw(cfg, data = data.frame(time = c(0, 1, 2), survival = c(1, .8, .5)))cfg <- setup_SurvivalConfig() draw(cfg, data = data.frame(time = c(0, 1, 2), survival = c(1, .8, .5)))
Text styling used in labels, titles, tooltips, and other text elements.
TextStyle( color = NULL, font_style = NULL, font_weight = NULL, font_family = NULL, font_size = NULL, align = NULL, vertical_align = NULL, opacity = NULL, line_height = NULL, background_color = NULL, border_color = NULL, border_width = NULL, border_type = NULL, border_dash_offset = NULL, border_radius = NULL, padding = NULL, width = NULL, height = NULL, text_border_color = NULL, text_border_width = NULL, text_border_type = NULL, text_border_dash_offset = NULL, text_shadow_blur = NULL, text_shadow_color = NULL, text_shadow_offset_x = NULL, text_shadow_offset_y = NULL, overflow = NULL, ellipsis = NULL, rich = NULL, shadow_blur = NULL, shadow_color = NULL, shadow_offset_x = NULL, shadow_offset_y = NULL )TextStyle( color = NULL, font_style = NULL, font_weight = NULL, font_family = NULL, font_size = NULL, align = NULL, vertical_align = NULL, opacity = NULL, line_height = NULL, background_color = NULL, border_color = NULL, border_width = NULL, border_type = NULL, border_dash_offset = NULL, border_radius = NULL, padding = NULL, width = NULL, height = NULL, text_border_color = NULL, text_border_width = NULL, text_border_type = NULL, text_border_dash_offset = NULL, text_shadow_blur = NULL, text_shadow_color = NULL, text_shadow_offset_x = NULL, text_shadow_offset_y = NULL, overflow = NULL, ellipsis = NULL, rich = NULL, shadow_blur = NULL, shadow_color = NULL, shadow_offset_x = NULL, shadow_offset_y = NULL )
color |
Optional Character: Text color. |
font_style |
Optional Character {"normal", "italic", "oblique"}: Font style. |
font_weight |
Optional Character {"normal", "bold", "bolder", "lighter"} or Numeric |
font_family |
Optional Character: Font family name. |
font_size |
Optional Numeric or Character: Font size. |
align |
Optional Character {"left", "center", "right"}: Horizontal alignment. |
vertical_align |
Optional Character {"top", "middle", "bottom"}: Vertical alignment. |
opacity |
Optional Numeric |
line_height |
Optional Numeric |
background_color |
Optional Character: Background color behind text. |
border_color |
Optional Character: Text box border color. |
border_width |
Optional Numeric |
border_type |
Optional Character {"solid", "dashed", "dotted"}: Text box border type. |
border_dash_offset |
Optional Numeric: Text box border dash offset. |
border_radius |
Optional Numeric or Numeric vector: Text box corner radius. |
padding |
Optional Numeric or Numeric vector: Text box padding. |
width |
Optional Numeric or Character: Text box width. |
height |
Optional Numeric |
text_border_color |
Optional Character: Stroke color around the text. |
text_border_width |
Optional Numeric |
text_border_type |
Optional Character {"solid", "dashed", "dotted"}: Stroke type around the text. |
text_border_dash_offset |
Optional Numeric: Stroke dash offset around the text. |
text_shadow_blur |
Optional Numeric |
text_shadow_color |
Optional Character: Text shadow color. |
text_shadow_offset_x |
Optional Numeric: Text shadow horizontal offset. |
text_shadow_offset_y |
Optional Numeric: Text shadow vertical offset. |
overflow |
Optional Character {"truncate", "break", "breakAll", "none"}: Text overflow behavior. |
ellipsis |
Optional Character: Ellipsis string used when truncating. |
rich |
Optional Named list: Rich text styles. |
shadow_blur |
Optional Numeric |
shadow_color |
Optional Character: Box shadow color. |
shadow_offset_x |
Optional Numeric: Box shadow horizontal offset. |
shadow_offset_y |
Optional Numeric: Box shadow vertical offset. |
Corresponds to TextCommonOption in src/util/types.ts (line 1220).
ECharts docs: https://echarts.apache.org/en/option.html#title.textStyle
TextStyle object.
TextStyle(color = "#333333", font_size = 14, font_weight = "bold")TextStyle(color = "#333333", font_size = 14, font_weight = "bold")
A chart theme that controls default colors, text styles, and
component appearance. Corresponds to the object passed as the second
argument to echarts.init(dom, theme) or registered via
echarts.registerTheme().
Theme( color = NULL, background_color = NULL, text_style = NULL, title = NULL, legend = NULL, tooltip = NULL, data_zoom = NULL, line = NULL, bar = NULL, pie = NULL, scatter = NULL, category_axis = NULL, value_axis = NULL, log_axis = NULL, time_axis = NULL )Theme( color = NULL, background_color = NULL, text_style = NULL, title = NULL, legend = NULL, tooltip = NULL, data_zoom = NULL, line = NULL, bar = NULL, pie = NULL, scatter = NULL, category_axis = NULL, value_axis = NULL, log_axis = NULL, time_axis = NULL )
color |
Optional Character: Color palette. |
background_color |
Optional Character: Chart background color. |
text_style |
Optional TextStyle: Global default text style. |
title |
Optional Named list: Title overrides. |
legend |
Optional Named list: Legend overrides. |
tooltip |
Optional Named list: Tooltip overrides. |
data_zoom |
Optional Named list: Data-zoom defaults using native ECharts
camelCase fields from |
line |
Optional Named list: Line-series defaults. |
bar |
Optional Named list: Bar-series defaults. |
pie |
Optional Named list: Pie-series defaults. |
scatter |
Optional Named list: Scatter-series defaults. |
category_axis |
Optional Named list: Category-axis defaults. |
value_axis |
Optional Named list: Value-axis defaults. |
log_axis |
Optional Named list: Log-axis defaults. |
time_axis |
Optional Named list: Time-axis defaults. |
TS source: src/model/globalDefault.ts, src/theme/dark.ts.
Theme object.
Theme(color = c("#16a085", "#e67e22"), background_color = "#ffffff")Theme(color = c("#16a085", "#e67e22"), background_color = "#ffffff")
Returns a dark theme. All parameters have sensible defaults; most
users only need base_font_size. Title font size defaults to 1.2x
the base; all other text defaults to 1x.
Data-zoom sliders use neutral gray controls adapted to dark backgrounds.
theme_dark( base_font_size = 12, title_font_size = NULL, subtitle_font_size = NULL, axis_label_font_size = NULL, legend_font_size = NULL, tooltip_font_size = NULL, font_family = "system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif", color = palette_colors(rtemis_colors), bg_color = "#181818", fg_color = "rgba(255, 255, 255, 0.7)", title_color = "rgba(255, 255, 255, 0.9)", subtitle_color = "rgba(255, 255, 255, 0.5)", legend_color = NULL, axis_color = "rgba(255, 255, 255, 0.3)", grid_color = "rgba(255, 255, 255, 0.1)", tooltip_bg = "rgba(20, 20, 20, 0.9)", tooltip_border_color = "rgba(255, 255, 255, 0.1)", tooltip_color = NULL )theme_dark( base_font_size = 12, title_font_size = NULL, subtitle_font_size = NULL, axis_label_font_size = NULL, legend_font_size = NULL, tooltip_font_size = NULL, font_family = "system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif", color = palette_colors(rtemis_colors), bg_color = "#181818", fg_color = "rgba(255, 255, 255, 0.7)", title_color = "rgba(255, 255, 255, 0.9)", subtitle_color = "rgba(255, 255, 255, 0.5)", legend_color = NULL, axis_color = "rgba(255, 255, 255, 0.3)", grid_color = "rgba(255, 255, 255, 0.1)", tooltip_bg = "rgba(20, 20, 20, 0.9)", tooltip_border_color = "rgba(255, 255, 255, 0.1)", tooltip_color = NULL )
base_font_size |
Numeric |
title_font_size |
Optional Numeric |
subtitle_font_size |
Optional Numeric |
axis_label_font_size |
Optional Numeric |
legend_font_size |
Optional Numeric |
tooltip_font_size |
Optional Numeric |
font_family |
Character: Font family string. |
color |
Character: Color palette. |
bg_color |
Optional Character: Chart background color. |
fg_color |
Optional Character: Global text color. |
title_color |
Optional Character: Title text color. |
subtitle_color |
Optional Character: Subtitle text color. |
legend_color |
Optional Character: Legend text color. |
axis_color |
Optional Character: Axis line color. |
grid_color |
Optional Character: Grid or split-line color. |
tooltip_bg |
Optional Character: Tooltip background color. |
tooltip_border_color |
Optional Character: Tooltip border color. |
tooltip_color |
Optional Character: Tooltip text color. |
Theme: Theme object.
theme_dark(base_font_size = 14)theme_dark(base_font_size = 14)
Returns a light theme. All parameters have sensible defaults; most
users only need base_font_size. Title font size defaults to 1.2x
the base; all other text defaults to 1x.
Data-zoom sliders use neutral gray controls, including their data preview
and hover states. Explicit component styles override these theme defaults.
theme_light( base_font_size = 12, title_font_size = NULL, subtitle_font_size = NULL, axis_label_font_size = NULL, legend_font_size = NULL, tooltip_font_size = NULL, font_family = "system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif", color = palette_colors(rtemis_colors), bg_color = "#ffffff", fg_color = "rgba(0, 0, 0, 0.7)", title_color = NULL, subtitle_color = NULL, legend_color = NULL, axis_color = NULL, grid_color = NULL, tooltip_bg = NULL, tooltip_border_color = NULL, tooltip_color = NULL )theme_light( base_font_size = 12, title_font_size = NULL, subtitle_font_size = NULL, axis_label_font_size = NULL, legend_font_size = NULL, tooltip_font_size = NULL, font_family = "system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif", color = palette_colors(rtemis_colors), bg_color = "#ffffff", fg_color = "rgba(0, 0, 0, 0.7)", title_color = NULL, subtitle_color = NULL, legend_color = NULL, axis_color = NULL, grid_color = NULL, tooltip_bg = NULL, tooltip_border_color = NULL, tooltip_color = NULL )
base_font_size |
Numeric |
title_font_size |
Optional Numeric |
subtitle_font_size |
Optional Numeric |
axis_label_font_size |
Optional Numeric |
legend_font_size |
Optional Numeric |
tooltip_font_size |
Optional Numeric |
font_family |
Character: Font family string. |
color |
Character: Color palette. |
bg_color |
Optional Character: Chart background color. |
fg_color |
Optional Character: Global text color. |
title_color |
Optional Character: Title text color. |
subtitle_color |
Optional Character: Subtitle text color. |
legend_color |
Optional Character: Legend text color. |
axis_color |
Optional Character: Axis line color. |
grid_color |
Optional Character: Grid or split-line color. |
tooltip_bg |
Optional Character: Tooltip background color. |
tooltip_border_color |
Optional Character: Tooltip border color. |
tooltip_color |
Optional Character: Tooltip text color. |
Theme: Theme object.
theme_light(base_font_size = 14)theme_light(base_font_size = 14)
Numeric or date-time observations with optional rolling summaries and a secondary value axis. Uses LineSeriesOption and CartesianAxisOption from ECharts src/chart/line and src/coord/cartesian. Rolling windows count sorted observations, not elapsed time; incomplete windows and windows containing missing values remain missing. Even centered windows favor following values, matching data.table's centered alignment used by rtemis.
TimeSeriesConfig( dat_path = NULL, title = NULL, origin = NULL, writer = NULL, legend_position = "top", legend_placement = "outside", x = NULL, y = NULL, group = NULL, xlab = NULL, ylab = NULL, palette = NULL, zoom = FALSE, x2 = NULL, zt = NULL, shade_bin = NULL, show_zt_every = 1L, y2 = NULL, y2lab = NULL, window = 7L, roll_fn = "none", align = "center", roll_width = 2, roll_color = NULL, raw_opacity = 0.5, points = TRUE )TimeSeriesConfig( dat_path = NULL, title = NULL, origin = NULL, writer = NULL, legend_position = "top", legend_placement = "outside", x = NULL, y = NULL, group = NULL, xlab = NULL, ylab = NULL, palette = NULL, zoom = FALSE, x2 = NULL, zt = NULL, shade_bin = NULL, show_zt_every = 1L, y2 = NULL, y2lab = NULL, window = 7L, roll_fn = "none", align = "center", roll_width = 2, roll_color = NULL, raw_opacity = 0.5, points = TRUE )
dat_path |
Optional Character: Path to the data, read at draw time. The
serializable alternative to passing |
title |
Optional Character: Chart title. Declared here because it is the
one property every chart type has; |
origin |
Optional Named character {"user", "default", "derived"}: Where each value came from, one entry per settable property. Absent on an authored config; written by the interface that resolved it. |
writer |
Optional Named character: Which interface wrote the config, as
|
legend_position |
Character {"top", "bottom", "left", "right", "top-left", "top-right", "bottom-left", "bottom-right"}: Legend anchor. Top/bottom anchors use horizontal rows; left/right anchors use a vertical column. Corner anchors align within the top or bottom row. |
legend_placement |
Character {"outside", "inside"}: Relation to the plotting area. Outside placement reserves space for the complete legend; inside placement overlays the data. Neither setting adds a missing legend. |
x, y
|
Optional Character: Time and value column bindings. Multiple y columns share x; group splits a single y column. |
group |
Optional Character: Group column binding. |
xlab, ylab
|
Optional Character: Axis labels. |
palette |
Optional Character: Series colors, overriding the theme
palette for this chart. |
zoom |
Logical: Enable the zoom control. |
x2, y2
|
Optional Character: Secondary time/value bindings. Unset x2 uses x. |
zt, shade_bin
|
Optional Character: Columns of zeitgeber labels and zero/one shading flags. |
show_zt_every |
Integer |
y2lab |
Optional Character: Secondary axis name. |
window |
Integer |
roll_fn |
Character |
align |
Character |
roll_width |
Numeric |
roll_color |
Optional Character: Rolling line color; unset uses the group color. |
raw_opacity |
Numeric |
points |
Logical: Show raw points; FALSE draws raw lines. |
TimeSeriesConfig: Validated portable settings.
setup_TimeSeriesConfig(x = "day", y = "value", window = 3L)setup_TimeSeriesConfig(x = "day", y = "value", window = 3L)
Chart title configuration with main text and optional subtext.
Title( show = NULL, text = NULL, link = NULL, target = NULL, subtext = NULL, sublink = NULL, subtarget = NULL, text_align = NULL, text_vertical_align = NULL, padding = NULL, item_gap = NULL, text_style = NULL, subtext_style = NULL, trigger_event = NULL, background_color = NULL, border_color = NULL, border_width = NULL, border_radius = NULL, left = NULL, right = NULL, top = NULL, bottom = NULL )Title( show = NULL, text = NULL, link = NULL, target = NULL, subtext = NULL, sublink = NULL, subtarget = NULL, text_align = NULL, text_vertical_align = NULL, padding = NULL, item_gap = NULL, text_style = NULL, subtext_style = NULL, trigger_event = NULL, background_color = NULL, border_color = NULL, border_width = NULL, border_radius = NULL, left = NULL, right = NULL, top = NULL, bottom = NULL )
show |
Optional Logical: Whether to show the title. |
text |
Optional Character: Main title text. Supports |
link |
Optional Character: Hyperlink for the main title. |
target |
Optional Character {"self", "blank"}: Link target. |
subtext |
Optional Character: Subtitle text. |
sublink |
Optional Character: Hyperlink for the subtitle. |
subtarget |
Optional Character {"self", "blank"}: Subtitle link target. |
text_align |
Optional Character {"auto", "left", "center", "right"}: Horizontal alignment. |
text_vertical_align |
Optional Character {"auto", "top", "middle", "bottom"}: Vertical alignment. |
padding |
Optional Numeric: Padding inside the title box. |
item_gap |
Optional Numeric |
text_style |
Optional TextStyle: Main title text style. |
subtext_style |
Optional TextStyle: Subtitle text style. |
trigger_event |
Optional Logical: Whether the title emits events. |
background_color |
Optional Character: Title-box background color. |
border_color |
Optional Character: Border color. |
border_width |
Optional Numeric |
border_radius |
Optional Numeric: Border radius. |
left |
Optional Numeric or Character: Left position. |
right |
Optional Numeric or Character: Right position. |
top |
Optional Numeric or Character: Top position. |
bottom |
Optional Numeric or Character: Bottom position. |
Corresponds to TitleOption in src/component/title/install.ts (line 48).
ECharts docs: https://echarts.apache.org/en/option.html#title
Title object.
Title(text = "Monthly revenue", subtext = "2026", left = "center")Title(text = "Monthly revenue", subtext = "2026", left = "center")
Convert EChartsOption to JSON
to_json(x, pretty = FALSE, auto_unbox = TRUE, ...)to_json(x, pretty = FALSE, auto_unbox = TRUE, ...)
x |
EChartsOption: Option object to serialize. |
pretty |
Logical: Whether to pretty-print the JSON. |
auto_unbox |
Logical: Whether to auto-unbox single-element vectors. |
... |
Dots: Additional arguments passed to |
Character: JSON string.
to_json(EChartsOption(title = Title(text = "Weekly sessions")))to_json(EChartsOption(title = Title(text = "Weekly sessions")))
Generic function that converts an S7 object to a plain named list matching the ECharts JSON option structure.
to_list(x, ...)to_list(x, ...)
x |
S7 object: Object to serialize. |
... |
Dots: Unused. |
List: Named list.
to_list(LineStyle(color = "#16a085", width = 2))to_list(LineStyle(color = "#16a085", width = 2))
Tooltip configuration for showing data on hover/click.
Tooltip( show = NULL, trigger = NULL, trigger_on = NULL, show_content = NULL, always_show_content = NULL, formatter = NULL, value_formatter = NULL, position = NULL, confine = NULL, enterable = NULL, show_delay = NULL, hide_delay = NULL, transition_duration = NULL, background_color = NULL, border_color = NULL, border_width = NULL, border_radius = NULL, padding = NULL, text_style = NULL, extra_css_text = NULL, order = NULL, class_name = NULL )Tooltip( show = NULL, trigger = NULL, trigger_on = NULL, show_content = NULL, always_show_content = NULL, formatter = NULL, value_formatter = NULL, position = NULL, confine = NULL, enterable = NULL, show_delay = NULL, hide_delay = NULL, transition_duration = NULL, background_color = NULL, border_color = NULL, border_width = NULL, border_radius = NULL, padding = NULL, text_style = NULL, extra_css_text = NULL, order = NULL, class_name = NULL )
show |
Optional Logical: Whether to show the tooltip. |
trigger |
Optional Character {"item", "axis", "none"}: Trigger type. |
trigger_on |
Optional Character {"mousemove", "click", "none", "mousemove|click"}: Trigger event.
|
show_content |
Optional Logical: Whether to show tooltip content. |
always_show_content |
Optional Logical: Whether to keep the tooltip visible. |
formatter |
Optional Character or function: Tooltip content formatter. |
value_formatter |
Optional function: Formatter for the value portion. |
position |
Optional Character or Numeric: Tooltip position. |
confine |
Optional Logical: Whether to confine the tooltip within the chart container. |
enterable |
Optional Logical: Whether the mouse can enter the tooltip. |
show_delay |
Optional Numeric |
hide_delay |
Optional Numeric |
transition_duration |
Optional Numeric |
background_color |
Optional Character: Background color. |
border_color |
Optional Character: Border color. |
border_width |
Optional Numeric |
border_radius |
Optional Numeric |
padding |
Optional Numeric: Padding inside the tooltip. |
text_style |
Optional TextStyle: Tooltip text style. |
extra_css_text |
Optional Character: Extra CSS for HTML render mode. |
order |
Optional Character {"seriesAsc", "seriesDesc", "valueAsc", "valueDesc"}: Tooltip content order. |
class_name |
Optional Character: CSS class name for the tooltip element. |
Corresponds to TooltipOption in src/component/tooltip/TooltipModel.ts (line 36)
and CommonTooltipOption in src/util/types.ts (line 1527).
ECharts docs: https://echarts.apache.org/en/option.html#tooltip
Tooltip object.
Tooltip(trigger = "axis", border_width = 1)Tooltip(trigger = "axis", border_width = 1)
Named lists are matched by name; unnamed lists are matched by position. Each pair is checked before concatenation, so unequal split or fold lengths cannot silently shift observations. Missing pairs are removed together.
true_pred_data(x, y, group = NULL)true_pred_data(x, y, group = NULL)
x |
Numeric vector, single-column matrix, or list: True observations. |
y |
Numeric vector, single-column matrix, or list: Predicted values. |
group |
Optional Atomic vector or single-column data frame: Groups for vector inputs. |
Data frame with true, predicted, and optional sample columns.
true_pred_data(1:3, c(1.1, 1.9, 3.2))true_pred_data(1:3, c(1.1, 1.9, 3.2))
Keep named measures and observed fold rows intact. Summaries are computed separately so this boundary can also supply distribution views.
varimp_data(x)varimp_data(x)
x |
Numeric vector, single-column matrix, or data frame: Importance data. |
Data frame with variable, named measures, and optionally fold.
varimp_data(c(age = 2, weight = 1))varimp_data(c(age = 2, weight = 1))
Continuous visual map component that maps data values to visual properties (typically color). Required for heatmaps.
VisualMap( type = "continuous", min = NULL, max = NULL, precision = NULL, calculable = NULL, show = NULL, orient = NULL, in_range = NULL, out_of_range = NULL, left = NULL, right = NULL, top = NULL, bottom = NULL )VisualMap( type = "continuous", min = NULL, max = NULL, precision = NULL, calculable = NULL, show = NULL, orient = NULL, in_range = NULL, out_of_range = NULL, left = NULL, right = NULL, top = NULL, bottom = NULL )
type |
Character {"continuous", "piecewise"}: Visual map type. |
min |
Optional Numeric: Minimum value of the mapped data range. |
max |
Optional Numeric: Maximum value of the mapped data range. |
precision |
Optional Integer |
calculable |
Optional Logical: Whether to show drag handles for interactive range selection. |
show |
Optional Logical: Whether to display the visual map legend. |
orient |
Optional Character {"vertical", "horizontal"}: Orientation of the color bar. |
in_range |
Optional list: Visual encoding for in-range values.
Typically |
out_of_range |
Optional list: Visual encoding for out-of-range values. |
left |
Optional Numeric or Character: Distance from the left of the container. |
right |
Optional Numeric or Character: Distance from the right of the container. |
top |
Optional Numeric or Character: Distance from the top of the container.
For vertical heatmap colorbars, |
bottom |
Optional Numeric or Character: Distance from the bottom of the container. |
Corresponds to ContinuousVisualMapOption in
src/component/visualMap/ContinuousModel.ts.
ECharts docs: https://echarts.apache.org/en/option.html#visualMap-continuous
VisualMap object.
VisualMap(type = "continuous", min = 0, max = 100, calculable = TRUE)VisualMap(type = "continuous", min = 0, max = 100, calculable = TRUE)
Write a chart config to a JSON file
write_chart_config(config, path, complete = FALSE)write_chart_config(config, path, complete = FALSE)
config |
ChartConfig: The chart configuration. |
path |
Character: Destination file. |
complete |
Logical: If TRUE, write the output-config form. |
complete = FALSE (default) writes an input config: only the properties
that are set. It validates against the chart's schema.json.
complete = TRUE writes an output config: every property, unset ones as
explicit nulls, with this package stamped as the writer. It validates
against record.json, and is what an interface hands to another interface
– nothing is left for the reader to infer. Resolve the config first, so that
the values the data determines are written as the derived facts they are:
write_chart_config(resolve(config, data), path, complete = TRUE)
path, invisibly.
EDG
path <- tempfile(fileext = ".json") write_chart_config(setup_ScatterConfig(x = "wt", y = "mpg"), path) # An output config: resolved against the data, then written in full. cfg <- resolve(setup_ScatterConfig(x = "wt", y = "mpg"), data = mtcars) write_chart_config(cfg, path, complete = TRUE) unlink(path)path <- tempfile(fileext = ".json") write_chart_config(setup_ScatterConfig(x = "wt", y = "mpg"), path) # An output config: resolved against the data, then written in full. cfg <- resolve(setup_ScatterConfig(x = "wt", y = "mpg"), data = mtcars) write_chart_config(cfg, path, complete = TRUE) unlink(path)