Incapsulate logic to build d3js graph structure in one object NCI.graphBuilder