d3 / d3-contour

Compute contour polygons using marching squares.
https://d3js.org/d3-contour
ISC License
494 stars 63 forks source link

respect thresholds passed to contourDensity #57

Closed Fil closed 2 years ago

Fil commented 2 years ago

When passing thresholds([0.5]) to contourDensity, one would expect the returned thresholds to be [0.5], but instead we get 0.5 * 2^-2k = 1/32 (with the default cellSize k=2).

This fixes the logic so that the thresholds are respected. Unfortunately it is a breaking change or any user who has manually set those thresholds.