1

This problem is driving me crazy

My requirement is simple, I want to put node x and y on the same vertical position. I've looked at this and this question, the answer seem to suggest manually setting the x position. However I don't really want to do that, is there a better way?

https://jsfiddle.net/laike9m/dg8Lzt7c/31/

The following graph is what I currently have:

enter image description here

Ideally, I want the left part unchanged, but y is placed on the same vertical position with x:

enter image description here

laike9m
  • 18,344
  • 20
  • 107
  • 140

1 Answers1

1

Join them with a transparent edge:

{
  "from": "x",
  "to": "y",
  "color": "rgba(0, 0, 0, 0)"
}
Wenfang Du
  • 8,804
  • 9
  • 59
  • 90
  • Thanks. I tried it, interestingly, if `hidden` is true, then the nodes are **not** aligned: https://jsfiddle.net/laike9m/dg8Lzt7c/47/, however if it's false, nodes are aligned: https://jsfiddle.net/laike9m/dg8Lzt7c/49/ – laike9m Aug 08 '20 at 23:36
  • My bad, I should've tested it. The edge can't be hidden but can be transparent. – Tomáš Vyčítal Aug 10 '20 at 05:46
  • Make sense. thanks. https://jsfiddle.net/laike9m/5gvh0ya4/2/ is a working example. – laike9m Aug 10 '20 at 19:32