-
Notifications
You must be signed in to change notification settings - Fork 8.3k
/
Copy pathindex.js
48 lines (42 loc) · 1.65 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
43
44
45
46
47
48
import { VisFactoryProvider } from 'ui/vis/vis_factory';
import { CATEGORY } from 'ui/vis/vis_category';
import image from '../images/icon-timelion.svg';
import { VisTypesRegistryProvider } from 'ui/registry/vis_types';
import { TimelionRequestHandlerProvider } from './timelion_request_handler';
// we also need to load the controller and directive used by the template
import 'plugins/timelion/vis/timelion_vis_controller';
import 'plugins/timelion/directives/timelion_expression_input';
// Stylin
import 'plugins/timelion/vis/timelion_vis.less';
import visConfigTemplate from 'plugins/timelion/vis/timelion_vis.html';
import editorConfigTemplate from 'plugins/timelion/vis/timelion_vis_params.html';
// register the provider with the visTypes registry so that other know it exists
VisTypesRegistryProvider.register(TimelionVisProvider);
export default function TimelionVisProvider(Private) {
const VisFactory = Private(VisFactoryProvider);
const timelionRequestHandler = Private(TimelionRequestHandlerProvider);
// return the visType object, which kibana will use to display and configure new
// Vis object of this type.
return VisFactory.createAngularVisualization({
name: 'timelion',
title: 'Timelion',
image,
description: 'Build time-series using functional expressions',
category: CATEGORY.TIME,
visConfig: {
defaults: {
expression: '.es(*)',
interval: 'auto'
},
template: visConfigTemplate,
},
editorConfig: {
optionsTemplate: editorConfigTemplate,
},
requestHandler: timelionRequestHandler.handler,
responseHandler: 'none',
options: {
showIndexSelection: false
}
});
}