From 15ec0ca944623959ca27bf40b5121aa44ddce6ed Mon Sep 17 00:00:00 2001 From: Torben Brenner Date: Fri, 27 Oct 2023 15:30:46 +0200 Subject: [PATCH 1/2] refactor: corrected specimen tooltips --- packages/demo/src/AppCCP.svelte | 42 ++++++++++++++++----------------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/packages/demo/src/AppCCP.svelte b/packages/demo/src/AppCCP.svelte index 9fb6070..541f0b8 100644 --- a/packages/demo/src/AppCCP.svelte +++ b/packages/demo/src/AppCCP.svelte @@ -167,30 +167,28 @@ .set("ST", "Strahlentherapie") .set("OP", "Operation"); - const specimenHeaders: Map = new Map() - .set("whole-blood", "Whole blood") - .set("bone-marrow", "Bone marrow") - .set("buffy-coat", "Buffy-Coat") - .set("dried-whole-blood", "Dried whole blood") - .set( - "peripheral-blood-cells-vital", - "Peripheral blood mononuclear cells (PBMCs, viable)" - ) + const specimenTooltips: Map = new Map() + .set("whole-blood", "Vollblut") + .set("bone-marrow", "Knochenmark") + .set("buffy-coat", "Buffycoat") + .set("dried-whole-blood", "Blutkarten Guthrie") + .set("peripheral-blood-cells", "Periphere mononukleäre Blutzellen (PBMC)") .set("blood-plasma", "Plasma") .set("blood-serum", "Serum") - .set("ascites", "Ascites") - .set("csf-liquor", "CSF/Liquor") - .set("saliva", "Saliva") - .set("stool-faeces", "Stool/Faeces") - .set("urine", "Urine") - .set("swab", "Swab") - .set("liquid-other", "Other liquid biosample/storage") - .set("tissue-ffpe", "Tissue FFPE") - .set("tissue-frozen", "Tissue frozen") - .set("tissue-other", "Other tissue storage") + .set("ascites", "Aszites") + .set("csf-liquor", "Liquor") + .set("saliva", "Speichel") + .set("stool-faeces", "Stuhl") + .set("urine", "Urin") + .set("swab", "Abstrich") + .set("liquid-other", "Flüssigprobe, Andere") + .set("tissue-ffpe", "Gewebe FFPE") + .set("tissue-frozen", "Gewebe schockgefroren") + .set("tissue-other", "Gewebe, Andere Konservierungsart") .set("dna", "DNA") .set("rna", "RNA") - .set("derivative-other", "Other derivative"); + .set("derivative-other", "Derivat, Andere") + @@ -333,7 +331,7 @@ chartType="bar" xAxisTitle="Probentypen" yAxisTitle="Probenanzahl" - tooltips={specimenHeaders} + tooltips={specimenTooltips} /> @@ -350,4 +348,4 @@ > - \ No newline at end of file + From 0d51499a4ab7c03004d8dfa23ca7644f3f8cecdc Mon Sep 17 00:00:00 2001 From: Mats Johansen Date: Mon, 30 Oct 2023 10:31:02 +0100 Subject: [PATCH 2/2] feat(options): add chart tooltips to options fix(charts): add missing tooltips --- packages/demo/public/options.json | 49 +++++++++++++++++-- packages/demo/src/AppCCP.svelte | 42 ---------------- .../results/ChartComponent.wc.svelte | 6 +-- 3 files changed, 49 insertions(+), 48 deletions(-) diff --git a/packages/demo/public/options.json b/packages/demo/public/options.json index b376dfe..fd5d96c 100644 --- a/packages/demo/public/options.json +++ b/packages/demo/public/options.json @@ -45,17 +45,60 @@ ] }, "therapy_of_tumor": { - "aggregations": ["medicationStatements"] + "aggregations": ["medicationStatements"], + "tooltips": { + "OP": "Operationen", + "ST": "Strahlentherapien", + "medicationStatements": "Systemische Therapien" + } }, "medicationStatements": { "hintText": [ "Art der systemischen oder abwartenden Therapie (ADT Basisdatensatz Versionen 2014, 2021)" - ] + ], + "tooltips":{ + "CH": "Chemotherapie", + "HO": "Hormontherapie", + "IM": "Immun-/Antikörpertherapie", + "KM": "Knochenmarktransplantation", + "ZS": "zielgerichtete Substanzen", + "CI": "Chemo- + Immun-/Antikörpertherapie", + "CZ": "Chemotherapie + zielgerichtete Substanzen", + "CIZ": "Chemo- + Immun-/Antikörpertherapie + zielgerichtete Substanzen", + "IZ": "Immun-/Antikörpertherapie + zielgerichtete Substanzen", + "SZ": "Stammzelltransplantation (inklusive Knochenmarktransplantation)", + "AS": "Active Surveillance", + "WS": "Wait and see", + "WW": "Watchful Waiting", + "SO": "Sonstiges" + } }, "sample_kind": { "hintText": [ "Verteilung der Bioprobentypen der Patienten gemäß der ausgewählten Kriterien. Es werden auch Einträge angezeigt, die ggfs. außerhalb der Suchkriterien liegen." - ] + ], + "tooltips":{ + "whole-blood": "Vollblut", + "bone-marrow": "Knochenmark", + "buffy-coat": "Buffycoat", + "dried-whole-blood": "Blutkarten Guthrie", + "peripheral-blood-cells": "Periphere mononukleäre Blutzellen (PBMC,", + "blood-plasma": "Plasma", + "blood-serum": "Serum", + "ascites": "Aszites", + "csf-liquor": "Liquor", + "saliva": "Speichel", + "stool-faeces": "Stuhl", + "urine": "Urin", + "swab": "Abstrich", + "liquid-other": "Flüssigprobe, Andere", + "tissue-ffpe": "Gewebe FFPE", + "tissue-frozen": "Gewebe schockgefroren", + "tissue-other": "Gewebe, Andere Konservierungsart", + "dna": "DNA", + "rna": "RNA", + "derivative-other": "Derivat, Andere" + } } } } \ No newline at end of file diff --git a/packages/demo/src/AppCCP.svelte b/packages/demo/src/AppCCP.svelte index 541f0b8..dfbfaca 100644 --- a/packages/demo/src/AppCCP.svelte +++ b/packages/demo/src/AppCCP.svelte @@ -150,45 +150,6 @@ "Sys. T" ); - const therapyTooltips: Map = new Map() - .set("OP", "Operationen") - .set("ST", "Strahlentherapien") - .set("medicationStatements", "Systemische Therapien"); - - const systemicTherapyTooltips: Map = new Map() - .set("CH", "Chemotherapie") - .set("HO", "Hormontherapie") - .set("IM", "Immun- und Antikörpertherapie") - .set("KM", "Knochenmarkstransplantation") - .set("WS", "Wait and see") - .set("AS", "Active Surveillance") - .set("ZS", "Zielgerichtete Substanzen") - .set("SO", "Sonstiges") - .set("ST", "Strahlentherapie") - .set("OP", "Operation"); - - const specimenTooltips: Map = new Map() - .set("whole-blood", "Vollblut") - .set("bone-marrow", "Knochenmark") - .set("buffy-coat", "Buffycoat") - .set("dried-whole-blood", "Blutkarten Guthrie") - .set("peripheral-blood-cells", "Periphere mononukleäre Blutzellen (PBMC)") - .set("blood-plasma", "Plasma") - .set("blood-serum", "Serum") - .set("ascites", "Aszites") - .set("csf-liquor", "Liquor") - .set("saliva", "Speichel") - .set("stool-faeces", "Stuhl") - .set("urine", "Urin") - .set("swab", "Abstrich") - .set("liquid-other", "Flüssigprobe, Andere") - .set("tissue-ffpe", "Gewebe FFPE") - .set("tissue-frozen", "Gewebe schockgefroren") - .set("tissue-other", "Gewebe, Andere Konservierungsart") - .set("dna", "DNA") - .set("rna", "RNA") - .set("derivative-other", "Derivat, Andere") - @@ -309,7 +270,6 @@ catalogueGroupCode="therapy_of_tumor" chartType="bar" headers={therapyHeaders} - tooltips={therapyTooltips} xAxisTitle="Art der Therapie" yAxisTitle="Anzahl der Therapien" /> @@ -319,7 +279,6 @@ title="Systemische Therapien" catalogueGroupCode="medicationStatements" chartType="bar" - tooltips={systemicTherapyTooltips} xAxisTitle="Art der Therapie" yAxisTitle="Anzahl der Therapien" /> @@ -331,7 +290,6 @@ chartType="bar" xAxisTitle="Probentypen" yAxisTitle="Probenanzahl" - tooltips={specimenTooltips} /> diff --git a/packages/lib/src/components/results/ChartComponent.wc.svelte b/packages/lib/src/components/results/ChartComponent.wc.svelte index 246e0ad..160aeff 100644 --- a/packages/lib/src/components/results/ChartComponent.wc.svelte +++ b/packages/lib/src/components/results/ChartComponent.wc.svelte @@ -114,9 +114,9 @@ callbacks: { title: (context: any) => { const key = context[0].label || ""; - let result = tooltips.get(key) - ? tooltips.get(key) - : key; + let result = options.tooltips && options.tooltips[key] + ? options.tooltips[key] + : key return result; }, },