@@ -112,6 +112,7 @@ exports.get = function() {
112
112
* @param {String } attrName name string
113
113
* @param {object[] } attrs all the attributes
114
114
* @param {Number } level the recursion level, 0 at the root
115
+ * @param {String } fullAttrString full attribute name (ie 'marker.line')
115
116
* @param {Number } [specifiedLevel]
116
117
* The level in the tree, in order to let the callback function detect descend or backtrack,
117
118
* typically unsupplied (implied 0), just used by the self-recursive call.
@@ -460,11 +461,22 @@ function getTraceAttributes(type) {
460
461
// make 'type' the first attribute in the object
461
462
attributes . type = null ;
462
463
464
+
465
+ var copyBaseAttributes = extendDeepAll ( { } , baseAttributes ) ;
466
+ var copyModuleAttributes = extendDeepAll ( { } , _module . attributes ) ;
467
+
468
+ // prune global-level trace attributes that are already defined in a trace
469
+ exports . crawl ( copyModuleAttributes , function ( attr , attrName , attrs , level , fullAttrString ) {
470
+ Lib . nestedProperty ( copyBaseAttributes , fullAttrString ) . set ( undefined ) ;
471
+ // Prune undefined attributes
472
+ if ( attr === undefined ) Lib . nestedProperty ( copyModuleAttributes , fullAttrString ) . set ( undefined ) ;
473
+ } ) ;
474
+
463
475
// base attributes (same for all trace types)
464
- extendDeepAll ( attributes , baseAttributes ) ;
476
+ extendDeepAll ( attributes , copyBaseAttributes ) ;
465
477
466
478
// module attributes
467
- extendDeepAll ( attributes , _module . attributes ) ;
479
+ extendDeepAll ( attributes , copyModuleAttributes ) ;
468
480
469
481
// subplot attributes
470
482
if ( basePlotModule . attributes ) {
0 commit comments