How to use the phovea_core/src/range.list function in phovea_core

To help you get started, we’ve selected a few phovea_core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Caleydo / ordino / src / lineup / LineUpSelectionHelper.ts View on Github external
// add new element to the end
    if (diffAdded.length > 0) {
      diffAdded.forEach((d) => {
        this.orderedSelectionIndicies.push(d);
      });
    }

    // remove elements within, but preserve order
    if (diffRemoved.length > 0) {
      diffRemoved.forEach((d) => {
        this.orderedSelectionIndicies.splice(this.orderedSelectionIndicies.indexOf(d), 1);
      });
    }

    const ids = rlist(this.orderedSelectionIndicies.map((i) => this.idAccessor(this._rows[i])));
    //console.log(this.orderedSelectionIndicies, ids.toString(), diffAdded, diffRemoved);

    const selection: ISelection = {idtype: this.idType, range: ids};
    // Note: listener of that event calls LineUpSelectionHelper.setItemSelection()
    this.fire(LineUpSelectionHelper.SET_ITEM_SELECTION, selection);
  }
github Caleydo / ordino / src / lineup / LineUpSelectionHelper.ts View on Github external
rowIdsAsSet(indices: number[]) {
    let ids: number[];
    if (indices.length === this._rows.length) {
      ids = this._rows.map((d) => this.idAccessor(d));
    } else {
      ids = indices.map((i) => this.index2id.get(String(i)));
    }
    ids.sort((a, b) => a - b); // sort by number
    return rlist(ids);
  }