function createCheckmarkGroup(
svg,
x,
y,
scale,
text,
votes,
fill,
swapBool,
checkBool
) {
var group = svg.append("g");
group
.append("text")
.attr("class", "checkmark-label")
.text(text)
.attr("x", 20)
.attr("y", 40)
.style("text-anchor", "end")
.attr("fill", fill || "#0571b0");
group
.append("text")
.attr("class", "vote-label")
.text(votes)
.attr("x", -15)
.attr("y", 20)
.style("font-size", 72)
.style("text-anchor", "middle")
.attr("fill", fill || "#0571b0");
group
.append("path")
.attr("d", checkmark)
.attr("class", "checkmark")
.attr("fill", fill || "#0571b0");
if (checkBool != true) {
group.select(".checkmark").attr("fill", "white");
}
if (swapBool) {
group.select(".checkmark-label").style("text-anchor", "start");
group.select(".checkmark").attr("transform", "translate(0, 30) scale(1)");
group
.select(".vote-label")
.attr("transform", "translate(125, 0) scale(1)")
.style("text-anchor", "end");
} else {
group.select(".checkmark").attr("transform", "translate(22, 30) scale(1)");
}
group.attr("transform", `translate(${x}, ${y}) scale(${scale})`);
group.attr("class", `check-group-${text}`);
group.select(".vote-label").attr("class", `vote-label-${text}`);
group.select(".checkmark").attr("class", `checkmark-${text}`);
group.select(".checkmark-label").attr("class", `checkmark-label-${text}`);
return group;
}