Map

The Map data type represents a collection of key/value pairs, where the keys are unique.

Examples

`values` argument of the "Extend datatable" adaptor

The "Extend datatable" adaptor accepts a Map for the values argument. This argument should provide mapping such that for a given value in the `source` column, a corresponding value should appear in the target column.

Given the following Datatable:

datatable.json
{
"columns": [
"city"
],
"rows": [
{ "city": "Manchester" },
{ "city": "London" }
]
}

This map would assign a colour to each city:

map.json
[
[ "Manchester", "red" ],
[ "London", "blue" ]
]

Resulting in this Datatable:

extended-datatable.json
{
"columns": [
"city",
"colour"
],
"rows": [
{ "city": "Manchester", "colour": "red" },
{ "city": "London", "colour": "blue" }
]
}