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

Default sort order per column #114

Open
mootari opened this issue Mar 3, 2021 · 3 comments
Open

Default sort order per column #114

mootari opened this issue Mar 3, 2021 · 3 comments
Labels
enhancement New feature or request

Comments

@mootari
Copy link
Member

mootari commented Mar 3, 2021

It is often desirable to sort numeric or date columns in descending order, viewing the highest or latest items first. In the Table input, this can only be achieved by clicking the respective column twice.

Suggested solution

  1. Allow the option reverse to be specified per column.
  2. When clicking a column header, query this setting to determine the column's initial sort order.
@Fil
Copy link
Collaborator

Fil commented Mar 4, 2021

see #76

@mootari
Copy link
Member Author

mootari commented Mar 4, 2021

I'm not sure that #76 replaces the need for this issue. It only implements an alt-modifier for the clicks, but:

  1. The modifier key isn't documented anywhere (as far as I'm aware)
  2. Even if it were, viewers can't be expected to know about it
  3. It still requires mental switching when sorting different types of columns.

@jrus
Copy link

jrus commented Mar 4, 2021

Clicking twice seems like a pretty trivial burden (this is standard behavior from many other sortable table implementations), and consistency from table to table seems like a benefit to readers. I'd skip this change.

@mbostock mbostock added the enhancement New feature or request label Mar 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants