declare interface AggregationSettingsDataType { column: string; aggregationMethod?: 'sum' | 'average' | 'min' | 'max'; } declare interface ColumnConfigurationDataType { column: string; delimiter?: string; } declare interface FileSettingsDataType { dataURL: string; idColumnName: string; fileType?: 'csv' | 'json' | 'api'; delimiter?: string; columnsToArray?: ColumnConfigurationDataType[]; apiHeaders?: any; dataTransformation?: string; } declare interface GraphConfigurationDataType { columnId: string | string[]; chartConfigId: string; } declare type GraphType = GraphTypeForGriddedGraph; declare type GraphTypeForGriddedGraph = 'barChart' | 'waterfallChart' | 'stackedBarChart' | 'groupedBarChart' | 'lineChart' | 'dualAxisLineChart' | 'multiLineChart' | 'multiLineAltChart' | 'differenceLineChart' | 'stackedAreaChart' | 'choroplethMap' | 'biVariateChoroplethMap' | 'hybridMap' | 'dotDensityMap' | 'donutChart' | 'slopeChart' | 'scatterPlot' | 'dumbbellChart' | 'treeMap' | 'circlePacking' | 'heatMap' | 'stripChart' | 'beeSwarmChart' | 'butterflyChart' | 'histogram' | 'sparkLine' | 'paretoChart' | 'dataTable' | 'statCard' | 'unitChart' | 'sankeyChart' | 'lineChartWithConfidenceInterval' | 'dataCards' | 'radarChart' | 'bulletChart'; declare type ThreeDGraphType = 'threeDGlobe'; /** * Transforms specified columns of the CSV data into arrays, splitting the string values based on a delimiter. * This function is useful for handling columns that contain multiple values separated by a delimiter, * and it converts them into arrays for further processing. * * @param csvData - The input CSV data, typically an array of objects where each object represents a row. * @param columnConfig - An optional array of column configuration objects specifying the columns to be transformed, * along with the delimiter used to split the values (defaults to ',' if not provided). * Each object should contain: * - `column`: The name of the column to transform. * - `delimiter`: The delimiter used to split the column values (optional, defaults to ','). * * @returns A new array of objects, where the specified columns are transformed into arrays of values, split by the delimiter. * * @example * const data = [ * { category: 'A', tags: 'apple, orange, banana' }, * { category: 'B', tags: 'grape, pear' } * ]; * const columnConfig = [ * { column: 'tags', delimiter: ', ' } * ]; * const transformedData = transformColumnsToArray(data, columnConfig); * console.log(transformedData); * // Output: * // [ * // { category: 'A', tags: ['apple', 'orange', 'banana'] }, * // { category: 'B', tags: ['grape', 'pear'] } * // ] */ export declare function transformColumnsToArray(csvData: any, columnConfig?: ColumnConfigurationDataType[]): any; /** * Transforms the data for aggregation based on a key column and specified aggregation settings. * It groups the data by unique values in the key column and applies the aggregation methods to each group. * * @param data - The input data to be aggregated. Can be an array of objects, where each object represents a data row. * @param keyColumn - The name of the column to group the data by (key column). * @param aggregationSettings - Optional settings for the aggregation, specifying the column and aggregation method (e.g., 'average', 'max', 'min', 'sum'). * Each setting can define a column and a corresponding aggregation method to apply to that column. * * @returns An array of objects where each object contains the aggregated values for each unique value in the key column. * Each object includes the key column value, count of occurrences, and the aggregated values for each specified column. * * @example * const data = [ * { category: 'A', value: 10, amount: 5 }, * { category: 'A', value: 20, amount: 10 }, * { category: 'B', value: 15, amount: 7 }, * ]; * const aggregationSettings = [ * { column: 'value', aggregationMethod: 'average' }, * { column: 'amount', aggregationMethod: 'sum' }, * ]; * const transformedData = transformDataForAggregation(data, 'category', aggregationSettings); * console.log(transformedData); * // Output: * // [ * // { category: 'A', count: 2, value: 15, amount: 15 }, * // { category: 'B', count: 1, value: 15, amount: 7 }, * // ] */ export declare function transformDataForAggregation(data: any, keyColumn: string, aggregationSettings?: AggregationSettingsDataType[]): any[]; /** * Transforms the input data into a format suitable for graph visualization based on the given graph type and configuration. * * The function formats the data according to the specified graph configuration and checks the validity of the configuration. * It also handles cases for graphs like "dataTable" and "dataCards" without additional processing, and it processes * more complex graphs (e.g., charts) with a specific configuration. * * @param data - The data to be transformed, typically an array of objects representing rows of data. * @param graph - The type of graph to transform the data for (e.g., lineChart, barChart, etc.). * @param config - An optional array of configuration objects that define how the data should be mapped to the graph. * Each object in the array should define column mappings and how data should be grouped or aggregated. * * @returns The transformed data in the format required by the graph. If no valid configuration is provided, or if * data is invalid, an error message is returned. * - If the graph type is "dataTable" or "dataCards", the original data is returned unchanged. * - If data is invalid, an error message will be returned. * * @throws {string} If the configuration is invalid or the data can't be processed, an error message is logged and * returned. * * @example * const graphData = [ * { category: 'A', value: 10 }, * { category: 'B', value: 15 }, * ]; * const graph = 'barChart'; * const config = [ * { columnId: 'category', chartConfigId: 'label' }, * { columnId: 'value', chartConfigId: 'size' }, * ]; * const transformedData = transformDataForGraph(graphData, graph, config); * console.log(transformedData); */ export declare function transformDataForGraph(data: any, graph: GraphType | ThreeDGraphType, config?: GraphConfigurationDataType[]): any; /** * Fetches data from a given URL or multiple data sources, processes it according to the specified graph configuration, * and formats it for use in a graph. * * This function supports different file types (CSV, JSON, and API), and can handle multiple data sources. It applies * any necessary data transformations and column formatting, then prepares the data for visualization in the specified graph. * * @param dataURL - The URL or array of data sources to fetch data from. If it's a string, it represents the URL to fetch data from. * If it's an array, it represents multiple data sources with different types (CSV, JSON, API). * @param dataConfiguration - The graph configuration data used to determine how the data should be formatted for the graph. * @param graph - The type of graph to be used (e.g., lineChart, barChart). * @param fileType - The type of the file being fetched. Can be 'csv', 'json', or 'api'. This parameter is ignored if `dataURL` is an array. * @param delimiter - The delimiter used in CSV files (default is ',' if not provided). * @param columnsToArray - Configuration for columns that need to be transformed into arrays (optional). * @param apiHeaders - Headers for the API request (optional). * @param dataTransformation - A Handlebars template used for transforming the data (optional). * @param idColumnTitle - The title of the ID column when merging multiple data sources (optional). * * @returns A Promise that resolves to the transformed data ready for the graph, or null if an error occurs. * * @throws {Error} Throws an error if the data fetching or processing fails. * * @example * const dataURL = 'https://example.com/data.json'; * const dataConfiguration = [ * { column: 'value', chartConfigId: 'size' }, * { column: 'category', chartConfigId: 'label' }, * ]; * const graph = 'barChart'; * transformDataForGraphFromFile(dataURL, dataConfiguration, graph, 'json') * .then(data => { * console.log('Formatted Data:', data); * }) * .catch(error => { * console.error('Error:', error); * }); */ export declare function transformDataForGraphFromFile(dataURL: string | FileSettingsDataType[], dataConfiguration: GraphConfigurationDataType[], graph: GraphType, fileType?: 'csv' | 'json' | 'api', delimiter?: string, columnsToArray?: ColumnConfigurationDataType[], apiHeaders?: any, dataTransformation?: string, idColumnTitle?: string): Promise; export { }