Take a more OO approach to handling the d3 data

Do we need to pass ``this`` here?