Fix several aspects of the GraphViewer

Replace several magic numbers with consts. Make PSR2 compliant.
Part of #699