Layouts

A Layout determines how data is mapped to graphical output. For example, a Scatter represents each data point as a small graphical mark known as a Glyph, and is used to create scatter plots and bubble plots.

Line

The Line layout draws a straight line between each data point. The data is drawn in the order it is received, so you should probably ensure the data is sorted before it is drawn.

Curve

The Curve layout interpolates a smooth curve that passes through each data point. Like Line, the data is drawn in the order it is received, so you should probably ensure the data is sorted before it is drawn.

The curve is produced using the Catmul-Rom method, which is controlled by a tension parameter that determines how closely the interpolated curve follows the data.

Scatter

The Scatter layout draws each data point as a small graphical mark known as a Glyph.

The Glyph accepts a Double value, which is interpreted as the size of the data point being drawn. This allows the Glyph to vary in relation to the size, for example by creating a larger output when this value is larger. This Double value is in turn determined by the toSize parameter of Scatter, which can be changed in the usual way using the withToSize builder method. The default toSize ignores it's input and returns 5.0.