OpenSource For You

Data

-

This section of the specificat­ion is to configure and define the data to load and its type. By default, Vega is configured to use a tabular data structure with collection­s of rows as records and columns as fields. Data can either be directly loaded through the values property or through url as shown below:

“data”: [{"name": "temperatur­e", "values": [244.85, 50.74, 2.95, 1.25, 44.04, 116.34]}] “data”: [{"name": "stats", "url": "data/playerStat­s.json", “transform”: [ ]}]

Apart from these basic configurat­ions, it is also possible to specify the format of data to load (csv, tsv, json). The transform section is used to define how to render the data being loaded. Data transforms operations are executed over the given dataset before rendering the visualisat­ion. Its main purpose is to define the encoding mechanism and to filter, group, sort or define the custom formula. Each transform section should have type property, which defines the type of transforma­tion to be performed and some set of properties. Some examples are shown below:

"transform": [ {"type": "copy", "from": "data", "fields": ["source", "target"]} {"type": "filter", "test": "data.score > 100"} {"type": "formula", "field": "rectArea", "expr": "data. length*data.width"}

]

Newspapers in English

Newspapers from India