Skip to content

Commit

Permalink
fix payload emitted in brush event
Browse files Browse the repository at this point in the history
  • Loading branch information
Dosant committed Apr 16, 2020
1 parent 66c9906 commit bc6d22f
Showing 1 changed file with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,21 @@ export class Handler {

// memoize so that the same function is returned every time,
// allowing us to remove/re-add the same function
this.getProxyHandler = _.memoize(function(event) {
this.getProxyHandler = _.memoize(function(eventType) {
const self = this;
return function(e) {
self.vis.emit(event, e);
return function(eventPayload) {
switch (eventType) {
case 'brush':
const xRaw = _.get(eventPayload.data, 'series[0].values[0].xRaw');
if (!xRaw) return; // not sure if this is possible?
return self.vis.emit(eventType, {
table: xRaw.table,
range: eventPayload.range,
column: xRaw.column,
});
case 'click':
return self.vis.emit(eventType, eventPayload);
}
};
});

Expand Down

0 comments on commit bc6d22f

Please sign in to comment.