Geovisualization Developer's Guide

H.datalens.HeatmapLayer. Options

Type Definition Summary

Defines data processing and rendering options for HeatmapLayer.

Type Definition Description

The data processing flow of HeatmapLayer is similar to RasterLayer. The initial step of rendering is to split the tile data by rows, where each row represents a bucket. By default this step is processed with H.datalens.HeatmapLayer.defaultDataToRows. This behavior can be changed by defining the dataToRows callback. To collect the rows for a tile including buffer, the rows must be translated to H.datalens.HeatmapLayer.TilePoint. This translation must be specified with the rowToTilePoint callback. Other options define the blending options for the heat map.

Property Details

dataToRows : { function( H.datalens.Service.Data , H.datalens.QueryTileProvider.X , H.datalens.QueryTileProvider.Y , H.datalens.QueryTileProvider.Zoom ) : Array.< H.datalens.HeatmapLayer.Row > } [optional]

Defines how the input tile data is split by rows. You can specify this callback to define client-side aggregation and filtering. This callback is called for each tile.

rowToTilePoint : { function( H.datalens.HeatmapLayer.Row , H.datalens.QueryTileProvider.X , H.datalens.QueryTileProvider.Y ) : H.datalens.HeatmapLayer.TilePoint }

Defines how the row is translated to the H.datalens.HeatmapLayer.TilePoint. This callback is called for each row returned from dataToRows.

bandwidth : { H.datalens.HeatmapLayer ~Bandwidth | H.datalens.HeatmapLayer ~BandwidthStop | Array.< H.datalens.HeatmapLayer ~BandwidthStop> | H.datalens.HeatmapLayer ~BandwidthCallback } [optional]

Describes the bandwidth behavior in relation to the current zoom level and can be one of four value types. An Object with zoom, value and optional zoomIncrementFactor (1 equals doubling on every zoom increment) defines a behavior across all zoom levels An Array of one or more zoom or value objects describes the behavior between the two defined levels and extrapolates the implied change outside of the defined range Or you can define the level of smoothing as a function of the zoom level. The callback must return a value in pixels and the cut-off of the Gaussian kernel is defined as 3 * bandwidth, a multiple (default 3) of bandwidth.

valueRange : { function( H.datalens.QueryTileProvider.Zoom ) : Array.<Number> } [optional]

Defines the range for the color scale as a function of the zoom level. The value returned must be an array of 2 numbers.

countRange : { function( H.datalens.QueryTileProvider.Zoom ) : Array.<Number> } [optional]

Defines the range for the density alpha mask as a function of the zoom level. When defined, the density alpha mask is applied. The value returned must be an array of 2 numbers.

colorScale : { function( number ) : string } [optional]

Defines a color palette as a function of the normalized value, you can use D3.js library scale functions with the domain [0, 1].

alphaScale : { function( number ) : number } [optional]

Defines the alpha mask value as a function of the normalized count, you can use D3.js library scale functions with the domain [0, 1] and the range [0, 1].

aggregation : { H.datalens.HeatmapLayer.Aggregation } [optional]

Specifies which type of aggregation was applied (eg. the type of aggregation function for a bucket in the Data Lens query). The possible values are SUM or AVERAGE, if the aggregation type is AVERAGE, then an averaged heat map is rendered.

inputScale : { H.datalens.HeatmapLayer.InputScale } [optional]

Defines the scale (eg logarithmic scale) of the TilePoint value. Note: If the value is not in a linear scale, then the aggregation in the source query must be defined with respect to the scale type. For example, before applying the average aggregation function in a query, the value must be transformed to the linear scale, this guarantees correct linear averaging of values.