Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit cf6e5db

Browse filesBrowse files
committed
Clear inputDomain in diffLayout
1 parent ca6a886 commit cf6e5db
Copy full SHA for cf6e5db

File tree

Expand file treeCollapse file tree

1 file changed

+23
-5
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+23
-5
lines changed

‎src/plot_api/plot_api.js

Copy file name to clipboardExpand all lines: src/plot_api/plot_api.js
+23-5Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2811,6 +2811,29 @@ function diffLayout(gd, oldFullLayout, newFullLayout, immutable, transition) {
28112811
return PlotSchema.getLayoutValObject(newFullLayout, parts);
28122812
}
28132813

2814+
// Clear out any _inputDomain that's no longer valid
2815+
for (var key in newFullLayout) {
2816+
if (!key.startsWith('xaxis') && !key.startsWith('yaxis')) {
2817+
continue;
2818+
}
2819+
if (!oldFullLayout[key]) {
2820+
continue;
2821+
}
2822+
var newDomain = newFullLayout[key].domain;
2823+
var oldDomain = oldFullLayout[key].domain;
2824+
var oldInputDomain = oldFullLayout[key]._inputDomain;
2825+
if (oldFullLayout[key]._inputDomain) {
2826+
if (newDomain[0] === oldInputDomain[0] && newDomain[1] === oldInputDomain[1]) {
2827+
// what you're asking for hasn't changed, so let plotly.js start with what it
2828+
// concluded last time and iterate from there
2829+
newFullLayout[key].domain = oldFullLayout[key].domain;
2830+
} else if (newDomain[0] !== oldDomain[0] || newDomain[1] !== oldDomain[1]) {
2831+
// what you're asking for HAS changed, so clear _inputDomain and let us start from scratch
2832+
newFullLayout[key]._inputDomain = null;
2833+
}
2834+
}
2835+
}
2836+
28142837
var diffOpts = {
28152838
getValObject: getLayoutValObject,
28162839
flags: flags,
@@ -2863,11 +2886,6 @@ function getDiffFlags(oldContainer, newContainer, outerparts, opts) {
28632886
flags.rangesAltered[outerparts[0]] = 1;
28642887
}
28652888

2866-
// clear _inputDomain on cartesian axes with altered domains
2867-
if(AX_DOMAIN_RE.test(astr)) {
2868-
nestedProperty(newContainer, '_inputDomain').set(null);
2869-
}
2870-
28712889
// track datarevision changes
28722890
if(key === 'datarevision') {
28732891
flags.newDataRevision = 1;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.