How to use the paraviewweb/src/Common/Misc/AnnotationBuilder.update 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
div.uncertainty *= uncertScale;
    });
    // console.log('DBG partitionSelection', JSON.stringify(partitionSelection, 2));

    // Construct a partition annotation:
    let partitionAnnotation = null;
    if (def.annotation && !model.provider.shouldCreateNewAnnotation()) {
      // don't send a new selection unless it's changed.
      const saveGen = partitionSelection.generation;
      partitionSelection.generation = def.annotation.selection.generation;
      const changeSet = { score: def.regions };
      if (!deepEquals(partitionSelection, def.annotation.selection)) {
        partitionSelection.generation = saveGen;
        changeSet.selection = partitionSelection;
      }
      partitionAnnotation = AnnotationBuilder.update(def.annotation, {
        selection: partitionSelection,
        score: def.regions,
      });
    } else {
      partitionAnnotation = AnnotationBuilder.annotation(
        partitionSelection,
        def.regions,
        1,
        ''
      );
    }
    AnnotationBuilder.updateReadOnlyFlag(
      partitionAnnotation,
      model.readOnlyFields
    );
    return partitionAnnotation;
github Kitware / paraviewweb / src / InfoViz / Native / ParallelCoordinates / index.js View on Github external
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,
              }
            );
          }
          AnnotationBuilder.updateReadOnlyFlag(
            lastAnnotationPushed,
            model.readOnlyFields
          );
          model.provider.setAnnotation(lastAnnotationPushed);
        } else {
          model.provider.setSelection(model.axes.getSelection());
        }
github Kitware / paraviewweb / src / InfoViz / Native / MutualInformationDiagram / index.js View on Github external
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,
              }
            );
          }
          AnnotationBuilder.updateReadOnlyFlag(
            lastAnnotationPushed,
            model.readOnlyFields
          );
          model.provider.setAnnotation(lastAnnotationPushed);
        } else {
          model.provider.setSelection(selection);
        }