2018-11-30 13:50:49 +01:00
|
|
|
<!--
|
|
|
|
Copyright JS Foundation and other contributors, http://js.foundation
|
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
|
|
|
-->
|
|
|
|
|
2020-01-15 03:40:48 +01:00
|
|
|
<script type="text/html" data-help-name="range">
|
2018-11-30 13:50:49 +01:00
|
|
|
<p>Maps a numeric value to a different range.</p>
|
|
|
|
<h3>Inputs</h3>
|
|
|
|
<dl class="message-properties">
|
|
|
|
<dt>payload <span class="property-type">number</span></dt>
|
|
|
|
<dd>The payload <i>must</i> be a number. Anything else will try to be
|
|
|
|
parsed into a number and rejected if that fails.</dd>
|
|
|
|
</dl>
|
|
|
|
<h3>Outputs</h3>
|
|
|
|
<dl class="message-properties">
|
|
|
|
<dt>payload <span class="property-type">number</span></dt>
|
|
|
|
<dd>The value mapped to the new range.</dd>
|
|
|
|
</dl>
|
|
|
|
<h3>Details</h3>
|
|
|
|
<p>This node will linearly scale the received value. By default, the result
|
2019-10-01 21:57:20 +02:00
|
|
|
is not constrained to the range defined in the node.</p>
|
2018-11-30 13:50:49 +01:00
|
|
|
<p><i>Scale and limit to target range</i> means that the result will never be outside
|
2019-10-01 21:57:20 +02:00
|
|
|
the range specified within the target range.</p>
|
2018-11-30 13:50:49 +01:00
|
|
|
<p><i>Scale and wrap within the target range</i> means that the result will
|
2019-10-01 21:57:20 +02:00
|
|
|
be wrapped within the target range.</p>
|
|
|
|
<p>For example an input 0 - 10 mapped to 0 - 100.</p>
|
|
|
|
<table style="outline-width:#888 solid thin">
|
|
|
|
<tr><th width="80px">mode</th><th width="80px">input</th><th width="80px">output</th></tr>
|
|
|
|
<tr><td><center>scale</center></td><td><center>12</center></td><td><center>120</center></td></tr>
|
|
|
|
<tr><td><center>limit</center></td><td><center>12</center></td><td><center>100</center></td></tr>
|
|
|
|
<tr><td><center>wrap</center></td><td><center>12</center></td><td><center>20</center></td></tr>
|
|
|
|
</table>
|
2018-11-30 13:50:49 +01:00
|
|
|
</script>
|