Skip to content

Serialization & History

Two day-one features that most canvas libraries bolt on later: scenes round-trip through plain JSON, and every mutation can be a reversible command on a History stack.

stringify walks the stage to a JSON document; parse rebuilds it. Add shapes, save, clear, then load to restore:

Wrap a change in a command and run it through History to make it reversible: