This is some exercise code on the problem of populating a <ul>
element subject to constraints and other criteria. It uses an "out-of-sight" dummy list to compute the dimensions it needs to lay out the actual list.
https://code.jquery.com/jquery-1.10.2.min.js
https://d3js.org/d3.v3.min.js