-
Notifications
You must be signed in to change notification settings - Fork 198
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Currently the groupY transform populates the x channel as the frequency of observations in each group, optionally normalized. But sometimes each observation has a different weight, and you want to sum the weights to compute the x value. That can be done outside of the group transform, like so:
Plot.barX(data, {...Plot.groupY({y: "name"}), x: d => d3.sum(d, d => d.weight)})but it would be nice if there were a way to do this directly in the group transform, say by passing a x channel into the group transform, where the default x channel definition is unity (one).
Plot.barX(data, Plot.groupY({y: "name", x: "weight"}))Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request