Library
Compose.circleFunction.
circle(xs, ys, rs)

Arguments can be passed in arrays in order to perform multiple drawing operations.

source
Compose.circleFunction.
circle(x, y, r)

Define a circle with its center at (x,y) and a radius of r.

source
Compose.circleMethod.
circle()

Define a circle in the center of the current context with a diameter equal to the width of the context.

source
Compose.polygonFunction.
polygon(points)

Define a polygon. points is an array of (x,y) tuples that specify the corners of the polygon.

source
Compose.rectangleFunction.
rectangle(x0, y0, width, height)

Define a rectangle of size widthxheight with its top left corner at the point (x, y).

source
Compose.rectangleFunction.
rectangle(x0s, y0s, widths, heights)

Arguments can be passed in arrays in order to perform multiple drawing operations at once.

source
Compose.rectangleMethod.
rectangle()

Define a rectangle that fills the current context completely.

source
Compose.textFunction.
text(x, y, value [,halign::HAlignment [,valign::VAlignment [,rot::Rotation]]])

Draw the text value at the position (x,y) relative to the current context.

The default alignment of the text is hleft vbottom. The vertical and horizontal alignment is specified by passing hleft, hcenter or hright and vtop, vcenter or vbottom as values for halgin and valgin respectively.

source
Compose.textFunction.
text(xs, ys, values [,haligns::HAlignment [,valigns::VAlignment [,rots::Rotation]]])

Arguments can be passed in arrays in order to perform multiple drawing operations at once.

source

A form batch is a vectorized form with n primitives transformed into a simpler representation: one primitive repositioned n times.

On certain backends this leads to more efficient drawing. For example, SVG can be shortened by using <def> and <use> tags, and raster graphics can render the form primitive to a back buffer and blit it into place for faster drawing.

Batching is an optimization transform that happens at draw time. There's currently no mechanism to manually batch. E.g. contexts cannot have FormBatch children.

source
Compose.batchMethod.

Attempt to batch a form. Return a Nullable{FormBatch} which is null if the Form could not be batched, and non-null if the original form can be replaced with teh resulting FormBatch.

source
Compose.canbatchMethod.

Some backends can more efficiently draw forms by batching. If so, they shuld define a similar method that returns true.

source

Count the number of unique primitives in a property, stopping when max_count is exceeded.

source

Remove and return vector forms and vector properties from the Context.

source

Produce a new array of offsets in which near duplicate values have been removed.

source

Attempt to transform a tree into an equivalent tree that can more easily be batched.

What this does is look for patterns in which a long vector form is accompanied by a large vector property that has a relatively small number of unique values. If there are n unique values, we can split it into n contexts, each with a shorter vector form and only scalar properties.

source