chart = {
const width = 400;
const height = 400;
const margin = { top: 20, right: 20, bottom: 20, left: 20 };
const svg = d3.create("svg").attr("width", width).attr("height", height);
const x = d3
.scaleLinear()
.domain([0, 100])
.range([margin.left, width - margin.right]);
const y = d3
.scaleLinear()
.domain([0, 100])
.range([margin.top, width - margin.bottom]);
const axisX = d3.axisBottom(x);
const axisY = d3.axisLeft(y);
svg
.append("g")
.attr("class", "axisX")
.attr("transform", `translate(0,${height - margin.bottom})`)
.call(axisX);
svg
.append("g")
.attr("class", "axisY")
.attr("transform", `translate(${margin.left}),0`)
.call(axisY);
svg
.append("g")
.selectAll("circle")
.data(dataset)
.join("circle")
.attr("cx", (d) => x(d.x))
.attr("cy", (d) => y(d.y))
.attr("r", 10)
.attr("fill", "blue")
.attr("fill-opacity", 0.5)
.append("title")
.text((d) => d.id);
return svg.node();
}