Skip to content

Commit

Permalink
update(examples): remove "hack" from layouting example
Browse files Browse the repository at this point in the history
  • Loading branch information
bcakmakoglu committed Oct 21, 2021
1 parent e11fddf commit a9f1876
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 1 addition & 3 deletions examples/Layouting/LayoutingExample.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ const onLayout = (direction: string) => {
const nodeWithPosition = dagreGraph.node(el.id)
el.targetPosition = isHorizontal ? Position.Left : Position.Top
el.sourcePosition = isHorizontal ? Position.Right : Position.Bottom
// we need to pass a slighltiy different position in order to notify react flow about the change
// @TODO how can we change the position handling so that we dont need this hack?
el.position = { x: nodeWithPosition.x + Math.random() / 1000, y: nodeWithPosition.y }
el.position = { x: nodeWithPosition.x, y: nodeWithPosition.y }
}
return el
Expand Down
4 changes: 4 additions & 0 deletions examples/Layouting/layouting.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@
top: 10px;
z-index: 10;
}

.controls button {
margin-left: 10px;
}

0 comments on commit a9f1876

Please sign in to comment.