msagljs icon indicating copy to clipboard operation
msagljs copied to clipboard

getFeedbackSetExternal not implemented in VerticalConstraintsForSugiyama

Open aocenas opened this issue 2 years ago • 3 comments

The docs are quite sparse so not sure if this is bug or just something that is not finished yet or maybe I am doing something wrong with the configuration.

When using VerticalConstraintsForSugiyama the layout code calls getFeedbackSetExternal on the constraints object: https://github.com/microsoft/msagljs/blob/0777c999aad222f0e4e9ea405c0e86aacd3528b9/modules/core/src/layout/layered/layeredLayout.ts#L158

As that call just throws https://github.com/microsoft/msagljs/blob/fe509231409e2cb21693ef1b9e05457761b29627/modules/core/src/layout/layered/verticalConstraintsForSugiyama.ts#L13 it seems like this is not usable at all. Not sure if this is not supposed to be used or there is something else going on here.

aocenas avatar Nov 29 '23 14:11 aocenas

Sorry, it seems you use VerticalConstraints. I have not ported the constraints for Sugiyama scheme at all yet. I do not have the time for it at the moment unfortunately. If more people demand the feature, I will implement it.

levnach avatar Nov 29 '23 16:11 levnach

Ah ok yeah that makes sense in that case :D. I am trying to use it for a better layout of a visualization in Grafana https://github.com/grafana/grafana/pull/78957 and I wanted to do some tweaking which now I have to do manually. So it would help us to have some more configuration. If I have some more time I could take a look at what it would entail to port the constraining config from the .Net library but that probably won't be soon.

aocenas avatar Dec 01 '23 15:12 aocenas

Maybe you can achieve the effect you want by using edge weights in Sugiyama scheme. Increasing the edge weight might make the edge shorter and even align the source and the target.

A note on porting: I believe GPT-4 would do a very good job converting chunks of C# to TypeScript:-)

levnach avatar Dec 01 '23 16:12 levnach