From 95be4fdcf4a3c9a01ec49ca899b68c5f417b4903 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefanie=20J=C3=A4ger?= Date: Wed, 20 Dec 2023 14:06:26 +0100 Subject: [PATCH] Ooooh, get graph working --- package-lock.json | 28 ++- package.json | 2 + .../ModuleDependencyDropdown.vue | 28 +-- .../ModuleDependencyGraph.vue | 177 +++++++++++------- .../ModuleDependencyPage.vue | 4 +- 5 files changed, 154 insertions(+), 85 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7ea157c..dccc470 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,11 +17,13 @@ "chart.js": "^4.4.0", "chartjs-chart-graph": "^4.2.6", "chartjs-plugin-datalabels": "^2.2.0", + "cytoscape": "^3.28.0", "vue": "^3.2.47", "vue-router": "^4.1.6", "vuedraggable": "^4.1.0" }, "devDependencies": { + "@types/cytoscape": "^3.19.16", "@types/node": "^20.3.3", "@typescript-eslint/eslint-plugin": "^6.0.0", "@typescript-eslint/parser": "^6.0.0", @@ -689,6 +691,12 @@ "moment": "^2.10.2" } }, + "node_modules/@types/cytoscape": { + "version": "3.19.16", + "resolved": "https://registry.npmjs.org/@types/cytoscape/-/cytoscape-3.19.16.tgz", + "integrity": "sha512-A3zkjaZ6cOGyqEvrVuC1YUgiRSJhDZOj8Qhd1ALH2/+YxH2za1BOmR4RWQsKYHsc+aMP/IWoqg1COuUbZ39t/g==", + "dev": true + }, "node_modules/@types/d3-force": { "version": "3.0.6", "resolved": "https://registry.npmjs.org/@types/d3-force/-/d3-force-3.0.6.tgz", @@ -1646,6 +1654,18 @@ "resolved": "https://registry.npmjs.org/csstype/-/csstype-2.6.21.tgz", "integrity": "sha512-Z1PhmomIfypOpoMjRQB70jfvy/wxT50qW08YXO5lMIJkrdq4yOTR+AW7FqutScmB9NkLwxo+jU+kZLbofZZq/w==" }, + "node_modules/cytoscape": { + "version": "3.28.0", + "resolved": "https://registry.npmjs.org/cytoscape/-/cytoscape-3.28.0.tgz", + "integrity": "sha512-x7+BHQXN90Audv5xXvdOECmiKuZdeKeoqOmDuYoht4zDKSdObC0Z9AdJXFkXEQvXU8UndI6WnTz47TRI7duReg==", + "dependencies": { + "heap": "^0.2.6", + "lodash": "^4.17.21" + }, + "engines": { + "node": ">=0.10" + } + }, "node_modules/d3-dispatch": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/d3-dispatch/-/d3-dispatch-3.0.1.tgz", @@ -2801,6 +2821,11 @@ "he": "bin/he" } }, + "node_modules/heap": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/heap/-/heap-0.2.7.tgz", + "integrity": "sha512-2bsegYkkHO+h/9MGbn6KWcE45cHZgPANo5LXF7EvWdT0yT2EguSVO1nDgU5c8+ZOPwp2vMNa7YFsJhVcDR9Sdg==" + }, "node_modules/ignore": { "version": "5.2.4", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", @@ -3288,8 +3313,7 @@ "node_modules/lodash": { "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, "node_modules/lodash.merge": { "version": "4.6.2", diff --git a/package.json b/package.json index 21a1ede..b82b930 100644 --- a/package.json +++ b/package.json @@ -19,11 +19,13 @@ "chart.js": "^4.4.0", "chartjs-chart-graph": "^4.2.6", "chartjs-plugin-datalabels": "^2.2.0", + "cytoscape": "^3.28.0", "vue": "^3.2.47", "vue-router": "^4.1.6", "vuedraggable": "^4.1.0" }, "devDependencies": { + "@types/cytoscape": "^3.19.16", "@types/node": "^20.3.3", "@typescript-eslint/eslint-plugin": "^6.0.0", "@typescript-eslint/parser": "^6.0.0", diff --git a/src/components/module-dependency-graph/ModuleDependencyDropdown.vue b/src/components/module-dependency-graph/ModuleDependencyDropdown.vue index 3ff244c..4c68958 100644 --- a/src/components/module-dependency-graph/ModuleDependencyDropdown.vue +++ b/src/components/module-dependency-graph/ModuleDependencyDropdown.vue @@ -1,12 +1,4 @@ + + diff --git a/src/components/module-dependency-graph/ModuleDependencyPage.vue b/src/components/module-dependency-graph/ModuleDependencyPage.vue index 1e1ff30..51cd12c 100644 --- a/src/components/module-dependency-graph/ModuleDependencyPage.vue +++ b/src/components/module-dependency-graph/ModuleDependencyPage.vue @@ -11,7 +11,7 @@
- +
@@ -35,6 +35,7 @@ export default defineComponent({ return { modulesForGraph: [] as Module[], allModules: [] as Module[], + selectedModules: [] as Module[], } }, async mounted() { @@ -57,6 +58,7 @@ export default defineComponent({ } this.modulesForGraph = [...selectedModules, ...recommended, ...recommending].filter((value, index, array) => array.indexOf(value) === index); + this.selectedModules = selectedModules; }, getRecommendedModulesForModule(module: Module, visited: Module[]): Module[] { const recommended = module.recommendedModuleIds.map(m => this.allModules.find(f => f.id === m));