From d6b4fe3507a2b9936e63cb93b3da2eba893fad3c Mon Sep 17 00:00:00 2001 From: Emile Date: Sat, 22 Jan 2022 15:04:08 +0100 Subject: [PATCH] feat: Expand nodes in the BC Juggl view graph --- src/Visualisations/Juggl.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Visualisations/Juggl.ts b/src/Visualisations/Juggl.ts index 7a50400e..d9eb576e 100644 --- a/src/Visualisations/Juggl.ts +++ b/src/Visualisations/Juggl.ts @@ -89,9 +89,16 @@ class BCStore extends Component implements ICoreDataStore { return new BCStoreEvents(); } - getNeighbourhood(nodeId: VizId[]): Promise { + async getNeighbourhood(nodeIds: VizId[], view: IJuggl): Promise { // TODO - return Promise.resolve([]); + const new_nodes = []; + for (const nodeId of nodeIds) { + const name = nodeId.id.slice(0, -3); + for (const new_node of this.graph.neighbors(name)) { + new_nodes.push(await this.get(new VizId(new_node + ".md", STORE_ID), view)) + } + } + return new_nodes; } refreshNode(id: VizId, view: IJuggl): void | Promise {