Commit b4fc84d4 authored by aomietanski's avatar aomietanski

CloneDB occurrences axe added

parent fc54dea6
Pipeline #35533 passed with stage
in 5 seconds
......@@ -269,6 +269,13 @@ Axes.prototype = {
axis: new NumericalAxis(this.m),
fct: function(clone) {return clone.getDeletion('3', 'delLeft')}
},
"occCloneDB": {
doc: "number of occurrences in cloneDB",
label: "cloneDB occurrences",
axis: new NumericalAxis(this.m),
min: 0,
fct: function(clone) {return clone.numberInCloneDB()}
}
};
}
}
......@@ -1409,25 +1409,30 @@ Clone.prototype = {
}else if (typeof this.seg[field_name] != 'undefined'){
field = this.seg[field_name]
}
if (typeof field != 'object'){
return field;
}else{
time = this.m.getTime(time)
return field[time]
}
}
};
},
/**
* Get the number of occurrences of the clone in cloneDB
* @return {int} res - the number of occurrences, undefined if cloneDB wasn't called
*/
numberInCloneDB: function () {
var res = 0;
var clonedb = this.seg.clonedb;
if (typeof clonedb == 'undefined'){
return undefined;
}else{
for (var c in clonedb.clones_names){
res += clonedb.clones_names[c][0];
}
return res;
}
}
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment