chart = {
const svg = d3.select(DOM.svg(width, height));
svg.append("g")
.attr("id", "background");
svg.append("g")
.attr("id", "counter");
svg.append("g")
.attr("id", "series");
var counts = entry_counts(x),
scales = generate_scales(counts);
svg.select("#background")
.append("rect")
.classed("active", true)
.attrs({
"width": width,
"height": 200,
"fill": "#F7F7F7"
})
.on("mousemove", function() { click_fun(svg, this) });
svg.select("#series")
.selectAll("circle")
.data(x).enter()
.append("circle")
.attrs({
"cx": (d) => scales.t(d.t),
"cy": (d) => scales.x(d.x),
"fill": (d) => scales.fill(d.in_range),
"r": 2
});
svg.select("#counter")
.selectAll("circle")
.data(counts).enter()
.append("circle")
.attrs({
"cx": (d) => scales.t(d.t),
"cy": (d) => scales.counter(d.count),
"fill": "#515771",
"r": 3,
"opacity": 0.8
});
return svg.node()
}