-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
scattergl errorbars fixes #2620
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
Conversation
- for example, when 'x' array is given (i.e. the x0/dx case) or when numeric string are inputted.
src/traces/scattergl/convert.js
Outdated
var calcFromTrace = Registry.getComponentMethod('errorbars', 'calcFromTrace'); | ||
var vals = calcFromTrace(trace, gd._fullLayout); | ||
var count = positions.length / 2; | ||
var _trace = Lib.extendFlat({}, trace, {x: x, y: y}); |
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.
This seems weird to me - putting arrays of calcdata
values into a fake trace. I don't know if category or date data would make any sense in this context but if we were to support them this would break.
This is the only caller of calcFromTrace
, right? Can we just pass in the x and y calc'ed arrays separately from the trace?
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.
Good call. Using calcFromTrace
made things very dry 🌴 but added a lot of overhead and many (many) object creations. So yeah good riddance 🔪 -> 82290a2
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 nice - that's more of a refactor than I was expecting but you're right, much better. 🌴 before, but as well as the 🐎 overhead, the scaffolding meant it didn't even really result in shorter code.
- this should be a performance boost as we no longer mock calcdata item
src/traces/scattergl/convert.js
Outdated
var opts = trace['error_' + axLetter]; | ||
|
||
if(opts && opts.visible && (ax.type === 'linear' || ax.type === 'log')) { | ||
var computeError = makeComputeError(trace['error_' + axLetter]); |
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.
makeComputeError(opts)
?
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.
good eye!
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.
-> 7e77bb4
Very nice! 💃 after the minor comment above. |
Fixes #2600 and the last item off #2450 (comment) (x errorbars aren't supported?).
Does not attempt to fix the on-relayout issue of #2450 (comment) nor the incorrect errorbar layering order described in #2450, @dy will take care of them once he finishes his
regl-component
module.cc @alexcjohnson