chart = {
let svg = d3
.create('svg')
.attr("width", width)
.attr('height', height)
.attr('id', 'mainViz');
let bg = svg
.append('rect')
.attr("width", width)
.attr('height', height)
.attr('fill', '#28343e');
let deathCircs = svg
.selectAll('.deathCircles')
.data(visualizedDataset)
.enter()
.append('circle')
.attr('cx', (d, i) => (i % columns) * perCircle + radius)
.attr('cy', (d, i) => Math.floor(i / columns) * perCircle + radius)
.attr('r', radius)
.attr('class', d => d.dateClass + " " + d.countryClass + " deathCircles")
.attr('fill', '#aaa')
.on('mouseover', function(d) {
svg.selectAll('.' + d.countryClass).attr('fill', 'white');
d3.select('#legend').text(d.country + " " + d.date);
})
.on('mouseout', function(d) {
let mousedClass = d3
.selectAll('.deathCircles')
.attr('stroke-width', 0)
.attr('fill', '#aaa');
d3.select('#legend').text('');
});
return svg.node();
}