An example of using D3 v4 for making quilted block designs (also called color weaving; see Albers et al. work on visual aggregation for more information). There’s probably a way to abstract the quilted block generation in a d3 module, but hopefully the intuition is pretty clear from the code.
The data is randomly generated from a normal distribution, with the color scale quantized around two standard deviations from the mean. Refresh the page to see different distributions of data.