Closed jstcki closed 11 years ago
Well, the original intent of not using sort
was that it doesn't actually sort, right? Because what you do later is myArr.sort(d3.comparator().dimension(d3.descending, function(d){return d.name}))
, so you create a comparator with certain dimensions, not a sorting-function.
So I still kind of like the naming of dimension
. Alternative: orderBy
, to take the SQL route.
.sort()
reads well, though. Still undecided…
To me dimension()
sounds wrong with something like d3.ascending
as the first argument (try to read it as a sentence). But maybe rather .order()
so it's not going to be confused with array .sort()
?
Not 100% sure but
seems more eloquent than