defproc addgroup($color=black, $target) {
    edge [color=$color];
    A~$$->$target:: \c($color) 1st;
    B~$$->$target:: \c($color) 2nd;
    C~$$->$target:: \c($color) 3rd;
}

graph {
    composite;
    replay addgroup(, composite);
    replay addgroup(blue, composite);
    replay addgroup(yellow, composite);
};