heatmapStatistics

AMD: require(["esri/smartMapping/statistics/heatmapStatistics"], (heatmapStatistics) => { /* code goes here */ });
ESM: import heatmapStatistics from "@arcgis/core/smartMapping/statistics/heatmapStatistics";
Function: esri/smartMapping/statistics/heatmapStatistics
Since: ArcGIS API for JavaScript 4.8

Function for generating statistics from a Layer for a HeatmapRenderer visualization.

It is important to note that the input layer must have features available in the input view for the heatmapStatistics() method to generate pixel intensity statistics.

Known Limitations

Only layers with point geometries are supported.

Method Overview

Name Return Type Summary Function
Promise<HeatmapStatisticsResult>

Returns an object containing various statistics describing the intensity values for a heatmap visualization of a given point Layer.

more details
heatmapStatistics

Method Details

heatmapStatistics(params){Promise<HeatmapStatisticsResult>}

Returns an object containing various statistics describing the intensity values for a heatmap visualization of a given point Layer.

Parameters
Specification
params Object

See the table below for details of each parameter.

Specification

The layer from which to generate statistics for the pixel intensity values and a given field if provided.

A view instance used to calculate pixel intensity values based on the features in the current view.

field String
optional

The name of the numeric field for which the statistics will be generated.

radius Number
optional

The area of influence for each point as a radius in points from the point.

signal AbortSignal
optional

Allows for cancelable requests. If canceled, the promise will be rejected with an error named AbortError. See also AbortController.

Returns
Type Description
Promise<HeatmapStatisticsResult> Returns a promise that resolves to HeatmapStatisticsResult.
Example
heatmapStatistics({
  layer: featureLayer,
  view: mapView
}).then(function(stats){
  // `stats` contains statistics used to construct a heatmap renderer
});

Type Definitions

HeatmapStatisticsResult

The statistics returned from the heatmapStatistics() function.

Properties
max Number

The maximum density value of all pixels in the view.

min Number

The minimum density value of all pixels in the view.

summaryStatistics SummaryStatisticsResult
optional

The summary statistics for all values returned from the field, if provided.

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