animation3 = {
const data = d3.range(0, 2 * Math.PI, 2 * Math.PI/20)
const svg = d3.create('svg')
.attr('width', 300)
.attr('height', 300)
const circle = svg
.selectAll('circle')
.data( data )
.join('circle')
.attr('r', 15)
.attr('cx', d => 150 + 130 * Math.cos(d))
.attr('cy', d => 150 + 130 * Math.sin(d))
.style('fill', (d,i) => d3.quantize(d3.interpolateRainbow, data.length + 1)[i])
while(true) {
yield svg.node()
await circle
.transition()
.duration(5000)
.attr('cx', (d,i,arr) => 300 - d3.select(arr[i]).attr('cx'))
.attr('cy', (d,i,arr) => 300 - d3.select(arr[i]).attr('cy'))
.end()
}
}