Attention une mise à jour du service Gitlab va être effectuée le mardi 18 janvier (et non lundi 17 comme annoncé précédemment) entre 18h00 et 18h30. Cette mise à jour va générer une interruption du service dont nous ne maîtrisons pas complètement la durée mais qui ne devrait pas excéder quelques minutes.

Commit 6f2e7466 authored by Marc Duez's avatar Marc Duez
Browse files

scatterplot.js/axis.js : add custom function to create more axis

parent 247e4dde
......@@ -205,10 +205,51 @@ Axis.prototype = {
}
},
custom: function(fct){
var self = this;
this.fct = fct;
var min,
max;
for (var i in this.m.clones){
var tmp;
try{
tmp = fct(i);
}catch(e){}
if ( typeof tmp != "undefined" ){
if ( tmp > max || typeof max == "undefined") max = tmp;
if ( tmp < min || typeof min == "undefined") min = tmp;
}
}
this.sizeScale = d3.scale.linear()
.domain([min, max+1])
.range([1, 0]);
this.min = min;
this.max = max;
this.pos = function(cloneID) {
var value;
try{
value = self.fct(cloneID);
}catch(e){}
if (typeof value != "undefined"){
return self.sizeScale(value)
}else{
return self.min
}
}
this.computeCustomLabels(min, max+1, true, false, true);
},
/*
* TODO linear/log percent/value parameter
* */
custom: function(min, max, reverse, percent, linear){
computeCustomLabels: function(min, max, reverse, percent, linear){
this.labels = [];
var h = (max-min)/5
......
......@@ -106,7 +106,8 @@ function ScatterPlot(id, model) {
["allele_j", "allele J"],
["Size", "abundance"],
["sequenceLength", "clone length"],
["n", "N length"]
["n", "N length"],
["lengthCDR3", "CDR3 length"]
];
//Menu with graph distrib' (see initMenu function)
......@@ -1627,6 +1628,9 @@ ScatterPlot.prototype = {
if (splitMethod == "n") {
axis.useNlength()
}
if (splitMethod == "lengthCDR3") {
axis.custom(function(cloneID){ return m.clone(cloneID).seg["cdr3"].length})
}
},
/* Fonction permettant de mettre à jour le menu
......
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