diff --git a/R/ggplotly.R b/R/ggplotly.R index 0e144774ac..a1ff33225f 100644 --- a/R/ggplotly.R +++ b/R/ggplotly.R @@ -77,6 +77,7 @@ markLegends <- # Legends based on sizes not implemented yet in Plotly # list(point=c("colour", "fill", "shape", "size"), list(point=c("colour", "fill", "shape"), + hex=c("count", "density"), path=c("linetype", "size", "colour", "shape"), ## NOTE: typically "group" should not be present here, since ## that would mean creating a separate plotly legend for each diff --git a/R/trace_generation.R b/R/trace_generation.R index 5f868a6795..029634843a 100644 --- a/R/trace_generation.R +++ b/R/trace_generation.R @@ -345,6 +345,10 @@ toBasic <- list( g$data <- g$data[!is.na(g$data$y), ] g }, + hex=function(g) { + g$geom <- "point" + g + }, contour=function(g) { g$data <- g$prestats.data g @@ -609,6 +613,8 @@ geom2trace <- list( if (!is.null(params$shape) && params$shape %in% c(32)) { L$visible <- FALSE } + # for geom/stat hex + if (params$stat.type == "binhex") L$marker$symbol <- "hexagon" L }, text=function(data, params){