@deck.gl/aggregation-layers 8.8.1 → 8.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/cpu-grid-layer/cpu-grid-layer.ts"],"names":["nop","defaultProps","colorDomain","colorRange","defaultColorRange","getColorValue","type","value","getColorWeight","colorAggregation","lowerPercentile","min","max","upperPercentile","colorScaleType","onSetColorDomain","elevationDomain","elevationRange","getElevationValue","getElevationWeight","elevationAggregation","elevationLowerPercentile","elevationUpperPercentile","elevationScale","elevationScaleType","onSetElevationDomain","gridAggregator","pointToDensityGridDataCPU","cellSize","coverage","getPosition","x","position","extruded","material","_filterData","optional","CPUGridLayer","cpuAggregator","CPUAggregator","getAggregator","props","getCellSize","state","aggregatorState","attributeManager","getAttributeManager","add","positions","size","accessor","opts","setState","updateState","viewport","context","attributes","getAttributes","numInstances","getNumInstances","info","getPickingInfo","cell","getAccessor","getUpdateTriggers","transitions","SubLayerClass","getSubLayerClass","GridCellLayer","updateTriggers","_getSublayerUpdateTriggers","getFillColor","_onGetSublayerColor","bind","getElevation","_onGetSublayerElevation","getSubLayerProps","id","data","layerData","AggregationLayer"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAqBA;;AAGA;;AACA;;AACA;;AACA;;;;;;AAOA,SAASA,GAAT,GAAe,CAAE;;AAEjB,IAAMC,YAA6C,GAAG;AAEpDC,EAAAA,WAAW,EAAE,IAFuC;AAGpDC,EAAAA,UAAU,EAAEC,6BAHwC;AAIpDC,EAAAA,aAAa,EAAE;AAACC,IAAAA,IAAI,EAAE,UAAP;AAAmBC,IAAAA,KAAK,EAAE;AAA1B,GAJqC;AAKpDC,EAAAA,cAAc,EAAE;AAACF,IAAAA,IAAI,EAAE,UAAP;AAAmBC,IAAAA,KAAK,EAAE;AAA1B,GALoC;AAMpDE,EAAAA,gBAAgB,EAAE,KANkC;AAOpDC,EAAAA,eAAe,EAAE;AA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charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nimport GL from '@luma.gl/constants';\nimport {GridCellLayer} from '@deck.gl/layers';\nimport {Accessor, AccessorFunction, Color, Position, Material, DefaultProps} from '@deck.gl/core';\n\nimport {defaultColorRange} from '../utils/color-utils';\nimport {pointToDensityGridDataCPU} from './grid-aggregator';\nimport CPUAggregator from '../utils/cpu-aggregator';\nimport AggregationLayer, {AggregationLayerProps} from '../aggregation-layer';\n\nimport Layer, {UpdateParameters} from 'modules/core/src/lib/layer';\nimport {GetPickingInfoParams, PickingInfo} from 'modules/core/src/lib/picking/pick-info';\nimport {AggregateAccessor} from '../types';\n\n// eslint-disable-next-line @typescript-eslint/no-empty-function\nfunction nop() {}\n\nconst defaultProps: DefaultProps<CPUGridLayerProps> = {\n // color\n colorDomain: null,\n colorRange: defaultColorRange,\n getColorValue: {type: 'accessor', value: null}, // default value is calculated from `getColorWeight` and `colorAggregation`\n getColorWeight: {type: 'accessor', value: 1},\n colorAggregation: 'SUM',\n lowerPercentile: {type: 'number', min: 0, max: 100, value: 0},\n upperPercentile: {type: 'number', min: 0, max: 100, value: 100},\n colorScaleType: 'quantize',\n onSetColorDomain: nop,\n\n // elevation\n elevationDomain: null,\n elevationRange: [0, 1000],\n getElevationValue: {type: 'accessor', value: null}, // default value is calculated from `getElevationWeight` and `elevationAggregation`\n getElevationWeight: {type: 'accessor', value: 1},\n elevationAggregation: 'SUM',\n elevationLowerPercentile: {type: 'number', min: 0, max: 100, value: 0},\n elevationUpperPercentile: {type: 'number', min: 0, max: 100, value: 100},\n elevationScale: {type: 'number', min: 0, value: 1},\n elevationScaleType: 'linear',\n onSetElevationDomain: nop,\n\n gridAggregator: pointToDensityGridDataCPU,\n\n // grid\n cellSize: {type: 'number', min: 0, max: 1000, value: 1000},\n coverage: {type: 'number', min: 0, max: 1, value: 1},\n getPosition: {type: 'accessor', value: x => x.position},\n extruded: false,\n\n // Optional material for 'lighting' shader module\n material: true,\n\n // data filter\n _filterData: {type: 'function', value: null, optional: true}\n};\n\n/** All properties supported by CPUGridLayer. */\nexport type CPUGridLayerProps<DataT = any> = _CPUGridLayerProps<DataT> &\n AggregationLayerProps<DataT>;\n\n/** Properties added by CPUGridLayer. */\nexport type _CPUGridLayerProps<DataT> = {\n /**\n * Size of each cell in meters.\n * @default 1000\n */\n cellSize?: number;\n\n /**\n * Color scale domain, default is set to the extent of aggregated weights in each cell.\n * @default [min(colorWeight), max(colorWeight)]\n */\n colorDomain?: [number, number] | null;\n\n /**\n * Default: [colorbrewer](http://colorbrewer2.org/#type=sequential&scheme=YlOrRd&n=6) `6-class YlOrRd`\n */\n colorRange?: Color[];\n\n /**\n * Cell size multiplier, clamped between 0 - 1.\n * @default 1\n */\n coverage?: number;\n\n /**\n * Elevation scale input domain, default is set to between 0 and the max of aggregated weights in each cell.\n * @default [0, max(elevationWeight)]\n */\n elevationDomain?: [number, number] | null;\n\n /**\n * Elevation scale output range.\n * @default [0, 1000]\n */\n elevationRange?: [number, number];\n\n /**\n * Cell elevation multiplier.\n * @default 1\n */\n elevationScale?: number;\n\n /**\n * Whether to enable cell elevation. If set to false, all cell will be flat.\n * @default true\n */\n extruded?: boolean;\n\n /**\n * Filter cells and re-calculate color by `upperPercentile`.\n * Cells with value arger than the upperPercentile will be hidden.\n * @default 100\n */\n upperPercentile?: number;\n\n /**\n * Filter cells and re-calculate color by `lowerPercentile`.\n * Cells with value smaller than the lowerPercentile will be hidden.\n * @default 0\n */\n lowerPercentile?: number;\n\n /**\n * Filter cells and re-calculate elevation by `elevationUpperPercentile`.\n * Cells with elevation value larger than the `elevationUpperPercentile` will be hidden.\n * @default 100\n */\n elevationUpperPercentile?: number;\n\n /**\n * Filter cells and re-calculate elevation by `elevationLowerPercentile`.\n * Cells with elevation value larger than the `elevationLowerPercentile` will be hidden.\n * @default 0\n */\n elevationLowerPercentile?: number;\n\n /**\n * Scaling function used to determine the color of the grid cell, default value is 'quantize'.\n * Supported Values are 'quantize', 'linear', 'quantile' and 'ordinal'.\n * @default 'quantize'\n */\n colorScaleType?: 'quantize' | 'linear' | 'quantile' | 'ordinal';\n\n /**\n * Scaling function used to determine the elevation of the grid cell, only supports 'linear'.\n */\n elevationScaleType?: 'linear';\n\n // TODO - document\n gridAggregator?: (props: any, params: any) => any;\n\n /**\n * Material settings for lighting effect. Applies if `extruded: true`.\n *\n * @default true\n * @see https://deck.gl/docs/developer-guide/using-lighting\n */\n material?: Material;\n\n /**\n * Defines the operation used to aggregate all data object weights to calculate a cell's color value.\n * @default 'SUM'\n */\n colorAggregation?: 'SUM' | 'MEAN' | 'MIN' | 'MAX';\n\n /**\n * Defines the operation used to aggregate all data object weights to calculate a cell's elevation value.\n * @default 'SUM'\n */\n elevationAggregation?: 'SUM' | 'MEAN' | 'MIN' | 'MAX';\n\n /**\n * Method called to retrieve the position of each object.\n * @default object => object.position\n */\n getPosition?: AccessorFunction<DataT, Position>;\n\n /**\n * The weight of a data object used to calculate the color value for a cell.\n * @default 1\n */\n getColorWeight?: Accessor<DataT, number>;\n\n /**\n * After data objects are aggregated into cells, this accessor is called on each cell to get the value that its color is based on.\n * @default null\n */\n getColorValue?: AggregateAccessor<DataT> | null;\n\n /**\n * The weight of a data object used to calculate the elevation value for a cell.\n * @default 1\n */\n getElevationWeight?: Accessor<DataT, number>;\n\n /**\n * After data objects are aggregated into cells, this accessor is called on each cell to get the value that its elevation is based on.\n * @default null\n */\n getElevationValue?: AggregateAccessor<DataT> | null;\n\n /**\n * This callback will be called when bin color domain has been calculated.\n * @default () => {}\n */\n onSetColorDomain?: (minMax: [number, number]) => void;\n\n /**\n * This callback will be called when bin elevation domain has been calculated.\n * @default () => {}\n */\n onSetElevationDomain?: (minMax: [number, number]) => void;\n\n /**\n * (Experimental) Filter data objects\n */\n _filterData: null | ((d: DataT) => boolean);\n};\n\n/** Aggregate data into a grid-based heatmap. Aggregation is performed on CPU. */\nexport default class CPUGridLayer<DataT = any, ExtraPropsT = {}> extends AggregationLayer<\n ExtraPropsT & Required<_CPUGridLayerProps<DataT>>\n> {\n static layerName = 'CPUGridLayer';\n static defaultProps = defaultProps;\n\n initializeState(): void {\n const cpuAggregator = new CPUAggregator({\n getAggregator: props => props.gridAggregator,\n getCellSize: props => props.cellSize\n });\n\n this.state = {\n cpuAggregator,\n aggregatorState: cpuAggregator.state\n };\n const attributeManager = this.getAttributeManager()!;\n attributeManager.add({\n positions: {size: 3, type: GL.DOUBLE, accessor: 'getPosition'}\n });\n // color and elevation attributes can't be added as attributes\n // they are calcualted using 'getValue' accessor that takes an array of pints.\n }\n\n updateState(opts: UpdateParameters<this>) {\n super.updateState(opts);\n this.setState({\n // make a copy of the internal state of cpuAggregator for testing\n aggregatorState: this.state.cpuAggregator.updateState(opts, {\n viewport: this.context.viewport,\n attributes: this.getAttributes(),\n numInstances: this.getNumInstances()\n })\n });\n }\n\n getPickingInfo({info}: GetPickingInfoParams): PickingInfo {\n return this.state.cpuAggregator.getPickingInfo({info});\n }\n\n // create a method for testing\n _onGetSublayerColor(cell) {\n return this.state.cpuAggregator.getAccessor('fillColor')(cell);\n }\n\n // create a method for testing\n _onGetSublayerElevation(cell) {\n return this.state.cpuAggregator.getAccessor('elevation')(cell);\n }\n\n _getSublayerUpdateTriggers() {\n return this.state.cpuAggregator.getUpdateTriggers(this.props);\n }\n\n renderLayers(): Layer {\n const {elevationScale, extruded, cellSize, coverage, material, transitions} = this.props;\n const {cpuAggregator} = this.state;\n const SubLayerClass = this.getSubLayerClass('grid-cell', GridCellLayer);\n const updateTriggers = this._getSublayerUpdateTriggers();\n\n return new SubLayerClass(\n {\n cellSize,\n coverage,\n material,\n elevationScale,\n extruded,\n\n getFillColor: this._onGetSublayerColor.bind(this),\n getElevation: this._onGetSublayerElevation.bind(this),\n transitions: transitions && {\n getFillColor: transitions.getColorValue || transitions.getColorWeight,\n getElevation: transitions.getElevationValue || transitions.getElevationWeight\n }\n },\n this.getSubLayerProps({\n id: 'grid-cell',\n updateTriggers\n }),\n {\n data: cpuAggregator.state.layerData.data\n }\n );\n }\n}\n"],"file":"cpu-grid-layer.js"}
1
+ {"version":3,"sources":["../../../src/cpu-grid-layer/cpu-grid-layer.ts"],"names":["nop","defaultProps","colorDomain","colorRange","defaultColorRange","getColorValue","type","value","getColorWeight","colorAggregation","lowerPercentile","min","max","upperPercentile","colorScaleType","onSetColorDomain","elevationDomain","elevationRange","getElevationValue","getElevationWeight","elevationAggregation","elevationLowerPercentile","elevationUpperPercentile","elevationScale","elevationScaleType","onSetElevationDomain","gridAggregator","pointToDensityGridDataCPU","cellSize","coverage","getPosition","x","position","extruded","material","_filterData","optional","CPUGridLayer","cpuAggregator","CPUAggregator","getAggregator","props","getCellSize","state","aggregatorState","attributeManager","getAttributeManager","add","positions","size","accessor","opts","setState","updateState","viewport","context","attributes","getAttributes","numInstances","getNumInstances","info","getPickingInfo","cell","getAccessor","getUpdateTriggers","transitions","SubLayerClass","getSubLayerClass","GridCellLayer","updateTriggers","_getSublayerUpdateTriggers","getFillColor","_onGetSublayerColor","bind","getElevation","_onGetSublayerElevation","getSubLayerProps","id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WAAW,CAAC5D,aAAZ,IAA6B4D,WAAW,CAACzD,cAD7B;AAE1BkE,UAAAA,YAAY,EAAET,WAAW,CAAC/C,iBAAZ,IAAiC+C,WAAW,CAAC9C;AAFjC;AAT9B,OADK,EAeL,KAAKyD,gBAAL,CAAsB;AACpBC,QAAAA,EAAE,EAAE,WADgB;AAEpBR,QAAAA,cAAc,EAAdA;AAFoB,OAAtB,CAfK,EAmBL;AACES,QAAAA,IAAI,EAAExC,aAAa,CAACK,KAAd,CAAoBoC,SAApB,CAA8BD;AADtC,OAnBK,CAAP;AAuBD;;;EAnFsEE,yB;;;8BAApD3C,Y,eAGA,c;8BAHAA,Y,kBAIGpC,Y","sourcesContent":["// Copyright (c) 2015 - 2017 Uber Technologies, Inc.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nimport GL from '@luma.gl/constants';\nimport {GridCellLayer} from '@deck.gl/layers';\nimport {Accessor, AccessorFunction, Color, Position, Material, DefaultProps} from '@deck.gl/core';\n\nimport {defaultColorRange} from '../utils/color-utils';\nimport {pointToDensityGridDataCPU} from './grid-aggregator';\nimport CPUAggregator from '../utils/cpu-aggregator';\nimport AggregationLayer, {AggregationLayerProps} from '../aggregation-layer';\n\nimport {Layer, UpdateParameters, GetPickingInfoParams, PickingInfo} from '@deck.gl/core';\nimport {AggregateAccessor} from '../types';\n\n// eslint-disable-next-line @typescript-eslint/no-empty-function\nfunction nop() {}\n\nconst defaultProps: DefaultProps<CPUGridLayerProps> = {\n // color\n colorDomain: null,\n colorRange: defaultColorRange,\n getColorValue: {type: 'accessor', value: null}, // default value is calculated from `getColorWeight` and `colorAggregation`\n getColorWeight: {type: 'accessor', value: 1},\n colorAggregation: 'SUM',\n lowerPercentile: {type: 'number', min: 0, max: 100, value: 0},\n upperPercentile: {type: 'number', min: 0, max: 100, value: 100},\n colorScaleType: 'quantize',\n onSetColorDomain: nop,\n\n // elevation\n elevationDomain: null,\n elevationRange: [0, 1000],\n getElevationValue: {type: 'accessor', value: null}, // default value is calculated from `getElevationWeight` and `elevationAggregation`\n getElevationWeight: {type: 'accessor', value: 1},\n elevationAggregation: 'SUM',\n elevationLowerPercentile: {type: 'number', min: 0, max: 100, value: 0},\n elevationUpperPercentile: {type: 'number', min: 0, max: 100, value: 100},\n elevationScale: {type: 'number', min: 0, value: 1},\n elevationScaleType: 'linear',\n onSetElevationDomain: nop,\n\n gridAggregator: pointToDensityGridDataCPU,\n\n // grid\n cellSize: {type: 'number', min: 0, max: 1000, value: 1000},\n coverage: {type: 'number', min: 0, max: 1, value: 1},\n getPosition: {type: 'accessor', value: x => x.position},\n extruded: false,\n\n // Optional material for 'lighting' shader module\n material: true,\n\n // data filter\n _filterData: {type: 'function', value: null, optional: true}\n};\n\n/** All properties supported by CPUGridLayer. */\nexport type CPUGridLayerProps<DataT = any> = _CPUGridLayerProps<DataT> &\n AggregationLayerProps<DataT>;\n\n/** Properties added by CPUGridLayer. */\nexport type _CPUGridLayerProps<DataT> = {\n /**\n * Size of each cell in meters.\n * @default 1000\n */\n cellSize?: number;\n\n /**\n * Color scale domain, default is set to the extent of aggregated weights in each cell.\n * @default [min(colorWeight), max(colorWeight)]\n */\n colorDomain?: [number, number] | null;\n\n /**\n * Default: [colorbrewer](http://colorbrewer2.org/#type=sequential&scheme=YlOrRd&n=6) `6-class YlOrRd`\n */\n colorRange?: Color[];\n\n /**\n * Cell size multiplier, clamped between 0 - 1.\n * @default 1\n */\n coverage?: number;\n\n /**\n * Elevation scale input domain, default is set to between 0 and the max of aggregated weights in each cell.\n * @default [0, max(elevationWeight)]\n */\n elevationDomain?: [number, number] | null;\n\n /**\n * Elevation scale output range.\n * @default [0, 1000]\n */\n elevationRange?: [number, number];\n\n /**\n * Cell elevation multiplier.\n * @default 1\n */\n elevationScale?: number;\n\n /**\n * Whether to enable cell elevation. If set to false, all cell will be flat.\n * @default true\n */\n extruded?: boolean;\n\n /**\n * Filter cells and re-calculate color by `upperPercentile`.\n * Cells with value arger than the upperPercentile will be hidden.\n * @default 100\n */\n upperPercentile?: number;\n\n /**\n * Filter cells and re-calculate color by `lowerPercentile`.\n * Cells with value smaller than the lowerPercentile will be hidden.\n * @default 0\n */\n lowerPercentile?: number;\n\n /**\n * Filter cells and re-calculate elevation by `elevationUpperPercentile`.\n * Cells with elevation value larger than the `elevationUpperPercentile` will be hidden.\n * @default 100\n */\n elevationUpperPercentile?: number;\n\n /**\n * Filter cells and re-calculate elevation by `elevationLowerPercentile`.\n * Cells with elevation value larger than the `elevationLowerPercentile` will be hidden.\n * @default 0\n */\n elevationLowerPercentile?: number;\n\n /**\n * Scaling function used to determine the color of the grid cell, default value is 'quantize'.\n * Supported Values are 'quantize', 'linear', 'quantile' and 'ordinal'.\n * @default 'quantize'\n */\n colorScaleType?: 'quantize' | 'linear' | 'quantile' | 'ordinal';\n\n /**\n * Scaling function used to determine the elevation of the grid cell, only supports 'linear'.\n */\n elevationScaleType?: 'linear';\n\n // TODO - document\n gridAggregator?: (props: any, params: any) => any;\n\n /**\n * Material settings for lighting effect. Applies if `extruded: true`.\n *\n * @default true\n * @see https://deck.gl/docs/developer-guide/using-lighting\n */\n material?: Material;\n\n /**\n * Defines the operation used to aggregate all data object weights to calculate a cell's color value.\n * @default 'SUM'\n */\n colorAggregation?: 'SUM' | 'MEAN' | 'MIN' | 'MAX';\n\n /**\n * Defines the operation used to aggregate all data object weights to calculate a cell's elevation value.\n * @default 'SUM'\n */\n elevationAggregation?: 'SUM' | 'MEAN' | 'MIN' | 'MAX';\n\n /**\n * Method called to retrieve the position of each object.\n * @default object => object.position\n */\n getPosition?: AccessorFunction<DataT, Position>;\n\n /**\n * The weight of a data object used to calculate the color value for a cell.\n * @default 1\n */\n getColorWeight?: Accessor<DataT, number>;\n\n /**\n * After data objects are aggregated into cells, this accessor is called on each cell to get the value that its color is based on.\n * @default null\n */\n getColorValue?: AggregateAccessor<DataT> | null;\n\n /**\n * The weight of a data object used to calculate the elevation value for a cell.\n * @default 1\n */\n getElevationWeight?: Accessor<DataT, number>;\n\n /**\n * After data objects are aggregated into cells, this accessor is called on each cell to get the value that its elevation is based on.\n * @default null\n */\n getElevationValue?: AggregateAccessor<DataT> | null;\n\n /**\n * This callback will be called when bin color domain has been calculated.\n * @default () => {}\n */\n onSetColorDomain?: (minMax: [number, number]) => void;\n\n /**\n * This callback will be called when bin elevation domain has been calculated.\n * @default () => {}\n */\n onSetElevationDomain?: (minMax: [number, number]) => void;\n\n /**\n * (Experimental) Filter data objects\n */\n _filterData: null | ((d: DataT) => boolean);\n};\n\n/** Aggregate data into a grid-based heatmap. Aggregation is performed on CPU. */\nexport default class CPUGridLayer<DataT = any, ExtraPropsT = {}> extends AggregationLayer<\n ExtraPropsT & Required<_CPUGridLayerProps<DataT>>\n> {\n static layerName = 'CPUGridLayer';\n static defaultProps = defaultProps;\n\n initializeState(): void {\n const cpuAggregator = new CPUAggregator({\n getAggregator: props => props.gridAggregator,\n getCellSize: props => props.cellSize\n });\n\n this.state = {\n cpuAggregator,\n aggregatorState: cpuAggregator.state\n };\n const attributeManager = this.getAttributeManager()!;\n attributeManager.add({\n positions: {size: 3, type: GL.DOUBLE, accessor: 'getPosition'}\n });\n // color and elevation attributes can't be added as attributes\n // they are calcualted using 'getValue' accessor that takes an array of pints.\n }\n\n updateState(opts: UpdateParameters<this>) {\n super.updateState(opts);\n this.setState({\n // make a copy of the internal state of cpuAggregator for testing\n aggregatorState: this.state.cpuAggregator.updateState(opts, {\n viewport: this.context.viewport,\n attributes: this.getAttributes(),\n numInstances: this.getNumInstances()\n })\n });\n }\n\n getPickingInfo({info}: GetPickingInfoParams): PickingInfo {\n return this.state.cpuAggregator.getPickingInfo({info});\n }\n\n // create a method for testing\n _onGetSublayerColor(cell) {\n return this.state.cpuAggregator.getAccessor('fillColor')(cell);\n }\n\n // create a method for testing\n _onGetSublayerElevation(cell) {\n return this.state.cpuAggregator.getAccessor('elevation')(cell);\n }\n\n _getSublayerUpdateTriggers() {\n return this.state.cpuAggregator.getUpdateTriggers(this.props);\n }\n\n renderLayers(): Layer {\n const {elevationScale, extruded, cellSize, coverage, material, transitions} = this.props;\n const {cpuAggregator} = this.state;\n const SubLayerClass = this.getSubLayerClass('grid-cell', GridCellLayer);\n const updateTriggers = this._getSublayerUpdateTriggers();\n\n return new SubLayerClass(\n {\n cellSize,\n coverage,\n material,\n elevationScale,\n extruded,\n\n getFillColor: this._onGetSublayerColor.bind(this),\n getElevation: this._onGetSublayerElevation.bind(this),\n transitions: transitions && {\n getFillColor: transitions.getColorValue || transitions.getColorWeight,\n getElevation: transitions.getElevationValue || transitions.getElevationWeight\n }\n },\n this.getSubLayerProps({\n id: 'grid-cell',\n updateTriggers\n }),\n {\n data: cpuAggregator.state.layerData.data\n }\n );\n }\n}\n"],"file":"cpu-grid-layer.js"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/cpu-grid-layer/cpu-grid-layer.ts"],"names":["GridCellLayer","defaultColorRange","pointToDensityGridDataCPU","CPUAggregator","AggregationLayer","nop","defaultProps","colorDomain","colorRange","getColorValue","type","value","getColorWeight","colorAggregation","lowerPercentile","min","max","upperPercentile","colorScaleType","onSetColorDomain","elevationDomain","elevationRange","getElevationValue","getElevationWeight","elevationAggregation","elevationLowerPercentile","elevationUpperPercentile","elevationScale","elevationScaleType","onSetElevationDomain","gridAggregator","cellSize","coverage","getPosition","x","position","extruded","material","_filterData","optional","CPUGridLayer","initializeState","cpuAggregator","getAggregator","props","getCellSize","state","aggregatorState","attributeManager","getAttributeManager","add","positions","size","accessor","updateState","opts","setState","viewport","context","attributes","getAttributes","numInstances","getNumInstances","getPickingInfo","info","_onGetSublayerColor","cell","getAccessor","_onGetSublayerElevation","_getSublayerUpdateTriggers","getUpdateTriggers","renderLayers","transitions","SubLayerClass","getSubLayerClass","updateTriggers","getFillColor","bind","getElevation","getSubLayerProps","id","data","layerData"],"mappings":";AAqBA,SAAQA,aAAR,QAA4B,iBAA5B;AAGA,SAAQC,iBAAR,QAAgC,sBAAhC;AACA,SAAQC,yBAAR,QAAwC,mBAAxC;AACA,OAAOC,aAAP,MAA0B,yBAA1B;AACA,OAAOC,gBAAP,MAAsD,sBAAtD;;AAOA,SAASC,GAAT,GAAe,CAAE;;AAEjB,MAAMC,YAA6C,GAAG;AAEpDC,EAAAA,WAAW,EAAE,IAFuC;AAGpDC,EAAAA,UAAU,EAAEP,iBAHwC;AAIpDQ,EAAAA,aAAa,EAAE;AAACC,IAAAA,IAAI,EAAE,UAAP;AAAmBC,IAAAA,KAAK,EAAE;AAA1B,GAJqC;AAKpDC,EAAAA,cAAc,EAAE;AAACF,IAAAA,IAAI,EAAE,UAAP;AAAmBC,IAAAA,KAAK,EAAE;AAA1B,GALoC;AAMpDE,EAAAA,gBAAgB,EAAE,KANkC;AAOpDC,EAAAA,eAAe,EAAE;AAACJ,IAAAA,IAAI,EAAE,QAAP;AAAiBK,IAAAA,GAAG,EAAE,CAAtB;AAAyBC,IAAAA,GAAG,EAAE,GAA9B;AAAmCL,IAAAA,KAAK,EAAE;AAA1C,GAPmC;AAQpDM,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AG,KAAKC,gBAAL,CAAsB,WAAtB,EAAmC1E,aAAnC,CAAtB;;AACA,UAAM2E,cAAc,GAAG,KAAKN,0BAAL,EAAvB;;AAEA,WAAO,IAAII,aAAJ,CACL;AACE1C,MAAAA,QADF;AAEEC,MAAAA,QAFF;AAGEK,MAAAA,QAHF;AAIEV,MAAAA,cAJF;AAKES,MAAAA,QALF;AAOEwC,MAAAA,YAAY,EAAE,KAAKX,mBAAL,CAAyBY,IAAzB,CAA8B,IAA9B,CAPhB;AAQEC,MAAAA,YAAY,EAAE,KAAKV,uBAAL,CAA6BS,IAA7B,CAAkC,IAAlC,CARhB;AASEL,MAAAA,WAAW,EAAEA,WAAW,IAAI;AAC1BI,QAAAA,YAAY,EAAEJ,WAAW,CAAC/D,aAAZ,IAA6B+D,WAAW,CAAC5D,cAD7B;AAE1BkE,QAAAA,YAAY,EAAEN,WAAW,CAAClD,iBAAZ,IAAiCkD,WAAW,CAACjD;AAFjC;AAT9B,KADK,EAeL,KAAKwD,gBAAL,CAAsB;AACpBC,MAAAA,EAAE,EAAE,WADgB;AAEpBL,MAAAA;AAFoB,KAAtB,CAfK,EAmBL;AACEM,MAAAA,IAAI,EAAEvC,aAAa,CAACI,KAAd,CAAoBoC,SAApB,CAA8BD;AADtC,KAnBK,CAAP;AAuBD;;AAjFD;;gBAFmBzC,Y,eAGA,c;;gBAHAA,Y,kBAIGlC,Y","sourcesContent":["// Copyright (c) 2015 - 2017 Uber Technologies, Inc.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nimport GL from '@luma.gl/constants';\nimport {GridCellLayer} from '@deck.gl/layers';\nimport {Accessor, AccessorFunction, Color, Position, Material, DefaultProps} from '@deck.gl/core';\n\nimport {defaultColorRange} from '../utils/color-utils';\nimport {pointToDensityGridDataCPU} from './grid-aggregator';\nimport CPUAggregator from '../utils/cpu-aggregator';\nimport AggregationLayer, {AggregationLayerProps} from '../aggregation-layer';\n\nimport Layer, {UpdateParameters} from 'modules/core/src/lib/layer';\nimport {GetPickingInfoParams, PickingInfo} from 'modules/core/src/lib/picking/pick-info';\nimport {AggregateAccessor} from '../types';\n\n// eslint-disable-next-line @typescript-eslint/no-empty-function\nfunction nop() {}\n\nconst defaultProps: DefaultProps<CPUGridLayerProps> = {\n // color\n colorDomain: null,\n colorRange: defaultColorRange,\n getColorValue: {type: 'accessor', value: null}, // default value is calculated from `getColorWeight` and `colorAggregation`\n getColorWeight: {type: 'accessor', value: 1},\n colorAggregation: 'SUM',\n lowerPercentile: {type: 'number', min: 0, max: 100, value: 0},\n upperPercentile: {type: 'number', min: 0, max: 100, value: 100},\n colorScaleType: 'quantize',\n onSetColorDomain: nop,\n\n // elevation\n elevationDomain: null,\n elevationRange: [0, 1000],\n getElevationValue: {type: 'accessor', value: null}, // default value is calculated from `getElevationWeight` and `elevationAggregation`\n getElevationWeight: {type: 'accessor', value: 1},\n elevationAggregation: 'SUM',\n elevationLowerPercentile: {type: 'number', min: 0, max: 100, value: 0},\n elevationUpperPercentile: {type: 'number', min: 0, max: 100, value: 100},\n elevationScale: {type: 'number', min: 0, value: 1},\n elevationScaleType: 'linear',\n onSetElevationDomain: nop,\n\n gridAggregator: pointToDensityGridDataCPU,\n\n // grid\n cellSize: {type: 'number', min: 0, max: 1000, value: 1000},\n coverage: {type: 'number', min: 0, max: 1, value: 1},\n getPosition: {type: 'accessor', value: x => x.position},\n extruded: false,\n\n // Optional material for 'lighting' shader module\n material: true,\n\n // data filter\n _filterData: {type: 'function', value: null, optional: true}\n};\n\n/** All properties supported by CPUGridLayer. */\nexport type CPUGridLayerProps<DataT = any> = _CPUGridLayerProps<DataT> &\n AggregationLayerProps<DataT>;\n\n/** Properties added by CPUGridLayer. */\nexport type _CPUGridLayerProps<DataT> = {\n /**\n * Size of each cell in meters.\n * @default 1000\n */\n cellSize?: number;\n\n /**\n * Color scale domain, default is set to the extent of aggregated weights in each cell.\n * @default [min(colorWeight), max(colorWeight)]\n */\n colorDomain?: [number, number] | null;\n\n /**\n * Default: [colorbrewer](http://colorbrewer2.org/#type=sequential&scheme=YlOrRd&n=6) `6-class YlOrRd`\n */\n colorRange?: Color[];\n\n /**\n * Cell size multiplier, clamped between 0 - 1.\n * @default 1\n */\n coverage?: number;\n\n /**\n * Elevation scale input domain, default is set to between 0 and the max of aggregated weights in each cell.\n * @default [0, max(elevationWeight)]\n */\n elevationDomain?: [number, number] | null;\n\n /**\n * Elevation scale output range.\n * @default [0, 1000]\n */\n elevationRange?: [number, number];\n\n /**\n * Cell elevation multiplier.\n * @default 1\n */\n elevationScale?: number;\n\n /**\n * Whether to enable cell elevation. If set to false, all cell will be flat.\n * @default true\n */\n extruded?: boolean;\n\n /**\n * Filter cells and re-calculate color by `upperPercentile`.\n * Cells with value arger than the upperPercentile will be hidden.\n * @default 100\n */\n upperPercentile?: number;\n\n /**\n * Filter cells and re-calculate color by `lowerPercentile`.\n * Cells with value smaller than the lowerPercentile will be hidden.\n * @default 0\n */\n lowerPercentile?: number;\n\n /**\n * Filter cells and re-calculate elevation by `elevationUpperPercentile`.\n * Cells with elevation value larger than the `elevationUpperPercentile` will be hidden.\n * @default 100\n */\n elevationUpperPercentile?: number;\n\n /**\n * Filter cells and re-calculate elevation by `elevationLowerPercentile`.\n * Cells with elevation value larger than the `elevationLowerPercentile` will be hidden.\n * @default 0\n */\n elevationLowerPercentile?: number;\n\n /**\n * Scaling function used to determine the color of the grid cell, default value is 'quantize'.\n * Supported Values are 'quantize', 'linear', 'quantile' and 'ordinal'.\n * @default 'quantize'\n */\n colorScaleType?: 'quantize' | 'linear' | 'quantile' | 'ordinal';\n\n /**\n * Scaling function used to determine the elevation of the grid cell, only supports 'linear'.\n */\n elevationScaleType?: 'linear';\n\n // TODO - document\n gridAggregator?: (props: any, params: any) => any;\n\n /**\n * Material settings for lighting effect. Applies if `extruded: true`.\n *\n * @default true\n * @see https://deck.gl/docs/developer-guide/using-lighting\n */\n material?: Material;\n\n /**\n * Defines the operation used to aggregate all data object weights to calculate a cell's color value.\n * @default 'SUM'\n */\n colorAggregation?: 'SUM' | 'MEAN' | 'MIN' | 'MAX';\n\n /**\n * Defines the operation used to aggregate all data object weights to calculate a cell's elevation value.\n * @default 'SUM'\n */\n elevationAggregation?: 'SUM' | 'MEAN' | 'MIN' | 'MAX';\n\n /**\n * Method called to retrieve the position of each object.\n * @default object => object.position\n */\n getPosition?: AccessorFunction<DataT, Position>;\n\n /**\n * The weight of a data object used to calculate the color value for a cell.\n * @default 1\n */\n getColorWeight?: Accessor<DataT, number>;\n\n /**\n * After data objects are aggregated into cells, this accessor is called on each cell to get the value that its color is based on.\n * @default null\n */\n getColorValue?: AggregateAccessor<DataT> | null;\n\n /**\n * The weight of a data object used to calculate the elevation value for a cell.\n * @default 1\n */\n getElevationWeight?: Accessor<DataT, number>;\n\n /**\n * After data objects are aggregated into cells, this accessor is called on each cell to get the value that its elevation is based on.\n * @default null\n */\n getElevationValue?: AggregateAccessor<DataT> | null;\n\n /**\n * This callback will be called when bin color domain has been calculated.\n * @default () => {}\n */\n onSetColorDomain?: (minMax: [number, number]) => void;\n\n /**\n * This callback will be called when bin elevation domain has been calculated.\n * @default () => {}\n */\n onSetElevationDomain?: (minMax: [number, number]) => void;\n\n /**\n * (Experimental) Filter data objects\n */\n _filterData: null | ((d: DataT) => boolean);\n};\n\n/** Aggregate data into a grid-based heatmap. Aggregation is performed on CPU. */\nexport default class CPUGridLayer<DataT = any, ExtraPropsT = {}> extends AggregationLayer<\n ExtraPropsT & Required<_CPUGridLayerProps<DataT>>\n> {\n static layerName = 'CPUGridLayer';\n static defaultProps = defaultProps;\n\n initializeState(): void {\n const cpuAggregator = new CPUAggregator({\n getAggregator: props => props.gridAggregator,\n getCellSize: props => props.cellSize\n });\n\n this.state = {\n cpuAggregator,\n aggregatorState: cpuAggregator.state\n };\n const attributeManager = this.getAttributeManager()!;\n attributeManager.add({\n positions: {size: 3, type: GL.DOUBLE, accessor: 'getPosition'}\n });\n // color and elevation attributes can't be added as attributes\n // they are calcualted using 'getValue' accessor that takes an array of pints.\n }\n\n updateState(opts: UpdateParameters<this>) {\n super.updateState(opts);\n this.setState({\n // make a copy of the internal state of cpuAggregator for testing\n aggregatorState: this.state.cpuAggregator.updateState(opts, {\n viewport: this.context.viewport,\n attributes: this.getAttributes(),\n numInstances: this.getNumInstances()\n })\n });\n }\n\n getPickingInfo({info}: GetPickingInfoParams): PickingInfo {\n return this.state.cpuAggregator.getPickingInfo({info});\n }\n\n // create a method for testing\n _onGetSublayerColor(cell) {\n return this.state.cpuAggregator.getAccessor('fillColor')(cell);\n }\n\n // create a method for testing\n _onGetSublayerElevation(cell) {\n return this.state.cpuAggregator.getAccessor('elevation')(cell);\n }\n\n _getSublayerUpdateTriggers() {\n return this.state.cpuAggregator.getUpdateTriggers(this.props);\n }\n\n renderLayers(): Layer {\n const {elevationScale, extruded, cellSize, coverage, material, transitions} = this.props;\n const {cpuAggregator} = this.state;\n const SubLayerClass = this.getSubLayerClass('grid-cell', GridCellLayer);\n const updateTriggers = this._getSublayerUpdateTriggers();\n\n return new SubLayerClass(\n {\n cellSize,\n coverage,\n material,\n elevationScale,\n extruded,\n\n getFillColor: this._onGetSublayerColor.bind(this),\n getElevation: this._onGetSublayerElevation.bind(this),\n transitions: transitions && {\n getFillColor: transitions.getColorValue || transitions.getColorWeight,\n getElevation: transitions.getElevationValue || transitions.getElevationWeight\n }\n },\n this.getSubLayerProps({\n id: 'grid-cell',\n updateTriggers\n }),\n {\n data: cpuAggregator.state.layerData.data\n }\n );\n }\n}\n"],"file":"cpu-grid-layer.js"}
1
+ {"version":3,"sources":["../../../src/cpu-grid-layer/cpu-grid-layer.ts"],"names":["GridCellLayer","defaultColorRange","pointToDensityGridDataCPU","CPUAggregator","AggregationLayer","nop","defaultProps","colorDomain","colorRange","getColorValue","type","value","getColorWeight","colorAggregation","lowerPercentile","min","max","upperPercentile","colorScaleType","onSetColorDomain","elevationDomain","elevationRange","getElevationValue","getElevationWeight","elevationAggregation","elevationLowerPercentile","elevationUpperPercentile","elevationScale","elevationScaleType","onSetElevationDomain","gridAggregator","cellSize","coverage","getPosition","x","position","extruded","material","_filterData","optional","CPUGridLayer","initializeState","cpuAggregator","getAggregator","props","getCellSize","state","aggregatorState","attributeManager","getAttributeManager","add","positions","size","accessor","updateState","opts","setState","viewport","context","attributes","getAttributes","numInstances","getNumInstances","getPickingInfo","info","_onGetSublayerColor","cell","getAccessor","_onGetSublayerElevation","_getSublayerUpdateTriggers","getUpdateTriggers","renderLayers","transitions","SubLayerClass","getSubLayerClass","updateTriggers","getFillColor","bind","getElevation","getSubLayerProps","id","data","layerData"],"mappings":";AAqBA,SAAQA,aAAR,QAA4B,iBAA5B;AAGA,SAAQC,iBAAR,QAAgC,sBAAhC;AACA,SAAQC,yBAAR,QAAwC,mBAAxC;AACA,OAAOC,aAAP,MAA0B,yBAA1B;AACA,OAAOC,gBAAP,MAAsD,sBAAtD;;AAMA,SAASC,GAAT,GAAe,CAAE;;AAEjB,MAAMC,YAA6C,GAAG;AAEpDC,EAAAA,WAAW,EA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,SAApB,CAA8BD;AADtC,KAnBK,CAAP;AAuBD;;AAjFD;;gBAFmBzC,Y,eAGA,c;;gBAHAA,Y,kBAIGlC,Y","sourcesContent":["// Copyright (c) 2015 - 2017 Uber Technologies, Inc.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nimport GL from '@luma.gl/constants';\nimport {GridCellLayer} from '@deck.gl/layers';\nimport {Accessor, AccessorFunction, Color, Position, Material, DefaultProps} from '@deck.gl/core';\n\nimport {defaultColorRange} from '../utils/color-utils';\nimport {pointToDensityGridDataCPU} from './grid-aggregator';\nimport CPUAggregator from '../utils/cpu-aggregator';\nimport AggregationLayer, {AggregationLayerProps} from '../aggregation-layer';\n\nimport {Layer, UpdateParameters, GetPickingInfoParams, PickingInfo} from '@deck.gl/core';\nimport {AggregateAccessor} from '../types';\n\n// eslint-disable-next-line @typescript-eslint/no-empty-function\nfunction nop() {}\n\nconst defaultProps: DefaultProps<CPUGridLayerProps> = {\n // color\n colorDomain: null,\n colorRange: defaultColorRange,\n getColorValue: {type: 'accessor', value: null}, // default value is calculated from `getColorWeight` and `colorAggregation`\n getColorWeight: {type: 'accessor', value: 1},\n colorAggregation: 'SUM',\n lowerPercentile: {type: 'number', min: 0, max: 100, value: 0},\n upperPercentile: {type: 'number', min: 0, max: 100, value: 100},\n colorScaleType: 'quantize',\n onSetColorDomain: nop,\n\n // elevation\n elevationDomain: null,\n elevationRange: [0, 1000],\n getElevationValue: {type: 'accessor', value: null}, // default value is calculated from `getElevationWeight` and `elevationAggregation`\n getElevationWeight: {type: 'accessor', value: 1},\n elevationAggregation: 'SUM',\n elevationLowerPercentile: {type: 'number', min: 0, max: 100, value: 0},\n elevationUpperPercentile: {type: 'number', min: 0, max: 100, value: 100},\n elevationScale: {type: 'number', min: 0, value: 1},\n elevationScaleType: 'linear',\n onSetElevationDomain: nop,\n\n gridAggregator: pointToDensityGridDataCPU,\n\n // grid\n cellSize: {type: 'number', min: 0, max: 1000, value: 1000},\n coverage: {type: 'number', min: 0, max: 1, value: 1},\n getPosition: {type: 'accessor', value: x => x.position},\n extruded: false,\n\n // Optional material for 'lighting' shader module\n material: true,\n\n // data filter\n _filterData: {type: 'function', value: null, optional: true}\n};\n\n/** All properties supported by CPUGridLayer. */\nexport type CPUGridLayerProps<DataT = any> = _CPUGridLayerProps<DataT> &\n AggregationLayerProps<DataT>;\n\n/** Properties added by CPUGridLayer. */\nexport type _CPUGridLayerProps<DataT> = {\n /**\n * Size of each cell in meters.\n * @default 1000\n */\n cellSize?: number;\n\n /**\n * Color scale domain, default is set to the extent of aggregated weights in each cell.\n * @default [min(colorWeight), max(colorWeight)]\n */\n colorDomain?: [number, number] | null;\n\n /**\n * Default: [colorbrewer](http://colorbrewer2.org/#type=sequential&scheme=YlOrRd&n=6) `6-class YlOrRd`\n */\n colorRange?: Color[];\n\n /**\n * Cell size multiplier, clamped between 0 - 1.\n * @default 1\n */\n coverage?: number;\n\n /**\n * Elevation scale input domain, default is set to between 0 and the max of aggregated weights in each cell.\n * @default [0, max(elevationWeight)]\n */\n elevationDomain?: [number, number] | null;\n\n /**\n * Elevation scale output range.\n * @default [0, 1000]\n */\n elevationRange?: [number, number];\n\n /**\n * Cell elevation multiplier.\n * @default 1\n */\n elevationScale?: number;\n\n /**\n * Whether to enable cell elevation. If set to false, all cell will be flat.\n * @default true\n */\n extruded?: boolean;\n\n /**\n * Filter cells and re-calculate color by `upperPercentile`.\n * Cells with value arger than the upperPercentile will be hidden.\n * @default 100\n */\n upperPercentile?: number;\n\n /**\n * Filter cells and re-calculate color by `lowerPercentile`.\n * Cells with value smaller than the lowerPercentile will be hidden.\n * @default 0\n */\n lowerPercentile?: number;\n\n /**\n * Filter cells and re-calculate elevation by `elevationUpperPercentile`.\n * Cells with elevation value larger than the `elevationUpperPercentile` will be hidden.\n * @default 100\n */\n elevationUpperPercentile?: number;\n\n /**\n * Filter cells and re-calculate elevation by `elevationLowerPercentile`.\n * Cells with elevation value larger than the `elevationLowerPercentile` will be hidden.\n * @default 0\n */\n elevationLowerPercentile?: number;\n\n /**\n * Scaling function used to determine the color of the grid cell, default value is 'quantize'.\n * Supported Values are 'quantize', 'linear', 'quantile' and 'ordinal'.\n * @default 'quantize'\n */\n colorScaleType?: 'quantize' | 'linear' | 'quantile' | 'ordinal';\n\n /**\n * Scaling function used to determine the elevation of the grid cell, only supports 'linear'.\n */\n elevationScaleType?: 'linear';\n\n // TODO - document\n gridAggregator?: (props: any, params: any) => any;\n\n /**\n * Material settings for lighting effect. Applies if `extruded: true`.\n *\n * @default true\n * @see https://deck.gl/docs/developer-guide/using-lighting\n */\n material?: Material;\n\n /**\n * Defines the operation used to aggregate all data object weights to calculate a cell's color value.\n * @default 'SUM'\n */\n colorAggregation?: 'SUM' | 'MEAN' | 'MIN' | 'MAX';\n\n /**\n * Defines the operation used to aggregate all data object weights to calculate a cell's elevation value.\n * @default 'SUM'\n */\n elevationAggregation?: 'SUM' | 'MEAN' | 'MIN' | 'MAX';\n\n /**\n * Method called to retrieve the position of each object.\n * @default object => object.position\n */\n getPosition?: AccessorFunction<DataT, Position>;\n\n /**\n * The weight of a data object used to calculate the color value for a cell.\n * @default 1\n */\n getColorWeight?: Accessor<DataT, number>;\n\n /**\n * After data objects are aggregated into cells, this accessor is called on each cell to get the value that its color is based on.\n * @default null\n */\n getColorValue?: AggregateAccessor<DataT> | null;\n\n /**\n * The weight of a data object used to calculate the elevation value for a cell.\n * @default 1\n */\n getElevationWeight?: Accessor<DataT, number>;\n\n /**\n * After data objects are aggregated into cells, this accessor is called on each cell to get the value that its elevation is based on.\n * @default null\n */\n getElevationValue?: AggregateAccessor<DataT> | null;\n\n /**\n * This callback will be called when bin color domain has been calculated.\n * @default () => {}\n */\n onSetColorDomain?: (minMax: [number, number]) => void;\n\n /**\n * This callback will be called when bin elevation domain has been calculated.\n * @default () => {}\n */\n onSetElevationDomain?: (minMax: [number, number]) => void;\n\n /**\n * (Experimental) Filter data objects\n */\n _filterData: null | ((d: DataT) => boolean);\n};\n\n/** Aggregate data into a grid-based heatmap. Aggregation is performed on CPU. */\nexport default class CPUGridLayer<DataT = any, ExtraPropsT = {}> extends AggregationLayer<\n ExtraPropsT & Required<_CPUGridLayerProps<DataT>>\n> {\n static layerName = 'CPUGridLayer';\n static defaultProps = defaultProps;\n\n initializeState(): void {\n const cpuAggregator = new CPUAggregator({\n getAggregator: props => props.gridAggregator,\n getCellSize: props => props.cellSize\n });\n\n this.state = {\n cpuAggregator,\n aggregatorState: cpuAggregator.state\n };\n const attributeManager = this.getAttributeManager()!;\n attributeManager.add({\n positions: {size: 3, type: GL.DOUBLE, accessor: 'getPosition'}\n });\n // color and elevation attributes can't be added as attributes\n // they are calcualted using 'getValue' accessor that takes an array of pints.\n }\n\n updateState(opts: UpdateParameters<this>) {\n super.updateState(opts);\n this.setState({\n // make a copy of the internal state of cpuAggregator for testing\n aggregatorState: this.state.cpuAggregator.updateState(opts, {\n viewport: this.context.viewport,\n attributes: this.getAttributes(),\n numInstances: this.getNumInstances()\n })\n });\n }\n\n getPickingInfo({info}: GetPickingInfoParams): PickingInfo {\n return this.state.cpuAggregator.getPickingInfo({info});\n }\n\n // create a method for testing\n _onGetSublayerColor(cell) {\n return this.state.cpuAggregator.getAccessor('fillColor')(cell);\n }\n\n // create a method for testing\n _onGetSublayerElevation(cell) {\n return this.state.cpuAggregator.getAccessor('elevation')(cell);\n }\n\n _getSublayerUpdateTriggers() {\n return this.state.cpuAggregator.getUpdateTriggers(this.props);\n }\n\n renderLayers(): Layer {\n const {elevationScale, extruded, cellSize, coverage, material, transitions} = this.props;\n const {cpuAggregator} = this.state;\n const SubLayerClass = this.getSubLayerClass('grid-cell', GridCellLayer);\n const updateTriggers = this._getSublayerUpdateTriggers();\n\n return new SubLayerClass(\n {\n cellSize,\n coverage,\n material,\n elevationScale,\n extruded,\n\n getFillColor: this._onGetSublayerColor.bind(this),\n getElevation: this._onGetSublayerElevation.bind(this),\n transitions: transitions && {\n getFillColor: transitions.getColorValue || transitions.getColorWeight,\n getElevation: transitions.getElevationValue || transitions.getElevationWeight\n }\n },\n this.getSubLayerProps({\n id: 'grid-cell',\n updateTriggers\n }),\n {\n data: cpuAggregator.state.layerData.data\n }\n );\n }\n}\n"],"file":"cpu-grid-layer.js"}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@deck.gl/aggregation-layers",
3
3
  "description": "deck.gl layers that aggregate the input data into alternative representations",
4
4
  "license": "MIT",
5
- "version": "8.8.1",
5
+ "version": "8.8.2",
6
6
  "publishConfig": {
7
7
  "access": "public"
8
8
  },
@@ -40,5 +40,5 @@
40
40
  "@deck.gl/layers": "^8.0.0",
41
41
  "@luma.gl/core": "^8.0.0"
42
42
  },
43
- "gitHead": "fb84b75176a1c2114411e8d0b4063de594023567"
43
+ "gitHead": "17d768baed9e2149d3b62863e9db2b9d23bbf5ba"
44
44
  }
@@ -27,8 +27,7 @@ import {pointToDensityGridDataCPU} from './grid-aggregator';
27
27
  import CPUAggregator from '../utils/cpu-aggregator';
28
28
  import AggregationLayer, {AggregationLayerProps} from '../aggregation-layer';
29
29
 
30
- import Layer, {UpdateParameters} from 'modules/core/src/lib/layer';
31
- import {GetPickingInfoParams, PickingInfo} from 'modules/core/src/lib/picking/pick-info';
30
+ import {Layer, UpdateParameters, GetPickingInfoParams, PickingInfo} from '@deck.gl/core';
32
31
  import {AggregateAccessor} from '../types';
33
32
 
34
33
  // eslint-disable-next-line @typescript-eslint/no-empty-function
@@ -1,7 +1,6 @@
1
1
  import { Accessor, AccessorFunction, Color, Position, Material, DefaultProps } from '@deck.gl/core/typed';
2
2
  import AggregationLayer, { AggregationLayerProps } from '../aggregation-layer';
3
- import Layer, { UpdateParameters } from 'modules/core/src/lib/layer';
4
- import { GetPickingInfoParams, PickingInfo } from 'modules/core/src/lib/picking/pick-info';
3
+ import { Layer, UpdateParameters, GetPickingInfoParams, PickingInfo } from '@deck.gl/core/typed';
5
4
  import { AggregateAccessor } from '../types';
6
5
  /** All properties supported by CPUGridLayer. */
7
6
  export declare type CPUGridLayerProps<DataT = any> = _CPUGridLayerProps<DataT> & AggregationLayerProps<DataT>;
@@ -1 +1 @@
1
- {"version":3,"file":"cpu-grid-layer.d.ts","sourceRoot":"","sources":["../../src/cpu-grid-layer/cpu-grid-layer.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAC,QAAQ,EAAE,gBAAgB,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAC,MAAM,eAAe,CAAC;AAKlG,OAAO,gBAAgB,EAAE,EAAC,qBAAqB,EAAC,MAAM,sBAAsB,CAAC;AAE7E,OAAO,KAAK,EAAE,EAAC,gBAAgB,EAAC,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAC,oBAAoB,EAAE,WAAW,EAAC,MAAM,wCAAwC,CAAC;AACzF,OAAO,EAAC,iBAAiB,EAAC,MAAM,UAAU,CAAC;AA4C3C,gDAAgD;AAChD,oBAAY,iBAAiB,CAAC,KAAK,GAAG,GAAG,IAAI,kBAAkB,CAAC,KA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