Comments (8)
by default a message coming back from the UI has a msg.socketid
property attached. If that is then routed back to the UI then it will only go back to that socketid - if you delete that property it will go to all.
I'll update those comments to remove the < >
in that example node.
from node-red-ui-nodes.
Hi Dave, thank you for your quick reply.
When the user change the ui element a (new) message is sent via `$scope.send({state:color[$scope.config.outFormat]});´
It then pass `beforeSend´ on the backend:
beforeSend: function (msg, orig) {
if (orig) {
var newMsg = {};
// Store the switch state in the specified msg state field
RED.util.setMessageProperty(newMsg, config.stateField, orig.msg.state, true)
//orig.msg = newMsg;
var topic = RED.util.evaluateNodeProperty(config.topic,config.topicType || "str",node,msg) || node.topi;
if (topic) { newMsg.topic = topic; }
console.log('beforeSend:',newMsg);
return newMsg;
}
},
resulting in
beforeSend: { payload: { r: 129, g: 120, b: 255 }, topic: 'colorPicker' }
So no msg.socketid
at this point.
Sorry I still don't get it.
Chris
If you like to know what I'm working on: https://github.com/Christian-Me/node-red-contrib-ui-iro-color-picker
from node-red-ui-nodes.
yeah - but what arrives in a debug node set to show all ?
(And yes very nice - like it)
from node-red-ui-nodes.
As expected ... including the socketid
But how can I get the dashboard backend to update other clients automatically. (like when I place a slider without any connections and use it on one client other clients follow simultaneously).
If I send a new colour from the flow to the node (without a specific socketid) all clients are updated as expected.
I was searching for a colour picker which is usable in different ways and on mobile devices for a long time. iro.js popped up in the forum from time to time and to be honest I hoped that someone else (with more experience) could do the job. In the end I was procrastinating other jobs and thought it would be a nice small project to learn how to implement a custom ui-node. In reality I was searching for a slider which could set a (or two like upper and lower) value and display the actual value by the bargraph. I have dimmers for my indoor green house which fade (very) slowly to simulate the sun over dark winter days. A combined setpoint and real value is useful for other actuators like heaters and valves too. This would a project for another rainy weekend (or two) - iro.js can do something similar by using the multiple colour feature which I will try out too
from node-red-ui-nodes.
After some (hours) of debugging I found it ,,, I already noticed that flag several times but never tested it until I reached ui.js with the debugger ... ;)
storeFrontEndInputAsState: true,
Now I only have to solve that loopback issue as the emitting session now gets its own message back. I somehow have to figure out if a message received in $scope.$watch('msg', function(msg) {...}
originates from a different cession or the input of the node in the flow. If it is the own messages (in the meantime the slider may have already changed by the user) it should be dropped. (For me a cession should not get it's own message back from the backend - I already had that problem in ui-table and had not found a satisfying solution back then)
Should be solvable ...
from node-red-ui-nodes.
Think I fixed (most) of the tasks around my initial question. (I pushed the latest version to github)
I don't know if it is ok to ask it here but I ask it anyway ;)
Is it a good idea to stop sending new values until the last one is "confirmed" to avoid flooding the backend? In this case the loopback is actually quite useful. Currently the backend (debug window) builds up a long tail if you drag with the option "on user interaction"
Perhaps I have to add a timeout in case a message is lost
from node-red-ui-nodes.
the built in widgets use a timeout to rate limit the updates from things like the slider etc. But it always a tradeoff between sending too many and making any animation look smooth.
from node-red-ui-nodes.
Thank you for the information, I will try both ... The wait until confirmed might be too slow as a little queue in buffer should help in smooth animations The tail animation when the picker is released is funny but a little bit irritating (will try to avoid this with a on release flag to find out when it is ok to handle messages as real updates from somewhere else - somehow.
from node-red-ui-nodes.
Related Issues (20)
- node-red-node-ui-table dashboard rendering error other controls dont render HOT 14
- ui-list scroll HOT 1
- Dashboard - theme: chart and ui-table
- node-red-node-ui-table: sorting on row number doesn't work HOT 2
- ui_table node - Order property not set HOT 2
- node-red-node-ui-table column width incorrect at random HOT 5
- webcam: unable to switch camera via msg.camera
- node-red-node-ui-table DEPRECATION WANRING -
- Textarea formatter not supported with ui-table HOT 2
- ui-table v0.4.0 code missing in repo
- ui-table style of html links changed with v0.4.0 HOT 2
- ui-tables: alignment no longer working with v0.4.0 HOT 5
- ui-tables: flickering when updated with v0.4.0 HOT 6
- node-ui-table send data on click no longer works since update to 0.4.0
- ui-tables: alignment no longer working with v0.4.1 HOT 3
- ui-table style of html links changed with v0.4.1 HOT 2
- headerHozAlign not working HOT 6
- Tabulator getData() function from node-red-node-ui-table does not work
- Problem using two webcams with ui-webcam. HOT 1
- auto recognizer
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-red-ui-nodes.