From 250d827d0c2b172d7f93dfb4df8c8076fbac4f55 Mon Sep 17 00:00:00 2001 From: Paul Rosenzweig Date: Tue, 18 Jan 2022 16:56:54 -0500 Subject: [PATCH 1/2] set binSuffix for defined channel --- src/compile/mark/encode/defined.ts | 2 +- test/compile/mark/area.test.ts | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/compile/mark/encode/defined.ts b/src/compile/mark/encode/defined.ts index 7b0f9bfdcd..a73fcd4f99 100644 --- a/src/compile/mark/encode/defined.ts +++ b/src/compile/mark/encode/defined.ts @@ -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)) { diff --git a/test/compile/mark/area.test.ts b/test/compile/mark/area.test.ts index 355e6971eb..8c7b58130a 100644 --- a/test/compile/mark/area.test.ts +++ b/test/compile/mark/area.test.ts @@ -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.includes('bin_maxbins_10_IMDB_Rating_mid')).toBe(true); + }); }); describe('vertical area, with zero=false', () => { From 8f5750f014c44c35f6d26cc955327b283ab7f218 Mon Sep 17 00:00:00 2001 From: Paul Rosenzweig Date: Wed, 19 Jan 2022 23:15:34 -0500 Subject: [PATCH 2/2] appease tsc --- test/compile/mark/area.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/compile/mark/area.test.ts b/test/compile/mark/area.test.ts index 8c7b58130a..e1baae809f 100644 --- a/test/compile/mark/area.test.ts +++ b/test/compile/mark/area.test.ts @@ -55,7 +55,7 @@ describe('Mark: Area', () => { }); it('should use bin_mid for the defined check', () => { - expect(props.defined.signal.includes('bin_maxbins_10_IMDB_Rating_mid')).toBe(true); + expect(props.defined['signal']).toContain('bin_maxbins_10_IMDB_Rating_mid'); }); });