hello graphwizards,
I have this dotfile in my repo. the idea is to describe a grammar in a chomsky tree way. I tested 2 strategies but none of them looks good. As the final output will be a part of a research paper, we have to make it looking good. I consider writing a wrapper over pic to do so but I’d really love to keep it the graphviz way.
Anyone can help on it ?
// Ideal case should be
// digraph {
// { node [shape=plain] rank=same
// Alain conduit la voiture
// }
// nc[label="nom\ncommun"]
// sujet -> Alain
// verbe -> conduit
// article -> la
// nc -> voiture
// complement -> {article nc}
// phrase -> { rank=same; sujet verbe complement }
// }
// but rank=same doesn't guaranty the order and this seems to be
// a known possible improvement:
// https://forum.graphviz.org/t/how-to-arrange-node-in-order/1303/2
// so I used record but there are 2 drawbacks
// * the tree isn't a tree anymore. I mean: in the first version,
// edges where vertical, this looks very good. Not anymore with
// the record because graphviz lost the ability to position the
// nodes to do so.
// * I would like to get a grid of the record boxes
digraph {
texte[shape=record,label="<s>Alain|<v>conduit|<a>la|<nc>voiture"]
nc[label="nom\ncommun"]
sujet -> texte:s
verbe -> texte:v
article -> texte:a
nc -> texte:nc:n
complement -> {article nc}
phrase -> { rank=same; sujet verbe complement }
}