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

DSL for tooltip fields

Implements #9
parent c61ec8d3
......@@ -6,7 +6,7 @@ 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:Gene Name","type:Gene Type","description","start:Start","end:End","strand:Strand"],
colorMap: {"xRNA":"#CC0000"}
},
feature_data: [
......
......@@ -2,8 +2,8 @@ Vue.component("tool-tip",{
template:
`
<div style="transform:translate(-50%,0%);" :style="tooltipStyle">
<p v-for="property in tip" :key='property.id'>
<b>{{property}}:</b> {{feature[property]}}
<p v-for="property in tipArray" :key='property.id'>
<b>{{tipMap[property]}}:</b> {{feature[property]}}
</p>
<div :style="smallArrorStyle">
</div>
......@@ -54,6 +54,26 @@ Vue.component("tool-tip",{
},
},
computed: {
tipArray(){
let arr = [];
for (entry of this.tip){
splitted = entry.split(":");
arr.push(splitted[0])
}
return arr;
},
tipMap(){
let map = {}
for(entry of this.tip){
splitted = entry.split(":");
if(splitted.length == 1){
map[splitted[0]]=splitted[0]
}else{
map[splitted[0]]=splitted[1]
}
}
return map
},
tooltipStyle(){
return {
position: "absolute",
......
Markdown is supported
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