/ui/utils/jsonDataview

The jsonDataview module exports as default an object with a create method for JSON dataviews.

Requires

Methods

(inner) create(dataview)

The create method for json dataviews assigns the setData method to the dataview object.

Parameters:
NameTypeDescription
dataviewdataview

Dataview object.

(inner) jsonfile(dataview) → {HTMLElement}

The button method creates a button element.

The button will call the textFile utility method to create a json file download.

Parameters:
NameTypeDescription
dataviewdataview

Dataview object.

Returns:

Returns the button element.

Type: 
HTMLElement

(inner) setData(data)

The [json] dataview setData method sets the stringified JSON data as textcontent of the dataview.target element.

Parameters:
NameTypeDescription
dataObject

JSON data.