import type { ColorScaleType, D3InterpolateName } from '../colors'; import { type AtomColorMode } from '../settings'; import type { AnyStructure, Site } from './'; import type { BondingStrategy } from './bonding'; import type { WyckoffPos } from '../symmetry/wyckoff'; type SimpleAtomColorMode = Exclude; type AtomColorFn = (site: Site, idx: number) => number | string; interface AtomColorBase { scale: D3InterpolateName; scale_type: ColorScaleType; } export type AtomColorConfig = (AtomColorBase & { mode: SimpleAtomColorMode; }) | (AtomColorBase & { mode: `property`; property_key: string; }) | (AtomColorBase & { mode: `custom`; color_fn: AtomColorFn; }); export interface AtomPropertyColors { colors: string[]; values: (number | string)[]; min_value?: number; max_value?: number; unique_values?: (number | string)[]; } export declare function apply_color_scale(vals: number[], scale?: D3InterpolateName, type?: ColorScaleType): { colors: string[]; unique_values?: number[]; }; export declare const apply_categorical_color_scale: (vals: string[], scale?: D3InterpolateName) => { colors: string[]; unique_values: string[]; }; export declare function get_coordination_colors(structure: AnyStructure, strategy?: BondingStrategy, scale?: D3InterpolateName, type?: ColorScaleType): AtomPropertyColors; export declare function get_wyckoff_colors(structure: AnyStructure, wyckoff_rows: readonly WyckoffPos[], scale?: D3InterpolateName): AtomPropertyColors; declare const SELECTIVE_DYNAMICS_CATEGORIES: readonly ["free", "partially fixed", "fixed", "unknown"]; type SelectiveDynamicsCategory = (typeof SELECTIVE_DYNAMICS_CATEGORIES)[number]; export declare function categorize_selective_dynamics(value: unknown): SelectiveDynamicsCategory; export declare const structure_has_selective_dynamics: (structure: AnyStructure | undefined | null) => boolean; export declare function get_selective_dynamics_colors(structure: AnyStructure, scale?: D3InterpolateName): AtomPropertyColors; export declare function get_colorable_property_keys(structure: AnyStructure | undefined | null): string[]; export declare const DEFAULT_ATOM_COLOR_CONFIG: AtomColorConfig; export declare function normalize_atom_color_config(config: unknown): AtomColorConfig; export declare const next_atom_color_config: (config: AtomColorConfig, mode: AtomColorMode, property_keys: string[], preferred_key?: string) => AtomColorConfig; export declare function get_site_property_colors(structure: AnyStructure, property_key: string, scale?: D3InterpolateName, type?: ColorScaleType): AtomPropertyColors; export declare function get_custom_colors(structure: AnyStructure, fn: AtomColorFn, scale?: D3InterpolateName, type?: ColorScaleType): AtomPropertyColors; export type AtomColorSources = { base?: AnyStructure; to_base_idx?: (site: Site, site_idx: number) => number; bonding_strategy?: BondingStrategy; wyckoff_rows?: readonly WyckoffPos[]; }; export declare function get_atom_colors(structure: AnyStructure, config: AtomColorConfig, { base, to_base_idx, bonding_strategy, wyckoff_rows, }?: AtomColorSources): AtomPropertyColors; export declare function get_property_colors(structure: AnyStructure | undefined, config: AtomColorConfig, sources?: AtomColorSources): AtomPropertyColors | null; export type AtomColorModeContext = { has_sym_data: boolean; has_selective_dynamics: boolean; colorable_property_keys: readonly string[]; }; export declare const is_atom_color_mode_available: (mode: AtomColorMode, { has_sym_data, has_selective_dynamics, colorable_property_keys }: AtomColorModeContext) => boolean; export {};