implement GraphPainter (debugging only)