-
Notifications
You must be signed in to change notification settings - Fork 186
Could Plot.auto make the Simpsons cell heatmap? #1672
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
Comments
would it be mark: "cell", or "interval: 1" (which it should then do in both dimensions) |
I think this is a straight-up bug, not the intended behavior. I believe the code assumes that if we’re using the rect mark, that there’s a color reducer (and hence that x and y are binned). But that isn’t the case in the provided snippet. Here are some options that I don’t immediately reject:
To me (1) choosing cell instead of mark is likely the easiest fix and seems like the place to start. I think it’s this line here, but you have to check whether a colorReduce was specified. Line 134 in 16c75f4
(I think we’d still chose cell if a sizeReduce was specified? But the inputs don’t make much sense since the bar mark doesn’t support a size encoding.) I would not introduce a cell mark option as @Fil suggested. A big value-add of the auto mark is that the differences between the rect marks are ignorable and in the chart cell we wouldn’t want the user to choose between cell and bar (and rect). |
Selecting a bar override on "season" vs "number_in_season" makes a bunch of zero-width, zero-height rects (and a working tooltip with some extraneous intervals): https://observablehq.com/d/58a592d7a3c97fc8
I wish it made this:
If there's no reducer / no binning by which to give the rects extent, could we infer that we could treat x and y as discrete and use cell instead? Though maybe that'd be brittle; it'd kinda depend on the numbers being evenly spaced.
The text was updated successfully, but these errors were encountered: