The code below makes the edge red, but does not add the label "foo", as it does on the example posted https://tikz.dev/tikz-graphs
Is there something about PG that requires a different syntax to label the edge?
DOCUMENT();
loadMacros('PGstandard.pl', 'PGML.pl',"MathObjects.pl",
"parserFunction.pl", 'PGtikz.pl','PGcourse.pl');
# whether or not to graph this edge
$bd = random(0,1);
# Create the graph
$graph_image = createTikZImage();
$graph_image->tikzLibraries("graphs", "quotes");
$graph_image->BEGIN_TIKZ
\node (a) at (0,0) {\(S_1\)};
\node (b) at (0,4) {\(S_2\)};
\node (c) at (3,0) {\(D_1\)};
\node (d) at (3,4) {\(D_2\)};
\graph { (a) -> (c);}
\graph { (a) -> [red, "foo"] (d);}
\graph { (b) -> (c);}
\ifdim 1 pt = $bd pt\relax \graph {(b) -> (d);};\fi
END_TIKZ
BEGIN_PGML
Here's a graph
>> [@ image($graph_image, width => 300, tex_size => 450) @]* <<
END_PGML
ENDDOCUMENT();