mirror of
https://github.com/gonum/gonum.git
synced 2025-10-11 18:10:10 +08:00
graph/encoding/dot: store graph DOT ID if present (#237)
Add round trip test case for graph DOT ID.
This commit is contained in:
@@ -54,6 +54,9 @@ func copyGraph(dst encoding.Builder, src *ast.Graph) (err error) {
|
||||
directed: src.Directed,
|
||||
ids: make(map[string]graph.Node),
|
||||
}
|
||||
if dst, ok := dst.(DOTIDSetter); ok {
|
||||
dst.SetDOTID(src.ID)
|
||||
}
|
||||
if a, ok := dst.(AttributeSetters); ok {
|
||||
gen.graphAttr, gen.nodeAttr, gen.edgeAttr = a.DOTAttributeSetters()
|
||||
}
|
||||
|
Reference in New Issue
Block a user