require(["esri/smartMapping/symbology/heatmap"], (heatmapSchemes) => { /* code goes here */ });
import * as heatmapSchemes from "@arcgis/core/smartMapping/symbology/heatmap.js";
esri/smartMapping/symbology/heatmap
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
cloneScheme(scheme){HeatmapScheme}
-
Clones a heatmap scheme object.
Parameterscheme HeatmapSchemeThe heatmap scheme object to clone.
ReturnsType 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
getSchemeByName(params){HeatmapScheme}
Since: ArcGIS Maps SDK for JavaScript 4.12heatmap since 4.11, getSchemeByName added at 4.12. -
Returns a heatmap scheme with the provided name.
ParametersSpecificationparams ObjectSee the table below for details of each parameter that may be passed to this function.
Specificationname StringThe name of the scheme to retrieve.
optional The basemap to pair with the visualization. This value indicates the best colors for visualizing features against the given basemap.
basemapTheme StringoptionalIf 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
ordark
.Possible Values:"light"|"dark"
ReturnsType 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
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.ParametersSpecificationparams ObjectSee the table below for details of each parameter that may be passed to this function.
Specificationoptional 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 StringoptionalIf 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
ordark
.Possible Values:"light"|"dark"
ReturnsType 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
getSchemesByTag(params){HeatmapScheme[]}
Since: ArcGIS Maps SDK for JavaScript 4.12heatmap 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.
ParametersSpecificationparams ObjectSee the table below for details of each parameter that may be passed to this function.
Specificationoptional 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
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
optional The basemap to pair with the visualization. This value indicates the best symbol colors for visualizing features against the given basemap.
basemapTheme StringoptionalIf 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
ordark
.Possible Values:"light"|"dark"
ReturnsType 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" ] });
-
Returns metadata for the available themes. If a basemap is provided, returns themes that work best with the given basemap.
Parameteroptional The Esri basemap string or object that will be used with the returned theme(s).
Returns
Type Definitions
-
Properties defining the symbology scheme used to visualize point features as a heatmap.
- Properties
-
name String
The unique name of the scheme.
Tags associated with the scheme.
id StringThe unique id of the color scheme to usee in the visualization. The id is assigned based on the following template:
<themeName>/<basemapName>/<schemeName>
.A continuous color ramp used to construct a heatmap.
opacity NumberThe opacity of the heatmap.
-
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 StringThe ID of the basemap associated with the given schemes.
basemapTheme StringIndicates whether the average basemap color is
light
ordark
.