From ecef1afc6f9e1bc9beb130113fcf13dee5ddb16a Mon Sep 17 00:00:00 2001 From: Jorrit Boekel Date: Mon, 18 Nov 2024 16:08:52 +0100 Subject: [PATCH] Fix gene plot which fetched wrong ids in tulos frontend --- src/frontend/mstulos/src/GenePlots.svelte | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/frontend/mstulos/src/GenePlots.svelte b/src/frontend/mstulos/src/GenePlots.svelte index 6af67909..c4ba2fd8 100644 --- a/src/frontend/mstulos/src/GenePlots.svelte +++ b/src/frontend/mstulos/src/GenePlots.svelte @@ -9,9 +9,10 @@ let errors = []; async function fetchData() { let url = new URL('/mstulos/plotdata/genes/', document.location); - let expids = new Set(); - data.forEach(x => x.experiments.forEach(x => expids.add(x[0]))); - const post = {expids: Array.from(expids), gids: data.map(x => x.id )} + const post = { + expids: Array.from(new Set(data.flatMap(x => x.experiments.map(e => e[0])))), + gids: Array.from(new Set(data.flatMap(x => x.genes.map(g => g[0])))), + } const resp = await postJSON(url, post); return resp; }