| Title: | Visualization Tools for Optirrig Outputs and Tabular Data |
|---|---|
| Description: | A visualization package for Optirrig outputs and generic tabular data. It provides a small plotting core built around ggplot2 to normalize heterogeneous inputs, build reusable graphics, and optionally compose multi-panel views for Optirrig workflows. |
| Authors: | Florian Ricquier [aut, cre] (ORCID: <https://orcid.org/0000-0002-6595-7984>), Kevin Bosirany Orlando [aut] (ORCID: <https://orcid.org/0009-0009-2784-3108>), Bruno Cheviron [aut], UMR G-Eau Aqua Department INRAE Montpellier Team Optimiste [aut] |
| Maintainer: | Florian Ricquier <[email protected]> |
| License: | AGPL (>= 3) |
| Version: | 0.1.0 |
| Built: | 2026-05-23 09:08:35 UTC |
| Source: | https://forge.inrae.fr/OptirrigHIVE/OptirrigVIEW |
Default color palette used by OptirrigVIEW.
optirrig_palette optirrig_view_paletteoptirrig_palette optirrig_view_palette
An object of class character of length 6.
An object of class character of length 6.
A named character vector of hex colors.
plot_vars() defines one independent graph before panel composition.
Use the returned object inside plot(x, options = list(plots = ...)), then
organize the panel layout separately with layout.
plot_vars(var_1 = NULL, var_2, var_3 = NULL, options = NULL)plot_vars(var_1 = NULL, var_2, var_3 = NULL, options = NULL)
var_1 |
Column used on the x axis. If |
var_2 |
Primary y specification. |
var_3 |
Optional secondary y specification. |
options |
Optional list with graph-level options. Supported entries are
|
var_1 defines the x axis column. var_2 defines the primary y variable(s),
and var_3 optionally defines a secondary y axis. var_2 and var_3 accept
either a regex string, or a list with entries such as series, regex,
values, geom, and label.
An object of class optirrig_view_plot_spec.
Plot method for tabular data
## S3 method for class 'data.frame' plot(x, options = NULL, geom = "line", interactive = FALSE, ...)## S3 method for class 'data.frame' plot(x, options = NULL, geom = "line", interactive = FALSE, ...)
x |
A data frame. |
options |
Optional OptirrigVIEW plotting options. |
geom |
Default geometry to draw. |
interactive |
If |
... |
Additional arguments passed to |
A ggplot object, a composed patchwork object, or a plotly
object when requested for a single panel.
Plot method for list inputs
## S3 method for class 'list' plot(x, options = NULL, geom = "line", interactive = FALSE, ...)## S3 method for class 'list' plot(x, options = NULL, geom = "line", interactive = FALSE, ...)
x |
A list of tables, matrices, or nested Optirrig-like outputs. |
options |
Optional OptirrigVIEW plotting options. |
geom |
Default geometry to draw. |
interactive |
If |
... |
Additional arguments passed to |
A ggplot object, a composed patchwork object, or a plotly
object when requested for a single panel.
Plot method for matrix data
## S3 method for class 'matrix' plot(x, options = NULL, geom = "line", interactive = FALSE, ...)## S3 method for class 'matrix' plot(x, options = NULL, geom = "line", interactive = FALSE, ...)
x |
A matrix. |
options |
Optional OptirrigVIEW plotting options. |
geom |
Default geometry to draw. |
interactive |
If |
... |
Additional arguments passed to |
A ggplot object, a composed patchwork object, or a plotly
object when requested for a single panel.
Plot method for a single Optirrig model output
## S3 method for class 'model_output' plot(x, y = NULL, obs = NULL, options = NULL, ...)## S3 method for class 'model_output' plot(x, y = NULL, obs = NULL, options = NULL, ...)
x |
A |
y |
Optional shortcut passed to |
obs |
Optional observed data passed to |
options |
Optional list passed to |
... |
Additional arguments passed to |
A ggplot object, a composed patchwork object, or a plotly
object when requested for a single panel.
This method lets plot() normalize model_outputs internally. It supports
direct graph definitions with x, y, and optional y_bis, so the user
does not need to call view_data() for each panel.
## S3 method for class 'model_outputs' plot( x, y = NULL, obs = NULL, geom = "line", interactive = FALSE, options = NULL, ... )## S3 method for class 'model_outputs' plot( x, y = NULL, obs = NULL, geom = "line", interactive = FALSE, options = NULL, ... )
x |
A |
y |
Optional shortcut. A character value is treated as |
obs |
Optional observed data. Use a named list such as
|
geom |
Default geometry to draw. |
interactive |
If |
options |
Optional list. Supported top-level entries are |
... |
Additional arguments passed to |
A ggplot object, or a plotly object when interactive = TRUE.
Plot method for normalized OptirrigVIEW data
## S3 method for class 'optirrig_view_data' plot(x, geom = "line", interactive = FALSE, options = NULL, ...)## S3 method for class 'optirrig_view_data' plot(x, geom = "line", interactive = FALSE, options = NULL, ...)
x |
An |
geom |
Geometry to draw. |
interactive |
If |
options |
Optional list used to recover the historical
|
... |
Additional arguments passed to |
A ggplot object, or a plotly object when interactive = TRUE.
Lightweight theme used by view_plot().
theme_optirrig(base_size = 12, legend_position = "top") theme_optirrig_view(base_size = 12, legend_position = "top")theme_optirrig(base_size = 12, legend_position = "top") theme_optirrig_view(base_size = 12, legend_position = "top")
base_size |
Base font size. |
legend_position |
Legend position passed to |
A ggplot2 theme.
view_compose() combines several named ggplot objects into a single layout.
The layout argument accepts the same compact row syntax as the historical
Optirrig plotting helpers, for example "graph1 | graph2 / graph3 | graph4".
view_compose( plots, layout = NULL, title = NULL, subtitle = NULL, theme = NULL, guides = "collect" )view_compose( plots, layout = NULL, title = NULL, subtitle = NULL, theme = NULL, guides = "collect" )
plots |
Named list of |
layout |
Optional layout description. Use |
title, subtitle
|
Optional global annotation. |
theme |
Optional theme object, or a function returning one, applied to each plot before composition. |
guides |
Guide collection mode passed to |
A ggplot object for a single plot, or a composed patchwork object.
view_data() converts several common input shapes into a plotting table with
stored column mappings. This object can then be passed directly to
view_plot() or plot().
view_data(x, ...) ## S3 method for class 'data.frame' view_data( x, x_var = NULL, y_var = NULL, value_vars = NULL, series = NULL, facet = NULL, ymin = NULL, ymax = NULL, group = NULL, names_to = "series", values_to = "value", drop_na = TRUE, ... ) ## S3 method for class 'list' view_data( x, x_var = NULL, y_var = NULL, value_vars = NULL, series = NULL, facet = NULL, ymin = NULL, ymax = NULL, group = NULL, names_to = "series", values_to = "value", drop_na = TRUE, ... ) ## S3 method for class 'matrix' view_data( x, x_var = NULL, y_var = NULL, value_vars = NULL, series = NULL, facet = NULL, ymin = NULL, ymax = NULL, group = NULL, names_to = "series", values_to = "value", drop_na = TRUE, ... ) ## Default S3 method: view_data(x, ...) ## S3 method for class 'optirrig_view_data' view_data(x, ...)view_data(x, ...) ## S3 method for class 'data.frame' view_data( x, x_var = NULL, y_var = NULL, value_vars = NULL, series = NULL, facet = NULL, ymin = NULL, ymax = NULL, group = NULL, names_to = "series", values_to = "value", drop_na = TRUE, ... ) ## S3 method for class 'list' view_data( x, x_var = NULL, y_var = NULL, value_vars = NULL, series = NULL, facet = NULL, ymin = NULL, ymax = NULL, group = NULL, names_to = "series", values_to = "value", drop_na = TRUE, ... ) ## S3 method for class 'matrix' view_data( x, x_var = NULL, y_var = NULL, value_vars = NULL, series = NULL, facet = NULL, ymin = NULL, ymax = NULL, group = NULL, names_to = "series", values_to = "value", drop_na = TRUE, ... ) ## Default S3 method: view_data(x, ...) ## S3 method for class 'optirrig_view_data' view_data(x, ...)
x |
Object to normalize. |
... |
Unused. |
x_var |
Column used on the x axis. |
y_var |
Column used on the y axis when data is already long. |
value_vars |
Columns to pivot to a long |
series |
Optional grouping column. |
facet |
Optional faceting column. |
ymin, ymax
|
Optional lower and upper bound columns, mainly for ribbons. |
group |
Optional grouping column passed to geoms. |
names_to |
Name of the column created by |
values_to |
Name of the value column created by |
drop_na |
If |
An object of class optirrig_view_data.
view_plot() accepts either raw data or the normalized output of
view_data(). The function keeps the plotting API intentionally small and
handles the most common plot types used across Optirrig packages.
view_plot( x, geom = c("line", "point", "col", "boxplot", "ribbon", "area"), x_var = NULL, y_var = NULL, value_vars = NULL, series = NULL, facet = NULL, ymin = NULL, ymax = NULL, group = NULL, names_to = "series", values_to = "value", drop_na = TRUE, title = NULL, subtitle = NULL, x_lab = NULL, y_lab = NULL, palette = optirrig_palette, series_values = NULL, scales = "free_y", alpha = NULL, interactive = FALSE, tooltip = NULL, ... )view_plot( x, geom = c("line", "point", "col", "boxplot", "ribbon", "area"), x_var = NULL, y_var = NULL, value_vars = NULL, series = NULL, facet = NULL, ymin = NULL, ymax = NULL, group = NULL, names_to = "series", values_to = "value", drop_na = TRUE, title = NULL, subtitle = NULL, x_lab = NULL, y_lab = NULL, palette = optirrig_palette, series_values = NULL, scales = "free_y", alpha = NULL, interactive = FALSE, tooltip = NULL, ... )
x |
Object to plot. |
geom |
Geometry to draw. |
x_var, y_var, value_vars, series, facet, ymin, ymax, group, names_to, values_to, drop_na
|
Passed to |
title, subtitle
|
Plot labels. |
x_lab, y_lab
|
Axis labels. |
palette |
Color palette used for grouped plots. |
series_values |
Optional complete set of series values to keep in the legend, even when some series are absent from one panel. |
scales |
Facet scales passed to |
alpha |
Geom transparency. |
interactive |
If |
tooltip |
Optional tooltip vector passed to |
... |
Unused. |
A ggplot object, or a plotly object when interactive = TRUE.
Convert a ggplot to plotly
view_plotly(x, tooltip = NULL)view_plotly(x, tooltip = NULL)
x |
A |
tooltip |
Optional tooltip vector forwarded to |
A plotly object.