[Announce] node-red-contrib-ui-svg (final beta) UPDATE V1.2.1

Was not much work. I have updated all the flows, to avoid users having the same problem...

Tooltip has been changed to guide the user toward the Settings tabsheet:

image

2 Likes

I've used ComfortClick bOS in the past and the thing I loved the most about it was how easy it was to visualize your data using either floor plans or technical layouts of your boiler room for instance. So I can not wait to give this svg plugin a try. However, I seem to be having some issues with it. I've successfully installed it using npm, ( npm install bartbutenaers/node-red-contrib-ui-svg) but now my node editor view comes up blank. It's complaining that it can not find the jschannel library.

main.js:1050 GET http://192.168.32.50:1880/ui_svg_graphics/lib/jschannel.js?_=1570166131278 404 (Not Found)

Any ideas on what I missed or botched up?

And of course, after posting I would identify the root cause... my httpAdminRoot path is non standard. As soon as I switch it back to default (/) it works perfectly.

Hi, could you explain a little further please? This is perhaps something we need to handle.

Morning @thucar, @Steve-Mcl,
Normally I always take into account the httpAdminRoot path when I create an http endpoint for my custom nodes. Really thought I had added it also for the SVG node, but seems I have forgotten. Will fix it today !!!

1 Like

It seems that node-red-contrib-ui-svg expects to find its libraries at a very specific path (noderedIP:port/ui_svg_graphics/lib/) which is fine until someone goes into nodered config file and changes their httpAdminRoot path. For isntance, my nodered editor is located at noderedip:port/editor
And in this case, the library path should be noderedIP:port/editor/ui_svg_graphics/lib/

So, since the httpAdminRoot is configurable, then it would be good if node-red-contrib-ui-svg could detect and use whatever path is defined in the configuration. To ensure compatibility.

@Steve-Mcl,
I have added following fix on Github

@thucar,
It still works for my test setup, but would be nice if you could test this as soon as possible. Because I never use the httpAdminRoot, and would be a pitty if my fix is incorrect and I mess up the flows of other test users ...
P.S. Your post that you have withdrawned contained a good explanation. If you can restore it somehow, I would do that so others can learn from it ...

Thank you for the quick fix @BartButenaers

I'll test it as soon as I can. I've also restored my post. I deleted it because I felt it was irrelevant after you identified the issue and solution.

I fell foul of similar issues uibuilder as well! Now I keep my dev PC with projects, httpAdminRoot and httpRoot set.

1 Like

In fairness, pretty sure that was my booboo haha. (Off to check gitblame) :joy:

1 Like

One of our company policies was "no shame, no blame, no name". But as soon as something went wrong, they said "wo caused that problem" :rofl:

1 Like

Great work!
By the way, in the current implementation, there is no order property defined in the first object argument of addWidget call.
The order property controls the UI widget placement and is a required parameter.
Please consider adding: order: config.order,

5 Likes

Hi Hiroyasu (@nisiyama),
Thanks!!
About the order property:

  • Seems I have never used that for my UI nodes (e.g. node-red-contrib-ui-heatmap) and none of the users have ever complaint about that. So I'm wondering now what it is being used for, if nobody notices it?
  • I see that other nodes (e.g. node-red-contrib-ui-led) don't use it. If it so important, wouldn't it be a good plan to create a quick pull request for all those nodes. There are very few UI nodes currently, and others will look at the code of those nodes to start creating new UI nodes ...
  • I see that all UI nodes in node-red-ui-nodes are already using the order, so that is already covered.

Bart

It is mandatory. I struggled with it in early days of ui-level couple of days before i found it was missing. It will be affect placement of widgets if ther is more than one to show.

1 Like

@BartButenaers i seen issues with random reordering of buttons and text items in relation to our SVG node during development. I forgot to query it but now thinking it's related?. Perhaps @nisiyama, @hotNipi or @dceejay can confirm this is the side effect of not having the order property?

Yes it is... needs to be there. happy patching weekend :slight_smile:

2 Likes

Have added it now to Github. Will trust everybody blindfolded :face_with_raised_eyebrow:

@Steve-Mcl: Ooh, now indeed I remember... Would never have linked that weird behaviour to the order property.

1 Like

Sorry for the delay. I was not able to test it until now. Good news is - it works exactly as expected! I could switch back to my preferred httpAdminRoot without any issues.

Thanks again for the quick patch!

2 Likes

Thank you!

@dceejay It might be better to add a feature to check existence of required parameters of addWidget.

1 Like