Download node_modules/d3-array/src/extent.js from NKessler/Horizon: direct link, hf CLI and curl.
- Browser
- Download file 723 Bytes
-
https://huggingface.co/NKessler/Horizon/resolve/main/node_modules/d3-array/src/extent.js
- Command line
-
hf download hf://NKessler/Horizon/node_modules/d3-array/src/extent.js
-
curl -L -o extent.js https://huggingface.co/NKessler/Horizon/resolve/main/node_modules/d3-array/src/extent.js
723 Bytes
| export default function extent(values, valueof) { | |
| let min; | |
| let max; | |
| if (valueof === undefined) { | |
| for (const value of values) { | |
| if (value != null) { | |
| if (min === undefined) { | |
| if (value >= value) min = max = value; | |
| } else { | |
| if (min > value) min = value; | |
| if (max < value) max = value; | |
| } | |
| } | |
| } | |
| } else { | |
| let index = -1; | |
| for (let value of values) { | |
| if ((value = valueof(value, ++index, values)) != null) { | |
| if (min === undefined) { | |
| if (value >= value) min = max = value; | |
| } else { | |
| if (min > value) min = value; | |
| if (max < value) max = value; | |
| } | |
| } | |
| } | |
| } | |
| return [min, max]; | |
| } | |