cleaned up unefficient graph render, and added onclick and onhaver events