Support interval+reduce in the area mark #2329
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Defaults y to the reducer when creating a dense interval.
There is a discrepancy between line and area, where the default y = identity is set:
in line, it is set immediately, whereas in area it is set in maybeIdentityY, which comes after the determination of the dense interval in maybeDenseIntervalX. By way of consequence, the dense interval does not apply the reducer to any channel.
With this change, the default reducer is applied to y when it's undefined.
An unwelcome consequence is that this defines y even when y1/y2 are defined? But I don't think it has an impact in practice, because when y2 is used y is ignored.
closes #2328
For fun I tried to solve this with Claude Code.
I've left the agent's solution as the first commit (including unit tests); I did not touch the files at all for that first commit, so I signed it with Claude's email. (The commit message is also Claude's, although I added the costs below, because the agent told me it didn't have access to this information.)
In the second commit I reversed Claude's approach, and applied a human solution instead. Is it better or worse? I'll ask copilot for an opinion.