update(examples): remove "hack" from layouting example
This commit is contained in:
@@ -36,9 +36,7 @@ const onLayout = (direction: string) => {
|
|||||||
const nodeWithPosition = dagreGraph.node(el.id)
|
const nodeWithPosition = dagreGraph.node(el.id)
|
||||||
el.targetPosition = isHorizontal ? Position.Left : Position.Top
|
el.targetPosition = isHorizontal ? Position.Left : Position.Top
|
||||||
el.sourcePosition = isHorizontal ? Position.Right : Position.Bottom
|
el.sourcePosition = isHorizontal ? Position.Right : Position.Bottom
|
||||||
// we need to pass a slighltiy different position in order to notify react flow about the change
|
el.position = { x: nodeWithPosition.x, y: nodeWithPosition.y }
|
||||||
// @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 }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return el
|
return el
|
||||||
|
|||||||
@@ -9,3 +9,7 @@
|
|||||||
top: 10px;
|
top: 10px;
|
||||||
z-index: 10;
|
z-index: 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.controls button {
|
||||||
|
margin-left: 10px;
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user