The OpenD Programming Language

Aes

Aes is used to store and access data for plotting

Aes is an InputRange, with named Tuples as the ElementType. The names refer to certain fields, such as x, y, colour etc.

The fields commonly used are data fields, such as "x" and "y". Which data fields are required depends on the geom function being called.

Other common fields:

  • "label": Text labels (string)
  • "colour": Identifier for the colour. In general data points with different colour ids get different colours. This can be almost any type. You can also specify the colour by name or cairo.Color type if you want to specify an exact colour (any type that isNumeric, cairo.Color.RGB(A), or can be converted to string)
  • "size": Gives the relative size of points/lineWidth etc.
  • "angle": Angle of printed labels in radians (double)
  • "alpha": Alpha value of the drawn object (double)
  • "mask": Mask the area outside the axes. Prevents you from drawing outside of the area (bool)
  • "fill": Whether to fill the object/holds the alpha value to fill with (double).

Examples

Basic Aes usage

auto aes = Aes!(double[], "x", double[], "y", string[], "colour")([0.0, 1],
    [2, 1.0], ["white", "white2"]);

aes.popFront;
assertEqual(aes.front.y, 1);
assertEqual(aes.front.colour, "white2");

auto aes2 = Aes!(double[], "x", double[], "y")([0.0, 1], [2.0, 1]);
assertEqual(aes2.front.y, 2);

import std.range : repeat;

auto xs = repeat(0);
auto aes3 = Aes!(typeof(xs), "x", double[], "y")(xs, [2.0, 1]);

assertEqual(aes3.front.x, 0);
aes3.popFront;
aes3.popFront;
assertEqual(aes3.empty, true);

Meta