Skip to content

Commit b0aa596

Browse files
committed
format hovertext & include PANEL in tooltip data
1 parent 515498e commit b0aa596

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

R/layers2traces.R

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -226,18 +226,18 @@ to_basic.GeomBoxplot <- function(data, prestats_data, layout, params, p, ...) {
226226
dplyr::mutate(
227227
# TODO:
228228
# (1) respect tooltip argument
229-
# (2) include varwidth and/or notch information?
229+
# (2) include varwidth and/or notch information, if relevant
230230
hovertext = paste(
231-
paste("Max:", ymax),
232-
paste("Upper:", upper),
233-
paste("Middle:", middle),
234-
paste("Lower:", lower),
235-
paste("Min:", ymin),
231+
paste("Max:", format(ymax)),
232+
paste("Upper:", format(upper)),
233+
paste("Middle:", format(middle)),
234+
paste("Lower:", format(lower)),
235+
paste("Min:", format(ymin)),
236236
sep = br()
237237
),
238238
alpha = 0
239239
) %>%
240-
dplyr::select(x, y = middle, hovertext, alpha, colour)
240+
dplyr::select(PANEL, x, y = middle, hovertext, alpha, fill)
241241

242242
# If boxplot has notches, it needs to drawn as a polygon (instead of a crossbar/rect)
243243
# This code is adapted from GeomCrossbar$draw_panel()

0 commit comments

Comments
 (0)