Skip to content

Fixup geo event data #1819

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 26, 2017
Merged
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/event_data.js
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@
module.exports = function eventData(out, pt) {
out.lon = pt.lon;
out.lat = pt.lat;
out.location = pt.lon ? pt.lon : null;
out.location = pt.loc ? pt.loc : null;

return out;
};
4 changes: 2 additions & 2 deletions src/traces/scattergeo/hover.js
Original file line number Diff line number Diff line change
@@ -66,8 +66,8 @@ module.exports = function hoverPoints(pointData) {
pointData.y1 = pos[1] + rad;

pointData.loc = di.loc;
pointData.lat = lonlat[0];
pointData.lon = lonlat[1];
pointData.lon = lonlat[0];
pointData.lat = lonlat[1];

pointData.color = getTraceColor(trace, di);
pointData.extraText = getExtraText(trace, di, geo.mockAxis);
24 changes: 12 additions & 12 deletions test/jasmine/tests/geo_test.js
Original file line number Diff line number Diff line change
@@ -1109,9 +1109,9 @@ describe('Test event property of interactions on a geo plot:', function() {
expect(pt.curveNumber).toEqual(0, 'points[0].curveNumber');
expect(typeof pt.data).toEqual(typeof {}, 'points[0].data');
expect(typeof pt.fullData).toEqual(typeof {}, 'points[0].fullData');
expect(pt.lat).toEqual(-101.57, 'points[0].lat');
expect(pt.lon).toEqual(57.75, 'points[0].lon');
expect(pt.location).toEqual(57.75, 'points[0].location');
expect(pt.lat).toEqual(57.75, 'points[0].lat');
expect(pt.lon).toEqual(-101.57, 'points[0].lon');
expect(pt.location).toEqual('CAN', 'points[0].location');
expect(pt.pointNumber).toEqual(0, 'points[0].pointNumber');
expect(pt.text).toEqual(20, 'points[0].text');
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() {
expect(pt.curveNumber).toEqual(0, 'points[0].curveNumber');
expect(typeof pt.data).toEqual(typeof {}, 'points[0].data');
expect(typeof pt.fullData).toEqual(typeof {}, 'points[0].fullData');
expect(pt.lat).toEqual(-101.57, 'points[0].lat');
expect(pt.lon).toEqual(57.75, 'points[0].lon');
expect(pt.location).toEqual(57.75, 'points[0].location');
expect(pt.lat).toEqual(57.75, 'points[0].lat');
expect(pt.lon).toEqual(-101.57, 'points[0].lon');
expect(pt.location).toEqual('CAN', 'points[0].location');
expect(pt.pointNumber).toEqual(0, 'points[0].pointNumber');
expect(pt.text).toEqual(20, 'points[0].text');
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() {
expect(pt.curveNumber).toEqual(0, 'points[0].curveNumber');
expect(typeof pt.data).toEqual(typeof {}, 'points[0].data');
expect(typeof pt.fullData).toEqual(typeof {}, 'points[0].fullData');
expect(pt.lat).toEqual(-101.57, 'points[0].lat');
expect(pt.lon).toEqual(57.75, 'points[0].lon');
expect(pt.location).toEqual(57.75, 'points[0].location');
expect(pt.lat).toEqual(57.75, 'points[0].lat');
expect(pt.lon).toEqual(-101.57, 'points[0].lon');
expect(pt.location).toEqual('CAN', 'points[0].location');
expect(pt.pointNumber).toEqual(0, 'points[0].pointNumber');
expect(pt.text).toEqual(20, 'points[0].text');
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() {
expect(pt.curveNumber).toEqual(0, 'points[0].curveNumber');
expect(typeof pt.data).toEqual(typeof {}, 'points[0].data');
expect(typeof pt.fullData).toEqual(typeof {}, 'points[0].fullData');
expect(pt.lat).toEqual(-101.57, 'points[0].lat');
expect(pt.lon).toEqual(57.75, 'points[0].lon');
expect(pt.location).toEqual(57.75, 'points[0].location');
expect(pt.lat).toEqual(57.75, 'points[0].lat');
expect(pt.lon).toEqual(-101.57, 'points[0].lon');
expect(pt.location).toEqual('CAN', 'points[0].location');
expect(pt.pointNumber).toEqual(0, 'points[0].pointNumber');
expect(pt.text).toEqual(20, 'points[0].text');
expect(pt['marker.size']).toEqual(20, 'points[0][\'marker.size\']');