mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[table_vis] move into own plugin
This commit is contained in:
parent
198824f625
commit
7187e06395
8 changed files with 37 additions and 9 deletions
|
@ -1,13 +1,15 @@
|
|||
define(function (require) {
|
||||
return function HistogramVisType(Private) {
|
||||
var TemplateVisType = Private(require('plugins/vis_types/template/_template_vis_type'));
|
||||
function TableVisProvider(Private) {
|
||||
var TemplateVisType = Private(require('plugins/vis_types/template/template_vis_type'));
|
||||
var Schemas = Private(require('plugins/vis_types/_schemas'));
|
||||
|
||||
require('plugins/table_vis/table');
|
||||
|
||||
return new TemplateVisType({
|
||||
name: 'table',
|
||||
title: 'Data Table',
|
||||
icon: 'fa-table',
|
||||
template: require('text!plugins/vis_types/template/table.html'),
|
||||
template: require('text!plugins/table_vis/table.html'),
|
||||
schemas: new Schemas([
|
||||
{
|
||||
group: 'metrics',
|
||||
|
@ -17,9 +19,16 @@ define(function (require) {
|
|||
{
|
||||
group: 'buckets',
|
||||
name: 'buckets',
|
||||
title: 'Bucket'
|
||||
title: 'Split Column'
|
||||
},
|
||||
{
|
||||
group: 'buckets',
|
||||
name: 'split',
|
||||
title: 'Split Table'
|
||||
}
|
||||
])
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
require('registry/vis_types').register(TableVisProvider);
|
||||
});
|
3
src/kibana/plugins/table_vis/table.html
Normal file
3
src/kibana/plugins/table_vis/table.html
Normal file
|
@ -0,0 +1,3 @@
|
|||
<div ng-controller="TableVisController">
|
||||
<pre>{{ tableData | json }}</pre>
|
||||
</div>
|
17
src/kibana/plugins/table_vis/table.js
Normal file
17
src/kibana/plugins/table_vis/table.js
Normal file
|
@ -0,0 +1,17 @@
|
|||
define(function (require) {
|
||||
require('modules')
|
||||
.get('kibana/table_vis', ['kibana'])
|
||||
.controller('TableVisController', function ($scope, Private) {
|
||||
var tabifyAggResponse = Private(require('components/agg_response/tabify/tabify_agg_response'));
|
||||
|
||||
$scope.$watch('esResponse', function (resp, oldResp) {
|
||||
if (!resp) {
|
||||
$scope.tableData = null;
|
||||
return;
|
||||
}
|
||||
|
||||
$scope.tableData = tabifyAggResponse($scope.vis, $scope.esResponse);
|
||||
});
|
||||
});
|
||||
|
||||
});
|
|
@ -4,6 +4,4 @@ define(function (require) {
|
|||
visTypes.register(require('plugins/vis_types/vislib/histogram'));
|
||||
visTypes.register(require('plugins/vis_types/vislib/line'));
|
||||
visTypes.register(require('plugins/vis_types/vislib/pie'));
|
||||
|
||||
visTypes.register(require('plugins/vis_types/template/table'));
|
||||
});
|
|
@ -8,6 +8,8 @@ define(function (require) {
|
|||
TemplateRenderbot.Super.call(this, vis, $el);
|
||||
|
||||
this.$scope = $rootScope.$new();
|
||||
this.$scope.vis = vis;
|
||||
|
||||
$el.html($compile(this.vis.type.template)(this.$scope));
|
||||
}
|
||||
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
<pre>{{ esResponse | json }}</pre>
|
|
@ -2,7 +2,7 @@ define(function (require) {
|
|||
return function VislibRenderbotFactory(Private, vislib) {
|
||||
var _ = require('lodash');
|
||||
var Renderbot = Private(require('plugins/vis_types/_renderbot'));
|
||||
var normalizeChartData = Private(require('components/chart_data/index'));
|
||||
var normalizeChartData = Private(require('components/agg_response/index'));
|
||||
|
||||
_(VislibRenderbot).inherits(Renderbot);
|
||||
function VislibRenderbot(vis, $el) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue