Skip to content

Commit

Permalink
inline if
Browse files Browse the repository at this point in the history
  • Loading branch information
aloccid-iata authored May 1, 2024
1 parent be336fa commit 8afa33e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
7 changes: 1 addition & 6 deletions src/Visualizer/helpers/calculateEdges.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,7 @@ export const calculateEdges = ({ nodes, currentDatabase }: CalculateEdgesOptions
const targetPosition = edgeConfig.targetPosition || calculateTargetPosition(sourceNode.width as number, sourceNode!.position.x, targetNode.width as number, targetNode!.position.x);

const sourceHandle = `${edgeConfig.sourceKey}-${sourcePosition}`;
const targetHandle = "";
if(edgeConfig.targetKey == ""){
targetHandle = `${edgeConfig!.target}-table-${targetPosition}`;
} else {
targetHandle = `${edgeConfig!.targetKey}-${targetPosition}`;
}
const targetHandle = edgeConfig.targetKey == ""? `${edgeConfig!.target}-table-${targetPosition}` :`${edgeConfig!.targetKey}-${targetPosition}`;

initialEdges.push({
id: `${edgeConfig.source}-${edgeConfig.target}`,
Expand Down
7 changes: 1 addition & 6 deletions src/Visualizer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -209,12 +209,7 @@ const Flow: React.FC<FlowProps> = (props: FlowProps) => {
const targetPosition = edgeConfig!.targetPosition || calculateTargetPosition((incomingNode.width as number), incomingNode.position.x, (node.width as number), nodeChange.positionAbsolute!.x);

const sourceHandle = `${edgeConfig!.sourceKey}-${sourcePosition}`;
const targetHandle = "";
if(edgeConfig.targetKey == ""){
targetHandle = `${edgeConfig!.target}-table-${targetPosition}`;
} else {
targetHandle = `${edgeConfig!.targetKey}-${targetPosition}`;
}
const targetHandle = edgeConfig.targetKey == ""? `${edgeConfig!.target}-table-${targetPosition}` :`${edgeConfig!.targetKey}-${targetPosition}`;

ed.sourceHandle = sourceHandle;
ed.targetHandle = targetHandle;
Expand Down

0 comments on commit 8afa33e

Please sign in to comment.