當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript SortAction.equals方法代碼示例

本文整理匯總了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]))});
  })
開發者ID:baeeq,項目名稱:pivot,代碼行數:34,代碼來源:line-chart.ts

示例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]))});
  })
開發者ID:avenger-teamave,項目名稱:pivot,代碼行數:30,代碼來源:circumstances.ts

示例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));
 }
開發者ID:RaviNK,項目名稱:pivot,代碼行數:11,代碼來源:split-combine.ts


注:本文中的plywood.SortAction.equals方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。