The functions from src/scale in the d3 repo