I suggest adding a comment explaining the importance of this.  Something like this?

// We include this information for each unit in order to enable a very important optimization in the d3 code.  Without it, in the d3 code, for each unit we have to look up the DOM for the category and categoryType.  With it, we simply look in the data structure.