Update constrain.js

This commit is contained in:
Tyler Cooper 2025-08-19 11:48:49 -05:00 committed by GitHub
parent 55e3b09415
commit 957b2bf1e6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -4,7 +4,7 @@ export default {
bytecodeKey: "constrain", bytecodeKey: "constrain",
name: "Constrain", name: "Constrain",
colour: 120, colour: 120,
description: "Constrain a given number to fall within a given range.", description: "Keep any number within specified minimum and maximum boundaries. If the input value is below the minimum, it becomes the minimum. If above the maximum, it becomes the maximum. Perfect for ensuring values stay within expected ranges, creating percentage bounds, or limiting user input to acceptable values.",
connections: { connections: {
mode: "value", mode: "value",
output: "number", output: "number",
@ -15,12 +15,12 @@ export default {
`, `,
inputs: { inputs: {
VALUE: { VALUE: {
description: "The number to constrain within the specified range limits.", description: "The number to limit within your specified boundaries. Examples: user input values, calculation results, sensor readings, or any numerical data that might go outside your desired range.",
check: "expression", check: "expression",
shadow: "io_math_number" shadow: "io_math_number"
}, },
RANGE: { RANGE: {
description: "The minimum and maximum bounds to limit the value within (values outside this range will be clamped to the nearest boundary).", description: "The minimum and maximum limits for your value. Examples: (0,100) for percentages, (1,10) for rating scales, (-50,150) for temperature ranges, or any boundaries that make sense for your data. Values outside these limits get automatically adjusted to the nearest boundary.",
check: 'range', check: 'range',
shadow: { shadow: {
type: "math_range", type: "math_range",