MCPcopy Create free account
hub / github.com/breck7/scroll / contours

Function contours

external/.d3.js:6405–6419  ·  view source on GitHub ↗
(values)

Source from the content-addressed store, hash-verified

6403 smooth = smoothLinear;
6404
6405 function contours(values) {
6406 var tz = threshold(values);
6407
6408 // Convert number of thresholds into uniform thresholds.
6409 if (!Array.isArray(tz)) {
6410 const e = extent$1(values, finite);
6411 tz = ticks(...nice$1(e[0], e[1], tz), tz);
6412 while (tz[tz.length - 1] >= e[1]) tz.pop();
6413 while (tz[1] < e[0]) tz.shift();
6414 } else {
6415 tz = tz.slice().sort(ascending$1);
6416 }
6417
6418 return tz.map(value => contour(values, value));
6419 }
6420
6421 // Accumulate, smooth contour rings, assign holes to exterior rings.
6422 // Based on https://github.com/mbostock/shapefile/blob/v0.6.2/shp/polygon.js

Callers

nothing calls this directly

Calls 9

thresholdFunction · 0.85
extent$1Function · 0.85
ticksFunction · 0.85
nice$1Function · 0.85
contourFunction · 0.85
shiftMethod · 0.80
sortMethod · 0.80
sliceMethod · 0.80
mapMethod · 0.80

Tested by

no test coverage detected