Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error handling for missing loader or missing chart package #123

Open
naoak opened this issue Jul 1, 2016 · 6 comments
Open

Error handling for missing loader or missing chart package #123

naoak opened this issue Jul 1, 2016 · 6 comments

Comments

@naoak
Copy link

naoak commented Jul 1, 2016

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?

@naoak
Copy link
Author

naoak commented Jul 4, 2016

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.

@naoak
Copy link
Author

naoak commented Jul 4, 2016

I tried rewriting the codes by using IronJsonpLibrary, but it did not go well because loader.js does not support jsonp loading...

@wesalvaro
Copy link
Member

wesalvaro commented Jul 10, 2016

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.

@naoak
Copy link
Author

naoak commented Jul 11, 2016

@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.

@naoak
Copy link
Author

naoak commented Aug 3, 2016

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.

@wesalvaro
Copy link
Member

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.
Loading all packages
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.
Loading only 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?

@wesalvaro wesalvaro added this to the Comprehensive API milestone Jan 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants