I have this pedantic streak that likes straight lines especially when creating flows.
Question: how do I align (other than doing it manually) the two nodes so that the wire is straight:
Align top, middle and bottom are shown but because they use the edges of the nodes, the wire is never straight. Perhaps an align-to-straight-line would be a nice feature for the artisans amongst us!
If your grid size is not a multiple/divisor of the vertical port spacing, then getting them aligned will mean one of the nodes having to be ‘off grid’.
Thanks for the suggestion and it does sound like a solution ... however .... that for me is a manual solution - I don't use snap to grid, so I would have activate and deactivate just for alignment.
I had a quick look at the implementation and realised that there isn't a "easy" way to align on ports instead of node edges. Then the thought struck me: what it's the third point from the top on the switch node (for example)? I.e., the location of the ports in the order is total important - since I was thinking of aligning ports not node edges.
Besides aligning on ports would require knowing how a port movements affect the position of the node.
5 is the smallest snap size I use/like in/on my grids. 10 at a pinch if it isn't very populated.
Normally when putting nodes beside one another the in/out points align.
So, if the node height is.... something weird like 13..... If you have multiple outputs and the output points are (say) 5 apart, this way madness lies.
Because if the offset from the bottom of the node and the point is not 5 it is going to be hard/difficult to have extra outputs to align with the overwhelming grid.
Alas for an overall solution the vertical size of nodes with more than one output would have to be made higher so the outputs would alight with the 5x5 grid.
MAYBE if the greater grid size was set to 6 it may be better as 6 is a bit more factorisable.
(3 and 2)
I'm really not sure where I was going with my post.
Odd/Even output numbered nodes would be ..... problematic to handle.
Unless the distance from the top/bottom of the node and the output node was a bit dynamic and could be changed depending if the number of outputs was odd or even.
Then the outputs could be adjusted up/down to lock onto the greater grid's lines.
So @dceejay are you selling fuzzy wuzzy snake oil with your 12.5 pixels - I'm definitely not going down that road - it'll only end with me and a magnifying glass counting fuzzy pixels on laptop screen.
I suffer with this too.
But I once realized that straightening the wire automatically would only really work when there is an odd number of ports and only for the wire connected to the middle port. In your example, try to place 4 nodes, one for each of the output ports, and manually straight the 4 wires and you will see there is an overlap between nodes. To let us straight all wires, no matter the number of ports, it would be necessary to dynamically increase the space between ports. All ports would have to have a margin equal to the height of a node with a single port + an additional space between inner ports to avoid having the wired nodes too close to each other
So does the work-around with additional ports and 25px grid spacing.
(picture redacted for @gregorius' placidity). View edit history at your discretion!
Oh f2k'g OMG - don't do that, I'm going to have nightmares now. My autistic self is wondering whether the lines in the second example are straight or not ... the top three. I hate these optical illusions in Node-RED - drives me batty.
Thank you - It might just have been a little over emphasised on my part - don't worry, I won't be having nightmares because of that image - especially since I'm doing my own alignment here.
I'm quite amazed that they were parallel, they really seemed off for me ... weird.