ta, barwidth, min, max)] computes histogram
// values as follows:
// - a value [v] of [data] contributes to the bar between [u] and
// [u+barwidth] if u <= v < u+barwidth
// - the [i]th bar is between [min+i*barwidth] and [min+(i+1)*barwidth]
// - [max] is used only to determine the number of bars. It MUST be greater
// than [d3.max(data)]
function histogram(data, barwidth, min, max) {
    const nbar = Math.floor((max-min)/barwidth)+1;
    let hist = new Array(nbar);
    for (let i=0; i<nbar; i++) {
	hist[i