ke-width", 1)
	  .attr("stroke-linejoin", "round")
	  .attr("d",
		d3.line()
		.curve(d3.curveBasis)
		.x(d => xscale(d[0]))
		.y(d => yscale(d[1])));

    function update_kde(nbandwidth) {
	let kde = kernelDensityEstimation(data, nbandwidth);

	for (let i=0; i<n;i++){
	    density[i][1] = kde(density[i][0]);
	}

	graph.datum(density)
	    .transition()
	    .duration(50)
	    .attr("d",
		  d3.line()
		  .curve(d3.curveBasis)
		  .x(d => xscale(d[0]))
		  .y(d => yscale(d[1])));
    };

    return update_k