Pull out graphing code for maintainability, defer render until tab is clicked