From 01b704ee8b1f2a28230be957c2472d31b1b0a828 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20V=C3=A9ril?= Date: Tue, 5 May 2020 13:12:09 +0200 Subject: [PATCH] Combine sets in statistics --- content/multipledataset.html | 36 +++++++++--------------------------- 1 file changed, 9 insertions(+), 27 deletions(-) diff --git a/content/multipledataset.html b/content/multipledataset.html index 2f290266..14c67890 100644 --- a/content/multipledataset.html +++ b/content/multipledataset.html @@ -239,7 +239,7 @@ draft: false $(stb).empty() var sdatdic = new Map() for (const d of window.filtData) { - const key = JSON.stringify([d.method, d.DOI.string]) + const key = JSON.stringify(d.method) if (!(sdatdic.has(key))) { sdatdic.set(key, new Map()) } @@ -273,8 +273,8 @@ draft: false } else { const key = JSON.parse(strkey) - const newkey = JSON.stringify([key[0].name, key[1]]) - const newkeybasis = JSON.stringify(key[0].basis) + const newkey = JSON.stringify([key.name]) + const newkeybasis = JSON.stringify(key.basis) if (!sdatdic2.has(newkey)) { sdatdic2.set(newkey, new Map()) } @@ -312,28 +312,11 @@ draft: false row = $("") key = JSON.parse(keystr) if (!combbasis) { - Reflect.setPrototypeOf(key[0], method.prototype) + Reflect.setPrototypeOf(key, method.prototype) } - //Reflect.setPrototypeOf(key[1], DOI.prototype) th = $("", { scope: "column" }) - const [meth, doi] = key + const meth = key th.clone().text(meth.toString("\n").split('-').join('\u2011')).appendTo(row) - var thdoi = th.clone() - var publi = doiCache.get(doi, true) - const publis = await getPublis() - const sets = publis.sets - if (sets.has(doi)) { - var str = sets.get(doi) - $(thdoi).append(str + " ") - } - $("", { - href: new DOI(doi).url, - target: "_blank" - }).html(publi.format('citation', { - format: 'html', - lang: 'en-US' - })).appendTo(thdoi) - $(row).append(thdoi) const noNanVals = (vals.every((v) => Number.isNaN(v))) ? vals : (vals.filter((v) => !Number.isNaN(v))) const avals = noNanVals.map(v => Math.abs(v)) th.clone().text(noNanVals.length).appendTo(row) @@ -344,7 +327,7 @@ draft: false var box = { x: noNanVals, amean: ss.mean(avals).toFixed(3), - name: key[0].toString() + " MAD : " + ss.mean(avals).toPrecision(4), + name: key.toString() + " MAD : " + ss.mean(avals).toPrecision(4), type: 'box', boxmean: 'sd' }; @@ -555,11 +538,11 @@ draft: false async function reloadRef() { const combbasis = $("#cb_combbasis").is(':checked') $(sel_ref).empty() - for (const el of uniq(window.filtData.map(d => [d.method, d.DOI.string]))) { + for (const el of uniq(window.filtData.map(d => d.method))) { op = $("