chart = {
const svg = d3.create("svg")
.attr("viewBox", [0, 0, width, height]);
const tooltip = new Tooltip()
svg.append("g")
.call(xAxis);
svg.append("g")
.call(yAxis);
const color = d3.scaleSequential().domain(d3.extent(data, d => d.culmen_depth_mm)).interpolator(d3.interpolatePuRd);
svg.append("g")
.selectAll("circle")
.data(data)
.join("circle")
.filter(d => d.body_mass_g)
.attr("cx", d => x(d.flipper_length_mm))
.attr("cy", d => y(d.body_mass_g))
.attr("r", 2)
svg.append("g")
.selectAll('path')
.data(data)
.join('path')
.attr("fill", d => color(d.culmen_depth_mm))
.attr("stroke", "#FFF")
.attr('opacity', .3)
.attr("d", (d, i) => voronoi.renderCell(i))
.on("mouseover", (event, d) => tooltip.show(d) )
svg.append(() => tooltip.node)
return svg.node();
}