function geometricPeopleRenderer(skinColorFunction=(d=>"#bbb"),
hairColorFunction=(d=>"#666"),
clothesColorFunction=(d=>"#999")){
return function(people, width, height) {
let numPeople = people._groups[0].length;
let headSize = Math.sqrt(width * height / numPeople / 30);
let clipRand = Math.random();
people.append("clipPath")
.attr("id", d => "clip-" + d.id + "-" + clipRand)
.append("circle")
.attr("r", 2*headSize)
.attr("transform", "translate(0,0)");
const body = d3.path();
body.moveTo(-1.25*headSize, 2.5*headSize);
body.bezierCurveTo(-1.25*headSize, 0, 1.25*headSize, 0, 1.25*headSize, 2.5*headSize);
people.append("path")
.attr("clip-path", d => "url(#clip-" + d.id + "-" + clipRand + ")")
.attr("fill", clothesColorFunction)
.attr("d", body);
people.append("circle")
.attr("fill", hairColorFunction)
.attr("r", 1.1*headSize);
people.append("circle")
.attr("fill", d=>d.dominantColor=skinColorFunction(d))
.attr("r", headSize)
.attr("transform", "translate(0,"+0.1*headSize+")");
}
}