-
Notifications
You must be signed in to change notification settings - Fork 345
/
interaction.ts
53 lines (43 loc) 路 1.51 KB
/
interaction.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
45
46
47
48
49
50
51
52
53
/**
* Copyright (c) 2017 ~ present NAVER Corp.
* billboard.js project is licensed under the MIT license
*/
import Chart from "../../Chart/Chart";
import ChartInternal from "../../ChartInternal/ChartInternal";
import Options from "../Options/Options";
import {extend} from "../../module/util";
// Chart
import apiSelection from "../../Chart/api/selection";
import apiSubchart from "../../Chart/api/subchart";
import apiZoom from "../../Chart/api/zoom";
// ChartInternal
import selection from "../../ChartInternal/internals/selection";
import subchart from "../../ChartInternal/interactions/subchart";
import zoom from "../../ChartInternal/interactions/zoom";
// Axis based options
import optDataSelection from "../Options/data/selection";
import optSubchart from "../Options/interaction/subchart";
import optZoom from "../Options/interaction/zoom";
export {
selectionModule as selection,
subchartModule as subchart,
zoomModule as zoom
};
let selectionModule = (): boolean => {
extend(ChartInternal.prototype, selection);
extend(Chart.prototype, apiSelection);
Options.setOptions([optDataSelection]);
return (selectionModule = () => true)();
};
let subchartModule = (): boolean => {
extend(ChartInternal.prototype, subchart);
extend(Chart.prototype, apiSubchart);
Options.setOptions([optSubchart]);
return (subchartModule = () => true)();
};
let zoomModule = (): boolean => {
extend(ChartInternal.prototype, zoom);
extend(Chart.prototype, apiZoom);
Options.setOptions([optZoom]);
return (zoomModule = () => true)();
};