MCPcopy Create free account
hub / github.com/WardAnalytics/WardGraph / setNodeHighlight

Function setNodeHighlight

src/components/graph/Graph.tsx:768–784  ·  view source on GitHub ↗

Sets the highlight of a node to either true or false. * * @param address The address of the node to highlight * @param highlight Whether to highlight the node or not

(address: string, highlight: boolean)

Source from the content-addressed store, hash-verified

766 */
767
768 function setNodeHighlight(address: string, highlight: boolean) {
769 const node = nodesRecord[address];
770 if (node) {
771 const newNode: Node = {
772 ...node,
773 data: {
774 ...node.data,
775 highlight: highlight,
776 },
777 };
778 setNodes((nodes) => {
779 const newNodes = nodes.filter((node) => node.id !== address);
780 newNodes.push(newNode);
781 return newNodes;
782 });
783 }
784 }
785
786 // Adding New Address -------------------------------------------------------
787

Callers 1

AddressNodeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected