added support for redrawing graphs