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/examples/compiled/geo_layer_line_london.vg.json b/examples/compiled/geo_layer_line_london.vg.json index 0d6a45ab47..fca6c8ca57 100644 --- a/examples/compiled/geo_layer_line_london.vg.json +++ b/examples/compiled/geo_layer_line_london.vg.json @@ -5,6 +5,7 @@ "width": 700, "height": 500, "style": "cell", + "encode": {"update": {"stroke": {"value": "transparent"}}}, "data": [ { "name": "source_0", @@ -149,6 +150,5 @@ "symbolType": "circle", "encode": {"symbols": {"update": {"fill": {"value": "transparent"}}}} } - ], - "config": {"style": {"cell": {"stroke": "transparent"}}} + ] } diff --git a/examples/specs/geo_layer_line_london.vl.json b/examples/specs/geo_layer_line_london.vl.json index cd8b434a9e..f2fb829af7 100644 --- a/examples/specs/geo_layer_line_london.vl.json +++ b/examples/specs/geo_layer_line_london.vl.json @@ -2,10 +2,8 @@ "$schema": "https://vega.github.io/schema/vega-lite/v4.json", "width": 700, "height": 500, - "config": { - "view": { - "stroke": "transparent" - } + "view": { + "stroke": "transparent" }, "layer": [ { diff --git a/src/compile/projection/parse.ts b/src/compile/projection/parse.ts index 3b67e90f4b..2933dee2e8 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', () => {