Skip to content

Commit

Permalink
Bug fix for duplicate areas appearing in the multiselect
Browse files Browse the repository at this point in the history
  • Loading branch information
henryjameslau committed Jan 6, 2022
1 parent bd8a64e commit 53284c2
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1034,7 +1034,7 @@ <h2 id="measuresLabel">Data table for selected areas</h2>
} //end of annotationCreation

selectlist(graphic_data);
multiselect(graphic_data);


function selectlist(datacsv) {

Expand Down Expand Up @@ -1088,7 +1088,7 @@ <h2 id="measuresLabel">Data table for selected areas</h2>
// unhide comparison
d3.select("#dataTable").style("display", "block")


multiselect(graphic_data);

clicked = true;
d3.selectAll(".cell").classed("cellspermselected", false);
Expand Down Expand Up @@ -1174,16 +1174,19 @@ <h2 id="measuresLabel">Data table for selected areas</h2>
var dropnames = datacsv.map(function(d, i) {
return d.group
}).filter(function(item, pos, val) {
return val.indexOf(item) == pos
return val.indexOf(item) == pos //filter uniques
})

var dropcodes = datacsv.map(function(d, i) {
return d.unique
}).filter(function(item, pos, val) {
return val.indexOf(item) == pos
return val.indexOf(item) == pos //filter uniques
})

var menuarea = d3.zip(dropnames, dropcodes).sort(function(a, b) {
return d3.ascending(a[0], b[0]);
}).filter(function(d){
return d[1]!=$("#dropselect").val()
});

//clear dropdown
Expand Down

0 comments on commit 53284c2

Please sign in to comment.