Skip to content

Commit 428e248

Browse files
committed
fixup ordering period points
1 parent e96ad53 commit 428e248

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/components/fx/hover.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -641,14 +641,15 @@ function _hover(gd, evt, subplot, noHoverEvent) {
641641
hoverData.sort(function(d1, d2) { return d1.distance - d2.distance; });
642642

643643
// move period positioned points to the end of list
644-
orderPeriod(hoverData, hovermode);
644+
hoverData = orderPeriod(hoverData, hovermode);
645645

646646
// If in compare mode, select every point at position
647647
if(
648648
helpers.isXYhover(mode) &&
649649
hoverData[0].length !== 0 &&
650650
hoverData[0].trace.type !== 'splom' // TODO: add support for splom
651651
) {
652+
var initLen = hoverData.length;
652653
var winningPoint = hoverData[0];
653654

654655
var customXVal = customVal('x', winningPoint, fullLayout);
@@ -659,8 +660,6 @@ function _hover(gd, evt, subplot, noHoverEvent) {
659660
// also find start, middle and end point for period
660661
var axLetter = hovermode.charAt(0);
661662
if(winningPoint.trace[axLetter + 'period']) {
662-
var initLen = hoverData.length;
663-
664663
var v = winningPoint[axLetter + 'LabelVal'];
665664
var ax = winningPoint[axLetter + 'a'];
666665
var T = {};
@@ -1932,7 +1931,7 @@ function orderPeriod(hoverData, hovermode) {
19321931
}
19331932
}
19341933

1935-
hoverData = first.concat(last);
1934+
return first.concat(last);
19361935
}
19371936

19381937
function customVal(axLetter, winningPoint, fullLayout) {

0 commit comments

Comments
 (0)