2024-01-09 - Frontend GraphNav requesting relNodes
Revision as of 23:35, 8 January 2024 by Sven the Barbarian (talk | contribs) (Created page with "Frontend SitePage Element - GraphNavigation = graphNavigation useRef = * graphNavigation has Ref focusedNodes that stores array of focused nodes for each graphNav * graphNavigation has Ref for all nodes sent relNode request to backend (so not double up requests) = initialNodes processing = * initialNodes sets focusedNodes for each graphNav as all initialNodes shown in that graphNav (objTypes) * initialNodes setGraphNode(s) * setGraphNode triggers a useEffect that n...")
Frontend SitePage Element - GraphNavigation
- graphNavigation has Ref focusedNodes that stores array of focused nodes for each graphNav
- graphNavigation has Ref for all nodes sent relNode request to backend (so not double up requests)
initialNodes processing
- initialNodes sets focusedNodes for each graphNav as all initialNodes shown in that graphNav (objTypes)
- initialNodes setGraphNode(s)
- setGraphNode triggers a useEffect that newNodeAdded
newNodeAdded useEffect
- check ref if already sent request to backend?
for each GraphNav start
- check this node shown in that graphNav (objTypes)
- find shortest # hops to newNode from all focusedNodes
- if shortest hops is < graphNav hopLimit, need to request backend
for each GraphNav end
if any graphNav need to request backend
- check ref if already sent request to backend again, in case updated during processing (?)
- add to sent request ref
- send request
after get backend result
for each relNode
- setGraphRelationship
- setGraphNode (must do after setGraphRelationship)
- setGraphNode triggers a useEffect that newNodeAdded
for each GraphNav start
- check this node shown in graphNav (objTypes)
- check this relationship Type shown in graphNav
- find shortest # hops to newNode from all focusedNodes
- if shortest hops is < graphNav hopLimit, setGraphRelationshipPerGraphNav and setGraphNodePerGraphNav
for each GraphNav end for each relNode end