import { BaseScaleConfig } from './BaseScaleConfig'; import { StringLike, DefaultOutput, ValueOf, NumberLike } from './Base'; import { NiceTime } from './Nice'; import { DefaultThresholdInput, ScaleTypeToD3Scale } from './Scale'; declare type Numeric = number | NumberLike; export declare type TimeInput = number | Date; export declare type ContinuousInput = number | Date; export declare type TimeDomain = TimeInput[]; export declare type ContinuousDomain = ContinuousInput[]; declare type CreateScaleConfig = 'type'> = Pick, 'type' | 'domain' | 'range' | 'reverse' | Fields>; export declare type LinearScaleConfig = CreateScaleConfig<'linear', ContinuousDomain, Output[], 'clamp' | 'interpolate' | 'nice' | 'round' | 'zero'>; export declare type LogScaleConfig = CreateScaleConfig<'log', ContinuousDomain, Output[], 'base' | 'clamp' | 'interpolate' | 'nice' | 'round'>; export declare type PowScaleConfig = CreateScaleConfig<'pow', ContinuousDomain, Output[], 'clamp' | 'exponent' | 'interpolate' | 'nice' | 'round' | 'zero'>; export declare type SqrtScaleConfig = CreateScaleConfig<'sqrt', ContinuousDomain, Output[], 'clamp' | 'interpolate' | 'nice' | 'round' | 'zero'>; export declare type SymlogScaleConfig = CreateScaleConfig<'symlog', ContinuousDomain, Output[], 'clamp' | 'constant' | 'nice' | 'zero'>; export declare type QuantileScaleConfig = CreateScaleConfig<'quantile', ContinuousDomain, Output[]>; export declare type QuantizeScaleConfig = CreateScaleConfig<'quantize', [ContinuousInput, ContinuousInput], Output[], 'nice' | 'zero'>; export declare type ThresholdScaleConfig = CreateScaleConfig<'threshold', ThresholdInput[], Output[]>; export declare type OrdinalScaleConfig = CreateScaleConfig<'ordinal', DiscreteInput[], Output[], 'unknown'>; export declare type PointScaleConfig = CreateScaleConfig<'point', DiscreteInput[], [Numeric, Numeric], 'align' | 'padding' | 'round'>; export declare type BandScaleConfig = CreateScaleConfig<'band', DiscreteInput[], [Numeric, Numeric], 'align' | 'padding' | 'paddingInner' | 'paddingOuter' | 'round'>; interface TemporalScaleConfig extends CreateScaleConfig { /** * Extending the domain so that it starts and ends on nice round values. This method typically modifies the scale’s domain, and may only extend the bounds to the nearest round value. Nicing is useful if the domain is computed from data and may be irregular. For example, for a domain of _[0.201479…, 0.996679…]_, a nice domain might be _[0.2, 1.0]_. * * For quantitative scales such as linear, `nice` can be either a boolean flag or a number. If `nice` is a number, it will represent a desired tick count. This allows greater control over the step size used to extend the bounds, guaranteeing that the returned ticks will exactly cover the domain. * * For temporal fields with time and utc scales, the `nice` value can be a string indicating the desired time interval. Legal values are `"millisecond"`, `"second"`, `"minute"`, `"hour"`, `"day"`, `"week"`, `"month"`, and `"year"`. Alternatively, `time` and `utc` scales can accept an object-valued interval specifier of the form `{"interval": "month", "step": 3}`, which includes a desired number of interval steps. Here, the domain would snap to quarter (Jan, Apr, Jul, Oct) boundaries. * * __Default value:__ `true` for unbinned _quantitative_ fields; `false` otherwise. * */ nice?: boolean | number | NiceTime | { interval: NiceTime; step: number; }; } export declare type TimeScaleConfig = TemporalScaleConfig<'time', Output>; export declare type UtcScaleConfig = TemporalScaleConfig<'utc', Output>; /** * Map scale type to D3Scale type * @type `Output`: Output type of all scales except point and band * @type `ThresholdInput`: Input type for threshold scale * @type `DiscreteInput`: Input type for ordinal, point and band scales */ export interface ScaleTypeToScaleConfig { linear: LinearScaleConfig; log: LogScaleConfig; pow: PowScaleConfig; sqrt: SqrtScaleConfig; symlog: SymlogScaleConfig; time: TimeScaleConfig; utc: UtcScaleConfig; quantile: QuantileScaleConfig; quantize: QuantizeScaleConfig; threshold: ThresholdScaleConfig; ordinal: OrdinalScaleConfig; point: PointScaleConfig; band: BandScaleConfig; } /** All scale types */ export declare type ScaleType = keyof ScaleTypeToScaleConfig; /** Scales that take time as domains */ export declare type TimeScaleType = 'time' | 'utc'; /** Scales that take continuous domains and return continuous ranges */ export declare type ContinuousScaleType = 'linear' | 'log' | 'pow' | 'sqrt' | 'symlog' | TimeScaleType; /** Scales that convert continuous domains to discrete ranges */ export declare type DiscretizingScaleType = 'quantile' | 'quantize' | 'threshold'; /** Scales that take discrete domains and return discrete ranges */ export declare type DiscreteScaleType = 'ordinal' | 'point' | 'band'; /** Scales that take continuous domains */ export declare type ContinuousDomainScaleType = ContinuousScaleType | DiscretizingScaleType; export declare type PickScaleConfig = ValueOf, T>>; declare type OmitType = { [key in keyof T]: Omit; }; export declare type PickScaleConfigWithoutType = ValueOf>, T>>; export declare type ScaleConfig = ValueOf>; export declare type ScaleConfigWithoutType = PickScaleConfigWithoutType; export declare type ScaleConfigToD3Scale, Output = DefaultOutput, DiscreteInput extends StringLike = StringLike, ThresholdInput extends DefaultThresholdInput = DefaultThresholdInput> = ScaleTypeToD3Scale[Config['type']]; export {}; //# sourceMappingURL=ScaleConfig.d.ts.map