Back

Sample Code

Sample code demonstrating various forms of API usage.
To inspect the sample code of these pages, choose View Source in your browser.

Basic Triangle
How to simply embed a Sketchpad document in a web page.
Basic Triangle with JavaScript
How to embed a Sketchpad document in a web page using JavaScript, including saving/restoring state.
Isosceles Events
How to bind to sketch events, and respond to them. Useful in an assessment context.
Analytics
An example logging the various kinds of events we track.