From b9e491d6ab0ab7a8d900d127ef1d3a0fdaa2ffe1 Mon Sep 17 00:00:00 2001 From: "Thomas F. K. Jorna" Date: Mon, 2 Aug 2021 18:31:18 +0200 Subject: feature: tag filtering lotic and ui --- pages/index.tsx | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'pages') diff --git a/pages/index.tsx b/pages/index.tsx index 4a178be..ee826ce 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -51,6 +51,7 @@ const ForceGraph3D = ( export type NodeById = { [nodeId: string]: OrgRoamNode | undefined } export type LinksByNodeId = { [nodeId: string]: OrgRoamLink[] | undefined } export type NodesByFile = { [file: string]: OrgRoamNode[] | undefined } +export type Tags = string[] export type Scope = { nodeIds: string[] } @@ -79,8 +80,10 @@ export function GraphPage() { const nodeByIdRef = useRef({}) const linksByNodeIdRef = useRef({}) + const tagsRef = useRef([]) const updateGraphData = (orgRoamGraphData: OrgRoamGraphReponse) => { + tagsRef.current = orgRoamGraphData.tags const nodesByFile = orgRoamGraphData.nodes.reduce((acc, node) => { return { ...acc, @@ -270,6 +273,7 @@ export function GraphPage() { behavior, setBehavior, }} + tags={tagsRef.current} />