Skip to main content


The BrushingExtension adds GPU-based data brushing functionalities to layers. It allows the layer to show/hide objects based on the current pointer position.

import {ScatterplotLayer} from '';
import {BrushingExtension} from '';

const layer = new ScatterplotLayer({
id: 'points',
data: POINTS,

// props from ScatterplotLayer
getPosition: d => d.position,
getRadius: d => d.radius,

// props added by BrushingExtension
brushingEnabled: true,
brushingRadius: 100000,

// Define extensions
extensions: [new BrushingExtension()]


To install the dependencies from NPM:

npm install
# or
npm install
import {BrushingExtension} from '';
new BrushingExtension();

To use pre-bundled scripts:

<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.BrushingExtension();


new BrushingExtension();

Layer Properties

When added to a layer via the extensions prop, the BrushingExtension adds the following properties to the layer:

brushingRadius (number)

The brushing radius centered at the pointer, in meters. If a data object is within this circle, it is rendered; otherwise it is hidden.

brushingEnabled (boolean, optional)

  • Default: true

Enable/disable brushing. If brushing is disabled, all objects are rendered.

Brushing is always disabled when the pointer leaves the current viewport.

brushingTarget (string, optional)

  • Default: source

The position used to filter each object by. One of the following:

  • 'source': Use the primary position for each object. This can mean different things depending on the layer. It usually refers to the coordinates returned by getPosition or getSourcePosition accessors.
  • 'target': Use the secondary position for each object. This may not be available in some layers. It usually refers to the coordinates returned by getTargetPosition accessors.
  • 'source_target': Use both the primary position and secondary position for each object. Show objet if either is in brushing range.
  • 'custom': Some layers may not describe their data objects with one or two coordinates, for example PathLayer and PolygonLayer. Use this option with the getBrushingTarget prop to provide a custom position that each object should be filtered by.

getBrushingTarget (Accessor<Position>, optional)

  • Default: null

Called to retrieve an arbitrary position for each object that it will be filtered by. Returns an array [x, y]. Only effective if brushingTarget is set to custom.