Skip to content

Commit 658d311

Browse files
committed
revise winnig point not to be bar or box
1 parent 3b85534 commit 658d311

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/components/fx/hover.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -644,8 +644,8 @@ function _hover(gd, evt, subplot, noHoverEvent) {
644644

645645
hoverData.sort(function(d1, d2) { return d1.distance - d2.distance; });
646646

647-
// move period positioned points to the end of list
648-
hoverData = orderPeriod(hoverData, hovermode);
647+
// move period positioned points and box/bar-like traces to the end of the list
648+
hoverData = orderRangePoints(hoverData, hovermode);
649649

650650
// If in compare mode, select every point at position
651651
if(
@@ -1864,7 +1864,7 @@ function plainText(s, len) {
18641864
});
18651865
}
18661866

1867-
function orderPeriod(hoverData, hovermode) {
1867+
function orderRangePoints(hoverData, hovermode) {
18681868
var axLetter = hovermode.charAt(0);
18691869

18701870
var first = [];
@@ -1873,7 +1873,11 @@ function orderPeriod(hoverData, hovermode) {
18731873
for(var i = 0; i < hoverData.length; i++) {
18741874
var d = hoverData[i];
18751875

1876-
if(d.trace[axLetter + 'period']) {
1876+
if(
1877+
d.trace[axLetter + 'period'] ||
1878+
Registry.traceIs(d.trace, 'bar-like') ||
1879+
Registry.traceIs(d.trace, 'box-violin')
1880+
) {
18771881
last.push(d);
18781882
} else {
18791883
first.push(d);

0 commit comments

Comments
 (0)