Skip to content

Commit 7233419

Browse files
committed
require ggplot2 >= 2.1
1 parent 95bbdb5 commit 7233419

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

DESCRIPTION

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Description: Easily translate ggplot2 graphs to an interactive web-based version
2020
URL: https://plot.ly/r, https://github.com/ropensci/plotly
2121
BugReports: https://github.com/ropensci/plotly/issues
2222
Depends:
23-
ggplot2 (>= 2.0.0)
23+
ggplot2 (>= 2.1.0)
2424
Imports:
2525
scales,
2626
httr,

R/layers2traces.R

+3-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,9 @@ layers2traces <- function(data, prestats_data, layers, layout, scales, labels) {
8585
# name in the legend entries
8686
lab <- labels[legendVars]
8787
vals <- key[paste0(legendVars, "_domain")]
88-
valz <- Map(function(x, y) { paste0(x, ": ", y) }, lab, vals)
88+
valz <- Map(function(x, y) {
89+
if (nchar(x) > 0) paste0(x, ": ", y) else y
90+
}, lab, vals)
8991
entries <- Reduce(function(x, y) {
9092
if (identical(x, y)) x else paste0(x, "<br>", y)
9193
}, valz)

0 commit comments

Comments
 (0)