I am having a JSON data and i want to group by a field and then sort by the count.
var data = [{\"Name\":\"Ravi\",\"Country\":\"India\"},
{\"Name\":
No, there is no built-in function giving the result you are after. d3.nest()
does have a methode nest.sortValues() which will sort the leaf elements of nested data, but this is meaningless in your case since you did apply .rollup()
leaving you with just one leaf per key. As you already mentioned, the way to go is using Array.prototype.sort().