File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -132,6 +132,8 @@ is_subplot <- function(p) {
132
132
}
133
133
134
134
supply_defaults <- function (p ) {
135
+ # no need to supply defaults for subplots
136
+ if (is_subplot(p )) return (p )
135
137
# supply trace anchor defaults
136
138
anchors <- if (is_geo(p )) c(" geo" = " geo" ) else if (is_mapbox(p )) c(" subplot" = " mapbox" ) else c(" xaxis" = " x" , " yaxis" = " y" )
137
139
@@ -207,6 +209,9 @@ verify_boxed <- function(p) {
207
209
thisTrace <- p $ x $ data [[tr ]]
208
210
validAttrs <- Schema $ traces [[thisTrace $ type %|| % " scatter" ]]$ attributes
209
211
p $ x $ data [[tr ]] <- verify_box(thisTrace , validAttrs )
212
+ # prevent these objects from sending null keys
213
+ p $ x $ data [[tr ]][[" xaxis" ]] <- p $ x $ data [[tr ]][[" xaxis" ]] %|| % NULL
214
+ p $ x $ data [[tr ]][[" yaxis" ]] <- p $ x $ data [[tr ]][[" yaxis" ]] %|| % NULL
210
215
}
211
216
p $ x $ layout $ updatemenus
212
217
Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ s <- subplot(
86
86
)
87
87
88
88
test_that(" Row/column height/width" , {
89
- l <- expect_traces(s , 3 , " width-height" )
89
+ l <- expect_traces(s , 4 , " width-height" )
90
90
expect_equal(diff(l $ layout $ xaxis $ domain ), 0.8 - 0.005 )
91
91
expect_equal(diff(l $ layout $ xaxis2 $ domain ), 0.2 - 0.005 )
92
92
expect_equal(diff(l $ layout $ yaxis $ domain ), 0.2 - 0.005 )
You can’t perform that action at this time.
0 commit comments