diff --git a/R/boxwhisker-plotconfiguration.R b/R/boxwhisker-plotconfiguration.R index c194fefe..babf089f 100644 --- a/R/boxwhisker-plotconfiguration.R +++ b/R/boxwhisker-plotconfiguration.R @@ -6,6 +6,9 @@ BoxWhiskerPlotConfiguration <- R6::R6Class( "BoxWhiskerPlotConfiguration", inherit = PlotConfiguration, public = list( + #' @field defaultXScale Default xAxis scale value when creating a `BoxWhiskerPlotConfiguration` object + defaultXScale = "discrete", + #' @description Create a new `BoxWhiskerPlotConfiguration` object #' @param outliers logical defining if outliers should be included in boxplot #' @param ... parameters inherited from `PlotConfiguration` diff --git a/R/plotconfiguration-axis.R b/R/plotconfiguration-axis.R index 3ffe47c7..7291fc10 100644 --- a/R/plotconfiguration-axis.R +++ b/R/plotconfiguration-axis.R @@ -38,7 +38,6 @@ createPlotTicks <- function(ticks) { return(ticks) } - #' @title AxisConfiguration #' @description R6 class defining the configuration of axis #' @export @@ -52,20 +51,26 @@ AxisConfiguration <- R6::R6Class( #' @param ticks numeric vector or function defining where to position axis ticks #' @param ticklabels character vector or function defining what to print on axis ticks #' @param font `Font` object defining the font of ticklabels + #' @param expand logical defining if data is expanded until axis. + #' If `TRUE`, data is expanded until axis + #' If `FALSE`, some space between data and axis is kept #' @return A new `AxisConfiguration` object initialize = function(limits = NULL, scale = Scaling$lin, ticks = NULL, ticklabels = NULL, - font = NULL) { + font = NULL, + expand = FALSE) { validateIsNumeric(limits, nullAllowed = TRUE) validateIsOfType(font, "Font", nullAllowed = TRUE) + validateIsLogical(expand) private$.limits <- limits scale <- scale %||% Scaling$lin private$.scale <- createPlotScale(scale) private$.ticks <- createPlotTicks(ticks) private$.ticklabels <- createPlotTicks(ticklabels) + private$.expand <- expand # Default axis font will use theme defaultFont <- Font$new() @@ -90,6 +95,15 @@ AxisConfiguration <- R6::R6Class( ) }, + #' @description Get the `ggplot2` actual function for expansion + #' @return A `ggplot2` function + ggplotExpansion = function() { + if (private$.expand) { + return(ggplot2::expansion()) + } + return(ggplot2::waiver()) + }, + #' @description Get tick values for pretty default log plots #' @return User defined tick values or tlf default ticks prettyTicks = function() { @@ -185,6 +199,17 @@ AxisConfiguration <- R6::R6Class( } private$.font <- value %||% defaultFont return(invisible()) + }, + #' @field expand logical defining if data is expanded until axis. + #' If `TRUE`, data is expanded until axis + #' If `FALSE`, some space between data and axis is kept + expand = function(value) { + if (missing(value)) { + return(private$.expand) + } + validateIsLogical(value) + private$.expand <- value + return(invisible()) } ), private = list( @@ -192,7 +217,8 @@ AxisConfiguration <- R6::R6Class( .scale = NULL, .ticks = NULL, .ticklabels = NULL, - .font = NULL + .font = NULL, + .expand = NULL ) ) @@ -219,7 +245,11 @@ XAxisConfiguration <- R6::R6Class( if (isIncluded(private$.scale, Scaling$discrete)) { suppressMessages( plotObject <- plotObject + - ggplot2::scale_x_discrete(breaks = private$.ticks, labels = private$.ticklabels) + ggplot2::scale_x_discrete( + breaks = private$.ticks, + labels = private$.ticklabels, + expand = self$ggplotExpansion() + ) ) return(plotObject) } @@ -227,7 +257,12 @@ XAxisConfiguration <- R6::R6Class( # `try` should be added in cases of scale breaking because all the ggplot object elements are not yet in place suppressMessages( plotObject <- plotObject + - ggplot2::scale_x_continuous(trans = self$ggplotScale(), breaks = self$prettyTicks(), labels = self$prettyTickLabels()) + ggplot2::scale_x_continuous( + trans = self$ggplotScale(), + breaks = self$prettyTicks(), + labels = self$prettyTickLabels(), + expand = self$ggplotExpansion() + ) ) # Add special tick lines for pretty log plots suppressMessages( @@ -268,7 +303,11 @@ YAxisConfiguration <- R6::R6Class( if (isIncluded(private$.scale, Scaling$discrete)) { suppressMessages( plotObject <- plotObject + - ggplot2::scale_y_discrete(breaks = private$.ticks, labels = private$.ticklabels) + ggplot2::scale_y_discrete( + breaks = private$.ticks, + labels = private$.ticklabels, + expand = self$ggplotExpansion() + ) ) return(plotObject) } @@ -276,7 +315,12 @@ YAxisConfiguration <- R6::R6Class( # `try` should be added in cases of scale breaking because all the ggplot object elements are not yet in place suppressMessages( plotObject <- plotObject + - ggplot2::scale_y_continuous(trans = self$ggplotScale(), breaks = self$prettyTicks(), labels = self$prettyTickLabels()) + ggplot2::scale_y_continuous( + trans = self$ggplotScale(), + breaks = self$prettyTicks(), + labels = self$prettyTickLabels(), + expand = self$ggplotExpansion() + ) ) # Add special tick lines for pretty log plots suppressMessages( diff --git a/R/plotconfiguration.R b/R/plotconfiguration.R index 2c2eb0cb..b83e378c 100644 --- a/R/plotconfiguration.R +++ b/R/plotconfiguration.R @@ -1,6 +1,9 @@ #' @title PlotConfiguration #' @description R6 class defining the configuration of a `ggplot` object #' @field export R6 class `ExportConfiguration` defining properties for saving/exporting plota +#' @field defaultXScale Default xAxis scale value when creating a `PlotConfiguration` object +#' @field defaultYScale Default yAxis scale value when creating a `PlotConfiguration` object +#' @field defaultExpand Default expand value when creating a `PlotConfiguration` object #' @family PlotConfiguration classes #' @references For examples, see: #' @@ -9,6 +12,11 @@ PlotConfiguration <- R6::R6Class( "PlotConfiguration", public = list( export = NULL, + # Caution, helper enum Scaling doesn't work here + # (even using @include to collate and define the variable beforehand) + defaultXScale = "lin", + defaultYScale = "lin", + defaultExpand = FALSE, #' @description Create a new `PlotConfiguration` object #' @param title character or `Label` object defining plot title @@ -122,13 +130,19 @@ PlotConfiguration <- R6::R6Class( # X-Axis Configuration, overwrite some properties only if they are defined validateIsOfType(xAxis, "XAxisConfiguration", nullAllowed = TRUE) - private$.xAxis <- xAxis %||% XAxisConfiguration$new(scale = xAxisDefaultScale(self)) + private$.xAxis <- xAxis %||% XAxisConfiguration$new( + scale = self$defaultXScale, + expand = self$defaultExpand + ) private$.xAxis$limits <- xLimits %||% private$.xAxis$limits private$.xAxis$scale <- xScale %||% private$.xAxis$scale # Y-Axis configuration, overwrite some properties only if they are defined validateIsOfType(yAxis, "YAxisConfiguration", nullAllowed = TRUE) - private$.yAxis <- yAxis %||% YAxisConfiguration$new(scale = yAxisDefaultScale(self)) + private$.yAxis <- yAxis %||% YAxisConfiguration$new( + scale = self$defaultYScale, + expand = self$defaultExpand + ) private$.yAxis$limits <- yLimits %||% private$.yAxis$limits private$.yAxis$scale <- yScale %||% private$.yAxis$scale @@ -272,20 +286,32 @@ TimeProfilePlotConfiguration <- R6::R6Class( #' @title PKRatioPlotConfiguration #' @description R6 class defining the configuration of a `ggplot` object for PK ratio plots +#' @field defaultYScale Default yAxis scale value when creating a `PKRatioPlotConfiguration` object #' @export #' @family PlotConfiguration classes PKRatioPlotConfiguration <- R6::R6Class( "PKRatioPlotConfiguration", - inherit = PlotConfiguration + inherit = PlotConfiguration, + public = list( + defaultYScale = "log" + ) ) #' @title DDIRatioPlotConfiguration #' @description R6 class defining the configuration of a `ggplot` object for DDI ratio plots +#' @field defaultXScale Default xAxis scale value when creating a `DDIRatioPlotConfiguration` object +#' @field defaultYScale Default yAxis scale value when creating a `DDIRatioPlotConfiguration` object +#' @field defaultExpand Default expand value when creating a `DDIRatioPlotConfiguration` object #' @export #' @family PlotConfiguration classes DDIRatioPlotConfiguration <- R6::R6Class( "DDIRatioPlotConfiguration", - inherit = PlotConfiguration + inherit = PlotConfiguration, + public = list( + defaultXScale = "log", + defaultYScale = "log", + defaultExpand = TRUE + ) ) #' @title ObsVsPredPlotConfiguration diff --git a/R/tornado-plotconfiguration.R b/R/tornado-plotconfiguration.R index ebabcff6..61156d39 100644 --- a/R/tornado-plotconfiguration.R +++ b/R/tornado-plotconfiguration.R @@ -12,6 +12,8 @@ TornadoPlotConfiguration <- R6::R6Class( colorPalette = NULL, #' @field dodge space between the bars/points dodge = NULL, + #' @field defaultYScale Default yAxis scale value when creating a `TornadoPlotConfiguration` object + defaultYScale = "discrete", #' @description Create a new `TornadoPlotConfiguration` object #' @param bar logical setting if tornado is uses a bar plot instead of regular points diff --git a/R/utilities-axis.R b/R/utilities-axis.R index d6be03be..011887de 100644 --- a/R/utilities-axis.R +++ b/R/utilities-axis.R @@ -43,6 +43,7 @@ Scaling <- enum(c( #' @param ticks Optional values or function for axis ticks #' @param ticklabels Optional values or function for axis ticklabels #' @param font A `Font` object defining font of ticklabels +#' @param expand Logical defining if data is expanded until axis #' @return A `ggplot` object #' @export #' @examples @@ -64,11 +65,13 @@ setXAxis <- function(plotObject, limits = NULL, ticks = NULL, ticklabels = NULL, - font = NULL) { + font = NULL, + expand = NULL) { validateIsOfType(plotObject, "ggplot") validateIsIncluded(scale, Scaling, nullAllowed = TRUE) validateIsNumeric(limits, nullAllowed = TRUE) validateIsOfType(font, "Font", nullAllowed = TRUE) + validateIsLogical(expand, nullAllowed = TRUE) # Clone plotConfiguration into a new plot object # Prevents update of R6 class being spread to plotObject @@ -77,7 +80,7 @@ setXAxis <- function(plotObject, # R6 class not cloned will spread modifications into newPlotObject$plotConfiguration$xAxis xAxis <- newPlotObject$plotConfiguration$xAxis - eval(parseVariableToObject("xAxis", c("limits", "scale", "ticks", "ticklabels", "font"), keepIfNull = TRUE)) + eval(parseVariableToObject("xAxis", c("limits", "scale", "ticks", "ticklabels", "font", "expand"), keepIfNull = TRUE)) newPlotObject <- xAxis$updatePlot(newPlotObject, ylim = newPlotObject$plotConfiguration$yAxis$limits) return(newPlotObject) } @@ -106,11 +109,13 @@ setYAxis <- function(plotObject, limits = NULL, ticks = NULL, ticklabels = NULL, - font = NULL) { + font = NULL, + expand = NULL) { validateIsOfType(plotObject, "ggplot") validateIsIncluded(scale, Scaling, nullAllowed = TRUE) validateIsNumeric(limits, nullAllowed = TRUE) validateIsOfType(font, "Font", nullAllowed = TRUE) + validateIsLogical(expand, nullAllowed = TRUE) # Clone plotConfiguration into a new plot object # Prevents update of R6 class being spread to plotObject @@ -119,70 +124,11 @@ setYAxis <- function(plotObject, # R6 class not cloned will spread modifications into newPlotObject$plotConfiguration$yAxis yAxis <- newPlotObject$plotConfiguration$yAxis - eval(parseVariableToObject("yAxis", c("limits", "scale", "ticks", "ticklabels", "font"), keepIfNull = TRUE)) + eval(parseVariableToObject("yAxis", c("limits", "scale", "ticks", "ticklabels", "font", "expand"), keepIfNull = TRUE)) newPlotObject <- yAxis$updatePlot(newPlotObject, xlim = newPlotObject$plotConfiguration$xAxis$limits) return(newPlotObject) } -#' @title xAxisDefaultScale -#' @description Return x-axis default scale from a plot configuration -#' @param plotConfiguration A `PlotConfiguration` object -#' @return The default scale. -#' The enum `Scaling` provides a list of available scales. -#' @examples -#' \dontrun{ -#' # Regular plots use continuous linear scale for x-axis -#' plotConfiguration <- PlotConfiguration$new() -#' xAxisDefaultScale(plotConfiguration) -#' -#' # DDI plots use log scale for x-axis -#' ddiPlotConfiguration <- DDIRatioPlotConfiguration$new() -#' xAxisDefaultScale(ddiPlotConfiguration) -#' -#' # Boxplots use discrete scale for x-axis -#' boxPlotConfiguration <- BoxWhiskerPlotConfiguration$new() -#' xAxisDefaultScale(boxPlotConfiguration) -#' } -#' @keywords internal -xAxisDefaultScale <- function(plotConfiguration) { - if (isOfType(plotConfiguration, c("DDIRatioPlotConfiguration"))) { - return(Scaling$log) - } - if (isOfType(plotConfiguration, c("BoxWhiskerPlotConfiguration"))) { - return(Scaling$discrete) - } - return(Scaling$lin) -} - -#' @title yAxisDefaultScale -#' @description Return y-axis default scale from a plot configuration -#' @param plotConfiguration A `PlotConfiguration` object -#' @return The default scale. -#' The enum `Scaling` provides a list of available scales. -#' @examples -#' \dontrun{ -#' # Regular plots use continuous linear scale for x-axis -#' plotConfiguration <- PlotConfiguration$new() -#' yAxisDefaultScale(plotConfiguration) -#' -#' # DDI plots use log scale for y-axis -#' ddiPlotConfiguration <- DDIRatioPlotConfiguration$new() -#' yAxisDefaultScale(ddiPlotConfiguration) -#' -#' # Tornado plots use discrete scale for y-axis -#' tornadoPlotConfiguration <- TornadoPlotConfiguration$new() -#' yAxisDefaultScale(tornadoPlotConfiguration) -#' } -#' @keywords internal -yAxisDefaultScale <- function(plotConfiguration) { - if (isOfType(plotConfiguration, c("PKRatioPlotConfiguration", "DDIRatioPlotConfiguration"))) { - return(Scaling$log) - } - if (isOfType(plotConfiguration, c("TornadoPlotConfiguration"))) { - return(Scaling$discrete) - } - return(Scaling$lin) -} #' @title getLogTickLabels #' @description Get ticklabels expressions for log scale plots diff --git a/man/AxisConfiguration.Rd b/man/AxisConfiguration.Rd index c6ffaa1d..bf9531aa 100644 --- a/man/AxisConfiguration.Rd +++ b/man/AxisConfiguration.Rd @@ -20,6 +20,10 @@ A value of \code{NULL} is allowed and will lead to a default linear scale} \item{\code{ticklabels}}{function or values defining the axis tick labels} \item{\code{font}}{\code{Font} object defining the font of the ticklabels} + +\item{\code{expand}}{logical defining if data is expanded until axis. +If \code{TRUE}, data is expanded until axis +If \code{FALSE}, some space between data and axis is kept} } \if{html}{\out{}} } @@ -28,6 +32,7 @@ A value of \code{NULL} is allowed and will lead to a default linear scale} \itemize{ \item \href{#method-new}{\code{AxisConfiguration$new()}} \item \href{#method-ggplotScale}{\code{AxisConfiguration$ggplotScale()}} +\item \href{#method-ggplotExpansion}{\code{AxisConfiguration$ggplotExpansion()}} \item \href{#method-prettyTicks}{\code{AxisConfiguration$prettyTicks()}} \item \href{#method-prettyTickLabels}{\code{AxisConfiguration$prettyTickLabels()}} \item \href{#method-clone}{\code{AxisConfiguration$clone()}} @@ -44,7 +49,8 @@ Create a new \code{AxisConfiguration} object scale = Scaling$lin, ticks = NULL, ticklabels = NULL, - font = NULL + font = NULL, + expand = FALSE )}\if{html}{\out{}} } @@ -61,6 +67,10 @@ Use enum \code{Scaling} to access predefined scales.} \item{\code{ticklabels}}{character vector or function defining what to print on axis ticks} \item{\code{font}}{\code{Font} object defining the font of ticklabels} + +\item{\code{expand}}{logical defining if data is expanded until axis. +If \code{TRUE}, data is expanded until axis +If \code{FALSE}, some space between data and axis is kept} } \if{html}{\out{}} } @@ -82,6 +92,19 @@ A character included in \code{ggplot2} available \code{trans} names } } \if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-ggplotExpansion}{}}} +\subsection{Method \code{ggplotExpansion()}}{ +Get the \code{ggplot2} actual function for expansion +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{AxisConfiguration$ggplotExpansion()}\if{html}{\out{
}} +} + +\subsection{Returns}{ +A \code{ggplot2} function +} +} +\if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-prettyTicks}{}}} \subsection{Method \code{prettyTicks()}}{ diff --git a/man/BoxWhiskerPlotConfiguration.Rd b/man/BoxWhiskerPlotConfiguration.Rd index 754e074c..127c5727 100644 --- a/man/BoxWhiskerPlotConfiguration.Rd +++ b/man/BoxWhiskerPlotConfiguration.Rd @@ -20,6 +20,13 @@ Other PlotConfiguration classes: \section{Super class}{ \code{\link[tlf:PlotConfiguration]{tlf::PlotConfiguration}} -> \code{BoxWhiskerPlotConfiguration} } +\section{Public fields}{ +\if{html}{\out{
}} +\describe{ +\item{\code{defaultXScale}}{Default xAxis scale value when creating a \code{BoxWhiskerPlotConfiguration} object} +} +\if{html}{\out{
}} +} \section{Active bindings}{ \if{html}{\out{
}} \describe{ diff --git a/man/DDIRatioPlotConfiguration.Rd b/man/DDIRatioPlotConfiguration.Rd index b4d6449b..6cebdddf 100644 --- a/man/DDIRatioPlotConfiguration.Rd +++ b/man/DDIRatioPlotConfiguration.Rd @@ -20,6 +20,17 @@ Other PlotConfiguration classes: \section{Super class}{ \code{\link[tlf:PlotConfiguration]{tlf::PlotConfiguration}} -> \code{DDIRatioPlotConfiguration} } +\section{Public fields}{ +\if{html}{\out{
}} +\describe{ +\item{\code{defaultXScale}}{Default xAxis scale value when creating a \code{DDIRatioPlotConfiguration} object} + +\item{\code{defaultYScale}}{Default yAxis scale value when creating a \code{DDIRatioPlotConfiguration} object} + +\item{\code{defaultExpand}}{Default expand value when creating a \code{DDIRatioPlotConfiguration} object} +} +\if{html}{\out{
}} +} \section{Methods}{ \subsection{Public methods}{ \itemize{ diff --git a/man/PKRatioPlotConfiguration.Rd b/man/PKRatioPlotConfiguration.Rd index b46b7fec..a0365e55 100644 --- a/man/PKRatioPlotConfiguration.Rd +++ b/man/PKRatioPlotConfiguration.Rd @@ -20,6 +20,13 @@ Other PlotConfiguration classes: \section{Super class}{ \code{\link[tlf:PlotConfiguration]{tlf::PlotConfiguration}} -> \code{PKRatioPlotConfiguration} } +\section{Public fields}{ +\if{html}{\out{
}} +\describe{ +\item{\code{defaultYScale}}{Default yAxis scale value when creating a \code{PKRatioPlotConfiguration} object} +} +\if{html}{\out{
}} +} \section{Methods}{ \subsection{Public methods}{ \itemize{ diff --git a/man/PlotConfiguration.Rd b/man/PlotConfiguration.Rd index af8fbb84..92c3314e 100644 --- a/man/PlotConfiguration.Rd +++ b/man/PlotConfiguration.Rd @@ -25,6 +25,12 @@ Other PlotConfiguration classes: \if{html}{\out{
}} \describe{ \item{\code{export}}{R6 class \code{ExportConfiguration} defining properties for saving/exporting plota} + +\item{\code{defaultXScale}}{Default xAxis scale value when creating a \code{PlotConfiguration} object} + +\item{\code{defaultYScale}}{Default yAxis scale value when creating a \code{PlotConfiguration} object} + +\item{\code{defaultExpand}}{Default expand value when creating a \code{PlotConfiguration} object} } \if{html}{\out{
}} } diff --git a/man/TornadoPlotConfiguration.Rd b/man/TornadoPlotConfiguration.Rd index 7fefb366..796031b8 100644 --- a/man/TornadoPlotConfiguration.Rd +++ b/man/TornadoPlotConfiguration.Rd @@ -28,6 +28,8 @@ Other PlotConfiguration classes: \item{\code{colorPalette}}{color palette property from \code{ggplot2}} \item{\code{dodge}}{space between the bars/points} + +\item{\code{defaultYScale}}{Default yAxis scale value when creating a \code{TornadoPlotConfiguration} object} } \if{html}{\out{
}} } diff --git a/man/XAxisConfiguration.Rd b/man/XAxisConfiguration.Rd index 6d746d67..aee9a024 100644 --- a/man/XAxisConfiguration.Rd +++ b/man/XAxisConfiguration.Rd @@ -19,6 +19,7 @@ R6 class defining the configuration of X-axis \if{html}{ \out{
Inherited methods} \itemize{ +\item \out{}\href{../../tlf/html/AxisConfiguration.html#method-ggplotExpansion}{\code{tlf::AxisConfiguration$ggplotExpansion()}}\out{} \item \out{}\href{../../tlf/html/AxisConfiguration.html#method-ggplotScale}{\code{tlf::AxisConfiguration$ggplotScale()}}\out{} \item \out{}\href{../../tlf/html/AxisConfiguration.html#method-initialize}{\code{tlf::AxisConfiguration$initialize()}}\out{} \item \out{}\href{../../tlf/html/AxisConfiguration.html#method-prettyTickLabels}{\code{tlf::AxisConfiguration$prettyTickLabels()}}\out{} diff --git a/man/YAxisConfiguration.Rd b/man/YAxisConfiguration.Rd index 28086547..bb7da7dd 100644 --- a/man/YAxisConfiguration.Rd +++ b/man/YAxisConfiguration.Rd @@ -26,6 +26,7 @@ R6 class defining the configuration of Y-axis \if{html}{ \out{
Inherited methods} \itemize{ +\item \out{}\href{../../tlf/html/AxisConfiguration.html#method-ggplotExpansion}{\code{tlf::AxisConfiguration$ggplotExpansion()}}\out{} \item \out{}\href{../../tlf/html/AxisConfiguration.html#method-ggplotScale}{\code{tlf::AxisConfiguration$ggplotScale()}}\out{} \item \out{}\href{../../tlf/html/AxisConfiguration.html#method-initialize}{\code{tlf::AxisConfiguration$initialize()}}\out{} \item \out{}\href{../../tlf/html/AxisConfiguration.html#method-prettyTickLabels}{\code{tlf::AxisConfiguration$prettyTickLabels()}}\out{} diff --git a/man/setXAxis.Rd b/man/setXAxis.Rd index f64d3873..22281f67 100644 --- a/man/setXAxis.Rd +++ b/man/setXAxis.Rd @@ -10,7 +10,8 @@ setXAxis( limits = NULL, ticks = NULL, ticklabels = NULL, - font = NULL + font = NULL, + expand = NULL ) } \arguments{ @@ -25,6 +26,8 @@ setXAxis( \item{ticklabels}{Optional values or function for axis ticklabels} \item{font}{A \code{Font} object defining font of ticklabels} + +\item{expand}{Logical defining if data is expanded until axis} } \value{ A \code{ggplot} object diff --git a/man/setYAxis.Rd b/man/setYAxis.Rd index c79ca8c9..2658e9b8 100644 --- a/man/setYAxis.Rd +++ b/man/setYAxis.Rd @@ -10,7 +10,8 @@ setYAxis( limits = NULL, ticks = NULL, ticklabels = NULL, - font = NULL + font = NULL, + expand = NULL ) } \arguments{ @@ -25,6 +26,8 @@ setYAxis( \item{ticklabels}{Optional values or function for axis ticklabels} \item{font}{A \code{Font} object defining font of ticklabels} + +\item{expand}{Logical defining if data is expanded until axis} } \value{ A \code{ggplot} object diff --git a/man/xAxisDefaultScale.Rd b/man/xAxisDefaultScale.Rd deleted file mode 100644 index de91674e..00000000 --- a/man/xAxisDefaultScale.Rd +++ /dev/null @@ -1,34 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/utilities-axis.R -\name{xAxisDefaultScale} -\alias{xAxisDefaultScale} -\title{xAxisDefaultScale} -\usage{ -xAxisDefaultScale(plotConfiguration) -} -\arguments{ -\item{plotConfiguration}{A \code{PlotConfiguration} object} -} -\value{ -The default scale. -The enum \code{Scaling} provides a list of available scales. -} -\description{ -Return x-axis default scale from a plot configuration -} -\examples{ -\dontrun{ -# Regular plots use continuous linear scale for x-axis -plotConfiguration <- PlotConfiguration$new() -xAxisDefaultScale(plotConfiguration) - -# DDI plots use log scale for x-axis -ddiPlotConfiguration <- DDIRatioPlotConfiguration$new() -xAxisDefaultScale(ddiPlotConfiguration) - -# Boxplots use discrete scale for x-axis -boxPlotConfiguration <- BoxWhiskerPlotConfiguration$new() -xAxisDefaultScale(boxPlotConfiguration) -} -} -\keyword{internal} diff --git a/man/yAxisDefaultScale.Rd b/man/yAxisDefaultScale.Rd deleted file mode 100644 index 2833aa42..00000000 --- a/man/yAxisDefaultScale.Rd +++ /dev/null @@ -1,34 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/utilities-axis.R -\name{yAxisDefaultScale} -\alias{yAxisDefaultScale} -\title{yAxisDefaultScale} -\usage{ -yAxisDefaultScale(plotConfiguration) -} -\arguments{ -\item{plotConfiguration}{A \code{PlotConfiguration} object} -} -\value{ -The default scale. -The enum \code{Scaling} provides a list of available scales. -} -\description{ -Return y-axis default scale from a plot configuration -} -\examples{ -\dontrun{ -# Regular plots use continuous linear scale for x-axis -plotConfiguration <- PlotConfiguration$new() -yAxisDefaultScale(plotConfiguration) - -# DDI plots use log scale for y-axis -ddiPlotConfiguration <- DDIRatioPlotConfiguration$new() -yAxisDefaultScale(ddiPlotConfiguration) - -# Tornado plots use discrete scale for y-axis -tornadoPlotConfiguration <- TornadoPlotConfiguration$new() -yAxisDefaultScale(tornadoPlotConfiguration) -} -} -\keyword{internal}