Allow wires to be rendered as straight lines and right angles

Pretty much every schematic software and visual code editor in the world uses straight lines and right angles to display wire connections. Node Red uses some nonstandard 3rd degree polynomial to render wires which makes it really hard to make flows look clean.

Please support rendering wires as straight lines and right angles for bends. It simply makes more sense.

I would disagree. I don't think the visual engine would allow this- how would you "rubber band" the connections between nodes without re-routing the connections?

I apologize i dont quite understand what you mean when you ask "how would you rubber band he connections between nodes"

I'm just asking for the wires to be rendered as straight lines so this situation doesnt happen so often where wires are hidden by blocks. Do you see how the 60m block has a wire exiting to the debug node that is covered up by the function block?

If the wires could be straight lines they'd turn upwards at a right angle quickly and then turn to the right to go into the same debug node

Well, I've used a lot of visual tools and actually they nearly all support BOTH styles. Actually, that is 3 styles: straight, angled and spline. But then, it is complex to support multiple styles. As soon as you go down that route, you also immediately have to handle far more wire data in order to support additional wire nodes and possibly rotating wire nodes (to support changes in spline routing). Someone needs to program it all and maintain it. I'm pretty sure it can all be done with the underlying library that Node-RED uses.

I'm sure that there would be interest in a contribution to Node-RED to enable other line routing patterns. Until then, many of us would probably agree that there are more pressing enhancements that are needed.

You can already do that using junctions of course. Not as seamless as a full wire routing capability but it gets the job done

And if you've ever used a diagramming tool, you will know that immediately brings other issues of routing. Those issues need the wire nodes I've already mentioned that let you move each horizontal and vertical line out of the way where needed.

Not saying it wouldn't be nice - it certainly would. But a lot of work with a lot of consequences not only for the visual programming but also the complexity of the stored flow data which would grow a lot.

Even so, I'd probably applaud a contribution to Node-RED to do it.

Actually junctions don't really help with nodes overlaying the wires.
here are a couple of simple ways to alleviate the problem though:
Leave slightly more horizontal space between nodes.
Don't align all nodes vertically.
In more complex cases, use link in-out nodes.

I imagine there must be a "curviness" parameter buried somewhere inside the editor, maybe it could be made accessible in settings.js?

1 Like

I was going to suggest what @jbudd said.
With the new version and that wire junction feature you could do what was shown.

it's still not right angles and makes a mess if you want to make flows that are spaced out a bunch... I just tried it and if if i didnt put at least a full two grid squares between blocks i the junction curls and makes a mess.

Alas: nothing is perfect.
I was only saying I was about to suggest what had already been suggested.

You may need to space out the groups a bit more then to allow for the curves in the wires.

The wire junction went a long way to tidying up the wires from how it was before.

Not sure I entirely agree :slight_smile:

Of course, for myself, I'd probably have a million other things to do than worry about a slight overlap as long as the logic is visually clear.

The curves are currently part of the "look and feel" of Node-RED, and are indeed somewhat hardcoded (inside view.js) . Indeed once upon a time we didn't have a snap-to-grid so it was all a lot more free form. Just because other tools do force things to 90 degrees doesn't necessarily make it right :-)... but yes I can see it does make sense for circuit diagrams where you can overlap wires in a bus - though they also sometimes have jumps and junctions to indicate whether they should connect or not.

Note, Node-RED wires do not have properties (they are just an array of endpoints on nodes) so saving things like how many pixels to go before turning 90 degrees etc (ie the geometry) would need serious thinking about, if it isn't going to break things.

There was also this recent thread about wires - [Feature Request]Do nodes or lines know if they are above/below each other?.

hi, thanks for the response.

While i certainly can respect the "look and feel" branding argument for the curvy wires, it feels a little detrimental to not at least give users the choice.

But yes, i can understand the development work involved. That said, there are many open source apps which can be referenced such as draw.io which does the logic for "when to turn" very well imo, i've used this tool for many different design docs i've written and it seems to always preform fairly well with the placement of wires and angles.

Anyway, like i said, i definitely can respect that it's a non-insignificant amount of work to implement, I just started using node red and was very turned off by the look and feel of the wiggly wires. Coming from an electronics engineer background - having spent many hours in altium/kicad and doing block diagrams with the above tool) it just didn't jive with my brain :stuck_out_tongue:

Think of that as a good thing. Every time we expose ourselves to something new it makes new connections in the brain, postponing the onset of age related decay.

4 Likes

… plus it stops you making assumptions about how things will work (like not having multiple inputs to nodes, etc)

We have seen these types of post more often from people that just installed NR.
Soon you will have other things to worry about :wink:

2 Likes

:rofl: true enough

1 Like

I must say I love the curvy line style.
I was used to the straight lines and angles of my PLC software, which has it's own overlap issues and it's own ways to make a mess.
Careful placement of nodes, and the use of junction and link nodes helps a lot.

5 Likes

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.