From 2b255fd37d4f1344116a068a3f7d0dd1d8bd29fa Mon Sep 17 00:00:00 2001 From: Annie Moriondo <104587901+moriondo2022@users.noreply.github.com> Date: Fri, 13 Dec 2024 17:31:38 -0500 Subject: [PATCH] Plot sync (#816) * located the right place to emit * streamlined a little * narrowing down the problem * emitting from research phewas * dots are being received from phewas to pigean plot * phewas is receiving * can close pigean hover box even when not pinned --- src/components/PigeanPlot.vue | 28 +++++++++++++++---- .../researchPortal/ResearchPheWAS.vue | 24 +++++++++------- src/views/PIGEAN/Gene/Template.vue | 4 +++ src/views/PIGEAN/Gene/main.js | 15 ++++++++++ 4 files changed, 55 insertions(+), 16 deletions(-) diff --git a/src/components/PigeanPlot.vue b/src/components/PigeanPlot.vue index 75f7c10a4..2ca1b243a 100644 --- a/src/components/PigeanPlot.vue +++ b/src/components/PigeanPlot.vue @@ -24,7 +24,10 @@ Vue.use(BootstrapVueIcons); export default Vue.component("pigean-plot", { components: { }, - props: ["pigeanData", "config", "phenotypeMap", "filter", "genesetSize", "traitGroup"], + props: [ + "pigeanData", "config", "phenotypeMap", "filter", + "genesetSize", "traitGroup", "matchingHoverDots" + ], data() { return { plotId: `pigean-plot-${Math.floor(Math.random() * 10e9)}`, @@ -147,7 +150,7 @@ export default Vue.component("pigean-plot", { .data(this.chartData) .enter() .append("circle") - .attr("class", d => `${d[this.config.dotKey]}`) + .attr("class", d => `dot_${d[this.config.dotKey]}`) .attr("cx", d => d[this.config.xField] === undefined ? this.xScale(0) @@ -166,8 +169,6 @@ export default Vue.component("pigean-plot", { this.svg.selectAll("circle") .on("click", d => { if (!this.tooltipPinned){ - let closeButton = this.tooltip.select("a"); - closeButton.style("visibility", "visible"); this.tooltipPinned = true; } }); @@ -190,6 +191,7 @@ export default Vue.component("pigean-plot", { return; } this.unHoverDot(); + this.$emit("dotsHovered", dotString) let xcoord = d3.event.layerX; let ycoord = d3.event.layerY; @@ -222,13 +224,12 @@ export default Vue.component("pigean-plot", { : this.hoverBoxPosition === "left"; }, getTooltipContent(dotString){ - console.log(dotString); let dot = JSON.parse(dotString); let dKey = this.config.dotKey; let dKeyContent = dot[dKey]; // Get raw content before formatting dot.phenotype = this.phDesc(dot.phenotype); let linkAddress = `/pigean/${dKey}.html?${dKey}=${dKeyContent}${this.linkSuffix}`; - let tooltipText = '