Skip to content

Commit b095320

Browse files
committed
Try to avoid redundant text in legend entries
1 parent a15b9cc commit b095320

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

R/plotly_build.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ plotly_build.plotly <- function(p) {
149149
isSplit <- names(builtData) %in% "linetype" |
150150
!isAsIs & isDiscrete & names(builtData) %in% c("symbol", "color")
151151
if (any(isSplit)) {
152-
paste2 <- function(x, y) paste(x, y, sep = "<br>")
152+
paste2 <- function(x, y) if (identical(x, y)) x else paste(x, y, sep = "<br />")
153153
builtData[[".plotlyTraceIndex"]] <- Reduce(paste2, builtData[isSplit])
154154
}
155155
# Build the index used to determine grouping (later on, NAs are inserted
@@ -329,7 +329,7 @@ map_size <- function(traces) {
329329
}
330330
allSize <- unlist(compact(sizeList))
331331
if (!is.null(allSize) && is.discrete(allSize)) {
332-
stop("Size must be mapped to a numeric variable",
332+
stop("Size must be mapped to a numeric variable\n",
333333
"symbols only make sense for discrete variables", call. = FALSE)
334334
}
335335
sizeRange <- range(allSize, na.rm = TRUE)

0 commit comments

Comments
 (0)