observablehq / observablehq/plot
Should Plot.maxX consume the reverse option?
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 5.4k
- Forks
- 244
- PR merge metrics
- No merged PRs in 30d
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the Plot.selectMaxX and Plot.stackY entry points using the two examples in the issue, then inspect how the select transform handles order and reverse. Compare both transform orderings and define done as reverse behaving consistently with the documented or intended selection semantics.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- data-visualization
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100