Dataset API

class Dataset(options)
Arguments:

Creates an empty dataset.

Dataset.update(cues[, options])
Arguments:
  • cues (iterator) – iterable of cues or single cue
  • options (object) – options
Returns Array:

list of cue change items

Insert, replace and delete cues from the dataset. For details on how to construct cue parameters see Update. For details on return value see Update Result.

  • options.equals: custom equality function for cue data.

  • options.chaining: support chaining. True by default.

  • options.safe: safe mode. False by default.

  • options.debug: debug mode. False by default.

    Performs integrity testing of internal datastructures after each update operation, throwing exceptions if not passed.

Dataset.addCue(key, interval, data)

Add or replace a single cue. See Update Convenience Methods.

Arguments:
  • key (object) – cue key
  • interval (Interval) – cue interval
  • data (object) – cue data
Returns Dataset dataset:
 

dataset

Dataset.removeCue(key)

Remove a single cue. See Update Convenience Methods.

Arguments:
  • key (object) – cue key
Returns Dataset dataset:
 

dataset

Dataset.makeBuilder(options)

Make cue argument builder object with options. See Update Convenience Methods.

Params object options:
 

update options (see Dataset.update())

Returns object builder:
 

cue argument update builder

  • builder.addCue(key, interval, data)
  • builder.removeCue(key)
Dataset.clear()
Returns Array:list of change items: cue changes caused by the operation

Clears all cues of the dataset. Much more effective than iterating through cues and deleting them.

Dataset.lookup(interval[, mask])
Arguments:
  • interval (Interval) – lookup interval
  • mask (int) – match mask
Returns Array:

list of cues

Returns all cues matching a given interval on dataset. Lookup mask specifies the exact meaning of match, see Interval Match.

Note also that the lookup operation may be used to lookup cues that match a single point on the timeline, simply by defining the lookup interval as a single point, see Definition.

Dataset.lookup_endpoints(interval)
Arguments:
  • interval (Interval) – lookup interval
Returns Array:

list of {endpoint: endpoint, cue:cue} objects

Lookup all cue endpoints on the dataset, within some interval see Lookup endpoints.

Dataset.lookup_delete(interval[, mask])
Arguments:
  • interval (Interval) – lookup interval
  • mask (int) – match mask
Returns Array:

list of cue change items

Deletes all cues matching a given lookup interval. Similar to lookup, see Lookup.

Dataset.size

see ObservableMapInterface.size()

Dataset.has(key)

see ObservableMapInterface.has()

Dataset.get(key)

see ObservableMapInterface.get()

Dataset.keys()

see ObservableMapInterface.keys()

Dataset.values()

see ObservableMapInterface.values()

Dataset.entries()

see ObservableMapInterface.entries()

Dataset.cues(options)

see CueCollection.cues()

Dataset.on(name, callback[, options])

see EventProviderInterface.on()

Dataset.off(name, subscription)

see EventProviderInterface.off()