Skip to content

Commit

Permalink
Fixed for categories
Browse files Browse the repository at this point in the history
  • Loading branch information
elenatorro committed Nov 8, 2019
1 parent 428a792 commit 85cedae
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/renderer/viz/expressions/belongs.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,6 @@ function generateBelongsExpression (name, inlineMaker, jsEval) {
const funcName = `belongs${this._uid}`;
const funcList = this._getFuncList();
const funcBody = this.list.elems.map(funcList).join('');

// TODO: should work for categories too using the category uid
const preface = `float ${funcName}(float x){
${funcBody}
Expand All @@ -123,7 +121,7 @@ function generateBelongsExpression (name, inlineMaker, jsEval) {

_getFuncList () {
return (elem) => {
const x = isNumber(elem) ? `${elem}.0` : elem;
const x = isNumber(elem) ? `${elem}.0` : `cat${elem._uid}`;
return `if (x${this.compare}${x}) { return 1.; }`;
}
}
Expand All @@ -138,8 +136,6 @@ function generateBelongsExpression (name, inlineMaker, jsEval) {
checkType(name, 'list', 1, `${type}-list`, this.list);
}
});

// this.inlineMaker = inlineMaker(this.list.elems);
}
};
}

0 comments on commit 85cedae

Please sign in to comment.