@antv/attr
Version:
The Attribute module for G2, F2.
19 lines (16 loc) • 411 B
text/typescript
import { AttributeCfg } from '../interface';
import Attribute from './base';
export default class Shape extends Attribute {
constructor(cfg: AttributeCfg) {
super(cfg);
this.type = 'shape';
this.names = ['shape'];
}
/**
* @override
*/
public getLinearValue(percent: number): string {
const idx = Math.round((this.values.length - 1) * percent);
return this.values[idx];
}
}