Is there a way to make the ui_gauge clickable?

Not sure if it's possible...Thanks...

In what way? what do you want the click to do?

So when a user clicks on the gauge I get some event that I can execute some javascript code similar to the ui_button.

The gauge has no click event so no output. It may be possible to add one by targeting the css div via a template but I haven’t tried

OK, I understand.... It's not worth jumping through hoops for this functionality. I thought it could be something simple which is why I asked about it...

Thanks anyway...

Adding a button is the simple way

True, but it takes up vertical space, which is critical in my app. I think clicking on the Gauge itself is more intuitive...

Intuitive? How would anyone know to click on it ?

Funny you mentioned that.... So, this morning I was showing the dashboard to some potential users. When they saw the gauges, they said "if I click on the gauge would it drill down to the settings?"

Honestly, that never even crossed my mind until it was mentioned to me... Go figure... :crazy_face:

2 Likes

Not difficult to add a click event handler to anything. Since Dashboard includes JQuery in addition to Angular.

You can feed in a custom script using a Dashboard Template node.

https://api.jquery.com/click/

In Angular, you can use the ng-click attribute to add a handler so you don't even need JQuery, just depends what you are more comfortable with. JQuery is easiest to add programmatically I think - but then I'm not a fan of Angular.

https://docs.angularjs.org/tutorial/step_12

You could add the click event to the whole card or just to the gauge itself

Above, you can see an example of a gauge - you can see that you have a class you could attach to though remember that would add a click handler to all gauges in the Dashboard, you can tell which one it is within your code.

The space conservation was one of reasons why I did the node-red-contrib-ui-level (node) - Node-RED node. All features what is given by regular gauge can be fitted into one unit height. Try it out.

Ui-level does not provide click functionality but if you can free up some space, so you can then add buttons if you like.

2 Likes

I agree that there is obvious functionality for being able to click on a gauge , to be able to "drill down" into the underlying data. First level of which could be a time series graph of the data being fed to the gauge, followed by raw data points in said time series. This issue as well as being able to customise the look and feel of gauges is one of the limiting factors in the existing node-red ui dashboard.

More than happy to consider a pull request for some added functionality, provided it doesn’t break existing, and doesn’t add too many options that would confuse beginners.
Other gauge types can be provided by 3rd party widgets so feel free to create some.

1 Like

Well, from my original post, I thought it might be a "nice feature to have".
That said, I think I can get by without it for now.
However, I wouldn't mind having that functionality because I could think of some decent use-cases for it...

Thanks...