diamondsChart = {
const svg = d3.create('svg')
.attr('width', widthDiamond)
.attr('height', heightDiamond);
const groups = svg.selectAll('g')
.data(colorToCutToCount)
.join('g')
.attr('transform', ([color, cutToCount]) => `translate(${groupX(color)})`);
groups.selectAll('rect')
.data(([color, cutToCount]) => cutToCount)
.join('rect')
.attr('x', d => barX(d[0]))
.attr('width', barX.bandwidth())
.attr('y', ([cut, count]) => y(count))
.attr('height', ([cut, count]) => y(0) - y(count))
.attr('fill', ([cut, count]) => color(cut));
svg.append('g')
.attr('transform', `translate(0,${heightDiamond - marginDiamond.bottom})`)
.call(xAxisDiamond)
.call(g => g.select('.domain').remove())
.append('text')
.attr('x', widthDiamond / 2)
.attr('y', 30)
.attr('dominant-baseline', 'hanging')
.attr('text-align', 'middle')
.attr('fill', 'black')
.text('Diamond Color');
svg.append('g')
.attr('transform', `translate(${marginDiamond.left})`)
.call(yAxisDiamond)
.call(g => g.select('.domain').remove())
.append('text')
.attr('x', -50)
.attr('y', heightDiamond / 2)
.attr('dominant-baseline', 'middle')
.attr('text-align', 'end')
.attr('fill', 'black')
.text('Count');
return svg.node();
}