Skip to main content
The Editor is the main entry point into the tsdraw engine. It coordinates the document store, viewport, input, tools, and rendering. In @tsdraw/react, access it via onMount:

Subsystems

Managing shapes

Draw styles

New shapes inherit the current style:
  • color — CSS color or palette key
  • size's', 'm', 'l', 'xl'
  • dash'draw', 'solid', 'dashed', 'dotted'
  • fill'none', 'semi', 'solid', 'blank'

Selecting tools

Viewport control

Undo and redo

Snapshots

Snapshots are plain objects for serialization: