Skip to main content

Scatterplot Layer

A circle per row.

Syntax​

{ "id": "n1", "op": "scatter", "name": "scatter", "x": 0, "y": 0, "params": {} }

An edge into it ends at "targetPort": "in"; one out of it starts at "sourcePort": "out"; a parameter is set in params (leave out the ones at their default), driven by an edge to par:radiusScale, or read elsewhere as ch('scatter/radiusScale').

Inputs​

PortTypeTakes
intableone edge

Parameters​

ParameterKindDefaultChoices
positionexpr"P"
colorexpr""
radiusexpr""
lineColorChannelexpr""
lineWidthexpr""
rampmenu"viridis"37 choices
radiusScalefloat4
radiusUnitsmenu"pixels"pixels, meters
fillColorcolor[255,140,0]
strokedtogglefalse
lineColorcolor[255,255,255]
lineWidthScalefloat1
lineWidthUnitsmenu"pixels"pixels, meters
billboardtogglefalse
antialiasingtoggletrue
opacityfloat1
blendmenu"normal"normal, additive, subtractive
depthTesttoggletrue
depthWritetoggletrue
extensionsfield[]

Outputs​

PortType
outlayer

Remarks​

Scatterplot Layer draws one circle per row of its input. Position, Color and Radius are per-row expressions over the rows' columns, or the name of a column an Attribute Create made. Position defaults to P, so until a column named P exists or Position names another, the layer has nothing to place.

A few defaults differ from deck.gl's own ScatterplotLayer, which matters when you follow the deck.gl docs:

ParameterHeredeck.gl
radiusUnits"pixels""meters"
radiusScale41

Circles therefore keep their size on screen as you zoom. To size them on the ground, set Radius units to meters.

An empty Color draws every circle in Fill color. A Color expression gives [r, g, b] from 0 to 1, or uses ramp(t) for a value from 0 to 1 on the layer's Color ramp. Radius scale, Fill color and Opacity are deck props: dragging them redraws without reading any rows again.

Examples​

Circles at each row's longitude and latitude, sized on the ground:

{ "id": "n1", "op": "scatter", "name": "points", "x": 0, "y": 0, "params": { "position": "[lng, lat]", "radius": "sqrt(mag) * 500", "radiusScale": 1, "radiusUnits": "meters" } }

Details​

  • Category: Layers
  • Operator: scatter

Older projects​

Projects saved before documents used operator classes. These convert to scatter when they open: GeoJsonLayerOp, ScatterplotLayerOp.