Skip to content

Commit e7c2240

Browse files
committed
Clean up box' custom eventData function [1852]
1 parent 6a2ae3b commit e7c2240

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/traces/box/event_data.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,16 @@
99
'use strict';
1010

1111
module.exports = function eventData(out, pt) {
12+
13+
// Note: hoverOnBox property is needed for click-to-select
14+
// to ignore when a box was clicked. This is the reason box
15+
// implements this custom eventData function.
1216
if(pt.hoverOnBox) out.hoverOnBox = pt.hoverOnBox;
1317

14-
// TODO Clean up
1518
if('xVal' in pt) out.x = pt.xVal;
16-
else if('x' in pt) out.x = pt.x;
17-
1819
if('yVal' in pt) out.y = pt.yVal;
19-
else if('y' in pt) out.y = pt.y;
20-
2120
if(pt.xa) out.xaxis = pt.xa;
2221
if(pt.ya) out.yaxis = pt.ya;
23-
if(pt.zLabelVal !== undefined) out.z = pt.zLabelVal;
2422

2523
return out;
2624
};

0 commit comments

Comments
 (0)