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:
- Clears the segment value from the segmentation data.
- Removes the segment from the list of segments.
- If the removed segment was active and setNextSegmentAsActive is true, it sets the next or previous segment as active.
- Updates the segmentation state with the modified segments.