google-chart
google-chart copied to clipboard
Error handling for missing loader or missing chart package
Hi. I'd like to handle the title error cases.
An extreme case, Great Firewall blocks any connections to gstatic.com. Is there any way to handle this kind of errors?
Additionally, if gstatic.com site is down, loading loader.js blocks whole scripting until it is timeouted. I think we should load external scripts by IronJsonpLibraryBehavior as it used to be.
I tried rewriting the codes by using IronJsonpLibrary, but it did not go well because loader.js
does not support jsonp loading...
Yes, that was the original reason that the google-api-loader
was dumped. But then the loader.js
did not support being loaded more than once...
We could do some magic, but not being able to access gstatic.com
is probably an issue specific to only the great firewall... so it doesn't really make sense to me to do so in this component. I think it makes the most sense for the new loader to have a compatible component that we could make use of here.
Until then, you may just need to fork your own copy that is able to work around it until a permanent solution is available.
@wesalvaro Thanks for your clarification and suggestion. Actually, I've already created its fork here, that works fine for now. I've not tried, but I might be able to do the similar by lazy loading google-chart component itself.
Unfortunately, I've decided to not use google chart due to the performance issue. I was using this component for drawing a simple line chart, but this component loaded so many library files which are totally almost 1MB without gzipped. I could not ignore the payload just for the one chart.
I might not participate, but I hope google-chart for further development. If you think you don't need this feature, please feel free to close. Thank you till now.
I'm not sure how that's possible. It loads only the necessary amount of data for Google Visualizations for a line chart.
Here is my network panel for the chart demo page. The demo page loads all possible chart packages and data for demo purposes.
It only loads ~425KB for everything. Most of it is in the UI module.
Here is the network panel for loading only a line chart.
It only loads ~325KB for a line chart.
The content looks gzip encoded to me, too.
Of course, maybe the biggest part of these downloads is features you are not directly utilizing, features like DataTables, DataViews, Queries, Formatters, localization, cross-browser support etc.
For a simple line chart there are probably other much smaller and still sufficient libraries, though. Which did you decide to go with?