import { DataType } from 'apache-arrow'; import { CosmographConfig } from ".."; import { ColorAccessorFn } from "../config/interfaces/data"; export declare enum LinkColorStrategy { /** * Uses the sum of numeric values between the same source and target points in {@link CosmographConfig.linkColorBy linkColorBy} to determine link colors and interpolates them from {@link CosmographConfig.linkColorPalette linkColorPalette}. * - Uses {@link CosmographConfig.unknownColor unknownColor} for nullish values * - Has effect only if {@link CosmographConfig.linkColorBy linkColorBy} provided and contains numeric data. */ Sum = "sum", /** * Uses the average of numeric values between the same source and target points in {@link CosmographConfig.linkColorBy linkColorBy} to determine link colors and interpolates them from {@link CosmographConfig.linkColorPalette linkColorPalette}. * - Uses {@link CosmographConfig.unknownColor unknownColor} for nullish values * - Has effect only if {@link CosmographConfig.linkColorBy linkColorBy} provided and contains numeric data. */ Average = "average", /** * Uses the count of links between the same source and target points in {@link CosmographConfig.linkColorBy linkColorBy} to determine link colors and interpolates them from {@link CosmographConfig.linkColorPalette linkColorPalette}. */ Count = "count", /** * Uses colors from {@link CosmographConfig.linkColorPalette linkColorPalette} for {@link CosmographConfig.linkColorBy linkColorBy} data without interpolation. * - For numeric data: Creates equal-width buckets mapped to {@link CosmographConfig.linkColorPalette linkColorPalette} colors * - For categorical data: Assigns colors from {@link CosmographConfig.linkColorPalette linkColorPalette} in order, cycling when unique values exceed palette length * - Uses {@link CosmographConfig.unknownColor unknownColor} for nullish values * - Has effect only if {@link CosmographConfig.linkColorBy linkColorBy} provided */ Categorical = "categorical", /** * Directly uses {@link CosmographConfig.linkColorBy linkColorBy} column values as colors. * - Applies the color if it's a valid color string (hex, rgb, named color, etc) or an array of `[r, g, b, a]` * - If {@link CosmographConfig.linkColorByFn linkColorByFn} exists, applies it to transform {@link CosmographConfig.linkColorBy linkColorBy} values into custom colors with it * - Falls back to {@link CosmographConfig.unknownColor unknownColor} if invalid color * - If neither {@link CosmographConfig.linkColorBy} nor {@link CosmographConfig.linkColorByFn} exist, colors all links with {@link CosmographConfig.unknownColor unknownColor} */ Direct = "direct", /** * Colors all links uniformly to the same color specified by {@link CosmographConfig.linkDefaultColor linkDefaultColor}. */ Single = "single" } export type LinkColorStrategyType = `${LinkColorStrategy}`; /** * Determines the optimal color strategy for points based on the input configuration and color data type. * * @param config - The configuration object of the Cosmograph. * @param pointsSummary - Optional summaries of points. * @returns The resolved {@link PointColorStrategyType} */ export declare function resolveOptimalLinkColorStrategy(config?: CosmographConfig, dataColumnType?: DataType): LinkColorStrategyType; /** * Determines the appropriate color accessor function based on the provided configuration and data. * * @param config - The configuration object of the Cosmograph. * @param data - The data array to be used for color scaling. * @param dataColumnType - The data type of the column being colored (optional). * @returns A color accessor function that can be used to determine the color of points. */ export declare const getActiveLinkColorFn: (strategy: LinkColorStrategyType, config: CosmographConfig, data: string[] | number[], dataColumnType?: DataType) => ColorAccessorFn;