Skip to content

Commit f56dff8

Browse files
committed
attr trace type should inherit from actual trace type
1 parent f85a9dd commit f56dff8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

R/ggplotly.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -930,7 +930,7 @@ gg2list <- function(p, width = NULL, height = NULL,
930930
l$attrs <- setNames(mappingFormulas, ids)
931931
l$attrs <- lapply(l$attrs, function(x) structure(x, class = "plotly_eval"))
932932
# the build step removes the first attrs if no type exists
933-
l$attrs[[1]][["type"]] <- "ggplotly"
933+
l$attrs[[1]][["type"]] <- l$data[[1]][["type"]] %||% "scatter"
934934

935935
l$cur_data <- ids[[layerData]]
936936
l$visdat <- setNames(lapply(return_dat, function(x) function(y) x), ids)

0 commit comments

Comments
 (0)