Commit c23fd31a authored by Mikaël Salson's avatar Mikaël Salson

Merge branch 'feature-c/4014-clones-selectionnable-even-if-disable_new' into 'dev'

Resolve "clones virtuels: selectionnable même lorsqu'ils ne sont pas visibles" 2

Closes #4014

See merge request !862
parents c97212f7 d7fce16e
Pipeline #199634 failed with stages
in 16 minutes and 2 seconds
......@@ -2003,11 +2003,18 @@ Clone.prototype = {
}
}
if (mode == "bar"){
return (x.indexOf(axes[0]) != -1)
} else {
// console.default.warn("same_axes_as_scatter: The scatter mode is not correct; '"+mode+"'")
return x.equals(axes)
// if scatterplot is in "one_system" mode
if (this.m.system != "multi" || typeof this.m.system != 'undefined'){
var locus = this.getLocus()
var same_locus = (this.m.getCurrentSystem() == locus)
return (x.equals(axes) && same_locus)
} else {
return x.equals(axes)
}
}
},
......
......@@ -331,6 +331,9 @@ Model.prototype = {
}, //end loadGermline
getCurrentSystem: function(){
return this.germlineV.system
},
/**
* compute some meta-data for each clones
* */
......
......@@ -299,7 +299,7 @@ ScatterPlot.prototype = {
},
includeBar: function(clone, log) {
var system_grid = (!this.use_system_grid || (this.use_system_grid && this.m.germlineV.system == clone.get('germline') ))
var system_grid = (!this.use_system_grid || (this.use_system_grid && this.m.getCurrentSystem() == clone.get('germline') ))
var showVirtual;
// Set if the clone should be show on is virtual/distrib status
......@@ -519,7 +519,7 @@ ScatterPlot.prototype = {
var xpos = 0.8
if (system != this.m.germlineV.system) {
if (system != this.m.getCurrentSystem()) {
this.systemGrid.label.push({
"text": system,
"enabled": enabled,
......@@ -834,8 +834,8 @@ ScatterPlot.prototype = {
this.updateElemStyle();
if (this.m.germlineV.system != this.system) {
this.system = this.m.germlineV.system
if (this.m.getCurrentSystem() != this.system) {
this.system = this.m.getCurrentSystem() //
this.changeSplitMethod(this.splitX, this.splitY, this.mode)
}
return this;
......@@ -958,7 +958,7 @@ ScatterPlot.prototype = {
if (xpos === undefined) node.hasValidAxisPosition = false
if (ypos === undefined) node.hasValidAxisPosition = false
if (this.use_system_grid && this.m.system == "multi" && typeof sys != 'undefined' && sys != this.m.germlineV.system) {
if (this.use_system_grid && this.m.system == "multi" && typeof sys != 'undefined' && sys != this.m.getCurrentSystem()) {
node.use_system_grid = true
node.x2 = Math.random()*0.01 + this.systemGrid[sys].x * this.resizeW;
node.y2 = Math.random()*0.01 + this.systemGrid[sys].y * this.resizeH;
......
......@@ -315,8 +315,11 @@ ScatterPlot_selector.prototype = {
node_y = mid_y + this.margin[0];
}
if (clone.isActive() && (clone.getSize() || clone.getSequenceSize()) && node_x > x1 && node_x < x2 && node_y > y1 && node_y < y2)
nodes_selected.push(i);
if (clone.isActive() && (clone.getSize() || clone.getSequenceSize()) && node_x > x1 && node_x < x2 && node_y > y1 && node_y < y2 &&
(!clone.hasSizeDistrib() || (clone.sameAxesAsScatter(this) && clone.getSize()) ) ) {
nodes_selected.push(i);
}
}
this.selector
......@@ -336,6 +339,7 @@ ScatterPlot_selector.prototype = {
* @param {integer} cloneID - clone index
* */
clickNode: function(cloneID) {
if (this.m.clone(cloneID).hasSizeDistrib() && !this.m.clone(cloneID).sameAxesAsScatter(this)) {return}
this.m.unselectAllUnlessKey(d3.event)
this.m.select(cloneID)
},
......
......@@ -118,6 +118,38 @@ class TestScatterplot < BrowserTest
assert ( axis[3].text == "0.01" ), ">> incorrect fourth legend, got '" + axis[3].text + "', expected '0.01'"
end
def test_05_multiple_select_with_inapropriate_distrib_clone
## reset, time 0, preset 0
$b.send_keys 0
$b.graph_x_legend("0").fire_event('click')
$b.update_icon.wait_while(&:present?)
slider = $b.menu_item("top_slider")
slider.click
$b.menu_filter.hover
slider.send_keys :arrow_left
slider.send_keys :arrow_left
slider.send_keys :arrow_left
$b.clone_in_list("0").click
$b.update_icon.wait_while(&:present?)
assert ( $b.clone_in_segmenter('0').present? ), ">> First click; Correct selection of clone 0 by click in scatterplot"
assert ( not $b.clone_in_segmenter('1').present? ), ">> First click; Clone 1 should not be present in segmenter"
# assert ( not $b.clone_in_scatterplot("18").present? ), "distrib clone is present"
$b.send_keys 4
$b.update_icon.wait_while(&:present?)
$b.send_keys 0
$b.update_icon.wait_while(&:present?)
circle_18 = $b.clone_in_scatterplot('18')
circle_18.fire_event('click') # allow to click if clone is not visible or under another element
# control by segmenter the curent state of selection
segmenter_stat = $b.statsline
assert ( segmenter_stat.text.include? "1 clone, 50 reads (20.00%)" ), "segmenter show correct information of selection (without selection of distrib clone)"
end
def test_07_open_click_by_dblclick
## reset, time 0, preset 0
$b.send_keys 0
......
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