Modified Nadieh code to cover the whole svg (adding an extra hexbin on even rows) and computing the sizes based only on the columns.
The end result of my blog on SOM - Creating hexagonal heatmaps with D3.js in which the one heatmap of a Self Organizing Map is displayed with D3 with a small hover event
A version with line boundaries to separate the segments can be found here
forked from nbremer's block: Self Organizing Map - Heatmap - D3
Modified http://d3js.org/d3.v4.js to a secure url
https://d3js.org/d3.v4.js
https://d3js.org/d3-hexbin.v0.2.min.js
https://ajax.googleapis.com/ajax/libs/jquery/1.6.3/jquery.js