createDracoProgram = function(data) {
var query_constraints = "";
var c = 0;
for (var stat in schema.stats) {
if (selected_features_ids.includes(stat)) {
query_constraints += '\nencoding(e' + c + ').';
query_constraints += '\n:- not field(e' + c + ',"' + stat + '").';
let measureType = features.find(f => f.feature == stat).measureType;
query_constraints += "\n:- not type(e" + c + ',' + measureType + ').';
if (not_binned_features_ids.includes(stat)) {
query_constraints += '\n:- bin(e' + c + ',_).';
} else {
query_constraints += '\n:- not bin(e' + c + ',_).';
}
}
c += 1;
}
console.log("query constraints", query_constraints);
query_constraints += `\n`;
return query_constraints;
}