Skip to content

Commit

Permalink
QTL Ontology colour : QTL with no .Ontology is black, make it translu…
Browse files Browse the repository at this point in the history
…cent.

 ... to avoid obscuring those QTLs which do have .Ontology
feature.js : add ontologyColourDefault = #3, use in ontologyColour() when no values.Ontology.
  • Loading branch information
Don-Isdale committed Dec 7, 2021
1 parent 3633cda commit 82041f1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion frontend/app/models/feature.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ import { traitColour } from '../utils/draw/axis';

const dLog = console.debug;

/** many QTLs don't have .Ontology yet (so colour is undefined - black) and
* they are obscuring those that do, so try making the black translucent.
*/
const ontologyColourDefault = "#0003";


export default Model.extend({
ontology : service('data/ontology'),

Expand Down Expand Up @@ -78,7 +84,8 @@ export default Model.extend({
get ontologyColour() {
// return ontology_colour_scale(ontologyId);
let ontologyId = this.get('values.Ontology'),
colour = ontologyId && this.get('ontology').qtlColour(ontologyId);
colour = ontologyId ? this.get('ontology').qtlColour(ontologyId) :
ontologyColourDefault;
return colour;
},

Expand Down

0 comments on commit 82041f1

Please sign in to comment.