Hi Dan,
Thank you for your hints.
Still, it seems []attr is not enough.
Users also want to parse the corresponding nodes to the subgraph for practical use.
To parse them, we should assume the Builder implements Subgrapher (to keep consistency with encode.go).
In that case, a generator needs not only []attr but a stack of subgraphs ([]graph.Graph).
The subgraphs need to be stored because Subgrapher.Subgraph is called on pushSubgraph to generate AttributeSetters for the subgraph and is also required up to popSubgraph to add subgraph nodes.
It also means there can be two kinds of subgraphs: user-defined graph.Graph to be parsed (for Subgrapher case) and simple node sets to represent edge vertex (for non-Subgrapher case).
These might be better unified into graph.Graph.
Satoru
Hi Dan,
I tried to implement it on my own idea, but the code changes diverged, and there seemed no end in sight.
To make it, we need to sort out many potential specifications on the conversion from DOT to gonum.graph.
Now I understand that it is difficult to fully support DOT expressions with graph.Builder completely.
I plan to use other DOT parser tools on golang and then convert it to gonum.graph with ad-hoc code for my use case.
Sorry that I cannot contribute to the improvement of gonum.
Thank you again for your help.
Satoru