From 0af285401a7eb1b9115535efb4b961c27637ed0b Mon Sep 17 00:00:00 2001 From: David Mendez <dmendez@ebi.ac.uk> Date: Thu, 2 Sep 2021 12:19:29 +0100 Subject: [PATCH] Sunburst: implement handling of current path for breadcrumbs --- .../TargetsTree/TargetsSunburst.vue | 34 +++++++++---------- 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/components/mainPage/visualisations/TargetsTree/TargetsSunburst.vue b/components/mainPage/visualisations/TargetsTree/TargetsSunburst.vue index 52b3786..4dd3697 100644 --- a/components/mainPage/visualisations/TargetsTree/TargetsSunburst.vue +++ b/components/mainPage/visualisations/TargetsTree/TargetsSunburst.vue @@ -5,8 +5,12 @@ <v-card tile flat class="sunburst-card"> <v-card-subtitle> Targets in EUbOPEN </v-card-subtitle> <v-divider /> + <Sunburst + :hierachy-tree="parsedTree" + @path-updated="updateBreadcrumbsPath" + /> <v-breadcrumbs :items="currentPath"></v-breadcrumbs> - <Sunburst :hierachy-tree="parsedTree" /> + <v-divider /> <v-card-text class="text-caption text-justify"> Click on a section to expand it. Click on the links on top to see the targets of the corresponding class. @@ -29,23 +33,7 @@ export default { return { loading: true, rawHierachyTree: {}, - currentPath: [ - { - text: 'Enzyme', - disabled: false, - href: 'breadcrumbs_dashboard', - }, - { - text: 'Kinase', - disabled: false, - href: 'breadcrumbs_link_1', - }, - { - text: 'Protein Kinase', - disabled: true, - href: 'breadcrumbs_link_2', - }, - ], + currentPath: [], } }, computed: { @@ -78,6 +66,16 @@ export default { ) }) }, + updateBreadcrumbsPath(newPath) { + const parsedPath = newPath.map((pathItem) => { + return { + text: `${pathItem.name} (${pathItem.belongingsCount})`, + disabled: pathItem.tentative, + href: '/', + } + }) + this.currentPath = parsedPath + }, }, } </script> -- GitLab