{
const plotContainer = document.getElementById("waffle");
if (plotContainer) {
plotContainer.innerHTML = "";
Array.from(plotContainer.children).forEach((child) =>
plotContainer.removeChild(child)
);
plotContainer.style.width = `${containerWidth}px`;
plotContainer.style.height = `${containerHeight}px`;
if (alignment === "center") {
plotContainer.classList.add("center");
} else {
plotContainer.classList.remove("center");
}
const cols = Math.min(data.length, columnCount);
const rows = rowCount(data.length);
const maxHorizontal = containerWidth / cols;
const titleHeight = 60;
const maxVertical = (containerHeight - titleHeight) / rows - labelSpacing;
const maxSide = Math.min(maxHorizontal, maxVertical);
const waffleInDiv = createWaffle(maxSide);
plotContainer.appendChild(waffleInDiv);
return "Code to resize the chart container";
}
return "Container not found";
}