How do I count distinct values in d3 nest rollup?
<p>I'm using d3.nest.rollup to count leaves in my data. The data comes from csv and is converted to json by d3. The csv looks like this:</p>

<pre><code>Color,ID,Animal
Green,1,Dog
Red,2,Cat
Red,3,Cat
Red,3,Dog
</code></pre>

<p>Note that ID #3 has 2 different animals, but I want to count distinct IDs in this data, so each color should return count = 1.</p>

<p>Simple rollup function would return counts of all the leaves, i.e. 1, 1, 2, whereas I need to group by color and count distinct IDs within that group...</p>