UNPKG

1.38 kBTypeScriptView Raw
1import { Datum, MappingDatum, ShapeInfo } from '../interface';
2import { ShapeAttrs } from '../dependents';
3import Geometry, { GeometryCfg } from './base';
4/** 引入对应的 ShapeFactory */
5import './shape/interval';
6/** Path 构造函数参数类型 */
7export interface IntervalCfg extends GeometryCfg {
8 /** shape 背景,只对 Interval Geometry 生效,目前只对 interval-rect shape 生效。 */
9 background?: {
10 style?: ShapeAttrs;
11 };
12}
13/**
14 * Interval 几何标记。
15 * 用于绘制柱状图、饼图、条形图、玫瑰图等。
16 */
17export default class Interval extends Geometry {
18 readonly type: string;
19 readonly shapeType: string;
20 /** shape 背景。目前只对 interval-rect shape 生效。 */
21 protected background?: {
22 style?: ShapeAttrs;
23 };
24 protected generatePoints: boolean;
25 constructor(cfg: IntervalCfg);
26 /**
27 * 获取每条数据的 Shape 绘制信息
28 * @param obj 经过分组 -> 数字化 -> adjust 调整后的数据记录
29 * @returns
30 */
31 protected createShapePointsCfg(obj: Datum): import("../interface").ShapePoint;
32 /**
33 * 调整 y 轴的 scale 范围。
34 * 对于 Y 轴为数值轴柱状图,默认从 0 开始 生长。
35 */
36 protected adjustScale(): void;
37 /**
38 * @override
39 */
40 protected getDrawCfg(mappingData: MappingDatum): ShapeInfo;
41}