based of this really nice example: pusher.com/dynamic-graphs-with-d3-js/
data generated in this format, looping over red, green, blue and incrementing the id:
render([{
id: 1,
color: 'red'
}, {
id: 2,
color: 'green'
}, {
id: 3,
color: 'blue'
}]);
xxxxxxxxxx
<meta charset="utf-8">
<!-- https://clrs.cc/ -->
<link href="//s3-us-west-2.amazonaws.com/colors-css/2.2.0/colors.min.css" rel="stylesheet">
<style>
body { background: #130C0E; }
</style>
<body>
<script src="//d3js.org/d3.v3.min.js" charset="utf-8"></script>
<!-- d3 code -->
<script src="script-compiled.js" charset="utf-8"></script>
https://d3js.org/d3.v3.min.js