Conversation
Fixed areaY to work with dense intervals (interval + reduce) without requiring an explicit y option, matching lineY behavior. 🤖 Generated with [Claude Code](https://claude.ai/code) Total cost: $5.51 Total duration (API): 23m 31.3s Total duration (wall): 14h 30m 4.3s Total code changes: 208 lines added, 53 lines removed Token usage by model: claude-3-5-haiku: 204.7k input, 4.8k output, 0 cache read, 0 cache write claude-sonnet: 18.9k input, 28.4k output, 8.3m cache read, 629.5k cache write
mbostock
left a comment
There was a problem hiding this comment.
More description about how this fixes the problem would be helpful in the PR. (And it would be more relevant than your experience with AI, though I appreciate you sharing!) I guess this changes the behavior exactly when y is undefined, but preserves the current behavior when y is null. Will anything else be affected by this fix?
|
Good call. I added details in the description. |
mbostock
left a comment
There was a problem hiding this comment.
I figured out how to lift the defaults for dense intervals up so they are shared between line and area. That feels a little cleaner to me.
mbostock
left a comment
There was a problem hiding this comment.
I’m less sure about this, but at least according to the tests, the area mark also doesn’t need the maybeIdentity transform now?
|
Merging main was a bit complicated by 3542325; then I saw that lineX could be simplified to follow the same pattern as we had in areaX (we were setting the defaults |
Defaults for
x,y,indexOf, andidentityare now set insidemaybeDenseIntervalX/maybeDenseIntervalY, instead of being scattered across the mark constructors. This fixes a bug whereareaY(andareaX) with a dense interval did not apply the reducer to the y (or x) channel, because the default was set too late — after the dense interval transform had already been configured.For example, this now works as expected:
Previously, the dense interval would not reduce
ybecauseywas still undefined whenmaybeDenseIntervalXran. Theidentitydefault was only applied later bymaybeIdentityY.Closes #2328