{
const container = d3.create('svg')
.attr('height', 100)
.attr('width', 310);
const data = [
{x: 0, y: 0, label: 'one'},
{x: 105, y: 0, label: 'two'},
{x: 210, y: 0, label: 'three'},
];
const cells = container.selectAll('g')
.data(data)
.join('g')
.attr('transform', d => `translate(${d.x},${d.y})`);
cells.append('rect')
.attr('width', 100)
.attr('height', 100)
.attr('fill', 'RebeccaPurple');
cells.append('text')
.attr('x', 50)
.attr('y', 50)
.attr('fill', 'white')
.attr('text-anchor', 'middle')
.attr('dominant-baseline', 'middle')
.attr('font-family', 'sans-serif')
.text(d => d.label);
return container.node();
}