{"library":"node-red-contrib-ui-level","title":"Node-RED UI Level Indicator","description":"node-red-contrib-ui-level is a custom Node-RED node designed to provide a linear level indicator widget for the Node-RED Dashboard. It enables users to visually represent numerical data as a customizable bar graph. The current stable version provided is 0.1.46. This node is part of the Node-RED ecosystem, typically seeing updates driven by Node-RED and Node-RED Dashboard releases, and new feature additions. Key differentiators include its support for three layouts (Single Horizontal, Pair Horizontal, Single Vertical), extensive color customization options (multiple segments, single color, interpolated), an optional 'Peak mode' with adjustable hold times, and dynamic configuration of properties like min/max values, segments, and labels via `msg.control` inputs. It also offers multiple stripe resolutions and animation options, providing flexibility for various dashboard designs.","language":"javascript","status":"active","last_verified":"Wed Apr 22","install":{"commands":["npm install node-red-contrib-ui-level"],"cli":null},"imports":["Install 'node-red-contrib-ui-level' via Node-RED's 'Manage palette' feature (Menu -> Manage palette -> Install tab). Alternatively, run 'npm install node-red-contrib-ui-level' in your Node-RED user directory (~/.node-red)."],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"// Conceptual JavaScript to simulate messages for the UI Level node\n// In Node-RED, you would use an Inject node connected to a UI Level node.\n\nfunction simulateFlow() {\n  // Scenario 1: Basic value update\n  let msg1 = { payload: 42 };\n  console.log('Sending basic value:', msg1.payload);\n  // In Node-RED, this 'msg1' would go to the 'ui-level' node's input.\n\n  // Scenario 2: Change min/max and segment values dynamically\n  let msg2 = {\n    payload: 75,\n    control: { min: 0, max: 100, seg1: 25, seg2: 50, seg3: 75 }\n  };\n  console.log('Sending value with dynamic control:', msg2.payload, msg2.control);\n  // This 'msg2' updates the level, its range, and segment thresholds.\n\n  // Scenario 3: Update label dynamically\n  let msg3 = {\n    payload: 12.3,\n    control: { label: 'Pressure (PSI)' }\n  };\n  console.log('Sending value with dynamic label:', msg3.payload, msg3.control.label);\n\n  // Scenario 4: Reset peak mode (if enabled)\n  let msg4 = {\n    payload: 90,\n    control: { peakreset: true }\n  };\n  console.log('Sending value and resetting peak:', msg4.payload);\n}\n\nsimulateFlow();","lang":"javascript","description":"This conceptual code demonstrates how `msg.payload` and `msg.control` properties are structured and sent to a Node-RED UI Level node to update its display, dynamically adjust parameters, and control features like peak mode.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}