UNPKG

557 BTypeScriptView Raw
1import Base from '../base';
2import { ScaleType } from '../types';
3/**
4 * identity scale原则上是定义域和值域一致,scale/invert方法也是一致的
5 * 参考R的实现:https://github.com/r-lib/scales/blob/master/R/pal-identity.r
6 * 参考d3的实现(做了下转型):https://github.com/d3/d3-scale/blob/master/src/identity.js
7 */
8export default class Identity extends Base {
9 readonly type: ScaleType;
10 readonly isIdentity: boolean;
11 calculateTicks(): any[];
12 scale(value: any): number;
13 invert(value?: number): number;
14}