Skip to content

Commit b554bdd

Browse files
committed
make sure index is a character before performing lookup, fixes #650
1 parent 715e036 commit b554bdd

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
@@ -533,7 +533,7 @@ map_symbol <- function(traces) {
533533
palette <- setNames(symbols[seq_len(N)], unique(symbol))
534534
for (i in which(nSymbols > 0)) {
535535
s <- symbolList[[i]]
536-
symbols <- pch2symbol(if (inherits(s, "AsIs")) s else as.character(palette[s]))
536+
symbols <- pch2symbol(if (inherits(s, "AsIs")) s else as.character(palette[as.character(s)]))
537537
illegalSymbols <- setdiff(symbols, validSymbols)
538538
if (length(illegalSymbols)) {
539539
warning(
@@ -581,7 +581,7 @@ map_linetype <- function(traces) {
581581
palette <- setNames(linetypes[seq_len(N)], unique(linetype))
582582
for (i in which(nLinetypes > 0)) {
583583
l <- linetypeList[[i]]
584-
dashes <- lty2dash(if (inherits(l, "AsIs")) l else as.character(palette[l]))
584+
dashes <- lty2dash(if (inherits(l, "AsIs")) l else as.character(palette[as.character(l)]))
585585
illegalLinetypes <- setdiff(dashes, validLinetypes)
586586
if (length(illegalLinetypes)) {
587587
warning(

0 commit comments

Comments
 (0)