{
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) - 2.5)
.attr("y", d => 1100 - (Math.sqrt(d.footprint) * 1000) + 26)
.text(d => d.title)
.attr("class", "title");
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) + 33)
.text(d => "Eco-footprint: " + d["footprint"] + " hectares")
.attr("transform", (d,i,nodes) => "rotate(90 " + nodes[i].getAttribute("x") + " " + nodes[i].getAttribute("y") + ")")
.attr("class", "footprint");
landguzzlersViz.selectAll(".subtext1")
.data(land_guzzlers)
.join("text") // new object type created
.attr("x", d => (Math.sqrt(d.footprint) * 1000) - 27)
.attr("y", d => 1100 - (Math.sqrt(d.footprint) * 1000) + 55)
.text(d => d.subtitle) // this is how we actually write the text content
.attr("class", "subtext1"); // tag it with the style class 'title'
landguzzlersViz.selectAll(".subtext2") // notice that I'm selectingAll objects of a class called .title, to only get those text.
.data(land_guzzlers) // same dataset
.join("text") // new object type created
.attr("x", d => (Math.sqrt(d.footprint) * 1000) - 27)
.attr("y", d => 1100 - (Math.sqrt(d.footprint) * 1000) + 70)
.text(d => d.subtitle2) // this is how we actually write the text content
.attr("class", "subtext1"); // tag it with the style class 'title'
landguzzlersViz.selectAll(".subtext3") // notice that I'm selectingAll objects of a class called .title, to only get those text.
.data(land_guzzlers) // same dataset
.join("text") // new object type created
.attr("x", d => (Math.sqrt(d.footprint) * 1000) - 27)
.attr("y", d => 1100 - (Math.sqrt(d.footprint) * 1000) + 90)
.text(d => d.subtitle3) // this is how we actually write the text content
.attr("class", "subtext1"); // tag it with the style class 'title'
// MEDIUM-SIZED DOG
landguzzlersViz.append("line")
//horizonta line
.attr("x1", "640") //left part of horizontal line. Larger # the shorter line gets from left
.attr("y1", "219") //horizontal, larger # lower it gets
.attr("x2", "896") //right part of horizontal line. Larger # the longer line gets from the right
.attr("y2", "219") //horizontal, larger # lower it gets
landguzzlersViz.append("line")
//vertical line
.attr("x1", "895") // vertical line, lesser #= shift left
.attr("y1", "218") //top part of the vertical line, smaller # the line gets longer on the top
.attr("x2", "895") // vertical line, less #= shiftleft
.attr("y2", "270") // bottom part of vertica line, larger the line gets longer in the bottom
// TOYOTA LAND CRUISER lines
landguzzlersViz.append("line")
.attr("x1", "320")
.attr("y1", "490")
.attr("x2", "620")
.attr("y2", "490")
landguzzlersViz.append("line")
.attr("x1", "620")
.attr("y1", "490")
.attr("x2", "620")
.attr("y2", "530")
}