Skip to content

Commit f3697a8

Browse files
authoredJun 26, 2017
Merge pull request #1819 from plotly/fixup-scattergeo-event-data
Fixup geo event data
2 parents 09181b1 + c17e62c commit f3697a8

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed
 

‎src/traces/scattergeo/event_data.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
module.exports = function eventData(out, pt) {
1414
out.lon = pt.lon;
1515
out.lat = pt.lat;
16-
out.location = pt.lon ? pt.lon : null;
16+
out.location = pt.loc ? pt.loc : null;
1717

1818
return out;
1919
};

‎src/traces/scattergeo/hover.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ module.exports = function hoverPoints(pointData) {
6666
pointData.y1 = pos[1] + rad;
6767

6868
pointData.loc = di.loc;
69-
pointData.lat = lonlat[0];
70-
pointData.lon = lonlat[1];
69+
pointData.lon = lonlat[0];
70+
pointData.lat = lonlat[1];
7171

7272
pointData.color = getTraceColor(trace, di);
7373
pointData.extraText = getExtraText(trace, di, geo.mockAxis);

‎test/jasmine/tests/geo_test.js

+12-12
Original file line numberDiff line numberDiff line change
@@ -1109,9 +1109,9 @@ describe('Test event property of interactions on a geo plot:', function() {
11091109
expect(pt.curveNumber).toEqual(0, 'points[0].curveNumber');
11101110
expect(typeof pt.data).toEqual(typeof {}, 'points[0].data');
11111111
expect(typeof pt.fullData).toEqual(typeof {}, 'points[0].fullData');
1112-
expect(pt.lat).toEqual(-101.57, 'points[0].lat');
1113-
expect(pt.lon).toEqual(57.75, 'points[0].lon');
1114-
expect(pt.location).toEqual(57.75, 'points[0].location');
1112+
expect(pt.lat).toEqual(57.75, 'points[0].lat');
1113+
expect(pt.lon).toEqual(-101.57, 'points[0].lon');
1114+
expect(pt.location).toEqual('CAN', 'points[0].location');
11151115
expect(pt.pointNumber).toEqual(0, 'points[0].pointNumber');
11161116
expect(pt.text).toEqual(20, 'points[0].text');
11171117
expect(pt['marker.size']).toEqual(20, 'points[0][\'marker.size\']');
@@ -1157,9 +1157,9 @@ describe('Test event property of interactions on a geo plot:', function() {
11571157
expect(pt.curveNumber).toEqual(0, 'points[0].curveNumber');
11581158
expect(typeof pt.data).toEqual(typeof {}, 'points[0].data');
11591159
expect(typeof pt.fullData).toEqual(typeof {}, 'points[0].fullData');
1160-
expect(pt.lat).toEqual(-101.57, 'points[0].lat');
1161-
expect(pt.lon).toEqual(57.75, 'points[0].lon');
1162-
expect(pt.location).toEqual(57.75, 'points[0].location');
1160+
expect(pt.lat).toEqual(57.75, 'points[0].lat');
1161+
expect(pt.lon).toEqual(-101.57, 'points[0].lon');
1162+
expect(pt.location).toEqual('CAN', 'points[0].location');
11631163
expect(pt.pointNumber).toEqual(0, 'points[0].pointNumber');
11641164
expect(pt.text).toEqual(20, 'points[0].text');
11651165
expect(pt['marker.size']).toEqual(20, 'points[0][\'marker.size\']');
@@ -1198,9 +1198,9 @@ describe('Test event property of interactions on a geo plot:', function() {
11981198
expect(pt.curveNumber).toEqual(0, 'points[0].curveNumber');
11991199
expect(typeof pt.data).toEqual(typeof {}, 'points[0].data');
12001200
expect(typeof pt.fullData).toEqual(typeof {}, 'points[0].fullData');
1201-
expect(pt.lat).toEqual(-101.57, 'points[0].lat');
1202-
expect(pt.lon).toEqual(57.75, 'points[0].lon');
1203-
expect(pt.location).toEqual(57.75, 'points[0].location');
1201+
expect(pt.lat).toEqual(57.75, 'points[0].lat');
1202+
expect(pt.lon).toEqual(-101.57, 'points[0].lon');
1203+
expect(pt.location).toEqual('CAN', 'points[0].location');
12041204
expect(pt.pointNumber).toEqual(0, 'points[0].pointNumber');
12051205
expect(pt.text).toEqual(20, 'points[0].text');
12061206
expect(pt['marker.size']).toEqual(20, 'points[0][\'marker.size\']');
@@ -1234,9 +1234,9 @@ describe('Test event property of interactions on a geo plot:', function() {
12341234
expect(pt.curveNumber).toEqual(0, 'points[0].curveNumber');
12351235
expect(typeof pt.data).toEqual(typeof {}, 'points[0].data');
12361236
expect(typeof pt.fullData).toEqual(typeof {}, 'points[0].fullData');
1237-
expect(pt.lat).toEqual(-101.57, 'points[0].lat');
1238-
expect(pt.lon).toEqual(57.75, 'points[0].lon');
1239-
expect(pt.location).toEqual(57.75, 'points[0].location');
1237+
expect(pt.lat).toEqual(57.75, 'points[0].lat');
1238+
expect(pt.lon).toEqual(-101.57, 'points[0].lon');
1239+
expect(pt.location).toEqual('CAN', 'points[0].location');
12401240
expect(pt.pointNumber).toEqual(0, 'points[0].pointNumber');
12411241
expect(pt.text).toEqual(20, 'points[0].text');
12421242
expect(pt['marker.size']).toEqual(20, 'points[0][\'marker.size\']');

0 commit comments

Comments
 (0)
Please sign in to comment.