It’d be nice to have a variant of d3.extent that returns a three-element array with zero in the middle for use with d3.scaleDiverging.
function extentDiverging() {
const [x0, x1] = extent.apply(this, arguments);
return [Math.min(0, x0), 0, Math.max(0, x1)];
}