The Histogram is a plot operator that computes a histogram plot either over attributes of a vector dataset or values of a raster source. The output is a plot in Vega-Lite specification.
Histogram
For instance, you want to plot the data distribution of numeric attributes of a feature collection. Then you can use a histogram with a suitable number of buckets to visualize and assess this.
columnName
string
"temperature"
bounds
HistogramBounds
data
values
{ "min": 0.0, "max": 20.0}
"data"
buckets
Number
SquareRootChoiceRule
{ "type": "number", "value": 20}
interactive
boolean
false
true
The operator consumes either one vector or one raster operator.
source
SingleRasterOrVectorSource
The operator returns an error if the selected column (columnName) does not exist or is not numeric.
If bounds or buckets are not defined, the operator will determine these values by itself which requires processing the data twice.
If the buckets parameter is set to squareRootChoiceRule, the operator estimates it using the square root of the number of elements in the data.
squareRootChoiceRule
{ "type": "Histogram", "params": { "columnName": "foobar", "bounds": { "min": 5.0, "max": 10.0 }, "buckets": { "type": "number", "value": 15 }, "interactive": false }, "sources": { "vector": { "type": "OgrSource", "params": { "data": { "type": "internal", "datasetId": "a626c880-1c41-489b-9e19-9596d129859c" } } } } }