Modification of Mike Bostock's code to allow for horizontal transitions