My objective is to take the Table from the DashBoard Lens visualization editor and create a new type of visualization called TableM by creating a plugin in Kibana.
This table will act exactly as the normal Table ( From the sort to how it can be edited in the editor ) however I want to add multiselection and action buttons to the table. ( See example to modify DataGrid to add action and multiselection : https://eui.elastic.co/pr_3350/#/tabular-content/data-grid-control-columns | Elastic UI )
EDIT : SKIP this part So I tried on my own and copy past the code from kibana/src/plugins/vis_types/table into a folder in my plugin folder. I changed all the exports to work and I changed almost all occurence of 'Table' to 'TableM'. And I added in /components/table_vis_basic.tsx a context, code for the buttons, header cells leadingControlColumns etc. However this code is to make a Data Table not a Lens table. I tried looking for the code of 'enhanced table plugin' on github but they do not add a vis type to the lens editor just to the Aggregation Based vis.
So I think I finally found the code for the Lens Table at kibana/x-pack/plugins/lens/public/datatable_visualization.
However I don't know how to use this code to create my 'Lens TableM' with a multiselection and action buttons linked to the multiselection.
Moreover maybe there is no need to recreate a whole Lens Visualization and it's possible to add an option to the existing one to just add the multi selection and the action buttons.
If anyone can help me on this I would be really glad.
Thanks again.
Clicking on it will actually lead you to Lens with the new custom visualization configured.
The source code is available in x-pack/examples/third_party_vis_lens_example.
Another good example is the Region Map visualization built using the example above as foundation. You can find the code here: x-pack/plugins/maps/public/lens.
As for the datatable code, what's in x-pack/plugins/lens/public/datatable_visualization is actually Lens code to wrap the DataGrid component from EUI with some Lens/Kibana configuration.
I was able to create a plugin based on the third_party_vis_lens_example and add a visualization to lens.
However I would like to ask you where is situated the code for the Lens Table so I can do the same thing with the Lens Table that I did with the third_party_vis_lens_example. ( Copy paste, change some names and add new content )
But maybe the code for the Lens Table isn't as simple as the one for the example and won't fit in a plugin ?
Moreover I would like to ask if maybe there is no need to recreate a whole Lens Visualization and if it's possible to add an option to the existing one to just add the multi selection and the action buttons to the Lens Table ?
Unfortunately there's currently no way to extend existing visualizations features with a plugin-like API .
The current route is to replicate the Lens datatable visualization code and add the extra features.
I was able to create a new plugin using the code from the lens/public/datatable/visualization folder.
I aplied a lot of change and had to also copy some code from the Lens itself.
However now I have issue with the code itself to create the class XXXPlugin that implements Plugin.
The new Lens Visualization is registered and appear in the Lens Editor but I have an issue with :
The editorFrame ( I, for now, got rid of it as if I understood it rigth, is initiliazed by the Lens plugin then distributed in the Lens Visu )
The palette ( from ChartsPluginSetup ) wouldn't get imported and the getPalettes function was 'undefined'. ( I, for now, got rid of it and replaced it by a PaletteRegistry )
My last issue is with the getType argument of the DatatableRenderer I have the 'TypeError: Cannot read properties of undefined (reading 'get')'. For this one I couldn't find a way to make it work or a simple patch. Something like : 'getType: core.getStartServices().then(([_, { data: dataStart }]) => dataStart.search.aggs.types.get)'
Would you minde helping me on this subject or redirect me to someone that could be able to help me further ?
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.