summaryrefslogtreecommitdiff
path: root/util/isLinkRelatedToNode.ts
blob: eeacab70e88897927f6681ea406f96daa468b0e2 (about) (plain)
1
2
3
4
5
6
7
import { NodeObject, LinkObject } from 'force-graph'

export const isLinkRelatedToNode = (link: LinkObject, node: NodeObject | null) => {
  return (
    (link.source as NodeObject)?.id! === node?.id! || (link.target as NodeObject)?.id! === node?.id!
  )
}