import { GraphConfig } from '@cosmos.gl/graph'; import { CosmographConfig } from "../cosmograph"; import { CosmographData, CosmographInputData, CosmographLinksConfig, CosmographPointsConfig } from "../cosmograph/config/interfaces"; /** * Represents the configuration options for preparing data for the Cosmograph. * * @property {CosmographDataPrepPointsConfig} points - {@link CosmographDataPrepPointsConfig} Configuration options for the points data. * @property {CosmographDataPrepLinksConfig} [links] - {@link CosmographDataPrepLinksConfig} Configuration options for the links data. * @property {string} [outputFormat] - The output format for the prepared data: 'csv', 'arrow' or 'parquet'. Does not have impact when `CosmographDataPrepConfig` is passed into {@link prepareCosmographData} because it prepares into {@link CosmographData} format. */ export interface CosmographDataPrepConfig { points: CosmographDataPrepPointsConfig; links?: CosmographDataPrepLinksConfig; outputFormat?: string; } export type Data = CosmographInputData | Record[]; export type DataFormat = 'csv' | 'arrow' | 'parquet'; export type OutputCosmographDataPrepConfig = Omit; export interface CosmographDataPrepResult { points?: T; links?: T; pointsSummary?: Record[]; linksSummary?: Record[]; /** Indicates whether the points dataset was processed fully without hitting memory limits */ pointsProcessedFully?: boolean; /** Indicates whether the links dataset was processed fully without hitting memory limits */ linksProcessedFully?: boolean; cosmographConfig: OutputCosmographDataPrepConfig; } /** * Represents the configuration options for preparing points data for the Cosmograph. * * @property {string} [linkSourceBy] - The column name to use as the source for links. * @property {string[]} [linkTargetsBy] - The column names to use as the targets for links. * @property {string} [outputFilename] - The filename to use for the output points data. Has impact only when `CosmographDataPrepConfig` is passed into {@link downloadCosmographData}. * @property {string} [csvParseTimeFormat] - The time format to use when parsing CSV data. Has impact only when source data is CSV. * @property {Record} [csvColumnTypesMap] - A mapping of column names to data types for CSV parsing. Has impact only when source data is CSV. */ export interface CosmographDataPrepPointsConfig extends Omit, Pick { linkSourceBy?: string; linkTargetsBy?: string[]; outputFilename?: string; csvParseTimeFormat?: string; csvColumnTypesMap?: Record; } /** * Represents the configuration options for preparing links data for the Cosmograph. * * @property {string[]} linkTargetsBy - The column names to use as the targets for links. * @property {string} [outputFilename] - The filename to use for the output links data. Has impact only when `CosmographDataPrepConfig` is passed into {@link downloadCosmographData}. * @property {string} [csvParseTimeFormat] - The time format to use when parsing CSV data. Has impact only when source data is CSV. * @property {Record} [csvColumnTypesMap] - A mapping of column names to data types for CSV parsing. Has impact only when source data is CSV. * @property {boolean} [createMissingPoints] - Whether to additionally create points for any link source or target missing in the points id column. */ export interface CosmographDataPrepLinksConfig extends Omit, Pick { linkTargetsBy: string[]; outputFilename?: string; csvParseTimeFormat?: string; csvColumnTypesMap?: Record; createMissingPoints?: boolean; }