From 880c87d9a8e744941b14ec704d022eb7dcb8ad03 Mon Sep 17 00:00:00 2001 From: Nicolas Kruchten Date: Tue, 6 Oct 2020 10:31:56 -0400 Subject: [PATCH 1/5] Trying matching and scaling --- src/plots/cartesian/constraints.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/plots/cartesian/constraints.js b/src/plots/cartesian/constraints.js index d3c0c138152..5347165edb1 100644 --- a/src/plots/cartesian/constraints.js +++ b/src/plots/cartesian/constraints.js @@ -57,10 +57,7 @@ exports.handleConstraintDefaults = function(containerIn, containerOut, coerce, o // 'matches' wins over 'scaleanchor' (for now) var scaleanchor, scaleOpts; - if(!matches && - !(containerOut.fixedrange && constrain !== 'domain') && - (containerIn.scaleanchor || scaleanchorDflt) - ) { + if(containerIn.scaleanchor || scaleanchorDflt) { scaleOpts = getConstraintOpts(constraintGroups, thisID, allAxisIds, layoutOut, constrain); scaleanchor = Lib.coerce(containerIn, containerOut, { scaleanchor: { From f51f7e95ae675dbd25e475cc6039305c341032d2 Mon Sep 17 00:00:00 2001 From: Nicolas Kruchten Date: Tue, 6 Oct 2020 11:24:32 -0400 Subject: [PATCH 2/5] Update layout_defaults.js --- src/plots/cartesian/layout_defaults.js | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/src/plots/cartesian/layout_defaults.js b/src/plots/cartesian/layout_defaults.js index 3e411ae0574..1ce678dcd29 100644 --- a/src/plots/cartesian/layout_defaults.js +++ b/src/plots/cartesian/layout_defaults.js @@ -444,26 +444,5 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut, fullData) { } axLayoutOut._matchGroup = group; } - - // remove matching axis from scaleanchor constraint groups (for now) - if(constraintGroups.length) { - for(axId in group) { - for(j = 0; j < constraintGroups.length; j++) { - var group2 = constraintGroups[j]; - for(var axId2 in group2) { - if(axId === axId2) { - Lib.warn('Axis ' + axId2 + ' is set with both ' + - 'a *scaleanchor* and *matches* constraint; ' + - 'ignoring the scale constraint.'); - - delete group2[axId2]; - if(Object.keys(group2).length < 2) { - constraintGroups.splice(j, 1); - } - } - } - } - } - } } }; From c801fb70dce63ad53b232653d5b46ead5c8b7ec3 Mon Sep 17 00:00:00 2001 From: archmoj Date: Mon, 26 Oct 2020 11:55:31 -0400 Subject: [PATCH 3/5] fixup tests --- src/plots/cartesian/layout_defaults.js | 2 +- test/jasmine/tests/axes_test.js | 87 -------------------------- 2 files changed, 1 insertion(+), 88 deletions(-) diff --git a/src/plots/cartesian/layout_defaults.js b/src/plots/cartesian/layout_defaults.js index 1ce678dcd29..5a5f0d9bffa 100644 --- a/src/plots/cartesian/layout_defaults.js +++ b/src/plots/cartesian/layout_defaults.js @@ -377,7 +377,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut, fullData) { // sets of axes linked by `scaleanchor` along with the scaleratios compounded // together, populated in handleConstraintDefaults - var constraintGroups = layoutOut._axisConstraintGroups = []; + layoutOut._axisConstraintGroups = []; // similar to _axisConstraintGroups, but for matching axes var matchGroups = layoutOut._axisMatchGroups = []; // make sure to include 'missing' axes here diff --git a/test/jasmine/tests/axes_test.js b/test/jasmine/tests/axes_test.js index ad6d2509bc5..8585b2e55fc 100644 --- a/test/jasmine/tests/axes_test.js +++ b/test/jasmine/tests/axes_test.js @@ -693,93 +693,6 @@ describe('Test axes', function() { }); }); - it('disallow constraining AND matching range', function() { - layoutIn = { - xaxis: {}, - xaxis2: {matches: 'x', scaleanchor: 'x'} - }; - layoutOut._subplots.cartesian.push('x2y'); - layoutOut._subplots.xaxis.push('x2'); - - supplyLayoutDefaults(layoutIn, layoutOut, fullData); - - expect(layoutOut.xaxis2.matches).toBe('x'); - expect(layoutOut.xaxis2.scaleanchor).toBe(undefined); - expect(layoutOut.xaxis2.constrain).toBe(undefined); - - expect(layoutOut._axisConstraintGroups).toEqual([]); - expect(layoutOut._axisMatchGroups).toEqual([{x: 1, x2: 1}]); - }); - - it('remove axes from constraint groups if they are in a match group', function() { - layoutIn = { - // this one is ok - xaxis: {}, - yaxis: {scaleanchor: 'x'}, - // this one too - xaxis2: {}, - yaxis2: {matches: 'x2'}, - // not these ones - xaxis3: {scaleanchor: 'x2'}, - yaxis3: {scaleanchor: 'y2'} - }; - layoutOut._subplots.cartesian.push('x2y2, x3y3'); - layoutOut._subplots.xaxis.push('x2', 'x3'); - layoutOut._subplots.yaxis.push('y2', 'y3'); - - supplyLayoutDefaults(layoutIn, layoutOut, fullData); - - expect(layoutOut._axisMatchGroups.length).toBe(1); - expect(layoutOut._axisMatchGroups).toContain({x2: 1, y2: 1}); - - expect(layoutOut._axisConstraintGroups.length).toBe(1); - expect(layoutOut._axisConstraintGroups).toContain({x: 1, y: 1}); - }); - - it('remove constraint group if they are one or zero items left in it', function() { - layoutIn = { - xaxis: {}, - yaxis: {matches: 'x'}, - xaxis2: {scaleanchor: 'y'} - }; - layoutOut._subplots.cartesian.push('x2y'); - layoutOut._subplots.xaxis.push('x2'); - - supplyLayoutDefaults(layoutIn, layoutOut, fullData); - - expect(layoutOut._axisMatchGroups.length).toBe(1); - expect(layoutOut._axisMatchGroups).toContain({x: 1, y: 1}); - - expect(layoutOut._axisConstraintGroups.length).toBe(0); - }); - - it('drops scaleanchor settings if either the axis or target has fixedrange', function() { - // some of these will create warnings... not too important, so not going to test, - // just want to keep the output clean - // spyOn(Lib, 'warn'); - - layoutIn = { - xaxis: {fixedrange: true, scaleanchor: 'y', scaleratio: 2}, - yaxis: {scaleanchor: 'x2', scaleratio: 3}, // only this one should survive - xaxis2: {}, - yaxis2: {scaleanchor: 'x', scaleratio: 5} - }; - layoutOut._subplots.cartesian.push('x2y2'); - layoutOut._subplots.yaxis.push('x2', 'y2'); - - supplyLayoutDefaults(layoutIn, layoutOut, fullData); - - expect(layoutOut._axisConstraintGroups).toEqual([{x2: 1, y: 3}]); - - expect(layoutOut.yaxis.scaleanchor).toBe('x2'); - expect(layoutOut.yaxis.scaleratio).toBe(3); - - ['xaxis', 'yaxis2', 'xaxis2'].forEach(function(axName) { - expect(layoutOut[axName].scaleanchor).toBeUndefined(); - expect(layoutOut[axName].scaleratio).toBeUndefined(); - }); - }); - it('drops *matches* settings if either the axis or target has fixedrange', function() { layoutIn = { xaxis: {fixedrange: true, matches: 'y'}, From c4ed5517129c4718f4bca631031440335a43ff6c Mon Sep 17 00:00:00 2001 From: archmoj Date: Mon, 26 Oct 2020 13:32:18 -0400 Subject: [PATCH 4/5] relax constraints --- src/plots/cartesian/constraints.js | 5 --- test/jasmine/tests/axes_test.js | 63 ------------------------------ 2 files changed, 68 deletions(-) diff --git a/src/plots/cartesian/constraints.js b/src/plots/cartesian/constraints.js index 5347165edb1..925aba2c05d 100644 --- a/src/plots/cartesian/constraints.js +++ b/src/plots/cartesian/constraints.js @@ -87,11 +87,6 @@ exports.handleConstraintDefaults = function(containerIn, containerOut, coerce, o if(!scaleratio) scaleratio = containerOut.scaleratio = 1; updateConstraintGroups(constraintGroups, scaleOpts.thisGroup, thisID, scaleanchor, scaleratio); - } else if(allAxisIds.indexOf(containerIn.scaleanchor) !== -1) { - Lib.warn('ignored ' + containerOut._name + '.scaleanchor: "' + - containerIn.scaleanchor + '" to avoid either an infinite loop ' + - 'and possibly inconsistent scaleratios, or because the target ' + - 'axis has fixed range or this axis declares a *matches* constraint.'); } }; diff --git a/test/jasmine/tests/axes_test.js b/test/jasmine/tests/axes_test.js index b9f5ce4190e..2cd278a42f4 100644 --- a/test/jasmine/tests/axes_test.js +++ b/test/jasmine/tests/axes_test.js @@ -591,69 +591,6 @@ describe('Test axes', function() { ]); }); - var warnTxt = ' to avoid either an infinite loop and possibly ' + - 'inconsistent scaleratios, or because the target axis has ' + - 'fixed range or this axis declares a *matches* constraint.'; - - it('breaks scaleanchor loops and drops conflicting ratios', function() { - var warnings = []; - spyOn(Lib, 'warn').and.callFake(function(msg) { - warnings.push(msg); - }); - - layoutIn = { - xaxis: {scaleanchor: 'y', scaleratio: 2}, - yaxis: {scaleanchor: 'x', scaleratio: 3}, // dropped loop - - xaxis2: {scaleanchor: 'y2', scaleratio: 5}, - yaxis2: {scaleanchor: 'x3', scaleratio: 7}, - xaxis3: {scaleanchor: 'y3', scaleratio: 9}, - yaxis3: {scaleanchor: 'x2', scaleratio: 11}, // dropped loop - - xaxis4: {scaleanchor: 'x', scaleratio: 13}, // x<->x is OK now - yaxis4: {scaleanchor: 'y', scaleratio: 17}, // y<->y is OK now - }; - layoutOut._subplots.cartesian.push('x2y2', 'x3y3', 'x4y4'); - layoutOut._subplots.yaxis.push('x2', 'x3', 'x4', 'y2', 'y3', 'y4'); - - supplyLayoutDefaults(layoutIn, layoutOut, fullData); - - expect(layoutOut._axisConstraintGroups).toEqual([ - {x: 2, y: 1, x4: 2 * 13, y4: 17}, - {x2: 5 * 7 * 9, y2: 7 * 9, y3: 1, x3: 9} - ]); - - expect(warnings).toEqual([ - 'ignored yaxis.scaleanchor: "x"' + warnTxt, - 'ignored yaxis3.scaleanchor: "x2"' + warnTxt - ]); - }); - - it('silently drops invalid scaleanchor values', function() { - var warnings = []; - spyOn(Lib, 'warn').and.callFake(function(msg) { - warnings.push(msg); - }); - - layoutIn = { - xaxis: {scaleanchor: 'x', scaleratio: 2}, // can't link to itself - this one isn't ignored... - yaxis: {scaleanchor: 'x4', scaleratio: 3}, // doesn't exist - xaxis2: {scaleanchor: 'yaxis', scaleratio: 5} // must be an id, not a name - }; - layoutOut._subplots.cartesian.push('x2y'); - layoutOut._subplots.yaxis.push('x2'); - - supplyLayoutDefaults(layoutIn, layoutOut, fullData); - - expect(layoutOut._axisConstraintGroups).toEqual([]); - expect(warnings).toEqual(['ignored xaxis.scaleanchor: "x"' + warnTxt]); - - ['xaxis', 'yaxis', 'xaxis2'].forEach(function(axName) { - expect(layoutOut[axName].scaleanchor).toBeUndefined(axName); - expect(layoutOut[axName].scaleratio).toBeUndefined(axName); - }); - }); - it('will not link axes of different types', function() { layoutIn = { xaxis: {type: 'linear'}, From 30e7f63aa9090f52b50ee43749277e6bf88a7147 Mon Sep 17 00:00:00 2001 From: archmoj Date: Mon, 26 Oct 2020 13:36:53 -0400 Subject: [PATCH 5/5] add new mock for match and scale --- test/image/baselines/match-and-scale.png | Bin 0 -> 21317 bytes test/image/mocks/match-and-scale.json | 49 +++++++++++++++++++++++ test/jasmine/tests/mock_test.js | 2 + 3 files changed, 51 insertions(+) create mode 100644 test/image/baselines/match-and-scale.png create mode 100644 test/image/mocks/match-and-scale.json diff --git a/test/image/baselines/match-and-scale.png b/test/image/baselines/match-and-scale.png new file mode 100644 index 0000000000000000000000000000000000000000..653e22ca380d148032b4428c1fefd46a31310a4b GIT binary patch literal 21317 zcmeHvby$>J+ppjtAcz865lKZsT0tpEl}1368d51K>FyE{3F$_qBnE~Ux>0&SX_Stk zbLc#40Jpy1yZ8A{pL3mS{{hzpvt~Uj?)=@q`|*>P6+d_O%Gpz=PMwpKc&Kpd6t)WH z2k#8{Po;j;z^PNTrz9VWJhj(c7$h)JoPi#$;EGb3;LDmKzDYb!cYiNyl~u2Hr{1f+ zCHE8J1*<&PJ$Wdf<(rfSH5uYRF2}rLL=1VxkDQa4JI5Zc6p$+6hZh(iY80>uH4SpC zza)^hmS}fwO)keN2QiFDu*=yj3k?k=G_Htj-<@ASDBUpa92*<^xGa1M3v%J;7n~mM z=dOngd3F4!@F@>rcX!dNwC<;{@i4z4aPU+jL=1_3j;GareER4E@XK8f3p+wjKIXyC z+3-}lPQHdmtE~z?Cl5pYoEHoG(%qkv;;CE$pPxzLJy`_ik>~z-$L# ze{3w|{|QfGU4fz&a%EA@R)5#uugb{G9J;Y#%gDq8wXs)Ii+vjq(3JWp*3&IBBO_$I zA&B9QRH?{`C#1lJuu!}q|8BoAAKlg4+cMLcmXepJu(P{6S>uJ<@$FmgZ0oC6XG)y6 z^Gt>-1w7t;!#Q@hc%QEdSHF2+BN{tCKHkyUNvENqQB%dj#wPXXQNTd4#e=hF&qh#b zsHrh?n+>U#dWBanPh+3>W)^}Aa2BuZ?t!mg<;@#r=lk=e4+jPYSROrkl;^a$sFy~` zV=gQuC8g`?s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xT8ec+8IE!iLN#G`}iVypPHT%%~N9r$Q%`HTp;Oh2Fr0WNCz%~wm*lh!z)^(R6$ z{ZuTRm#j8tDXLZ|yp|+6>`I7e1mj9>2ZDHw0aBc>e|T?Iy*=)xq_G!xyI0a$(p6GT zSCoM(y?toK(ThJUXS*1;zi91!={p_a;P7>CF%I9Fof;J3Y9ftY!3qViT7pP)0oj~% z#8E#Wwc>;lt(0%#64h^BHbnpIZ>)~N#5K%> zl^L|{m)?$EbFVH1LvIG&0fM+{VzZs$$**?n6=m@dKJ>Ij&|ztt}w{z)neu%0A4#ukHC? E0L99r;{X5v literal 0 HcmV?d00001 diff --git a/test/image/mocks/match-and-scale.json b/test/image/mocks/match-and-scale.json new file mode 100644 index 00000000000..ddd2ac29d14 --- /dev/null +++ b/test/image/mocks/match-and-scale.json @@ -0,0 +1,49 @@ +{ + "data":[ + {"type": "image", "z": [[[0, 0, 255], [255, 0, 0]], [[255, 0, 0], [0, 0, 255]]]}, + {"type": "image", "z": [[[0, 0, 255], [255, 0, 0]], [[255, 0, 0], [0, 0, 255]]], "xaxis": "x2"}, + {"type": "image", "z": [[[0, 0, 255], [255, 0, 0]], [[255, 0, 0], [0, 0, 255]]], "xaxis": "x3"}, + {"type": "image", "z": [[[0, 0, 255], [255, 0, 0]], [[255, 0, 0], [0, 0, 255]]], "yaxis": "y2"}, + {"type": "image", "z": [[[0, 0, 255], [255, 0, 0]], [[255, 0, 0], [0, 0, 255]]], "yaxis": "y3"}, + {"type": "image", "z": [[[0, 0, 255], [255, 0, 0]], [[255, 0, 0], [0, 0, 255]]], "yaxis": "y3", "xaxis": "x3"}, + {"type": "image", "z": [[[0, 0, 255], [255, 0, 0]], [[255, 0, 0], [0, 0, 255]]], "yaxis": "y2", "xaxis": "x2"} + ], + "layout":{ + "width": 600, + "height": 600, + "showlegend": false, + "xaxis": { + "scaleanchor": "y", + "constrain": "domain", + "domain": [0, 0.3] + }, + "xaxis2": { + "scaleanchor": "y", + "matches": "x", + "scaleratio": 2, + "domain": [0.35, 0.65] + }, + "xaxis3": { + "scaleanchor": "y", + "matches": "x", + "scaleratio": 1, + "domain": [0.7, 1] + }, + "yaxis": { + "constrain": "domain", + "domain": [0, 0.3] + }, + "yaxis2": { + "matches": "y", + "scaleanchor": "x", + "scaleratio": 2, + "domain": [0.35, 0.65] + }, + "yaxis3": { + "matches": "y", + "scaleanchor": "x", + "scaleratio": 1, + "domain": [0.7, 1] + } + } +} diff --git a/test/jasmine/tests/mock_test.js b/test/jasmine/tests/mock_test.js index 86825fc7e0d..d9537411036 100644 --- a/test/jasmine/tests/mock_test.js +++ b/test/jasmine/tests/mock_test.js @@ -726,6 +726,7 @@ var list = [ 'marker_colorscale_template', 'marker_line_width', 'marker_symbols', + 'match-and-scale', 'matching-categories', 'matching-missing-axes', 'mathjax', @@ -1790,6 +1791,7 @@ figs['mapbox_white-bg-style'] = require('@mocks/mapbox_white-bg-style'); figs['marker_colorscale_template'] = require('@mocks/marker_colorscale_template'); figs['marker_line_width'] = require('@mocks/marker_line_width'); figs['marker_symbols'] = require('@mocks/marker_symbols'); +figs['match-and-scale'] = require('@mocks/match-and-scale'); figs['matching-categories'] = require('@mocks/matching-categories'); // figs['matching-missing-axes'] = require('@mocks/matching-missing-axes'); // figs['mathjax'] = require('@mocks/mathjax');