Spaces:
Paused
Paused
Download node_modules/@plotly/d3/src/arrays/median.js from Leon4gr45/UserSyncFrontend: direct link, hf CLI and curl.
- Browser
- Download file 464 Bytes
-
https://huggingface.co/spaces/Leon4gr45/UserSyncFrontend/resolve/main/node_modules/%40plotly/d3/src/arrays/median.js
- Command line
-
hf download hf://spaces/Leon4gr45/UserSyncFrontend/node_modules/@plotly/d3/src/arrays/median.js
-
curl -L -o median.js https://huggingface.co/spaces/Leon4gr45/UserSyncFrontend/resolve/main/node_modules/%40plotly/d3/src/arrays/median.js
464 Bytes
| import "../math/number"; | |
| import "ascending"; | |
| import "quantile"; | |
| d3.median = function(array, f) { | |
| var numbers = [], | |
| n = array.length, | |
| a, | |
| i = -1; | |
| if (arguments.length === 1) { | |
| while (++i < n) if (d3_numeric(a = d3_number(array[i]))) numbers.push(a); | |
| } else { | |
| while (++i < n) if (d3_numeric(a = d3_number(f.call(array, array[i], i)))) numbers.push(a); | |
| } | |
| if (numbers.length) return d3.quantile(numbers.sort(d3_ascending), 0.5); | |
| }; | |