Atlaslog
Atlaslog / deck.gl / API / ScatterplotLayer
deck.gl · API reference

ScatterplotLayer

Quick answer

The ScatterplotLayer renders circles at given coordinates.

Last verified 2026-11-03 · deck.gl 9.0 · Cite this page
Runnable examplesChinese noteAll API topics

The ScatterplotLayer renders circles at given coordinates.

import {Deck} from '@deck.gl/core';
import {ScatterplotLayer} from '@deck.gl/layers';

const layer = new ScatterplotLayer({
id: 'ScatterplotLayer',
data: 'https://raw.githubusercontent.com/visgl/deck.gl-data/master/website/bart-stations.json',

stroked: true,
getPosition: d => d.coordinates,
getRadius: d => Math.sqrt(d.exits),
getFillColor: [255, 140, 0],
getLineColor: [0, 0, 0],
getLineWidth: 10,
radiusScale: 6,
pickable: true
});

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

Installation​

To install the dependencies from NPM:

npm install deck.gl
# or
npm install @deck.gl/core @deck.gl/layers
import {ScatterplotLayer} from '@deck.gl/layers';
import type {ScatterplotLayerProps} from '@deck.gl/layers';

new ScatterplotLayer<DataT>(...props: ScatterplotLayerProps<DataT>[]);

To use pre-bundled scripts:

<script src="https://unpkg.com/deck.gl@^9.0.0/dist.min.js"></script>
<!-- or -->
<script src="https://unpkg.com/@deck.gl/core@^9.0.0/dist.min.js"></script>
<script src="https://unpkg.com/@deck.gl/layers@^9.0.0/dist.min.js"></script>
new deck.ScatterplotLayer({});

Properties​

Inherits from all Base Layer properties.

Render Options​

radiusUnits (string, optional) ​

The units of the radius, one of 'meters', 'common', and 'pixels'. See unit system.

radiusScale (number, optional) ​

A global radius multiplier for all points.

lineWidthUnits (string, optional) ​

The units of the line width, one of 'meters', 'common', and 'pixels'. See unit system.

lineWidthScale (number, optional) ​

A global line width multiplier for all points.

stroked (boolean, optional)​

Draw the outline of points.

filled (boolean, optional)​

Draw the filled area of points.

radiusMinPixels (number, optional) ​

The minimum radius in pixels. This prop can be used to prevent the circle from getting too small when zoomed out.

radiusMaxPixels (number, optional) ​

The maximum radius in pixels. This prop can be used to prevent the circle from getting too big when zoomed in.

lineWidthMinPixels (number, optional) ​

The minimum line width in pixels. This prop can be used to prevent the stroke from getting too thin when zoomed out.

lineWidthMaxPixels (number, optional) ​

The maximum line width in pixels. This prop can be used to prevent the path from getting too thick when zoomed in.

billboard (boolean, optional)​

If true, rendered circles always face the camera. If false circles face up (i.e. are parallel with the ground plane).

antialiasing (boolean, optional)​

If true, circles are rendered with smoothed edges. If false, circles are rendered with rough edges. Antialiasing can cause artifacts on edges of overlapping circles. Also, antialiasing isn't supported in FirstPersonView.

Data Accessors​

getPosition (Accessor<Position>, optional) ​

Method called to retrieve the position of each object.

getRadius (Accessor<number>, optional) ​

The radius of each object, in units specified by radiusUnits (default meters).

getColor (Accessor<Color>, optional) ​

The rgba color is in the format of [r, g, b, [a]]. Each channel is a number between 0-255 and a is 255 if not supplied.

It will be overridden by getLineColor and getFillColor if these new accessors are specified.

getFillColor (Accessor<Color>, optional) ​

The rgba color is in the format of [r, g, b, [a]]. Each channel is a number between 0-255 and a is 255 if not supplied.

getLineColor (Accessor<Color>, optional) ​

The rgba color is in the format of [r, g, b, [a]]. Each channel is a number between 0-255 and a is 255 if not supplied.

getLineWidth (Accessor<number>, optional) ​

The width of the outline of each object, in units specified by lineWidthUnits (default meters).

getPixelOffset (Accessor<number[2]>, optional) ​

Screen space offset relative to the coordinates in pixel unit.

Source​

modules/layers/src/scatterplot-layer

TutorialsAPI index
English reference text adapted from the official deck.gl documentation, © vis.gl contributors, licensed under MIT.
Original page: https://deck.gl/docs/api-reference/layers/scatterplot-layer · Chinese note: /deckgl/api/scatterplot-layer.html
Cite this page

Atlaslog (2026). ScatterplotLayer. https://www.jingweizhi.com/en/deckgl/api/scatterplot-layer.html (accessed 2026-11-03).