skieffer / hola

Human-like Orthogonal Layout Algorithm
46 stars 10 forks source link

Option for spacing link origins #10

Closed dominicfollett closed 5 years ago

dominicfollett commented 5 years ago

@skieffer Is there an option that allows you to space the originating/terminating position for a link?

E.g.

screenshot 2018-11-26 at 10 55 31

For node 10, I'd like those links to be spaced further apart across more of the box's real estate.

I'm using your fork of Adaptagrams C++ library.

skieffer commented 5 years ago

For the final routing, HOLA uses a Router, from libavoid. This has a parameter called idealNudgingDistance that would control the spacing you want. At present there's no way to set that parameter in the Router that HOLA uses, so you'd have to hack it. Look somewhere around line 410 in hola.cpp. I think the default value is 4 (pixels), so try setting something a bit larger. Might look something like this:

ra.router.setRoutingParameter(Avoid::idealNudgingDistance, 8);
dominicfollett commented 5 years ago

Gotcha, thanks! Maybe I can submit a PR once your fork is merged.