-
-
Notifications
You must be signed in to change notification settings - Fork 50
/
index.js
42 lines (29 loc) · 1.43 KB
/
index.js
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
import CompositeClosureHelper from 'paraviewweb/src/Common/Core/CompositeClosureHelper';
// ----------------------------------------------------------------------------
// Histogram Bin Hover Provider
// ----------------------------------------------------------------------------
function histogramBinHoverProvider(publicAPI, model) {
if (!model.hoverState) {
model.hoverState = {};
}
publicAPI.setHoverState = (hoverState) => {
model.hoverState = hoverState;
publicAPI.fireHoverBinChange(model.hoverState);
};
}
// ----------------------------------------------------------------------------
// Object factory
// ----------------------------------------------------------------------------
const DEFAULT_VALUES = {};
// ----------------------------------------------------------------------------
export function extend(publicAPI, model, initialValues = {}) {
Object.assign(model, DEFAULT_VALUES, initialValues);
CompositeClosureHelper.destroy(publicAPI, model);
CompositeClosureHelper.isA(publicAPI, model, 'HistogramBinHoverProvider');
CompositeClosureHelper.event(publicAPI, model, 'HoverBinChange');
histogramBinHoverProvider(publicAPI, model);
}
// ----------------------------------------------------------------------------
export const newInstance = CompositeClosureHelper.newInstance(extend);
// ----------------------------------------------------------------------------
export default { newInstance, extend };