-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
71 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,68 +1,82 @@ | ||
{ | ||
"id": "clip", | ||
"summary": "Clips values between minimum and maximum values.", | ||
"description": "Clips an array of numbers between specified minimum and maximum values. All values larger than the maximal value will have the maximal value, all values lower than minimal value will have the minimal value.", | ||
"summary": "Clips a value between a minimum and a maximum value.", | ||
"description": "Clips a number between specified minimum and maximum values. A value larger than the maximal value will have the maximal value, a value lower than minimal value will have the minimal value.", | ||
"categories": [ | ||
"math" | ||
"math" | ||
], | ||
"parameter_order": [ | ||
"x", | ||
"min", | ||
"max" | ||
], | ||
"parameter_order": ["data", "min", "max"], | ||
"parameters": { | ||
"data": { | ||
"description": "An array of numbers.", | ||
"schema": { | ||
"type": "array", | ||
"items": { | ||
"type": [ | ||
"number", | ||
"null" | ||
] | ||
} | ||
}, | ||
"required": true | ||
"x": { | ||
"description": "A number.", | ||
"schema": { | ||
"type": [ | ||
"number", | ||
"null" | ||
] | ||
}, | ||
"min": { | ||
"description": "Minimum value. All values lower than this value will be set to the value of this parameter.", | ||
"schema": { | ||
"type": "number" | ||
}, | ||
"required": true | ||
"required": true | ||
}, | ||
"min": { | ||
"description": "Minimum value. If the value is lower than this value, the process will return the value of this parameter.", | ||
"schema": { | ||
"type": "number" | ||
}, | ||
"required": true | ||
}, | ||
"max": { | ||
"description": "Maximum value. If the value is greater than this value, the process will return the value of this parameter.", | ||
"schema": { | ||
"type": "number" | ||
}, | ||
"max": { | ||
"description": "Maximum value. All values greater than this value will be set to the value of this parameter.", | ||
"schema": { | ||
"type": "number" | ||
}, | ||
"required": true | ||
} | ||
"required": true | ||
} | ||
}, | ||
"returns": { | ||
"description": "An array with the values clipped to the specified range.", | ||
"schema": { | ||
"type": "array", | ||
"items": { | ||
"type": [ | ||
"number", | ||
"null" | ||
] | ||
} | ||
} | ||
"description": "The value clipped to the specified range.", | ||
"schema": { | ||
"type": [ | ||
"number", | ||
"null" | ||
] | ||
} | ||
}, | ||
"examples": [ | ||
{ | ||
"arguments": { | ||
"data": [-2,-1,0,1,2], | ||
"min": -1, | ||
"max": 1 | ||
}, | ||
"returns": [-1,-1,0,1,1] | ||
{ | ||
"arguments": { | ||
"x": -5, | ||
"min": -1, | ||
"max": 1 | ||
}, | ||
"returns": -1 | ||
}, | ||
{ | ||
"arguments": { | ||
"x": 10.001, | ||
"min": 1, | ||
"max": 10 | ||
}, | ||
"returns": 10 | ||
}, | ||
{ | ||
"arguments": { | ||
"x": 0.000001, | ||
"min": 0, | ||
"max": 0.02 | ||
}, | ||
"returns": 0.000001 | ||
}, | ||
{ | ||
"arguments": { | ||
"x": null, | ||
"min": 0, | ||
"max": 1 | ||
}, | ||
{ | ||
"arguments": { | ||
"data": [-0.1,-0.001,null,0,0.25,0.75,1.001,null], | ||
"min": 0, | ||
"max": 1 | ||
}, | ||
"returns": [0,0,null,0,0.25,0.75,1,null] | ||
} | ||
"returns": null | ||
} | ||
] | ||
} | ||
} |