ageUtils
require(["esri/renderers/smartMapping/statistics/support/ageUtils"], function(ageUtils) { /* code goes here */ });
esri/renderers/smartMapping/statistics/support/ageUtils
Provides utility functions for generating Arcade expressions intended for use in an age renderer.
Method Overview
Name | Return Type | Summary | Object | |
---|---|---|---|---|
AgeExpressionsResult | Returns an Arcade expression for visualizing the age of a feature based on a given start time and end time. more details | more details | ageUtils |
Method Details
- getAgeExpressions(params){AgeExpressionsResult}
Returns an Arcade expression for visualizing the age of a feature based on a given start time and end time.
Parameters:Specification:params ObjectSee the table below for details of each parameter.
Specification:The layer from which to generate age statistics for the given
startTime
andendTime
.The start time for the age calculation. This can be a field name or a date value, such as
Date.now()
. If aDate
is provided, then theendTime
parameter must be a field name.The end time for the age calculation. This can be a field name or a date value, such as
Date.now()
. If aDate
is provided, then thestartTime
parameter must be a field name.unit StringoptionalThe desired units of the age result.
Possible Values: years | months | days | hours | minutes | seconds
Returns:Type Description AgeExpressionsResult Returns an instance of AgeExpressionsResult. Example:const ageExpressions = ageUtils.getAgeExpressions({ layer: featureLayer, startTime: "Created_Date", endTime: Date.now(), unit: "days" }); console.log(`value expression: ${ageExpressions.valueExpression}`);
Type Definitions
- AgeExpressionsResult
The result object returned from the getAgeExpressions() method.
- Properties:
- valueExpression String
The Arcade expression used to calculate the age of a feature based on the difference between the end time and the start time.
statisticsQuery ObjectA SQL expression and where clause that matches the generated
valueExpression
used to query statistics from the layer.histogramQuery ObjectA SQL expression and where clause that matches the generated
valueExpression
used to query for a histogram from the layer.