Skip to content

Commit

Permalink
Brother let's go
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanieJaeger committed Dec 20, 2023
1 parent 95be4fd commit 4ba686f
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 2 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,12 @@ npm run lint-fix

### Customize configuration
See [Configuration Reference](https://vitejs.dev/config/).

## Stefi

- [ ] Label of selected modules in graph different color
- [ ] Popover on node click (select/unselect and adunis)
- [ ] Maybe position selected modules differently in graph
- [ ] Maybe style nodes differently. Rounded square with text, like planner?
- [ ] Spread nodes, so no nodes, labels or edges overlap in weird way
- [ ] Maybe get edges to not overlap when connecting to node (confusing)
20 changes: 19 additions & 1 deletion src/components/module-dependency-graph/ModuleDependencyGraph.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,19 @@ export default defineComponent({
},
methods: {
buildData(): { nodes: { data: Node }[], edges: { data: Edge }[] } {
const nodes: { data: Node }[] = [...this.modulesToDisplay.map(module => ({
const nodes1: { data: Node }[] = [...this.modulesToDisplay.map(module => ({
data: {
id: module.id,
label: module.name,
categoryColor: getCategoryColorForModule(module),
}
}))];
const nodes = nodes1.map(m => {
if(this.selectedModules.some(s => s.id === m.data.id)) {
m.data.labelColor = 'red';
}
return m;
});
let edges = [...this.modulesToDisplay.flatMap(module =>
module.recommendedModuleIds.map(recId =>
({ data: { source: recId, target: module.id } })
Expand Down Expand Up @@ -94,6 +100,17 @@ export default defineComponent({
"label": "data(label)",
}
},
{
selector: "node[labelColor]",
style: {
"color": "data(labelColor)"
}
},
// {selector: 'node[label][isSelectedModule]',
// style: {
// 'color': 'pink',
// }
// },
{
selector: "edge[label]",
style: {
Expand Down Expand Up @@ -125,6 +142,7 @@ type Node = {
id: string,
label: string,
categoryColor: string,
labelColor?: string,
};
type Edge = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,13 @@ export default defineComponent({
}
const recommending = <Module[]>[];
const recommended2 = <Module[]>[];
for (const module of selectedModules) {
this.getRecommendingModulesForModule(module, recommending);
this.getRecommendedModulesForModule(module, recommended2);
}
this.modulesForGraph = [...selectedModules, ...recommended, ...recommending].filter((value, index, array) => array.indexOf(value) === index);
this.modulesForGraph = [...recommended, ...recommended2, ...selectedModules, ...recommending].filter((value, index, array) => array.indexOf(value) === index);

Check failure on line 62 in src/components/module-dependency-graph/ModuleDependencyPage.vue

View workflow job for this annotation

GitHub Actions / Build

This line has a length of 164. Maximum allowed is 120
this.selectedModules = selectedModules;
},
getRecommendedModulesForModule(module: Module, visited: Module[]): Module[] {
Expand Down

0 comments on commit 4ba686f

Please sign in to comment.