How to use the phovea_core/src.hash.removeProp 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 selectTimePoint(...timepoints: ITacoTimePoint[]) {
  // remove timepoints that are already selected
  timepoints = timepoints.filter((d) => selectedTimePoints.indexOf(d) === -1);

  if (timepoints.length > 2) {
    timepoints = timepoints.slice(0, 2);
  }

  selectedTimePoints.push(...timepoints);

  // sort elements by time -> [0] = earlier = source; [1] = later = destination
  selectedTimePoints = selectedTimePoints.sort((a, b) => d3.ascending(a.time.toISOString(), b.time.toISOString()));

  hash.setProp(AppConstants.HASH_PROPS.TIME_POINTS, selectedTimePoints.map((d) => d.key).join(','));
  hash.removeProp(AppConstants.HASH_PROPS.DETAIL_VIEW);

  events.fire(AppConstants.EVENT_TIME_POINTS_SELECTED, selectedTimePoints);

  // clear after 2 selected time points
  if (selectedTimePoints.length === 2) {
    selectedTimePoints = [];
  }
}
github Caleydo / taco / src / data_set_selector.ts View on Github external
.on('change', () => {
        const selectedData = this.$select.selectAll('option')
          .filter((d, i) => i === this.$select.property('selectedIndex'))
          .data();

        hash.setProp(AppConstants.HASH_PROPS.DATASET, selectedData[0].key);
        hash.removeProp(AppConstants.HASH_PROPS.TIME_POINTS);
        hash.removeProp(AppConstants.HASH_PROPS.DETAIL_VIEW);
        hash.removeProp(AppConstants.HASH_PROPS.SELECTION);

        if (selectedData.length > 0) {
          events.fire(AppConstants.EVENT_DATA_COLLECTION_SELECTED, selectedData[0].values);
          this.trackSelections(selectedData[0].values[0].item);
        }
      });
  }
github Caleydo / taco / src / data_set_selector.ts View on Github external
.on('change', () => {
        const selectedData = this.$select.selectAll('option')
          .filter((d, i) => i === this.$select.property('selectedIndex'))
          .data();

        hash.setProp(AppConstants.HASH_PROPS.DATASET, selectedData[0].key);
        hash.removeProp(AppConstants.HASH_PROPS.TIME_POINTS);
        hash.removeProp(AppConstants.HASH_PROPS.DETAIL_VIEW);
        hash.removeProp(AppConstants.HASH_PROPS.SELECTION);

        if (selectedData.length > 0) {
          events.fire(AppConstants.EVENT_DATA_COLLECTION_SELECTED, selectedData[0].values);
          this.trackSelections(selectedData[0].values[0].item);
        }
      });
  }
github Caleydo / taco / src / data_set_selector.ts View on Github external
.on('change', () => {
        const selectedData = this.$select.selectAll('option')
          .filter((d, i) => i === this.$select.property('selectedIndex'))
          .data();

        hash.setProp(AppConstants.HASH_PROPS.DATASET, selectedData[0].key);
        hash.removeProp(AppConstants.HASH_PROPS.TIME_POINTS);
        hash.removeProp(AppConstants.HASH_PROPS.DETAIL_VIEW);
        hash.removeProp(AppConstants.HASH_PROPS.SELECTION);

        if (selectedData.length > 0) {
          events.fire(AppConstants.EVENT_DATA_COLLECTION_SELECTED, selectedData[0].values);
          this.trackSelections(selectedData[0].values[0].item);
        }
      });
  }