plot icon indicating copy to clipboard operation
plot copied to clipboard

Should Plot.maxX consume the reverse option?

Open Fil opened this issue 4 years ago • 2 comments

See https://observablehq.com/@observablehq/surprising-reverse-gets-eaten: if you have

Plot.stackY(
  Plot.selectMaxX({
    order: "y",
    reverse: true
  }))

reverse: true is "eaten" by the select transform, and doesn't do anything.

Applying maxX after stackY works as expected:

Plot.selectMaxX(
  Plot.stackY({
    order: "y",
    reverse: true
  }))

I'm not sure if this is fixable (we could want all the selection transforms to pass sort and reverse untouched?), but it's at least surprising.

Fil avatar Mar 10 '22 11:03 Fil

Previously #565.

mbostock avatar Mar 10 '22 17:03 mbostock

another instance of this happening in Plot.groupZ : https://observablehq.com/@fil/diverging-stacked-bar-chart-help

Fil avatar Mar 14 '22 16:03 Fil