File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -136,6 +136,10 @@ plotly_build.plotly <- function(p, registerFrames = TRUE) {
136
136
trace <- verify_type(trace )
137
137
# verify orientation of boxes/bars
138
138
trace <- verify_orientation(trace )
139
+ # supply sensible defaults based on trace type
140
+ trace <- coerce_attr_defaults(trace )
141
+
142
+
139
143
140
144
# attach crosstalk info, if necessary
141
145
if (crosstalk_key() %in% names(dat ) && isTRUE(trace [[" inherit" ]] %|| % TRUE )) {
@@ -1022,3 +1026,12 @@ has_fill <- function(trace) {
1022
1026
if (has_fillcolor && isTRUE(fill != " none" )) return (TRUE )
1023
1027
FALSE
1024
1028
}
1029
+
1030
+ # ensure we've set a sensible trace defaults
1031
+ # based on the trace type
1032
+ coerce_attr_defaults <- function (trace ) {
1033
+ if (identical(trace [[" type" ]], " sunburst" )) {
1034
+ trace $ stroke <- trace [[" stroke" ]] %|| % I(" white" )
1035
+ }
1036
+ trace
1037
+ }
You can’t perform that action at this time.
0 commit comments