@@ -453,8 +453,7 @@ function getTraceAttributes(type) {
453453 if ( type === 'area' ) {
454454 _module = { attributes : polarAreaAttrs } ;
455455 basePlotModule = { } ;
456- }
457- else {
456+ } else {
458457 _module = Registry . modules [ type ] . _module ,
459458 basePlotModule = _module . basePlotModule ;
460459 }
@@ -464,7 +463,6 @@ function getTraceAttributes(type) {
464463 // make 'type' the first attribute in the object
465464 attributes . type = null ;
466465
467-
468466 var copyBaseAttributes = extendDeepAll ( { } , baseAttributes ) ;
469467 var copyModuleAttributes = extendDeepAll ( { } , _module . attributes ) ;
470468
@@ -478,6 +476,22 @@ function getTraceAttributes(type) {
478476 // base attributes (same for all trace types)
479477 extendDeepAll ( attributes , copyBaseAttributes ) ;
480478
479+ // prune-out base attributes based on trace module categories
480+ if ( Registry . traceIs ( type , 'noOpacity' ) ) {
481+ delete attributes . opacity ;
482+ }
483+ if ( ! Registry . traceIs ( type , 'showLegend' ) ) {
484+ delete attributes . showlegend ;
485+ delete attributes . legendgroup ;
486+ }
487+ if ( Registry . traceIs ( type , 'noHover' ) ) {
488+ delete attributes . hoverinfo ;
489+ delete attributes . hoverlabel ;
490+ }
491+ if ( ! _module . selectPoints ) {
492+ delete attributes . selectedpoints ;
493+ }
494+
481495 // module attributes
482496 extendDeepAll ( attributes , copyModuleAttributes ) ;
483497
0 commit comments