Skip to content

Commit

Permalink
fix(ui): Render DAG with exit node (#3408)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexec committed Jul 7, 2020
1 parent 3d50f98 commit 03cbb8c
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions ui/src/app/workflows/components/workflow-dag/workflow-dag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -321,21 +321,23 @@ export class WorkflowDag extends React.Component<WorkflowDagProps, WorkflowDagRe
// `h` and `v` move the arrow heads to next to the node, otherwise they would be behind it
const h = this.state.horizontal ? this.nodeSize / 2 : 0;
const v = !this.state.horizontal ? this.nodeSize / 2 : 0;
this.graph.edges = edges.map(e => ({
v: e.v,
w: e.w,
points: [
{
// for hidden nodes, we want to size them zero
x: this.graph.nodes.get(e.v).x + (this.hiddenNode(e.v) ? 0 : h),
y: this.graph.nodes.get(e.v).y + (this.hiddenNode(e.v) ? 0 : v)
},
{
x: this.graph.nodes.get(e.w).x - (this.hiddenNode(e.w) ? 0 : h),
y: this.graph.nodes.get(e.w).y - (this.hiddenNode(e.w) ? 0 : v)
}
]
}));
this.graph.edges = edges
.filter(e => this.graph.nodes.has(e.v) && this.graph.nodes.has(e.w))
.map(e => ({
v: e.v,
w: e.w,
points: [
{
// for hidden nodes, we want to size them zero
x: this.graph.nodes.get(e.v).x + (this.hiddenNode(e.v) ? 0 : h),
y: this.graph.nodes.get(e.v).y + (this.hiddenNode(e.v) ? 0 : v)
},
{
x: this.graph.nodes.get(e.w).x - (this.hiddenNode(e.w) ? 0 : h),
y: this.graph.nodes.get(e.w).y - (this.hiddenNode(e.w) ? 0 : v)
}
]
}));
}

private selectNode(nodeId: string) {
Expand Down

0 comments on commit 03cbb8c

Please sign in to comment.