Strange link routing

I seem to be having a similar problem to scanjet2. I have tracked down the cause of the problem but am not sure how to fix it. I have a rectangle, used for selection, with a text block outside it (DM.2 in the image below) and the link is avoiding the text block. I wanted to set a maximum width for the text block, but binding to maxWidth doesn’t seem to work? So I am binding to width, but this means the text block is wider than it needs to be. Is there a different approach I should be using?

I also tried setting the avoidable property on the text block but that is not supported.

Yes, a wide fixed-width TextBlock there would explain the AvoidsNodes routing.

There is no maxWidth property – set or bind the maxSize property.

Doh! That’ll explain why maxWidth doesn’t work! I guess I’ve been assuming I’d get an error when binding a non-existent property like I do when setting the property directly

Thanks




Actually, you do get a warning in the console log:

Binding error: undefined target property: fil on Shape(RoundedRectangle)#1161


Ah OK, will look more closely at that in the future. maxSize has fixed most of my linking issues, I just have one more oddity to investigate

I’ve looked at this more closely. Look at the highlighted link below. I’ve set the background colour of some panels which don’t contain anything. If I make the panels invisible then the routing works sensibly so it looks like the panels are causing the issue. The panels contain a text block and three images. I’m making the text block invisible if it contains no text.

I could hide the panel if none of its contents are visible, but this could get much more complicated as we add more stuff (and really we’d only want the routing to avoid the contents not the panel itself). I could adjust the height of the panels (Although I’m not too sure why they have a height at all, I’m not setting the height of any of its contents). I guess I could get rid of the panels altogether and position the text block and images related to the main shape.

Any thoughts on which would work and which would be best?

So, to be clear, you don’t mind that the links go through the gray areas?

Well, the obvious answer is to allow enough room between the lanes so that there is enough space for the links to be routed without crossing over any nodes.

However, if you don’t want to do that, that’s OK – you could set the Node.avoidableMargin to use negative values for Margin.top and Margin.bottom.

OK thanks. Just to clarify, the grey areas are generally transparent so links passing through them is fine.

In the mean time I figured I could actually get rid of the panels altogether. I think I added them before I understood how alignment and alignmentFocus work, which I think I can use instead. The linking now looks good, I just have to tidy up some other things