How to use the phovea_core/src.hash.getProp 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 / data_set_selector.ts View on Github external
private restoreSelections() {
    if (!this.trackedSelections) {
      return;
    }
    const value = hash.getProp(AppConstants.HASH_PROPS.SELECTION, '');
    if (value === '') {
      return;
    }
    const ranges = value.split(';').map((s) => parse(s));
    this.trackedSelections.select(ranges);
  }
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 / data_set_selector.ts View on Github external
          const selectedData = data.filter((d, i) => d.key === hash.getProp(AppConstants.HASH_PROPS.DATASET));
github Caleydo / taco / src / app_constants.ts View on Github external
export const COLOR_NO_CHANGE = '#fff';
export const COLOR_CONTENT_NEGATIVE = '#8da0cb';
export const COLOR_CONTENT_POSITIVE = '#d8b365';

export interface IChangeType {
  type: string;
  ratioName: string;
  countName: string;
  label: string;

  isActive: boolean;

  abbr: string;
}

const defaultFilter = hash.getProp(AppConstants.HASH_PROPS.FILTER, 'NCAR');

export class ChangeTypes {

  static NO_CHANGE: IChangeType = {
    type: 'nochange',
    ratioName: 'no_ratio',
    countName: 'no_counts',
    label: 'No changes',
    abbr: 'N',
    isActive: defaultFilter.includes('N')
  };

  static CONTENT: IChangeType = {
    type: 'content',
    ratioName: 'c_ratio',
    countName: 'c_counts',