auto a = aes!(int, "y", int, "x")(1, 2);
assertEqual( a.y, 1 );
assertEqual( a.x, 2 );
auto a1 = aes!("y", "x")(1, 2);
assertEqual( a1.y, 1 );
assertEqual( a1.x, 2 );
auto a2 = aes!("y")(1);
assertEqual( a2.y, 1 );
import std.range : zip;
import std.algorithm : map;
auto xs = [0,1];
auto ys = [2,3];
auto points = xs.zip(ys).map!((t) => aes!("x", "y")(t[0], t[1]));
assertEqual(points.front.x, 0);
assertEqual(points.front.y, 2);
points.popFront;
assertEqual(points.front.x, 1);
assertEqual(points.front.y, 3);
Map data fields to "aesthetic" fields understood by the ggplotd geom functions
The most commonly used aesthetic fields in ggplotd are "x" and "y". Which further data fields are used/required depends on the geom function being called.
Other common fields:
In practice aes is an alias for std.typecons.tuple.