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: set binSuffix for defined channel #7931

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/compile/mark/encode/defined.ts
Expand Up @@ -30,7 +30,7 @@ function allFieldsInvalidPredicate(
const scaleComponent = model.getScaleComponent(channel);
if (scaleComponent) {
const scaleType = scaleComponent.get('type');
const field = model.vgField(channel, {expr: 'datum'});
const field = model.vgField(channel, {expr: 'datum', binSuffix: model.stack?.impute ? 'mid' : undefined});

// While discrete domain scales can handle invalid values, continuous scales can't.
if (field && hasContinuousDomain(scaleType)) {
Expand Down
4 changes: 4 additions & 0 deletions test/compile/mark/area.test.ts
Expand Up @@ -53,6 +53,10 @@ describe('Mark: Area', () => {
it('should use bin_mid for x', () => {
expect(props.x).toEqual({field: 'bin_maxbins_10_IMDB_Rating_mid', scale: 'x'});
});

it('should use bin_mid for the defined check', () => {
expect(props.defined['signal']).toContain('bin_maxbins_10_IMDB_Rating_mid');
});
});

describe('vertical area, with zero=false', () => {
Expand Down