mirror of
https://github.com/noodlapp/noodl-docs.git
synced 2026-01-11 14:52:54 +01:00
Initial commit
Co-Authored-By: kotte <14197736+mrtamagotchi@users.noreply.github.com> Co-Authored-By: mikaeltellhed <2311083+mikaeltellhed@users.noreply.github.com> Co-Authored-By: Tore Knudsen <18231882+torekndsn@users.noreply.github.com> Co-Authored-By: Michael Cartner <32543275+michaelcartner@users.noreply.github.com>
This commit is contained in:
52
nodes/math/counter.md
Normal file
52
nodes/math/counter.md
Normal file
@@ -0,0 +1,52 @@
|
||||
---
|
||||
hide_title: true
|
||||
hide_table_of_contents: true
|
||||
title: Counter
|
||||
---
|
||||
|
||||
<##head##>
|
||||
|
||||
# Counter
|
||||
|
||||
This node holds a <span className="ndl-data">number</span> that can be increased or decreased with <span className="ndl-signal">signals</span>.
|
||||
|
||||
<div className="ndl-image-with-background l">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
The Counter node can be limited to a `min` and a `max` value, and the limit can be turned on and off.
|
||||
|
||||
<##head##>
|
||||
|
||||
<div className="ndl-image-with-background l">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
## Inputs
|
||||
|
||||
| Signal | Description |
|
||||
| -------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-signal">Increase Count</span> | <##input:increase##>Triggering this action will increases the count by one.<##input##> |
|
||||
| <span className="ndl-signal">Decrease Count</span> | <##input:decrease##>Triggering this action will decrease the count by one.<##input##> |
|
||||
| <span className="ndl-signal">Reset To Start</span> | <##input:reset##>Triggering this action will reset the counter to its _Start Value_.<##input##> |
|
||||
| <span className="ndl-signal">Start Value</span> | <##input:startValue##>The start value of the count. Defaults to zero.<##input##> |
|
||||
|
||||
| Data | Description |
|
||||
| ------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-data">Min Value</span> | <##input:limitsMin##>The minimum value of the counter. The counter will never decrease below this value. Note that **Limits Enabled** need to be set to `true` for this to be in effect.<##input##> |
|
||||
| <span className="ndl-data">Max Value</span> | <##input:limitsMax##>The maximum value of the counter. The counter will never increase above this value. Note that **Limits Enabled** need to be set to `true` for this to be in effect.<##input##> |
|
||||
| <span className="ndl-data">Limits Enabled</span> | <##input:limitsEnabled##>This input controls if the limits (**Min Value** and **Max Value**) are active or disabled.<##input##> |
|
||||
|
||||
## Outputs
|
||||
|
||||
| Data | Description |
|
||||
| ----------------------------------------------- | ---------------------------------------------------------------------------- |
|
||||
| <span className="ndl-data">Current Count</span> | <##output:currentCount##>This output contains the current count.<##output##> |
|
||||
|
||||
| Signal | Description |
|
||||
| ------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-signal">Count Changed</span> | <##output:countChanged##>This signal will be triggered whenever the **Current Count** changes.<##output##> |
|
||||
79
nodes/math/expression.md
Normal file
79
nodes/math/expression.md
Normal file
@@ -0,0 +1,79 @@
|
||||
---
|
||||
hide_title: true
|
||||
hide_table_of_contents: true
|
||||
title: Expression
|
||||
---
|
||||
|
||||
<##head##>
|
||||
|
||||
# Expression
|
||||
|
||||
This node enables you to do your own calculations using simple expressons. Inputs are automatically derived from the expression. An expression set to `a + someName + 1` will get two inputs: one for <span className="ndl-data">a</span> and one for <span className="ndl-data">someName</span>.
|
||||
|
||||
<div className="ndl-image-with-background xl">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
The <span className="ndl-node">Expression</span> node runs JavaScript under the hood and supports a range of mathematical expressions.
|
||||
|
||||
<##head##>
|
||||
|
||||
## Built in math functions
|
||||
|
||||
Expressions support the following funcitons:
|
||||
|
||||
- `min(a,b)` - Minimum of two values
|
||||
- `max(a,b)` - Maximum of two values
|
||||
- `cos(angle)` - The cosine of an angle in radians
|
||||
- `sin(angle)` - The sine of an angle in radians
|
||||
- `tan(angle)` - The tangent of an angle in radians
|
||||
- `sqrt(a)` - Square root of a number
|
||||
- `pi` - PI in radians
|
||||
- `round(a)` - Rounds a number to the closest integer
|
||||
- `floor(a)` - Removes the fractional part of a number
|
||||
- `ceil(a)` - Rounds a value up to the closest higher integer. E.g. `round(1.1)` equals `2`.
|
||||
- `abs(a)` - The absolute value of a number. Negative values will become positive.
|
||||
- `random()` - A random number from 0 to 1
|
||||
|
||||
## Advanced
|
||||
|
||||
The _Expression_ node is running JavaScript under the hood so in addition to the above functions any standard
|
||||
JavaScript functions will also be valid. The _Expression_ node will add a `return` statement before the
|
||||
expression is executed. `1+2` will be evaluated as `return (1+2)`
|
||||
|
||||
## Truthy and Falsy signals
|
||||
|
||||
You can use the signal outputs <span className="ndl-signal">On True</span> and <span className="ndl-signal">On False</span> to trigger actions based on the result of an expression, if the result is considered "truthy" or "falsy" in Javascript.
|
||||
|
||||
Normally, an expression node recalculates whenever one of the input parameters change. However, if you connect a signal to the <span className="ndl-signal">Run</span> signal input you can control when the expression is calculated. It will only calculate and update it's outputs when a signal is received.
|
||||
|
||||
<div className="ndl-image-with-background xl">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
## Inputs
|
||||
|
||||
| Data | Description |
|
||||
| -------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| <span className="ndl-data">Expression</span> | The expression to be calculated. |
|
||||
| <span className="ndl-data">Run</span> | Normally the expression is recalucated every time one of the input parameters change. But if you want to control when the expression is calculated you can connect a signal to this input, then the expression will **only** be calculated when a signal is received. |
|
||||
|
||||
|
||||
### Parameters
|
||||
Inputs are automatically derived from the expression. An expression set to `a + someName + 1` will get two inputs, one for `a` and one for `someName`.<br/><br/>As soon as any of the input values changes, the expression is reevaluated.
|
||||
|
||||
## Outputs
|
||||
|
||||
| Data | Description |
|
||||
| ---------------------------------------- | --------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-data">Result</span> | <##output:result##>This output contains the result when evaluating the expression<##output##> |
|
||||
| <span className="ndl-data">Is true</span> | <##output:isTrue##>This output will be true if the result of the expression is "truthy", that is considered true in Javascript.<##output##> |
|
||||
| <span className="ndl-data">Is false</span> | <##output:isFalse##>This output will be true if the result of the expression is "falsy", that is considered false in Javascript.<##output##> |
|
||||
| <span className="ndl-signal">On True</span> | <##output:isTrueEv##>A signal will be sent on this output when the expression is calculated and the result is "truthy".<##output##> |
|
||||
| <span className="ndl-signal">On False</span> | <##output:isFalseEv##>A signal will be sent on this output when the expression is calculated and the result is "falsy".<##output##> |
|
||||
|
||||
|
||||
38
nodes/math/number-remapper.md
Normal file
38
nodes/math/number-remapper.md
Normal file
@@ -0,0 +1,38 @@
|
||||
---
|
||||
hide_title: true
|
||||
hide_table_of_contents: true
|
||||
title: Number Remapper
|
||||
---
|
||||
|
||||
<##head##>
|
||||
|
||||
# Number Remapper
|
||||
|
||||
This node maps a range of input <span className="ndl-data">numbers</span> to a range of output <span className="ndl-data">numbers</span>. It translates the relative position of the input <span className="ndl-data">number</span> to its corresponding <span className="ndl-data">number</span> in the output range.
|
||||
|
||||
<div className="ndl-image-with-background l">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
If the input range is `0 to 360`, the output range is `0 to 1` and the input <span className="ndl-data">number</span> is `180` the output <span className="ndl-data">number</span> will be `0.5`.
|
||||
|
||||
<##head##>
|
||||
|
||||
## Inputs
|
||||
|
||||
| Data | Description |
|
||||
| ------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| <span className="ndl-data">Input Value</span> | The number to remap. |
|
||||
| <span className="ndl-data">Input Minimum</span> | When the _Input Value_ equals this value the output of this node will exactly equal the value specified in _Output Minimum_. |
|
||||
| <span className="ndl-data">Input Maximum</span> | When the _Input Value_ equals this value the output of this node will exactly equal the value specified in _Output Maximum_. |
|
||||
| <span className="ndl-data">Output Minimum</span> | The lowest value to output. |
|
||||
| <span className="ndl-data">Output Maximum</span> | The highest value to output. |
|
||||
| <span className="ndl-data">Clamp Output</span> | Controls the behavior if the _Input Value_ is lower than _Input Minimum_ or higher than _Input Maximum_.<br/><br/>If _Clamp Output_ is set to _Yes_ then the output will not be lower than _Output Minimum_ or higher than _Output Maximum_. If _Clamp Output_ is set to _No_ then the output will be linearly extrapolated and will be lower or higher than the specified minimum and maximum values. |
|
||||
|
||||
## Outputs
|
||||
|
||||
| Data | Description |
|
||||
| ------------------------------------------------ | -------------------------------------------------------------------------- |
|
||||
| <span className="ndl-data">Remapped Value</span> | The result of remapping the _Input Value_ with the values specified above. |
|
||||
Reference in New Issue
Block a user