Dataset

Dataset

new Dataset()

A Dataset is responsible for actually managing the data: based on the filters and their factes, implement callbacks that return the processed data in a standardized format.

To help analyze data, a few methods to help autoconfigure your session must be implemented.

Implementations for Crossfilter (fully in memory client side filtering) and PostgreSQL datasets are available.

Source:

Members

(static, readonly) datasetType :string

Type of the dataset: crossfilter, server, generic (none)

Type:
  • string
Source:

(static) facets :Array.<Facet>

A Facet collection holding pre defined facets

Type:
Source:

(static) filters :Array.<Filter>

A Filter collection holding all active filters on the dataset

Type:
Source:

(static) isPaused :boolean

isPaused when true, calls to getAllData are ignored. This is useful to suppres calls to getData when adding and removing a number of filters at once.

Type:
  • boolean
Source:

Methods

(static) extendFacet(dataset, facet)

Extends a Facet by adding the dataset dependent callback functions: setMinMax, setCategories, setExceedances, and setPercentiles Automatically called when adding facets to the dataset

Parameters:
Name Type Description
dataset Dataset
facet Facet
Source:

(static) extendFilter(dataset, filter)

Extends a Filter by adding the dataset dependent callback functions: initDataFilter, updateDataFilter, and releaseDataFilter Automatically called when adding filters to the dataset

Parameters:
Name Type Description
dataset Dataset
filter Filter
Source:

(static) getAllData()

getAllData Refresh data for all filters, by calling getData for each filter in the filter collection.

Source:
See:
  • pause and play

(static) pause()

Pause the dataset. This means calls to getData are blocked. Useful when updating a lot of filters and you are not interested in the intermediate state.

Source:

(static) play()

Unpause the dataset

Source:

(abstract, static) sampleDataset(N) → {Array.<Object>}

returns an array containing N datum objects

Parameters:
Name Type Description
N number

Number of objects to return

Source:
Returns:

data Array of objects

Type
Array.<Object>

(static) scanData()

Autoconfigure a dataset:

  1. inspect the dataset, and create facets for the properties
  2. for continuous facets, guess the missing values, and set the minimum and maximum values
  3. for categorial facets, set the categorialTransform
Source: