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.
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.
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.
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.
makeComputeError(opts)?
|
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-componentmodule.cc @alexcjohnson