Skip to content

Commit f3a292d

Browse files
committed
Apply non-range props from layout to transition
1 parent 0221c79 commit f3a292d

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

src/plots/plots.js

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ plots.fontWeight = 'normal';
3434
var subplotsRegistry = plots.subplotsRegistry;
3535
var transformsRegistry = plots.transformsRegistry;
3636

37-
3837
var ErrorBars = require('../components/errorbars');
3938

4039
/**
@@ -1388,6 +1387,22 @@ plots.transition = function(gd, data, layout, traceIndices, frameOpts, transitio
13881387
Lib.extendDeepNoArrays(gd.data[traceIndices[i]], update);
13891388
}
13901389

1390+
// Follow the same procedure. Clone it so we don't mangle the input, then
1391+
// expand any object paths so we can merge deep into gd.layout:
1392+
var layoutUpdate = Lib.expandObjectPaths(Lib.extendDeepNoArrays({}, layout));
1393+
1394+
// Before merging though, we need to modify the incoming layout. We only
1395+
// know how to *transition* layout ranges, so it's imperative that a new
1396+
// range not be sent to the layout before the transition has started. So
1397+
// we must remove the things we can transition:
1398+
var axisAttrRe = /^[xy]axis[0-9]*$/;
1399+
for(var attr in layoutUpdate) {
1400+
if(!axisAttrRe.test(attr)) continue;
1401+
delete layoutUpdate[attr].range;
1402+
}
1403+
1404+
Lib.extendDeepNoArrays(gd.layout, layoutUpdate);
1405+
13911406
// Supply defaults after applying the incoming properties. Note that any attempt
13921407
// to simplify this step and reduce the amount of work resulted in the reconstruction
13931408
// of essentially the whole supplyDefaults step, so that it seems sensible to just use

0 commit comments

Comments
 (0)