本文整理匯總了TypeScript中plywood.SortAction.equals方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript SortAction.equals方法的具體用法?TypeScript SortAction.equals怎麽用?TypeScript SortAction.equals使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類plywood.SortAction
的用法示例。
在下文中一共展示了SortAction.equals方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: SortAction
.then((splits: Splits, dataSource: DataSource, colors: Colors, current: boolean) => {
var score = 4;
var continuousSplit = splits.get(0);
var continuousDimension = dataSource.getDimensionByExpression(continuousSplit.expression);
var sortAction: SortAction = new SortAction({
expression: $(continuousDimension.name),
direction: SortAction.ASCENDING
});
let autoChanged = false;
// Fix time sort
if (!sortAction.equals(continuousSplit.sortAction)) {
continuousSplit = continuousSplit.changeSortAction(sortAction);
autoChanged = true;
}
// Fix time limit
if (continuousSplit.limitAction && continuousDimension.kind === 'time') {
continuousSplit = continuousSplit.changeLimitAction(null);
autoChanged = true;
}
if (colors) {
autoChanged = true;
}
if (continuousDimension.kind === 'time') score += 3;
if (!autoChanged) return Resolve.ready(current ? 10 : score);
return Resolve.automatic(score, {splits: new Splits(List([continuousSplit]))});
})
示例2: SortAction
.then((splits: Splits, dataSource: DataSource, colors: Colors) => {
var timeSplit = splits.get(0);
var timeDimension = timeSplit.getDimension(dataSource.dimensions);
var sortAction: SortAction = new SortAction({
expression: $(timeDimension.name),
direction: SortAction.ASCENDING
});
let autoChanged = false;
// Fix time sort
if (!sortAction.equals(timeSplit.sortAction)) {
timeSplit = timeSplit.changeSortAction(sortAction);
autoChanged = true;
}
// Fix time limit
if (timeSplit.limitAction) {
timeSplit = timeSplit.changeLimitAction(null);
autoChanged = true;
}
if (colors) {
autoChanged = true;
}
if (!autoChanged) return Resolve.ready(10);
return Resolve.automatic(8, {splits: new Splits(List([timeSplit]))});
})
示例3: equals
public equals(other: SplitCombine): boolean {
var { expression, bucketAction, sortAction, limitAction } = this;
return SplitCombine.isSplitCombine(other) &&
expression.equals(other.expression) &&
Boolean(bucketAction) === Boolean(other.bucketAction) &&
(!bucketAction || bucketAction.equals(other.bucketAction)) &&
Boolean(sortAction) === Boolean(other.sortAction) &&
(!sortAction || sortAction.equals(other.sortAction)) &&
Boolean(limitAction) === Boolean(other.limitAction) &&
(!limitAction || limitAction.equals(other.limitAction));
}