I have managed to get this D3 example working but now I need to change the orientation from left-to-right to top-to-bottom.
I have had a look at this post and this one and tried changing the X,Y coordinates around but did not have much joy. I managed to get the nodes stacked vertically but the node links were still vertical and the spacing between nodes was totally off and they overlapped.