@@ -496,37 +496,11 @@ verify_attr <- function(proposed, schema) {
496
496
}
497
497
498
498
# do the same for "sub-attributes"
499
- # TODO: should this be done recursively?
500
499
if (identical(role , " object" )) {
501
- for (attr2 in names(proposed [[attr ]])) {
502
- if (is.null(attrSchema [[attr2 ]])) next
503
-
504
- valType2 <- tryNULL(attrSchema [[attr2 ]][[" valType" ]]) %|| % " "
505
- role2 <- tryNULL(attrSchema [[attr2 ]][[" role" ]]) %|| % " "
506
- arrayOK2 <- tryNULL(attrSchema [[attr2 ]][[" arrayOk" ]]) %|| % FALSE
507
- isDataArray2 <- identical(valType2 , " data_array" )
508
-
509
- if (! isDataArray2 && ! arrayOK2 && ! identical(role2 , " object" )) {
510
- proposed [[attr ]][[attr2 ]] <- retain(proposed [[attr ]][[attr2 ]], uniq )
511
- }
512
-
513
- # ensure data_arrays of length 1 are boxed up by to_JSON()
514
- if (isDataArray2 ) {
515
- proposed [[attr ]][[attr2 ]] <- i(proposed [[attr ]][[attr2 ]])
516
- }
517
-
518
- # tag 'src-able' attributes (needed for api_create())
519
- isSrcAble2 <- ! is.null(schema [[attr ]][[paste0(attr2 , " src" )]]) &&
520
- length(proposed [[attr ]][[attr2 ]]) > 1
521
- if (isDataArray2 || isSrcAble2 ) {
522
- proposed [[attr ]][[attr2 ]] <- structure(
523
- proposed [[attr ]][[attr2 ]], apiSrc = TRUE
524
- )
525
- }
526
-
527
- }
500
+ proposed [[attr ]] <- verify_attr(proposed [[attr ]], schema [[attr ]])
528
501
}
529
502
}
503
+
530
504
proposed
531
505
}
532
506
@@ -822,7 +796,6 @@ verify_guides <- function(p) {
822
796
823
797
idx <- which(isBar )
824
798
for (i in seq_along(idx )) {
825
- # TODO: account for marker.line.colorbar
826
799
j <- idx [[i ]]
827
800
bar <- p $ x $ data [[j ]]$ marker $ colorbar
828
801
p $ x $ data [[j ]]$ marker $ colorbar $ len <- bar $ len %|| % (1 / nGuides )
0 commit comments