Object Visibility

Overview

Use the visibility APIs to show, hide, or toggle objects. Hidden objects are removed from selection and can be revealed later.

API

showObjects

editor.showObjects([objectId])

hideObjects

editor.hideObjects([objectId])

toggleVisibility

editor.toggleVisibility([objectId])

Behavior

  • Missing IDs are ignored.
  • Hidden objects are deselected automatically.
  • Visibility changes are recorded in history.

Example

editor.hideObjects([rect.id, circle.id])
editor.showObjects([rect.id])
editor.toggleVisibility([circle.id])