Skip to content

Commit

Permalink
Account for the fact that linewidth_or_size() could take non element/…
Browse files Browse the repository at this point in the history
…Geom input (like NULL)
  • Loading branch information
cpsievert committed Nov 4, 2022
1 parent 5623eec commit ecb5edf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 5 additions & 0 deletions R/layers2traces.R
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit ecb5edf

Please sign in to comment.