diff options
author | Thomas F. K. Jorna <[email protected]> | 2021-08-02 18:31:18 +0200 |
---|---|---|
committer | Thomas F. K. Jorna <[email protected]> | 2021-08-02 18:31:18 +0200 |
commit | b9e491d6ab0ab7a8d900d127ef1d3a0fdaa2ffe1 (patch) | |
tree | ebbd3207de10005e514e6f1dba70c4d9753ebdbd /pages/index.tsx | |
parent | e6cac81a1be089774161314430fce28c620d7573 (diff) |
feature: tag filtering lotic and ui
Diffstat (limited to 'pages/index.tsx')
-rw-r--r-- | pages/index.tsx | 4 |
1 files changed, 4 insertions, 0 deletions
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<NodeById>({}) const linksByNodeIdRef = useRef<LinksByNodeId>({}) + const tagsRef = useRef<Tags>([]) const updateGraphData = (orgRoamGraphData: OrgRoamGraphReponse) => { + tagsRef.current = orgRoamGraphData.tags const nodesByFile = orgRoamGraphData.nodes.reduce<NodesByFile>((acc, node) => { return { ...acc, @@ -270,6 +273,7 @@ export function GraphPage() { behavior, setBehavior, }} + tags={tagsRef.current} /> <Box position="absolute" alignItems="top"> <Graph |