Cache digraphs to eliminate redraw

Closes #4.