I’m developing my datasource plugin based on simple-json. I want to use the library angular-ivh-treeview, but I do not understand how to use it in the plugin. Can someone help me?
Asked
Active
Viewed 980 times
1 Answers
1
To use an external JavaScript lib in a plugin, you have to include it in the plugin code. JavaScript libraries in node_modules are only used at build time and are not included in the output.
To take an example, here is the Plotly panel plugin that includes the Plotly lib in a subdirectory named lib
:
https://github.com/NatelEnergy/grafana-plotly-panel/tree/master/src/lib
and then uses it here:
https://github.com/NatelEnergy/grafana-plotly-panel/blob/master/src/module.js#L8
Another example - the GeoLoop plugin that includes the mapboxgl library:
https://github.com/CitiLogics/citilogics-geoloop-panel/blob/master/src/geoloop.js#L3

Daniel Lee
- 7,709
- 2
- 48
- 57
-
I understand it. Thanks, but it not working. Grafana does not see directives of this library. I used another lib (jsTree). – Oleksii Trubochkin Nov 30 '17 at 17:06