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);
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: