Alignment when snapping to grid

Sorry - brain overload :frowning:

I was swapping around so much between here and my editor and the settings menu and what constitues "align" that I'd forgotten who was on first! :slight_smile:

Looks nice to me
image

1 Like

Ahh - so this is with a non-default grid size to begin with. So yes, it width snapping is hardcoded to units of 20 (the default grid size). I remember now I didn't want to just use the grid size because if someone sets the grid to something big, like 100, then their nodes would get huge.

FTAOD

I'm talking about how NR behaves with default settings - Dave is the one who suggested changing grid size

I'm talking about how NR behaves with default settings - Dave is the one who suggested changing grid size

Maybe originally - and we established that was due to the compact nodes being square and not aligning to the grid on both edges.

But your reply from an hour ago, shows the regular nodes don't adjust their width to align both edges for non-default grid width. Alignment when snapping to grid - #35 by cymplecy

indeed - fixing that - but maybe limiting to gridSizes up to 50 ? - would then improve matters. (even if we decline to change the default)

2 Likes

Raised PR - set node width dependent on gridsize by dceejay · Pull Request #3256 · node-red/node-red · GitHub to try to improve matters.

2 Likes

@dceejay blame you for pointing me down this path :laughing:
image

image

5 Likes

Dare you to change that to your Christmas cards for this year Dave! :smiling_imp:

2 Likes

I think we've got a brand new game! :rofl:

Hate to admit it -- but this has always bugged me, too!

The reason that the input-side wire is longer than the output-side wire (in original example #1), is simply because the square link nodes are always aligned to the grid on the left edge of the link node. If this was mentioned somewhere in this looong thread, my apologies for missing it!

In my opinion, the link in node (and every square node that ONLY has an output port) should be right-aligned with the grid. In other words, make sure that ports with connected wires always align with the grid -- the only exception would be square nodes that have both input and output ports, since the square representation cannot have both edges fall on a default (20 px) grid line.

At least Simon and I would be happy... can this behavior be added to the new PR, please? :pray:

Fascinating -- now if only the icons were little beers... :beer:

I'm sure you're still wading through the 50+ replies in this thread, but I do suggest something similar somewhere in amongst the rest.

1 Like

Ah, thanks Nick - not sure how I missed that the first time... I guess what I'm asking is if the right-edge alignment be the default for nodes without any input ports? So dragging/dropping will just "do the right thing", so to speak.

BTW, @cymplecy -- if you really cannot wait for this "enhancement", you can always select the link in nodes and use ctrl-right-arrow 10 times to bump them into "proper" alignment :upside_down_face:

These are real variations I'm currently playing with

image

I think the bottom one with nodes touching is "legitimate" in the circumstances of a simple linear flow but I think I'll only use it when space is REALLY tight

One of advantages of this approach is that the individual node labels can be very descriptive, without taking up screen space

So you don't lose inline documentation when you back to it in 12 months time :slight_smile:

image

1 Like

Could always use a subflow, if minimalist is your goal... :wink:

alexa

1 Like

Just remember Nick's warning. Forget a wire in that and you will be cursing yourself for a week before you realise what you did.

2 Likes

Good point
But I'm only doing this when I've finished fifing and faffing around and tidying up :slight_smile:

But I'll try and not do it as it will bite me one day and then there will be a lot of "We told you so" :slight_smile:

image

... you can be sure of that :wink:

4 Likes