Class Selection

Constructors

Properties

list: ShapeModel<Shape<ShapeConfig> | Group, ShapeConfig>[] = []

Represents list of the selected shapes

transformer: Transformer

Represents the selections transformer object

Accessors

  • get isDisabled(): boolean
  • Determines whether the selection has been disabled by another component

    Returns boolean

    the disabled status which is true or false

  • get isVisible(): boolean
  • Checks whether the selection transformer is visible or not

    Returns boolean

  • get shapes(): ShapeModel<Shape<ShapeConfig> | Group, ShapeConfig>[]
  • Returns list of selected shapes

    Returns ShapeModel<Shape<ShapeConfig> | Group, ShapeConfig>[]

    array of [[ShapeModel]]

Methods

  • Adds a [[ShapeModel | shape ]] to the selections list

    Parameters

    • shape: ShapeModel<Shape<ShapeConfig> | Group, ShapeConfig>

      The [[ShapeModel]]

    Returns void

  • Adds filter or filters to the selected shapes

    Parameters

    Returns void

  • Deletes all selected shapes

    Returns void

  • Deselects a shape

    Parameters

    • shape: ShapeModel<Shape<ShapeConfig> | Group, ShapeConfig>

      The [[ShapeModel]]

    Returns void

  • Deselects all shapes in the board

    Returns void

    Example

    editor.board.selection.deselectAll()
    
  • Finds and selects multiple shapes

    Parameters

    • selector: ((shape) => boolean)

      The selector function

        • (shape): boolean
        • Parameters

          • shape: ShapeModel<Shape<ShapeConfig> | Group, ShapeConfig>

          Returns boolean

    Returns void

    Example

    editor.board.selection.find(shape => shape.node.getType() === 'Rect')
    

    Example

    editor.board.selection.find(shape => shape.node.getId() === '<id>')
    
  • Returns selection transformer object

    Returns Transformer

  • Creates a group of the selected shapes

    Parameters

    • groupName: string

      The group name

    Returns void

  • Moves the selected shape horizontally

    Parameters

    • value: number

      The value number

    Returns Promise<unknown>

  • Moves the selected shape vertically

    Parameters

    • value: number

      The value number

    Returns Promise<unknown>

  • Selects one or multiple shapes

    Parameters

    • shapes: ShapeModel<Shape<ShapeConfig> | Group, ShapeConfig>[]

      The array of [[ShapeModel]]

    Returns void

  • Removes a filter or list of filters from the selected shapes

    Parameters

    Returns void

  • Reselects all selected shapes

    Returns void

    Example

    editor.board.selection.reselectAll()
    
  • Selects all shapes in the board

    Returns void

    Example

    editor.board.selection.selectAll()
    
  • Toggles a [[ShapeModel | shape]]

    Parameters

    • shape: ShapeModel<Shape<ShapeConfig> | Group, ShapeConfig>

      The [[ShapeModel]]

    Returns void