Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 #12325.
Description
When
fill: 'stack'builds the stack target,findPointpassed the result ofLineElement.interpolate()straight topoint[property].interpolate()returns one point per matching segment, and when the source point's x sits within rounding error of a shared segment boundary it matches two segments at once and returns an array. In that casepoint[property]isundefined, the raw array is pushed into the stack target's points, and the dataset's fill disappears completely (reproducible deterministically by nudging a point's x by 1e-9, and visible as a flicker at the end of animatedchart.update()calls, as in the jsfiddle in the issue).The points of the matching segments are equal within rounding error of the source point, so taking the first one is safe. Analysis and the proposed approach are from @reporter in #12325 (the issue includes a deterministic repro); this PR implements the fix and adds a regression test.
Changes
src/plugins/plugin.filler/filler.target.stack.js: infindPoint, take the first point wheninterpolate()returns an array.test/specs/plugin.filler.tests.js: regression test rendering the deterministic repro from the issue (a stacked area chart where a point of the upper dataset is nudged by 1e-9) and asserting the canvas is unchanged compared to the un-nudged render — without the fix, the upper band's fill vanishes and the canvas differs.Testing
pnpm test-ci-karma --grep=filler: all filler specs pass except the pre-existingdrawTimeFillFalse/beforeDatasetDrawfixture pixel failure (0.46% difference, also fails on unmodified master with Chrome 154 — environmental, unrelated to this change).eslintclean on the changed files.