From 38ee9aeffb15a32b8f46d5aec765681ffc845da0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20V=C3=A9ril?= Date: Tue, 5 May 2020 13:52:00 +0200 Subject: [PATCH] Revert "Add combine basis sets option for statistics" This reverts commit fd81ff3c2105b67033dc3623d96ee865c6c02848. --- content/multipledataset.html | 72 +++++++++++------------------------- 1 file changed, 21 insertions(+), 51 deletions(-) diff --git a/content/multipledataset.html b/content/multipledataset.html index 14c67890..44991ff3 100644 --- a/content/multipledataset.html +++ b/content/multipledataset.html @@ -232,11 +232,10 @@ draft: false } async function reloadStat() { processingIndicator.isActive = true - const combbasis = $("#cb_combbasis").is(":checked") - const refstr = $("#sel_ref option:selected").val() var stb = $("#stat_table > tbody") $("#graph_div").empty() $(stb).empty() + var refstr = $("#sel_ref option:selected").val() var sdatdic = new Map() for (const d of window.filtData) { const key = JSON.stringify(d.method) @@ -265,55 +264,22 @@ draft: false } } } - if (combbasis) { - var sdatdic2 = new Map() - for (const [strkey, sdat] of sdatdic) { - if (refstr === strkey) { - sdatdic2.set(strkey, sdatdic.get(strkey)) - } - else { - const key = JSON.parse(strkey) - const newkey = JSON.stringify([key.name]) - const newkeybasis = JSON.stringify(key.basis) - if (!sdatdic2.has(newkey)) { - sdatdic2.set(newkey, new Map()) - } - if (!sdatdic2.get(newkey).has(newkeybasis)) { - sdatdic2.get(newkey).set(newkeybasis, new Map()) - } - for (const [strkey2, exval] of sdat) { - sdatdic2.get(newkey).get(newkeybasis).set(strkey2, exval) - } - } - } - sdatdic = sdatdic2 - } + var sdic = new Map() for (const [key, sdat] of sdatdic) { - if (key !== refstr) { + for (const [key2, exval] of sdat) { if (!(sdic.has(key))) { sdic.set(key, []) } - if (combbasis) { - for (const [key2, dic] of sdat) { - for (const [key3, exval] of dic) { - sdic.get(key).push(exval - ((sdatdic.has(refstr)) ? sdatdic.get(refstr).get(key3) : NaN)) - } - } - } else { - for (const [key2, exval] of sdat) { - sdic.get(key).push(exval - ((sdatdic.has(refstr)) ? sdatdic.get(refstr).get(key2) : NaN)) - } - } + sdic.get(key).push(exval - ((sdatdic.has(refstr)) ? sdatdic.get(refstr).get(key2) : NaN)) } } + sdic.delete(refstr) var graphdat = [] for (const [keystr, vals] of sdic) { row = $("") key = JSON.parse(keystr) - if (!combbasis) { - Reflect.setPrototypeOf(key, method.prototype) - } + Reflect.setPrototypeOf(key, method.prototype) th = $("", { scope: "column" }) const meth = key th.clone().text(meth.toString("\n").split('-').join('\u2011')).appendTo(row) @@ -417,6 +383,19 @@ draft: false } } } + $(sel_ref).empty() + for (const el of uniq(window.filtData.map(d => [d.method, d.DOI.string]))) { + op = $("