MCPcopy Index your code
hub / github.com/plotly/plotly.js / sortHoverData

Function sortHoverData

src/components/fx/hover.js:761–779  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

759 gd._spikepoints = newspikepoints;
760
761 var sortHoverData = function () {
762 // When sorting keep the points in the main subplot at the top
763 // then add points in other subplots
764
765 var hoverDataInSubplot = hoverData.filter(function (a) {
766 return firstXaxis && firstXaxis._id === a.xa._id && firstYaxis && firstYaxis._id === a.ya._id;
767 });
768
769 var hoverDataOutSubplot = hoverData.filter(function (a) {
770 return !(firstXaxis && firstXaxis._id === a.xa._id && firstYaxis && firstYaxis._id === a.ya._id);
771 });
772
773 hoverDataInSubplot.sort(distanceSort);
774 hoverDataOutSubplot.sort(distanceSort);
775 hoverData = hoverDataInSubplot.concat(hoverDataOutSubplot);
776
777 // move period positioned points and box/bar-like traces to the end of the list
778 hoverData = orderRangePoints(hoverData, hovermode);
779 };
780 sortHoverData();
781
782 var axLetter = hovermode.charAt(0);

Callers 1

_hoverFunction · 0.85

Calls 1

orderRangePointsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…