diff --git a/src/compile/scale/type.ts b/src/compile/scale/type.ts index 5397936675..e4c42ec496 100644 --- a/src/compile/scale/type.ts +++ b/src/compile/scale/type.ts @@ -117,8 +117,7 @@ function defaultType( } else if (isFieldDef(fieldDef) && fieldDef.timeUnit && normalizeTimeUnit(fieldDef.timeUnit).utc) { return 'utc'; } else if (isTime(channel)) { - // return 'linear'; - return 'band'; // TODO(jzong): when interpolation is implemented, this should be 'linear' + return 'linear'; } return 'time'; @@ -135,8 +134,7 @@ function defaultType( // TODO: consider using quantize (equivalent to binning) once we have it return 'ordinal'; } else if (isTime(channel)) { - // return 'linear'; - return 'band'; // TODO(jzong): when interpolation is implemented, this should be 'linear' + return 'linear'; } return 'linear'; diff --git a/test/compile/scale/type.test.ts b/test/compile/scale/type.test.ts index 841ac59fb5..9546fd6e07 100644 --- a/test/compile/scale/type.test.ts +++ b/test/compile/scale/type.test.ts @@ -159,6 +159,13 @@ describe('compile/scale', () => { }); }); }); + + describe('time (animation)', () => { + it('should return band scale for nominal/ordinal data by default.', () => { + expect(scaleType({}, 'time', {type: 'nominal'}, 'point')).toEqual(ScaleType.BAND); + expect(scaleType({}, 'time', {type: 'ordinal'}, 'point')).toEqual(ScaleType.BAND); + }); + }); }); describe('temporal', () => {