| Title: | FDI Shiny utils |
|---|---|
| Description: | FDI Shiny utils |
| Authors: | Emmanuel Blondel [aut, cre] (ORCID: <https://orcid.org/0000-0002-5870-5762>), Alexandre Bennici [aut] (ORCID: <https://orcid.org/0000-0003-2160-3487>) |
| Maintainer: | Emmanuel Blondel <[email protected]> |
| License: | |
| Version: | 0.1.20260529 |
| Built: | 2026-07-09 18:36:22 UTC |
| Source: | https://github.com/fdiwg/fdishinyr |
ERROR logger
ERROR(txt, ...)ERROR(txt, ...)
txt |
a character vector of format strings, each of up to 8192 bytes. |
... |
any values to be passed into |
FDI shiny utils
Emmanuel Blondel [email protected]
Useful links:
Server-side logic for a fully generic and configurable charting module. The module supports multiple plot types (time series, bars, stacked areas, distributions, rankings, composition charts), time granularities, aggregation statistics (sum or mean), optional error computation, internationalization (i18n), and data export.
The server:
Normalizes and aggregates heterogeneous tabular data
Handles time-based aggregation (monthly / yearly)
Computes optional statistical errors (SD, SE, CI95)
Dynamically dislay data with the appropriate Plotly chart type
Provides tabular summaries and download capabilities
generic_chart_server( id, lang = NULL, df, col_date, col_group, col_value, time_label = "Date", value_label = "Value", group_label = "Group", plot_types = NULL, plot_type_default = NULL, time_choices = c("month", "year"), stat = "sum", error = "none", rank_number = 10, rank_target_id = NULL, rank_target_color = "orange" )generic_chart_server( id, lang = NULL, df, col_date, col_group, col_value, time_label = "Date", value_label = "Value", group_label = "Group", plot_types = NULL, plot_type_default = NULL, time_choices = c("month", "year"), stat = "sum", error = "none", rank_number = 10, rank_target_id = NULL, rank_target_color = "orange" )
id |
Character string. Module namespace identifier. |
lang |
Optional language parameter. Can be either:
If |
df |
A reactive or static |
col_date |
Character string, name of the date column in |
col_group |
Character string, name of the grouping column (categorical variable). |
col_value |
Character string, name of the numeric value column. |
time_label |
Character string used as x-axis label for time-based charts.
Default is |
value_label |
Character string used as y-axis label for numeric values.
Default is |
group_label |
Character string used as label for grouping variables.
Default is |
plot_types |
Optional character vector restricting the set of plot types available to the user. Supported values are:
If |
plot_type_default |
Optional character string defining the default plot type selected in the plot type selector.
Supported values are the same as |
time_choices |
Character vector defining allowed time granularities.
Default is |
stat |
Character string defining the aggregation statistic. Supported values are:
Default is |
error |
Character string defining the default error type for mean-based plots. Supported values are:
Default is |
rank_number |
Integer. Specific to |
rank_target_id |
Optional character string. Specific to |
rank_target_color |
Optional character string. Specific to |
User interface for the generic chart Shiny module.
The UI provides:
A configurable sidebar for plot options
A main panel displaying interactive charts and summary tables
Download controls for exporting charts (PNG / HTML)
This UI is designed to work with generic_chart_server and relies on
bs4Dash plotly::layout components.
generic_chart_ui(id, title = "", sliderWidth = 25)generic_chart_ui(id, title = "", sliderWidth = 25)
id |
Character string. Module namespace identifier. |
title |
Character string, title displayed at the top of the chart box. |
sliderWidth |
A numeric value between 25 and 100. Sidebar opening width in percentage. 25%, means the card sidebar will take 25% of the card width, when opened.
Default is |
INFO logger
INFO(txt, ...)INFO(txt, ...)
txt |
a character vector of format strings, each of up to 8192 bytes. |
... |
any values to be passed into |
Generic logger
logger(type = c("INFO", "WARN", "ERROR"), txt, ...)logger(type = c("INFO", "WARN", "ERROR"), txt, ...)
type |
type either INFO, WARN or DEBUG |
txt |
a character vector of format strings, each of up to 8192 bytes. |
... |
any values to be passed into |
set_translation_language
set_translation_language(lang)set_translation_language(lang)
lang |
lang |
Get translator
translator()translator()
the translator, object of class Translator
WARN logger
WARN(txt, ...)WARN(txt, ...)
txt |
a character vector of format strings, each of up to 8192 bytes. |
... |
any values to be passed into |
POC shiny module server
welcome_server(id, lang = NULL)welcome_server(id, lang = NULL)
id |
id |
lang |
lang a reactive version of the language. Default is |
POC shiny module UI
welcome_ui(id)welcome_ui(id)
id |
id |