##change colors 2
If you liked change colors the original, you may or may not prefer this version, which allows the circles to change colors independently.
Forkable and tweakable jsfiddle version
xxxxxxxxxx
<meta charset="utf-8">
<style>
svg{
border: 5px gray solid;
}
</style>
<body>
<svg width="400" height="200">
<circle cx="100" cy="100" r="30" style="fill:cyan"></circle>
<circle cx="200" cy="100" r="30" style="fill:magenta;"></circle>
<circle cx="300" cy="100" r="30" style="fill:yellow;"></circle>
</svg>
<script src="https://d3js.org/d3.v3.min.js"></script>
<script type="text/javascript">
function update(data){
circle = d3.selectAll('circle')
.data(data);
circle.transition().duration(500)
.style('fill',function(d){return d;})
}
function randomcolor(){
colorrgb = []
for (var i=0; i<3; i++){
colorrgb.push(Math.floor(Math.random()*256))
}
return 'rgb('+colorrgb.toString()+')'
};
function newColors(){
return [randomcolor(),randomcolor(),randomcolor()]
};
setInterval(function(){
update(newColors())},
1500);
</script>
Modified http://d3js.org/d3.v3.min.js to a secure url
https://d3js.org/d3.v3.min.js