How to use the phovea_core/src/range.parse 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 / internal / cmds.ts View on Github external
export async function createViewImpl(inputs: IObjectRef[], parameter: any, graph: ProvenanceGraph): Promise {
  const app: OrdinoApp = inputs[0].value;
  const viewId: string = parameter.viewId;
  const idtype = parameter.idtype ? resolve(parameter.idtype) : null; // creates a new object
  const selection = parameter.selection ? parse(parameter.selection) : none(); // creates a new object
  const options = parameter.options;

  const view = getPlugin(EXTENSION_POINT_TDP_VIEW, viewId);

  const viewWrapperInstance = await createViewWrapper(graph, {idtype, range: selection}, app.node, view, options);
  if (viewWrapperInstance.built) {
    await viewWrapperInstance.built;
  }
  const oldFocus = await app.pushImpl(viewWrapperInstance);
  return {
    created: [viewWrapperInstance.ref],
    inverse: (inputs, created, removed) => removeView(inputs[0], created[0], oldFocus)
  };
}
github Caleydo / ordino / src / internal / cmds.ts View on Github external
export async function replaceViewImpl(inputs: IObjectRef[], parameter: any): Promise {
  const app: OrdinoApp = inputs[0].value;
  const existingView: ViewWrapper = inputs[1].value;

  const oldParams = {
    viewId: existingView.desc.id,
    idtype: existingView.selection.idtype,
    selection: existingView.selection.range,
    options: existingView.options
  };

  const viewId: string = parameter.viewId;
  const idtype = parameter.idtype ? resolve(parameter.idtype) : null; // creates a new object
  const selection = parameter.selection ? parse(parameter.selection) : none(); // creates a new object
  const options = parameter.options;

  // create new (inner) view
  const view = getPlugin(EXTENSION_POINT_TDP_VIEW, viewId);

  await replaceViewWrapper(existingView, {idtype, range: selection}, view, options);

  app.update();

  return {
    inverse: replaceView(inputs[0], inputs[1], oldParams.viewId, oldParams.idtype, oldParams.selection, oldParams.options)
  };
}
github Caleydo / taco / src / data_set_selector.ts View on Github external
    const ranges = value.split(';').map((s) => parse(s));
    this.trackedSelections.select(ranges);
github Caleydo / ordino / src / storage.ts View on Github external
export function saveNamedSet(name: string, idType: IDType|string, ids: RangeLike, subType: {key:string, value:string}, description = '') {
  const data = {
    name,
    type: ENamedSetType.NAMEDSET,
    creator: retrieve('username', 'Anonymous'),
    idType: resolve(idType).id,
    ids: parse(ids).toString(),
    subTypeKey: subType.key,
    subTypeValue: subType.value,
    description
  };
  return sendAPI('/targid/storage/namedsets/', data, 'POST');
}
github Caleydo / ordino / src / internal / cmds.ts View on Github external
export async function setSelectionImpl(inputs: IObjectRef[], parameter) {
  const views: ViewWrapper[] = await Promise.all([inputs[0].v, inputs.length > 1 ? inputs[1].v : null]);
  const view = views[0];
  const target = views[1];
  const idtype = parameter.idtype ? resolve(parameter.idtype) : null;
  const range = parse(parameter.range);

  const bak = view.getItemSelection();
  await Promise.resolve(view.setItemSelection({idtype, range}));
  if (target) {
    await Promise.resolve(target.setParameterSelection({idtype, range}));
  }
  return {
    inverse: inputs.length > 1 ? setAndUpdateSelection(inputs[0], inputs[1], bak.idtype, bak.range) : setSelection(inputs[0], bak.idtype, bak.range)
  };
}