Skip to content

Commit

Permalink
make contourcarpet w/ levels contours work w/ closeBoundaries
Browse files Browse the repository at this point in the history
... 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.
  • Loading branch information
etpinard committed Aug 2, 2019
1 parent 6ba77c6 commit 26e66fe
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/traces/contour/close_boundaries.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ module.exports = function(pathinfo, contours) {

for(i = 0; i < pathinfo.length; i++) {
var pi = pathinfo[i];
pi.prefixBoundary = !pi.edgepaths.length && edgeVal2 > pi.level;
pi.prefixBoundary = !pi.edgepaths.length &&
(edgeVal2 > pi.level || pi.starts.length && edgeVal2 === pi.level);
}
break;
case 'constraint':
Expand Down
5 changes: 1 addition & 4 deletions src/traces/contourcarpet/plot.js
Original file line number Diff line number Diff line change
Expand Up @@ -330,10 +330,7 @@ function makeFills(trace, plotgroup, xa, ya, pathinfo, perimeter, ab2p, carpet,
var hasFills = coloring === 'fill';

// fills prefixBoundary in pathinfo items
//
// N.B. cheater_contour mock fails if we call closeBoundaries
// on contourcarpet traces that with `levels` contours
if(hasFills && trace.contours.type === 'constraint') {
if(hasFills) {
closeBoundaries(pathinfo, trace.contours);
}

Expand Down

0 comments on commit 26e66fe

Please sign in to comment.