Skip to content

Conversation

etpinard
Copy link
Contributor

@etpinard etpinard commented Feb 9, 2017

fixes #1310

In bar calc, bars with non-numeric positions are not included in the resulting gd.calcdata (ref). Later in Plots.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 on placeholder 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 to 0 in Lib.distinctVals so essentially

data = [{
  x: [1,2,3],
  y: [2,1,2]
}, {
  x: [null],
  y: [/* ... */]
}]

was treated essentially the same way as

data = [{
  x: [1,2,3],
  y: [2,1,2]
}, {
  x: [0],
  y: [/* ... */]
}]

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.

@etpinard etpinard added status: reviewable bug something broken labels Feb 9, 2017
@alexcjohnson
Copy link
Collaborator

💃

@etpinard etpinard merged commit 969e0af into master Feb 10, 2017
@etpinard etpinard deleted the bar-skip-placeholder-traces branch February 10, 2017 21:46
etpinard added a commit that referenced this pull request Mar 28, 2017
- see #1369
  for why that was needed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Two 'bar' traces are not showing with empty data
2 participants