Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/d3/d3-array
/ thresholdSturges
Function
thresholdSturges
src/threshold/sturges.js:3–5 ·
view source on GitHub ↗
(values)
Source
from the content-addressed store, hash-verified
1
import
count from
"../count.js"
;
2
3
export
default
function
thresholdSturges(values) {
4
return
Math.max(1, Math.ceil(Math.log(count(values)) / Math.LN2) + 1);
5
}
Callers
1
sturges-test.js
File · 0.90
Calls
1
count
Function · 0.85
Tested by
no test coverage detected