Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Pessimistress committed Aug 23, 2024
1 parent f8f76b8 commit 91be89f
Show file tree
Hide file tree
Showing 30 changed files with 34 additions and 36 deletions.
2 changes: 1 addition & 1 deletion modules/aggregation-layers/src/common/aggregation-layer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
Attribute,
AttributeManager
} from '@deck.gl/core';
import {Aggregator} from './aggregator';
import {Aggregator} from './aggregator/aggregator';

export type AggregationLayerProps<DataT> = CompositeLayerProps & {
data: LayerDataSource<DataT>;
Expand Down
File renamed without changes.
6 changes: 6 additions & 0 deletions modules/aggregation-layers/src/common/aggregator/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export {CPUAggregator} from './cpu-aggregator/cpu-aggregator';
export {WebGLAggregator} from './gpu-aggregator/webgl-aggregator';

export type {Aggregator, AggregatedBin, AggregationOperation, AggregationProps} from './aggregator';
export type {CPUAggregatorProps} from './cpu-aggregator/cpu-aggregator';
export type {WebGLAggregatorProps} from './gpu-aggregator/webgl-aggregator';
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,9 @@ import {
DefaultProps
} from '@deck.gl/core';
import {PathLayer, SolidPolygonLayer} from '@deck.gl/layers';
import {WebGLAggregator} from '../common/gpu-aggregator/webgl-aggregator';
import {CPUAggregator} from '../common/cpu-aggregator/cpu-aggregator';
import {WebGLAggregator, CPUAggregator, AggregationOperation} from '../common/aggregator/index';
import AggregationLayer from '../common/aggregation-layer';
import {AggregationLayerProps} from '../common/aggregation-layer';
import {AggregationOperation} from '../common/aggregator';
import {generateContours, Contour, ContourLine, ContourPolygon} from './contour-utils';
import {getAggregatorValueReader} from './value-reader';
import {Matrix4} from '@math.gl/core';
Expand Down
4 changes: 1 addition & 3 deletions modules/aggregation-layers/src/contour-layer/value-reader.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import {Aggregator} from '../common/aggregator';
import {WebGLAggregator} from '../common/gpu-aggregator/webgl-aggregator';
import {CPUAggregator} from '../common/cpu-aggregator/cpu-aggregator';
import {Aggregator, CPUAggregator, WebGLAggregator} from '../common/aggregator/index';
import type {TypedArray} from '@luma.gl/core';

type ValueReader = (x: number, y: number) => number;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {Texture} from '@luma.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 {colorRangeToTexture} from '../common/utils/color-utils';
import vs from './grid-cell-layer-vertex.glsl';

/** Proprties added by GridCellLayer. */
Expand Down
8 changes: 3 additions & 5 deletions modules/aggregation-layers/src/grid-layer/grid-layer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,10 @@ import {
DefaultProps
} from '@deck.gl/core';
import {getDistanceScales} from '@math.gl/web-mercator';
import {WebGLAggregator} from '../common/gpu-aggregator/webgl-aggregator';
import {CPUAggregator} from '../common/cpu-aggregator/cpu-aggregator';
import {WebGLAggregator, CPUAggregator, AggregationOperation} from '../common/aggregator/index';
import AggregationLayer from '../common/aggregation-layer';
import {AggregationOperation} from '../common/aggregator';
import {AggregateAccessor} from '../types';
import {defaultColorRange} from '../utils/color-utils';
import {AggregateAccessor} from '../common/types';
import {defaultColorRange} from '../common/utils/color-utils';

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {
CompositeLayerProps,
Attribute
} from '@deck.gl/core';
import {filterProps} from '../utils/prop-utils';
import {filterProps} from '../common/utils/prop-utils';

export type AggregationLayerProps<DataT> = CompositeLayerProps & {
data: LayerDataSource<DataT>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ import {
} from '@deck.gl/core';
import TriangleLayer from './triangle-layer';
import AggregationLayer, {AggregationLayerProps} from './aggregation-layer';
import {defaultColorRange, colorRangeToFlatArray} from '../utils/color-utils';
import {defaultColorRange, colorRangeToFlatArray} from '../common/utils/color-utils';
import weightsVs from './weights-vs.glsl';
import weightsFs from './weights-fs.glsl';
import maxVs from './max-vs.glsl';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import {Texture} from '@luma.gl/core';
import {UpdateParameters, Color} from '@deck.gl/core';
import {ColumnLayer} from '@deck.gl/layers';
import {colorRangeToTexture} from '../utils/color-utils';
import {colorRangeToTexture} from '../common/utils/color-utils';
import vs from './hexagon-cell-layer-vertex.glsl';

/** Proprties added by HexagonCellLayer. */
Expand Down
8 changes: 3 additions & 5 deletions modules/aggregation-layers/src/hexagon-layer/hexagon-layer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,10 @@ import {
DefaultProps
} from '@deck.gl/core';
import {getDistanceScales} from '@math.gl/web-mercator';
import {WebGLAggregator} from '../common/gpu-aggregator/webgl-aggregator';
import {CPUAggregator} from '../common/cpu-aggregator/cpu-aggregator';
import {WebGLAggregator, CPUAggregator, AggregationOperation} from '../common/aggregator/index';
import AggregationLayer from '../common/aggregation-layer';
import {AggregationOperation} from '../common/aggregator';
import {AggregateAccessor} from '../types';
import {defaultColorRange} from '../utils/color-utils';
import {AggregateAccessor} from '../common/types';
import {defaultColorRange} from '../common/utils/color-utils';

import HexagonCellLayer from './hexagon-cell-layer';
import {pointToHexbin, HexbinVertices, getHexbinCentroid, pointToHexbinGLSL} from './hexbin';
Expand Down
13 changes: 8 additions & 5 deletions modules/aggregation-layers/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ export {default as GridLayer} from './grid-layer/grid-layer';
export {default as HeatmapLayer} from './heatmap-layer/heatmap-layer';

export {default as _AggregationLayer} from './common/aggregation-layer';
export {WebGLAggregator} from './common/gpu-aggregator/webgl-aggregator';
export {CPUAggregator} from './common/cpu-aggregator/cpu-aggregator';
export {WebGLAggregator, CPUAggregator} from './common/aggregator/index';

// types
export type {ContourLayerProps, ContourLayerPickingInfo} from './contour-layer/contour-layer';
Expand All @@ -38,6 +37,10 @@ export type {
ScreenGridLayerPickingInfo
} from './screen-grid-layer/screen-grid-layer';

export type {Aggregator, AggregationOperation, AggregationProps} from './common/aggregator';
export type {WebGLAggregatorProps} from './common/gpu-aggregator/webgl-aggregator';
export type {CPUAggregatorProps} from './common/cpu-aggregator/cpu-aggregator';
export type {
Aggregator,
AggregationOperation,
AggregationProps,
WebGLAggregatorProps,
CPUAggregatorProps
} from './common/aggregator/index';
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import {Texture} from '@luma.gl/core';
import {Model, Geometry} from '@luma.gl/engine';
import {Layer, picking, UpdateParameters, DefaultProps, Color} from '@deck.gl/core';
import {defaultColorRange, colorRangeToTexture} from '../utils/color-utils';
import {defaultColorRange, colorRangeToTexture} from '../common/utils/color-utils';
import vs from './screen-grid-layer-vertex.glsl';
import fs from './screen-grid-layer-fragment.glsl';
import {ShaderModule} from '@luma.gl/shadertools';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,8 @@ import {
UpdateParameters,
DefaultProps
} from '@deck.gl/core';
import {WebGLAggregator} from '../common/gpu-aggregator/webgl-aggregator';
import {CPUAggregator} from '../common/cpu-aggregator/cpu-aggregator';
import {WebGLAggregator, CPUAggregator, AggregationOperation} from '../common/aggregator/index';
import AggregationLayer from '../common/aggregation-layer';
import {AggregationOperation} from '../common/aggregator';
import ScreenGridCellLayer from './screen-grid-cell-layer';

const defaultProps: DefaultProps<ScreenGridLayerProps> = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {Attribute} from '@deck.gl/core';
import {
VertexAccessor,
evaluateVertexAccessor
} from '@deck.gl/aggregation-layers/common/cpu-aggregator/vertex-accessor';
} from '@deck.gl/aggregation-layers/common/aggregator/cpu-aggregator/vertex-accessor';
import {device} from '@deck.gl/test-utils';

test('evaluateVertexAccessor#sources', t => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import test from 'tape-promise/tape';
import {colorRangeToFlatArray} from '@deck.gl/aggregation-layers/utils/color-utils';
import {colorRangeToFlatArray} from '@deck.gl/aggregation-layers/common/utils/color-utils';

test('color-utils#colorRangeToFlatArray', t => {
const TESTS = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
getQuantileScale,
getOrdinalScale,
getLinearScale
} from '@deck.gl/aggregation-layers/utils/scale-utils';
} from '@deck.gl/aggregation-layers/common/utils/scale-utils';

const RANGE = [100, 200, 300, 400, 500, 600, 700, 800, 900, 1000];
const LINEAR_SCALE_TEST_CASES = [
Expand Down
5 changes: 2 additions & 3 deletions test/modules/aggregation-layers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@ import './hexagon-layer.spec';
import './hexbin.spec';
import './screen-grid-layer.spec';
import './screengrid-cell-layer.spec';
import './utils/color-utils.spec';
import './utils/scale-utils.spec';

import './common/utils/color-utils.spec';
import './common/utils/scale-utils.spec';
import './common/webgl-aggregator.spec';
import './common/cpu-aggregator/cpu-aggregator.spec';
import './common/cpu-aggregator/vertex-accessor.spec';

0 comments on commit 91be89f

Please sign in to comment.