vega-lite-api
Version:
A JavaScript API for Vega-Lite.
58 lines (50 loc) • 1.13 kB
JavaScript
import {BaseObject, copy, get, init, set} from './__util__';
class Lead extends BaseObject {
constructor(...args) {
super();
init(this);
set(this, "op", "lead");
if (args[0] !== undefined) set(this, "field", args[0]);
if (args[1] !== undefined) set(this, "param", args[1]);
if (args[2] !== undefined) set(this, "as", args[2]);
}
as(value) {
if (arguments.length) {
const obj = copy(this);
set(obj, "as", value);
return obj;
} else {
return get(this, "as");
}
}
field(value) {
if (arguments.length) {
const obj = copy(this);
set(obj, "field", value);
return obj;
} else {
return get(this, "field");
}
}
op(value) {
if (arguments.length) {
const obj = copy(this);
set(obj, "op", value);
return obj;
} else {
return get(this, "op");
}
}
param(value) {
if (arguments.length) {
const obj = copy(this);
set(obj, "param", value);
return obj;
} else {
return get(this, "param");
}
}
}
export function lead(...args) {
return new Lead(...args);
}