Skip to content

Commit

Permalink
Merge pull request #37 from eodaGmbH/prepare-cran-release
Browse files Browse the repository at this point in the history
Prepare cran release
  • Loading branch information
crazycapivara authored Sep 18, 2024
2 parents cb03636 + abdd3a1 commit 0eda3bf
Show file tree
Hide file tree
Showing 17 changed files with 121 additions and 11 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ _NAMESPACE
^\.github$
images/
^vignettes/articles$
^cran-comments\.md$
6 changes: 4 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ Title: R Bindings for Tabulator JS
Version: 0.1.2
Date: 2024-09-18
Authors@R: c(
person("Stefan", "Kuethe", email = "[email protected]", role = c("aut", "cre")),
person("Nico", "Friess", email = "[email protected]", role = c("aut"))
person("Stefan", "Kuethe", email = "[email protected]", role = c("aut", "cre", "cph")),
person("Nico", "Friess", email = "[email protected]", role = "aut"),
person("Oli", "Folkerd", role = "cph",
comment = "Author of included tabulator.js library")
)
Maintainer: Stefan Kuethe <[email protected]>
Description: Provides R bindings for 'Tabulator JS' <https://tabulator.info/>.
Expand Down
45 changes: 42 additions & 3 deletions R/context_calls.R
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
#' Download table data
#'
#' @details
#' If you want to provide xlsx downloads, you need to include
#' the sheetjs html dependency: \code{tabulator(..., sheetjs = TRUE)}
#' @param ctx (\code{\link{tabulatorContext}}): tabulator context object
#' @param type (character): csv, json or xlsx (needs sheetjs: \code{tabulator(..., sheetjs = TRUE)})
#' @param type (character): csv, json or xlsx
#' @param file_name (character, \code{NULL}): File name.
#' @returns tabulator context object
#' If \code{NULL}, it is set to \code{"data.{type}"}.
#' @returns tabulator context object
#' @examples
#' \dontrun{
#' tabulatorContext("table") |>
#' trigger_download("csv", "table-data.csv")
#' }
#' @export
trigger_download <- function(ctx, type = c("csv", "json", "xlsx"), file_name = NULL) {
if (is.null(file_name)) {
Expand All @@ -16,15 +25,25 @@ trigger_download <- function(ctx, type = c("csv", "json", "xlsx"), file_name = N
#' Submit data to R
#' @inheritParams trigger_download
#' @returns tabulator context object
#' @examples
#' \dontrun{
#' tabulatorContext("table") |>
#' trigger_get_data()
#' }
#' @export
trigger_get_data <- function(ctx) {
invoke_method(ctx, "getData")
}

#' Add row to table
#' @inheritParams trigger_download
#' @param row (list | NULL): row data or \code{NULL} to add an empty row
#' @param row (list): row data or \code{NULL} to add an empty row
#' @returns tabulator context object
#' @examples
#' \dontrun{
#' tabulatorContext("table") |>
#' add_row()
#' }
#' @export
add_row <- function(ctx, row = NULL) {
invoke_method(ctx, "addRow", row)
Expand All @@ -33,6 +52,11 @@ add_row <- function(ctx, row = NULL) {
#' Delete selected rows from table
#' @inheritParams trigger_download
#' @returns tabulator context object
#' @examples
#' \dontrun{
#' tabulatorContext("table") |>
#' delete_selected_rows()
#' }
#' @export
delete_selected_rows <- function(ctx) {
invoke_method(ctx, "deleteSelectedRows")
Expand All @@ -47,6 +71,11 @@ delete_row <- function(ctx) {
#' Undo changes
#' @inheritParams trigger_download
#' @returns tabulator context object
#' @examples
#' \dontrun{
#' tabulatorContext("table") |>
#' undo()
#' }
#' @export
undo <- function(ctx) {
invoke_method(ctx, "undo")
Expand All @@ -55,6 +84,11 @@ undo <- function(ctx) {
#' Redo changes
#' @inheritParams trigger_download
#' @returns tabulator context object
#' @examples
#' \dontrun{
#' tabulatorContext("table") |>
#' redo()
#' }
#' @export
redo <- function(ctx) {
invoke_method(ctx, "redo")
Expand All @@ -63,6 +97,11 @@ redo <- function(ctx) {
#' Submit sheet data to R
#' @inheritParams trigger_download
#' @returns tabulator context object
#' @examples
#' \dontrun{
#' tabulatorContext("table") |>
#' trigger_get_sheet_data()
#' }
#' @export
trigger_get_sheet_data <- function(ctx) {
invoke_method(ctx, "getSheetData")
Expand Down
5 changes: 5 additions & 0 deletions R/tabulator_context.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ invoke_method <- function(widget, method_name, ...) {
#' @param output_id (character): A tabulator output id.
#' @param session A shiny session object.
#' @returns tabulator context object
#' @examples
#' \dontrun{
#' tabulatorContext("table") |>
#' trigger_download("csv")
#' }
#' @export
tabulatorContext <- function(output_id, session = shiny::getDefaultReactiveDomain()) {
ctx <- list(
Expand Down
1 change: 1 addition & 0 deletions R/tabulator_options.R
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ set_options_pagination <- function(
#' @inheritParams set_formatter_html
#' @inheritParams tabulator_options
#' @returns tabulator htmlwidget
#' @example examples/options/group_by_options.R
#' @export
set_options_group_by <- function(
widget,
Expand Down
2 changes: 1 addition & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Bindings for Python are available at [https://github.com/eodaGmbH/py-tabulator](

## Installation

Once on CRAN you can install rtabulator with:
You can install the released version of rtabulator from [CRAN](https://CRAN.R-project.org) with:

``` r
install.packages("rtabulator")
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ Bindings for Python are available at

## Installation

Once on CRAN you can install rtabulator with:
You can install the released version of rtabulator from
[CRAN](https://CRAN.R-project.org) with:

``` r
install.packages("rtabulator")
Expand Down
5 changes: 5 additions & 0 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## R CMD check results

0 errors | 0 warnings | 1 note

* This is a new release.
8 changes: 7 additions & 1 deletion man/add_row.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions man/delete_selected_rows.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions man/redo.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions man/set_options_group_by.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions man/tabulatorContext.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 13 additions & 3 deletions man/trigger_download.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions man/trigger_get_data.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions man/trigger_get_sheet_data.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions man/undo.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0eda3bf

Please sign in to comment.