Commit be1319c5 authored by Raphael Müller's avatar Raphael Müller
Browse files

added colormap as prop which overwrites defaults

parent b6fefd7d
......@@ -16,13 +16,13 @@
<body>
<div id="app" style="position: absolute;left: 25%;right:25%;">
<div style="height:150px">
<genome-viewer :genome-stats="genome_stats" :feature-data="feature_data"></genome-viewer>
<genome-viewer :genome-stats="genome_stats" :color-map="{'xRNA':'#CC0000'}":feature-data="feature_data"></genome-viewer>
</div>
<div >
<genome-viewer :genome-stats="genome_stats" :feature-data="feature_data2"></genome-viewer>
</div>
<div style="height:150px">
<genome-viewer :genome-stats="genome_stats" :feature-data="feature_data2"></genome-viewer>
<genome-viewer :genome-stats="genome_stats" :color-map="genome_stats.colorMap" :feature-data="feature_data2"></genome-viewer>
</div>
</div>
<script src="js/axis.js"></script>
......
......@@ -6,7 +6,8 @@ var app = new Vue({
start: 1706479,
end: 1718084,
//tooltip: "name: {name}</br>description: {description}</br>start: {start}</br>end: {end}"
tooltip: ["name","type","description","start","end","strand"]
tooltip: ["name","type","description","start","end","strand"],
colorMap: {"xRNA":"#CC0000"}
},
feature_data: [
{ name: "Gene 1",
......@@ -23,9 +24,7 @@ var app = new Vue({
start: 1708314,
end: 1708671,
strand: "+",
type: "gene",
color: '#454aff',
color_border: '#000000'
type: "xRNA"
},
{ name: "Gene 3",
description: "ABC transporter ATP-binding protein LlsG",
......@@ -121,9 +120,7 @@ var app = new Vue({
start: 1708314,
end: 1708671,
strand: "+",
type: "gene",
color: '#454aff',
color_border: '#000000'
type: "xRNA",
},
{ name: "Gene 23",
description: "ABC transporter ATP-binding protein LlsG",
......
......@@ -55,12 +55,6 @@ Vue.component("genome-viewer",{
colorMap: {
default: function(){
return {
'region':'#bdbdbd', // greyLighten
'gene':'#757575', // greyDarken
'cds': '#000000', // black
'rRNA': '#795548', // brown
'tRNA': '#4caf50', // green
'ncRNA': '#ff9800' // orange
}
}
},
......@@ -142,11 +136,16 @@ Vue.component("genome-viewer",{
if(feature.hasOwnProperty("type")){
if(this.colorMap.hasOwnProperty(feature.type)){
return this.colorMap[feature.type]
}else{
return this.defaultColor
}
}else {
return this.defaultColor
else{
if(this.colorMapDefault.hasOwnProperty(feature.type)){
return this.colorMapDefault[feature.type]
}else{
return this.defaultColor
}
}
} else{
return this.defaultColor
}
}
},
......@@ -207,7 +206,15 @@ Vue.component("genome-viewer",{
width: 0,
height: 0,
y: 0,
currentFeature: undefined
currentFeature: undefined,
colorMapDefault: {
'region':'#bdbdbd', // greyLighten
'gene':'#757575', // greyDarken
'cds': '#000000', // black
'rRNA': '#795548', // brown
'tRNA': '#4caf50', // green
'ncRNA': '#ff9800' // orange
}
}
},
})
Supports Markdown
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