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

Refine “high cardinality” warning #1668

Merged
merged 1 commit into from
Jun 2, 2023
Merged

Conversation

Fil
Copy link
Contributor

@Fil Fil commented Jun 2, 2023

The intent of this “high cardinality” warning (as specified here) is the following: when a mark only¹ makes sense with grouping—currently area, line, linearRegression and density—, we want to warn when the number of groups (G.size) is higher than the smallest possible number of meaningful groups, which is I.length >> 1 (obtained when the groups are pairs).

However when there is an odd number of elements, having 1 element that falls out is to be expected and should not invalidate the chart.

Closes #1667

¹ It's not a hard rule: the areaY mark with a stroke, the lineY mark with a marker, and the density mark tolerate single points. But these are not the default usage.

…61 (comment))) is the following: when a mark only¹ makes sense with grouping—currently area, line, linearRegression and density—, we want to warn when the number of groups (G.size) is higher than the smallest possible number of _meaningful_ groups, which is I.length >> 1 (obtained when the groups are pairs).

However when there is an odd number of elements, having 1 element that falls out is to be expected and should not invalidate the chart.

Closes #1667

¹ It's not a hard rule: the areaY mark with a stroke, the lineY mark with a marker, and the density mark tolerate single points. But these are not the default usage.
@Fil Fil requested a review from mbostock June 2, 2023 05:44
@Fil Fil enabled auto-merge (squash) June 2, 2023 05:46
Copy link
Member

@mbostock mbostock left a comment

Choose a reason for hiding this comment

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

Nice!

@Fil Fil merged commit de76f93 into main Jun 2, 2023
@Fil Fil deleted the fil/refine-cardinality-warning branch June 2, 2023 15:36
Fil added a commit that referenced this pull request Aug 21, 2023
chaichontat pushed a commit to chaichontat/plot that referenced this pull request Jan 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

spurious "high cardinality" warning
2 participants