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 5010de0

Browse filesBrowse files
committed
track axes w/ autorange:true / altered ranges during react diffing
- to (in next commit) efficiently compute axis range transitions - potentially target axis range react update (like we currently do in relayout)
1 parent 78c3840 commit 5010de0
Copy full SHA for 5010de0

File tree

1 file changed

+14
-1
lines changed
Filter options

1 file changed

+14
-1
lines changed

‎src/plot_api/plot_api.js

Copy file name to clipboardExpand all lines: src/plot_api/plot_api.js
+14-1Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2466,6 +2466,8 @@ function diffData(gd, oldFullData, newFullData, immutable) {
24662466
function diffLayout(gd, oldFullLayout, newFullLayout, immutable) {
24672467
var flags = editTypes.layoutFlags();
24682468
flags.arrays = {};
2469+
flags.rangesAltered = {};
2470+
flags.autorangedAxes = {};
24692471

24702472
function getLayoutValObject(parts) {
24712473
return PlotSchema.getLayoutValObject(newFullLayout, parts);
@@ -2503,6 +2505,11 @@ function getDiffFlags(oldContainer, newContainer, outerparts, opts) {
25032505
return;
25042506
}
25052507
editTypes.update(flags, valObject);
2508+
2509+
// track cartesian axes with altered ranges
2510+
if(AX_RANGE_RE.test(astr) || AX_AUTORANGE_RE.test(astr)) {
2511+
flags.rangesAltered[outerparts[0]] = 1;
2512+
}
25062513
}
25072514

25082515
function valObjectCanBeDataArray(valObject) {
@@ -2515,6 +2522,13 @@ function getDiffFlags(oldContainer, newContainer, outerparts, opts) {
25152522

25162523
var oldVal = oldContainer[key];
25172524
var newVal = newContainer[key];
2525+
var parts = outerparts.concat(key);
2526+
astr = parts.join('.');
2527+
2528+
// track auto-ranged cartesian axes, changed or not
2529+
if(AX_AUTORANGE_RE.test(astr) && newVal === true) {
2530+
flags.autorangedAxes[outerparts[0]] = 1;
2531+
}
25182532

25192533
if(key.charAt(0) === '_' || typeof oldVal === 'function' || oldVal === newVal) continue;
25202534

@@ -2530,7 +2544,6 @@ function getDiffFlags(oldContainer, newContainer, outerparts, opts) {
25302544
if(key === 'range' && newContainer.autorange) continue;
25312545
if((key === 'zmin' || key === 'zmax') && newContainer.type === 'contourcarpet') continue;
25322546

2533-
var parts = outerparts.concat(key);
25342547
valObject = getValObject(parts);
25352548

25362549
// in case type changed, we may not even *have* a valObject.

0 commit comments

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