how to sort?
#1609
-
I would greatly appreciate any help. Thanks! |
Beta Was this translation helpful? Give feedback.
Answered by
Fil
May 22, 2023
Replies: 1 comment 1 reply
-
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:
|
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
winner106
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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)},