Commit 67b90081 authored by Tatiana Rocher's avatar Tatiana Rocher
Browse files

Merge branch 'selecClones'

parents ce322781 e7de1948
...@@ -258,7 +258,7 @@ ScatterPlot.prototype = { ...@@ -258,7 +258,7 @@ ScatterPlot.prototype = {
this.grpLinks = this.plot_container.append('svg:g') this.grpLinks = this.plot_container.append('svg:g')
.attr('class', 'grpLinks'); .attr('class', 'grpLinks');
//Initialisation des nodes //Initialisation of nodes
this.nodes = d3.range(this.m.clones.length) this.nodes = d3.range(this.m.clones.length)
.map(Object); .map(Object);
for (var i = 0; i < this.m.clones.length; i++) { for (var i = 0; i < this.m.clones.length; i++) {
...@@ -1702,7 +1702,19 @@ ScatterPlot.prototype = { ...@@ -1702,7 +1702,19 @@ ScatterPlot.prototype = {
.append("text"); .append("text");
leg.exit() leg.exit()
.remove(); .remove();
leg leg.on("click", function(d){
var listToSelect = [];
var halfRangeColumn = 0.5;
if (self.axisX.labels.length>1)
halfRangeColumn = (self.axisX.labels[1].pos - self.axisX.labels[0].pos)/2;
for (n in self.nodes){
if (Math.abs(self.axisX.pos(n) - d.pos) < halfRangeColumn)
//if (self.axisX.pos(n) == d.pos){
listToSelect.push(n);
}
self.m.multiSelect(listToSelect);
delete listToSelect;
})
.attr("x", function(d) { .attr("x", function(d) {
return self.gridSizeW * d.pos + self.marge_left; return self.gridSizeW * d.pos + self.marge_left;
}) })
...@@ -1795,7 +1807,19 @@ ScatterPlot.prototype = { ...@@ -1795,7 +1807,19 @@ ScatterPlot.prototype = {
.append("text"); .append("text");
leg.exit() leg.exit()
.remove(); .remove();
leg leg.on("click", function(d){
var listToSelect = [];
var halfRangeLine = 0.5;
if (self.axisY.labels.length>1)
halfRangeLine = (self.axisY.labels[1].pos - self.axisY.labels[0].pos)/2;
for (n in self.nodes){
if (Math.abs(self.axisY.pos(n) - d.pos) < halfRangeLine)
listToSelect.push(n);
}
self.m.multiSelect(listToSelect);
delete listToSelect;
})
.attr("x", function(d) { .attr("x", function(d) {
if (d.type == "subline") return self.sub_text_position_y; if (d.type == "subline") return self.sub_text_position_y;
else return self.text_position_y; else return self.text_position_y;
......
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