Skip to content

Commit 2f7ad27

Browse files
committed
Simplify check if clicked point is the sole selected point [1852]
- Remove an unnecessary call to `isPointOrBinSelected` in case the clicked point is part of a binned trace (like histogram).
1 parent b3984f7 commit 2f7ad27

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/plots/cartesian/select.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -315,10 +315,10 @@ function selectOnClick(evt, gd, xAxes, yAxes, subplot, dragOptions, polygonOutli
315315
// Note: potentially costly operation isPointOrBinSelected is
316316
// called as late as possible through the use of an assignment
317317
// in an if condition.
318-
if((isBinnedTrace ?
318+
if(isBinnedTrace ?
319319
isOnlyThisBinSelected(searchTraces, clickedPtInfo) :
320-
isOnlyOnePointSelected(searchTraces)) &&
321-
(pointOrBinSelected = isPointOrBinSelected(clickedPtInfo)))
320+
isOnlyOnePointSelected(searchTraces) &&
321+
(pointOrBinSelected = isPointOrBinSelected(clickedPtInfo)))
322322
{
323323
if(polygonOutlines) polygonOutlines.remove();
324324
for(i = 0; i < searchTraces.length; i++) {

0 commit comments

Comments
 (0)