Add graph2d directive