Module Hugin_kit.Symbol
Symbols.
A symbol is a marker shape: the circle, square or star a dot mark draws at each point.
Symbols are sized by their ink: a symbol of size a lays as much ink as the circle of area a painted the same way. Filled, the region it encloses has area a; stroked, its outline is as long as that circle's circumference, 2 √(π a), so that at one stroke width it lays as much ink as the circle. plus, times and asterisk enclose nothing and are sized by length however they are painted. A symbol keeps its shape at every size: the symbol of size a is the symbol of size 1. scaled by √a, so a figure can draw one outline and stamp it at many sizes.
Every symbol is symmetric under a rotation about the origin, so the centroids of the region it encloses and of its outline both lie at the origin: a triangle sits on its data point rather than above it. The plane is the one of hugin.gg, y pointing down, so a symbol that points up points towards negative y.
Some symbols are designed to be filled (filled), the others to be stroked (stroked).
Reference: Mike Bostock. d3-shape symbols, from which the shapes, the two sets and the sizing by ink are taken.
Symbols
type tThe type for symbols.
diamond is two equilateral triangles joined by a side parallel to the x axis: a rhombus standing on a corner, taller than wide.
cross is a Greek cross: five equal squares, one at the centre and one on each of its sides.
star is a regular five-pointed star pointing up, its inner corners on the lines that join its points.
wye is a Y: an equilateral triangle with a square on each of its sides, one of them below it.
plus is two strokes of equal length crossing at their middles, one parallel to each axis.
asterisk is three strokes of equal length crossing at their middles, a sixth of a turn apart, one parallel to the y axis.
Sets
Ordered sets of symbols for categories, one for marks that fill their symbols and one for marks that stroke them.
Drawing
The type for the ways a symbol is painted, which decide how it is sized: `Fill by the area it encloses, `Stroke by the length of its outline.
val path : paint -> float -> t -> Hugin_gg.Path.tpath paint a s is the outline of s at size a painted with paint, its centre at the origin. It is path paint 1. s scaled by √a, up to rounding. Closed outlines are closed subpaths that turn clockwise on screen, as Hugin_gg.Path.rect and Hugin_gg.Path.circle do, and the circle is the one Hugin_gg.Path.circle draws, whose area and length are those of a true circle up to the error of its arcs. plus, times and asterisk are open subpaths of one segment per stroke, so filled they paint nothing. path paint 0. s has every point at the origin.
Raises Invalid_argument if a is negative or not finite.