Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions modules/core/src/lib/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// SPDX-License-Identifier: MIT
// Copyright (c) vis.gl contributors

import log from '../utils/log';
import {Pan, DoubleClickDrag, Pinch, Tap} from 'mjolnir.js';
import type {PanRecognizerOptions, PinchRecognizerOptions, TapRecognizerOptions} from 'mjolnir.js';

Expand Down Expand Up @@ -52,16 +51,6 @@ export const COORDINATE_SYSTEM = {
CARTESIAN: 'cartesian'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Document the removed public alias

The v10 migration and release documentation does not record that COORDINATE_SYSTEM.IDENTITY was removed or that callers must use COORDINATE_SYSTEM.CARTESIAN. This leaves TypeScript consumers without guidance for the resulting compile error and JavaScript consumers without guidance when the missing property becomes an invalid undefined coordinate system at runtime.

} as const;

// Deprecated
/* eslint-disable accessor-pairs */
Object.defineProperty(COORDINATE_SYSTEM, 'IDENTITY', {
get: () => {
log.deprecated('COORDINATE_SYSTEM.IDENTITY', 'COORDINATE_SYSTEM.CARTESIAN')();
return COORDINATE_SYSTEM.CARTESIAN;
}
});
/* eslint-enable accessor-pairs */

/**
* How coordinates are transformed from the world space into the common space.
*/
Expand Down
4 changes: 2 additions & 2 deletions showcases/ascii/ascii-layer/ascii-layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: MIT
// Copyright (c) vis.gl contributors

import {CompositeLayer, IconLayer, COORDINATE_SYSTEM} from 'deck.gl';
import {CompositeLayer, IconLayer} from 'deck.gl';
import {makeFontAtlas} from '@deck.gl/layers/dist/esm/text-layer/font-atlas';
import AsciiFilter from './ascii-filter';

Expand Down Expand Up @@ -110,7 +110,7 @@ export default class AsciiLayer extends CompositeLayer {

return new IconLayer({
id: 'text',
coordinateSystem: COORDINATE_SYSTEM.IDENTITY,
coordinateSystem: 'cartesian',
data: grid,
opacity: 1,
iconAtlas,
Expand Down
4 changes: 2 additions & 2 deletions showcases/graph/graph-layer/graph-layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
// SPDX-License-Identifier: MIT
// Copyright (c) vis.gl contributors

import {CompositeLayer, IconLayer, LineLayer, ScatterplotLayer, COORDINATE_SYSTEM} from 'deck.gl';
import {CompositeLayer, IconLayer, LineLayer, ScatterplotLayer} from 'deck.gl';

const defaultProps = {
offset: {x: 0, y: 0},
coordinateSystem: COORDINATE_SYSTEM.IDENTITY,
coordinateSystem: 'cartesian',

getLinkPosition: link => ({
sourcePosition: [link.source.x, link.source.y],
Expand Down
4 changes: 2 additions & 2 deletions showcases/graph/graph-layer/graph-layout-layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: MIT
// Copyright (c) vis.gl contributors

import {CompositeLayer, COORDINATE_SYSTEM} from 'deck.gl';
import {CompositeLayer} from 'deck.gl';
import GraphLayer from './graph-layer';

import LayoutD3 from './layout/layout-d3';
Expand All @@ -13,7 +13,7 @@ const defaultProps = {
data: null,
opacity: 1.0,
layout: LayoutD3,
coordinateSystem: COORDINATE_SYSTEM.IDENTITY,
coordinateSystem: 'cartesian',
nodeIconAccessors: {}
};

Expand Down
2 changes: 1 addition & 1 deletion test/apps/standalone/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const nonGeoExample = new deck.DeckGL({
layers: [
new deck.PointCloudLayer({
id: 'pointCloud',
coordinateSystem: deck.COORDINATE_SYSTEM.IDENTITY,
coordinateSystem: 'cartesian',
opacity: 1,
data: points,
getPosition: d => d.position,
Expand Down
6 changes: 3 additions & 3 deletions test/apps/svg-interoperability/app.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/* eslint-disable no-console */
import React, {PureComponent} from 'react';
import {createRoot} from 'react-dom/client';
import DeckGL, {COORDINATE_SYSTEM, ScatterplotLayer, OrthographicView} from 'deck.gl';
import DeckGL, {ScatterplotLayer, OrthographicView} from 'deck.gl';
import ContourLayer from '@deck.gl/layers/contour-layer/contour-layer';

const DEGREE_TO_RADIAN = Math.PI / 180;
Expand Down Expand Up @@ -141,7 +141,7 @@ class Root extends PureComponent {
],
getRadius: p => 2,
getColor: p => [255, 0, 128, 196],
coordinateSystem: COORDINATE_SYSTEM.IDENTITY,
coordinateSystem: 'cartesian',
// there's a bug that the radius calculated with project_scale
radiusMinPixels: 2
});
Expand Down Expand Up @@ -172,7 +172,7 @@ class Root extends PureComponent {
p.radius * Math.cos(p.theta * DEGREE_TO_RADIAN) * size,
p.radius * Math.sin(p.theta * DEGREE_TO_RADIAN) * size
],
coordinateSystem: COORDINATE_SYSTEM.IDENTITY,
coordinateSystem: 'cartesian',
cellSize: 20,
contours: this._getContours(bandsOn),
gpuAggregation: true
Expand Down
4 changes: 2 additions & 2 deletions test/apps/video/app.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import React, {createRef, Component} from 'react';
import {createRoot} from 'react-dom/client';
import DeckGL from '@deck.gl/react';
import {OrthographicView, COORDINATE_SYSTEM} from '@deck.gl/core';
import {OrthographicView} from '@deck.gl/core';
import {BitmapLayer} from '@deck.gl/layers';

const DATA_URL =
Expand Down Expand Up @@ -37,7 +37,7 @@ export class App extends Component {

_renderLayers() {
return new BitmapLayer({
coordinateSystem: COORDINATE_SYSTEM.IDENTITY,
coordinateSystem: 'cartesian',
image: this._videoRef.current,
bounds: [-300, -400, 400, 300]
});
Expand Down
11 changes: 0 additions & 11 deletions test/modules/core/shaderlib/project/project-functions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,17 +160,6 @@ test('project#projectPosition rejects legacy numeric coordinate systems', () =>
}),
'Legacy numeric coordinate systems are rejected'
).toThrow(/Invalid coordinateSystem/);

const identityResult = projectPosition([0, 0, 0], {
viewport: TEST_VIEWPORT,
coordinateSystem: COORDINATE_SYSTEM.IDENTITY,
coordinateOrigin: [256, 256, 0]
});

expect(
equals(identityResult, [174.15110778808594, -58.11044311523443, 0]),
'IDENTITY aliases cartesian behavior'
).toBeTruthy();
});

webglTest('project#projectPosition vs project_position', async () => {
Expand Down
13 changes: 0 additions & 13 deletions test/modules/core/shaderlib/project/viewport-uniforms.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,19 +171,6 @@ test('project#getUniforms rejects legacy numeric coordinate systems', () => {
).toThrow(/Invalid coordinateSystem/);
});

test('project#getUniforms normalizes IDENTITY to CARTESIAN', () => {
const cartesian = project.getUniforms({
viewport: TEST_VIEWPORTS.infoVis,
coordinateSystem: COORDINATE_SYSTEM.CARTESIAN
});
const identity = project.getUniforms({
viewport: TEST_VIEWPORTS.infoVis,
coordinateSystem: COORDINATE_SYSTEM.IDENTITY
});

expect(identity, 'IDENTITY matches CARTESIAN').toEqual(cartesian);
});

test('project64#getUniforms', () => {
const viewport = TEST_VIEWPORTS.map;
const uniforms = project.getUniforms({viewport});
Expand Down
13 changes: 6 additions & 7 deletions test/modules/mesh-layers/utils.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,26 @@

import {test, expect} from 'vitest';
import {shouldComposeModelMatrix} from '@deck.gl/mesh-layers/utils/matrix';
import {COORDINATE_SYSTEM} from '@deck.gl/core';

test('shouldComposeModelMatrix', () => {
expect(
shouldComposeModelMatrix({isGeospatial: false}, COORDINATE_SYSTEM.DEFAULT),
shouldComposeModelMatrix({isGeospatial: false}, 'default'),
'Should composeModelMatrix for cartesian.'
).toBeTruthy();
expect(
shouldComposeModelMatrix({isGeospatial: true}, COORDINATE_SYSTEM.DEFAULT),
shouldComposeModelMatrix({isGeospatial: true}, 'default'),
'Should not composeModelMatrix for lnglat.'
).toBeFalsy();
expect(
shouldComposeModelMatrix({}, COORDINATE_SYSTEM.IDENTITY),
'Should composeModelMatrix for identity.'
shouldComposeModelMatrix({}, 'cartesian'),
'Should composeModelMatrix for cartesian.'
).toBeTruthy();
expect(
shouldComposeModelMatrix({}, COORDINATE_SYSTEM.METER_OFFSETS),
shouldComposeModelMatrix({}, 'meter-offsets'),
'Should composeModelMatrix for meter_offsets.'
).toBeTruthy();
expect(
shouldComposeModelMatrix({}, COORDINATE_SYSTEM.LNGLAT_OFFSETS),
shouldComposeModelMatrix({}, 'lnglat-offsets'),
'Should not composeModelMatrix for lnglat_offsets.'
).toBeFalsy();
});