diff --git a/NAMESPACE b/NAMESPACE index ec1fd23ced..9fe5f8e0d5 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -27,6 +27,7 @@ S3method(layout,matrix) S3method(layout,plotly) S3method(layout,shiny.tag.list) S3method(linewidth_or_size,Geom) +S3method(linewidth_or_size,default) S3method(linewidth_or_size,element) S3method(plotly_build,"NULL") S3method(plotly_build,gg) diff --git a/R/layers2traces.R b/R/layers2traces.R index 124d2fd595..dedd8d9d43 100644 --- a/R/layers2traces.R +++ b/R/layers2traces.R @@ -1136,6 +1136,11 @@ linewidth_or_size.element <- function(x) { if ("linewidth" %in% names(x)) "linewidth" else "size" } +#' @export +linewidth_or_size.default <- function(x) { + if (get_package_version("ggplot2") >= "3.4") "linewidth" else "size" +} + # Convert R pch point codes to plotly "symbol" codes. pch2symbol <- function(x) {