Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/d3/d3-array
/ center
Function
center
src/bisector.js:46–49 ·
view source on GitHub ↗
(a, x, lo = 0, hi = a.length)
Source
from the content-addressed store, hash-verified
44
}
45
46
function
center(a, x, lo = 0, hi = a.length) {
47
const
i = left(a, x, lo, hi - 1);
48
return
i > lo && delta(a[i - 1], x) > -delta(a[i], x) ? i - 1 : i;
49
}
50
51
return
{left, center, right};
52
}
Callers
nothing calls this directly
Calls
1
left
Function · 0.85
Tested by
no test coverage detected