Skip to content

Commit ab1dcb3

Browse files
committed
cleanup if-visible block(s):
- rm obsolete '|| scene' condition - merge multiple if-visible into one
1 parent 6344fa4 commit ab1dcb3

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

src/plots/plots.js

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -658,9 +658,7 @@ plots.supplyDataDefaults = function(traceIn, i, layout) {
658658

659659
// module-independent attributes
660660
traceOut.index = i;
661-
var visible = coerce('visible'),
662-
scene,
663-
_module;
661+
var visible = coerce('visible');
664662

665663
coerce('type');
666664
coerce('uid');
@@ -672,19 +670,20 @@ plots.supplyDataDefaults = function(traceIn, i, layout) {
672670
coerceSubplotAttr('geo', 'geo');
673671
coerceSubplotAttr('ternary', 'subplot');
674672

675-
// module-specific attributes --- note: we need to send a trace into
676-
// the 3D modules to have it removed from the webgl context.
677-
if(visible || scene) {
678-
_module = plots.getModule(traceOut);
679-
traceOut._module = _module;
680-
}
681673

682-
// gets overwritten in pie, geo and ternary modules
683-
if(visible) coerce('hoverinfo', (layout._dataLength === 1) ? 'x+y+z+text' : undefined);
684674

685-
if(_module && visible) _module.supplyDefaults(traceIn, traceOut, defaultColor, layout);
686675

687676
if(visible) {
677+
var _module = plots.getModule(traceOut);
678+
traceOut._module = _module;
679+
680+
// gets overwritten in pie, geo and ternary modules
681+
coerce('hoverinfo', (layout._dataLength === 1) ? 'x+y+z+text' : undefined);
682+
683+
// TODO add per-base-plot-module trace defaults step
684+
685+
if(_module) _module.supplyDefaults(traceIn, traceOut, defaultColor, layout);
686+
688687
coerce('name', 'trace ' + i);
689688

690689
if(!plots.traceIs(traceOut, 'noOpacity')) coerce('opacity');

0 commit comments

Comments
 (0)