Public
Edited
Nov 1
3 forks
12 stars
Insert cell
Insert cell
{
const svg = d3
.create("svg")
.attr("viewBox", [0, 0, width, height])
.style("overflow", "visible");

svg
.append("g")
.selectAll("circle")
.data(data)
.enter()
.append("circle")
.attr(
"transform",
(d, i) =>
`translate(${xOffset + i * xFactor},${height / 1.5 - i * yFactor})`
)
.attr("fill", (d) => color(rScale(d)))
.attr("stroke-width", 1)
.attr("stroke", "black")
.attr("cx", 0)
.attr("cy", 0)
.attr("r", (d) => rScale(d))

.lower()
.transition()
//.delay((d, i) => i * 10)
.duration(2000)
.attr("r", 8)
.transition()
.delay((d, i) => i * 10)
.duration(4000)
.attr("r", (d) => rScale(d));

//@velimirgasp

svg.append("g").call(xAxis).lower();

return svg.node();
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
d3.csvParse(await FileAttachment('us@1.csv').text(), d3.autoType)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more