chart = {
const svg = d3.create("svg")
.attr("viewBox", [0, 0, width, height]);
svg.append("g")
.call(xAxis);
svg.append("g")
.call(yAxis);
svg.append("g")
.call(grid);
svg.append("g")
.attr("stroke-width", 1.5)
.attr("font-family", "sans-serif")
.attr("font-size", 10)
.selectAll("path")
.data(sdata)
.join("path")
.attr("transform", d => `translate(${x1(d.width)},${y1(d.length)})`)
.attr("fill", d => scolor(d.variety))
.attr("d", d => sshape(d.category));
svg.append("g")
.attr("stroke-width", 1.5)
.attr("font-family", "sans-serif")
.attr("font-size", 10)
.selectAll("path")
.data(pdata)
.join("path")
.attr("transform", d => `translate(${x2(d.width)},${y2(d.length)})`)
.attr("fill", d => pcolor(d.variety))
.attr("d", d => pshape(d.category));
return svg.node();
}