import TimeSeriesInfo from "@arcgis/core/layers/support/TimeSeriesInfo.js";const TimeSeriesInfo = await $arcgis.import("@arcgis/core/layers/support/TimeSeriesInfo.js");- Inheritance
- TimeSeriesInfo→
Accessor
- Since
- ArcGIS Maps SDK for JavaScript 5.1
A time series describes a series of fields that represent a sequence of related data points over time or other dimensions.
This style of visualization works best with features whose positions or geographic shapes don't change over time.
This requires the data to be structured so that two or more fields contain data values for the same attribute at
different points in time. Those fields must be either string or number data types, and their names should clearly
indicate the time period represented by the data (e.g. temperature_Jan2020, temperature_Feb2020, etc.). Web map
authoring applications can use the information in the time series fields configuration to generate
Arcade expressions
that reference the fields in the time series, allowing the layer's renderer, labels, and/or popups to reflect an attribute's value relative
to the map's current time.
- Example
- layer.dataSeriesInfos = [{type: "time-series-fields",name: "ts0",title: "U.S. National Park Annual Visitation Numbers (10 year increments, 1910-2020)",fieldTimeMappings: [{fieldName: "F1910",timeValue: "1910"},{fieldName: "F1920",timeValue: "1920"},{fieldName: "F1930",timeValue: "1930"},{fieldName: "F1940",timeValue: "1940"},{fieldName: "F1950",timeValue: "1950"},{fieldName: "F1960",timeValue: "1960"},{fieldName: "F1970",timeValue: "1970"},{fieldName: "F1980",timeValue: "1980"},{fieldName: "F1990",timeValue: "1990"},{fieldName: "F2000",timeValue: "2000"},{fieldName: "F2010",timeValue: "2010"},{fieldName: "F2020",timeValue: "2020"}],timeInterval: 1,timeValueUnits: "years",timeIntervalUnits: "decades",timeExtent: {start: new Date("1910-01-01"),end: new Date("2020-01-01")}}];
Constructors
Constructor
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| properties | | |
Properties
| Property | Type | Class |
|---|---|---|
| readonly inherited | ||
| | ||
| | ||
| TimeExtent | null | undefined | | |
| | ||
| | ||
| | ||
| | ||
| readonly | "time-series-fields" | |
fieldTimeMappings
- Type
- TimeSeriesFieldTimeMapping[] | null | undefined
The mapping between field names and time values for the time series configuration.
timeExtent
- Type
- TimeExtent | null | undefined
Represents the time extent for the full list of fields used in the time series fields configuration. This is used for setting the bounds of the time slider.
timeIntervalUnits
- Type
- "seconds" | "minutes" | "hours" | "days" | "weeks" | "months" | "years" | "decades" | "centuries" | null | undefined
Temporal unit of measure for timeInterval. For example, if the fields in the time series included temperature_Jan2020,
temperature_Jan2021, temperature_Jan2022, etc., the time interval would be 1 and the time interval units would be years.
timeValueUnits
Temporal unit of measure for timeValue (specified in fieldTimeMappings). For example, if the fields in the time
series included temperature_Jan2020, temperature_Jan2021, temperature_Jan2022, etc. the time value unit
would be month to reflect each field's relevance over a singular month.
type
- Type
- "time-series-fields"
Specifies the type of data series info. This is used by client applications to determine how to use
the data series info configuration to generate expressions for renderers, labels, popups, charts,
or other representations of the data for display in the web map. For time series fields, the
value of this property must be time-series-fields.
- Default value
- "time-series-fields"
Methods
| Method | Signature | Class |
|---|---|---|
| inherited static | fromJSON(json: any): any | |
| inherited | clone(): this | |
| inherited | toJSON(): any |
fromJSON
- Signature
-
fromJSON (json: any): any
Creates a new instance of this class and initializes it with values from a JSON object
generated from an ArcGIS product. The object passed into the input json
parameter often comes from a response to a query operation in the REST API or a
toJSON()
method from another ArcGIS product. See the Using fromJSON()
topic in the Guide for details and examples of when and how to use this function.
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| json | A JSON representation of the instance in the ArcGIS format. See the ArcGIS REST API documentation for examples of the structure of various input JSON objects. | |
- Returns
- any
Returns a new instance of this class.
clone
- Signature
-
clone (): this
Creates a deep clone of this object. Any properties that store values by reference will be assigned copies of the referenced values on the cloned instance.
- Returns
- this
A deep clone of the class instance that invoked this method.
toJSON
- Signature
-
toJSON (): any
Converts an instance of this class to its ArcGIS portal JSON representation. See the Using fromJSON() guide topic for more information.
- Returns
- any
The ArcGIS portal JSON representation of an instance of this class.