Not a typo. Each data array is sliced such that their length match the number of sample passed. For example,
frames shows three data points corresponding to year 1952, 1957 and 1962,
frames has data for years 1952, 1957, 1962 and 1967 and so on.
This behavior is questionable. Perhaps you want to show the all sample points for a given after click? If so, a simple
slice() should suffice.