plot icon indicating copy to clipboard operation
plot copied to clipboard

select top *k* values?

Open Fil opened this issue 3 years ago • 1 comments

A data transform to select the top k values in each series (facet+z) Plot.selectTop({k: 5, value: "revenue", ...options})

Fil avatar Mar 22 '22 12:03 Fil

Not sure how this will fit into our existing Plot.select syntax. Currently you do something like this:

Plot.select({x: "max"}, options)

We could let you pass the k as another option, if we assume you’ll never want to select a channel k:

Plot.select({x: "top", k: 5}, options)

We could do like what we did for percentile reducers?

Plot.select({x: "top5"}, options)

We could require you to pass in a selector implementation?

Plot.select({x: Plot.top(5)}, options)

We could allow an object?

Plot.select({x: {top: 5}}, options)

Hmm.

mbostock avatar Mar 25 '22 21:03 mbostock