Commit 5f6b6753 authored by Mathieu Giraud's avatar Mathieu Giraud
Browse files

Merge branch 'feature-c/2452' into 'dev'

fix -- a clone without reads should not be displayed

Closes #2452

See merge request !47
parents b08d8ce4 62d452d5
...@@ -722,11 +722,10 @@ ScatterPlot.prototype = { ...@@ -722,11 +722,10 @@ ScatterPlot.prototype = {
var clone = this.barTab[i][j] var clone = this.barTab[i][j]
var cloneID = clone.index; var cloneID = clone.index;
if (this.includeBar(clone)){ if (this.includeBar(clone)){
height = 0;
height = clone.getSize()/bar_max; height = clone.getSize()/bar_max;
// Minimal height (does not affect y_pos) // Minimal height (does not affect y_pos)
var height_for_display = Math.max(height, 0.01) var height_for_display = this.heightClone(height)
var y_pos_for_display = y_pos + height_for_display ; var y_pos_for_display = y_pos + height_for_display ;
y_pos += height; y_pos += height;
...@@ -816,31 +815,6 @@ ScatterPlot.prototype = { ...@@ -816,31 +815,6 @@ ScatterPlot.prototype = {
}, },
/**
* compute the height of a bar representing a given clone in the bar graph mode
* @param {integer} cloneID - clone index
* @return {float} height
* */
getBarHeight: function(cloneID) {
var size = this.m.clone(cloneID)
.getSize();
return size / this.bar_max;
},
/**
* compute the x pos of a bar representing a given clone in the bar graph mode
* @param {integer} cloneID - clone index
* @return {float} pos
* */
getBarPosition: function(cloneID) {
for (var i = 0; i < this.vKey.length; i++) {
for (var j = 0; j < this.bar_v[this.vKey[i]].clones.length; j++) {
if (this.bar_v[this.vKey[i]].clones[j].id == cloneID)
return this.bar_v[this.vKey[i]].clones[j].pos;
}
}
},
/** /**
* select a mode * select a mode
* @param {mode} new mode, this.MODE_* * @param {mode} new mode, this.MODE_*
...@@ -1220,15 +1194,22 @@ ScatterPlot.prototype = { ...@@ -1220,15 +1194,22 @@ ScatterPlot.prototype = {
}, },
/** /**
* return the actual radius of the clone * return the actual radius (for MODE_GRID) or height (for MODE_BAR) of the clone
* @param {float} size - clone ratio size, between 0.0 and 1.0 * A clone without reads is not displayed
* A clone with a small number of reads is displayed and has a minimal size
* @param {float} size/height - clone ratio size, between 0.0 and 1.0
* @return {float} size - clone display size
* */ * */
radiusClone: function(size) { radiusClone: function(size) {
if (size === 0) if (size === 0)
return 0 ; return 0 ;
//Math.pow(x,y) -> x**y
return this.resizeCoef * Math.pow((size + this.resizeMinSize), (1 / 3)) / 25 return this.resizeCoef * Math.pow((size + this.resizeMinSize), (1 / 3)) / 25
}, },
heightClone: function(height) {
if (height === 0)
return 0 ;
return Math.max(height, 0.01)
},
/** /**
......
Supports Markdown
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