diff --git a/R/plotly_build.R b/R/plotly_build.R index 0f768a8654..2cf5de65aa 100644 --- a/R/plotly_build.R +++ b/R/plotly_build.R @@ -1026,6 +1026,11 @@ has_fill <- function(trace) { # ensure we've set a sensible trace defaults # based on the trace type coerce_attr_defaults <- function(trace, layout) { + # if user has specified stroke, make sure the span + # defaults to something greater than 0 (so they can see the stroke!) + if (length(trace[["stroke"]]) && !is.default(trace[["stroke"]])) { + trace$span <- trace[["span"]] %||% default(I(1)) + } if (trace[["type"]] %in% c("sunburst", "pie")) { # As of v1.46.1, paper_bgcolor defaults to '#fff' which # col2rgb() can't parse, but expands to '#ffffff' diff --git a/tests/figs/colorscales/contour-alpha.svg b/tests/figs/colorscales/contour-alpha.svg index 0a33f583d4..bb059e9d83 100644 --- a/tests/figs/colorscales/contour-alpha.svg +++ b/tests/figs/colorscales/contour-alpha.svg @@ -1 +1 @@ -010203040506001020304050607080100120140160180 +010203040506001020304050607080100120140160180 diff --git a/tests/figs/plotly-color/plotly-color-box-color-stroke.svg b/tests/figs/plotly-color/plotly-color-box-color-stroke.svg index 2353eaf57d..5368178b47 100644 --- a/tests/figs/plotly-color/plotly-color-box-color-stroke.svg +++ b/tests/figs/plotly-color/plotly-color-box-color-stroke.svg @@ -1 +1 @@ -AB−1.5−1−0.500.511.52ABxy +AB−1.5−1−0.500.511.52ABxy