From bfffca4a5bf683f0f3b9fca6e87cb1745dbbb0d4 Mon Sep 17 00:00:00 2001 From: Alex | Kronox Date: Tue, 26 Sep 2023 16:54:24 +0200 Subject: [PATCH 01/22] add lib --- report-viewer/package-lock.json | 73 +++++++++++++++++++++++++++++++++ report-viewer/package.json | 1 + 2 files changed, 74 insertions(+) diff --git a/report-viewer/package-lock.json b/report-viewer/package-lock.json index 4c063d310..a33e370f2 100644 --- a/report-viewer/package-lock.json +++ b/report-viewer/package-lock.json @@ -13,6 +13,7 @@ "@fortawesome/free-solid-svg-icons": "^6.4.2", "@fortawesome/vue-fontawesome": "^3.0.3", "chart.js": "^4.4.0", + "chartjs-chart-graph": "^4.2.5", "chartjs-plugin-datalabels": "^2.2.0", "highlight.js": "^11.8.0", "jszip": "^3.10.0", @@ -766,6 +767,16 @@ "@types/chai": "*" } }, + "node_modules/@types/d3-force": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/@types/d3-force/-/d3-force-3.0.6.tgz", + "integrity": "sha512-G9wbOvCxkNlLrppoHLZ6oFpbm3z7ibfkXwLD8g5/4Aa7iTEV0Z7TQ0OL8UxAtvdOhCa2VZcSuqn1NQqyCEqmiw==" + }, + "node_modules/@types/d3-hierarchy": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/@types/d3-hierarchy/-/d3-hierarchy-3.1.4.tgz", + "integrity": "sha512-wrvjpRFdmEu6yAqgjGy8MSud9ggxJj+I9XLuztLeSf/E0j0j6RQYtxH2J8U0Cfbgiw9ZDHyhpmaVuWhxscYaAQ==" + }, "node_modules/@types/jsdom": { "version": "21.1.3", "resolved": "https://registry.npmjs.org/@types/jsdom/-/jsdom-21.1.3.tgz", @@ -1806,6 +1817,23 @@ "pnpm": ">=7" } }, + "node_modules/chartjs-chart-graph": { + "version": "4.2.5", + "resolved": "https://registry.npmjs.org/chartjs-chart-graph/-/chartjs-chart-graph-4.2.5.tgz", + "integrity": "sha512-peZFFOYBLMn8cCvtT9xNapwOA8enfPQ3DO7bTBSNCTw0GjurnwxW3BF6H3lGjn+9VURVaVN/NHF2nSvUaCsxnw==", + "dependencies": { + "@types/d3-force": "^3.0.5", + "@types/d3-hierarchy": "^3.1.3", + "d3-dispatch": "^3.0.1", + "d3-force": "^3.0.0", + "d3-hierarchy": "^3.1.2", + "d3-quadtree": "^3.0.1", + "d3-timer": "^3.0.1" + }, + "peerDependencies": { + "chart.js": "^4.1.0" + } + }, "node_modules/chartjs-plugin-datalabels": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/chartjs-plugin-datalabels/-/chartjs-plugin-datalabels-2.2.0.tgz", @@ -2002,6 +2030,51 @@ "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.2.tgz", "integrity": "sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==" }, + "node_modules/d3-dispatch": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-dispatch/-/d3-dispatch-3.0.1.tgz", + "integrity": "sha512-rzUyPU/S7rwUflMyLc1ETDeBj0NRuHKKAcvukozwhshr6g6c5d8zh4c2gQjY2bZ0dXeGLWc1PF174P2tVvKhfg==", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-force": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/d3-force/-/d3-force-3.0.0.tgz", + "integrity": "sha512-zxV/SsA+U4yte8051P4ECydjD/S+qeYtnaIyAs9tgHCqfguma/aAQDjo85A9Z6EKhBirHRJHXIgJUlffT4wdLg==", + "dependencies": { + "d3-dispatch": "1 - 3", + "d3-quadtree": "1 - 3", + "d3-timer": "1 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-hierarchy": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/d3-hierarchy/-/d3-hierarchy-3.1.2.tgz", + "integrity": "sha512-FX/9frcub54beBdugHjDCdikxThEqjnR93Qt7PvQTOHxyiNCAlvMrHhclk3cD5VeAaq9fxmfRp+CnWw9rEMBuA==", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-quadtree": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-quadtree/-/d3-quadtree-3.0.1.tgz", + "integrity": "sha512-04xDrxQTDTCFwP5H6hRhsRcb9xxv2RzkcsygFzmkSIOJy3PeRJP7sNk3VRIbKXcog561P9oU0/rVH6vDROAgUw==", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-timer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-timer/-/d3-timer-3.0.1.tgz", + "integrity": "sha512-ndfJ/JxxMd3nw31uyKoY2naivF+r29V+Lc0svZxe1JvvIRmi8hUsrMvdOwgS1o6uBHmiz91geQ0ylPP0aj1VUA==", + "engines": { + "node": ">=12" + } + }, "node_modules/data-urls": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-4.0.0.tgz", diff --git a/report-viewer/package.json b/report-viewer/package.json index c88eef012..5e5de762a 100644 --- a/report-viewer/package.json +++ b/report-viewer/package.json @@ -22,6 +22,7 @@ "@fortawesome/free-solid-svg-icons": "^6.4.2", "@fortawesome/vue-fontawesome": "^3.0.3", "chart.js": "^4.4.0", + "chartjs-chart-graph": "^4.2.5", "chartjs-plugin-datalabels": "^2.2.0", "highlight.js": "^11.8.0", "jszip": "^3.10.0", From 46b43176402746e467796a948fa6e232109f50b2 Mon Sep 17 00:00:00 2001 From: Alex | Kronox Date: Tue, 26 Sep 2023 17:44:02 +0200 Subject: [PATCH 02/22] add chart component --- report-viewer/src/components/ClusterGraph.vue | 172 ++++++++++++++++++ report-viewer/src/utils/ColorUtils.ts | 5 +- report-viewer/src/views/ClusterView.vue | 4 +- 3 files changed, 179 insertions(+), 2 deletions(-) create mode 100644 report-viewer/src/components/ClusterGraph.vue diff --git a/report-viewer/src/components/ClusterGraph.vue b/report-viewer/src/components/ClusterGraph.vue new file mode 100644 index 000000000..7f2fbb0c7 --- /dev/null +++ b/report-viewer/src/components/ClusterGraph.vue @@ -0,0 +1,172 @@ + + + diff --git a/report-viewer/src/utils/ColorUtils.ts b/report-viewer/src/utils/ColorUtils.ts index e44adec27..7625cd80a 100644 --- a/report-viewer/src/utils/ColorUtils.ts +++ b/report-viewer/src/utils/ColorUtils.ts @@ -68,7 +68,10 @@ const graphColors = { }), contentFill: 'rgba(190, 22, 34, 0.5)', contentBorder: 'rgb(127, 15, 24)', - pointFill: 'rgba(190, 22, 34, 1)' + pointFill: 'rgba(190, 22, 34, 1)', + contentFillAlpha(alpha: number) { + return `rgba(190, 22, 34, ${alpha})` + } } export { generateColors, graphColors } diff --git a/report-viewer/src/views/ClusterView.vue b/report-viewer/src/views/ClusterView.vue index 62c94d50e..c2435b37f 100644 --- a/report-viewer/src/views/ClusterView.vue +++ b/report-viewer/src/views/ClusterView.vue @@ -13,7 +13,8 @@
- + +

Comparisons of Cluster Members:

@@ -25,6 +26,7 @@