grafana-sankey-panel
grafana-sankey-panel copied to clipboard
How not to build plugin with google chart
Hi,
Your project is really cool but I have a good suggestion. Why you don't build your js plugin with directly the google charts loader inside it ? It's more simple to include your plugin into our grafana server using this and, in that case, we don't have to modify the index.html file
Thanks
@throrin19 I will try it with the suggested way
@kumaravel29 That would be great if it was self-contained when you release the 6.x compatible version.
Tried including the google charts in the plugin itself. But the Sankey chart does not seems to be available with the function. Any suggestions/links related to this would be appreciated.
Not sure you can:
Can I use charts offline? Your users' computers must have access to https://www.gstatic.com/charts/loader.js in order to use the interactive features of Google Charts. This is because the visualization libraries that your page requires are loaded dynamically before you use them. The code for loading the appropriate library is part of the included script, and is called when you invoke the google.charts.load() method. Our terms of service do not allow you to download the google.charts.load or google.visualization code to use offline
From: https://developers.google.com/chart/interactive/faq
Perhaps ask Grafana Devs if you can include it in some other way?
Looks like some other plugin's use externaly hosted .js files too. Search for MathJax.js in this file to see the imported src URL: https://github.com/algenty/grafana-flowcharting/blob/master/src/libs/viewer.min.js
Looks like this in the browser:
<script type="text/javascript" src="https://www.draw.io/math/MathJax.js?config=TeX-MML-AM_HTMLorMML"></script>