Skip to main content
Version: 8.1

Map Transform

Inductive University

Map Transform

Watch the video

The Map Transform allows you to set up a map of input values to output values. Inputs can be anything from specific values or strings, to numeric ranges of values. Each input value can then be mapped to an output value, which can be a string, integer, color, style, etc. A great example of this is mapping specific values to specific colors, so that you can easily bind visual properties to tag values.

The mapping table defaults to a value for both the input and output, but they can both be changed to one of several types. Select the Input Type and Output type for the mapping using the pull down arrows next to the Input/Output Type headers to make your selections.

Input Type​

Input Type is The value coming into the transform (from the binding or previous transform)

  • Value: Individual numeric values designed to exactly match the input value.
  • Numeric Range: A range of values that the incoming value will fall between. Use brackets [x,y] to indicate values that are to be inclusive, or parenthesis for values that are exclusive (x,y), and you can mix them as needed. You can also omit start or end values to indicate no end to the range. See the examples below for clarification.
  • Expression: Used in a similar manner to a Value Input Type. Use the Expression language to create a Value.

Output Type​

Output Type is the outgoing value from the transform.

  • Value: An alphanumeric value.
  • Color: A color.
  • Expression: A value result calculated by an expression.
  • Document: A manually created JSON document (You can also copy an existing or custom made property and paste it in).
  • Style: A formatting style (best for simple edits of formatting style). To map to a named Style, use the "Value" output type to call the name.
  • Style Class: A style class to use. Once selected, a dropdown list shows the available style classes.

Use the Add icon to add rows to the Map table. The Delete icon will delete the selected row. The up/down arrows will sort the order execution for the mapping. The first mapping (from top to bottom) that matches will be the mapping that is assigned.

You can then double-click to set values for each cell except the Fallback cell. The Fallback allows you to create a value to use in case non of your values, expressions, or ranges match to the input.

Examples​

Numeric Range to Integer Value​

  • Input Type: Numeric Range
  • Output Type: Value

You can see in the Binding Preview at the bottom that the original value of the property binding is zero. Since the Map Transform input value is 0, we get an output value of 99, the Fallback value. This is because the first mapping uses an exclusive 0 (with a parenthesis) so it is testing for strictly greater than 0, not "greater than or equal to."

Numeric Range to Number Mapping
(0,25]          0
(25,40] 1
[40,50] 2
Fallback 99

Numeric Range to String Mapping - Range Values Omitted
(,25]           "Below 25"
(25,) "Above 25"
Fallback "Invalid Value"

Integer to String​

This is linked to a status text display.

  • Input Type: Value
  • Output Type: Value

You can see in the Binding Preview at the bottom that the original value of the property binding is zero. Since the Map Transform input value is 0, we get an output value of "OFF".

Expression to Color​

This is linked to the background color property of a text field.

  • Input Type: Expression
  • Output Type: Color

This input is passed through several expressions before selecting the Fallback value of black (#000000). You can see in the Binding Preview at the bottom that the original value of the property binding is 15. For each expression past the first, a single bit of that integer is being tested. Since none of bits 0, 1, or 2 are true, we get the fallback. For more information on the getBit() function, see the appendix.

Numeric Range to Expression​

  • Input Type: Range
  • Output Type: Expression

This mapping maps different ranges of values to different parts of the current time. You can see in the Binding Preview at the bottom that the original value of the property binding is 11 so we get an output value that pulls the minute out of the current time. That was 51 at the time this screenshot was taken.