I wanted to know the difference between sort function and ascending function in d3.
I am looking for a way to rearrange the data in my table in ascending order of the column selected.
Thanks.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Array.sort()will sort the values alphabetically in ascending order.Array.sort(d3.ascending)will sort the values naturally in ascending order. The difference can be seen when you are sorting a list of numbers.For additional information on how
sortworks, see https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/sort.