dagrejs / graphlib-dot

A DOT language parser and writer for graphlib
MIT License
224 stars 42 forks source link

Support for { rank=plop; x, y } #36

Open FGRibreau opened 6 years ago

FGRibreau commented 6 years ago

With the following input:

graph {
    rankdir=LR;
    a -- { b c d }; b -- { c e }; c -- { e f }; d -- { f g }; e -- h;
    f -- { h i j g }; g -- k; h -- { o l }; i -- { l m j }; j -- { m n k };
    k -- { n r }; l -- { o m }; m -- { o p n }; n -- { q r };
    o -- { s p }; p -- { s t q }; q -- { t r }; r -- t; s -- z; t -- z;
    { rank=same; b, c, d }
    { rank=same; e, f, g }
    { rank=same; h, i, j, k }
    { rank=same; l, m, n }
    { rank=same; o, p, q, r }
    { rank=same; s, t }
}

graphlib-dot does not seem to be able to parse it and instead throws Expected "--", "->", ":", ";", "=", "[", "edge", "graph", "node", "subgraph", "{", "}", comment, identifier or whitespace but "," found..

But it should work:

chart

explosivose commented 5 years ago

I've discovered the same problem but in trying to produce this kind of ranking as opposed to parsing it