Use the arrow keys to pan. On the Java version, use +/- to zoom in and out, respectively. On the Python version, use Enter to zoom in and Shift+Enter to zoom out.
View source code for the Python version on Github.
View source code for the Java version on Github.