@@ -1125,6 +1125,7 @@ plots.supplyTraceDefaults = function(traceIn, traceOut, colorIndex, layout, trac
1125
1125
// we want even invisible traces to make their would-be subplots visible
1126
1126
// so coerce the subplot id(s) now no matter what
1127
1127
var _module = plots . getModule ( traceOut ) ;
1128
+
1128
1129
traceOut . _module = _module ;
1129
1130
if ( _module ) {
1130
1131
var basePlotModule = _module . basePlotModule ;
@@ -1158,9 +1159,21 @@ plots.supplyTraceDefaults = function(traceIn, traceOut, colorIndex, layout, trac
1158
1159
}
1159
1160
}
1160
1161
1162
+ function coerceUnlessPruned ( attr , dflt , cb ) {
1163
+ if ( _module && ( attr in _module . attributes ) && _module . attributes [ attr ] === undefined ) {
1164
+ // Pruned
1165
+ } else {
1166
+ if ( cb && typeof cb === 'function' ) {
1167
+ cb ( ) ;
1168
+ } else {
1169
+ coerce ( attr , dflt ) ;
1170
+ }
1171
+ }
1172
+ }
1173
+
1161
1174
if ( visible ) {
1162
- coerce ( 'customdata' ) ;
1163
- coerce ( 'ids' ) ;
1175
+ coerceUnlessPruned ( 'customdata' ) ;
1176
+ coerceUnlessPruned ( 'ids' ) ;
1164
1177
1165
1178
if ( Registry . traceIs ( traceOut , 'showLegend' ) ) {
1166
1179
traceOut . _dfltShowLegend = true ;
@@ -1171,14 +1184,12 @@ plots.supplyTraceDefaults = function(traceIn, traceOut, colorIndex, layout, trac
1171
1184
traceOut . _dfltShowLegend = false ;
1172
1185
}
1173
1186
1174
- if ( _module && ( 'hoverlabel' in _module . attributes ) && _module . attributes . hoverlabel === undefined ) {
1175
- // Do not coerce hoverlabel
1176
- } else {
1187
+ coerceUnlessPruned ( 'hoverlabel' , '' , function ( ) {
1177
1188
Registry . getComponentMethod (
1178
1189
'fx' ,
1179
1190
'supplyDefaults'
1180
1191
) ( traceIn , traceOut , defaultColor , layout ) ;
1181
- }
1192
+ } ) ;
1182
1193
1183
1194
// TODO add per-base-plot-module trace defaults step
1184
1195
0 commit comments