-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
More optimization for cartesian subplots #2487
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
Changes from 2 commits
928ff6d
a2c5c3d
49177a2
8cf99a6
5307125
4059764
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -124,31 +124,20 @@ exports.lsInner = function(gd) { | |
|
||
var xDomain = plotinfo.xaxis.domain; | ||
var yDomain = plotinfo.yaxis.domain; | ||
var plotgroupBgData = []; | ||
var plotgroup = plotinfo.plotgroup; | ||
var plotgroupBg; | ||
|
||
if(overlappingDomain(xDomain, yDomain, lowerDomains)) { | ||
plotgroupBgData = [0]; | ||
} | ||
else { | ||
var pgNode = plotgroup.node(); | ||
plotgroupBg = plotinfo.bg = Lib.ensureSingle(plotgroup, 'rect', 'bg'); | ||
pgNode.insertBefore(plotgroupBg.node(), pgNode.childNodes[0]); | ||
} else { | ||
plotgroupBg = plotgroup.select('rect,bg'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice catch. I guess that means we have some untested code branches in there 😡 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
maybe, maybe not. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed in 5307125 |
||
if(plotgroupBg.size()) plotgroupBg.remove(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. does this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. that |
||
|
||
lowerBackgroundIDs.push(subplot); | ||
lowerDomains.push([xDomain, yDomain]); | ||
} | ||
|
||
// create the plot group backgrounds now, since | ||
// they're all independent selections | ||
var plotgroupBg = plotinfo.plotgroup.selectAll('.bg') | ||
.data(plotgroupBgData); | ||
|
||
plotgroupBg.enter().append('rect') | ||
.classed('bg', true); | ||
|
||
plotgroupBg.exit().remove(); | ||
|
||
plotgroupBg.each(function() { | ||
plotinfo.bg = plotgroupBg; | ||
var pgNode = plotinfo.plotgroup.node(); | ||
pgNode.insertBefore(this, pgNode.childNodes[0]); | ||
}); | ||
}); | ||
|
||
// now create all the lower-layer backgrounds at once now that | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK... this is the only caller using
doTicks(gd, '')
right? From the logic below it looks like there may have been one previously (or someone just callingdoTicks(gd)
) but I don't see it now. I'm a little reticent to add new branches insidedoTicks
when what we really need to do is unpack it into more digestible pieces - but that's probably a project for another time refactoring all ofaxes.js
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's correct.