Skip to content

Commit

Permalink
Merge pull request #4719 from solgenomics/topic/fixing_histogram
Browse files Browse the repository at this point in the history
fixing histogram when management factors are present
  • Loading branch information
lukasmueller authored Nov 6, 2023
2 parents de28d94 + b244d81 commit 60ca8a8
Showing 1 changed file with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,24 @@
}
var histLoc = d3.select(loc);
var header = data[0];
var traitName = header[header.length-(header[header.length-1]!="notes"?1:2)];

// var traitName = header[header.length-(header[header.length-1]!="notes"?1:2)];

// Find the index of the "notes" column
var notesIndex = header.indexOf("notes");

if (notesIndex !== -1 && notesIndex > 0) {
// Get the column before "notes"
var traitName = header[notesIndex - 1];
} else {
// Handle the case where "notes" is the first column or not found
var traitName = null; // You can use a default value or handle this case as needed
}


// The `traitName` variable contains the column before "notes" or null if "notes" is the first column or not found
console.log(traitName);


var observations = data.slice(1).map(function(d){
var o = {};
Expand Down

0 comments on commit 60ca8a8

Please sign in to comment.