Skip to content

Commit

Permalink
WidthUnits/radiusUnits: add new 'common' unit type (danmarshall#241)
Browse files Browse the repository at this point in the history
* WidthUnits/radiusUnits: add new 'common' unit type

* use UNIT const

* ScatterplotLayerProps: fix UNIT import
  • Loading branch information
davidcalhoun authored and hellocreep committed Apr 6, 2022
1 parent 0b545fb commit 8c97b54
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions deck.gl/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ declare module 'deck.gl' {
Position,
Position2D,
Position3D,
UNIT
} from '@deck.gl/core';
export {
ArcLayer,
Expand Down
3 changes: 2 additions & 1 deletion deck.gl__core/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -982,6 +982,7 @@ declare module '@deck.gl/core/lib/layer' {
import Viewport from '@deck.gl/core/viewports/viewport';
import { Position } from '@deck.gl/core/utils/positions';
import { Matrix4 } from '@math.gl/core';
import { UNIT } from '@deck.gl/core/lib/constants';

export interface LayerContext {
layerManager: LayerManager;
Expand Down Expand Up @@ -1016,7 +1017,7 @@ declare module '@deck.gl/core/lib/layer' {
(o: PickInfo<D>, e: HammerInput): any;
}
export type DataSet<D> = Iterable<D>;
export type WidthUnits = 'meters' | 'pixels';
export type WidthUnits = keyof typeof UNIT;

export interface ObjectInfo<D, T> {
// the index of the current iteration
Expand Down
3 changes: 2 additions & 1 deletion deck.gl__layers/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@ declare module '@deck.gl/layers/scatterplot-layer/scatterplot-layer' {
import { LayerProps, WidthUnits } from '@deck.gl/core/lib/layer';
import { Position } from '@deck.gl/core/utils/positions';
import { RGBAColor } from '@deck.gl/core/utils/color';
import { UNIT } from '@deck.gl/core/lib/constants';
export interface ScatterplotLayerProps<D> extends LayerProps<D> {
radiusScale?: number;
lineWidthUnits?: WidthUnits;
Expand All @@ -306,7 +307,7 @@ declare module '@deck.gl/layers/scatterplot-layer/scatterplot-layer' {
radiusMaxPixels?: number;
lineWidthMinPixels?: number;
lineWidthMaxPixels?: number;
radiusUnits?: 'meters' | 'pixels';
radiusUnits?: keyof typeof UNIT;

//Data Accessors
getPosition?: (d: D) => Position;
Expand Down

0 comments on commit 8c97b54

Please sign in to comment.