Skip to content

Commit 55b47f5

Browse files
committed
marker.line.color is now transparent by default
1 parent b6555ab commit 55b47f5

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

R/plotly_build.R

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -435,12 +435,12 @@ map_color <- function(traces, title = "", na.color = "transparent") {
435435
hasMarker[[i]] <- TRUE
436436
} else {
437437
# scatter3d supports data arrays for color
438-
traces[[i]]$line <- modify_list(colorObj, traces[[i]]$line)
438+
traces[[i]][["line"]] <- modify_list(colorObj, traces[[i]][["line"]])
439439
traces[[i]]$marker$colorscale <- as_df(traces[[i]]$marker$colorscale)
440440
}
441441
}
442442
if (hasMarker[[i]]) {
443-
traces[[i]]$marker <- modify_list(colorObj, traces[[i]]$marker)
443+
traces[[i]][["marker"]] <- modify_list(colorObj, traces[[i]][["marker"]])
444444
traces[[i]]$marker$colorscale <- as_df(traces[[i]]$marker$colorscale)
445445
}
446446
if (hasText[[i]]) {
@@ -487,7 +487,15 @@ map_color <- function(traces, title = "", na.color = "transparent") {
487487
traces[[i]][[obj]] <- modify_list(list(fillcolor = toRGB(rgb, 0.5)), traces[[i]][[obj]])
488488
}
489489
}
490-
490+
491+
# marker.line.color (stroke) inherits from marker.color (color)
492+
# TODO: allow users to control via a `stroke`` argument
493+
# to make consistent, in "filled polygons", color -> fillcolor, stroke -> line.color
494+
for (i in seq_along(color)) {
495+
traces[[i]]$marker$line$color <-
496+
traces[[i]]$marker$line$color %||% "transparent"
497+
}
498+
491499
traces
492500
}
493501

0 commit comments

Comments
 (0)