You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The easy fix is to change the last row of this to use rectY instead of rect, on the theory that Plot.auto never has enough information to use Plot.rect effectively:
We could change that bit. But, moreover, the heatmap example shows that Plot.auto does sometimes have enough information to specify a rect mark: in the case of 2D binning. So just switching rect to rectY feels wrong.
The text was updated successfully, but these errors were encountered:
tophtucker
changed the title
Auto: bar override fails for non-additive reducers
Auto mark: no display with non-zero reducer and bar mark
Mar 15, 2023
The only difference between rect and rectY is that rectY gives you an implicit stackY transform and defaults y to the identity transform. So, if you’re supply y1 and y2 anyway, which the bin transform will do, there is no difference between rect and rectY. So I think it will be acceptable to use rectY here.
Regarding the zero baseline issue, maybe the answer is to address the TODO to move the zero-ness determination into autoSpec, rather than splitting the defaults into two places. You’ll have to rewrite the logic to be based more on “first principles” than the concrete mark type, but that might end up being a cleaner expression of the desired logic besides.
See examples. You get a bunch of zero-height bars:
The easy fix is to change the last row of this to use rectY instead of rect, on the theory that Plot.auto never has enough information to use Plot.rect effectively:
plot/src/marks/auto.js
Lines 159 to 174 in c489290
That works in this case:
But it breaks the heatmap, because it gives it a zero baseline:
Because we're inferring whether to show the zero baseline from the mark type:
plot/src/marks/auto.js
Lines 217 to 220 in c489290
We could change that bit. But, moreover, the heatmap example shows that Plot.auto does sometimes have enough information to specify a rect mark: in the case of 2D binning. So just switching rect to rectY feels wrong.
The text was updated successfully, but these errors were encountered: