From a9f187697ad2d9c8340ae7d431e04bf0256a8804 Mon Sep 17 00:00:00 2001 From: Braks <78412429+bcakmakoglu@users.noreply.github.com> Date: Thu, 21 Oct 2021 15:11:10 +0200 Subject: [PATCH] update(examples): remove "hack" from layouting example --- examples/Layouting/LayoutingExample.vue | 4 +--- examples/Layouting/layouting.css | 4 ++++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/examples/Layouting/LayoutingExample.vue b/examples/Layouting/LayoutingExample.vue index f8dbe00a..88740d00 100644 --- a/examples/Layouting/LayoutingExample.vue +++ b/examples/Layouting/LayoutingExample.vue @@ -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 diff --git a/examples/Layouting/layouting.css b/examples/Layouting/layouting.css index 6d248b22..2e058546 100644 --- a/examples/Layouting/layouting.css +++ b/examples/Layouting/layouting.css @@ -9,3 +9,7 @@ top: 10px; z-index: 10; } + +.controls button { + margin-left: 10px; +}