Skip to content

Commit 68a6a96

Browse files
committed
loop over register subplot types to coerce their subplot attr
1 parent 6d35c48 commit 68a6a96

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/plots/plots.js

+10-6
Original file line numberDiff line numberDiff line change
@@ -664,15 +664,19 @@ plots.supplyDataDefaults = function(traceIn, traceIndex, layout) {
664664
coerce('type');
665665
coerce('uid');
666666

667-
// this is necessary otherwise we lose references to scene objects when
668-
// the traces of a scene are invisible. Also we handle visible/unvisible
669-
// differently for 3D cases.
670-
coerceSubplotAttr('gl3d', 'scene');
671-
coerceSubplotAttr('geo', 'geo');
672-
coerceSubplotAttr('ternary', 'subplot');
667+
// coerce subplot attributes of all registered subplot types
668+
var subplotTypes = Object.keys(subplotsRegistry);
669+
for(var i = 0; i < subplotTypes.length; i++) {
670+
var subplotType = subplotTypes[i];
673671

672+
// done below (only when visible is true)
673+
// TODO unified this pattern
674+
if(['cartesian', 'gl2d'].indexOf(subplotType) !== -1) continue;
674675

676+
var attr = subplotsRegistry[subplotType].attr;
675677

678+
if(attr) coerceSubplotAttr(subplotType, attr);
679+
}
676680

677681
if(visible) {
678682
var _module = plots.getModule(traceOut);

0 commit comments

Comments
 (0)