-
Notifications
You must be signed in to change notification settings - Fork 1
Fix inconsistent legend aesthetics #63
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
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -27,12 +27,12 @@ | |||
| #' @param geomErrorbarAttributes A `list` with arguments which are passed on to the call `ggplot2::geom_errorbar` | ||||
| #' @param geomLLOQAttributes A `list` with arguments which are passed on to the call `ggplot2::geom_hline` | ||||
| #' @param groupAesthetics vector of aesthetics, which are used for columns mapped with `groupby`, | ||||
| #' @param xScale either 'linear' then `ggplot2::scale_x_continuous()` or 'log' then `ggplot2::scale_x_log10()` is used | ||||
| #' @param xScaleArgs list of arguments passed to `ggplot2::scale_x_continuous()` or `ggplot2::scale_x_log10()` | ||||
| #' @param yScale either 'linear' then `ggplot2::scale_y_continuous()` or 'log' then `ggplot2::scale_y_log10()` is used | ||||
| #' @param yScaleArgs list of arguments passed to `ggplot2::scale_y_continuous()` or `ggplot2::scale_y_log10()` | ||||
| #' @param y2Scale either 'linear' the secondary axis is displayed linear, or 'log' secondary axis is displayed with log scale | ||||
| #' @param y2ScaleArgs list of arguments passed to `ggplot2::sec_axis()`, trans, break are set by code | ||||
| #' @param xscale either 'linear' then `ggplot2::scale_x_continuous()` or 'log' then `ggplot2::scale_x_log10()` is used | ||||
| #' @param xscale.args list of arguments passed to `ggplot2::scale_x_continuous()` or `ggplot2::scale_x_log10()` | ||||
| #' @param yscale either 'linear' then `ggplot2::scale_y_continuous()` or 'log' then `ggplot2::scale_y_log10()` is used | ||||
| #' @param yscale.args list of arguments passed to `ggplot2::scale_y_continuous()` or `ggplot2::scale_y_log10()` | ||||
| #' @param y2scale either 'linear' the secondary axis is displayed linear, or 'log' secondary axis is displayed with log scale | ||||
| #' @param y2scale.args list of arguments passed to `ggplot2::sec_axis()`, trans, break are set by code | ||||
| #' | ||||
| #' @return A `ggplot` object | ||||
| #' @examples | ||||
|
|
@@ -65,31 +65,57 @@ plotTimeProfile <- function(data = NULL, # nolint | |||
| observedMapping = mapping, | ||||
| metaData = NULL, | ||||
| mapSimulatedAndObserved = NULL, | ||||
| xScale = AxisScales$linear, | ||||
| xScaleArgs = list(limits = c(0, NA)), | ||||
| yScale = AxisScales$linear, | ||||
| yScaleArgs = list(), | ||||
| y2Scale = AxisScales$linear, | ||||
| y2ScaleArgs = list(), | ||||
| xscale = AxisScales$linear, | ||||
| xscale.args = list(limits = c(0, NA)), | ||||
| yscale = AxisScales$linear, | ||||
| yscale.args = list(), | ||||
| y2scale = AxisScales$linear, | ||||
| y2scale.args = list(), | ||||
| plotObject = NULL, | ||||
| geomLineAttributes = getDefaultGeomAttributes("Line"), | ||||
| geomRibbonAttributes = getDefaultGeomAttributes("Ribbon"), | ||||
| geomPointAttributes = getDefaultGeomAttributes("Point"), | ||||
| geomErrorbarAttributes = getDefaultGeomAttributes("Errorbar"), | ||||
| geomLLOQAttributes = getDefaultGeomAttributes("LLOQ"), | ||||
| groupAesthetics = c("colour", "fill", "shape")) { | ||||
| groupAesthetics = c("colour", "fill", "shape"), | ||||
| xScale = NULL, | ||||
| xScaleArgs = NULL, | ||||
| yScale = NULL, | ||||
| yScaleArgs = NULL, | ||||
| y2Scale = NULL, | ||||
| y2ScaleArgs = NULL) { | ||||
| # Handle backward compatibility for camelCase parameter names | ||||
| if (!is.null(xScale)) { | ||||
| xscale <- xScale | ||||
| } | ||||
| if (!is.null(xScaleArgs)) { | ||||
| xscale.args <- xScaleArgs | ||||
| } | ||||
| if (!is.null(yScale)) { | ||||
| yscale <- yScale | ||||
| } | ||||
| if (!is.null(yScaleArgs)) { | ||||
| yscale.args <- yScaleArgs | ||||
| } | ||||
| if (!is.null(y2Scale)) { | ||||
| y2scale <- y2Scale | ||||
| } | ||||
| if (!is.null(y2ScaleArgs)) { | ||||
| y2scale.args <- y2ScaleArgs | ||||
| } | ||||
|
|
||||
|
||||
Outdated
Copilot
AI
Dec 18, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inconsistent parameter name format in roxygen documentation. The parameter is documented as 'y2scale.args' (dot.case) but should be 'y2ScaleArgs' (camelCase) to comply with OSP R coding standards.
Outdated
Copilot
AI
Dec 18, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incorrect parameter description: 'yscale.args' is described as 'list with y2scale arguments' when it should describe arguments for the primary y-axis scale, not the secondary y2-axis. Additionally, the parameter name should follow camelCase convention (yScaleArgs) per OSP coding standards.
Outdated
Copilot
AI
Dec 18, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Parameter name in return value documentation uses dot.case format 'yscale.args' which violates OSP R coding standards requiring camelCase naming (should be 'yScaleArgs').
Copilot
AI
Dec 18, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code block creates a single-element list for one aesthetic inside a loop over multiple groupAesthetics. This approach differs from the similar code at lines 191-200 which correctly uses lapply to create guides for all aesthetics at once. Consider refactoring to match that pattern for consistency and to avoid repeatedly calling guides() inside the loop.
Copilot
AI
Jan 6, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code creates a guides list for simulated data when it should be creating one for observed data. The title says 'Simulated' but this section is meant to set up the observed data legend before adding new scale. The title should be 'Observed' and the order should be 1, not 2.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The parameter names in the roxygen documentation have been changed from camelCase (xScale, xScaleArgs, etc.) to dot.case (xscale, xscale.args, etc.). However, this violates the OSP R coding standards which specify that function and variable names should use camelCase. While backward compatibility is maintained through deprecated parameters, the new primary parameter names should follow the established camelCase convention.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with copilot