MCPcopy Create free account
hub / github.com/breck7/scroll / extent$1

Function extent$1

external/.d3.js:310–338  ·  view source on GitHub ↗
(values, valueof)

Source from the content-addressed store, hash-verified

308}
309
310function extent$1(values, valueof) {
311 let min;
312 let max;
313 if (valueof === undefined) {
314 for (const value of values) {
315 if (value != null) {
316 if (min === undefined) {
317 if (value >= value) min = max = value;
318 } else {
319 if (min > value) min = value;
320 if (max < value) max = value;
321 }
322 }
323 }
324 } else {
325 let index = -1;
326 for (let value of values) {
327 if ((value = valueof(value, ++index, values)) != null) {
328 if (min === undefined) {
329 if (value >= value) min = max = value;
330 } else {
331 if (min > value) min = value;
332 if (max < value) max = value;
333 }
334 }
335 }
336 }
337 return [min, max];
338}
339
340// https://github.com/python/cpython/blob/a74eea238f5baba15797e2e8b570d153bc8690a7/Modules/mathmodule.c#L1423
341class Adder {

Callers 1

contoursFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected