Closed SujayRhombuz closed 1 year ago
this was not a but, the edges are working as expected, i had to filter the nodes and consider only nodes which are of type "component" and not "group". this solved my issue but with more nodes on the screen the performance is bad anyhow im closing this issue as it is not a bug
Filtering nodes is the current workaround for groups, this issue was noted here: https://github.com/tisoap/react-flow-smart-edge/issues/32
Closing as duplicate
Describe the Bug
im facing an issue while using the custom edge example from the docs,
case 1
case 2
The connection of edges can be made within the sub-flow or in between another group or a node from outside of the group.
here is my custom edge component `import { useNodes, BezierEdge } from 'reactflow'; import { getSmartEdge, svgDrawStraightLinePath, pathfindingJumpPointNoDiagonal } from '@tisoap/react-flow-smart-edge'; import { AStarFinder, JumpPointFinder, Util, DiagonalMovement } from 'pathfinding'; export function SmartEdgeWithSubFlow(props: any) { const { id, sourcePosition, targetPosition, sourceX, sourceY, targetX, targetY, style, markerStart, markerEnd } = props;
} `
My findings and requirements: 1) A group is also considered a node(or obstacle) and so in case 2 you can see that the edge is going around the group border, I want to check a condition if target node is within the group don't consider the group to be a node and don't go around the group, but still consider other nodes within the group as obstacles. 2) If the edge is coming from or to another node or group outside the current group, similar to the condition above, consider all nodes to be obstacles but don't consider the group to be an obstacle
It would be great if you can help me out on this one
Minimal Example
https://github.com/tisoap/react-flow-smart-edge#custom-smart-edges
Steps to Reproduce the Bug or Issue
1) Use a reactflow boiler plate 2) using this component as your edgeType `import { useNodes, BezierEdge } from 'reactflow'; import { getSmartEdge, svgDrawStraightLinePath, pathfindingJumpPointNoDiagonal } from '@tisoap/react-flow-smart-edge'; import { AStarFinder, JumpPointFinder, Util, DiagonalMovement } from 'pathfinding'; export function SmartEdgeWithSubFlow(props: any) { const { id, sourcePosition, targetPosition, sourceX, sourceY, targetX, targetY, style, markerStart, markerEnd } = props;
} `
3) make connections between sub-flows and stand alone nodes, connections between nodes within the subflows like in the 2 images
Expected behavior
1) A group is also considered a node(or obstacle) and so in case 2 you can see that the edge is going around the group border, I want to check a condition if target node is within the group don't consider the group to be a node and don't go around the group, but still consider other nodes within the group as obstacles. 2) If the edge is coming from or to another node or group outside the current group, similar to the condition above, consider all nodes to be obstacles but don't consider the group to be an obstacle
Screenshots or Videos
No response
Platform
Additional context
No response