How to use the phovea_core/src.hash.setInt 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 / taco / src / util.ts View on Github external
export function selectTimePointFromHash(timepoints: ITacoTimePoint[]) {
  if (hash.has(AppConstants.HASH_PROPS.TIME_POINTS) === false) {
    return;
  }

  const selectedTPKeys: string[] = hash.getProp(AppConstants.HASH_PROPS.TIME_POINTS).split(',');
  const selectedTimePoints = timepoints.filter((d) => selectedTPKeys.indexOf(d.key) > -1);
  const showDetailView = hash.getInt(AppConstants.HASH_PROPS.DETAIL_VIEW);

  selectTimePoint(...selectedTimePoints);

  if (selectedTimePoints.length === 2 && showDetailView === 1) {
    hash.setInt(AppConstants.HASH_PROPS.DETAIL_VIEW, showDetailView);
    events.fire(AppConstants.EVENT_OPEN_DETAIL_VIEW, selectedTimePoints);

  } else {
    hash.removeProp(AppConstants.HASH_PROPS.DETAIL_VIEW);
  }
}
github Caleydo / taco / src / detail_view.ts View on Github external
private loadDetailView(selection:ITacoTimePoint[]) {
    if(selection.length !== 2) {
      return;
    }

    hash.setInt(AppConstants.HASH_PROPS.DETAIL_VIEW, 1);

    events.fire(AppConstants.EVENT_OPEN_DIFF_HEATMAP, selection.map((d) => d.item));
    events.fire(AppConstants.EVENT_DATASET_SELECTED_LEFT, selection[0].item);
    events.fire(AppConstants.EVENT_DATASET_SELECTED_RIGHT, selection[1].item);
    this.$node.select('button').attr('disabled', 'disabled').classed('loading', true);
  }
}