{
let colors = ["#a5620b", "#c29657", "#cc1f5e", "#a71949", "#f7991d", "#231f20"]
let viz_height = landguzzlers.attr("height") - 5
let viz_width = landguzzlers.attr("width")
landguzzlers.selectAll("rect")
.data(data)
.join("rect")
.attr("y", d => viz_height - d["pixel_footprint"])
.attr("width", d => d["pixel_footprint"])
.attr("height", d => d["pixel_footprint"])
.style("fill", (d, i) => colors[i]);
landguzzlers.selectAll(".square_title")
.data(data)
.join("text")
.text(d => d["title"])
.attr("y", d => viz_height - d["pixel_footprint"] + d["title_size"])
.attr("x", d => d["pixel_footprint"] - 5)
.attr("class", d => d["title_class"]);
landguzzlers.selectAll(".eco")
.data(data.filter(d => d["title"] != "HAMSTER").filter(d => d["title"] != "VOLKSWAGEN GOLF"))
.join("text")
.text(d => "Eco-footprint: " + d["footprint"] + " hectares")
.attr("y", d => viz_height - d["pixel_footprint"] + d["title_size"] + 5)
.attr("x", d => d["pixel_footprint"] - 15)
.attr("class", "eco");
landguzzlers.selectAll(".detail1")
.data(data)
.join("text")
.text(d => d["subtitle"])
.attr("y", d => viz_height - d["pixel_footprint"] + d["title_size"] + 25)
.attr("x", d => d["pixel_footprint"] - 30)
.attr("class", "detail1");
landguzzlers.selectAll(".detail2")
.data(data)
.join("text")
.text(d => d["subtitle2"])
.attr("y", d => viz_height - d["pixel_footprint"] + d["title_size"] + 42)
.attr("x", d => d["pixel_footprint"] - 30)
.attr("class", "detail2");
landguzzlers.selectAll(".detail3")
.data(data)
.join("text")
.text(d => d["subtitle3"])
.attr("y", d => viz_height - d["pixel_footprint"] + d["title_size"] + 60)
.attr("x", d => d["pixel_footprint"] - 30)
.attr("class", "detail3");
landguzzlers.selectAll(".hamster")
.data(data)
.join("text")
.attr("dx", 10);
landguzzlers.selectAll(".eco_hamster1")
.data(data.filter(d => d["title"] == "HAMSTER"))
.join("text")
.text("Eco footprint:")
.attr("x", d => d["pixel_footprint"] + 5)
.attr("y", d => viz_height - d["pixel_footprint"] + d["title_size"] + 20)
.attr("class", "eco_hamster1 square_title");
landguzzlers.selectAll(".eco_hamster2")
.data(data.filter(d => d["title"] == "HAMSTER"))
.join("text")
.text(d => d["footprint"] + " hectares")
.attr("x", d => d["pixel_footprint"] + 5)
.attr("y", d => viz_height - d["pixel_footprint"] + d["title_size"] + 40)
.attr("class", "eco_hamster2 square_title");
}