UNPKG

@antv/g2

Version:

the Grammar of Graphics in Javascript

16 lines (12 loc) 406 B
import { DataComponent as DC } from '../runtime'; import { CustomDataTransform } from '../spec'; import { identity } from '../utils/helper'; export type CustomOptions = Omit<CustomDataTransform, 'type'>; /** * Connector transfom by function. */ export const Custom: DC<CustomOptions> = (options) => { const { callback = identity } = options; return (data) => callback(data); }; Custom.props = {};