Skip to content

Commit

Permalink
Fix isNumber
Browse files Browse the repository at this point in the history
  • Loading branch information
elenatorro committed Nov 8, 2019
1 parent 8803848 commit 2a04d9a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/renderer/viz/expressions/belongs.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { implicitCast, checkType, checkExpression, checkMaxArguments } from './utils';
import BaseExpression from './base';
import * as util from 'util';

/**
* Check if a categorical value belongs to a list of categories.
Expand Down Expand Up @@ -121,7 +120,7 @@ function generateBelongsExpression (name, inlineMaker, jsEval) {

_getFuncList () {
return (elem) => {
const x = util.isNumber(elem) ? `${elem}.0` : `cat${elem._uid}`;
const x = this.input.type === 'number' ? `${elem}.0` : `cat${elem._uid}`;
return `if (x${this.compare}${x}) { return 1.; }`;
};
}
Expand Down

0 comments on commit 2a04d9a

Please sign in to comment.