Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make tables sortable #14

Open
fasiha opened this issue Sep 4, 2014 · 0 comments
Open

Make tables sortable #14

fasiha opened this issue Sep 4, 2014 · 0 comments

Comments

@fasiha
Copy link
Owner

fasiha commented Sep 4, 2014

D3's design of putting data into the DOM for later selection and processing is fantastic. I can do this right now in the Javascript console:

d3.select('tbody').selectAll('tr').sort(function(a, b) {
    return -(a.noteSortKeyFact - b.noteSortKeyFact) /
               (_.max(_.pluck(revlogTable, 'noteSortKeyFact')) * 2) +
           (a.ease - b.ease);
});

to sort the reviews table so that lower ease (review result) is at the top, and for reviews at the same ease, the higher noteSortKeyFact (in this case, the kanji number) comes first, so I see the ones I failed and most recently learned at the top. THAT was easy! (http://bl.ocks.org/mbostock/3719724 inspiration)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant