Spaces:
Paused
Paused
Download node_modules/@plotly/d3/src/arrays/bisect.js from Leon4gr45/UserSyncFrontend: direct link, hf CLI and curl.
- Browser
- Download file 898 Bytes
-
https://huggingface.co/spaces/Leon4gr45/UserSyncFrontend/resolve/main/node_modules/%40plotly/d3/src/arrays/bisect.js
- Command line
-
hf download hf://spaces/Leon4gr45/UserSyncFrontend/node_modules/@plotly/d3/src/arrays/bisect.js
-
curl -L -o bisect.js https://huggingface.co/spaces/Leon4gr45/UserSyncFrontend/resolve/main/node_modules/%40plotly/d3/src/arrays/bisect.js
898 Bytes
| import "ascending"; | |
| function d3_bisector(compare) { | |
| return { | |
| left: function(a, x, lo, hi) { | |
| if (arguments.length < 3) lo = 0; | |
| if (arguments.length < 4) hi = a.length; | |
| while (lo < hi) { | |
| var mid = lo + hi >>> 1; | |
| if (compare(a[mid], x) < 0) lo = mid + 1; | |
| else hi = mid; | |
| } | |
| return lo; | |
| }, | |
| right: function(a, x, lo, hi) { | |
| if (arguments.length < 3) lo = 0; | |
| if (arguments.length < 4) hi = a.length; | |
| while (lo < hi) { | |
| var mid = lo + hi >>> 1; | |
| if (compare(a[mid], x) > 0) hi = mid; | |
| else lo = mid + 1; | |
| } | |
| return lo; | |
| } | |
| }; | |
| } | |
| var d3_bisect = d3_bisector(d3_ascending); | |
| d3.bisectLeft = d3_bisect.left; | |
| d3.bisect = d3.bisectRight = d3_bisect.right; | |
| d3.bisector = function(f) { | |
| return d3_bisector(f.length === 1 | |
| ? function(d, x) { return d3_ascending(f(d), x); } | |
| : f); | |
| }; | |