{
const svg = d3.create("svg")
.attr("width",400)
.attr("height",400);
const colsD = 33, rowsD = 16;
const stepX = 12, stepY = 20;
for (let i = 0; i < colsD; i++) {
for (let j = 0; j < rowsD; j++) {
const x = i * stepX;
const y = j * stepY;
const isUp = i % 2 === 0;
const alt = (i) % 2 === 0;
const points = isUp
? `${x + 8},${y} ${x},${y + 14} ${x + 16},${y + 14}`
: `${x + 8},${y + 14} ${x},${y} ${x + 16},${y}`;
svg.append("polygon")
.attr("points", points)
.attr("fill", alt ? "yellow" : "white")
.attr("stroke", alt ? "blue" : "red")
.attr("stroke-width", 1);
}
}
return svg.node();
}