Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/traces/scattergeo/hover.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ function getExtraText(trace, pt, pointData, labels) {
if(hasLocation) {
text.push(pt.loc);
} else if(hasLon && hasLat) {
text.push('(' + format(pointData.lonLabel) + ', ' + format(pointData.latLabel) + ')');
text.push('(' + format(pointData.latLabel) + ', ' + format(pointData.lonLabel) + ')');
} else if(hasLon) {
text.push(labels.lon + format(pointData.lonLabel));
} else if(hasLat) {
Expand Down
6 changes: 3 additions & 3 deletions test/jasmine/tests/scattergeo_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ describe('Test scattergeo hover', function() {

describe('should preserve lon/lat formatting hovetemplate equivalence', function() {
var pos = [381, 221];
var exp = ['(10.00012°, 10.00088°)\nA'];
var exp = ['(10.00088°, 10.00012°)\nA'];

it('- base case (truncate z decimals)', function(done) {
Plotly.restyle(gd, {
Expand All @@ -427,11 +427,11 @@ describe('Test scattergeo hover', function() {
.then(done, done.fail);
});

it('- hovertemplate case (same lon/lat truncation)', function(done) {
it('- hovertemplate case (same lat/lon truncation)', function(done) {
Plotly.restyle(gd, {
lon: [[10.0001221321]],
lat: [[10.00087683]],
hovertemplate: '(%{lon}°, %{lat}°)<br>%{text}<extra></extra>'
hovertemplate: '(%{lat}°, %{lon}°)<br>%{text}<extra></extra>'
})
.then(function() { check(pos, exp); })
.then(done, done.fail);
Expand Down