If data sources are shared between multiple instances of Studio, or it's desirable to cache data whilst the Studio component is destroyed/recreated, a Data Engine can be used.
The Data Engine handles the loading, processing and caching of data. When providing data sources to Studio, it automatically creates a Data Engine. The Data Engine can instead be created outside of Studio by using the createDataEngine(data) function and passing the data source definitions. The Data Engine can then be passed to the data property of Studio.
const dataEngine = createDataEngine({
sources: [{
id: 'medals',
data: [
{
year: 2000,
sport: 'Swimming',
country: 'United States',
// ... other fields
},
// ... other rows
],
}],
});
const studioProperties = {
data: dataEngine,
// other studio properties ...
}createDataEngine(data) accepts a data object of type AgDataSourcesDefinition.
One or more data sources. |
When using multiple related tables, this describes the fields that link the tables together. |
Expression field definitions for calculated columns. |
Overrides to existing formats, or additional custom formats. |