@@ -453,8 +453,7 @@ function getTraceAttributes(type) {
453
453
if ( type === 'area' ) {
454
454
_module = { attributes : polarAreaAttrs } ;
455
455
basePlotModule = { } ;
456
- }
457
- else {
456
+ } else {
458
457
_module = Registry . modules [ type ] . _module ,
459
458
basePlotModule = _module . basePlotModule ;
460
459
}
@@ -464,7 +463,6 @@ function getTraceAttributes(type) {
464
463
// make 'type' the first attribute in the object
465
464
attributes . type = null ;
466
465
467
-
468
466
var copyBaseAttributes = extendDeepAll ( { } , baseAttributes ) ;
469
467
var copyModuleAttributes = extendDeepAll ( { } , _module . attributes ) ;
470
468
@@ -478,6 +476,22 @@ function getTraceAttributes(type) {
478
476
// base attributes (same for all trace types)
479
477
extendDeepAll ( attributes , copyBaseAttributes ) ;
480
478
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
+
481
495
// module attributes
482
496
extendDeepAll ( attributes , copyModuleAttributes ) ;
483
497
0 commit comments