davidhodge931 / ggblanket

Simplify ggplot2 visualisation
https://davidhodge931.github.io/ggblanket/
Other
149 stars 8 forks source link

add *_orientation back in #932

Closed davidhodge931 closed 4 weeks ago

davidhodge931 commented 4 weeks ago
  # if (rlang::is_null(x_orientation)) {
  #   if (y_scale_type == "discrete" & x_scale_type != "discrete") x_orientation <- TRUE
  #   else x_orientation <- FALSE
  # }
  #
  # if (rlang::is_null(y_orientation)) {
  #   y_orientation <- !x_orientation
  # }
davidhodge931 commented 4 weeks ago
  if (rlang::is_null(x_orientation) & rlang::is_null(y_orientation)) {
    if (y_scale_type == "discrete" & x_scale_type != "discrete") {
      x_orientation <- TRUE
      y_orientation <- FALSE
    }
    else {
      x_orientation <- FALSE
      y_orientation <- TRUE
    }
  }
  else if (!rlang::is_null(x_orientation) & rlang::is_null(y_orientation)) {
    y_orientation <- !x_orientation
  }
  else if (rlang::is_null(x_orientation) & !rlang::is_null(y_orientation)) {
    x_orientation <- !y_orientation
  }
davidhodge931 commented 4 weeks ago

Sorted :)