Skip to content

Explorer Configuration

jwildfire edited this page Sep 6, 2018 · 14 revisions

After major updates in v1.2, the webcodebook.createExplorer() method now adds a "Files" tab to the web-codebook, thereby allowing users to use the web-codebook library on several different data sets from a single web page. Parameters for the settings object are described in detail below.

settings

object

an object passed to webcodebook.createExplorer() which controls the settings and appearance of the explorer.

settings.files

array of objects required

An array of objects describing files and settings used to create codebook objects. Each file object must have a settings parameter and either a path or json parameter as described below. Any other parameters in the object will be included as metadata in the listing created on the "Files" tab of the codebook.

default: none

files[].settings

object

A settings file appropriate for webcodebook.createCodebook(). See config documentation here.

default: explorer.settings.defaultCodebookSettings (which defaults to {})

files[].path

string

The location of a csv file to be parsed using d3.csv() and then used to create a codebook.

default: none

files[].json

array of object

JSON content for the file formatted as one object per row with one key per column (like the output of d3.csv(). If JSON content is provided, the files[].path is ignored. Added in v1.3.

default: null

settings.labelColumn

string

Specifies a property for objects in the settings.files[] array to be used as the label in listing on the "Files" tab. The label column is highlighted and triggers the creation of a new codebook for the given file when clicked.

default: The first key in the first settings.files[] object is used.

settings.defaultCodebookSettings

object

A valid configuration for a codebook object. Added in v1.5.

default: {}

settings.ignoredColumns

array of strings

An array of column names that should not be shown in the listing on the "Files" tab. Note that system variables ["['settings', 'selected', 'event'] are automatically hidden.

default: []

settings.tableConfig

object

An valid webcharts table configuration object that controls the appearance and features of the files listing. Added in v1.2.1

default:

{
    sortable: false,
    searchable: false,
    pagination: false,
    exportable: false
  }

settings.meta

array of objects

Added in v1.2. Metadata objects passed to the codebook settings.meta parameter by the explorer for the current file. Objects have the same expectation as the codebook with one additional custom parameter.

default: []

meta[].file

string required

Parameter specifying the file for the metadata item matching settings.files[config.labelColumn].

settings.fileLoader

boolean

Specifies whether to add a control that allows users to add local files at the top of the files tab. Added in v1.5.

default: false