@@ -27,6 +27,9 @@ var editTypes = require('./edit_types');
2727var extendFlat = Lib . extendFlat ;
2828var extendDeepAll = Lib . extendDeepAll ;
2929var isPlainObject = Lib . isPlainObject ;
30+ var isArrayOrTypedArray = Lib . isArrayOrTypedArray ;
31+ var nestedProperty = Lib . nestedProperty ;
32+ var valObjectMeta = Lib . valObjectMeta ;
3033
3134var IS_SUBPLOT_OBJ = '_isSubplotObj' ;
3235var IS_LINKED_TO_ARRAY = '_isLinkedToArray' ;
@@ -65,7 +68,7 @@ exports.get = function() {
6568
6669 return {
6770 defs : {
68- valObjects : Lib . valObjectMeta ,
71+ valObjects : valObjectMeta ,
6972 metaKeys : UNDERSCORE_ATTRS . concat ( [ 'description' , 'role' , 'editType' , 'impliedEdits' ] ) ,
7073 editType : {
7174 traces : editTypes . traces ,
@@ -204,19 +207,19 @@ exports.findArrayAttributes = function(trace) {
204207 var item = container [ stack [ i ] ] ;
205208 var newAstrPartial = astrPartial + stack [ i ] ;
206209 if ( i === stack . length - 1 ) {
207- if ( Lib . isArrayOrTypedArray ( item ) ) {
210+ if ( isArrayOrTypedArray ( item ) ) {
208211 arrayAttributes . push ( baseAttrName + newAstrPartial ) ;
209212 }
210213 } else {
211214 if ( isArrayStack [ i ] ) {
212215 if ( Array . isArray ( item ) ) {
213216 for ( var j = 0 ; j < item . length ; j ++ ) {
214- if ( Lib . isPlainObject ( item [ j ] ) ) {
217+ if ( isPlainObject ( item [ j ] ) ) {
215218 crawlIntoTrace ( item [ j ] , i + 1 , newAstrPartial + '[' + j + '].' ) ;
216219 }
217220 }
218221 }
219- } else if ( Lib . isPlainObject ( item ) ) {
222+ } else if ( isPlainObject ( item ) ) {
220223 crawlIntoTrace ( item , i + 1 , newAstrPartial + '.' ) ;
221224 }
222225 }
@@ -463,9 +466,9 @@ function getTraceAttributes(type) {
463466
464467 // prune global-level trace attributes that are already defined in a trace
465468 exports . crawl ( copyModuleAttributes , function ( attr , attrName , attrs , level , fullAttrString ) {
466- Lib . nestedProperty ( copyBaseAttributes , fullAttrString ) . set ( undefined ) ;
469+ nestedProperty ( copyBaseAttributes , fullAttrString ) . set ( undefined ) ;
467470 // Prune undefined attributes
468- if ( attr === undefined ) Lib . nestedProperty ( copyModuleAttributes , fullAttrString ) . set ( undefined ) ;
471+ if ( attr === undefined ) nestedProperty ( copyModuleAttributes , fullAttrString ) . set ( undefined ) ;
469472 } ) ;
470473
471474 // base attributes (same for all trace types)
@@ -597,7 +600,7 @@ function getTransformAttributes(type) {
597600
598601function getFramesAttributes ( ) {
599602 var attrs = {
600- frames : Lib . extendDeepAll ( { } , frameAttributes )
603+ frames : extendDeepAll ( { } , frameAttributes )
601604 } ;
602605
603606 formatAttributes ( attrs ) ;
@@ -699,15 +702,15 @@ function assignPolarLayoutAttrs(layoutAttributes) {
699702}
700703
701704function handleBasePlotModule ( layoutAttributes , _module , astr ) {
702- var np = Lib . nestedProperty ( layoutAttributes , astr ) ;
705+ var np = nestedProperty ( layoutAttributes , astr ) ;
703706 var attrs = extendDeepAll ( { } , _module . layoutAttributes ) ;
704707
705708 attrs [ IS_SUBPLOT_OBJ ] = true ;
706709 np . set ( attrs ) ;
707710}
708711
709712function insertAttrs ( baseAttrs , newAttrs , astr ) {
710- var np = Lib . nestedProperty ( baseAttrs , astr ) ;
713+ var np = nestedProperty ( baseAttrs , astr ) ;
711714
712715 np . set ( extendDeepAll ( np . get ( ) || { } , newAttrs ) ) ;
713716}
0 commit comments