Skip to content

Problems with floating edges #966

Answered by bcakmakoglu
activey asked this question in Q&A
Discussion options

You must be logged in to vote

Alright, so the problem is somewhat related to nested nodes.
With nested nodes, we have to rely on computedPosition instead of just position.
So you will have to update the utils to use that property instead of the position prop.

// this helper function returns the intersection point
// of the line between the center of the intersectionNode and the target node
function getNodeIntersection(intersectionNode: GraphNode, targetNode: GraphNode): XYPosition {
  // https://math.stackexchange.com/questions/1724792/an-algorithm-for-finding-the-intersection-point-between-a-center-of-vision-and-a

// use computedPosition instead of position here
  const {
    dimensions: { width: intersectionNodeWidth,

Replies: 3 comments 9 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@bcakmakoglu
Comment options

Comment options

You must be logged in to vote
8 replies
@bcakmakoglu
Comment options

@activey
Comment options

@activey
Comment options

@bcakmakoglu
Comment options

Answer selected by bcakmakoglu
@activey
Comment options

@activey
Comment options

@activey
Comment options

@bcakmakoglu
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants