This is an old revision of the document!
Table of Contents
SketchCanvas Syntax
A SketchCanvas document is a YAML formatted data with a list on the root node. The list contains one or more drawing objects. A drawing object is an element in a sketch, such as a line, a rectangle or a ellipse. A sketch consists of a collection of drawing objects.
Following is a list of drawing object types. All objects have a property named “type” that defines the type of the drawing object.
Meta object
This object is always the first entry in the root list of the document.
- type: meta size: [550, 450]
Currently, this object contains only one property: size. The size defines the dimensions of the sketch, in pixels.
If a SketchCanvas document lacks this object, a meta object with default size: [934, 590] is automatically created.
Line object
A simple line with optional color and width specification.
- type: line points: '92,140:159,201' color: red width: 2
- points: A colon-separated list of point coordinates for the line. Currently only 2 points is allowed.
- color: Color of the line. Can be “black”, “blue”, “red” or “white”. If omitted, black is assumed.
- width: Width of the line. Can be 1, 2 or 3. If omitted, 1 is assumed.
Arrow object
A line with arrowhead on one end.
- type: arrow points: '71,265:168,214' color: blue width: 2
Properties are common with line object, except that an arrowhead is drawn on the second point.