A simple example of using the layout and scale functions of this d3 icon array plugin this time useing svg icons for each dot.
xxxxxxxxxx
<html>
<head>
<title>Simple icon array example</title>
<script src="//d3js.org/d3.v4.min.js" charset="utf-8"></script>
<script type="text/javascript" src="d3-iconarray.js"></script>
<style type="text/css">
*{
font-family: sans-serif;
font-weight: bold;
letter-spacing: 1px;
}
</style>
</head>
<body>
<div id="simple-example">
</div>
</body>
<script type="text/javascript">
var layout = d3_iconarray.layout();
var data = d3.range(1, 101, 1);
var grid = layout(data);
var dotRadius = 10;
var width = 600,
height = 600,
margin = {top:20, bottom:20, left:20, right:20 };
var arrayScale = d3_iconarray.scale()
.domain([ 0, layout.maxDimension(data.length) ])
.range([0, width-(margin.left+margin.right)])
.gapSize(1)
.gapInterval(5);
var svg = d3.select('#simple-example')
.append('svg')
.attr('width',width)
.attr('height',height)
.append('g')
.attr('transform','translate('+margin.left+','+margin.top+')');
svg.selectAll('g')
.data(grid)
.enter()
.append('g').attr('transform', function(d){
return 'translate('+arrayScale(d.position.x)+','+arrayScale(d.position.y)+')'
})
.call(function(parent){
parent.append('use')
.attr('xlink:href',function(d,i){
return 'icons.svg#icon'+(i%4 + 1);
})
.attr('transform','scale(0.2)');
})
d3.select(self.frameElement).style("height", height + "px");
</script>
</html>
https://d3js.org/d3.v4.min.js