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

Proposal: add load function to google-chart-loader #244

Closed
rslawik opened this issue May 27, 2019 · 0 comments · Fixed by #245
Closed

Proposal: add load function to google-chart-loader #244

rslawik opened this issue May 27, 2019 · 0 comments · Fixed by #245

Comments

@rslawik
Copy link
Contributor

rslawik commented May 27, 2019

Add the following function to the google-chart-loader module:

export function load(settings) {
  /* supply default values for settings and ... */
  /* delegate to Google Charts loader */
}

The options can specify:

  • language - what language should be used by Google Charts library, default: lang attribute of the document or English if no attribute
  • packages - which packages to load, default: ['corechart']
  • version - what version of Google Charts library to load, default: 'current', other possible values
  • mapsApiKey - used for queries from geocharts

The function returns a promise that resolves when the selected packages are loaded.

Use cases:

  • preload certain packages
  • show loading indicator while waiting for Google Charts library to be loaded
  • support testing (e.g. await load() before constructing a test DataTable)

This is a part extracter from PR #204.

@wesalvaro, WDYT?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant