Select to view content in your preferred language

TimeSlider Widgets for Historical or Geological Time Scales

1363
3
07-09-2021 09:06 AM
Abbey_Roelofs
New Contributor II
7 3 1,363

While TimeSlider widgets are great for scrolling through data in the past 2000 years or so, they don't work so well for much older information. This could be artifacts from an archaeological site of ancient Greece, or land changes over the course of a geological time scale. Since dates in these ranges can't be represented in a field that can be time-enabled in ArcGIS Online, this initially seems impossible.

However, there's a workaround. Since v4.17 the ArcGIS API for JavaScript provides the option to specify custom label formatting functions, which opens up the possibility of displaying any custom text in place of the time-enabled field values. By adding a new datetime field (or fields) to your dataset and using a little math to populate this field with your original dates scaled to a range of modern-day dates, you can time-enable the new field(s) and calculate the (approximately) correct corresponding original dates to be shown in the TimeSlider widget.

You can see an example of this customized TimeSlider in action here. This is a map of structures in the city of Corinth across a wide range of years, extracted from an archaeological dataset from the ASCSA Corinth Excavations available in ArcGIS Online. You can read more about their work and this dataset on their website. I chose this data mainly for its range of dates, which scales the range from about 750 BCE to 1800 CE, a range that wouldn't normally be possible to scroll with a TimeSlider widget.

To do this, I used ArcGIS Notebooks in ArcGIS Pro and the JavaScript API for Python. All the code used as well as directions on how to use it are available here. I hope you find it useful!

 

Filtering to the earliest structuresFiltering to the earliest structures

 Filtering to the earliest structures, around 800-500 BCE

Scrolling to a later date shows more structuresScrolling to a later date shows more structures

 Scrolling to a later date shows additional structures

3 Comments
MikeSlattery
Occasional Contributor

@Abbey_Roelofs this is great!   We realized we'd have to do a timeshift to play with the slider, and the new map viewer ecosystem didn't have the same formatting options described here.   Your work here is inspiring our team to break out of the confines of the AGOL app configurator, thank you very much.

MehdiPira1
Esri Contributor

Awesome!

Thanks @Abbey_Roelofs .

mollya99
New Contributor

Thanks @Abbey_Roelofs for this!

I am trying to do something similar on ArcPro. I want to display time data earlier than year 0101 which seems to be the cut off point for ArcPro. Ideally I want this to show to year 0000.

 

Does anybody know why this may be and how I can fix it?