Skip to content

Trying matching and scaling #5196

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions src/plots/cartesian/constraints.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,7 @@ exports.handleConstraintDefaults = function(containerIn, containerOut, coerce, o
// 'matches' wins over 'scaleanchor' (for now)
var scaleanchor, scaleOpts;

if(!matches &&
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alexcjohnson so I loosened this check, but I also had to remove the check below ... is this a belt-and-suspenders situation? If I restore the check below such that we only remove scale if it's the same letter as matches, does that seem sufficient?

!(containerOut.fixedrange && constrain !== 'domain') &&
(containerIn.scaleanchor || scaleanchorDflt)
) {
if(containerIn.scaleanchor || scaleanchorDflt) {
scaleOpts = getConstraintOpts(constraintGroups, thisID, allAxisIds, layoutOut, constrain);
scaleanchor = Lib.coerce(containerIn, containerOut, {
scaleanchor: {
Expand Down
21 changes: 0 additions & 21 deletions src/plots/cartesian/layout_defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
}
}
}
}
};