Embed visualizations in app plugin

Hi everyone!
I saw this PR in Kibana: add API to embed visualizations by ppisljar · Pull Request #14292 · elastic/kibana · GitHub

In the sample code, the test_vis_app.js controller fills the data for the visualization.

And I wonder, what is the structure of myVisData variable? Is it the same for every type of visualization? Is there documentation about this?

Also, in the final line:

$scope.myVis = new Vis('.logstash*', visConfig);

What is the '.logstash*', an index-pattern?

Thanks in advance!

ping @thomasneirynck

Hi @havidarou,

That PR is probably not the best to find out about these things, as the attached sample code went stale as the PR progressed.

If you're interested in plugin development, I would start with:

And particularly, for visualization plugins

This is all targeted to the upcoming v6 release.

Thanks,

Thanks @thomasneirynck.

I've been looking at the links and I have doubts.

The example code shown in https://www.elastic.co/guide/en/kibana/master/development-embedding-visualizations.htm (in the visualize example) creates a new controller for the Kibana module.

Is it the way to proceed? If I have a plugin called, let's say, test, I'd still have to add the controller to the Kibana module for it to work?

Or should I add the controller to my plugin's module? In that case, what imports should I do and where? Do I have to modify the uiExports in my plugin? adding the 'uses' part? add dependencies to the angular module definition?

Is there a sample plugin showing how to do this somewhere?

Thanks in advance!

Regards.

hi @havidarou,

no you have some flexibility in how you develop and embed plugins. You don't have to use the angular controllers necessarily. I think we're running a little behind on the docs there, as Kibana has some new modules that will make embedding easier.

You do always need your plugins module though, that will bootstrap your plugin inside Kibana.

Are you able to attend this webinar?

https://www.elastic.co/webinars/creating-custom-kibana-visualizations?ultron=creating-custom-kibana-visualizations-webinar&blade=invite&hulk=email

I think that will give you a high level overview and probably a decent starting point.

Hi @thomasneirynck I'll attend the webinar.

In the meantime, what are these Kibana modules you mention?

Regards.

hi @havidarou, please check https://www.elastic.co/guide/en/kibana/master/development-embedding-visualizations.html, it has some documentation on the ui/visualize/loader module.

thanks,

Thanks @thomasneirynck

how about kibana5.4.3, how to embed a visualize in app plugin?

@thomasneirynck

hi @whoami,

that documentation only applies to v6.0 and up, so embedding a visualization in 5.4.3 will not be possible.

what a pity

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.