Closed zmitry closed 5 years ago
The closest thing to what you want, that's mostly supported out of the box is here. There are a few things that this doesn't capture from your picture that I'll highlight below along with how to solve them.
I'm happy to work on these, because this is a pretty layout and seems like a nice variant of a topological layout that should be supported, but it may take me a while as I have a number of other more pressing things on my plate. However, pull requests are very welcome, and note that the decross
and coord
methods just take arbitrary functions, so if you implement them, you can just pass them in without having to wait for an accepted PR.
Thanks for your answer. I tried a lot to implement something like that with your library, I even read about sugiyama algorithm and how all this placement kitchen works. But I realised that with my constraints, node order are fixed, arrows are only one directions, arrows should be either on the right. So I end up with my custom algorithm for drawing and edges placement. pls take a look:) I thought it should be more optimal than implementing decross algorithm using LP. Algo is pretty straightforward. Just balance number of edges at the right and left side and then set correct padding to them,
I'm glad this worked out. I'm going to keep this open as a reminder to implement a layout like this. Alternatively if you want to submit a pr with the code. This is a library for dag layouts, so even layouts that don't fit the sugiyama paradigm make sense.
@zhDmitry This now exists in d3-dag. See: https://beta.observablehq.com/@erikbrinkman/d3-dag-topological
Hi, nice progress on that. btw you can compare my implementation with your https://codesandbox.io/s/lr0kwnnwy7. I bet results will be pretty similar.
I will try to compare my results, but with my implementation I found some settings pretty useful. 1) allow to set specific side for node 2) set maximum lvl of padding check it out maxPad property
it was useful for my internal needs
btw, could you recommend something to get familiar with sugiyama algorithm ? I read several articles about it but with no success.
This is what I used to write the library: http://www.it.usyd.edu.au/~shhong/fab.pdf
The general method is pretty simple: