Skip to content

Commit

Permalink
fixed plot_raw function
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberosa committed Apr 7, 2024
1 parent 1cea5b5 commit 4ea2e6c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
6 changes: 1 addition & 5 deletions R/002_plot_api.R
Original file line number Diff line number Diff line change
Expand Up @@ -120,16 +120,12 @@ plot_raw <- function(dabest_effectsize_obj, float_contrast, plot_kwargs) {
df_for_proportion_bar <- create_dfs_for_proportion_bar(proportion_success, bar_width = raw_bar_width)
}

## Adjustment of labels ##
if (ggplot2::as_label(enquo_colour) == "NULL" && main_plot_type != "slope") {
enquo_colour <- enquo_x
}

#### Initialise raw_plot & Add main_plot_type component ####
output <- initialize_raw_plot(plot_kwargs, plot_components, dabest_effectsize_obj, df_for_proportion_bar, sankey_df, sankey_bars, idx, float_contrast)
raw_plot <- output[[1]]
raw_y_range <- output[[2]]
raw_y_min <- output[[3]]
x_axis_raw <- output[[4]]

#### Add tufte lines component ####
if (is_tufte_lines) {
Expand Down
7 changes: 6 additions & 1 deletion R/002_plot_utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,11 @@ initialize_raw_plot <- function(plot_kwargs, plot_components, dabest_effectsize_
raw_flow_alpha <- plot_kwargs$raw_flow_alpha
main_plot_type <- plot_components$main_plot_type
is_summary_lines <- plot_components$is_summary_lines

## Adjustment of labels ##
if (ggplot2::as_label(enquo_colour) == "NULL" && main_plot_type != "slope") {
enquo_colour <- enquo_x
}

# sankey params
if (!is.null(sankey_df)) {
Expand Down Expand Up @@ -368,7 +373,7 @@ initialize_raw_plot <- function(plot_kwargs, plot_components, dabest_effectsize_
)
)
}
return(list(raw_plot, raw_y_range, raw_y_min))
return(list(raw_plot, raw_y_range, raw_y_min, x_axis_raw))
}

adjust_x_axis_in_delta_plot <- function(delta_plot, main_plot_type, flow, idx, x, delta_y_min, delta_y_mean) {
Expand Down

0 comments on commit 4ea2e6c

Please sign in to comment.