scatterChart = {
const svg = d3.create("svg")
.attr("width", 500)
.attr("height", 300);
const x = d3.scaleLinear()
.domain([0, d3.max(data, d => d.value)])
.range([40, 480]);
const y = d3.scaleLinear()
.domain([0, data.length])
.range([280, 20]);
const color = d3.scaleSequential(d3.interpolateBlues)
.domain([0, d3.max(data, d => d.value)]);
svg.selectAll("circle")
.data(data)
.join("circle")
.attr("cx", d => x(d.value))
.attr("cy", (d, i) => y(i))
.attr("r", 0)
.attr("fill", d => color(d.value))
.transition()
.duration(1000)
.attr("r", 8);
setTimeout(() => {
const xLog = d3.scaleLog()
.domain([1, d3.max(data, d => d.value)])
.range([40, 480]);
svg.selectAll("circle")
.transition()
.duration(1000)
.attr("cx", d => xLog(d.value))
.attr("fill", "purple");
}, 1500);
return svg.node();
}