UNPKG

1.33 kBPlain TextView Raw
1/**
2 * main module of LineUp.js containing the main class and exposes all other modules
3 */
4
5import { IColumnDesc } from './model';
6import { DataProvider, LocalDataProvider, ILocalDataProviderOptions } from './provider';
7import { LineUp, Taggle } from './ui';
8import { ILineUpOptions, ITaggleOptions } from './config';
9
10export * from './builder';
11export * from './config';
12export * from './internal/mathInterfaces';
13export * from './model';
14export * from './provider';
15export * from './renderer';
16export * from './ui';
17export { LineUp as default } from './ui';
18
19export function createLocalDataProvider(
20 data: any[],
21 columns: IColumnDesc[],
22 options: Partial<ILocalDataProviderOptions> = {}
23) {
24 return new LocalDataProvider(data, columns, options);
25}
26
27/**
28 *
29 * @param container the html element lineup should be built in
30 * @param data {DataProvider} the data provider
31 * @param config {Partial<ILineUpOptions>} lineup configuration overrides
32 * @returns {LineUp} the created lineup instance
33 */
34export function createLineUp(container: HTMLElement, data: DataProvider, config: Partial<ILineUpOptions> = {}) {
35 return new LineUp(container, data, config);
36}
37
38export function createTaggle(container: HTMLElement, data: DataProvider, config: Partial<ITaggleOptions> = {}) {
39 return new Taggle(container, data, config);
40}