Skip to content

Commit

Permalink
try fix ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Pessimistress committed Aug 21, 2024
1 parent 8d42053 commit acde30e
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 51 deletions.
8 changes: 4 additions & 4 deletions modules/aggregation-layers/src/grid-layer/grid-cell-layer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
// THE SOFTWARE.

import {Texture} from '@luma.gl/core';
import {UpdateParameters, DefaultProps, Color} from '@deck.gl/core';
import {UpdateParameters, Color} from '@deck.gl/core';
import {ColumnLayer} from '@deck.gl/layers';
import {CubeGeometry} from '@luma.gl/engine';
import {colorRangeToTexture} from '../utils/color-utils';
import vs from './grid-cell-layer-vertex.glsl';

/** Proprties added by GridCellLayer. */
export type _GridCellLayerProps = {
type GridCellLayerProps = {
cellSizeCommon: [number, number];
cellOriginCommon: [number, number];
colorDomain: () => [number, number];
Expand All @@ -35,9 +35,9 @@ export type _GridCellLayerProps = {
elevationRange: [number, number];
};

export default class GridCellLayer<ExtraPropsT extends {} = {}> extends ColumnLayer<
export class GridCellLayer<ExtraPropsT extends {} = {}> extends ColumnLayer<
null,
ExtraPropsT & Required<_GridCellLayerProps>
ExtraPropsT & Required<GridCellLayerProps>
> {
static layerName = 'GridCellLayer';

Expand Down
2 changes: 1 addition & 1 deletion modules/aggregation-layers/src/grid-layer/grid-layer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {AggregationOperation} from '../aggregation-layer-v9/aggregator';
import {AggregateAccessor} from '../types';
import {defaultColorRange} from '../utils/color-utils';

import GridCellLayer from './grid-cell-layer';
import {GridCellLayer} from './grid-cell-layer';

// eslint-disable-next-line @typescript-eslint/no-empty-function
function noop() {}
Expand Down
3 changes: 1 addition & 2 deletions modules/core/src/utils/typed-array-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ export class TypedArrayManager {
if (typedArray && copy) {
newArray.set(typedArray);
} else if (!initialize) {
// Hack - always initialize the first 4 elements. NaNs crash the Attribute validation
newArray.fill(0, 0, 4);
newArray.fill(0);
}

this._release(typedArray);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ void main(void) {
}
fragColor = vec4(vLineColor.rgb, vLineColor.a * isLine);
}
} else if (!scatterplot.filled) {
} else if (scatterplot.filled == false) {
discard;
} else {
fragColor = vFillColor;
Expand Down
2 changes: 2 additions & 0 deletions test/modules/aggregation-layers/grid-layer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ test('GridLayer#getAggregatorType', t => {
);
}
},
// v9 TODO - enable after implementing upperPercentile
// {
// updateProps: {
// upperPercentile: 90
Expand Down Expand Up @@ -124,6 +125,7 @@ test('GridLayer#getAggregatorType', t => {
);
}
}
// v9 TODO - enable after implementing colorScaleType
// {
// updateProps: {
// colorScaleType: 'quantile'
Expand Down
73 changes: 30 additions & 43 deletions test/modules/core/lib/pick-layers.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,24 @@
/* eslint-disable dot-notation, max-statements, no-unused-vars */

import test from 'tape-promise/tape';
import {Deck} from '@deck.gl/core';
import {
MapView,
ScatterplotLayer,
ColumnLayer,
Deck,
PolygonLayer,
PathLayer,
GeoJsonLayer,
GridLayer
} from 'deck.gl';
GeoJsonLayer
} from '@deck.gl/layers';
import {GridLayer} from '@deck.gl/aggregation-layers';

import {MaskExtension} from '@deck.gl/extensions';
import * as DATA from '../../../../examples/layer-browser/src/data-samples';
import type {DeckProps} from '@deck.gl/core';
import {equals} from '@math.gl/core';

const VIEW_STATE = {
latitude: 37.751537058389985,
longitude: -122.42694203247012,
latitude: 37.751537058389985,
zoom: 11.5,
pitch: 0,
bearing: 0
Expand All @@ -47,18 +47,17 @@ const VIEW_STATE = {
const DECK_PROPS: DeckProps = {
width: 500,
height: 550,
views: [new MapView()],
viewState: VIEW_STATE,
useDevicePixels: false,
layerFilter: null
};

const NEW_GRID_LAYER_PICK_METHODS = {
const GRID_LAYER_PICK_METHODS = {
pickObject: [
{
parameters: {
x: 60,
y: 160
y: 1
},
results: {
count: 0
Expand All @@ -72,7 +71,7 @@ const NEW_GRID_LAYER_PICK_METHODS = {
results: {
count: 1,
// point count in the aggregated cell for each pickInfo object
cellCounts: [8]
cellCounts: [26]
}
}
],
Expand All @@ -85,8 +84,8 @@ const NEW_GRID_LAYER_PICK_METHODS = {
height: 100
},
results: {
count: 23,
cellCounts: [1, 3, 1, 2, 3, 1, 1, 1, 1, 2, 2, 5, 1, 2, 5, 1, 3, 4, 1, 2, 1, 1, 1]
count: 16,
cellCounts: [1, 3, 2, 9, 1, 3, 1, 1, 10, 2, 5, 1, 4, 1, 2, 1]
}
},
{
Expand All @@ -109,17 +108,8 @@ const NEW_GRID_LAYER_PICK_METHODS = {
radius: 1
},
results: {
count: 4,
cellCounts: [4, 22, 3, 4]
}
},
{
parameters: {
x: 90,
y: 350
},
results: {
count: 0
count: 2,
cellCounts: [34, 12]
}
}
]
Expand Down Expand Up @@ -162,7 +152,6 @@ const TEST_CASES = [
}
}
],
/* luma.gl v9 test disable
pickObjects: [
{
parameters: {
Expand All @@ -187,7 +176,6 @@ const TEST_CASES = [
}
}
],
*/
pickMultipleObjects: [
{
parameters: {
Expand Down Expand Up @@ -719,37 +707,37 @@ const TEST_CASES = [
}
},
{
id: 'newgridlayer - cpu',
id: 'Gridlayer - cpu',
props: {
layers: [
new GridLayer({
data: DATA.points,
getPosition: d => d.COORDINATES,
pickable: true,
cellSize: 200,
cellSize: 400,
gpuAggregation: false,
extruded: true
})
]
},
pickingMethods: NEW_GRID_LAYER_PICK_METHODS
pickingMethods: GRID_LAYER_PICK_METHODS
},
{
id: 'newgridlayer - gpu',
id: 'Gridlayer - gpu',
props: {
layers: [
new GridLayer({
data: DATA.points,
getPosition: d => d.COORDINATES,
pickable: true,
cellSize: 200,
cellSize: 400,
gpuAggregation: true,
extruded: true,
fp64: true
})
]
},
pickingMethods: NEW_GRID_LAYER_PICK_METHODS
pickingMethods: GRID_LAYER_PICK_METHODS
}
];

Expand Down Expand Up @@ -781,15 +769,14 @@ test(`pickingTest`, async t => {
);
}

// TODO - fix aggregation layers
// if (pickingCase.results.cellCounts) {
// const cellCounts = pickInfos.map(x => x.object.count);
// t.deepEqual(
// cellCounts,
// pickingCase.results.cellCounts,
// 'Aggregation count for individual cells should match'
// );
// }
if (pickingCase.results.cellCounts) {
const cellCounts = pickInfos.map(x => x.object.count);
t.deepEqual(
cellCounts,
pickingCase.results.cellCounts,
'Aggregation count for individual cells should match'
);
}
}
}
}
Expand All @@ -815,10 +802,10 @@ test('pickingTest#unproject3D', async t => {
});

let pickInfo = deck.pickObject({x: 250, y: 275, unproject3D: true});
t.is(pickInfo.object, VIEW_STATE, 'object is picked');
t.comment(`pickInfo.coordinate: ${pickInfo.coordinate}`);
t.is(pickInfo?.object, VIEW_STATE, 'object is picked');
t.comment(`pickInfo.coordinate: ${pickInfo?.coordinate}`);
t.ok(
equals(pickInfo.coordinate, [VIEW_STATE.longitude, VIEW_STATE.latitude, 1000], 0.0001),
equals(pickInfo?.coordinate, [VIEW_STATE.longitude, VIEW_STATE.latitude, 1000], 0.0001),
'unprojects to 3D coordinate'
);

Expand Down
1 change: 1 addition & 0 deletions test/render/test-cases/grid-layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export function getMax(pts, key) {
}

export default [
// v9 TODO - enable after implementing colorScaleType
// {
// name: 'cpu-grid-layer:quantile',
// viewState: VIEW_STATE,
Expand Down

0 comments on commit acde30e

Please sign in to comment.