@deck.gl/aggregation-layers 8.8.0-beta.4 → 8.8.1
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.
- package/dist/dist.dev.js +8 -3
- package/dist/es5/contour-layer/contour-layer.js.map +1 -1
- package/dist/es5/cpu-grid-layer/cpu-grid-layer.js.map +1 -1
- package/dist/es5/gpu-grid-layer/gpu-grid-layer.js.map +1 -1
- package/dist/es5/grid-layer/grid-layer.js.map +1 -1
- package/dist/es5/heatmap-layer/heatmap-layer.js.map +1 -1
- package/dist/es5/hexagon-layer/hexagon-layer.js.map +1 -1
- package/dist/es5/screen-grid-layer/screen-grid-layer.js.map +1 -1
- package/dist/esm/contour-layer/contour-layer.js.map +1 -1
- package/dist/esm/cpu-grid-layer/cpu-grid-layer.js.map +1 -1
- package/dist/esm/gpu-grid-layer/gpu-grid-layer.js.map +1 -1
- package/dist/esm/grid-layer/grid-layer.js.map +1 -1
- package/dist/esm/heatmap-layer/heatmap-layer.js.map +1 -1
- package/dist/esm/hexagon-layer/hexagon-layer.js.map +1 -1
- package/dist/esm/screen-grid-layer/screen-grid-layer.js.map +1 -1
- package/package.json +2 -2
- package/src/contour-layer/contour-layer.ts +2 -0
- package/src/cpu-grid-layer/cpu-grid-layer.ts +1 -0
- package/src/gpu-grid-layer/gpu-grid-layer.ts +1 -3
- package/src/grid-layer/grid-layer.ts +1 -0
- package/src/heatmap-layer/heatmap-layer.ts +1 -0
- package/src/hexagon-layer/hexagon-layer.ts +1 -0
- package/src/screen-grid-layer/screen-grid-layer.ts +1 -0
- package/typed/contour-layer/contour-layer.d.ts +1 -0
- package/typed/contour-layer/contour-layer.d.ts.map +1 -1
- package/typed/cpu-grid-layer/cpu-grid-layer.d.ts +1 -0
- package/typed/cpu-grid-layer/cpu-grid-layer.d.ts.map +1 -1
- package/typed/gpu-grid-layer/gpu-grid-layer.d.ts +1 -3
- package/typed/gpu-grid-layer/gpu-grid-layer.d.ts.map +1 -1
- package/typed/grid-layer/grid-layer.d.ts +1 -0
- package/typed/grid-layer/grid-layer.d.ts.map +1 -1
- package/typed/heatmap-layer/heatmap-layer.d.ts +1 -0
- package/typed/heatmap-layer/heatmap-layer.d.ts.map +1 -1
- package/typed/hexagon-layer/hexagon-layer.d.ts +1 -0
- package/typed/hexagon-layer/hexagon-layer.d.ts.map +1 -1
- package/typed/screen-grid-layer/screen-grid-layer.d.ts +1 -0
- package/typed/screen-grid-layer/screen-grid-layer.d.ts.map +1 -1
- package/dist/es5/aggregation-layer.md +0 -54
- package/dist/es5/grid-aggregation-layer.md +0 -46
- package/dist/esm/aggregation-layer.md +0 -54
- package/dist/esm/grid-aggregation-layer.md +0 -46
- package/src/aggregation-layer.md +0 -54
- package/src/grid-aggregation-layer.md +0 -46
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/screen-grid-layer/screen-grid-layer.ts"],"names":["log","GPUGridAggregator","AGGREGATION_OPERATION","getValueFunc","ScreenGridCellLayer","GridAggregationLayer","getFloatTexture","defaultProps","getPosition","type","value","d","position","getWeight","gpuAggregation","aggregation","POSITION_ATTRIBUTE_NAME","DIMENSIONS","data","props","weights","accessors","ScreenGridLayer","initializeState","gl","context","isSupported","setState","supported","error","id","initializeAggregationLayer","dimensions","getCellSize","cellSizePixels","count","size","operation","SUM","needMax","maxTexture","projectPoints","subLayerData","attributes","positionAttributeName","posOffset","translation","attributeManager","getAttributeManager","add","accessor","fp64","use64bitPositions","shouldUpdateState","changeFlags","state","somethingChanged","updateState","opts","renderLayers","numRow","numCol","updateTriggers","aggregationBuffer","CellLayerClass","getSubLayerClass","getSubLayerProps","instanceCounts","numInstances","finalizeState","maxBuffer","delete","getPickingInfo","info","index","gpuGridAggregator","aggregationResults","getData","object","getAggregationData","pixelIndex","updateResults","aggregationData","maxData","setData","setImageData","updateAggregationState","cellSize","cellSizeChanged","oldProps","viewportChanged","warn","gpuAggregationChanged","positionsChanged","isAttributeChanged","aggregationDataDirty","isAggregationDirty","compareAll","dimension","aggregationWeightsDirty","viewport","width","height","Math","ceil","allocateResources","scaling","gridOffset","xOffset","yOffset","_updateAccessors","_resetResults","getValue"],"mappings":";AAoBA,SAOEA,GAPF,QAYO,eAZP;AAeA,OAAOC,iBAAP,MAA8B,mDAA9B;AACA,SAAQC,qBAAR,EAA+BC,YAA/B,QAAkD,sCAAlD;AACA,OAAOC,mBAAP,MAAgC,0BAAhC;AACA,OAAOC,oBAAP,MAA8D,2BAA9D;AACA,SAAQC,eAAR,QAA8B,4BAA9B;AAEA,MAAMC,YAAgD,GAAG,EACvD,GAAGH,mBAAmB,CAACG,YADgC;AAEvDC,EAAAA,WAAW,EAAE;AAACC,IAAAA,IAAI,EAAE,UAAP;AAAmBC,IAAAA,KAAK,EAAEC,CAAC,IAAIA,CAAC,CAACC;AAAjC,GAF0C;AAGvDC,EAAAA,SAAS,EAAE;AAACJ,IAAAA,IAAI,EAAE,UAAP;AAAmBC,IAAAA,KAAK,EAAE;AAA1B,GAH4C;AAKvDI,EAAAA,cAAc,EAAE,IALuC;AAMvDC,EAAAA,WAAW,EAAE;AAN0C,CAAzD;AASA,MAAMC,uBAAuB,GAAG,WAAhC;AACA,MAAMC,UAAU,GAAG;AACjBC,EAAAA,IAAI,EAAE;AACJC,IAAAA,KAAK,EAAE,CAAC,gBAAD;AADH,GADW;AAIjBC,EAAAA,OAAO,EAAE;AACPD,IAAAA,KAAK,EAAE,CAAC,aAAD,CADA;AAEPE,IAAAA,SAAS,EAAE,CAAC,WAAD;AAFJ;AAJQ,CAAnB;AAyFA,eAAe,MAAMC,eAAN,SAA4DjB,oBAA5D,CAEb;AAAA;AAAA;;AAAA;AAAA;;AAYAkB,EAAAA,eAAe,GAAG;AAChB,UAAM;AAACC,MAAAA;AAAD,QAAO,KAAKC,OAAlB;;AACA,QAAI,CAACrB,mBAAmB,CAACsB,WAApB,CAAgCF,EAAhC,CAAL,EAA0C;AAExC,WAAKG,QAAL,CAAc;AAACC,QAAAA,SA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AAD,CAAvC;AACD;;AACD,SAAKY,QAAL,CAAc;AAACqF,MAAAA,QAAQ,EAAE7G,YAAY,CAACY,WAAD,EAAcF,SAAd,EAAyB;AAACK,QAAAA;AAAD,OAAzB;AAAvB,KAAd;AACD;;AAED6F,EAAAA,aAAa,GAAG;AACd,UAAM;AAAC5E,MAAAA;AAAD,QAAU,KAAKoB,KAAL,CAAWnC,OAA3B;;AACA,QAAIe,KAAJ,EAAW;AACTA,MAAAA,KAAK,CAAC+C,eAAN,GAAwB,IAAxB;AACD;AACF;;AAhND;;gBAFmB5D,e,eAGA,iB;;gBAHAA,e,kBAIGf,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 {\n Accessor,\n Color,\n GetPickingInfoParams,\n Layer,\n LayerContext,\n LayersList,\n log,\n PickingInfo,\n Position,\n UpdateParameters,\n DefaultProps\n} from '@deck.gl/core';\nimport GL from '@luma.gl/constants';\nimport type {Texture2D} from '@luma.gl/core';\nimport GPUGridAggregator from '../utils/gpu-grid-aggregation/gpu-grid-aggregator';\nimport {AGGREGATION_OPERATION, getValueFunc} from '../utils/aggregation-operation-utils';\nimport ScreenGridCellLayer from './screen-grid-cell-layer';\nimport GridAggregationLayer, {GridAggregationLayerProps} from '../grid-aggregation-layer';\nimport {getFloatTexture} from '../utils/resource-utils.js';\n\nconst defaultProps: DefaultProps<ScreenGridLayerProps> = {\n ...ScreenGridCellLayer.defaultProps,\n getPosition: {type: 'accessor', value: d => d.position},\n getWeight: {type: 'accessor', value: 1},\n\n gpuAggregation: true,\n aggregation: 'SUM'\n};\n\nconst POSITION_ATTRIBUTE_NAME = 'positions';\nconst DIMENSIONS = {\n data: {\n props: ['cellSizePixels']\n },\n weights: {\n props: ['aggregation'],\n accessors: ['getWeight']\n }\n};\n\n/** All properties supported by ScreenGridLayer. */\nexport type ScreenGridLayerProps<DataT = any> = _ScreenGridLayerProps<DataT> &\n GridAggregationLayerProps<DataT>;\n\n/** Properties added by ScreenGridLayer. */\nexport type _ScreenGridLayerProps<DataT> = {\n /**\n * Unit width/height of the bins.\n * @default 100\n */\n cellSizePixels?: number;\n\n /**\n * Cell margin size in pixels.\n * @default 2\n */\n cellMarginPixels?: number;\n\n /**\n * Expressed as an rgba array, minimal color that could be rendered by a tile.\n * @default [0, 0, 0, 255]\n * @deprecated Deprecated in version 5.2.0, use `colorRange` and `colorDomain` instead.\n */\n minColor?: Color | null;\n\n /**\n * Expressed as an rgba array, maximal color that could be rendered by a tile.\n * @default [0, 255, 0, 255]\n * @deprecated Deprecated in version 5.2.0, use `colorRange` and `colorDomain` instead.\n */\n maxColor?: Color | null;\n\n /**\n * Color scale input domain. The color scale maps continues numeric domain into discrete color range.\n * @default [1, max(weight)]\n */\n colorDomain?: [number, number] | null;\n\n /**\n * Specified as an array of colors [color1, color2, ...].\n *\n * @default `6-class YlOrRd` - [colorbrewer](http://colorbrewer2.org/#type=sequential&scheme=YlOrRd&n=6)\n */\n colorRange?: Color[];\n\n /**\n * Method called to retrieve the position of each object.\n *\n * @default d => d.position\n */\n getPosition?: Accessor<DataT, Position>;\n\n /**\n * The weight of each object.\n *\n * @default 1\n */\n getWeight?: Accessor<DataT, number>;\n\n /**\n * Perform aggregation is performed on GPU.\n *\n * NOTE: GPU Aggregation requires WebGL2 support by the browser.\n * When `gpuAggregation` is set to true and browser doesn't support WebGL2, aggregation falls back to CPU.\n *\n * @default true\n */\n gpuAggregation?: boolean;\n\n /**\n * Defines the type of aggregation operation\n *\n * V valid values are 'SUM', 'MEAN', 'MIN' and 'MAX'.\n *\n * @default 'SUM'\n */\n aggregation?: 'SUM' | 'MEAN' | 'MIN' | 'MAX';\n};\n\nexport default class ScreenGridLayer<DataT = any, ExtraProps = {}> extends GridAggregationLayer<\n ExtraProps & Required<_ScreenGridLayerProps<DataT>>\n> {\n static layerName = 'ScreenGridLayer';\n static defaultProps = defaultProps;\n\n state!: GridAggregationLayer['state'] & {\n supported: boolean;\n gpuGridAggregator?: any;\n gpuAggregation?: any;\n weights?: any;\n maxTexture?: Texture2D;\n };\n\n initializeState() {\n const {gl} = this.context;\n if (!ScreenGridCellLayer.isSupported(gl)) {\n // max aggregated value is sampled from a float texture\n this.setState({supported: false});\n log.error(`ScreenGridLayer: ${this.id} is not supported on this browser`)();\n return;\n }\n super.initializeAggregationLayer({\n dimensions: DIMENSIONS,\n // @ts-expect-error\n getCellSize: props => props.cellSizePixels // TODO\n });\n const weights = {\n count: {\n size: 1,\n operation: AGGREGATION_OPERATION.SUM,\n needMax: true,\n maxTexture: getFloatTexture(gl, {id: `${this.id}-max-texture`})\n }\n };\n this.setState({\n supported: true,\n projectPoints: true, // aggregation in screen space\n weights,\n subLayerData: {attributes: {}},\n maxTexture: weights.count.maxTexture,\n positionAttributeName: 'positions',\n posOffset: [0, 0],\n translation: [1, -1]\n });\n const attributeManager = this.getAttributeManager()!;\n attributeManager.add({\n [POSITION_ATTRIBUTE_NAME]: {\n size: 3,\n accessor: 'getPosition',\n type: GL.DOUBLE,\n fp64: this.use64bitPositions()\n },\n // this attribute is used in gpu aggregation path only\n count: {size: 3, accessor: 'getWeight'}\n });\n }\n\n shouldUpdateState({changeFlags}: UpdateParameters<this>) {\n return this.state.supported && changeFlags.somethingChanged;\n }\n\n updateState(opts: UpdateParameters<this>) {\n super.updateState(opts);\n }\n\n renderLayers(): LayersList | Layer {\n if (!this.state.supported) {\n return [];\n }\n const {maxTexture, numRow, numCol, weights} = this.state;\n const {updateTriggers} = this.props;\n const {aggregationBuffer} = weights.count;\n const CellLayerClass = this.getSubLayerClass('cells', ScreenGridCellLayer);\n\n return new CellLayerClass(\n this.props,\n this.getSubLayerProps({\n id: 'cell-layer',\n updateTriggers\n }),\n {\n data: {attributes: {instanceCounts: aggregationBuffer}},\n maxTexture,\n numInstances: numRow * numCol\n }\n );\n }\n\n finalizeState(context: LayerContext): void {\n super.finalizeState(context);\n\n const {aggregationBuffer, maxBuffer, maxTexture} = this.state;\n\n aggregationBuffer?.delete();\n maxBuffer?.delete();\n maxTexture?.delete();\n }\n\n getPickingInfo({info}: GetPickingInfoParams): PickingInfo {\n const {index} = info;\n if (index >= 0) {\n const {gpuGridAggregator, gpuAggregation, weights} = this.state;\n // Get count aggregation results\n const aggregationResults = gpuAggregation\n ? gpuGridAggregator.getData('count')\n : weights.count;\n\n // Each instance (one cell) is aggregated into single pixel,\n // Get current instance's aggregation details.\n info.object = GPUGridAggregator.getAggregationData({\n pixelIndex: index,\n ...aggregationResults\n });\n }\n\n return info;\n }\n\n // Aggregation Overrides\n\n updateResults({aggregationData, maxData}) {\n const {count} = this.state.weights;\n count.aggregationData = aggregationData;\n count.aggregationBuffer.setData({data: aggregationData});\n count.maxData = maxData;\n count.maxTexture.setImageData({data: maxData});\n }\n\n /* eslint-disable complexity, max-statements */\n updateAggregationState(opts) {\n const cellSize = opts.props.cellSizePixels;\n const cellSizeChanged = opts.oldProps.cellSizePixels !== cellSize;\n const {viewportChanged} = opts.changeFlags;\n let gpuAggregation = opts.props.gpuAggregation;\n if (this.state.gpuAggregation !== opts.props.gpuAggregation) {\n if (gpuAggregation && !GPUGridAggregator.isSupported(this.context.gl)) {\n log.warn('GPU Grid Aggregation not supported, falling back to CPU')();\n gpuAggregation = false;\n }\n }\n const gpuAggregationChanged = gpuAggregation !== this.state.gpuAggregation;\n this.setState({\n gpuAggregation\n });\n\n const positionsChanged = this.isAttributeChanged(POSITION_ATTRIBUTE_NAME);\n\n const {dimensions} = this.state;\n const {data, weights} = dimensions;\n const aggregationDataDirty =\n positionsChanged ||\n gpuAggregationChanged ||\n viewportChanged ||\n this.isAggregationDirty(opts, {\n compareAll: gpuAggregation, // check for all (including extentions props) when using gpu aggregation\n dimension: data\n });\n const aggregationWeightsDirty = this.isAggregationDirty(opts, {dimension: weights});\n\n this.setState({\n aggregationDataDirty,\n aggregationWeightsDirty\n });\n\n const {viewport} = this.context;\n\n if (viewportChanged || cellSizeChanged) {\n const {width, height} = viewport;\n const numCol = Math.ceil(width / cellSize);\n const numRow = Math.ceil(height / cellSize);\n this.allocateResources(numRow, numCol);\n this.setState({\n // transformation from clipspace to screen(pixel) space\n scaling: [width / 2, -height / 2, 1],\n\n gridOffset: {xOffset: cellSize, yOffset: cellSize},\n width,\n height,\n numCol,\n numRow\n });\n }\n\n if (aggregationWeightsDirty) {\n this._updateAccessors(opts);\n }\n if (aggregationDataDirty || aggregationWeightsDirty) {\n this._resetResults();\n }\n }\n /* eslint-enable complexity, max-statements */\n\n // Private\n\n _updateAccessors(opts) {\n const {getWeight, aggregation, data} = opts.props;\n const {count} = this.state.weights;\n if (count) {\n count.getWeight = getWeight;\n count.operation = AGGREGATION_OPERATION[aggregation];\n }\n this.setState({getValue: getValueFunc(aggregation, getWeight, {data})});\n }\n\n _resetResults() {\n const {count} = this.state.weights;\n if (count) {\n count.aggregationData = null;\n }\n }\n}\n"],"file":"screen-grid-layer.js"}
|
|
1
|
+
{"version":3,"sources":["../../../src/screen-grid-layer/screen-grid-layer.ts"],"names":["log","GPUGridAggregator","AGGREGATION_OPERATION","getValueFunc","ScreenGridCellLayer","GridAggregationLayer","getFloatTexture","defaultProps","getPosition","type","value","d","position","getWeight","gpuAggregation","aggregation","POSITION_ATTRIBUTE_NAME","DIMENSIONS","data","props","weights","accessors","ScreenGridLayer","initializeState","gl","context","isSupported","setState","supported","error","id","initializeAggregationLayer","dimensions","getCellSize","cellSizePixels","count","size","operation","SUM","needMax","maxTexture","projectPoints","subLayerData","attributes","positionAttributeName","posOffset","translation","attributeManager","getAttributeManager","add","accessor","fp64","use64bitPositions","shouldUpdateState","changeFlags","state","somethingChanged","updateState","opts","renderLayers","numRow","numCol","updateTriggers","aggregationBuffer","CellLayerClass","getSubLayerClass","getSubLayerProps","instanceCounts","numInstances","finalizeState","maxBuffer","delete","getPickingInfo","info","index","gpuGridAggregator","aggregationResults","getData","object","getAggregationData","pixelIndex","updateResults","aggregationData","maxData","setData","setImageData","updateAggregationState","cellSize","cellSizeChanged","oldProps","viewportChanged","warn","gpuAggregationChanged","positionsChanged","isAttributeChanged","aggregationDataDirty","isAggregationDirty","compareAll","dimension","aggregationWeightsDirty","viewport","width","height","Math","ceil","allocateResources","scaling","gridOffset","xOffset","yOffset","_updateAccessors","_resetResults","getValue"],"mappings":";AAoBA,SAOEA,GAPF,QAYO,eAZP;AAeA,OAAOC,iBAAP,MAA8B,mDAA9B;AACA,SAAQC,qBAAR,EAA+BC,YAA/B,QAAkD,sCAAlD;AACA,OAAOC,mBAAP,MAAgC,0BAAhC;AACA,OAAOC,oBAAP,MAA8D,2BAA9D;AACA,SAAQC,eAAR,QAA8B,4BAA9B;AAEA,MAAMC,YAAgD,GAAG,EACvD,GAAGH,mBAAmB,CAACG,YADgC;AAEvDC,EAAAA,WAAW,EAAE;AAACC,IAAAA,IAAI,EAAE,UAAP;AAAmBC,IAAAA,KAAK,EAAEC,CAAC,IAAIA,CAAC,CAACC;AAAjC,GAF0C;AAGvDC,EAAAA,SAAS,EAAE;AAACJ,IAAAA,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AACC,UAAAA,OAAO,EAAErB,QAAV;AAAoBsB,UAAAA,OAAO,EAAEtB;AAA7B,SAJA;AAKZc,QAAAA,KALY;AAMZC,QAAAA,MANY;AAOZzC,QAAAA,MAPY;AAQZD,QAAAA;AARY,OAAd;AAUD;;AAED,QAAIuC,uBAAJ,EAA6B;AAC3B,WAAKW,gBAAL,CAAsBpD,IAAtB;AACD;;AACD,QAAIqC,oBAAoB,IAAII,uBAA5B,EAAqD;AACnD,WAAKY,aAAL;AACD;AACF;;AAKDD,EAAAA,gBAAgB,CAACpD,IAAD,EAAO;AACrB,UAAM;AAAC7C,MAAAA,SAAD;AAAYE,MAAAA,WAAZ;AAAyBG,MAAAA;AAAzB,QAAiCwC,IAAI,CAACvC,KAA5C;AACA,UAAM;AAACgB,MAAAA;AAAD,QAAU,KAAKoB,KAAL,CAAWnC,OAA3B;;AACA,QAAIe,KAAJ,EAAW;AACTA,MAAAA,KAAK,CAACtB,SAAN,GAAkBA,SAAlB;AACAsB,MAAAA,KAAK,CAACE,SAAN,GAAkBnC,qBAAqB,CAACa,WAAD,CAAvC;AACD;;AACD,SAAKY,QAAL,CAAc;AAACqF,MAAAA,QAAQ,EAAE7G,YAAY,CAACY,WAAD,EAAcF,SAAd,EAAyB;AAACK,QAAAA;AAAD,OAAzB;AAAvB,KAAd;AACD;;AAED6F,EAAAA,aAAa,GAAG;AACd,UAAM;AAAC5E,MAAAA;AAAD,QAAU,KAAKoB,KAAL,CAAWnC,OAA3B;;AACA,QAAIe,KAAJ,EAAW;AACTA,MAAAA,KAAK,CAAC+C,eAAN,GAAwB,IAAxB;AACD;AACF;;AAhND;;gBAFmB5D,e,eAGA,iB;;gBAHAA,e,kBAIGf,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 {\n Accessor,\n Color,\n GetPickingInfoParams,\n Layer,\n LayerContext,\n LayersList,\n log,\n PickingInfo,\n Position,\n UpdateParameters,\n DefaultProps\n} from '@deck.gl/core';\nimport GL from '@luma.gl/constants';\nimport type {Texture2D} from '@luma.gl/core';\nimport GPUGridAggregator from '../utils/gpu-grid-aggregation/gpu-grid-aggregator';\nimport {AGGREGATION_OPERATION, getValueFunc} from '../utils/aggregation-operation-utils';\nimport ScreenGridCellLayer from './screen-grid-cell-layer';\nimport GridAggregationLayer, {GridAggregationLayerProps} from '../grid-aggregation-layer';\nimport {getFloatTexture} from '../utils/resource-utils.js';\n\nconst defaultProps: DefaultProps<ScreenGridLayerProps> = {\n ...ScreenGridCellLayer.defaultProps,\n getPosition: {type: 'accessor', value: d => d.position},\n getWeight: {type: 'accessor', value: 1},\n\n gpuAggregation: true,\n aggregation: 'SUM'\n};\n\nconst POSITION_ATTRIBUTE_NAME = 'positions';\nconst DIMENSIONS = {\n data: {\n props: ['cellSizePixels']\n },\n weights: {\n props: ['aggregation'],\n accessors: ['getWeight']\n }\n};\n\n/** All properties supported by ScreenGridLayer. */\nexport type ScreenGridLayerProps<DataT = any> = _ScreenGridLayerProps<DataT> &\n GridAggregationLayerProps<DataT>;\n\n/** Properties added by ScreenGridLayer. */\nexport type _ScreenGridLayerProps<DataT> = {\n /**\n * Unit width/height of the bins.\n * @default 100\n */\n cellSizePixels?: number;\n\n /**\n * Cell margin size in pixels.\n * @default 2\n */\n cellMarginPixels?: number;\n\n /**\n * Expressed as an rgba array, minimal color that could be rendered by a tile.\n * @default [0, 0, 0, 255]\n * @deprecated Deprecated in version 5.2.0, use `colorRange` and `colorDomain` instead.\n */\n minColor?: Color | null;\n\n /**\n * Expressed as an rgba array, maximal color that could be rendered by a tile.\n * @default [0, 255, 0, 255]\n * @deprecated Deprecated in version 5.2.0, use `colorRange` and `colorDomain` instead.\n */\n maxColor?: Color | null;\n\n /**\n * Color scale input domain. The color scale maps continues numeric domain into discrete color range.\n * @default [1, max(weight)]\n */\n colorDomain?: [number, number] | null;\n\n /**\n * Specified as an array of colors [color1, color2, ...].\n *\n * @default `6-class YlOrRd` - [colorbrewer](http://colorbrewer2.org/#type=sequential&scheme=YlOrRd&n=6)\n */\n colorRange?: Color[];\n\n /**\n * Method called to retrieve the position of each object.\n *\n * @default d => d.position\n */\n getPosition?: Accessor<DataT, Position>;\n\n /**\n * The weight of each object.\n *\n * @default 1\n */\n getWeight?: Accessor<DataT, number>;\n\n /**\n * Perform aggregation is performed on GPU.\n *\n * NOTE: GPU Aggregation requires WebGL2 support by the browser.\n * When `gpuAggregation` is set to true and browser doesn't support WebGL2, aggregation falls back to CPU.\n *\n * @default true\n */\n gpuAggregation?: boolean;\n\n /**\n * Defines the type of aggregation operation\n *\n * V valid values are 'SUM', 'MEAN', 'MIN' and 'MAX'.\n *\n * @default 'SUM'\n */\n aggregation?: 'SUM' | 'MEAN' | 'MIN' | 'MAX';\n};\n\n/** Aggregates data into histogram bins and renders them as a grid. */\nexport default class ScreenGridLayer<DataT = any, ExtraProps = {}> extends GridAggregationLayer<\n ExtraProps & Required<_ScreenGridLayerProps<DataT>>\n> {\n static layerName = 'ScreenGridLayer';\n static defaultProps = defaultProps;\n\n state!: GridAggregationLayer['state'] & {\n supported: boolean;\n gpuGridAggregator?: any;\n gpuAggregation?: any;\n weights?: any;\n maxTexture?: Texture2D;\n };\n\n initializeState() {\n const {gl} = this.context;\n if (!ScreenGridCellLayer.isSupported(gl)) {\n // max aggregated value is sampled from a float texture\n this.setState({supported: false});\n log.error(`ScreenGridLayer: ${this.id} is not supported on this browser`)();\n return;\n }\n super.initializeAggregationLayer({\n dimensions: DIMENSIONS,\n // @ts-expect-error\n getCellSize: props => props.cellSizePixels // TODO\n });\n const weights = {\n count: {\n size: 1,\n operation: AGGREGATION_OPERATION.SUM,\n needMax: true,\n maxTexture: getFloatTexture(gl, {id: `${this.id}-max-texture`})\n }\n };\n this.setState({\n supported: true,\n projectPoints: true, // aggregation in screen space\n weights,\n subLayerData: {attributes: {}},\n maxTexture: weights.count.maxTexture,\n positionAttributeName: 'positions',\n posOffset: [0, 0],\n translation: [1, -1]\n });\n const attributeManager = this.getAttributeManager()!;\n attributeManager.add({\n [POSITION_ATTRIBUTE_NAME]: {\n size: 3,\n accessor: 'getPosition',\n type: GL.DOUBLE,\n fp64: this.use64bitPositions()\n },\n // this attribute is used in gpu aggregation path only\n count: {size: 3, accessor: 'getWeight'}\n });\n }\n\n shouldUpdateState({changeFlags}: UpdateParameters<this>) {\n return this.state.supported && changeFlags.somethingChanged;\n }\n\n updateState(opts: UpdateParameters<this>) {\n super.updateState(opts);\n }\n\n renderLayers(): LayersList | Layer {\n if (!this.state.supported) {\n return [];\n }\n const {maxTexture, numRow, numCol, weights} = this.state;\n const {updateTriggers} = this.props;\n const {aggregationBuffer} = weights.count;\n const CellLayerClass = this.getSubLayerClass('cells', ScreenGridCellLayer);\n\n return new CellLayerClass(\n this.props,\n this.getSubLayerProps({\n id: 'cell-layer',\n updateTriggers\n }),\n {\n data: {attributes: {instanceCounts: aggregationBuffer}},\n maxTexture,\n numInstances: numRow * numCol\n }\n );\n }\n\n finalizeState(context: LayerContext): void {\n super.finalizeState(context);\n\n const {aggregationBuffer, maxBuffer, maxTexture} = this.state;\n\n aggregationBuffer?.delete();\n maxBuffer?.delete();\n maxTexture?.delete();\n }\n\n getPickingInfo({info}: GetPickingInfoParams): PickingInfo {\n const {index} = info;\n if (index >= 0) {\n const {gpuGridAggregator, gpuAggregation, weights} = this.state;\n // Get count aggregation results\n const aggregationResults = gpuAggregation\n ? gpuGridAggregator.getData('count')\n : weights.count;\n\n // Each instance (one cell) is aggregated into single pixel,\n // Get current instance's aggregation details.\n info.object = GPUGridAggregator.getAggregationData({\n pixelIndex: index,\n ...aggregationResults\n });\n }\n\n return info;\n }\n\n // Aggregation Overrides\n\n updateResults({aggregationData, maxData}) {\n const {count} = this.state.weights;\n count.aggregationData = aggregationData;\n count.aggregationBuffer.setData({data: aggregationData});\n count.maxData = maxData;\n count.maxTexture.setImageData({data: maxData});\n }\n\n /* eslint-disable complexity, max-statements */\n updateAggregationState(opts) {\n const cellSize = opts.props.cellSizePixels;\n const cellSizeChanged = opts.oldProps.cellSizePixels !== cellSize;\n const {viewportChanged} = opts.changeFlags;\n let gpuAggregation = opts.props.gpuAggregation;\n if (this.state.gpuAggregation !== opts.props.gpuAggregation) {\n if (gpuAggregation && !GPUGridAggregator.isSupported(this.context.gl)) {\n log.warn('GPU Grid Aggregation not supported, falling back to CPU')();\n gpuAggregation = false;\n }\n }\n const gpuAggregationChanged = gpuAggregation !== this.state.gpuAggregation;\n this.setState({\n gpuAggregation\n });\n\n const positionsChanged = this.isAttributeChanged(POSITION_ATTRIBUTE_NAME);\n\n const {dimensions} = this.state;\n const {data, weights} = dimensions;\n const aggregationDataDirty =\n positionsChanged ||\n gpuAggregationChanged ||\n viewportChanged ||\n this.isAggregationDirty(opts, {\n compareAll: gpuAggregation, // check for all (including extentions props) when using gpu aggregation\n dimension: data\n });\n const aggregationWeightsDirty = this.isAggregationDirty(opts, {dimension: weights});\n\n this.setState({\n aggregationDataDirty,\n aggregationWeightsDirty\n });\n\n const {viewport} = this.context;\n\n if (viewportChanged || cellSizeChanged) {\n const {width, height} = viewport;\n const numCol = Math.ceil(width / cellSize);\n const numRow = Math.ceil(height / cellSize);\n this.allocateResources(numRow, numCol);\n this.setState({\n // transformation from clipspace to screen(pixel) space\n scaling: [width / 2, -height / 2, 1],\n\n gridOffset: {xOffset: cellSize, yOffset: cellSize},\n width,\n height,\n numCol,\n numRow\n });\n }\n\n if (aggregationWeightsDirty) {\n this._updateAccessors(opts);\n }\n if (aggregationDataDirty || aggregationWeightsDirty) {\n this._resetResults();\n }\n }\n /* eslint-enable complexity, max-statements */\n\n // Private\n\n _updateAccessors(opts) {\n const {getWeight, aggregation, data} = opts.props;\n const {count} = this.state.weights;\n if (count) {\n count.getWeight = getWeight;\n count.operation = AGGREGATION_OPERATION[aggregation];\n }\n this.setState({getValue: getValueFunc(aggregation, getWeight, {data})});\n }\n\n _resetResults() {\n const {count} = this.state.weights;\n if (count) {\n count.aggregationData = null;\n }\n }\n}\n"],"file":"screen-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.
|
|
5
|
+
"version": "8.8.1",
|
|
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": "
|
|
43
|
+
"gitHead": "fb84b75176a1c2114411e8d0b4063de594023567"
|
|
44
44
|
}
|
|
@@ -137,6 +137,8 @@ export type _ContourLayerProps<DataT> = {
|
|
|
137
137
|
*/
|
|
138
138
|
getWeight?: Accessor<DataT, number>;
|
|
139
139
|
};
|
|
140
|
+
|
|
141
|
+
/** Aggregate data into iso-lines or iso-bands for a given threshold and cell size. */
|
|
140
142
|
export default class ContourLayer<DataT = any, ExtraPropsT = {}> extends GridAggregationLayer<
|
|
141
143
|
ExtraPropsT & Required<_ContourLayerProps<DataT>>
|
|
142
144
|
> {
|
|
@@ -237,6 +237,7 @@ export type _CPUGridLayerProps<DataT> = {
|
|
|
237
237
|
_filterData: null | ((d: DataT) => boolean);
|
|
238
238
|
};
|
|
239
239
|
|
|
240
|
+
/** Aggregate data into a grid-based heatmap. Aggregation is performed on CPU. */
|
|
240
241
|
export default class CPUGridLayer<DataT = any, ExtraPropsT = {}> extends AggregationLayer<
|
|
241
242
|
ExtraPropsT & Required<_CPUGridLayerProps<DataT>>
|
|
242
243
|
> {
|
|
@@ -168,9 +168,7 @@ export type _GPUGridLayerProps<DataT> = {
|
|
|
168
168
|
getElevationWeight?: Accessor<DataT, number>;
|
|
169
169
|
};
|
|
170
170
|
|
|
171
|
-
/**
|
|
172
|
-
* The `GPUGridLayer` renders a grid heatmap based on an array of inputs.
|
|
173
|
-
*/
|
|
171
|
+
/** Aggregate data into a grid-based heatmap. Aggregation is performed on GPU (WebGL2 only). */
|
|
174
172
|
export default class GPUGridLayer<DataT = any, ExtraPropsT = {}> extends GridAggregationLayer<
|
|
175
173
|
ExtraPropsT & Required<_GPUGridLayerProps<DataT>>
|
|
176
174
|
> {
|
|
@@ -34,6 +34,7 @@ type _GridLayerProps<DataT> = _CPUGridLayerProps<DataT> &
|
|
|
34
34
|
gpuAggregation?: boolean;
|
|
35
35
|
};
|
|
36
36
|
|
|
37
|
+
/** Aggregate data into a grid-based heatmap. The color and height of a cell are determined based on the objects it contains. */
|
|
37
38
|
export default class GridLayer<DataT = any, ExtraPropsT = {}> extends CompositeLayer<
|
|
38
39
|
ExtraPropsT & Required<_GridLayerProps<DataT>>
|
|
39
40
|
> {
|
|
@@ -186,6 +186,7 @@ type _HeatmapLayerProps<DataT> = {
|
|
|
186
186
|
getWeight?: Accessor<DataT, number>;
|
|
187
187
|
};
|
|
188
188
|
|
|
189
|
+
/** Visualizes the spatial distribution of data. */
|
|
189
190
|
export default class HeatmapLayer<DataT = any, ExtraPropsT = {}> extends AggregationLayer<
|
|
190
191
|
ExtraPropsT & Required<_HeatmapLayerProps<DataT>>
|
|
191
192
|
> {
|
|
@@ -246,6 +246,7 @@ type _HexagonLayerProps<DataT = any> = {
|
|
|
246
246
|
_filterData: null | ((d: DataT) => boolean);
|
|
247
247
|
};
|
|
248
248
|
|
|
249
|
+
/** Aggregates data into a hexagon-based heatmap. The color and height of a hexagon are determined based on the objects it contains. */
|
|
249
250
|
export default class HexagonLayer<ExtraPropsT = {}> extends AggregationLayer<
|
|
250
251
|
ExtraPropsT & Required<_HexagonLayerProps>
|
|
251
252
|
> {
|
|
@@ -138,6 +138,7 @@ export type _ScreenGridLayerProps<DataT> = {
|
|
|
138
138
|
aggregation?: 'SUM' | 'MEAN' | 'MIN' | 'MAX';
|
|
139
139
|
};
|
|
140
140
|
|
|
141
|
+
/** Aggregates data into histogram bins and renders them as a grid. */
|
|
141
142
|
export default class ScreenGridLayer<DataT = any, ExtraProps = {}> extends GridAggregationLayer<
|
|
142
143
|
ExtraProps & Required<_ScreenGridLayerProps<DataT>>
|
|
143
144
|
> {
|
|
@@ -59,6 +59,7 @@ export declare type _ContourLayerProps<DataT> = {
|
|
|
59
59
|
*/
|
|
60
60
|
getWeight?: Accessor<DataT, number>;
|
|
61
61
|
};
|
|
62
|
+
/** Aggregate data into iso-lines or iso-bands for a given threshold and cell size. */
|
|
62
63
|
export default class ContourLayer<DataT = any, ExtraPropsT = {}> extends GridAggregationLayer<ExtraPropsT & Required<_ContourLayerProps<DataT>>> {
|
|
63
64
|
static layerName: string;
|
|
64
65
|
static defaultProps: DefaultProps<ContourLayerProps<any>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contour-layer.d.ts","sourceRoot":"","sources":["../../src/contour-layer/contour-layer.ts"],"names":[],"mappings":"AAuBA,OAAO,EACL,Q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AAI;IA2BvB,WAAW,CAAC,IAAI,EAAE,gBAAgB,CAAC,IAAI,CAAC,GAAG,IAAI;IAgB/C,YAAY,IAAI,KAAK,EAAE;IA4CvB,sBAAsB,CAAC,IAAI,KAAA;IAyE3B,OAAO,CAAC,gBAAgB;IAUxB,OAAO,CAAC,aAAa;IASrB,OAAO,CAAC,iBAAiB;IAsBzB,OAAO,CAAC,oBAAoB;CAc7B"}
|
|
@@ -138,6 +138,7 @@ export declare type _CPUGridLayerProps<DataT> = {
|
|
|
138
138
|
*/
|
|
139
139
|
_filterData: null | ((d: DataT) => boolean);
|
|
140
140
|
};
|
|
141
|
+
/** Aggregate data into a grid-based heatmap. Aggregation is performed on CPU. */
|
|
141
142
|
export default class CPUGridLayer<DataT = any, ExtraPropsT = {}> extends AggregationLayer<ExtraPropsT & Required<_CPUGridLayerProps<DataT>>> {
|
|
142
143
|
static layerName: string;
|
|
143
144
|
static defaultProps: DefaultProps<CPUGridLayerProps<any>>;
|
|
@@ -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,KAAK,CAAC,GACpE,qBAAqB,CAAC,KAAK,CAAC,CAAC;A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KAAK,IAAI,CAAC;IAE1D;;OAEG;IACH,WAAW,EAAE,IAAI,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,KAAK,OAAO,CAAC,CAAC;CAC7C,CAAC;AAEF,iFAAiF;AACjF,MAAM,CAAC,OAAO,OAAO,YAAY,CAAC,KAAK,GAAG,GAAG,EAAE,WAAW,GAAG,EAAE,CAAE,SAAQ,gBAAgB,CACvF,WAAW,GAAG,QAAQ,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC,CAClD;IACC,MAAM,CAAC,SAAS,SAAkB;IAClC,MAAM,CAAC,YAAY,uCAAgB;IAEnC,eAAe,IAAI,IAAI;IAkBvB,WAAW,CAAC,IAAI,EAAE,gBAAgB,CAAC,IAAI,CAAC;IAYxC,cAAc,CAAC,EAAC,IAAI,EAAC,EAAE,oBAAoB,GAAG,WAAW;IAKzD,mBAAmB,CAAC,IAAI,KAAA;IAKxB,uBAAuB,CAAC,IAAI,KAAA;IAI5B,0BAA0B;IAI1B,YAAY,IAAI,KAAK;CA8BtB"}
|
|
@@ -77,9 +77,7 @@ export declare type _GPUGridLayerProps<DataT> = {
|
|
|
77
77
|
*/
|
|
78
78
|
getElevationWeight?: Accessor<DataT, number>;
|
|
79
79
|
};
|
|
80
|
-
/**
|
|
81
|
-
* The `GPUGridLayer` renders a grid heatmap based on an array of inputs.
|
|
82
|
-
*/
|
|
80
|
+
/** Aggregate data into a grid-based heatmap. Aggregation is performed on GPU (WebGL2 only). */
|
|
83
81
|
export default class GPUGridLayer<DataT = any, ExtraPropsT = {}> extends GridAggregationLayer<ExtraPropsT & Required<_GPUGridLayerProps<DataT>>> {
|
|
84
82
|
static layerName: string;
|
|
85
83
|
static defaultProps: DefaultProps<GPUGridLayerProps<any>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gpu-grid-layer.d.ts","sourceRoot":"","sources":["../../src/gpu-grid-layer/gpu-grid-layer.ts"],"names":[],"mappings":"AAsBA,OAAO,EACL,QA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ataT> & _GPUGridLayerP
|
|
|
16
16
|
*/
|
|
17
17
|
gpuAggregation?: boolean;
|
|
18
18
|
};
|
|
19
|
+
/** Aggregate data into a grid-based heatmap. The color and height of a cell are determined based on the objects it contains. */
|
|
19
20
|
export default class GridLayer<DataT = any, ExtraPropsT = {}> extends CompositeLayer<ExtraPropsT & Required<_GridLayerProps<DataT>>> {
|
|
20
21
|
static layerName: string;
|
|
21
22
|
static defaultProps: DefaultProps<GridLayerProps<any>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grid-layer.d.ts","sourceRoot":"","sources":["../../src/grid-layer/grid-layer.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,KAAK,EACL,gBAAgB,EAChB,YAAY,EACb,MAAM,eAAe,CAAC;AAEvB,OAAqB,EAAC,kBAAkB,EAAC,MAAM,kCAAkC,CAAC;AAClF,OAAqB,EAAC,kBAAkB,EAAC,MAAM,kCAAkC,CAAC;AAQlF,6CAA6C;AAC7C,oBAAY,cAAc,CAAC,KAAK,GAAG,GAAG,IAAI,eAAe,CAAC,KAAK,CAAC,GAAG,mBAAmB,CAAC,KAAK,CAAC,CAAC;AAE9F,qCAAqC;AACrC,aAAK,eAAe,CAAC,KAAK,IAAI,kBAAkB,CAAC,KAAK,CAAC,GACrD,kBAAkB,CAAC,KAAK,CAAC,GAAG;IAC1B;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IAEf;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEJ,MAAM,CAAC,OAAO,OAAO,SAAS,CAAC,KAAK,GAAG,GAAG,EAAE,WAAW,GAAG,EAAE,CAAE,SAAQ,cAAc,CAClF,WAAW,GAAG,QAAQ,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,CAC/C;IACC,MAAM,CAAC,SAAS,SAAe;IAC/B,MAAM,CAAC,YAAY,oCAAgB;IAEnC,KAAK,EAAG,cA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AC;KAC5B,CAAC;IAEF,eAAe;IAMf,WAAW,CAAC,EAAC,KAAK,EAAC,EAAE,gBAAgB,CAAC,IAAI,CAAC;IAM3C,YAAY,IAAI,KAAK;IAoBrB,oBAAoB,CAAC,KAAK,EAAE,SAAS,CAAC,OAAO,CAAC;CA8B/C"}
|
|
@@ -68,6 +68,7 @@ declare type _HeatmapLayerProps<DataT> = {
|
|
|
68
68
|
*/
|
|
69
69
|
getWeight?: Accessor<DataT, number>;
|
|
70
70
|
};
|
|
71
|
+
/** Visualizes the spatial distribution of data. */
|
|
71
72
|
export default class HeatmapLayer<DataT = any, ExtraPropsT = {}> extends AggregationLayer<ExtraPropsT & Required<_HeatmapLayerProps<DataT>>> {
|
|
72
73
|
static layerName: string;
|
|
73
74
|
static defaultProps: DefaultProps<HeatmapLayerProps<any>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"heatmap-layer.d.ts","sourceRoot":"","sources":["../../src/heatmap-layer/heatmap-layer.ts"],"names":[],"mappings":"AA8BA,OAAO,EACL,MAAM,EACN,SAAS,EAMV,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,QAAQ,EACR,gBAAgB,EAChB,gBAAgB,EAChB,WAAW,EACX,KAAK,EAEL,KAAK,EACL,YAAY,EACZ,UAAU,EAEV,QAAQ,EACR,gBAAgB,EAChB,YAAY,EACb,MAAM,eAAe,CAAC;AAEvB,OAAO,gBAAgB,EAAE,EAAC,qBAAqB,EAAC,MAAM,sBAAsB,CAAC;AAsD7E,oBAAY,iBAAiB,CAAC,KAAK,GAAG,GAAG,IAAI,kBAAkB,CAAC,KAAK,CAAC,GACpE,qBAAqB,CAAC,KAAK,CAAC,CAAC;AAE/B,aAAK,kBAAkB,CAAC,KAAK,IAAI;IAC/B;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;;OAIG;IACH,UAAU,CAAC,EAAE,KAAK,EAAE,CAAC;IAErB;;;;OAIG;IACH,SAAS,CAAC,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CAAC,EAAE,MAAM,CAAC;QACd,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;QACvB,sBAAsB,CAAC,EAAE,MAAM,EAAE,CAAC;QAClC,WAAW,CAAC,EAAE,GAAG,CAAC;QAClB,iBAAiB,CAAC,EAAE,MAAM,CAAC;QAC3B,iBAAiB,CAAC,EAAE,MAAM,CAAC;KAC5B,CAAC;IAEF,eAAe;IAcf,iBAAiB,CAAC,EAAC,WAAW,EAAC,EAAE,gBAAgB,CAAC,IAAI,CAAC;IAMvD,WAAW,CAAC,IAAI,EAAE,gBAAgB,CAAC,IAAI,CAAC;IAQxC,mBAAmB,CAAC,IAAI,EAAE,gBAAgB,CAAC,IAAI,CAAC;IA8BhD,YAAY,IAAI,UAAU,GAAG,KAAK;IA2ClC,aAAa,CAAC,OAAO,EAAE,YAAY;IA2BnC,oBAAoB;IAOpB,eAAe,CAAC,IAAI,EAAE,gBAAgB,CAAC,IAAI,CAAC;;;;IAsB5C,eAAe;IAgBf,gBAAgB;IAShB,mBAAmB;IAgBnB,UAAU,CAAC,IAAI,KAAA;IAcf,uBAAuB,CAAC,OAAO,KAAK;IAgBpC,eAAe;IAqCf,aAAa,CAAC,aAAa,KAAA;IAK3B,qBAAqB;IAarB,aAAa,CAAC,WAAW,GAAE,GAAW,GAAG,OAAO;IAkDhD,6BAA6B;IAe7B,mBAAmB,CAAC,IAAI,KAAA;IAqBxB,gBAAgB;IAwDhB,yBAAyB,CAAC,SAAS,UAAQ;IAsB3C,oBAAoB,CAAC,WAAW,KAAA,EAAE,IAAI,GAAE;QAAC,wBAAwB,CAAC,EAAE,OAAO,CAAA;KAAM;IA0CjF,oBAAoB,CAAC,YAAY,KAAA;CAQlC"}
|
|
@@ -143,6 +143,7 @@ declare type _HexagonLayerProps<DataT = any> = {
|
|
|
143
143
|
*/
|
|
144
144
|
_filterData: null | ((d: DataT) => boolean);
|
|
145
145
|
};
|
|
146
|
+
/** Aggregates data into a hexagon-based heatmap. The color and height of a hexagon are determined based on the objects it contains. */
|
|
146
147
|
export default class HexagonLayer<ExtraPropsT = {}> extends AggregationLayer<ExtraPropsT & Required<_HexagonLayerProps>> {
|
|
147
148
|
static layerName: string;
|
|
148
149
|
static defaultProps: DefaultProps<HexagonLayerProps<any>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hexagon-layer.d.ts","sourceRoot":"","sources":["../../src/hexagon-layer/hexagon-layer.ts"],"names":[],"mappings":"AAoBA,OAAO,EACL,QAAQ,EACR,gBAAgB,EAChB,KAAK,EAEL,QAAQ,EACR,QAAQ,EACR,gBAAgB,EAChB,YAAY,EACb,MAAM,eAAe,CAAC;AACvB,OAAO,EAAC,WAAW,EAAC,MAAM,iBAAiB,CAAC;AAK5C,OAAO,aAAa,MAAM,yBAAyB,CAAC;AACpD,OAAO,gBAAgB,EAAE,EAAC,qBAAqB,EAAC,MAAM,sBAAsB,CAAC;AAG7E,OAAO,EAAC,iBAAiB,EAAC,MAAM,UAAU,CAAC;AAyC3C,mDAAmD;AACnD,oBAAY,iBAAiB,CAAC,KAAK,GAAG,GAAG,IAAI,kBAAkB,CAAC,KAAK,CAAC,GACpE,qBAAqB,CAAC,KAAK,CAAC,CAAC;AAE/B,wCAAwC;AACxC,aAAK,kBAAkB,CAAC,KAAK,GAAG,GAAG,IAAI;IACrC;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,KAAK,GAAG,CAAC;IAErD;;;OAGG;IACH,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC;IAEtC;;;OAGG;IACH,UAAU,CAAC,EAAE,KAAK,EAAE,CAAC;IAErB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;OAGG;IACH,eAAe,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC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AC;QAC7B,eAAe,EAAE,GAAG,CAAC;KACtB,CAAC;IACF,eAAe;IAmBf,WAAW,CAAC,IAAI,EAAE,gBAAgB,CAAC,IAAI,CAAC;IAwBxC,0BAA0B,CAAC,eAAe,KAAA;IA6B1C,cAAc,CAAC,EAAC,IAAI,EAAC;;KAAA;IAKrB,mBAAmB,CAAC,IAAI,KAAA;IAKxB,uBAAuB,CAAC,IAAI,KAAA;IAI5B,0BAA0B;IAI1B,YAAY;CAwCb"}
|
|
@@ -68,6 +68,7 @@ export declare type _ScreenGridLayerProps<DataT> = {
|
|
|
68
68
|
*/
|
|
69
69
|
aggregation?: 'SUM' | 'MEAN' | 'MIN' | 'MAX';
|
|
70
70
|
};
|
|
71
|
+
/** Aggregates data into histogram bins and renders them as a grid. */
|
|
71
72
|
export default class ScreenGridLayer<DataT = any, ExtraProps = {}> extends GridAggregationLayer<ExtraProps & Required<_ScreenGridLayerProps<DataT>>> {
|
|
72
73
|
static layerName: string;
|
|
73
74
|
static defaultProps: DefaultProps<ScreenGridLayerProps<any>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"screen-grid-layer.d.ts","sourceRoot":"","sources":["../../src/screen-grid-layer/screen-grid-layer.ts"],"names":[],"mappings":"AAoBA,OAAO,EACL,QAAQ,EACR,KAAK,EACL,oBAAoB,EACpB,KAAK,EACL,YAAY,EACZ,UAAU,EAEV,WAAW,EACX,QAAQ,EACR,gBAAgB,EAChB,YAAY,EACb,MAAM,eAAe,CAAC;AAEvB,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,eAAe,CAAC;AAI7C,OAAO,oBAAoB,EAAE,EAAC,yBAAyB,EAAC,MAAM,2BAA2B,CAAC;AAuB1F,mDAAmD;AACnD,oBAAY,oBAAoB,CAAC,KAAK,GAAG,GAAG,IAAI,qBAAqB,CAAC,KAAK,CAAC,GAC1E,yBAAyB,CAAC,KAAK,CAAC,CAAC;AAEnC,2CAA2C;AAC3C,oBAAY,qBAAqB,CA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zD,aAAa,CAAC,EAAC,eAAe,EAAE,OAAO,EAAC;;;KAAA;IASxC,sBAAsB,CAAC,IAAI,KAAA;IAiE3B,gBAAgB,CAAC,IAAI,KAAA;IAUrB,aAAa;CAMd"}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
# AggregationLayer
|
|
2
|
-
|
|
3
|
-
All of the layers in `@deck.gl/aggregation-layers` module perform some sort of data aggregation. All these layers perform aggregation with different parameters (CPU vs GPU, aggregation to rectangular bins vs hexagon bins, world space vs screen space, aggregation of single weight vs multiple weights etc).
|
|
4
|
-
|
|
5
|
-
`AggregationLayer` and `GridAggregationLayer` perform most of the common tasks for aggregation with flexibility of customizations. This document describes what `AggregationLayer` does and how to use it in other aggregation layers.
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
`AggregationLayer` is subclassed form `CompositeLayer` and all layers in `@deck.gl/aggregation-layers` are subclassed from this Layer.
|
|
9
|
-
|
|
10
|
-
## Integration with `AttributeManager`
|
|
11
|
-
|
|
12
|
-
This layer creates `AttributeManager` and makes it available for its subclasses. Any aggregation layer can add attributes to the `AttributeManager` and retrieve them using `getAttributes` method. This enables using `AttributeManager`'s features and optimization for using attributes. Also manual iteration of `data` prop can be removed and attributes can be directly set on GPU aggregation models or accessed directly for CPU aggregation.
|
|
13
|
-
|
|
14
|
-
Example: Adding attributes to an aggregation layer
|
|
15
|
-
|
|
16
|
-
```
|
|
17
|
-
const attributeManager = this.getAttributeManager();
|
|
18
|
-
attributeManager.add({
|
|
19
|
-
positions: {size: 3, accessor: 'getPosition'},
|
|
20
|
-
color: {size: 3, accessor: 'getColorWeight'},
|
|
21
|
-
elevation: {size: 3, accessor: 'getElevationWeight'}
|
|
22
|
-
});
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
## updateState()
|
|
26
|
-
|
|
27
|
-
During update state, Subclasses of `AggregationLayer` must first call 'super.updateState()', which calls
|
|
28
|
-
|
|
29
|
-
- `updateShaders(shaders)` : Subclasses can override this if they need to update shaders, for example, when performing GPU aggregation, aggregation shaders must be merged with argument of this function to correctly apply `extensions`.
|
|
30
|
-
|
|
31
|
-
- `_updateAttributes`: This checks and updates attributes based on updated props.
|
|
32
|
-
|
|
33
|
-
## Checking if aggregation is dirty
|
|
34
|
-
|
|
35
|
-
### Dimensions
|
|
36
|
-
|
|
37
|
-
Typical aggregation, involves :
|
|
38
|
-
1. Group the input data points into bins
|
|
39
|
-
2. Compute the aggregated value for each bin
|
|
40
|
-
|
|
41
|
-
For example, when `cellSize` or `data` is changed, layer needs to perform both `1` and `2` steps, when a parameter affecting a bin's value is changed (like `getWeight` accessor), layer only need to perform step `2`.
|
|
42
|
-
|
|
43
|
-
When doing CPU Aggregation, both above steps are performed individually. But for GPU aggregation, both are merged into single render call.
|
|
44
|
-
|
|
45
|
-
To support what state is dirty, constructor takes `dimensions` object, which contains, several keyed dimensions. It must contain `data` dimension that defines, when re-aggregation needs to be performed.
|
|
46
|
-
|
|
47
|
-
### isAggregationDirty()
|
|
48
|
-
|
|
49
|
-
This helper can be used if a dimension is changed. Sublayers can defined custom dimensions and call this method to check if a dimension is changed.
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
### isAttributeChanged()
|
|
53
|
-
|
|
54
|
-
`AggregationLayer` tracks what attributes are changed in each update cycle. Super classes can use `isAttributeChanged()` method to check if a specific attribute is changed or any attribute is changed.
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
# GridAggregationLayer
|
|
2
|
-
|
|
3
|
-
This layer performs some common tasks required to perform aggregation to grid cells, especially it takes care of deciding CPU vs GPU aggregation, allocating resources for GPU aggregation and uploading results.
|
|
4
|
-
|
|
5
|
-
This in an abstract layer, subclassed form `AggregationLayer`, `GPUGridLayer`, `ScreenGridLayer` and `ContourLayer` are subclassed from this layer.
|
|
6
|
-
|
|
7
|
-
## updateState()
|
|
8
|
-
|
|
9
|
-
During `updateState()`, it calls `updateAggregationState()` which sub classes must implement. During this method, sub classes must set following aggregation flags and aggregation params.
|
|
10
|
-
|
|
11
|
-
### Aggregation Flags
|
|
12
|
-
|
|
13
|
-
* `gpuAggregation`: When `true` aggregation happens on GPU, otherwise on CPU.
|
|
14
|
-
* `aggregationDataDirty` : When `true` data is re-aggregated.
|
|
15
|
-
* `aggregationWeightsDirty` : This flag is applicable only for CPU aggregation. When `true`, bin's aggregated values are re computed.
|
|
16
|
-
|
|
17
|
-
## Aggregation Parameters
|
|
18
|
-
|
|
19
|
-
* `gridOffset` : Grid's cell size in the format {xOffset, yOffset}.
|
|
20
|
-
* `projectPoints` : Should be `true` when doing screen space aggregation, when `false` it implies world space aggregation.
|
|
21
|
-
* `attributes` : Layer's current set of attributes which provide position and weights to CPU/GPU aggregators.
|
|
22
|
-
* `viewport` : current viewport object.
|
|
23
|
-
* `posOffset` : Offset to be added to object's position before aggregating.
|
|
24
|
-
* `boundingBox` : Bounding box of the input data.
|
|
25
|
-
Following are applicable for GPU aggregation only:
|
|
26
|
-
* `translation` : [xTranslation, yTranslation], position translation to be applied on positions.
|
|
27
|
-
* `scaling` : [xScale, yScale, flag], scaling to be applied on positions. When scaling not needed `flag` should be set to `0`.
|
|
28
|
-
* `vertexCount` : Number of objects to be aggregated.
|
|
29
|
-
* `moduleSettings` : Object with set of fields required for applying shader modules.
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
## updateResults()
|
|
33
|
-
|
|
34
|
-
When aggregation performed on CPU, aggregation result is in JS Array objects. Subclasses can override this method to consume aggregation data. This method is called with an object with following fields:
|
|
35
|
-
* `aggregationData` (*Float32Array*) - Array containing aggregation data per grid cell. Four elements per grid cell in the format `[value, 0, 0, count]`, where `value` is the aggregated weight value, up to 3 different weights. `count` is the number of objects aggregated to the grid cell.
|
|
36
|
-
* `maxMinData` (*Float32Array*) - Array with four values in format, `[maxValue, 0, 0, minValue]`, where `maxValue` is max of all aggregated cells.
|
|
37
|
-
* `maxData` (*Float32Array*) - Array with four values in format, `[maxValue, 0, 0, count]`, where `maxValue` is max of all aggregated cells and `count` is total number aggregated objects.
|
|
38
|
-
* `minData` (*Float32Array*) - Array with four values in format, `[minValue, 0, 0, count]`, where `minValue` is min of all aggregated cells and `count` is total number aggregated objects.
|
|
39
|
-
|
|
40
|
-
NOTE: The goal is to match format of CPU aggregation results to that of GPU aggregation, so consumers of this data (Sublayers) don't have to change.
|
|
41
|
-
|
|
42
|
-
## allocateResources()
|
|
43
|
-
|
|
44
|
-
Called with following arguments to allocated resources required to hold aggregation results.
|
|
45
|
-
* `numRow` (*Number*) - Number of rows in the grid.
|
|
46
|
-
* `numCol` (*Number*) - Number of columns in the grid.
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
# AggregationLayer
|
|
2
|
-
|
|
3
|
-
All of the layers in `@deck.gl/aggregation-layers` module perform some sort of data aggregation. All these layers perform aggregation with different parameters (CPU vs GPU, aggregation to rectangular bins vs hexagon bins, world space vs screen space, aggregation of single weight vs multiple weights etc).
|
|
4
|
-
|
|
5
|
-
`AggregationLayer` and `GridAggregationLayer` perform most of the common tasks for aggregation with flexibility of customizations. This document describes what `AggregationLayer` does and how to use it in other aggregation layers.
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
`AggregationLayer` is subclassed form `CompositeLayer` and all layers in `@deck.gl/aggregation-layers` are subclassed from this Layer.
|
|
9
|
-
|
|
10
|
-
## Integration with `AttributeManager`
|
|
11
|
-
|
|
12
|
-
This layer creates `AttributeManager` and makes it available for its subclasses. Any aggregation layer can add attributes to the `AttributeManager` and retrieve them using `getAttributes` method. This enables using `AttributeManager`'s features and optimization for using attributes. Also manual iteration of `data` prop can be removed and attributes can be directly set on GPU aggregation models or accessed directly for CPU aggregation.
|
|
13
|
-
|
|
14
|
-
Example: Adding attributes to an aggregation layer
|
|
15
|
-
|
|
16
|
-
```
|
|
17
|
-
const attributeManager = this.getAttributeManager();
|
|
18
|
-
attributeManager.add({
|
|
19
|
-
positions: {size: 3, accessor: 'getPosition'},
|
|
20
|
-
color: {size: 3, accessor: 'getColorWeight'},
|
|
21
|
-
elevation: {size: 3, accessor: 'getElevationWeight'}
|
|
22
|
-
});
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
## updateState()
|
|
26
|
-
|
|
27
|
-
During update state, Subclasses of `AggregationLayer` must first call 'super.updateState()', which calls
|
|
28
|
-
|
|
29
|
-
- `updateShaders(shaders)` : Subclasses can override this if they need to update shaders, for example, when performing GPU aggregation, aggregation shaders must be merged with argument of this function to correctly apply `extensions`.
|
|
30
|
-
|
|
31
|
-
- `_updateAttributes`: This checks and updates attributes based on updated props.
|
|
32
|
-
|
|
33
|
-
## Checking if aggregation is dirty
|
|
34
|
-
|
|
35
|
-
### Dimensions
|
|
36
|
-
|
|
37
|
-
Typical aggregation, involves :
|
|
38
|
-
1. Group the input data points into bins
|
|
39
|
-
2. Compute the aggregated value for each bin
|
|
40
|
-
|
|
41
|
-
For example, when `cellSize` or `data` is changed, layer needs to perform both `1` and `2` steps, when a parameter affecting a bin's value is changed (like `getWeight` accessor), layer only need to perform step `2`.
|
|
42
|
-
|
|
43
|
-
When doing CPU Aggregation, both above steps are performed individually. But for GPU aggregation, both are merged into single render call.
|
|
44
|
-
|
|
45
|
-
To support what state is dirty, constructor takes `dimensions` object, which contains, several keyed dimensions. It must contain `data` dimension that defines, when re-aggregation needs to be performed.
|
|
46
|
-
|
|
47
|
-
### isAggregationDirty()
|
|
48
|
-
|
|
49
|
-
This helper can be used if a dimension is changed. Sublayers can defined custom dimensions and call this method to check if a dimension is changed.
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
### isAttributeChanged()
|
|
53
|
-
|
|
54
|
-
`AggregationLayer` tracks what attributes are changed in each update cycle. Super classes can use `isAttributeChanged()` method to check if a specific attribute is changed or any attribute is changed.
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
# GridAggregationLayer
|
|
2
|
-
|
|
3
|
-
This layer performs some common tasks required to perform aggregation to grid cells, especially it takes care of deciding CPU vs GPU aggregation, allocating resources for GPU aggregation and uploading results.
|
|
4
|
-
|
|
5
|
-
This in an abstract layer, subclassed form `AggregationLayer`, `GPUGridLayer`, `ScreenGridLayer` and `ContourLayer` are subclassed from this layer.
|
|
6
|
-
|
|
7
|
-
## updateState()
|
|
8
|
-
|
|
9
|
-
During `updateState()`, it calls `updateAggregationState()` which sub classes must implement. During this method, sub classes must set following aggregation flags and aggregation params.
|
|
10
|
-
|
|
11
|
-
### Aggregation Flags
|
|
12
|
-
|
|
13
|
-
* `gpuAggregation`: When `true` aggregation happens on GPU, otherwise on CPU.
|
|
14
|
-
* `aggregationDataDirty` : When `true` data is re-aggregated.
|
|
15
|
-
* `aggregationWeightsDirty` : This flag is applicable only for CPU aggregation. When `true`, bin's aggregated values are re computed.
|
|
16
|
-
|
|
17
|
-
## Aggregation Parameters
|
|
18
|
-
|
|
19
|
-
* `gridOffset` : Grid's cell size in the format {xOffset, yOffset}.
|
|
20
|
-
* `projectPoints` : Should be `true` when doing screen space aggregation, when `false` it implies world space aggregation.
|
|
21
|
-
* `attributes` : Layer's current set of attributes which provide position and weights to CPU/GPU aggregators.
|
|
22
|
-
* `viewport` : current viewport object.
|
|
23
|
-
* `posOffset` : Offset to be added to object's position before aggregating.
|
|
24
|
-
* `boundingBox` : Bounding box of the input data.
|
|
25
|
-
Following are applicable for GPU aggregation only:
|
|
26
|
-
* `translation` : [xTranslation, yTranslation], position translation to be applied on positions.
|
|
27
|
-
* `scaling` : [xScale, yScale, flag], scaling to be applied on positions. When scaling not needed `flag` should be set to `0`.
|
|
28
|
-
* `vertexCount` : Number of objects to be aggregated.
|
|
29
|
-
* `moduleSettings` : Object with set of fields required for applying shader modules.
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
## updateResults()
|
|
33
|
-
|
|
34
|
-
When aggregation performed on CPU, aggregation result is in JS Array objects. Subclasses can override this method to consume aggregation data. This method is called with an object with following fields:
|
|
35
|
-
* `aggregationData` (*Float32Array*) - Array containing aggregation data per grid cell. Four elements per grid cell in the format `[value, 0, 0, count]`, where `value` is the aggregated weight value, up to 3 different weights. `count` is the number of objects aggregated to the grid cell.
|
|
36
|
-
* `maxMinData` (*Float32Array*) - Array with four values in format, `[maxValue, 0, 0, minValue]`, where `maxValue` is max of all aggregated cells.
|
|
37
|
-
* `maxData` (*Float32Array*) - Array with four values in format, `[maxValue, 0, 0, count]`, where `maxValue` is max of all aggregated cells and `count` is total number aggregated objects.
|
|
38
|
-
* `minData` (*Float32Array*) - Array with four values in format, `[minValue, 0, 0, count]`, where `minValue` is min of all aggregated cells and `count` is total number aggregated objects.
|
|
39
|
-
|
|
40
|
-
NOTE: The goal is to match format of CPU aggregation results to that of GPU aggregation, so consumers of this data (Sublayers) don't have to change.
|
|
41
|
-
|
|
42
|
-
## allocateResources()
|
|
43
|
-
|
|
44
|
-
Called with following arguments to allocated resources required to hold aggregation results.
|
|
45
|
-
* `numRow` (*Number*) - Number of rows in the grid.
|
|
46
|
-
* `numCol` (*Number*) - Number of columns in the grid.
|
package/src/aggregation-layer.md
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
# AggregationLayer
|
|
2
|
-
|
|
3
|
-
All of the layers in `@deck.gl/aggregation-layers` module perform some sort of data aggregation. All these layers perform aggregation with different parameters (CPU vs GPU, aggregation to rectangular bins vs hexagon bins, world space vs screen space, aggregation of single weight vs multiple weights etc).
|
|
4
|
-
|
|
5
|
-
`AggregationLayer` and `GridAggregationLayer` perform most of the common tasks for aggregation with flexibility of customizations. This document describes what `AggregationLayer` does and how to use it in other aggregation layers.
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
`AggregationLayer` is subclassed form `CompositeLayer` and all layers in `@deck.gl/aggregation-layers` are subclassed from this Layer.
|
|
9
|
-
|
|
10
|
-
## Integration with `AttributeManager`
|
|
11
|
-
|
|
12
|
-
This layer creates `AttributeManager` and makes it available for its subclasses. Any aggregation layer can add attributes to the `AttributeManager` and retrieve them using `getAttributes` method. This enables using `AttributeManager`'s features and optimization for using attributes. Also manual iteration of `data` prop can be removed and attributes can be directly set on GPU aggregation models or accessed directly for CPU aggregation.
|
|
13
|
-
|
|
14
|
-
Example: Adding attributes to an aggregation layer
|
|
15
|
-
|
|
16
|
-
```
|
|
17
|
-
const attributeManager = this.getAttributeManager();
|
|
18
|
-
attributeManager.add({
|
|
19
|
-
positions: {size: 3, accessor: 'getPosition'},
|
|
20
|
-
color: {size: 3, accessor: 'getColorWeight'},
|
|
21
|
-
elevation: {size: 3, accessor: 'getElevationWeight'}
|
|
22
|
-
});
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
## updateState()
|
|
26
|
-
|
|
27
|
-
During update state, Subclasses of `AggregationLayer` must first call 'super.updateState()', which calls
|
|
28
|
-
|
|
29
|
-
- `updateShaders(shaders)` : Subclasses can override this if they need to update shaders, for example, when performing GPU aggregation, aggregation shaders must be merged with argument of this function to correctly apply `extensions`.
|
|
30
|
-
|
|
31
|
-
- `_updateAttributes`: This checks and updates attributes based on updated props.
|
|
32
|
-
|
|
33
|
-
## Checking if aggregation is dirty
|
|
34
|
-
|
|
35
|
-
### Dimensions
|
|
36
|
-
|
|
37
|
-
Typical aggregation, involves :
|
|
38
|
-
1. Group the input data points into bins
|
|
39
|
-
2. Compute the aggregated value for each bin
|
|
40
|
-
|
|
41
|
-
For example, when `cellSize` or `data` is changed, layer needs to perform both `1` and `2` steps, when a parameter affecting a bin's value is changed (like `getWeight` accessor), layer only need to perform step `2`.
|
|
42
|
-
|
|
43
|
-
When doing CPU Aggregation, both above steps are performed individually. But for GPU aggregation, both are merged into single render call.
|
|
44
|
-
|
|
45
|
-
To support what state is dirty, constructor takes `dimensions` object, which contains, several keyed dimensions. It must contain `data` dimension that defines, when re-aggregation needs to be performed.
|
|
46
|
-
|
|
47
|
-
### isAggregationDirty()
|
|
48
|
-
|
|
49
|
-
This helper can be used if a dimension is changed. Sublayers can defined custom dimensions and call this method to check if a dimension is changed.
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
### isAttributeChanged()
|
|
53
|
-
|
|
54
|
-
`AggregationLayer` tracks what attributes are changed in each update cycle. Super classes can use `isAttributeChanged()` method to check if a specific attribute is changed or any attribute is changed.
|