-
Notifications
You must be signed in to change notification settings - Fork 345
/
Options.ts
44 lines (40 loc) 路 988 Bytes
/
Options.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/**
* Copyright (c) 2017 ~ present NAVER Corp.
* billboard.js project is licensed under the MIT license
*/
// common
import main from "./common/main";
import boost from "./common/boost";
import data from "./data/data";
import color from "./common/color";
import interaction from "./interaction/interaction";
import legend from "./common/legend";
import title from "./common/title";
import tooltip from "./common/tooltip";
import {deepClone} from "../../module/util";
/**
* Class to set options on generating chart.
* - It's instantiated internally, not exposed for public.
* @class Options
* @see {@link bb.generate} to use these options on generating the chart
*/
export default class Options {
static data = {};
static setOptions(options: any[]) {
this.data = options
.reduce((a, c) => ({...a, ...c}), this.data);
}
constructor() {
return deepClone(
main,
boost,
data,
color,
interaction,
legend,
title,
tooltip,
Options.data
);
}
}