zeehio / condformat

Compare 5446934 ... +3 ... 03c3247

No flags found

Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.

e.g., #unittest #integration

#production #enterprise

#frontend #backend

Learn more about Codecov Flags here.


@@ -44,11 +44,8 @@
Loading
44 44
    x <- condformat(x)
45 45
  }
46 46
  columnsquo <- rlang::enquo(columns)
47 -
  helpers <- tidyselect::vars_select_helpers
48 -
  columnsquo_bur <- rlang::env_bury(columnsquo, !!! helpers)
49 -
50 47
  expr <- rlang::enquo(expression)
51 -
  rule <- structure(list(columns = columnsquo_bur,
48 +
  rule <- structure(list(columns = columnsquo,
52 49
                         expression = expr,
53 50
                         low = force(low),
54 51
                         high = force(high),
@@ -62,18 +59,18 @@
Loading
62 59
63 60
#' @importFrom scales rescale
64 61
rule_to_cf_field.rule_fill_gradient <- function(rule, xfiltered, xview, ...) {
65 -
  columns <- do.call(tidyselect::vars_select, c(list(colnames(xview)), rule[["columns"]]))
62 +
  columns <- tidyselect::eval_select(expr = rule[["columns"]], data = xview)
66 63
  if (length(columns) == 0) {
67 64
    return(NULL)
68 65
  }
69 66
  if (rlang::quo_is_missing(rule[["expression"]])) {
70 67
    if (length(columns) > 1) {
71 68
      warning("rule_fill_gradient applied to multiple columns, using column ",
72 -
              columns[1], " values as expression. In the future this behaviour will change,",
69 +
              names(columns)[1], " values as expression. In the future this behaviour will change,",
73 70
              " please use a explicit expression instead.",
74 71
              call. = FALSE)
75 72
    }
76 -
    rule[["expression"]] <- as.symbol(as.name(columns[1]))
73 +
    rule[["expression"]] <- rlang::sym(names(columns)[1])
77 74
  }
78 75
  values_determining_color <- rlang::eval_tidy(rule[["expression"]], data = xfiltered)
79 76
  values_determining_color <- rep(values_determining_color, length.out = nrow(xfiltered))

@@ -33,8 +33,7 @@
Loading
33 33
              paste(wrong_args[!deprecated_args], collapse = ", "),
34 34
              ". This will be an error in a future condformat version")
35 35
      htmlwidgetargs <- htmlargs[wrong_args[deprecated_args]]
36 -
      x <- do.call(theme_htmlWidget, args = c(list(x = x),
37 -
                                              htmlwidgetargs))
36 +
      x <- rlang::exec(theme_htmlWidget, x = x, !!!htmlwidgetargs)
38 37
      wrong_args <- wrong_args[!deprecated_args]
39 38
    }
40 39
    # Deprecation code path ends here

@@ -19,12 +19,9 @@
Loading
19 19
                     na.value = "",
20 20
                     lockcells = FALSE) {
21 21
  columnsquo <- rlang::enquo(columns)
22 -
  helpers <- tidyselect::vars_select_helpers
23 -
  columnsquo_bur <- rlang::env_bury(columnsquo, !!! helpers)
24 -
25 22
  expr <- rlang::enquo(expression)
26 23
27 -
  rule <- structure(list(columns = columnsquo_bur,
24 +
  rule <- structure(list(columns = columnsquo,
28 25
                         expression = expr,
29 26
                         css_field = force(css_field),
30 27
                         na.value = force(na.value),
@@ -36,18 +33,18 @@
Loading
36 33
}
37 34
38 35
rule_to_cf_field.rule_css <- function(rule, xfiltered, xview, ...) {
39 -
  columns <- do.call(tidyselect::vars_select, c(list(colnames(xview)), rule[["columns"]]))
36 +
  columns <- tidyselect::eval_select(expr = rule[["columns"]], data = xview)
40 37
  if (length(columns) == 0) {
41 38
    return(NULL)
42 39
  }
43 40
  if (rlang::quo_is_missing(rule[["expression"]])) {
44 41
    if (length(columns) > 1) {
45 42
      warning("rule_css applied to multiple columns, using column ",
46 -
              columns[1], " values as expression. In the future this behaviour will change,",
43 +
              names(columns)[1], " values as expression. In the future this behaviour will change,",
47 44
              "please use a explicit expression instead.",
48 45
              call. = FALSE)
49 46
    }
50 -
    rule[["expression"]] <- as.symbol(as.name(columns[1]))
47 +
    rule[["expression"]] <- rlang::sym(names(columns)[1])
51 48
  }
52 49
  css_values <- rlang::eval_tidy(rule[["expression"]], data = xfiltered)
53 50
  stopifnot(identical(length(css_values), nrow(xview)))

@@ -46,11 +46,8 @@
Loading
46 46
    x <- condformat(x)
47 47
  }
48 48
  columnsquo <- rlang::enquo(columns)
49 -
  helpers <- tidyselect::vars_select_helpers
50 -
  columnsquo_bur <- rlang::env_bury(columnsquo, !!! helpers)
51 -
52 49
  expr <- rlang::enquo(expression)
53 -
  rule <- structure(list(columns = columnsquo_bur,
50 +
  rule <- structure(list(columns = columnsquo,
54 51
                         expression = expr,
55 52
                         colours = force(colours),
56 53
                         h = force(h),
@@ -65,18 +62,18 @@
Loading
65 62
}
66 63
67 64
rule_to_cf_field.rule_fill_discrete <- function(rule, xfiltered, xview, ...) {
68 -
  columns <- do.call(tidyselect::vars_select, c(list(colnames(xview)), rule[["columns"]]))
65 +
  columns <- tidyselect::eval_select(expr = rule[["columns"]], data = xview)
69 66
  if (length(columns) == 0) {
70 67
    return(NULL)
71 68
  }
72 69
  if (rlang::quo_is_missing(rule[["expression"]])) {
73 70
    if (length(columns) > 1) {
74 71
      warning("rule_fill_discrete applied to multiple columns, using column ",
75 -
              columns[1], " values as expression. In the future this behaviour will change,",
72 +
              names(columns)[1], " values as expression. In the future this behaviour will change,",
76 73
              "please use a explicit expression instead.",
77 74
              call. = FALSE)
78 75
    }
79 -
    rule[["expression"]] <- as.symbol(as.name(columns[1]))
76 +
    rule[["expression"]] <- rlang::sym(names(columns)[1])
80 77
  }
81 78
  values_determining_color <- as.factor(rlang::eval_tidy(rule[["expression"]], data = xfiltered))
82 79
  values_determining_color <- rep(values_determining_color, length.out = nrow(xfiltered))

@@ -11,10 +11,12 @@
Loading
11 11
#' @export
12 12
condformat2html <- function(x) {
13 13
  htmltable_ready <- condformat2htmlcommon(x)
14 -
  thetable <- do.call(htmlTable::htmlTable,
15 -
                      c(list(x = htmltable_ready[["xview"]],
16 -
                             css.cell = htmltable_ready[["css_cell"]]),
17 -
                        htmltable_ready[["htmlTableArgs"]]))
14 +
  thetable <- rlang::exec(
15 +
    htmlTable::htmlTable,
16 +
    x = htmltable_ready[["xview"]],
17 +
    css.cell = htmltable_ready[["css_cell"]],
18 +
    !!!htmltable_ready[["htmlTableArgs"]]
19 +
  )
18 20
  return(thetable)
19 21
}
20 22
@@ -41,11 +43,13 @@
Loading
41 43
  }
42 44
  # Deprecation path ends here
43 45
  htmltable_ready <- condformat2htmlcommon(x)
44 -
  thewidget <- do.call(what = htmlTable::htmlTableWidget,
45 -
                       args = c(list(x = htmltable_ready[["xview"]],
46 -
                                     css.cell = htmltable_ready[["css_cell"]]),
47 -
                                htmltable_ready[["htmlTableArgs"]],
48 -
                                htmltable_ready[["htmlWidget"]]))
46 +
  thewidget <- rlang::exec(
47 +
    htmlTable::htmlTableWidget,
48 +
    x = htmltable_ready[["xview"]],
49 +
    css.cell = htmltable_ready[["css_cell"]],
50 +
    !!!htmltable_ready[["htmlTableArgs"]],
51 +
    !!!htmltable_ready[["htmlWidget"]]
52 +
  )
49 53
  return(thewidget)
50 54
}
51 55

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Learn more Showing 2 files with coverage changes found.

Changes in R/rule_fill_discrete.R
-13
+13
Loading file...
Changes in R/render_gtable.R
-17
+17
Loading file...
Files Coverage
R +3.96% 73.52%
Project Totals (22 files) 73.52%
Loading