graph/encoding/dot: add multigraph serialization and deserialization support
Created by: 32bitkid
This should resolve issue #396, in the way that has been discussed there. This change introduces a new pair of MarshalMulti()
and UnmarshalMulti()
functions, both which take graph.Multigraph
. Please take a look.
There are a couple outstanding questions on this particular implementation:
-
The arguments for
Marshal()
have remained unchanged. However, the new functionMarshalMulti()
does not include thestrict
argument, because it doesn't really make any sense in that context. But, I wonder ifMarshal()
should always emit a strict DOT graph, because thats what it really represents. However, that might be too big of a breaking change here. -
In the
multiprinter.print()
function, I need to iterate lines, which I do vialines := graph.LinesOf(g.Lines(nid, tid))
, I'm not sure if I need to explicitly sort the lines here to get a stable output, like one does a few lines up onNodesOf()
, and if so, then what would be the preferred sorting strategy to use here?
If the approach looks worth moving forward, then I'll fill in some more testing coverage before finalizing the PR.
Thanks!