window

These are helper methods that get added to global window variable.

Methods

static createTable(data, config) → {Spyral.Table}

Create a new Table

Parameters:
Name Type Description
data Object | Array | String | Number
config Spyral.Table~TableConfig
Returns:
Spyral.Table

static loadCorpus(config, api) → {Promise.<Corpus>}

Load a Corpus using the provided config and api

Parameters:
Name Type Description
config Spyral.Corpus~CorpusConfig

the Corpus config

api Object

any additional API values

Returns:
Promise.<Corpus>

static show(contents, lenopt, modeopt)

Show contents in the results area. Will try to intelligently handle most types of content.

Parameters:
Name Type Attributes Default Description
contents *

The contents to show

len Number <optional>

A maximum length to trim the contents to

mode String <optional>
info

A CSS class to apply to the shown contents

static showError(error, moreopt)

Show an error in the results area.

Parameters:
Name Type Attributes Description
error *

An Error to display

more * <optional>

Additional Error details