Skip to content

how to sort? #1609

Answered by Fil
winner106 asked this question in Q&A
May 22, 2023 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

With the dodgeY transform, the derived y channel is not available when sorting the x domain, so we can't use the sort: {x:"y"} domain sort mark option. Instead, you can specify the x domain directly in the top-level options, like so:

x: {domain: d3.groupSort(transformedData, v => d3.sum(v, d => Math.sqrt(d["150m+"])), d => d.country)},

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@winner106
Comment options

Answer selected by winner106
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants