Skip to main content

Function: removeSegment()

removeSegment(segmentationId, segmentIndex, options): void

Removes a segment from a segmentation.

Parameters

segmentationId: string

The unique identifier of the segmentation.

segmentIndex: number

The index of the segment to be removed.

options = ...

Additional options for segment removal.

options.setNextSegmentAsActive: boolean

Whether to set the next available segment as active after removal. Defaults to true.

Returns

void

Remarks

This function performs the following steps:

  1. Clears the segment value from the segmentation data.
  2. Removes the segment from the list of segments.
  3. If the removed segment was active and setNextSegmentAsActive is true, it sets the next or previous segment as active.
  4. Updates the segmentation state with the modified segments.

Defined in

tools/src/stateManagement/segmentation/removeSegment.ts:25