kieler / klayjs

(deprecated) KIELER's layout algorithms for JavaScript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Edge routing with fixed nodes

mgax opened this issue · comments

Is it possible to keep the node positions from an input graph, and only perform edge routing?

Strictly speaking, no. The underlying algorithm is just not designed to support this.

There is, however, the option to keep the nodes vaguely in their positions. If you want to give it a try, specify x and y coordinates for the nodes and set the following options.

cycleBreaking: "INTERACTIVE",
crossMin: "INTERACTIVE",
nodeLayering: "INTERACTIVE",
nodePlace: "INTERACTIVE"
[...]
{ 
  id: "n1",
  x: 40,
  y: 40,
  width: 20,
  height: 20
}
[...]

You can find more information on the options here: KLay Layered Options

If this is not sufficient for you, something like Libavoid might be of interest to you. There's a javascript port avoid.js.

At first glance, that results in some weird routing decisions, but I'll look into avoid.js, thanks for pointing it out.

Would you be able to share (maybe privately) your results? I could tell you if it's an issue with the configuration or whether it's expected behavior.

Sure, I'll create a minimal example tomorrow.

Thanks. Actually, this is kind of expected behavior for this configuration (not that we say it's a good layout result!) :).
You can improve it a bit by using nodePlace: 'BRANDES_KOEPF', however, this will alter node positions a little more.

Anyway, thanks for the example. We believe we might be able to improve on this sometime in the future (rather long-term though).

Ok, thanks for taking the time to look into this :)