Skip to content

Commit 701fe5f

Browse files
committed
Resolve conflicts with test branch
Merge branch 'test' into 318021-default-analysis-params # Conflicts: # DESCRIPTION # NEWS.md
2 parents 780dbbf + 31f8032 commit 701fe5f

File tree

3 files changed

+23
-10
lines changed

3 files changed

+23
-10
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: dv.papo
22
Title: Patient Profile
3-
Version: 2.1.1-9000
3+
Version: 2.1.1-9002
44
Authors@R:
55
c(person("Boehringer-Ingelheim Pharma GmbH & Co.KG", role = c("cph", "fnd")),
66
person(given = "Korbinian",

NEWS.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
1-
# dv.papo 2.1.1-9000
1+
# dv.papo 2.1.1-9002
22

33
- Add `default_analysis_params` argument documentation (previously missed out)
44

5+
# dv.papo 2.1.1-9001
6+
7+
- Fixed issue where setting analysis_indicator to NULL caused loss of plot legend.
8+
9+
# dv.papo 2.1.1-9000
10+
11+
- Fixed issue with plot displays when POSIXt date-time variables used for the timeline limits.
12+
513
# dv.papo 2.1.1
614

715
- Remove early error feedback for trt_end is NA

R/mod_plots.R

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -158,19 +158,19 @@ patient_plot_server <- function(id, subject_var,
158158
# Compute plots ----
159159

160160
timeline_limits <- local({ # start...end, but takes icf and part_end dates into account if available
161-
min_total <- subject_level_dataset[[timeline_info[["trt_start_date"]]]]
161+
min_total <- sl_info[["trt_start_date"]]
162162
if ("icf_date" %in% names(timeline_info)) {
163-
icf_date <- subject_level_dataset[[timeline_info[["icf_date"]]]]
163+
icf_date <- sl_info[["icf_date"]]
164164
if (is.finite(icf_date)) min_total <- icf_date
165165
}
166166

167167
max_total <- as.Date(-Inf)
168-
trt_end_date <- subject_level_dataset[[timeline_info[["trt_end_date"]]]]
168+
trt_end_date <- sl_info[["trt_end_date"]]
169169
if (is.finite(trt_end_date)) {
170170
max_total <- trt_end_date
171171
}
172172
if ("part_end_date" %in% names(timeline_info)) {
173-
part_end_date <- subject_level_dataset[[timeline_info[["part_end_date"]]]]
173+
part_end_date <- sl_info[["part_end_date"]]
174174
if (is.finite(part_end_date)) max_total <- part_end_date
175175
}
176176
if (!is.finite(max_total)) max_total <- Sys.Date()
@@ -180,10 +180,11 @@ patient_plot_server <- function(id, subject_var,
180180

181181
x_limits <- local({ # we need to compute combined limits first because ggplot+plotly need them before layout calculation
182182
# the +/-1 avoids clipping the left and right arrows on the plot
183-
diff <- timeline_limits[[2]] - timeline_limits[[1]]
184-
offset_left <- min(-1L, round(-diff / 10))
185-
offset_right <- max(1L, round(diff / 10))
186-
c(timeline_limits[[1]] + offset_left, timeline_limits[[2]] + offset_right)
183+
timeline_limit_lower <- timeline_limits[[1]]
184+
timeline_limit_upper <- timeline_limits[[2]]
185+
diff <- timeline_limit_upper - timeline_limit_lower
186+
offset <- max(1L, round(diff / 10))
187+
c(timeline_limit_lower - offset, timeline_limit_upper + offset)
187188
})
188189

189190
plot_list <- local({
@@ -423,6 +424,10 @@ patient_plot_server <- function(id, subject_var,
423424
heights = heights / sum(heights)
424425
)
425426

427+
# Force legend visibility after subplot construction, since by default
428+
# if any plot does not have a legend then combined plot loses legend.
429+
plots$x$layout$showlegend <- TRUE
430+
426431
x_limits_z <- x_limits - sl_info[["trt_start_date"]]
427432
plots <- silence_warning(
428433
plotly::layout(plots, height = sum(heights), xaxis = list(range = x_limits_z)),

0 commit comments

Comments
 (0)