本文整理汇总了TypeScript中plywood.Expression.toJS方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Expression.toJS方法的具体用法?TypeScript Expression.toJS怎么用?TypeScript Expression.toJS使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类plywood.Expression
的用法示例。
在下文中一共展示了Expression.toJS方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: return
return (ex: Expression, env: Environment = {}) => {
return Qajax({
method: "POST",
url: url + '?by=' + getSplitsDescription(ex),
data: {
version: version,
dataCube: name,
expression: ex.toJS(),
timezone: env ? env.timezone : null
}
})
.then(Qajax.filterSuccess)
.then(Qajax.toJSON)
.then(
(res) => {
return Dataset.fromJS(res.result);
},
(xhr: XMLHttpRequest): Dataset => {
if (!xhr) return null; // This is only here to stop TS complaining
var jsonError = JSON.parse(xhr.responseText);
if (jsonError.action === 'reload') reload();
throw new Error(jsonError.message || jsonError.error);
}
);
};
示例2: toJS
public toJS(): DimensionJS {
return {
name: this.name,
title: this.title,
expression: this.expression.toJS(),
kind: this.kind
};
}
示例3: toJS
public toJS(): SplitCombineJS {
var js: SplitCombineJSFull = {
expression: this.expression.toJS()
};
if (this.bucketAction) js.bucketAction = this.bucketAction.toJS();
if (this.sortAction) js.sortAction = this.sortAction.toJS();
if (this.limitAction) js.limitAction = this.limitAction.toJS();
return js;
}
示例4: toJS
public toJS(): DimensionJS {
var js: DimensionJS = {
name: this.name,
title: this.title,
expression: this.expression.toJS(),
type: this.type
};
if (this.sortOn) js.sortOn = this.sortOn;
return js;
}
示例5: toJS
public toJS(): DimensionJS {
var js: DimensionJS = {
name: this.name,
title: this.title,
expression: this.expression.toJS(),
kind: this.kind
};
if (this.url) js.url = this.url;
return js;
}
示例6: toJS
public toJS(): DimensionJS {
var js: DimensionJS = {
name: this.name,
title: this.title,
expression: this.expression.toJS(),
kind: this.kind
};
if (this.url) js.url = this.url;
if (this.granularities) js.granularities = this.granularities.map((g) => { return granularityToJS(g); });
return js;
}
示例7: return
return (ex: Expression) => {
return Qajax({
method: "POST",
url: url + '?by=' + getSplitsDescription(ex),
data: {
dataset: name,
expression: ex.toJS()
}
})
.then(Qajax.filterSuccess)
.then(Qajax.toJSON)
.then(
(dataJS) => {
return Dataset.fromJS(dataJS);
},
(xhr: XMLHttpRequest): Dataset => {
throw new Error(JSON.parse(xhr.responseText).message);
}
);
};
示例8: return
return (ex: Expression) => {
return Qajax({
method: "POST",
url: url + '?by=' + getSplitsDescription(ex),
data: {
version: version,
dataSource: name,
expression: ex.toJS()
}
})
.then(Qajax.filterSuccess)
.then(Qajax.toJSON)
.then(
(dataJS) => {
return Dataset.fromJS(dataJS);
},
(xhr: XMLHttpRequest): Dataset => {
if (!xhr) return null; // This is only here to stop TS complaining
var jsonError = JSON.parse(xhr.responseText);
if (jsonError.action === 'reload') reload();
throw new Error(jsonError.message);
}
);
};