@antv/g2
Version:
the Grammar of Graphics in Javascript
29 lines (25 loc) • 716 B
text/typescript
import { MappingDatum, ShapeInfo } from '../interface';
import Geometry from './base';
/** 引入 Point 对应的 ShapeFactory */
import './shape/point';
/**
* Point 几何标记。
* 常用于绘制点图。
*/
export default class Point extends Geometry {
public readonly type: string = 'point';
public readonly shapeType: string = 'point';
protected generatePoints: boolean = true;
/**
* 获取一个点的绘制信息。
* @param mappingDatum
* @returns draw cfg
*/
protected getDrawCfg(mappingDatum: MappingDatum): ShapeInfo {
const shapeCfg = super.getDrawCfg(mappingDatum);
return {
...shapeCfg,
isStack: !!this.getAdjust('stack'), // 层叠点图
};
}
}