{
const svg = d3.select(DOM.svg(width, height)),
margin = {top:60, bottom:50, left:50, right:10},
iwidth = width - margin.left - margin.right,
iheight = height - margin.top - margin.bottom,
x = d3.scaleLinear()
.domain([
0,
d3.max(myData, d=> d.height)
])
.range([ 0, iwidth]),
y = d3.scaleLinear()
.domain([0, d3.max(myData, d=> d.age) ])
.range([ iheight, 0]);
console.log("iheight", iheight);
const g = svg.append("g")
.attr("transform", `translate(${margin.left},${margin.top})`)
g.append("g")
.call(d3.axisBottom(x))
.attr("transform", `translate(0,${iheight})`);
g.append("g")
.call(d3.axisLeft(y));
const circles = g.selectAll("circle")
.data(myData)
.enter()
.append("circle")
.attr("cx", d => x(d.height))
.attr("cy", d => y(d.age))
.style("fill", "steelblue")
.attr("r", 5)
.append("title")
.text(d => d.name);
const text = g.selectAll(".label")
.data(myData)
.enter()
.append("text")
.attr("class", "label")
.attr("x", d => x(d.height))
.attr("y", d => y(d.age) + 10)
.text(d => d.name);
return svg.node();
}