Next: , Previous: , Up: SPV Legacy Detail Member XML Format   [Contents][Index]


D.4.4 The derivedVariable Element

Parent: visualization
Contents: extension* (format | stringFormat valueMapEntry*)

Like sourceVariable, this element defines a variable whose values can be used elsewhere in the visualization. Instead of being read from a data source, the variable’s data are defined by a mathematical expression.

This element has the following attributes.

Required: categorical

Always set to true.

Required: value

An expression that defines the variable’s value. In theory this could be an arbitrary expression in terms of constants, functions, and other variables, e.g. (var1 + var2) / 2. In practice, the corpus contains only the following forms of expressions:

constant(number)
constant(variable)

A constant. The meaning when a variable is named is unknown. Sometimes the “variable name” has spaces in it.

map(variable)

Transforms the values in the named variable using the valueMapEntrys contained within the element.

Optional: dependsOn

The variable-name of a variable linked to this one, so that a viewer can work with them together. For a group variable, this is the name of the corresponding categorical variable.