How to use the paraviewweb/src/Common/Misc/AnnotationBuilder.setDefaultName function in paraviewweb

To help you get started, we’ve selected a few paraviewweb 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 Kitware / paraviewweb / src / InfoViz / Native / HistogramSelector / score.js View on Github external
function sendScores(def, passive = false) {
    const scoreData = dividersToPartition(def, model.scores);
    if (scoreData === null) {
      console.error('Cannot translate scores to send to provider');
      return;
    }
    if (model.provider.isA('SelectionProvider')) {
      if (!scoreData.name) {
        AnnotationBuilder.setDefaultName(scoreData);
        if (model.provider.isA('AnnotationStoreProvider')) {
          scoreData.name = model.provider.getNextStoredAnnotationName(
            scoreData.name
          );
        }
      }
      if (!passive) {
        model.provider.setAnnotation(scoreData);
      } else if (
        model.provider.isA('AnnotationStoreProvider') &&
        model.provider.getStoredAnnotation(scoreData.id)
      ) {
        // Passive means we don't want to set the active annotation, but if there is
        // a stored annotation matching these score dividers, we still need to update
        // that stored annotation
        model.provider.updateStoredAnnotations({
github Kitware / paraviewweb / src / InfoViz / Native / ParallelCoordinates / index.js View on Github external
const selection = model.axes.getSelection();
          if (selection.type === 'empty') {
            lastAnnotationPushed = AnnotationBuilder.EMPTY_ANNOTATION;
          } else if (
            !lastAnnotationPushed ||
            model.provider.shouldCreateNewAnnotation() ||
            lastAnnotationPushed.selection.type !== 'range'
          ) {
            lastAnnotationPushed = AnnotationBuilder.annotation(
              selection,
              [model.defaultScore],
              model.defaultWeight
            );
            if (lastAnnotationPushed.name === '') {
              // set default range annotation name
              AnnotationBuilder.setDefaultName(lastAnnotationPushed);
              if (model.provider.isA('AnnotationStoreProvider')) {
                lastAnnotationPushed.name = model.provider.getNextStoredAnnotationName(
                  lastAnnotationPushed.name
                );
              }
            }
          } else {
            lastAnnotationPushed = AnnotationBuilder.update(
              lastAnnotationPushed,
              {
                selection,
                score: [model.defaultScore],
                weight: model.defaultWeight,
              }
            );
          }
github Kitware / paraviewweb / src / InfoViz / Native / MutualInformationDiagram / index.js View on Github external
const selection = SelectionBuilder.range(vars);
        if (model.useAnnotation) {
          lastAnnotationPushed = model.provider.getAnnotation();
          if (
            !lastAnnotationPushed ||
            model.provider.shouldCreateNewAnnotation() ||
            lastAnnotationPushed.selection.type !== 'range'
          ) {
            lastAnnotationPushed = AnnotationBuilder.annotation(
              selection,
              [model.defaultScore],
              model.defaultWeight
            );
            if (lastAnnotationPushed.name === '') {
              // set default range annotation name
              AnnotationBuilder.setDefaultName(lastAnnotationPushed);
              if (model.provider.isA('AnnotationStoreProvider')) {
                lastAnnotationPushed.name = model.provider.getNextStoredAnnotationName(
                  lastAnnotationPushed.name
                );
              }
            }
          } else {
            lastAnnotationPushed = AnnotationBuilder.update(
              lastAnnotationPushed,
              {
                selection,
                score: [model.defaultScore],
                weight: model.defaultWeight,
              }
            );
          }