[Haskell-cafe] Canonical Graphviz code

Ivan Lazar Miljenovic ivan.miljenovic at gmail.com
Tue Jul 6 18:53:26 EDT 2010

Felipe Lessa <felipe.lessa at gmail.com> writes:

> On Tue, Jul 6, 2010 at 7:15 PM, Ivan Lazar Miljenovic
> <ivan.miljenovic at gmail.com> wrote:
>> As such, I probably won't be implementing the canonical form stuff any
>> time soon in graphviz, and might need to examine Graphviz's source code
>> to compare it and ensure that it's at least similar :s
> I'm sorry for being silly, but what's the motivation of having this
> canonic form? =)

A few things come to mind:

* Easier to reason about, as the various items of different types
  (global attributes, subgraphs/clusters, nodes and edges) are grouped
  together rather than being all mixed up; compare the layout of
  Data.GraphViz.Types.DotGraph to

* A non-canonical graph can have the same node specified several times
  with different attributes; in the canonical form they are all merged
  into one (see the `a' node in the examples in my original email).

* Less ambiguity: in the email I just sent out, I had a graph which I
  expected `a' to be outside the box and `b' to be inside it; the
  canonical representation of this explicitly puts both of them inside
  the cluster such that that ambiguity is no longer present.

Ivan Lazar Miljenovic
Ivan.Miljenovic at gmail.com

More information about the Haskell-Cafe mailing list