{
const svg = d3.create('svg')
.attr('width', visWidth + margin.left + margin.right)
.attr('height', visHeight + margin.top + margin.bottom);
const g = svg.append("g")
.attr('transform', `translate(${margin.left}, ${margin.top})`);
const cells = g.append('g')
.selectAll('g')
.data(data)
.join('g')
.attr('class', 'cell')
.attr('transform', d => `translate(${col(d.col)}, ${row(d.row)})`);
cells.append('path')
.attr('d', d => industryToScaleAndArea[d.industry].area(d.rates))
.attr('fill', 'steelblue');
cells.each(function(d) {
const group = d3.select(this);
const axis = d3.axisLeft(industryToScaleAndArea[d.industry].y)
.ticks(3)
.tickSizeOuter(0);
group.call(axis)
.call(g => g.select('.domain').remove())
});
return svg.node();
}