-
how can I Plot.barX(
data,
Plot.filter(
???????,
Plot.groupY(
{x: 'count'},
{
y: 'industry',
sort: {y: 'x', reverse: true},
}
)
)
), |
Beta Was this translation helpful? Give feedback.
Answered by
mbostock
May 20, 2023
Replies: 1 comment 1 reply
-
Either use the filter reducer option in the group outputs Plot.barX(
data,
Plot.groupY(
{x: "count", filter: (d) => d.length > 2},
{
y: "industry",
sort: {y: "x", reverse: true}
}
)
) or compose the filter transform with the group transform like you originally proposed Plot.barX(
data,
Plot.filter(
(d) => d.length > 2,
Plot.groupY(
{x: "count"},
{
y: "industry",
sort: {y: "x", reverse: true}
}
)
)
) In either case the filter function is passed the aggregated data, which is the array of data in each group. |
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
Either use the filter reducer option in the group outputs
or compose the filter transform with the group transform like you originally proposed
In either case the filter function is passed the aggregated data, which is the array of data in each group.