Labels for wires

Node-red is gradually acquiring more ways to include documentation in a flow, and to read it.

You can add a tooltip to function node (only?) outputs.

Tooltips are automatic for switch nodes

Groups allow a description
image

Is it desirable to allow a wire to have a description, to be visible when the wire is clicked?

This proposal has been discussed before, eg https://discourse.nodered.org/t/add-labels-to-wires-in-editor/50133

I know that a wire has no entry in flows.json, it only exists in the definition of the originating node as the id of the node it links to.
However, there is some devilry afoot which allows you to click on a wire and select it.

Wires are not straight - can we create a curved line of text along the wire by CSS?

Position of the displayed text - the centre of the wire? Adjacent to the node it links to ("right justified")?

If a comment is longer than it's wire, don't overflow.

Definition:

   ...
        "outputs": 2,
        "x": 590,
        "y": 180,
        "wires": [
            [
                "fcce9fc403afc77b"
            ],
            [
                "dd35dd2bbd582f93"
            ]
        ],
        "wire comments": [
            {"id": "fcce9fc403afc77b", "comment": "Steam traction"},
            {"id": "dd35dd2bbd582f93", "comment": "Electric traction"}
         ],
    ]
},

Nope. Any node. And for inputs as well of course.

Ha! Node-RED continues to surprise - I never even realised that! I usually name my outputs.

Well, it is theoretically possible. Not sure how practically easy it is though:

Also, not convinced that it would be worth it and would make the text harder to read certainly.

My personal preference would be options to add text to both the start and end of the wire separately. Maybe the middle as well. Sizing would be an issue for the flow author to deal with, some things are not worth automating.