http://jsfiddle.net/rdpt5e30/1/
const data = [
{'year': 2005, 'value': 771900},
{'year': 2006, 'value': 771500},
{'year': 2007, 'value': 770500},
{'year': 2008, 'value': 770400},
{'year': 2009, 'value': 771000},
{'year': 2010, 'value': 772400},
{'year': 2011, 'value': 774100},
{'year': 2012, 'value': 776700},
{'year': 2013, 'value': 777100},
{'year': 2014, 'value': 779200},
{'year': 2015, 'value': 782300}
];
const bisect = d3.bisector(function(t: any) { return t.year; }).left;
console.log(bisect(data, 4));
Regardless of where I position it, the result is always index 0. This example seems to be a known one that has worked for many others, but strangely, it's not producing the expected outcome for me.
Any thoughts on why this might be happening?