Angular Embedded AnalyticsAsynchronous Data Sources

Asynchronous data sources can be used to lazy load data on demand.

An asynchronous data source represents one or more tables of data.

<ag-studio
    [data]="data"
    /* other studio properties ... */ />

this.data = {
    sources: [{
        id: 'medalsSource',
        dataShape: 'row',
        getData: async (tableId) => {
            const data = await fetchData(tableId);
            return { data };
        },
        tables: [
            {
                id: 'medals',
                fields: [
                    {
                        id: 'athlete',
                        format: 'textFormat',
                    },
                    // ... other fields
                ],
            },
            // ... other tables
        ],
    }],
};

Asynchronous data sources can return row-based or column-based data. This is determined by the dataShape property.

Properties available on the AgDataSourceDefinition<TDataShape extends AgDataShape, TFormats extends AgFormats = AgFormats> interface.

string
Data source ID
string
Data source display name. If not provided, a formatted version of id will be used.
getDataCopy Link
Function
Callback to return the data for the provided table and fields
dataShapeCopy Link
TDataShape
'row' if the data is row-based, or 'column' if the data is column-based.
tablesCopy Link
AgAsyncTableDefinition<TFormats>[]
One or more tables that are provided by this data source.

Multiple Tables Copy Link

When multiple tables are provided, they can be linked by providing Relationships.

Reloading Data Copy Link

Data can be reloaded by calling api.reload().