Skip to main content


The H3ClusterLayer renders regions represented by hexagon sets from the H3 geospatial indexing system.

H3ClusterLayer is a CompositeLayer.

import {Deck} from '';
import {H3ClusterLayer} from '';

const layer = new H3ClusterLayer({
id: 'H3ClusterLayer',
data: '',

stroked: true,
getHexagons: d => d.hexIds,
getFillColor: d => [255, (1 - d.mean / 500) * 255, 0],
getLineColor: [255, 255, 255],
lineWidthMinPixels: 2,
pickable: true

new Deck({
initialViewState: {
longitude: -122.4,
latitude: 37.74,
zoom: 11
controller: true,
getTooltip: ({object}) => object && `density: ${object.mean}`,
layers: [layer]


To install the dependencies from NPM:

npm install
# or
npm install
import {H3ClusterLayer} from '';
import type {H3ClusterLayerProps} from '';

new H3ClusterLayer<DataT>(...props: H3ClusterLayerProps<DataT>[]);

To use pre-bundled scripts:

<script src="^4.0.0"></script>
<script src="^9.0.0/dist.min.js"></script>
<!-- or -->
<script src="^9.0.0/dist.min.js"></script>
<script src="^9.0.0/dist.min.js"></script>
<script src="^9.0.0/dist.min.js"></script>
new deck.H3ClusterLayer({});

Note that h3-js must be included before


Inherits from all Base Layer, CompositeLayer, and PolygonLayer properties, plus the following:

Data Accessors

getHexagons (Accessor<string[]>, optional)

Method called to retrieve the hexagon cluster from each object, as an array of H3 hexagon indices. These hexagons are joined into polygons that represent the geospatial outline of the cluster.

Sub Layers

The H3ClusterLayer renders the following sublayers: