trifacta/vega — pull request #162 by rluta (2013-12-10 15:08:31+00:00)
Title: Allow range values in ordinal scales to be derived from a data field

This patch allow the use of a DataRef in the range definition of an ordinal scale. In this scenario, the scale behaves as a simple map between the domain values and range values, both of which can be defined in external data files.

The main use case for this feature is to simplify the creation of lookup scales for label texts when the main data only contains a reference id but not the complete label.

Example:
```Javascript
"data": [
{"name":"values", ... },
{"name":"labels",...}
],
"scales": [{
"name":"x",
"type":"ordinal",
"range":"width",
"domain":{"data":"values","field":"data.id"}
}, {
"name":"xlabels",
"type":"ordinal",
"domain":{"data":"labels","field":"data.id"},
"range":{"data":"labels","field":"data.fullname"}
}],
"axes": [
{
"type":"x",
"scale":"x",
"properties": { "labels": { "text": { "scale":"xlabels", "field":"data"} } }
}
]
```