Skip over placeholder calc traces in bar set positions #1369
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fixes #1310
In bar calc, bars with non-numeric positions are not included in the resulting
gd.calcdata
(ref). Later inPlots.doCalcdata
, those skipped bars are given a placeholder calcdata item (ref) to ensure that all calc traces have as many items their corresponding fullData traces (see dd05c6e for more onplaceholder
calcdata items).These placeholder calc items contain
x: false, y: false
, which throws off the bar min-difference here; hence the 🐛 . In details,false
is coerced to0
inLib.distinctVals
so essentiallywas treated essentially the same way as
which leads to large errors especially when
data[0]
has date positions (which are stored in datetimes at the set position step) as reported in #1310.In brief, the fix is easy, simply skip over
placeholder
calc traces during bar set positions.