Skip to content

Commit d19b6fb

Browse files
committed
only store labels if character
1 parent a2881ab commit d19b6fb

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

R/ggplotly.R

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,12 @@ gg2list <- function(p){
311311
ax.list$title <- if(length(scale.i)){
312312
sc <- p$scales$scales[[scale.i]]
313313
trace.order.list[[xy]] <- sc$limits
314-
trace.name.map[sc$breaks] <- sc$labels
314+
if(is.character(sc$breaks)){
315+
if(is.character(sc$labels)){
316+
trace.name.map[sc$breaks] <- sc$labels
317+
}
318+
##TODO: if(is.function(sc$labels)){
319+
}
315320
if (is.null(sc$breaks)) {
316321
ax.list$showticklabels <- FALSE
317322
ax.list$showgrid <- FALSE

0 commit comments

Comments
 (0)