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: apply bandPosition to offset channel for grouped bar (so band size works with grouped bars) #9178

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

kanitw
Copy link
Member

@kanitw kanitw commented Nov 16, 2023

fix #9177

See the fixed example

cc: @richardliu-db

: isRelativeBandSize(bandSize)
? (1 - bandSize.band) / 2
: 0
bandPosition: offsetType === 'encoding' ? 0 : bandPosition
Copy link
Contributor

@richardliu-db richardliu-db Nov 16, 2023

Choose a reason for hiding this comment

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

I tested different combinations of center and offsetType, and found that this is not consistent with the old version.

The bandPosition used by defaultRef is signal-relative value in the old implementation, but 0 in the new implementation, when center is false and offsetType check is true.

This nested ternary expression is already very complex. Consider making it a function and testing it in unit test.

Copy link
Contributor

@richardliu-db richardliu-db left a comment

Choose a reason for hiding this comment

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

Left one comment regarding the behavior inconsistency.

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.

Discrete band size doesn't work with grouped bar
2 participants