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

added rect for feature for the mouseover event.

parent 3cd23d6a
Vue.component("feature",{
template:
`
<svg :height="svgHeight" :width="svgWidth" :x="svgX" :y="svgY">
<polygon :points="points" :style=featureStyle @click="clickEvent" @mouseover="hoverEvent" @mouseout="$emit('unhover')"/>
<svg :height="svgHeight" :width="svgWidth" :x="svgX" :y="svgY" @click="clickEvent" @mouseover="hoverEvent" @mouseout="$emit('unhover')">
<rect :width="svgWidth" :height="svgHeight" style="fill-opacity: 0;"/>
<polygon :points="points" :style=featureStyle />
</svg>
`,
props: ['svgWidth', 'svgHeight', 'svgX', 'svgY', 'color', 'borderColor', 'featureId', 'shape','inverse'],
......
......@@ -8,7 +8,7 @@ Vue.component("genome-viewer",{
<!-- -->
<lane v-for="lane in lanes_arr" :key="lane.id" :x="to_w(0)" :y="to_h(lane)" :height="lane_height" :width="to_w(100)" :color="defaultLaneColor">
</lane>
<feature v-for="(feature, index) in sortedFeatures" :key="feature.name" :feature-id="feature.name" :svg-width="genomeToPixel(feature.end)-genomeToPixel(feature.start)" :svg-height="lane_height" :svg-x="genomeToPixel(feature.start)" :svg-y="to_h(lane(feature))" :color="getColor(feature)" :border-color="(feature.color_border)?feature.color_border : defaultBorderColor" @click="featureClick" @hover="updateFeature" @unhover="currentFeature = undefined" :shape="feature.shape? feature.shape : 'arrow'" :inverse="lane(feature)>0">
<feature v-for="(feature, index) in sortedFeatures" :key="feature.name" :feature-id="feature.name" :svg-width="genomeToPixel(feature.end)-genomeToPixel(feature.start)" :svg-height="lane_height" :svg-x="genomeToPixel(feature.start)" :svg-y="to_h(lane(feature))" :color="getColor(feature)" :border-color="(feature.color_border)?feature.color_border : defaultBorderColor" @click="featureClick" @hover="updateFeature" @unhover="unfeature" :shape="feature.shape? feature.shape : 'arrow'" :inverse="lane(feature)>0">
</feature>
<!-- -->
</svg>
......@@ -125,6 +125,9 @@ Vue.component("genome-viewer",{
window.removeEventListener('resize', this.handleResize)
},
methods:{
unfeature(){
this.currentFeature = undefined
},
shape(feat){
return "arrow"
},
......
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