-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Recycled commits from abandoned fast trace toggle PRs #2860
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 1 commit
69dc0c4
41ad08a
9c8ba02
8ef5cb3
cf0b19d
9cc5fbe
dfada6a
be44366
ad1ac1f
769c160
736ab69
6194457
8cd06ae
2a745de
82d4bcc
29db388
72f06a6
a0bfaf3
33b4085
d233f3b
89aebd1
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 |
---|---|---|
|
@@ -86,23 +86,26 @@ function setPositionOffset(traceType, gd, boxList, posAxis, pad) { | |
// check for forced minimum dtick | ||
Axes.minDtick(posAxis, boxdv.minDiff, boxdv.vals[0], true); | ||
|
||
// set the width of all boxes | ||
for(i = 0; i < boxList.length; i++) { | ||
calcTrace = calcdata[boxList[i]]; | ||
calcTrace[0].t.dPos = dPos; | ||
} | ||
|
||
var gap = fullLayout[traceType + 'gap']; | ||
var groupgap = fullLayout[traceType + 'groupgap']; | ||
var padfactor = (1 - gap) * (1 - groupgap) * dPos / fullLayout[numKey]; | ||
|
||
// autoscale the x axis - including space for points if they're off the side | ||
// TODO: this will overdo it if the outermost boxes don't have | ||
// their points as far out as the other boxes | ||
Axes.expand(posAxis, boxdv.vals, { | ||
var extremes = Axes.findExtremes(posAxis, boxdv.vals, { | ||
vpadminus: dPos + pad[0] * padfactor, | ||
vpadplus: dPos + pad[1] * padfactor | ||
}); | ||
|
||
for(i = 0; i < boxList.length; i++) { | ||
calcTrace = calcdata[boxList[i]]; | ||
// set the width of all boxes | ||
calcTrace[0].t.dPos = dPos; | ||
// link extremes to all boxes | ||
calcTrace[0].trace._extremes[posAxis._id] = extremes; | ||
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. same question as for bars... can we just put these extremes in the first one? 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. ... for consistency I'm leaning on voting for making all traces have an |
||
} | ||
|
||
} | ||
|
||
module.exports = { | ||
|
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.
Now that we're not trying to make
_extremes
survive visibility changes, does it actually help to have the same thing repeated in all traces here? Seems like that will just waste time later on. Can we just put it in the first one and clear all the others?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.
Thanks for pointing this out, but turns out we still need to attach
_extremes
to all bar traces at the moment for error bars. Error bars concat their min/max extremes into thetrace._extremes
in which they are linked and assume thattrace._extremes[ax._id]
exists.We could alternatively linked error bar
_extremes
in theirtrace.error_(x|y)
containers and makegetAutorange
look forerror_(x|y)
in each trace. Or perhaps, making error bar createtrace._extremes[ax._id]
containers when needed would suffice.But, I wouldn't worry too much about performance. I can't imagine
getAutorange
taking more than 1ms even in the worse of scenario.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.
Ah OK. I suppose the first one could have the actual values, then all the others could just get
[]
to give something for errorbars to append to... but yeah, no big deal, no block. These extras will get pruned quickly during your improved_concat
that I hadn't noticed when I made that comment.