From b75111c28470a41420a9959d96d65fe86a062a4d Mon Sep 17 00:00:00 2001
From: Remi  PLANEL <rplanel@pasteur.fr>
Date: Wed, 3 Apr 2024 13:33:06 +0200
Subject: [PATCH] Add also in onMounted

---
 components/content/pdockqMatrix.vue | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/components/content/pdockqMatrix.vue b/components/content/pdockqMatrix.vue
index 3767cdae..881deb31 100644
--- a/components/content/pdockqMatrix.vue
+++ b/components/content/pdockqMatrix.vue
@@ -54,6 +54,9 @@ onMounted(async () => {
         throw createError("Error while getting structure pdocks")
     }
 
+
+    attachEventHandler()
+
 })
 
 const computedSystem = computed(() => {
@@ -140,7 +143,8 @@ function getDataLabelFromCell(elem) {
     const parent = elem.parentNode.parentNode.parentNode.parentNode
     return parent.dataset.label
 }
-watch(matrixPlot, () => {
+
+function attachEventHandler() {
     const cells = d3.selectAll(".pdockq-plot").selectAll("rect")
     console.log("cells rect on watch")
     console.log(cells)
@@ -161,6 +165,10 @@ watch(matrixPlot, () => {
         else { console.log("no data found") }
     })
 
+}
+
+watch(matrixPlot, () => {
+    attachEventHandler()
 })
 function pdbNameToCif(pdbPath: string) {
     const cifPath = pdbPath.split(".").slice(0, -1).join(".")
-- 
GitLab