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.
Fixes #1202. The previous fix in #950 was only partly correct: in essence, it was trying to undo transform applied by applyTransform:
plot/src/style.js
Lines 383 to 389 in c095660
But the behavior of applyTransform varies from mark to mark, and even within a mark depending on which channels are applied, for example for collapsed rects:
plot/src/marks/rect.js
Line 62 in c095660
Rather than trying to undo the transform, this fix instead wraps the G element with another (untransformed) G element, applying the clip to the parent G element. And thus the clipped region is not affected by the mark’s transform.
To simplify the adoption of this fix, applyIndirectStyles now mutates the passed-in selection.node to return the parent G element when clipping is applied. This means that callers effectively get the fix “for free” (and we now don’t even need to pass scales to applyIndirectStyles). I’m sure there’s a cleaner way to do this, but this seems good for now and minimizes churn.
Previously #949.