Add button to toggle layout direction

Some graphs will work better top-to-bottom and some will work better
left-to-right, it's hard to tell in advance, so provide the user with a
button to toggle.