{
let landguzzlersViz = d3.select(svgContainer)
landguzzlersViz.selectAll("rect")
.data(land_guzzlers)
.join("rect")
.attr("width", d => Math.sqrt(d["footprint"])*1000)
.attr("height", d => Math.sqrt(d["footprint"])*1000)
.attr("x", 0)
.attr("y", d => 1100-Math.sqrt(d["footprint"])*1000)
.style("fill", (d,i) => colors[i]);
landguzzlersViz.selectAll(".title")
.data(land_guzzlers)
.join("text")
.attr("x", d => Math.sqrt(d["footprint"])*1000-5)
.attr("y", d => 1100-Math.sqrt(d["footprint"])*1000+32)
.text(d => d["title"])
.attr("class", "title");
landguzzlersViz.selectAll(".subtitle")
.data(land_guzzlers)
.join("text")
.attr("x", d => Math.sqrt(d["footprint"])*1000-30)
.attr("y", d => 1100-Math.sqrt(d["footprint"])*1000+60)
.text(d => d["subtitle"])
.attr("class", "subtitle");
landguzzlersViz.selectAll(".subtitle2")
.data(land_guzzlers)
.join("text")
.attr("x", d => Math.sqrt(d["footprint"])*1000-30)
.attr("y", d => 1100-Math.sqrt(d["footprint"])*1000+78)
.text(d => d["subtitle2"])
.attr("class", "subtitle");
landguzzlersViz.selectAll(".subtitle3")
.data(land_guzzlers)
.join("text")
.attr("x", d => Math.sqrt(d["footprint"])*1000-30)
.attr("y", d => 1100-Math.sqrt(d["footprint"])*1000+96)
.text(d => d["subtitle3"])
.attr("class", "subtitle");
landguzzlersViz.selectAll(".footprint")
.data(land_guzzlers)
.join("text")
.attr("x", d => Math.sqrt(d["footprint"])*1000-15)
.attr("y", d => 1100-Math.sqrt(d["footprint"])*1000+40)
.text(d => "Eco-footprint " + d["footprint"] + " hectares")
.attr("transform", (d,i,nodes) => "rotate(90 " + nodes[i].getAttribute("x") + " " + nodes[i].getAttribute("y") + ")")
// ^^ OK, so you would not have gotten this one on your own easily. See if you can figure it out.
// also compare this back against your manual SVG code for the rotate. Similar?
.attr("class", "footprint"); // tag it with the style class 'title'
// ... what other objects
}