D3.js terminology question about time intervals

D3.js terminology question about time intervals
0.0 0


The D3 documentation about time intervals is here:


Functions such as d3.timeHour(aDate), d3.timeSeconds() etc are supposed to return a time interval. What these particular functions do return is a Date instance (or something equivalent) on an “interval boundary”. Others, such as d3.timeHour.offset(…) return a single date which is NOT in general on an interval boundary. The function d3.timeHour.range(…) (considered as a single function) returns an array of dates (of interval boundaries).

My question: Why are all these called time intervals. The definition of an “interval” is that it consists of two points, so the terminology is nearly 100% inappropriate. If this terminology is just a whim of the developer, then fine - he’s entitled, D3 is a hell of a library. But is there something relevant and important that I am missing because of not understanding the terminology? Something deep relevant to the implementation, for example? In my case, the terminology impeded my absorbing this material for a while.

Thank you.



More accurately, an interval is the space between two boundaries, which is exactly what time is (if we loosen our understanding of “space”). This isn’t up to the D3 team, and is an established use of the term.

time interval (plural time intervals)

A period of time with fixed, well-defined limits.