Constraint contours with rounded-off edgepath bug fix#4102
Merged
Conversation
- assign contours.value to variable - assign cd0.trace to variable - apply Math.min and Math.max instead of using .apply (only 2 values) - break up if clauses into multiple lines
... as they don't support hover (yet).
... no need to have separate file for these routines.
N.B. this mock renders fine on master, but failed during
one attempt at fixing contour+constraint bug
... with incorrect baselines.
Note that carpet_rounded_off-edgepath-gt renders correctly, but
is important to lock down the correct fix.
- this way the "prefixBoundary" logic for both `levels` and `constraint` contours is in the same place - note that `cheater_contour` mock fails if we call closeBoundaries on contourcarpet trace with `levels` contours
++ update incorrect baselines added two commits ago.
... with similar `edgepaths.length vs starts.length` logic than
previous commit.
Note that this patch may also fix un-reported bug for contour
traces with level contours. I haven't been able to spot any
while working on this patch.
... in this case joinAllPaths does enough already to render the
constraint contours correctly.
Contributor
Author
|
(finally) merging this thing for 1.50.0 |
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 a
contourcarpetbug reported in https://github.com/plotly/phoenix-integration/issues/244before: https://codepen.io/etpinard/pen/BXwzvw
after: https://codepen.io/etpinard/pen/bXoeOa
This bug also affects
contourtraces withtype: 'constraint'contours. Seebefore: https://codepen.io/etpinard/pen/QeqEZm?editors=0010
after: https://codepen.io/etpinard/pen/jgGrex?editors=1010
This PR is another step towards fixing all the edge cases at the contour edges - like #1309
This bug occurs when a
contour(carpet)trace withcontours.type: 'constraint'has all itsedgepaths(computed infindAllPaths) rounded off (done here infindAllPaths). In this case, the checks for below the contour value are off and the resulting contour-fill paths are missing a boundary prefix making the fill region incorrect and leading to this bug.Thank you very much to whoever wrote these comments
plotly.js/src/traces/contour/empty_pathinfo.js
Lines 45 to 49 in dbe942a
they got me thinking about a potential fix.
The most important part of this PR are the 5️⃣ new mocks. Please note that mocks
contour_constraints_equal_boundary_minmaxandcarpet_rounded-off-edgepath-gtrender fine onmastercurrently. I added them here as they proved very useful in figuring out how to fix this bug w/o causing regressions.In brief,
levelsandconstraintcontours logic more similar. This commit should not introduce any changes in behaviour.closeBoundarieslogic forcontourandcontourcarpettogether. I'm fairly confident the work here is correct, but perhaps we shouldn't release these commits in a patch version.Moreover, since I spent almost a full week in
src/traces/contour/andsrc/traces/contourcarpet/, I made a few clean-up commits and I decided to "might as well" checked off #1311.cc @plotly/plotly_js