factors.js code to display factoring in a grid with d3