{
const target= html`<svg viewBox= "0 0 ${width} ${height}"></svg>`
const svg= d3.select(target);
const margin= { left: 30, right: 40, top: 10, bottom: 20},
iwidth= width - margin.left -margin.right,
iheight= height- margin.top -margin.bottom;
const gDrawing= svg.append("g")
.attr("transform" , `translate( ${margin.left}, ${margin.top})`);
const x= d3.scaleLinear()
.domain( [0, d3.max(data_arr, d=> d.age)])
.range([0, iwidth]);
const y= d3.scaleLinear()
.domain([0, d3.max( data_arr, d => d.height_a)])
.range([iheight, 0]);
const color= d3.scaleOrdinal()
.domain( Array.from( new Set( data_arr.map( d=> d.profession)).values()))
.range(["steelblue", "salmon", "cyan"]);
gDrawing.append("g")
.attr("class", "x-axis")
.attr("transform", `translate(0, ${iheight})`)
.call(d3.axisBottom(x));
gDrawing.append("g")
.attr("class", "y-axis")
.call(d3.axisLeft(y));
gDrawing.append("rect")
.attr("width", iwidth)
.attr("height", iheight)
.attr("fill", "grey");
const circles= gDrawing.selectAll("circle")
.data(data_arr)
.join("circle")
.attr("cx", d => x(d.age))
.attr("cy", d => y(d.height_a))
.attr("fill", d => color( d.profession))
.attr("r", 3);
return target;
}