• Resolved JoachimDurchholz

    (@joachimdurchholz)


    Using this:

    digraph hierarchy {
    size="5,5"
    node[shape=record,style=filled,fillcolor=gray95]
    edge[dir=back, arrowtail=empty]
    
    2[label = "{AbstractSuffixTree|+ text\n+ root|...}"]
    3[label = "{SimpleSuffixTree|...| + constructTree()\l...}"]
    4[label = "{CompactSuffixTree|...| + compactNodes()\l...}"]
    5[label = "{SuffixTreeNode|...|+ addSuffix(...)\l...}"]
    6[label = "{SuffixTreeEdge|...|+ compactLabel(...)\l...}"]
    
    2->3
    2->4
    5->5[constraint=false, arrowtail=odiamond]
    4->3[constraint=false, arrowtail=odiamond]
    2->5[constraint=false, arrowtail=odiamond]
    5->6[arrowtail=odiamond]
    }

    Putting the dot source inside hierarchy.dot and running dot -O -Tsvg hierarchy.dot works just fine, putting it between [graphviz] markers gives me this:

    Error generating Graphviz image
    
    Graphviz cannot generate graph
    Warning: : syntax error in line 2 near ']'

    I have no way of finding out what’s wrong.
    Well okay removing the size parameter gave me another error, so I can find out problems by commenting out individual lines. Actually I’d be okay with that if errors happened just occasionally, but I’m not okay if I need to do this multiple times with no indication how many more problems of that kind mind be waiting for me.

    It would be nice if the plugin printed the full path name of the generated .dot file and the command-line invokation it used.

    The plugin page shows the generated sample graph, and pasting the code there to the WP page works just fine, too.

    Using TFO-Graphviz 1.12, which is accessing Graphviz through graphviz path /usr/bin/dot. Graphviz itself is dot - graphviz version 2.36.0 (20140111.2315).

    As things are, my only way forward is to generate the graphs offline.
    That will also fix the lack of svg support.

    https://www.ads-software.com/plugins/tfo-graphviz/

Viewing 4 replies - 16 through 19 (of 19 total)
  • Plugin Author Chris Luke

    (@chrisy)

    Okay, I just pushed 1.14 which includes the better way to not-mangle characters. It also includes an option to never emit JavaScript. ??

    As for an example image where this goes awry, look at https://blog.flirble.org/2015/11/15/adding-svg-support-tfo-graphviz/ . The last two graphs both have an image map, the only difference between them is that one is scaled to be larger – if you hover your mouse over the nodes you’ll notice that on the larger image the URLs don’t match the nodes, especially near the bottom of the image, but they do on the un-scaled one.

    Thread Starter JoachimDurchholz

    (@joachimdurchholz)

    Telling the browser to use a different scaling factor via Ctrl-Plus and Ctrl-Minus actually works, so that rules out the easy “it’s a browser bug” explanation.

    I read up on coordinates in the HTML specs, and found that coordinates are to be given in pixels, not imagemap percentages. No hints of scaling for an <img width=…> setting either, so browser behaviour seems to be conformant with the spec.
    So there’s nothing that Graphviz can do, since it doesn’t see HTML tags and attributes, just .dot files and command-line parameters.

    I don’t see a way to tell Graphviz that it should anticipate a different image width for generating the image map. The way to go seems to specify a different size= attribute in the dot source, see also dpi=, page=, and ratio= in https://www.graphviz.org/doc/info/attrs.html .

    This all amounts to saying that saying [graphviz width=…] cannot ever work properly, the image needs to be included at its default size.
    Maybe you want to deprecate width= on [graphviz] – I didn’t find that parameter documente on the plugin page so maybe it’s easy to remove.

    Take this all with a grain of salt, time’s running out for today so I couldn’t do any experimentation and verification with these findings. Maybe I’ll find more time tomorrow in the evening.
    Hope this all helps.

    Thread Starter JoachimDurchholz

    (@joachimdurchholz)

    1.14 works now, including for French and German.
    Thanks!

    (I haven’t tested the resizing stuff. I’m not seeing any Javascript, so I’m happy with that.)

    Plugin Author Chris Luke

    (@chrisy)

    Great, thanks for the feedback!

Viewing 4 replies - 16 through 19 (of 19 total)
  • The topic ‘Doesn't work, no idea why’ is closed to new replies.