alphagov/spotlight — pull request #198 by easternbloc (2014-02-12 12:13:13+00:00)
Title: Bugfix/graph errors

![](http://media.giphy.com/media/M4dGs3ITkAvMA/giphy.gif)

Fixes three types of errors in graphs.

If no data is present at the end of a graph the matrix will return an array of points on the graph that match the index you're mousing over. This would make other parts of the application throw exceptions because you can't do a [].get('thing')

You could mouse over parts of the graph that weren't a graph. This would cause exceptions.

There was a logic bomb inside line.js[getDistanceAndClosestModel] that would never break from a loop if 0 was returned (falsy).