viz.yaml: How to write a viz.yaml

Description fetch


See the testviz directory for an example, and see below for a detailed description.


The fetch section takes a list of items. Each item is a raw data file. Items always have a id field. They also always have information, either explicit or implicit, about how to (1) fetch and (2) read the data file.

Fields describing (1) fetch include fetcher, which can take the values file or sciencebase, If sciencebase, then the remoteItemId field should also be included and should be the 24-digit hexadecimal ScienceBase item ID, and the remoteFilename should be included and should be the filename as the item is stored on ScienceBase.

Fields describing (2) read include mimeType, which can take the values text/csv, text/tab-seperated-values, text/yaml, or application/vnd.openxmlformats-officedocument.spreadsheetml.sheet. If the reader function is unspecified then a default reader will use the mimeType to determine how to read the data file into R. Alternatively, the customReader field may be included with a value describing a custom reading function defined in the scripts|lib folder, where the function has the name readData.mytype and the value in the customReader field is mytype. For example, you could define a custom function called readData.netCDF and give customReader: netCDF. If both customReader and mimeType are specified, mimeType will be passed as a second argument to the customReader function.

The export tag is by default true for figures, false for data and munged. but can be set for any of those classes of items. Any item for which export=true will be copied to the target directory when the full visualization is built.

If the customReader argument is ever given, the code will automatically source all files in scripts/read before trying to run the customReader.

USGS-VIZLAB/vizlab documentation built on Nov. 17, 2018, 1:31 a.m.