You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
1.5 KiB

4 months ago
import { Base } from './base';
import { ContinuousOptions, Domain, Range, NiceMethod, TickMethodOptions, Transform } from '../types';
/**
* Continuous x y y = a * f(x) + b
*
* https://github.com/d3/d3-scale/blob/master/src/continuous.js
*/
export declare abstract class Continuous<O extends ContinuousOptions> extends Base<O> {
/** 实际上将 x 映射为 y 的函数 */
protected output: Transform;
/** 实际上将 y 映射为 x 的函数 */
protected input: Transform;
/**
* options transform untransform
* y = a * f(x) + b
* x = a * f'(y) + b
* @returns [f(x), f'(y)]
*/
protected abstract chooseTransforms(): Transform[];
protected getDefaultOptions(): O;
/**
* y = interpolate(normalize(clamp(transform(x))))
*/
map(x: Domain<O>): any;
/**
* x = transform(clamp(interpolate(normalize(y))))
*/
invert(x: Range<O>): any;
protected nice(): void;
getTicks(): (number | Date)[];
protected getTickMethodOptions(): TickMethodOptions;
protected chooseNice(): NiceMethod<number | Date>;
protected rescale(): void;
protected chooseClamp(transform: Transform): (x: number) => number;
protected composeOutput(transform: Transform, clamp: Transform): void;
protected composeInput(transform: Transform, untransform: Transform, clamp: Transform): void;
}