Skip to content

Commit

Permalink
fix: incorrect interface of ColormapLayer (#2314)
Browse files Browse the repository at this point in the history
Closes #2310.
  • Loading branch information
rubenthoms authored Oct 14, 2024
1 parent 7703056 commit 46176b7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ import type { BitmapLayerPickingInfo, BitmapLayerProps } from "@deck.gl/layers";
import { BitmapLayer } from "@deck.gl/layers";
import type { PickingInfo } from "@deck.gl/core";

import type { LayerPickInfo } from "../../layers/utils/layerTools";
import type {
LayerPickInfo,
TypeAndNameLayerProps,
} from "../../layers/utils/layerTools";
import { decoder } from "../shader_modules";
import type { ValueDecoder } from "../utils/propertyMapTools";
import { decodeRGB } from "../utils/propertyMapTools";
Expand Down Expand Up @@ -66,7 +69,9 @@ function getImageData(
// and RGB(255, 255, 255) to the maximum value in valueRange, thus giving us the full
// > 16mil possible values for any property value range.
// We also support property maps with an alpha channel. See colormap.fs.glsl for more details.
export interface ColormapLayerProps extends BitmapLayerProps {
export interface ColormapLayerProps
extends BitmapLayerProps,
TypeAndNameLayerProps {
// Name of color map.
colorMapName: string;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,15 @@ export type Position3D = [number, number, number];
// Return a color given a number in the [0,1] range.
export type colorMapFunctionType = (x: number) => [number, number, number];

export interface ExtendedLayerProps extends CompositeLayerProps {
export interface TypeAndNameLayerProps {
"@@type"?: string;
name: string;
}

export interface ExtendedLayerProps
extends CompositeLayerProps,
TypeAndNameLayerProps {}

export interface ExtendedLayer extends Layer {
getLegendData?: () => DiscreteLegendDataType | ContinuousLegendDataType;
}
Expand Down

0 comments on commit 46176b7

Please sign in to comment.