Standalone Flow Viewer Plugin

ok let us take a typical node definition from flows.json:

 {
        "id": "8bdcf0464a3270ca",
        "type": "change",
        "z": "543929cb2e9c4087",
        "g": "20b77a8b7c7caed7",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "origfilename",
                "pt": "msg",
                "to": "payload.origfilename",
                "tot": "msg"
            },
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "payload.origfilename",
                "tot": "msg"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 2242,
        "y": 485,
        "wires": [
            [
                "1924ae935c6999d9"
            ]
        ]
    },

I have the type and the name, so I have the text for the node (ok there might be more done in the label function but at https://flows.nodered.org/ the node names aren't always correct either), I've got a coordinate where the rectangle needs to go - x and y.

I've got the z so that I can group nodes into flows so that I can faithfully render a flow with its nodes.

I have the wires so I can draw the connections between nodes. So I can draw a flow with all its nodes and its connections between nodes.

What I don't have are the colours - true, but is that for a start that important? I understand that the purist would never attempt to do this because it will never be 100% as it is in the editor but that's not what I care about. What I care about is having, instead of a long line of json, an image of the flow, so that at least I can get an approximate idea what the flow does. I can't do that with a json.

A json, for me, is nothing or perhaps at the most, a waste of my time! So anything that gives me a bit of semantic info on what the json is trying to tell me is better than json!

Hence my enthusiasm for doing something here: json is wasting my time: mark json, copy, open node-red instance, go to import flow, paste and view flow. That's the process with a long line of json. If that long line of json were to be rendered in the browser, then I won't have to be doing that.

Of course, probably 80% of the time - to find the issue - one would still have to paste the flow into a running Node-Red instance but there is the 20% when I don't have to copy the json. 20% more time to philosophise about life, the universe and everything.

And of course there will be edge cases but since when has that stopped anyone from itching their scratch?

1 Like