danvk/dygraphs — pull request #131 by klausw-g (2012-02-28 04:59:25+00:00)
Title: Fix NaN values confusing closest-point search

The current algorithm was not handling NaN values right, the "dist >= max"
check is false for dist=NaN and led to the "this point is closer" branch
being taken. Fix this by reversing the if logic, and add a regression
test for it. (I confirmed that the test fails for the original code,
and passes after the change.)

[sorry about the duplicate, I wedged my git branch with an ill-conceived edit attempt after pushing. Ignore the previous request in #130 please.]