Skip to content

Commit 30d1f85

Browse files
authored
Merge pull request #4087 from plotly/fix4086-parcoords-stick-range
Bug fix parcoords - selecting lines outside displayed range axis
2 parents 6d09846 + b30f07e commit 30d1f85

File tree

5 files changed

+918
-16
lines changed

5 files changed

+918
-16
lines changed

src/traces/parcoords/axisbrush.js

-6
Original file line numberDiff line numberDiff line change
@@ -266,12 +266,6 @@ function attachDragBehavior(selection) {
266266
s.newExtent = [s.startExtent, d.unitToPaddedPx.invert(y)].sort(sortAsc);
267267
}
268268

269-
// take care of the parcoords axis height constraint: bar can't breach it
270-
var bottomViolation = Math.max(0, -s.newExtent[0]);
271-
var topViolation = Math.max(0, s.newExtent[1] - 1);
272-
s.newExtent[0] += bottomViolation;
273-
s.newExtent[1] -= topViolation;
274-
275269
d.brush.filterSpecified = true;
276270
s.extent = s.stayingIntervals.concat([s.newExtent]);
277271
s.brushCallback(d);

src/traces/parcoords/lines.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -225,9 +225,11 @@ function makeItem(model, leftmost, rightmost, itemNumber, i0, i1, x, y, panelSiz
225225

226226
function expandedPixelRange(bounds) {
227227
var dh = maskHeight - 1;
228+
var a = Math.max(0, Math.floor(bounds[0] * dh), 0);
229+
var b = Math.min(dh, Math.ceil(bounds[1] * dh), dh);
228230
return [
229-
Math.max(0, Math.floor(bounds[0] * dh), 0),
230-
Math.min(dh, Math.ceil(bounds[1] * dh), dh)
231+
Math.min(a, b),
232+
Math.max(a, b)
231233
];
232234
}
233235

Loading

0 commit comments

Comments
 (0)