MarkupSelected Class

The set of currently selected SVG elements. When elements are added to the set, they are hilited.

Methods

Name Description
constructor(svg: G): MarkupSelected    
add(el: Element): void Add a new element to the SS  
clearEditors(): void    
deleteAll(undo: UndoManager): void    
drop(el: Element): boolean Remove an element from the selection set and unhilite it.  
emptyAll(): void    
groupAll(undo: UndoManager): void    
has(el: Element): boolean    
replace(oldEl: Element, newEl: Element): void Replace an entry in the selection set with a different element.  
reposition(cmdName: string, undo: UndoManager, fn: (el: Element) => void): void Move all of the entries to a new position in the DOM via a callback.  
restart(el?: Element): void    
sizeChanged(): void    
ungroupAll(undo: UndoManager): void    

Properties

Name Type Description
elements Readonly Set<Element>    
handles undefined | Handles    
isEmpty Accessor ReadOnly boolean    
onChanged Readonly BeEvent<(selected: MarkupSelected) => void> Called whenever elements are added or removed from this SelectionSet  
size Accessor ReadOnly number    
svg G    

Defined in

Last Updated: 20 June, 2023