// data = Array.from({length: count}, d3.randomInt(500))
count=15
objects=d3.select(svg).selectAll("text")// in the SVG, select all text objects that already exist
.data(data)// bind those objects to the data
.join("text")// join with any new blank objects needed left-join on data->graphics)
.transition().duration(1000)
.attr("x",d=>d)// update properties of all of them based on the (new) data
.attr("y",(d,i)=>30+i*15)
.text(d=>d)
chosenData
objects2=d3.select(svg2).selectAll("text")
.data(chosenData)
.join("text")
.transition().duration(1000)
.attr("x",d=>d)
.attr("y",(d,i)=>30+i*15)
.text(d=>d)
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.