@@ -496,37 +496,11 @@ verify_attr <- function(proposed, schema) {
496496 }
497497
498498 # do the same for "sub-attributes"
499- # TODO: should this be done recursively?
500499 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 ]])
528501 }
529502 }
503+
530504 proposed
531505}
532506
@@ -822,7 +796,6 @@ verify_guides <- function(p) {
822796
823797 idx <- which(isBar )
824798 for (i in seq_along(idx )) {
825- # TODO: account for marker.line.colorbar
826799 j <- idx [[i ]]
827800 bar <- p $ x $ data [[j ]]$ marker $ colorbar
828801 p $ x $ data [[j ]]$ marker $ colorbar $ len <- bar $ len %|| % (1 / nGuides )
0 commit comments