Skip to content
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

fix group domain #271

Closed
wants to merge 4 commits into from
Closed

fix group domain #271

wants to merge 4 commits into from

Conversation

Fil
Copy link
Contributor

@Fil Fil commented Mar 24, 2021

compute the scaled coordinates of bars (and cell) before filtering, allowing NaN, null and undefined as (ordinal) classes
groups respect the domain option

fixes #52
fixes #45
fixes #255

@Fil Fil requested a review from mbostock March 24, 2021 14:35
Co-authored-by: Mike Bostock <mbostock@gmail.com>
Comment on lines +90 to +91
for (const [y, fy] of groups(I, Y, ydefined, ydomain)) {
for (const [x, f] of groups(fy, X, xdefined, xdomain)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’ve been thinking about this a little more, and I think it makes more sense that the corresponding scale’s domain drive which groups are shown, rather than needing to pass the domain explicitly to the group transform. I think this means that we should remove any filtering here, and just group all the data, and then we simply won’t show the resulting marks (e.g., bar will filter it out using maybeCoords).

This now intersects with the “grand unification” of group and reduce I’ve been working on, so I’ll try to merge these two PRs.

@mbostock
Copy link
Member

We’ll need to think through how to apply this more generally. This problem isn’t specific to bars — it applies whenever an ordinal scale is in play, which could be with any mark.

@mbostock mbostock mentioned this pull request Mar 25, 2021
10 tasks
Fil added a commit that referenced this pull request Mar 27, 2021
…llowing NaN, null and undefined as (ordinal) classes

groups respect the domain option

fixes #52
fixes #45
fixes #255
supersedes #271
@Fil
Copy link
Contributor Author

Fil commented Mar 29, 2021

superseded by #280

@Fil Fil closed this Mar 29, 2021
@Fil Fil deleted the fil/fix-group branch March 29, 2021 07:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment