Hi.
I'm trying to develop own kibana plugin which conditions like as below.
-> plural visualize can show
-> all visualize are saved in advance on kibana
I refer sample from here.
Sample Link (Github)
After referring, I did catch getVisualizeLoader() is caused about loading visualize in plugin.
So I'm tried edit my code (in ~controller.js) : edit parts are written by bold
import { getVisualizeLoader } from 'ui/visualize/loader';
import 'ui/visualize';
const app = require('ui/modules').get('apps/kibana_sample_plugin', []);
app.controller('TestVisApp', function ($scope, Private, serviceSettings) {
// showing saved kibana visualizations
$scope.visualizationList = null;
$scope.selectedVisualization = null;
let visualizeLoader = null;
getVisualizeLoader().then(loader => {
visualizeLoader = loader;
loader.getVisualizationList().then(list => {
$scope.visualizationList = list; // list params에 visualize 항목들을 save
});
}); // visualize
const visContainer = $('.test-vis-app-visualize');
const timeRange = {
min: 'now-1y/y',
max: 'now'
}; /* min: 'now-7d/d', max: 'now' */
const test = $.scope.visualizationList.list[0];
$scope.$watch('selectedVisualization', (visualizationId) => {
if (!visualizationId) return;
visualizeLoader.embedVisualizationWithId(visContainer, visualizationId, {
timeRange: timeRange
});
});
// below code is for tested
$scope.$watch('go-test', (visualizationId) => {
** if (!visualizationId) return;**
** visualizeLoader.test.embedVisualizationWithId(visContainer, visualizationId, {**
** timeRange: timeRange**
** });**
** })**;
});
However, I can not load my plugin properly
Could anyone tell me about solution?..
Regards,