UNPKG

1.53 kBTypeScriptView Raw
1import { Scale, Coordinate } from '../dependents';
2import { LooseObject, ScaleOption, ViewCfg } from '../interface';
3/**
4 * using the scale type if user specified, otherwise infer the type
5 */
6export declare function inferScaleType(scale: Scale, scaleDef: ScaleOption, attrType: string, geometryType: string): string;
7/**
8 * @ignore
9 * 为指定的 `field` 字段数据创建 scale
10 * @param field 字段名
11 * @param [data] 数据集,可为空
12 * @param [scaleDef] 列定义,可为空
13 * @returns scale 返回创建的 Scale 实例
14 */
15export declare function createScaleByField(field: string | number, data?: LooseObject[] | [], scaleDef?: ScaleOption): Scale;
16/**
17 * @ignore
18 * 同步 scale
19 * @todo 是否可以通过 scale.update() 方法进行更新
20 * @param scale 需要同步的 scale 实例
21 * @param newScale 同步源 Scale
22 */
23export declare function syncScale(scale: Scale, newScale: Scale): void;
24/**
25 * @ignore
26 * get the scale name, if alias exist, return alias, or else field
27 * @param scale
28 * @returns the name of field
29 */
30export declare function getName(scale: Scale): string;
31/**
32 * 根据 scale values 和 coordinate 获取分类默认 range
33 * @param scale 需要获取的 scale 实例
34 * @param coordinate coordinate 实例
35 * @param theme theme
36 */
37export declare function getDefaultCategoryScaleRange(scale: Scale, coordinate: Coordinate, theme: ViewCfg['theme']): Scale['range'];
38/**
39 * @function y轴scale的max
40 * @param {yScale}
41 */
42export declare function getMaxScale(scale: Scale): number;