diff --git a/build/vega-lite-schema.json b/build/vega-lite-schema.json index 0d7e480193..e2962a423b 100644 --- a/build/vega-lite-schema.json +++ b/build/vega-lite-schema.json @@ -20364,7 +20364,7 @@ }, "type": { "$ref": "#/definitions/ProjectionType", - "description": "The cartographic projection to use. This value is case-insensitive, for example `\"albers\"` and `\"Albers\"` indicate the same projection type. You can find all valid projection types [in the documentation](https://vega.github.io/vega-lite/docs/projection.html#projection-types).\n\n__Default value:__ `mercator`" + "description": "The cartographic projection to use. This value is case-insensitive, for example `\"albers\"` and `\"Albers\"` indicate the same projection type. You can find all valid projection types [in the documentation](https://vega.github.io/vega-lite/docs/projection.html#projection-types).\n\n__Default value:__ `equalEarth`" } }, "type": "object" diff --git a/src/compile/projection/parse.ts b/src/compile/projection/parse.ts index 0aaf01349b..89e1997386 100644 --- a/src/compile/projection/parse.ts +++ b/src/compile/projection/parse.ts @@ -21,7 +21,7 @@ function parseUnitProjection(model: UnitModel): ProjectionComponent { const size = fit ? [model.getSizeSignalRef('width'), model.getSizeSignalRef('height')] : undefined; const data = fit ? gatherFitData(model) : undefined; - return new ProjectionComponent( + const projComp = new ProjectionComponent( model.projectionName(true), { ...(model.config.projection ?? {}), @@ -30,6 +30,12 @@ function parseUnitProjection(model: UnitModel): ProjectionComponent { size, data ); + + if (!projComp.get('type')) { + projComp.set('type', 'equalEarth', false); + } + + return projComp; } return undefined; diff --git a/src/projection.ts b/src/projection.ts index 547ec69cbe..66c1adec74 100644 --- a/src/projection.ts +++ b/src/projection.ts @@ -5,7 +5,7 @@ export interface Projection extends BaseProjection { /** * The cartographic projection to use. This value is case-insensitive, for example `"albers"` and `"Albers"` indicate the same projection type. You can find all valid projection types [in the documentation](https://vega.github.io/vega-lite/docs/projection.html#projection-types). * - * __Default value:__ `mercator` + * __Default value:__ `equalEarth` */ type?: ProjectionType | SignalRef; // Re-declare to override docs diff --git a/test/compile/projection/parse.test.ts b/test/compile/projection/parse.test.ts index aaa27f8767..5458042240 100644 --- a/test/compile/projection/parse.test.ts +++ b/test/compile/projection/parse.test.ts @@ -38,6 +38,7 @@ describe('src/compile/projection/parse', () => { }); model.parse(); expect(model.component.projection.explicit).toEqual({}); + expect(model.component.projection.implicit).toEqual({name: 'projection', type: 'equalEarth'}); }); it('should create projection from config', () => {