MCPcopy
hub / github.com/jipegit/OSXAuditor / compare

Function compare

d3-3.2.8/d3.js:3018–3020  ·  view source on GitHub ↗
(a, b)

Source from the content-addressed store, hash-verified

3016 return Math.abs(p[0] - x0) < ε ? direction > 0 ? 0 : 3 : Math.abs(p[0] - x1) < ε ? direction > 0 ? 2 : 1 : Math.abs(p[1] - y0) < ε ? direction > 0 ? 1 : 0 : direction > 0 ? 3 : 2;
3017 }
3018 function compare(a, b) {
3019 return comparePoints(a.point, b.point);
3020 }
3021 function comparePoints(a, b) {
3022 var ca = corner(a, 1), cb = corner(b, 1);
3023 return ca !== cb ? ca - cb : ca === 0 ? b[1] - a[1] : ca === 1 ? a[0] - b[0] : ca === 2 ? a[1] - b[1] : b[0] - a[0];

Callers 1

d3_layout_treeSearchFunction · 0.85

Calls 1

comparePointsFunction · 0.85

Tested by

no test coverage detected