Skip to content

Commit e74b2cf

Browse files
authored
DS-4804 Remove the QTable class from plotly input data elements (#19)
1 parent 55f49ee commit e74b2cf

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

R/plotly.R

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,12 @@ plot_ly <- function(data = data.frame(), ..., type = NULL, name,
140140
if (!is.data.frame(data) && !crosstalk::is.SharedData(data)) {
141141
stop("First argument, `data`, must be a data frame or shared data.", call. = FALSE)
142142
}
143-
143+
if (is.data.frame(data) && nrow(data) > 0L) {
144+
qtables <- vapply(data, inherits, logical(1L), c("qTable", "QTable"))
145+
if (any(qtables))
146+
data[qtables] <- lapply(data[qtables], unclass)
147+
}
148+
144149
# "native" plotly arguments
145150
attrs <- list(...)
146151

0 commit comments

Comments
 (0)