Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update custom-basic-table-arguments.Rmd (#1) #247

Merged
merged 1 commit into from
Jun 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions vignettes/custom-basic-table-arguments.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,23 @@ creator in the server function, which has the lowest priority.

The implementation should consist of 5 steps:

1. Adding `basic_table_args` argument to the `tm_t_*` function and then its server function.
1. Add the `basic_table_args` arguments to the `tm_t_*` function and then its server function.
The default should be set to
the `basic_table_args()` function for a single plot.
and `list(default = basic_table_args())` multi-table modules.
2. Adding a validation (e.g. `stopifnot` or `checkmate`) of the `basic_table_args` argument to the `tm_*` function.
2. Add validation (e.g. `stopifnot` or `checkmate`) for the `basic_table_args` arguments to the `tm_*` function.
The validation is more complex for multi-table modules, where the `ggplot2_args` could be a `list`.
The module creator has to provide a list of plots names, which should be validated at this step and added to the `param`
field in `roxygen2`. For multi-table modules the step
`if (is_basic_table_args) basic_table_args <- list(default = basic_table_args)` is recommended.
3. Aggregating and reducing all `basic_table_args` sources with `resolve_basic_table_args()`.
4. Usage of the `parse_basic_table_args()` function which will aggregate and reduce all inputs
3. Aggregate and reduce all `basic_table_args` sources with `resolve_basic_table_args()`.
4. Use the `parse_basic_table_args()` function which will aggregate and reduce all inputs
to one expression.
5. Adding the created expression to the chunk with a table.
5. Add the created expression to the chunk with a table.

The `parse_basic_table_args()` function picks the first non NULL value for each argument, checking in order:

1. `basic_table_args` argument provided by the end user.
1. `basic_table_args` arguments provided by the end user.
For multi-table case, per table (`basic_table_args_table`) and then default (`basic_table_args_default`) setup.
2. Global R variable (`options`), `teal.basic_table_args`.
3. `basic_table_args_developer` which is a developer setup, lowest priority.
Expand Down
Loading