made client-side graphing more object-oriented