Skip to content

Commit

Permalink
Handle gene bar navigation from region view.
Browse files Browse the repository at this point in the history
  • Loading branch information
grosscol committed Sep 16, 2024
1 parent ab81832 commit 3f290e9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bravue",
"version": "0.16.0",
"version": "0.16.1",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
Expand Down
3 changes: 2 additions & 1 deletion src/components/GeneBars.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export default {
start: {default: 200000},
stop: {default: 201000}
},
emits: ['geneClick', 'close'],
props: {
//formerly region.segments.plot
segmentBounds: {
Expand Down Expand Up @@ -256,7 +257,7 @@ export default {
this.rects_box.on("mouseover", this.handleBarMouseover)
this.rects_box.on("mouseout", this.handleBarMouseout)
this.rects_box.on("click", d => this.$emit("click", d));
this.rects_box.on("click", d => this.$emit("geneClick", d));
},
draw: function () {
this.x_scale.range(this.segmentBounds).domain(this.segmentRegions);
Expand Down
6 changes: 6 additions & 0 deletions src/components/RegionDashboard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
<div class="row justify-content-left">
<div class="col-md px-5" v-if="positionResolved">
<GeneBars v-if="showPanels.genes.val" @close="showPanels.genes.val = false"
@gene-click="handleGeneBarClick"
:hoveredVarPosition="hoveredVarPosition" :segmentBounds="segmentBounds"
:segmentRegions="segmentRegions" :givenWidth="childWidth" :givenMargins="childMargins"/>
</div>
Expand Down Expand Up @@ -235,6 +236,11 @@ export default {
handleCloseModal: function(){
this.showModal = false }
,
handleGeneBarClick: function(evt){
console.log("geneClick")
console.log("gene.html?id="+evt.target.__data__.gene_name)
window.location.href="gene.html?id="+evt.target.__data__.gene_name
},
togglePanelAttr: function(attrName) {
this[attrName] = !this[attrName]
this.showMenuDropDown = !this.showMenuDropDown
Expand Down

0 comments on commit 3f290e9

Please sign in to comment.