predominantCategories
require(["esri/renderers/smartMapping/statistics/predominantCategories"], function(predominantCategories) { /* code goes here */ });
esri/renderers/smartMapping/statistics/predominantCategories
Function for generating category statistics for a predominance renderer.
Method Overview
Name | Return Type | Summary | Function | |
---|---|---|---|---|
Promise<PredominantCategoriesResult> | Determines predominant categories for a layer based on a given set of competing numeric fields and returns the number of features belonging to each category. more details | more details | predominantCategories |
Method Details
- predominantCategories(params){Promise<PredominantCategoriesResult>}
Determines predominant categories for a layer based on a given set of competing numeric fields and returns the number of features belonging to each category.
Parameters:Specification:params ObjectSee the table below for details of each parameter.
Specification:The layer from which to generate predominant categories for the given set of
fields
.An array of numeric fields from which to determine predominant categories. The fields must all be number fields and they must be competing or complementary (e.g. population totals by language spoken at home, or harvested acres by crop type, or the results of an election by candidate or party).
optional The view in which features will be rendered.
Returns:Type Description Promise<PredominantCategoriesResult> Returns a promise that resolves to PredominantCategoriesResult. Example:predominantCategories({ layer: featureLayer, fields: [ "corn_acres", "cotton_acres", "wheat_acres", "soybeans_acres", "vegetables_acres" ], view: mapView }).then(function(stats){ console.log(stats.predominantCategoryInfos); });
Type Definitions
- PredominantCategoriesResult
The statistics returned from the predominantCategories() function.
- Properties:
An array of objects describing the count of each predominant category.