A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developers.arcgis.com/javascript/latest/visualization/data-driven-styles/time/ below:

Time | Overview | ArcGIS Maps SDK for JavaScript 4.33

Incidents styled with a simple render, visual variables, and clusters to show number of days to close

What are time styles?

Time styles include all visualizations that involve date/time data. You can use these styles to visualize when and where an event occurs. Common examples involve the following:

  1. Timeline
  2. Before and after
  3. Age
  4. Track visualization
  5. Time series animation
Examples Timeline

A timeline visualization displays date/time data along a continuous color ramp. It provides an immediate view at when phenomena occurred or when a value was recorded relative to all other data points.

The following example visualizes hurricane locations in the Atlantic Ocean recorded in the year 2000. This uses a color visual variable to show which hurricanes occurred early in the season versus late in the season.

Expand

Use dark colors for code blocks Copy

44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 45 46 47 48 49 50 51 52 53 54 55 56 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
        visualVariables: [
          {
            type: "color",
            field: "Date_Time",
            legendOptions: {
              title: "Date of observation",
            },
            stops: [
              { value: new Date(2000, 7, 3).getTime(), color: "#00ffff" },
              { value: new Date(2000, 9, 22).getTime(), color: "#2f3f56" },
            ],
          },
        ],
Before and after

You can use a color visual variable with a diverging color ramp to visualize which events occurred before and after a specific date.

The following example visualizes clusters of hurricane locations summarized by whether they occurred before or after January 1, 1977 on average.

Expand

Use dark colors for code blocks Copy

42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
        visualVariables: [
          {
            type: "color",
            field: "ISO_time",
            legendOptions: {
              title: "Before and after July 1",
            },
            stops: [
              { value: new Date(2013, 0, 1).getTime(), color: colors[0], label: "January 1" },
              { value: new Date(2013, 6, 1).getTime(), color: colors[1], label: "July 1" },
              { value: new Date(2013, 11, 31).getTime(), color: colors[2], label: "December 31" },
            ],
          },
        ],
Age

An age visualization shows the age of a feature (or the elapsed time up to a meaningful date or the current date) based on a date field. Age visualizations may be applied in the following scenarios:

  1. How long has an asset been in commission?
  2. How old is the incident report?
  3. How long has it been since the last inspection?
  4. Is an incident past due for resolution?

Age is typically defined using the DateDiff function in an Arcade expression and mapped with a color or size variable. It specifies a length of time with desired units.

Use dark colors for code blocks Copy

1
valueExpression = "DateDiff( Now(), $feature.date_created, 'hours' )"

The following example visualizes clustered street condition complaints in New York City based on how much time passed before the incident was closed relative to its due date.

Expand

Use dark colors for code blocks Copy

57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 58 59 60 61 62 63 64 65 66 67 68 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
        visualVariables: [
          {
            type: "color",
            valueExpression: "DateDiff($feature['closed_time'], $feature['due_time'], 'days')",
            valueExpressionTitle: "Days it took to close incident",
            stops: [
              { value: -21, color: colors[0], label: "21 weeks early" },
              { value: 0, color: colors[1], label: "On time" },
              { value: 21, color: colors[2], label: "21 weeks late" },
            ],
          },
        ],
Track visualization

Track data is represented as a series of observations (typically points). In addition to a timestamp, each observation must belong to a track identified by a unique ID. This ID is used to group observations into a track. To render track data, the layer must be configured with a valid timeInfo.

The timeInfo property of the layer defines the following:

Use dark colors for code blocks Copy

1
2
3
4
layer.timeInfo = {
  startField: "ISO_time",
  trackIdField: "Serial_Num"
};

The layer in this example represents historic hurricane locations as points. To render each hurricane tracks as paths, you must also set the trackInfo property of the layer. The trackInfo property defines the following properties:

The renderers listed above also include opacity visual variables to indicate the age of the observation relative to the time slider. The older the observation, the more transparent it appears until it fades out completely.

This requires a TimeSlider component for control over the time.

The basic trackInfo configuration is stubbed out below. Open the code editor above to see the full configuration.

Use dark colors for code blocks Copy

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
layer.trackInfo = {
  previousObservations: {
    renderer: {
      // renderer configuration defined here
    },
    labelingInfo: [
      // labelingInfo configuration defined here
    ]
  },
  latestObservations: {
    renderer: {
      // renderer configuration defined here
    },
    labelingInfo: [
      // labelingInfo configuration defined here
    ]
  },
  trackLine: {
    renderer: {
      // renderer configuration defined here
    },
    labelingInfo: [
      // labelingInfo configuration defined here
    ]
  }
};
Time series animation

Time series animations are visualizations showing how data values change over time in features fixed at unchanging locations. These typically involve a time slider so users have the ability to explore moments of time or time windows.

For features that have a static position (such as sensors, buildings, countries, etc.), but have attributes that vary over time (e.g. POPULATION_2000, POPULATION_2005, POPULATION_2010, etc.), Arcade expressions can access time slider values to dynamically reference the field name corresponding to the current time on the slider. This allows you to visualize how data changes over time without needing to filter features or download duplicate geometries.

In this example, the temperature anomaly layer has field names representing temperature anomalies for each year from 1880 to 2020 in this format: F1900, F1901, F1902, ..., F2020. The Arcade expression uses the time slider value to dynamically reference the field name for the year represented by the slider value.

The underlying rendering engine re-executes the expression with every slider value change.

First, configure the time slider to match the start and end dates of the data with the appropriate time interval.

Expand

Use dark colors for code blocks Copy

31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
    const yearSlider = document.querySelector("arcgis-time-slider");
    yearSlider.fullTimeExtent = {
      start: new Date(1880, 0, 1),
      end: new Date(2018, 0, 1),
    };
    yearSlider.timeExtent = {
      start: new Date(1880, 0, 1),
      end: new Date(1880, 0, 1),
    };
    yearSlider.stops = {
      interval: {
        value: 1,
        unit: "years",
      },
    };

Next, update the layer's renderer to use an Arcade expression that references the time slider value to dynamically access the field name for the year represented by the slider value.

Expand

Use dark colors for code blocks Copy

58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 73 73 73 73 73 73 73 73 73 73 73 73 73 73 73 73 73 73 73 73 73 73 73 73 73 73 73 73

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
      const sizeVisualVariable = renderer.visualVariables.find(
        (visualVariable) => visualVariable.type === "size",
      );

      // Returns the value of the "F{year}" field based on the slider's value.
      // This expression will re-execute every time the slider's value changes
      const valueExpression = `
          Expects($feature, "F*");
          if(HasValue($view, ["timeProperties", "currentEnd"])){
            var y = Year($view.timeProperties.currentEnd);
            var value = $feature["F" + y];
            return value;
          }
          return null;
        `;
API support Full support Partial support No support

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4