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?
Add the following function to the
google-chart-loadermodule:The
optionscan specify:language- what language should be used by Google Charts library, default:langattribute of the document or English if no attributepackages- which packages to load, default:['corechart']version- what version of Google Charts library to load, default:'current', other possible valuesmapsApiKey- used for queries from geochartsThe function returns a promise that resolves when the selected packages are loaded.
Use cases:
await load()before constructing a testDataTable)This is a part extracter from PR #204.
@wesalvaro, WDYT?