Skip to content

Commit

Permalink
unify non-period and period filter
Browse files Browse the repository at this point in the history
  • Loading branch information
archmoj committed May 20, 2021
1 parent bb67741 commit 3b85534
Showing 1 changed file with 11 additions and 15 deletions.
26 changes: 11 additions & 15 deletions src/components/fx/hover.js
Original file line number Diff line number Diff line change
Expand Up @@ -661,22 +661,18 @@ function _hover(gd, evt, subplot, noHoverEvent) {

findHoverPoints(customXVal, customYVal);

var axLetter = hovermode.charAt(0);
if(winningPoint.trace[axLetter + 'period']) {
var k;
var seen = {};
for(k = 0; k < initLen; k++) {
seen[hoverData[k].trace.index] = true;
}
var k;
var seen = {};
for(k = 0; k < initLen; k++) {
seen[hoverData[k].trace.index] = true;
}

// remove non-period aditions and traces that seen before
for(k = hoverData.length - 1; k >= initLen; k--) {
if(
seen[hoverData[k].trace.index] ||
!hoverData[k].trace[axLetter + 'period']
) {
hoverData.splice(k, 1);
}
// remove aditions and traces that seen before
for(k = hoverData.length - 1; k >= initLen; k--) {
if(
seen[hoverData[k].trace.index]
) {
hoverData.splice(k, 1);
}
}

Expand Down

0 comments on commit 3b85534

Please sign in to comment.