Skip to main content

Function: getState()

getState(annotation?): AnnotationStyleStates

Given a Annotation object, return the annotationStyle State that it should be in based on its data. The ordering of states is:

  • Highlighted
  • Selected
  • Locked
  • Autogenerated
  • Default So the first one that applies will be returned. For the autogenerated state, it depends on the autoGenerated flag on the annotation, so once that is gone/false, the annotation will go to default.

Parameters

annotation?: Annotation

The annotation that we want to style.

Returns

AnnotationStyleStates

The state of the annotation whether it is Default, Highlighted, Locked, Selected, or AutoGenerated.

Defined in

tools/src/stateManagement/annotation/config/getState.ts:22