heatmap

AMD: require(["esri/smartMapping/symbology/heatmap"], (heatmapSchemes) => { /* code goes here */ });
ESM: import * as heatmapSchemes from "@arcgis/core/smartMapping/symbology/heatmap.js";
Object: esri/smartMapping/symbology/heatmap
Since: ArcGIS Maps SDK for JavaScript 4.11

Object containing helper methods for generating optimal colors for heatmap visualizations. The getSchemes() method is used to get the heatmap color schemes best suited to the given basemap.

Method Overview

Name Return Type Summary Object

Clones a heatmap scheme object.

heatmap

Returns a heatmap scheme with the provided name.

heatmap

Returns a primary scheme and secondary schemes defining properties for heatmap visualizations in a point Layer.

heatmap

Returns an array of heatmap schemes with the provided tags.

heatmap

Returns metadata for the available themes.

heatmap

Method Details

cloneScheme

Method
cloneScheme(scheme){HeatmapScheme}

Clones a heatmap scheme object.

Parameter
scheme HeatmapScheme

The heatmap scheme object to clone.

Returns
Type Description
HeatmapScheme A clone of the given heatmap scheme object.
Example
// clones the primary scheme returned from the getSchemes() method
let heatmapScheme = primaryScheme.clone();

getSchemeByName

Method
getSchemeByName(params){HeatmapScheme}
Since: ArcGIS Maps SDK for JavaScript 4.12 heatmap since 4.11, getSchemeByName added at 4.12.

Returns a heatmap scheme with the provided name.

Parameters
Specification
params Object

See the table below for details of each parameter that may be passed to this function.

Specification
name String

The name of the scheme to retrieve.

basemap String|Basemap
optional

The basemap to pair with the visualization. This value indicates the best colors for visualizing features against the given basemap.

basemapTheme String
optional

If you have a non-Esri basemap (e.g. a VectorTileLayer basemap with a custom style) or no basemap at all, use this parameter to indicate whether the background of the visualization is light or dark.

Possible Values:"light"|"dark"

Returns
Type Description
HeatmapScheme Returns the heatmap scheme with the given name.
Example
// Returns the Heatmap 4 scheme
let heatmapScheme = heatmapSchemes.getSchemeByName({
  basemap: map.basemap,
  name: "Heatmap 4"
});

getSchemes

Method
getSchemes(params){HeatmapSchemes}

Returns a primary scheme and secondary schemes defining properties for heatmap visualizations in a point Layer. The basemap parameter determines the color schemes of the heatmap.

Parameters
Specification
params Object

See the table below for details of each parameter that may be passed to this function.

Specification
basemap String|Basemap
optional

The Esri basemap to pair with the visualization. This value indicates the best colors for visualizing features against the given basemap. If you have a non-Esri basemap (e.g. a VectorTileLayer basemap with a custom style) or no basemap at all, then use the basemapTheme parameter instead of this parameter.

basemapTheme String
optional

If you have a non-Esri basemap (e.g. a VectorTileLayer basemap with a custom style) or no basemap at all, use this parameter to indicate whether the background of the visualization is light or dark.

Possible Values:"light"|"dark"

Returns
Type Description
HeatmapSchemes Returns an object containing the optimal heatmap scheme to use for the given basemap and secondary schemes that may also be used.
Example
// gets the primary scheme for the basemap
let schemes = heatmapSchemes.getSchemes({
  basemap: map.basemap
});

// the best default scheme for the layer, basemap, and theme
let primaryScheme = schemes.primaryScheme;

getSchemesByTag

Method
getSchemesByTag(params){HeatmapScheme[]}
Since: ArcGIS Maps SDK for JavaScript 4.12 heatmap since 4.11, getSchemesByTag added at 4.12.

Returns an array of heatmap schemes with the provided tags. These schemes define color stop properties for any layer that can be rendered with a HeatmapRenderer.

Parameters
Specification
params Object

See the table below for details of each parameter that may be passed to this function.

Specification
includedTags String[]
optional

When provided, only schemes containing all the matching tags will be returned.

Known Tags: light | dark | reds | yellows | oranges | greens | blues | purples | pinks | browns | grays | bright | subdued | deuteranopia | protanopia | tritanopia | grayscale | types | dot-density

excludedTags String[]
optional

When provided, only schemes missing all the provided tags will be returned.

Known Tags: light | dark | reds | yellows | oranges | greens | blues | purples | pinks | browns | grays | bright | subdued | deuteranopia | protanopia | tritanopia | grayscale | types | dot-density

basemap String|Basemap
optional

The basemap to pair with the visualization. This value indicates the best symbol colors for visualizing features against the given basemap.

basemapTheme String
optional

If you have a non-Esri basemap (e.g. a VectorTileLayer basemap with a custom style) or no basemap at all, use this parameter to indicate whether the background of the visualization is light or dark.

Possible Values:"light"|"dark"

Returns
Type Description
HeatmapScheme[] Returns an array of heatmap schemes either including or excluding the provided tags.
Example
// Returns all the heatmap schemes that look good in grayscale
let grayscaleSchemes = heatmapSchemes.getSchemesByTag({
  basemap: map.basemap,
  includedTags: [ "heatmap", "grayscale" ]
});

getThemes

Method
getThemes(basemap){Theme[]}

Returns metadata for the available themes. If a basemap is provided, returns themes that work best with the given basemap.

Parameter
basemap String|Basemap
optional

The Esri basemap string or object that will be used with the returned theme(s).

Returns
Type Description
Theme[] Returns an object containing information about the available themes for the given basemap.

Type Definitions

HeatmapScheme

Type Definition
HeatmapScheme

Properties defining the symbology scheme used to visualize point features as a heatmap.

Properties
name String

The unique name of the scheme.

tags String[]

Tags associated with the scheme.

id String

The unique id of the color scheme to usee in the visualization. The id is assigned based on the following template: <themeName>/<basemapName>/<schemeName>.

colors Color[]

A continuous color ramp used to construct a heatmap.

opacity Number

The opacity of the heatmap.

HeatmapSchemes

Type Definition
HeatmapSchemes

The return object of the getSchemes() method.

Properties
primaryScheme HeatmapScheme

The heatmap color scheme best suited for the given basemap and geometry type.

secondarySchemes HeatmapScheme[]

Additional heatmap color schemes that may be used to visualize data overlaid on the given basemap.

basemapId String

The ID of the basemap associated with the given schemes.

basemapTheme String

Indicates whether the average basemap color is light or dark.

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.