GenSpectrum / dashboard-components

https://genspectrum.github.io/dashboard-components/
GNU Affero General Public License v3.0
2 stars 0 forks source link

feat(components): initial sorting of aggregate table #289

Closed JonasKellerer closed 5 months ago

JonasKellerer commented 5 months ago

resolves #251

Summary

It is now possible to sort the aggregate by an initial field and direction. The initial sorting direction is discarded, when users click on the header of each column.

Screenshot

IntitialSortField: count, InitialSortDirection: descending grafik

PR Checklist

vercel[bot] commented 5 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
dashboards-components ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 17, 2024 3:15pm
chaoran-chen commented 5 months ago

Cool, thanks! One small caveat: The column header currently does not indicate the order. Although the values are sorted, it just shows:

image

When the table is manually sorted, it shows:

image

it would be great if we could also have the latter display for the initial sorting.

JonasKellerer commented 5 months ago

Gridjs does not support to specify the column to sort by when rendering. I tinkered a little with plugins and the config. However, I was not able to to set the column to initially sort by. (I was able to set it initially, but only to ascending, or I was able to set it, but then the table did not change any longer when clicking on the headers. When we put the state outside of the table component, this might be a solution, but I fear that we might loose some of the other functionality).