Skip to content

Commit

Permalink
Merge pull request #1550 from nextstrain/color-by-nucleotide-first
Browse files Browse the repository at this point in the history
controls/color-by: make nucleotide the first genotype option
  • Loading branch information
jameshadfield authored Sep 20, 2022
2 parents e671884 + 283071d commit 83da5bf
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/components/controls/color-by.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,12 @@ class ColorBy extends React.Component {
}, 400);

getGtGeneOptions() {
let options = [];
const options = [];
if (this.props.geneMap) {
options = Object.keys(this.props.geneMap).map((prot) => ({value: prot, label: prot}));
options[options.length] = {value: nucleotide_gene, label: "nucleotide"};
// Make the nucleotide the first option since it can be annoying to find the nucleotide
// option when there are ~200 genes like in monkeypox.
options.push({value: nucleotide_gene, label: "nucleotide"});
Object.keys(this.props.geneMap).forEach((prot) => options.push({value: prot, label: prot}));
}
return options;
}
Expand Down

0 comments on commit 83da5bf

Please sign in to comment.