-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Constraint contours with rounded-off edgepath bug fix #4102
Merged
etpinard
merged 12 commits into
master
from
constraint-contours-rounded-off-edgepath-bug
Aug 28, 2019
Merged
Constraint contours with rounded-off edgepath bug fix #4102
etpinard
merged 12 commits into
master
from
constraint-contours-rounded-off-edgepath-bug
Aug 28, 2019
Conversation
This file contains 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
- 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.
archmoj
reviewed
Aug 5, 2019
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(finally) merging this thing for 1.50.0 |
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
contourcarpet
bug 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
contour
traces 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_minmax
andcarpet_rounded-off-edgepath-gt
render fine onmaster
currently. I added them here as they proved very useful in figuring out how to fix this bug w/o causing regressions.In brief,
levels
andconstraint
contours logic more similar. This commit should not introduce any changes in behaviour.closeBoundaries
logic forcontour
andcontourcarpet
together. 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