Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it("should throw if expression is not a quantile expression", () => {
const expression = Expression.parse("$main.count()");
// @ts-ignore: access protected property
expect(() => quantileConcreteSeries.applyExpression(expression, "name", 0)).throws();
});
constructor(parameters: MeasureValue) {
super(parameters);
this.title = this.title || makeTitle(this.name);
this.expression = Expression.parse(this.formula);
this.formatFn = formatFnFactory(this.getFormat());
}
constructor(parameters: DimensionValue) {
var name = parameters.name;
verifyUrlSafeName(name);
this.name = name;
this.title = parameters.title || makeTitle(name);
var formula = parameters.formula || $(name).toString();
this.formula = formula;
this.expression = Expression.parse(formula);
var kind = parameters.kind || typeToKind(this.expression.type) || 'string';
this.kind = kind;
if (kind === 'string' && isGeo(name)) {
this.className = 'string-geo';
} else {
this.className = kind;
}
if (parameters.url) {
if (typeof parameters.url !== 'string') {
throw new Error(`unsupported url: ${parameters.url}: only strings are supported`);
}
this.url = parameters.url;
}
constructor(parameters: MeasureValue) {
super(parameters);
this.title = this.title || makeTitle(this.name);
this.expression = Expression.parse(this.formula);
this.formatFn = formatFnFactory(this.getFormat());
}
constructor(parameters: DimensionValue) {
const name = parameters.name;
verifyUrlSafeName(name);
this.name = name;
this.title = parameters.title || makeTitle(name);
this.description = parameters.description;
const formula = parameters.formula || $(name).toString();
this.formula = formula;
this.expression = Expression.parse(formula);
const kind = parameters.kind ? readKind(parameters.kind) : typeToKind(this.expression.type);
this.kind = kind;
this.multiValue = true === parameters.multiValue;
this.className = kind;
if (parameters.url) {
if (typeof parameters.url !== "string") {
throw new Error(`unsupported url: ${parameters.url}: only strings are supported`);
}
this.url = parameters.url;
}
const granularities = parameters.granularities;
if (granularities) {
if (!Array.isArray(granularities) || granularities.length !== 5) {