Skip to content
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

Clean subplots #2227

Merged
merged 17 commits into from
Jan 3, 2018
Merged
Changes from 1 commit
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
10 changes: 5 additions & 5 deletions src/plots/cartesian/layout_defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut, fullData) {
yaListCartesian = [],
xaListGl2d = [],
yaListGl2d = [],
xaListCheater = [],
xaListNonCheater = [],
xaCheater = {},
xaNonCheater = {},
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice 🐎

outerTicks = {},
noGrids = {},
i;
Expand All @@ -57,15 +57,15 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut, fullData) {
// 1. is not carpet
// 2. carpet that's not cheater
if(!Registry.traceIs(trace, 'carpet') || (trace.type === 'carpet' && !trace._cheater)) {
if(xaName) Lib.pushUnique(xaListNonCheater, xaName);
if(xaName) xaNonCheater[xaName] = 1;
}

// The above check for definitely-not-cheater is not adequate. This
// second list tracks which axes *could* be a cheater so that the
// full condition triggering hiding is:
// *could* be a cheater and *is not definitely visible*
if(trace.type === 'carpet' && trace._cheater) {
if(xaName) Lib.pushUnique(xaListCheater, xaName);
if(xaName) xaCheater[xaName] = 1;
}

// add axes implied by traces
Expand Down Expand Up @@ -186,7 +186,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut, fullData) {
data: fullData,
bgColor: bgColor,
calendar: layoutOut.calendar,
cheateronly: axLetter === 'x' && (xaListCheater.indexOf(axName) !== -1 && xaListNonCheater.indexOf(axName) === -1)
cheateronly: axLetter === 'x' && (xaCheater[axName] && !xaNonCheater[axName])
};

handleAxisDefaults(axLayoutIn, axLayoutOut, coerce, defaultOptions, layoutOut);
Expand Down